archive_acl_clear:
  129|   311k|{
  130|   311k|	struct archive_acl_entry *ap;
  131|       |
  132|   312k|	while (acl->acl_head != NULL) {
  ------------------
  |  Branch (132:9): [True: 917, False: 311k]
  ------------------
  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|   311k|	free(acl->acl_text_w);
  139|   311k|	acl->acl_text_w = NULL;
  140|   311k|	free(acl->acl_text);
  141|   311k|	acl->acl_text = NULL;
  142|       |	acl->acl_p = NULL;
  143|   311k|	acl->acl_types = 0;
  144|   311k|	acl->acl_state = 0; /* Not counting. */
  145|   311k|}
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|  9.41k|{
   94|       |#if defined(NATIVE_LITTLE_ENDIAN)
   95|       |  memcpy(dst, &w, sizeof w);
   96|       |#else
   97|  9.41k|  uint8_t *p = ( uint8_t * )dst;
   98|  9.41k|  p[0] = (uint8_t)(w >>  0);
   99|  9.41k|  p[1] = (uint8_t)(w >>  8);
  100|  9.41k|  p[2] = (uint8_t)(w >> 16);
  101|  9.41k|  p[3] = (uint8_t)(w >> 24);
  102|  9.41k|#endif
  103|  9.41k|}
archive_blake2sp_ref.c:store16:
   82|  4.70k|{
   83|       |#if defined(NATIVE_LITTLE_ENDIAN)
   84|       |  memcpy(dst, &w, sizeof w);
   85|       |#else
   86|  4.70k|  uint8_t *p = ( uint8_t * )dst;
   87|  4.70k|  *p++ = ( uint8_t )w; w >>= 8;
   88|  4.70k|  *p++ = ( uint8_t )w;
   89|  4.70k|#endif
   90|  4.70k|}
archive_blake2s_ref.c:load32:
   35|  39.2k|{
   36|       |#if defined(NATIVE_LITTLE_ENDIAN)
   37|       |  uint32_t w;
   38|       |  memcpy(&w, src, sizeof w);
   39|       |  return w;
   40|       |#else
   41|  39.2k|  const uint8_t *p = ( const uint8_t * )src;
   42|  39.2k|  return (( uint32_t )( p[0] ) <<  0) |
   43|  39.2k|         (( uint32_t )( p[1] ) <<  8) |
   44|  39.2k|         (( uint32_t )( p[2] ) << 16) |
   45|  39.2k|         (( uint32_t )( p[3] ) << 24) ;
   46|  39.2k|#endif
   47|  39.2k|}
archive_blake2s_ref.c:store32:
   93|    144|{
   94|       |#if defined(NATIVE_LITTLE_ENDIAN)
   95|       |  memcpy(dst, &w, sizeof w);
   96|       |#else
   97|    144|  uint8_t *p = ( uint8_t * )dst;
   98|    144|  p[0] = (uint8_t)(w >>  0);
   99|    144|  p[1] = (uint8_t)(w >>  8);
  100|    144|  p[2] = (uint8_t)(w >> 16);
  101|    144|  p[3] = (uint8_t)(w >> 24);
  102|    144|#endif
  103|    144|}
archive_blake2s_ref.c:secure_zero_memory:
  156|     18|{
  157|     18|  static void *(__LA_LIBC_CC *const volatile memset_v)(void *, int, size_t) = &memset;
  158|     18|  memset_v(v, 0, n);
  159|     18|}
archive_blake2s_ref.c:rotr32:
  145|  31.6k|{
  146|  31.6k|  return ( w >> c ) | ( w << ( 32 - c ) );
  147|  31.6k|}

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

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

__archive_check_magic:
  136|   690k|{
  137|   690k|	char states1[64];
  138|   690k|	char states2[64];
  139|   690k|	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|   690k|	handle_type = archive_handle_type_name(a->magic);
  147|       |
  148|   690k|	if (!handle_type) {
  ------------------
  |  Branch (148:6): [True: 0, False: 690k]
  ------------------
  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|   690k|	if (a->magic != magic) {
  ------------------
  |  Branch (155:6): [True: 0, False: 690k]
  ------------------
  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|   690k|	if ((a->state & state) == 0) {
  ------------------
  |  Branch (165:6): [True: 2.44k, False: 688k]
  ------------------
  166|       |		/* If we're already FATAL, don't overwrite the error. */
  167|  2.44k|		if (a->state != ARCHIVE_STATE_FATAL) {
  ------------------
  |  |   69|  2.44k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  |  Branch (167:7): [True: 312, False: 2.13k]
  ------------------
  168|    312|			write_all_states(states1, a->state);
  169|    312|			write_all_states(states2, state);
  170|    312|			archive_set_error(a, -1,
  171|    312|			    "INTERNAL ERROR: Function '%s' invoked with"
  172|    312|			    " archive structure in state '%s',"
  173|    312|			    " should be in state '%s'",
  174|    312|			    function,
  175|    312|			    states1,
  176|    312|			    states2);
  177|    312|		}
  178|  2.44k|		a->state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|  2.44k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  179|  2.44k|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|  2.44k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  180|  2.44k|	}
  181|   688k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|   688k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  182|   690k|}
archive_check_magic.c:archive_handle_type_name:
   97|   690k|{
   98|   690k|	switch (m) {
   99|      0|	case ARCHIVE_WRITE_MAGIC:	return ("archive_write");
  ------------------
  |  |   58|      0|#define	ARCHIVE_WRITE_MAGIC	(0xb0c5c0deU)
  ------------------
  |  Branch (99:2): [True: 0, False: 690k]
  ------------------
  100|   690k|	case ARCHIVE_READ_MAGIC:	return ("archive_read");
  ------------------
  |  |   59|   690k|#define	ARCHIVE_READ_MAGIC	(0xdeb0c5U)
  ------------------
  |  Branch (100:2): [True: 690k, 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: 690k]
  ------------------
  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: 690k]
  ------------------
  103|      0|	case ARCHIVE_MATCH_MAGIC:	return ("archive_match");
  ------------------
  |  |   62|      0|#define	ARCHIVE_MATCH_MAGIC	(0xcad11c9U)
  ------------------
  |  Branch (103:2): [True: 0, False: 690k]
  ------------------
  104|      0|	default:			return NULL;
  ------------------
  |  Branch (104:2): [True: 0, False: 690k]
  ------------------
  105|   690k|	}
  106|   690k|}
archive_check_magic.c:write_all_states:
  110|    624|{
  111|    624|	unsigned int lowbit;
  112|       |
  113|    624|	*buff = '\0';
  114|       |
  115|       |	/* A trick for computing the lowest set bit. */
  116|  1.24k|	while ((lowbit = states & (1 + ~states)) != 0) {
  ------------------
  |  Branch (116:9): [True: 624, False: 624]
  ------------------
  117|    624|		states &= ~lowbit;		/* Clear the low bit. */
  118|    624|		strcat(buff, state_name(lowbit));
  119|    624|		if (states != 0)
  ------------------
  |  Branch (119:7): [True: 0, False: 624]
  ------------------
  120|      0|			strcat(buff, "/");
  121|    624|	}
  122|    624|}
archive_check_magic.c:state_name:
   83|    624|{
   84|    624|	switch (s) {
   85|      0|	case ARCHIVE_STATE_NEW:		return ("new");
  ------------------
  |  |   64|      0|#define	ARCHIVE_STATE_NEW	1U
  ------------------
  |  Branch (85:2): [True: 0, False: 624]
  ------------------
   86|      1|	case ARCHIVE_STATE_HEADER:	return ("header");
  ------------------
  |  |   65|      1|#define	ARCHIVE_STATE_HEADER	2U
  ------------------
  |  Branch (86:2): [True: 1, False: 623]
  ------------------
   87|    312|	case ARCHIVE_STATE_DATA:	return ("data");
  ------------------
  |  |   66|    312|#define	ARCHIVE_STATE_DATA	4U
  ------------------
  |  Branch (87:2): [True: 312, False: 312]
  ------------------
   88|    311|	case ARCHIVE_STATE_EOF:		return ("eof");
  ------------------
  |  |   67|    311|#define	ARCHIVE_STATE_EOF	0x10U
  ------------------
  |  Branch (88:2): [True: 311, False: 313]
  ------------------
   89|      0|	case ARCHIVE_STATE_CLOSED:	return ("closed");
  ------------------
  |  |   68|      0|#define	ARCHIVE_STATE_CLOSED	0x20U
  ------------------
  |  Branch (89:2): [True: 0, False: 624]
  ------------------
   90|      0|	case ARCHIVE_STATE_FATAL:	return ("fatal");
  ------------------
  |  |   69|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  |  Branch (90:2): [True: 0, False: 624]
  ------------------
   91|      0|	default:			return ("??");
  ------------------
  |  Branch (91:2): [True: 0, False: 624]
  ------------------
   92|    624|	}
   93|    624|}

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:
  144|    161|{
  145|    161|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|    161|	unsigned int p3 = p[3];
  151|    161|	unsigned int p2 = p[2];
  152|    161|	unsigned int p1 = p[1];
  153|    161|	unsigned int p0 = p[0];
  154|       |
  155|    161|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|    161|}
archive_read_support_filter_lz4.c:archive_le32dec:
  144|  6.44k|{
  145|  6.44k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  6.44k|	unsigned int p3 = p[3];
  151|  6.44k|	unsigned int p2 = p[2];
  152|  6.44k|	unsigned int p1 = p[1];
  153|  6.44k|	unsigned int p0 = p[0];
  154|       |
  155|  6.44k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  6.44k|}
archive_read_support_filter_rpm.c:archive_be32dec:
   91|    158|{
   92|    158|	unsigned char const *p = (unsigned char const *)pp;
   93|       |
   94|       |	/* Store into unsigned temporaries before left shifting, to avoid
   95|       |	promotion to signed int and then left shifting into the sign bit,
   96|       |	which is undefined behaviour. */
   97|    158|	unsigned int p3 = p[3];
   98|    158|	unsigned int p2 = p[2];
   99|    158|	unsigned int p1 = p[1];
  100|    158|	unsigned int p0 = p[0];
  101|       |
  102|    158|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|    158|}
archive_read_support_filter_xz.c:archive_le32enc:
  216|      2|{
  217|      2|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|      2|	p[0] = u & 0xff;
  220|      2|	p[1] = (u >> 8) & 0xff;
  221|      2|	p[2] = (u >> 16) & 0xff;
  222|      2|	p[3] = (u >> 24) & 0xff;
  223|      2|}
archive_read_support_filter_xz.c:archive_le32dec:
  144|  8.17k|{
  145|  8.17k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  8.17k|	unsigned int p3 = p[3];
  151|  8.17k|	unsigned int p2 = p[2];
  152|  8.17k|	unsigned int p1 = p[1];
  153|  8.17k|	unsigned int p0 = p[0];
  154|       |
  155|  8.17k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  8.17k|}
archive_read_support_filter_xz.c:archive_le64dec:
  160|  2.72k|{
  161|  2.72k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  2.72k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  2.72k|}
archive_read_support_filter_zstd.c:archive_le32dec:
  144|  2.80k|{
  145|  2.80k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  2.80k|	unsigned int p3 = p[3];
  151|  2.80k|	unsigned int p2 = p[2];
  152|  2.80k|	unsigned int p1 = p[1];
  153|  2.80k|	unsigned int p0 = p[0];
  154|       |
  155|  2.80k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  2.80k|}
archive_read_support_format_cab.c:archive_le32dec:
  144|   144k|{
  145|   144k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|   144k|	unsigned int p3 = p[3];
  151|   144k|	unsigned int p2 = p[2];
  152|   144k|	unsigned int p1 = p[1];
  153|   144k|	unsigned int p0 = p[0];
  154|       |
  155|   144k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|   144k|}
archive_read_support_format_cab.c:archive_le16dec:
  115|  2.44k|{
  116|  2.44k|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|  2.44k|	unsigned int p1 = p[1];
  122|  2.44k|	unsigned int p0 = p[0];
  123|       |
  124|  2.44k|	return ((p1 << 8) | p0);
  125|  2.44k|}
archive_read_support_format_cab.c:archive_le16enc:
  197|    910|{
  198|    910|	unsigned char *p = (unsigned char *)pp;
  199|       |
  200|    910|	p[0] = u & 0xff;
  201|    910|	p[1] = (u >> 8) & 0xff;
  202|    910|}
archive_read_support_format_cab.c:archive_le32enc:
  216|     48|{
  217|     48|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|     48|	p[0] = u & 0xff;
  220|     48|	p[1] = (u >> 8) & 0xff;
  221|     48|	p[2] = (u >> 16) & 0xff;
  222|     48|	p[3] = (u >> 24) & 0xff;
  223|     48|}
archive_read_support_format_cpio.c:archive_be16dec:
   61|  4.64k|{
   62|  4.64k|	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|  4.64k|	unsigned int p1 = p[1];
   68|  4.64k|	unsigned int p0 = p[0];
   69|       |
   70|  4.64k|	return ((p0 << 8) | p1);
   71|  4.64k|}
archive_read_support_format_cpio.c:archive_le16dec:
  115|  11.1k|{
  116|  11.1k|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|  11.1k|	unsigned int p1 = p[1];
  122|  11.1k|	unsigned int p0 = p[0];
  123|       |
  124|  11.1k|	return ((p1 << 8) | p0);
  125|  11.1k|}
archive_read_support_format_iso9660.c:archive_le32dec:
  144|  3.32k|{
  145|  3.32k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  3.32k|	unsigned int p3 = p[3];
  151|  3.32k|	unsigned int p2 = p[2];
  152|  3.32k|	unsigned int p1 = p[1];
  153|  3.32k|	unsigned int p0 = p[0];
  154|       |
  155|  3.32k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  3.32k|}
archive_read_support_format_iso9660.c:archive_le16dec:
  115|    464|{
  116|    464|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|    464|	unsigned int p1 = p[1];
  122|    464|	unsigned int p0 = p[0];
  123|       |
  124|    464|	return ((p1 << 8) | p0);
  125|    464|}
archive_read_support_format_iso9660.c:archive_be32dec:
   91|    428|{
   92|    428|	unsigned char const *p = (unsigned char const *)pp;
   93|       |
   94|       |	/* Store into unsigned temporaries before left shifting, to avoid
   95|       |	promotion to signed int and then left shifting into the sign bit,
   96|       |	which is undefined behaviour. */
   97|    428|	unsigned int p3 = p[3];
   98|    428|	unsigned int p2 = p[2];
   99|    428|	unsigned int p1 = p[1];
  100|    428|	unsigned int p0 = p[0];
  101|       |
  102|    428|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|    428|}
archive_read_support_format_lha.c:archive_le32dec:
  144|  8.60k|{
  145|  8.60k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  8.60k|	unsigned int p3 = p[3];
  151|  8.60k|	unsigned int p2 = p[2];
  152|  8.60k|	unsigned int p1 = p[1];
  153|  8.60k|	unsigned int p0 = p[0];
  154|       |
  155|  8.60k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  8.60k|}
archive_read_support_format_lha.c:archive_le16dec:
  115|  18.1k|{
  116|  18.1k|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|  18.1k|	unsigned int p1 = p[1];
  122|  18.1k|	unsigned int p0 = p[0];
  123|       |
  124|  18.1k|	return ((p1 << 8) | p0);
  125|  18.1k|}
archive_read_support_format_rar.c:archive_le16dec:
  115|  9.58k|{
  116|  9.58k|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|  9.58k|	unsigned int p1 = p[1];
  122|  9.58k|	unsigned int p0 = p[0];
  123|       |
  124|  9.58k|	return ((p1 << 8) | p0);
  125|  9.58k|}
archive_read_support_format_rar.c:archive_le64dec:
  160|     84|{
  161|     84|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|     84|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|     84|}
archive_read_support_format_rar.c:archive_le32dec:
  144|  8.95k|{
  145|  8.95k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  8.95k|	unsigned int p3 = p[3];
  151|  8.95k|	unsigned int p2 = p[2];
  152|  8.95k|	unsigned int p1 = p[1];
  153|  8.95k|	unsigned int p0 = p[0];
  154|       |
  155|  8.95k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  8.95k|}
archive_read_support_format_rar.c:archive_le32enc:
  216|   114k|{
  217|   114k|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|   114k|	p[0] = u & 0xff;
  220|   114k|	p[1] = (u >> 8) & 0xff;
  221|   114k|	p[2] = (u >> 16) & 0xff;
  222|   114k|	p[3] = (u >> 24) & 0xff;
  223|   114k|}
archive_read_support_format_rar5.c:archive_le32dec:
  144|  12.0k|{
  145|  12.0k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  12.0k|	unsigned int p3 = p[3];
  151|  12.0k|	unsigned int p2 = p[2];
  152|  12.0k|	unsigned int p1 = p[1];
  153|  12.0k|	unsigned int p0 = p[0];
  154|       |
  155|  12.0k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  12.0k|}
archive_read_support_format_rar5.c:archive_le64dec:
  160|    264|{
  161|    264|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|    264|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|    264|}
archive_read_support_format_rar5.c:archive_le16dec:
  115|    194|{
  116|    194|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|    194|	unsigned int p1 = p[1];
  122|    194|	unsigned int p0 = p[0];
  123|       |
  124|    194|	return ((p1 << 8) | p0);
  125|    194|}
archive_read_support_format_rar5.c:archive_be24dec:
   75|  58.6k|{
   76|  58.6k|	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|  58.6k|	unsigned int p2 = p[2];
   82|  58.6k|	unsigned int p1 = p[1];
   83|  58.6k|	unsigned int p0 = p[0];
   84|       |
   85|  58.6k|	return ((p0 << 16) | (p1 << 8) | p2);
   86|  58.6k|}
archive_read_support_format_rar5.c:archive_be32dec:
   91|    100|{
   92|    100|	unsigned char const *p = (unsigned char const *)pp;
   93|       |
   94|       |	/* Store into unsigned temporaries before left shifting, to avoid
   95|       |	promotion to signed int and then left shifting into the sign bit,
   96|       |	which is undefined behaviour. */
   97|    100|	unsigned int p3 = p[3];
   98|    100|	unsigned int p2 = p[2];
   99|    100|	unsigned int p1 = p[1];
  100|    100|	unsigned int p0 = p[0];
  101|       |
  102|    100|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|    100|}
archive_read_support_format_xar.c:archive_be32dec:
   91|  3.20k|{
   92|  3.20k|	unsigned char const *p = (unsigned char const *)pp;
   93|       |
   94|       |	/* Store into unsigned temporaries before left shifting, to avoid
   95|       |	promotion to signed int and then left shifting into the sign bit,
   96|       |	which is undefined behaviour. */
   97|  3.20k|	unsigned int p3 = p[3];
   98|  3.20k|	unsigned int p2 = p[2];
   99|  3.20k|	unsigned int p1 = p[1];
  100|  3.20k|	unsigned int p0 = p[0];
  101|       |
  102|  3.20k|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|  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:
  107|    220|{
  108|    220|	unsigned char const *p = (unsigned char const *)pp;
  109|       |
  110|    220|	return (((uint64_t)archive_be32dec(p) << 32) | archive_be32dec(p + 4));
  111|    220|}
archive_read_support_format_zip.c:archive_le16dec:
  115|   220k|{
  116|   220k|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|   220k|	unsigned int p1 = p[1];
  122|   220k|	unsigned int p0 = p[0];
  123|       |
  124|   220k|	return ((p1 << 8) | p0);
  125|   220k|}
archive_read_support_format_zip.c:archive_le32dec:
  144|   337k|{
  145|   337k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|   337k|	unsigned int p3 = p[3];
  151|   337k|	unsigned int p2 = p[2];
  152|   337k|	unsigned int p1 = p[1];
  153|   337k|	unsigned int p0 = p[0];
  154|       |
  155|   337k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|   337k|}
archive_read_support_format_zip.c:archive_le64dec:
  160|  35.4k|{
  161|  35.4k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  35.4k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  35.4k|}
archive_string.c:archive_le16enc:
  197|  6.00k|{
  198|  6.00k|	unsigned char *p = (unsigned char *)pp;
  199|       |
  200|  6.00k|	p[0] = u & 0xff;
  201|  6.00k|	p[1] = (u >> 8) & 0xff;
  202|  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:
  115|  43.2k|{
  116|  43.2k|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|  43.2k|	unsigned int p1 = p[1];
  122|  43.2k|	unsigned int p0 = p[0];
  123|       |
  124|  43.2k|	return ((p1 << 8) | p0);
  125|  43.2k|}
archive_read_support_format_7zip.c:archive_le32dec:
  144|  39.9k|{
  145|  39.9k|	unsigned char const *p = (unsigned char const *)pp;
  146|       |
  147|       |	/* Store into unsigned temporaries before left shifting, to avoid
  148|       |	promotion to signed int and then left shifting into the sign bit,
  149|       |	which is undefined behaviour. */
  150|  39.9k|	unsigned int p3 = p[3];
  151|  39.9k|	unsigned int p2 = p[2];
  152|  39.9k|	unsigned int p1 = p[1];
  153|  39.9k|	unsigned int p0 = p[0];
  154|       |
  155|  39.9k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  39.9k|}
archive_read_support_format_7zip.c:archive_le16dec:
  115|    116|{
  116|    116|	unsigned char const *p = (unsigned char const *)pp;
  117|       |
  118|       |	/* Store into unsigned temporaries before left shifting, to avoid
  119|       |	promotion to signed int and then left shifting into the sign bit,
  120|       |	which is undefined behaviour. */
  121|    116|	unsigned int p1 = p[1];
  122|    116|	unsigned int p0 = p[0];
  123|       |
  124|    116|	return ((p1 << 8) | p0);
  125|    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:
   91|    106|{
   92|    106|	unsigned char const *p = (unsigned char const *)pp;
   93|       |
   94|       |	/* Store into unsigned temporaries before left shifting, to avoid
   95|       |	promotion to signed int and then left shifting into the sign bit,
   96|       |	which is undefined behaviour. */
   97|    106|	unsigned int p3 = p[3];
   98|    106|	unsigned int p2 = p[2];
   99|    106|	unsigned int p1 = p[1];
  100|    106|	unsigned int p0 = p[0];
  101|       |
  102|    106|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|    106|}
archive_read_support_format_7zip.c:archive_be64dec:
  107|      1|{
  108|      1|	unsigned char const *p = (unsigned char const *)pp;
  109|       |
  110|      1|	return (((uint64_t)archive_be32dec(p) << 32) | archive_be32dec(p + 4));
  111|      1|}
archive_read_support_format_7zip.c:archive_le64dec:
  160|  2.70k|{
  161|  2.70k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  2.70k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  2.70k|}

archive_entry_clear:
  155|   311k|{
  156|   311k|	if (entry == NULL)
  ------------------
  |  Branch (156:6): [True: 0, False: 311k]
  ------------------
  157|      0|		return (NULL);
  158|   311k|	archive_mstring_clean(&entry->ae_fflags_text);
  159|   311k|	archive_mstring_clean(&entry->ae_gname);
  160|   311k|	archive_mstring_clean(&entry->ae_linkname);
  161|   311k|	archive_mstring_clean(&entry->ae_pathname);
  162|   311k|	archive_mstring_clean(&entry->ae_sourcepath);
  163|   311k|	archive_mstring_clean(&entry->ae_uname);
  164|   311k|	archive_entry_copy_mac_metadata(entry, NULL, 0);
  165|   311k|	archive_acl_clear(&entry->acl);
  166|   311k|	archive_entry_xattr_clear(entry);
  167|   311k|	archive_entry_sparse_clear(entry);
  168|   311k|	free(entry->stat);
  169|   311k|	entry->ae_symlink_type = AE_SYMLINK_TYPE_UNDEFINED;
  ------------------
  |  |  227|   311k|#define AE_SYMLINK_TYPE_UNDEFINED	0
  ------------------
  170|   311k|	memset(entry, 0, sizeof(*entry));
  171|   311k|	return entry;
  172|   311k|}
archive_entry_free:
  250|  8.96k|{
  251|  8.96k|	archive_entry_clear(entry);
  252|  8.96k|	free(entry);
  253|  8.96k|}
archive_entry_new:
  257|  6.46k|{
  258|       |	return archive_entry_new2(NULL);
  259|  6.46k|}
archive_entry_new2:
  263|  8.96k|{
  264|  8.96k|	struct archive_entry *entry;
  265|       |
  266|  8.96k|	entry = calloc(1, sizeof(*entry));
  267|  8.96k|	if (entry == NULL)
  ------------------
  |  Branch (267:6): [True: 0, False: 8.96k]
  ------------------
  268|      0|		return (NULL);
  269|  8.96k|	entry->archive = a;
  270|  8.96k|	entry->ae_symlink_type = AE_SYMLINK_TYPE_UNDEFINED;
  ------------------
  |  |  227|  8.96k|#define AE_SYMLINK_TYPE_UNDEFINED	0
  ------------------
  271|  8.96k|	return (entry);
  272|  8.96k|}
archive_entry_atime:
  280|  84.5k|{
  281|  84.5k|	return (entry->ae_stat.aest_atime);
  282|  84.5k|}
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|  84.5k|{
  299|  84.5k|	return (entry->ae_stat.aest_birthtime);
  300|  84.5k|}
archive_entry_ctime:
  316|  84.5k|{
  317|  84.5k|	return (entry->ae_stat.aest_ctime);
  318|  84.5k|}
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|  89.1k|{
  335|  89.1k|	if (entry->ae_stat.aest_dev_is_broken_down)
  ------------------
  |  Branch (335:6): [True: 8.64k, False: 80.4k]
  ------------------
  336|  8.64k|		return ae_makedev(entry->ae_stat.aest_devmajor,
  ------------------
  |  |   94|  8.64k|#define ae_makedev(maj, min) makedev((maj), (min))
  ------------------
  337|  80.4k|		    entry->ae_stat.aest_devminor);
  338|  80.4k|	else
  339|  80.4k|		return (entry->ae_stat.aest_dev);
  340|  89.1k|}
archive_entry_filetype:
  368|   119k|{
  369|   119k|	return (AE_IFMT & entry->acl.mode);
  ------------------
  |  |  215|   119k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  370|   119k|}
archive_entry_gid:
  427|  84.5k|{
  428|  84.5k|	return (entry->ae_stat.aest_gid);
  429|  84.5k|}
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|  84.5k|{
  568|  84.5k|	return (entry->acl.mode);
  569|  84.5k|}
archive_entry_mtime:
  573|  84.5k|{
  574|  84.5k|	return (entry->ae_stat.aest_mtime);
  575|  84.5k|}
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|   117k|{
  605|   117k|	const char *p;
  606|   117k|	if (archive_mstring_get_mbs(
  ------------------
  |  Branch (606:6): [True: 117k, False: 6]
  ------------------
  607|   117k|	    entry->archive, &entry->ae_pathname, &p) == 0)
  608|   117k|		return (p);
  609|       |#if HAVE_EILSEQ  /*{*/
  610|      6|    if (errno == EILSEQ) {
  ------------------
  |  Branch (610:9): [True: 6, False: 0]
  ------------------
  611|      6|	    if (archive_mstring_get_utf8(
  ------------------
  |  Branch (611:10): [True: 6, False: 0]
  ------------------
  612|      6|	        entry->archive, &entry->ae_pathname, &p) == 0)
  613|      6|		    return (p);
  614|      6|    }
  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|  91.2k|{
  624|  91.2k|	const char *p;
  625|  91.2k|	if (archive_mstring_get_utf8(
  ------------------
  |  Branch (625:6): [True: 74.0k, False: 17.1k]
  ------------------
  626|  91.2k|	    entry->archive, &entry->ae_pathname, &p) == 0)
  627|  74.0k|		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|   198k|{
  636|   198k|	const wchar_t *p;
  637|   198k|	if (archive_mstring_get_wcs(
  ------------------
  |  Branch (637:6): [True: 166k, False: 31.9k]
  ------------------
  638|   198k|	    entry->archive, &entry->ae_pathname, &p) == 0)
  639|   166k|		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|   143k|{
  713|   143k|	return (entry->ae_stat.aest_size);
  714|   143k|}
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|  84.5k|{
  816|  84.5k|	return (entry->ae_stat.aest_uid);
  817|  84.5k|}
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|  84.5k|{
  868|  84.5k|	return ((entry->encryption & AE_ENCRYPTION_DATA) == AE_ENCRYPTION_DATA);
  ------------------
  |  |  169|  84.5k|#define AE_ENCRYPTION_DATA 1
  ------------------
              	return ((entry->encryption & AE_ENCRYPTION_DATA) == AE_ENCRYPTION_DATA);
  ------------------
  |  |  169|  84.5k|#define AE_ENCRYPTION_DATA 1
  ------------------
  869|  84.5k|}
archive_entry_is_metadata_encrypted:
  873|  84.5k|{
  874|  84.5k|	return ((entry->encryption & AE_ENCRYPTION_METADATA) == AE_ENCRYPTION_METADATA);
  ------------------
  |  |  170|  84.5k|#define AE_ENCRYPTION_METADATA 2
  ------------------
              	return ((entry->encryption & AE_ENCRYPTION_METADATA) == AE_ENCRYPTION_METADATA);
  ------------------
  |  |  170|  84.5k|#define AE_ENCRYPTION_METADATA 2
  ------------------
  875|  84.5k|}
archive_entry_is_encrypted:
  879|  84.5k|{
  880|  84.5k|	return (entry->encryption & (AE_ENCRYPTION_DATA|AE_ENCRYPTION_METADATA));
  ------------------
  |  |  169|  84.5k|#define AE_ENCRYPTION_DATA 1
  ------------------
              	return (entry->encryption & (AE_ENCRYPTION_DATA|AE_ENCRYPTION_METADATA));
  ------------------
  |  |  170|  84.5k|#define AE_ENCRYPTION_METADATA 2
  ------------------
  881|  84.5k|}
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|  3.27k|{
  909|  3.27k|	return archive_entry_copy_fflags_text_len(entry, flags, strlen(flags));
  910|  3.27k|}
archive_entry_copy_fflags_text_len:
  915|  3.27k|{
  916|  3.27k|	archive_mstring_copy_mbs_len(&entry->ae_fflags_text, flags, flags_length);
  917|  3.27k|	return (ae_strtofflags(flags, flags_length,
  918|  3.27k|		    &entry->ae_fflags_set, &entry->ae_fflags_clear));
  919|  3.27k|}
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|  51.1k|{
 1244|  51.1k|	entry->stat_valid = 0;
 1245|  51.1k|	entry->acl.mode = m;
 1246|  51.1k|	entry->ae_set |= AE_SET_PERM | AE_SET_FILETYPE;
  ------------------
  |  |  148|  51.1k|#define	AE_SET_PERM	512
  ------------------
              	entry->ae_set |= AE_SET_PERM | AE_SET_FILETYPE;
  ------------------
  |  |  149|  51.1k|#define	AE_SET_FILETYPE	1024
  ------------------
 1247|  51.1k|}
archive_entry_set_mtime:
 1251|  80.1k|{
 1252|  80.1k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  80.1k|	do {	\
  |  |  113|  80.1k|		t += ns / 1000000000; \
  |  |  114|  80.1k|		ns %= 1000000000; \
  |  |  115|  80.1k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 80.1k]
  |  |  ------------------
  |  |  116|  80.1k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 80.1k]
  |  |  ------------------
  ------------------
 1253|  80.1k|	entry->stat_valid = 0;
 1254|  80.1k|	entry->ae_set |= AE_SET_MTIME;
  ------------------
  |  |  143|  80.1k|#define	AE_SET_MTIME	16
  ------------------
 1255|  80.1k|	entry->ae_stat.aest_mtime = t;
 1256|  80.1k|	entry->ae_stat.aest_mtime_nsec = ns;
 1257|  80.1k|}
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|    735|{
 1276|    735|	archive_mstring_copy_mbs(&entry->ae_pathname, name);
 1277|    735|}
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|  10.2k|{
 1300|  10.2k|	if (archive_mstring_update_utf8(entry->archive,
  ------------------
  |  Branch (1300:6): [True: 7.23k, False: 3.02k]
  ------------------
 1301|  10.2k|	    &entry->ae_pathname, name) == 0)
 1302|  7.23k|		return (1);
 1303|  3.02k|	if (errno == ENOMEM)
  ------------------
  |  Branch (1303:6): [True: 0, False: 3.02k]
  ------------------
 1304|      0|		__archive_errx(1, "No memory");
 1305|  3.02k|	return (0);
 1306|  3.02k|}
_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|  83.6k|{
 1359|  83.6k|	if (s < 0) {
  ------------------
  |  Branch (1359:6): [True: 0, False: 83.6k]
  ------------------
 1360|      0|		s = 0;
 1361|      0|	}
 1362|  83.6k|	entry->stat_valid = 0;
 1363|  83.6k|	entry->ae_stat.aest_size = s;
 1364|  83.6k|	entry->ae_set |= AE_SET_SIZE;
  ------------------
  |  |  145|  83.6k|#define	AE_SET_SIZE	64
  ------------------
 1365|  83.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|  12.9k|{
 1529|  12.9k|	if (is_encrypted) {
  ------------------
  |  Branch (1529:6): [True: 12.9k, False: 0]
  ------------------
 1530|  12.9k|		entry->encryption |= AE_ENCRYPTION_DATA;
  ------------------
  |  |  169|  12.9k|#define AE_ENCRYPTION_DATA 1
  ------------------
 1531|  12.9k|	} else {
 1532|      0|		entry->encryption &= ~AE_ENCRYPTION_DATA;
  ------------------
  |  |  169|      0|#define AE_ENCRYPTION_DATA 1
  ------------------
 1533|      0|	}
 1534|  12.9k|}
archive_entry_set_is_metadata_encrypted:
 1538|     24|{
 1539|     24|	if (is_encrypted) {
  ------------------
  |  Branch (1539:6): [True: 24, False: 0]
  ------------------
 1540|     24|		entry->encryption |= AE_ENCRYPTION_METADATA;
  ------------------
  |  |  170|     24|#define AE_ENCRYPTION_METADATA 2
  ------------------
 1541|     24|	} else {
 1542|      0|		entry->encryption &= ~AE_ENCRYPTION_METADATA;
  ------------------
  |  |  170|      0|#define AE_ENCRYPTION_METADATA 2
  ------------------
 1543|      0|	}
 1544|     24|}
_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|   311k|{
 1565|   311k|  free(entry->mac_metadata);
 1566|   311k|  if (p == NULL || s == 0) {
  ------------------
  |  Branch (1566:7): [True: 311k, False: 0]
  |  Branch (1566:20): [True: 0, False: 0]
  ------------------
 1567|   311k|    entry->mac_metadata = NULL;
 1568|   311k|    entry->mac_metadata_size = 0;
 1569|   311k|  } 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|   311k|}
archive_entry_digest:
 1581|  84.5k|{
 1582|  84.5k|	switch (type) {
 1583|      0|	case ARCHIVE_ENTRY_DIGEST_MD5:
  ------------------
  |  |  444|      0|#define ARCHIVE_ENTRY_DIGEST_MD5              0x00000001
  ------------------
  |  Branch (1583:2): [True: 0, False: 84.5k]
  ------------------
 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: 84.5k]
  ------------------
 1586|      0|		return entry->digest.rmd160;
 1587|  84.5k|	case ARCHIVE_ENTRY_DIGEST_SHA1:
  ------------------
  |  |  446|  84.5k|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
  |  Branch (1587:2): [True: 84.5k, False: 0]
  ------------------
 1588|  84.5k|		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: 84.5k]
  ------------------
 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: 84.5k]
  ------------------
 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: 84.5k]
  ------------------
 1594|      0|		return entry->digest.sha512;
 1595|      0|	default:
  ------------------
  |  Branch (1595:2): [True: 0, False: 84.5k]
  ------------------
 1596|       |		return NULL;
 1597|  84.5k|	}
 1598|  84.5k|}
archive_entry_acl:
 1651|    116|{
 1652|    116|	return &entry->acl;
 1653|    116|}
archive_entry.c:ae_strtofflags:
 2145|  3.27k|{
 2146|  3.27k|	const char *start, *end;
 2147|  3.27k|	const struct flag *flag;
 2148|  3.27k|	unsigned long set, clear;
 2149|  3.27k|	const char *failed;
 2150|       |
 2151|  3.27k|	set = clear = 0;
 2152|  3.27k|	start = s;
 2153|  3.27k|	failed = NULL;
 2154|       |	/* Find start of first token. */
 2155|  3.27k|	while (l > 0 && (*start == '\t'  ||  *start == ' '  ||  *start == ',')) {
  ------------------
  |  Branch (2155:9): [True: 3.27k, False: 0]
  |  Branch (2155:19): [True: 0, False: 3.27k]
  |  Branch (2155:39): [True: 0, False: 3.27k]
  |  Branch (2155:58): [True: 0, False: 3.27k]
  ------------------
 2156|      0|		start++;
 2157|      0|		l--;
 2158|      0|	}
 2159|  12.5k|	while (l > 0) {
  ------------------
  |  Branch (2159:9): [True: 9.25k, False: 3.27k]
  ------------------
 2160|  9.25k|		size_t length;
 2161|       |		/* Locate end of token. */
 2162|  9.25k|		end = start;
 2163|  64.7k|		while (l > 0 && *end != '\t'  &&
  ------------------
  |  Branch (2163:10): [True: 61.4k, False: 3.27k]
  |  Branch (2163:19): [True: 61.4k, False: 0]
  ------------------
 2164|  61.4k|		    *end != ' '  &&  *end != ',') {
  ------------------
  |  Branch (2164:7): [True: 61.4k, False: 0]
  |  Branch (2164:24): [True: 55.5k, False: 5.97k]
  ------------------
 2165|  55.5k|			end++;
 2166|  55.5k|			l--;
 2167|  55.5k|		}
 2168|  9.25k|		length = end - start;
 2169|   185k|		for (flag = fileflags; flag->name != NULL; flag++) {
  ------------------
  |  Branch (2169:26): [True: 175k, False: 9.25k]
  ------------------
 2170|   175k|			size_t flag_length = strlen(flag->name);
 2171|   175k|			if (length == flag_length
  ------------------
  |  Branch (2171:8): [True: 37.0k, False: 138k]
  ------------------
 2172|  37.0k|			    && memcmp(start, flag->name, length) == 0) {
  ------------------
  |  Branch (2172:11): [True: 0, False: 37.0k]
  ------------------
 2173|       |				/* Matched "noXXXX", so reverse the sense. */
 2174|      0|				clear |= flag->set;
 2175|      0|				set |= flag->clear;
 2176|      0|				break;
 2177|   175k|			} else if (length == flag_length - 2
  ------------------
  |  Branch (2177:15): [True: 27.7k, False: 148k]
  ------------------
 2178|  27.7k|			    && memcmp(start, flag->name + 2, length) == 0) {
  ------------------
  |  Branch (2178:11): [True: 0, False: 27.7k]
  ------------------
 2179|       |				/* Matched "XXXX", so don't reverse. */
 2180|      0|				set |= flag->set;
 2181|      0|				clear |= flag->clear;
 2182|      0|				break;
 2183|      0|			}
 2184|   175k|		}
 2185|       |		/* Ignore unknown flag names. */
 2186|  9.25k|		if (flag->name == NULL  &&  failed == NULL)
  ------------------
  |  Branch (2186:7): [True: 9.25k, False: 0]
  |  Branch (2186:31): [True: 3.27k, False: 5.97k]
  ------------------
 2187|  3.27k|			failed = start;
 2188|       |
 2189|       |		/* Find start of next token. */
 2190|  9.25k|		start = end;
 2191|  15.2k|		while (l > 0 && (*start == '\t'  ||  *start == ' '  ||  *start == ',')) {
  ------------------
  |  Branch (2191:10): [True: 11.9k, False: 3.27k]
  |  Branch (2191:20): [True: 0, False: 11.9k]
  |  Branch (2191:40): [True: 0, False: 11.9k]
  |  Branch (2191:59): [True: 5.97k, False: 5.97k]
  ------------------
 2192|  5.97k|			start++;
 2193|  5.97k|			l--;
 2194|  5.97k|		}
 2195|       |
 2196|  9.25k|	}
 2197|       |
 2198|  3.27k|	if (setp)
  ------------------
  |  Branch (2198:6): [True: 3.27k, False: 0]
  ------------------
 2199|  3.27k|		*setp = set;
 2200|  3.27k|	if (clrp)
  ------------------
  |  Branch (2200:6): [True: 3.27k, False: 0]
  ------------------
 2201|  3.27k|		*clrp = clear;
 2202|       |
 2203|       |	/* Return location of first failure. */
 2204|  3.27k|	return (failed);
 2205|  3.27k|}

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|   311k|{
   41|   311k|	struct ae_sparse *sp;
   42|       |
   43|   312k|	while (entry->sparse_head != NULL) {
  ------------------
  |  Branch (43:9): [True: 984, False: 311k]
  ------------------
   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|   311k|}
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|   311k|{
   74|   311k|	struct ae_xattr	*xp;
   75|       |
   76|   311k|	while (entry->xattr_head != NULL) {
  ------------------
  |  Branch (76:9): [True: 36, False: 311k]
  ------------------
   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|   311k|}
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:
   95|  2.49k|{
   96|  2.49k|	struct archive_read *a;
   97|       |
   98|  2.49k|	a = calloc(1, sizeof(*a));
   99|  2.49k|	if (a == NULL)
  ------------------
  |  Branch (99:6): [True: 0, False: 2.49k]
  ------------------
  100|      0|		return (NULL);
  101|  2.49k|	a->archive.magic = ARCHIVE_READ_MAGIC;
  ------------------
  |  |   59|  2.49k|#define	ARCHIVE_READ_MAGIC	(0xdeb0c5U)
  ------------------
  102|       |
  103|  2.49k|	a->archive.state = ARCHIVE_STATE_NEW;
  ------------------
  |  |   64|  2.49k|#define	ARCHIVE_STATE_NEW	1U
  ------------------
  104|  2.49k|	a->entry = archive_entry_new2(&a->archive);
  105|  2.49k|	a->archive.vtable = &archive_read_vtable;
  106|       |
  107|  2.49k|	a->passphrases.last = &a->passphrases.first;
  108|       |
  109|  2.49k|	return (&a->archive);
  110|  2.49k|}
archive_read_set_open_callback:
  298|  2.49k|{
  299|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  300|  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]
  |  |  ------------------
  ------------------
  301|  2.49k|	    "archive_read_set_open_callback");
  302|  2.49k|	a->client.opener = client_opener;
  303|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  304|  2.49k|}
archive_read_set_read_callback:
  309|  2.49k|{
  310|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  311|  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]
  |  |  ------------------
  ------------------
  312|  2.49k|	    "archive_read_set_read_callback");
  313|  2.49k|	a->client.reader = client_reader;
  314|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  315|  2.49k|}
archive_read_set_skip_callback:
  320|  2.49k|{
  321|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  322|  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]
  |  |  ------------------
  ------------------
  323|  2.49k|	    "archive_read_set_skip_callback");
  324|  2.49k|	a->client.skipper = client_skipper;
  325|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  326|  2.49k|}
archive_read_set_seek_callback:
  331|  2.49k|{
  332|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  333|  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]
  |  |  ------------------
  ------------------
  334|  2.49k|	    "archive_read_set_seek_callback");
  335|  2.49k|	a->client.seeker = client_seeker;
  336|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  337|  2.49k|}
archive_read_set_close_callback:
  342|  2.49k|{
  343|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  344|  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]
  |  |  ------------------
  ------------------
  345|  2.49k|	    "archive_read_set_close_callback");
  346|  2.49k|	a->client.closer = client_closer;
  347|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  348|  2.49k|}
archive_read_set_callback_data:
  363|  2.49k|{
  364|  2.49k|	return archive_read_set_callback_data2(_a, client_data, 0);
  365|  2.49k|}
archive_read_set_callback_data2:
  370|  2.49k|{
  371|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  372|  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]
  |  |  ------------------
  ------------------
  373|  2.49k|	    "archive_read_set_callback_data2");
  374|       |
  375|  2.49k|	if (a->client.nodes == 0)
  ------------------
  |  Branch (375:6): [True: 2.49k, False: 0]
  ------------------
  376|  2.49k|	{
  377|  2.49k|		a->client.dataset = (struct archive_read_data_node *)
  378|  2.49k|		    calloc(1, sizeof(*a->client.dataset));
  379|  2.49k|		if (a->client.dataset == NULL)
  ------------------
  |  Branch (379:7): [True: 0, False: 2.49k]
  ------------------
  380|      0|		{
  381|      0|			archive_set_error(&a->archive, ENOMEM,
  382|      0|				"No memory");
  383|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  384|      0|		}
  385|  2.49k|		a->client.nodes = 1;
  386|  2.49k|	}
  387|       |
  388|  2.49k|	if (iindex > a->client.nodes - 1)
  ------------------
  |  Branch (388:6): [True: 0, False: 2.49k]
  ------------------
  389|      0|	{
  390|      0|		archive_set_error(&a->archive, EINVAL,
  391|      0|			"Invalid index specified");
  392|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  393|      0|	}
  394|  2.49k|	a->client.dataset[iindex].data = client_data;
  395|  2.49k|	a->client.dataset[iindex].begin_position = -1;
  396|  2.49k|	a->client.dataset[iindex].total_size = -1;
  397|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  398|  2.49k|}
archive_read_open1:
  468|  2.49k|{
  469|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  470|  2.49k|	struct archive_read_filter *filter, *tmp;
  471|  2.49k|	int slot, e = ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  472|       |
  473|  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]
  |  |  ------------------
  ------------------
  474|  2.49k|	    "archive_read_open");
  475|  2.49k|	archive_clear_error(&a->archive);
  476|       |
  477|  2.49k|	if (a->client.reader == NULL) {
  ------------------
  |  Branch (477:6): [True: 0, False: 2.49k]
  ------------------
  478|      0|		archive_set_error(&a->archive, EINVAL,
  479|      0|		    "No reader function provided to archive_read_open");
  480|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  481|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  482|      0|	}
  483|       |
  484|       |	/* Open data source. */
  485|  2.49k|	if (a->client.opener != NULL) {
  ------------------
  |  Branch (485:6): [True: 2.49k, False: 0]
  ------------------
  486|  2.49k|		e = (a->client.opener)(&a->archive, a->client.dataset[0].data);
  487|  2.49k|		if (e != 0) {
  ------------------
  |  Branch (487:7): [True: 0, False: 2.49k]
  ------------------
  488|       |			/* If the open failed, call the closer to clean up. */
  489|      0|			read_client_close_proxy(a);
  490|      0|			return (e);
  491|      0|		}
  492|  2.49k|	}
  493|       |
  494|  2.49k|	filter = calloc(1, sizeof(*filter));
  495|  2.49k|	if (filter == NULL)
  ------------------
  |  Branch (495:6): [True: 0, False: 2.49k]
  ------------------
  496|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  497|  2.49k|	filter->bidder = NULL;
  498|  2.49k|	filter->upstream = NULL;
  499|  2.49k|	filter->archive = a;
  500|  2.49k|	filter->data = a->client.dataset[0].data;
  501|  2.49k|	filter->vtable = &none_reader_vtable;
  502|  2.49k|	filter->name = "none";
  503|  2.49k|	filter->code = ARCHIVE_FILTER_NONE;
  ------------------
  |  |  309|  2.49k|#define	ARCHIVE_FILTER_NONE	0
  ------------------
  504|  2.49k|	filter->can_skip = 1;
  505|  2.49k|	filter->can_seek = 1;
  506|       |
  507|  2.49k|	a->client.dataset[0].begin_position = 0;
  508|  2.49k|	if (!a->filter || !a->bypass_filter_bidding)
  ------------------
  |  Branch (508:6): [True: 2.49k, False: 0]
  |  Branch (508:20): [True: 0, False: 0]
  ------------------
  509|  2.49k|	{
  510|  2.49k|		a->filter = filter;
  511|       |		/* Build out the input pipeline. */
  512|  2.49k|		e = choose_filters(a);
  513|  2.49k|		if (e < ARCHIVE_WARN) {
  ------------------
  |  |  235|  2.49k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (513:7): [True: 41, False: 2.45k]
  ------------------
  514|     41|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|     41|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  515|     41|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     41|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  516|     41|		}
  517|  2.49k|	}
  518|      0|	else
  519|      0|	{
  520|       |		/* Need to add "NONE" type filter at the end of the filter chain */
  521|      0|		tmp = a->filter;
  522|      0|		while (tmp->upstream)
  ------------------
  |  Branch (522:10): [True: 0, False: 0]
  ------------------
  523|      0|			tmp = tmp->upstream;
  524|      0|		tmp->upstream = filter;
  525|      0|	}
  526|       |
  527|  2.45k|	if (!a->format)
  ------------------
  |  Branch (527:6): [True: 2.45k, False: 0]
  ------------------
  528|  2.45k|	{
  529|  2.45k|		slot = choose_format(a);
  530|  2.45k|		if (slot < 0) {
  ------------------
  |  Branch (530:7): [True: 17, False: 2.44k]
  ------------------
  531|     17|			close_filters(a);
  532|     17|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|     17|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  533|     17|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     17|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  534|     17|		}
  535|  2.44k|		a->format = &(a->formats[slot]);
  536|  2.44k|	}
  537|       |
  538|  2.44k|	a->archive.state = ARCHIVE_STATE_HEADER;
  ------------------
  |  |   65|  2.44k|#define	ARCHIVE_STATE_HEADER	2U
  ------------------
  539|       |
  540|       |	/* Ensure libarchive starts from the first node in a multivolume set */
  541|  2.44k|	client_switch_proxy(a->filter, 0);
  542|  2.44k|	return (e);
  543|  2.45k|}
__archive_read_header:
  611|     64|{
  612|     64|	if (!a->filter->vtable->read_header)
  ------------------
  |  Branch (612:6): [True: 44, False: 20]
  ------------------
  613|     44|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     44|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  614|     20|	return a->filter->vtable->read_header(a->filter, entry);
  615|     64|}
archive_read_has_encrypted_entries:
  783|  2.44k|{
  784|  2.44k|	struct archive_read *a = (struct archive_read *)_a;
  785|  2.44k|	int format_supports_encryption = archive_read_format_capabilities(_a)
  786|  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.) */
  ------------------
  787|       |
  788|  2.44k|	if (!_a || !format_supports_encryption) {
  ------------------
  |  Branch (788:6): [True: 0, False: 2.44k]
  |  Branch (788:13): [True: 1.22k, False: 1.21k]
  ------------------
  789|       |		/* Format in general doesn't support encryption */
  790|  1.22k|		return ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED;
  ------------------
  |  |  410|  1.22k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED -2
  ------------------
  791|  1.22k|	}
  792|       |
  793|       |	/* A reader potentially has read enough data now. */
  794|  1.21k|	if (a->format && a->format->has_encrypted_entries) {
  ------------------
  |  Branch (794:6): [True: 1.21k, False: 0]
  |  Branch (794:19): [True: 1.21k, False: 0]
  ------------------
  795|  1.21k|		return (a->format->has_encrypted_entries)(a);
  796|  1.21k|	}
  797|       |
  798|       |	/* For any other reason we cannot say how many entries are there. */
  799|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  800|  1.21k|}
archive_read_format_capabilities:
  808|  4.88k|{
  809|  4.88k|	struct archive_read *a = (struct archive_read *)_a;
  810|  4.88k|	if (a && a->format && a->format->format_capabilties) {
  ------------------
  |  Branch (810:6): [True: 4.88k, False: 0]
  |  Branch (810:11): [True: 4.88k, False: 0]
  |  Branch (810:24): [True: 2.43k, False: 2.44k]
  ------------------
  811|  2.43k|		return (a->format->format_capabilties)(a);
  812|  2.43k|	}
  813|  2.44k|	return ARCHIVE_READ_FORMAT_CAPS_NONE;
  ------------------
  |  |  397|  2.44k|#define ARCHIVE_READ_FORMAT_CAPS_NONE (0) /* no special capabilities */
  ------------------
  814|  4.88k|}
archive_read_data:
  829|   106M|{
  830|   106M|	struct archive *a = (struct archive *)_a;
  831|   106M|	char	*dest;
  832|   106M|	const void *read_buf;
  833|   106M|	size_t	 bytes_read;
  834|   106M|	size_t	 len;
  835|   106M|	int	 r;
  836|       |
  837|   106M|	bytes_read = 0;
  838|   106M|	dest = (char *)buff;
  839|       |
  840|   213M|	while (s > 0) {
  ------------------
  |  Branch (840:9): [True: 106M, False: 106M]
  ------------------
  841|   106M|		if (a->read_data_offset == a->read_data_output_offset &&
  ------------------
  |  Branch (841:7): [True: 522k, False: 106M]
  ------------------
  842|   522k|		    a->read_data_remaining == 0) {
  ------------------
  |  Branch (842:7): [True: 150k, False: 372k]
  ------------------
  843|   150k|			read_buf = a->read_data_block;
  844|   150k|			a->read_data_is_posix_read = 1;
  845|   150k|			a->read_data_requested = s;
  846|   150k|			r = archive_read_data_block(a, &read_buf,
  847|   150k|			    &a->read_data_remaining, &a->read_data_offset);
  848|   150k|			a->read_data_block = read_buf;
  849|   150k|			if (r == ARCHIVE_EOF &&
  ------------------
  |  |  232|   300k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (849:8): [True: 79.7k, False: 70.5k]
  ------------------
  850|  79.7k|			    a->read_data_offset == a->read_data_output_offset &&
  ------------------
  |  Branch (850:8): [True: 72.3k, False: 7.37k]
  ------------------
  851|  72.3k|			    a->read_data_remaining == 0)
  ------------------
  |  Branch (851:8): [True: 72.3k, False: 0]
  ------------------
  852|  72.3k|				return (bytes_read);
  853|       |			/*
  854|       |			 * Error codes are all negative, so the status
  855|       |			 * return here cannot be confused with a valid
  856|       |			 * byte count.  (ARCHIVE_OK is zero.)
  857|       |			 */
  858|  77.8k|			if (r < ARCHIVE_OK)
  ------------------
  |  |  233|  77.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (858:8): [True: 32.6k, False: 45.2k]
  ------------------
  859|  32.6k|				return (r);
  860|  77.8k|		}
  861|       |
  862|   106M|		if (a->read_data_offset < a->read_data_output_offset) {
  ------------------
  |  Branch (862:7): [True: 224, False: 106M]
  ------------------
  863|    224|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    224|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  864|    224|			    "Encountered out-of-order sparse blocks");
  865|    224|			return (ARCHIVE_RETRY);
  ------------------
  |  |  234|    224|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  866|    224|		}
  867|       |
  868|       |		/* Compute the amount of zero padding needed. */
  869|   106M|		if (a->read_data_output_offset + (int64_t)s <
  ------------------
  |  Branch (869:7): [True: 106M, False: 417k]
  ------------------
  870|   106M|		    a->read_data_offset) {
  871|   106M|			len = s;
  872|   106M|		} else if (a->read_data_output_offset <
  ------------------
  |  Branch (872:14): [True: 7.50k, False: 410k]
  ------------------
  873|   417k|		    a->read_data_offset) {
  874|  7.50k|			len = (size_t)(a->read_data_offset -
  875|  7.50k|			    a->read_data_output_offset);
  876|  7.50k|		} else
  877|   410k|			len = 0;
  878|       |
  879|       |		/* Add zeroes. */
  880|   106M|		memset(dest, 0, len);
  881|   106M|		s -= len;
  882|   106M|		a->read_data_output_offset += len;
  883|   106M|		dest += len;
  884|   106M|		bytes_read += len;
  885|       |
  886|       |		/* Copy data if there is any space left. */
  887|   106M|		if (s > 0) {
  ------------------
  |  Branch (887:7): [True: 417k, False: 106M]
  ------------------
  888|   417k|			len = a->read_data_remaining;
  889|   417k|			if (len > s)
  ------------------
  |  Branch (889:8): [True: 372k, False: 45.0k]
  ------------------
  890|   372k|				len = s;
  891|   417k|			if (len) {
  ------------------
  |  Branch (891:8): [True: 408k, False: 9.40k]
  ------------------
  892|   408k|				memcpy(dest, a->read_data_block, len);
  893|   408k|				s -= len;
  894|   408k|				a->read_data_block += len;
  895|   408k|				a->read_data_remaining -= len;
  896|   408k|				a->read_data_output_offset += len;
  897|   408k|				a->read_data_offset += len;
  898|   408k|				dest += len;
  899|   408k|				bytes_read += len;
  900|   408k|			}
  901|   417k|		}
  902|   106M|	}
  903|   106M|	a->read_data_is_posix_read = 0;
  904|   106M|	a->read_data_requested = 0;
  905|   106M|	return (bytes_read);
  906|   106M|}
__archive_reset_read_data:
  912|   298k|{
  913|   298k|	a->read_data_output_offset = 0;
  914|   298k|	a->read_data_remaining = 0;
  915|   298k|	a->read_data_is_posix_read = 0;
  916|   298k|	a->read_data_requested = 0;
  917|       |
  918|       |   /* extra resets, from rar.c */
  919|       |   a->read_data_block = NULL;
  920|   298k|   a->read_data_offset = 0;
  921|   298k|}
archive_read_data_skip:
  928|  84.1k|{
  929|  84.1k|	struct archive_read *a = (struct archive_read *)_a;
  930|  84.1k|	int r;
  931|  84.1k|	const void *buff;
  932|  84.1k|	size_t size;
  933|  84.1k|	int64_t offset;
  934|       |
  935|  84.1k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_DATA,
  ------------------
  |  |  151|  84.1k|	do { \
  |  |  152|  84.1k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|  84.1k|			(allowed_states), (function_name)); \
  |  |  154|  84.1k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  84.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 84.1k]
  |  |  ------------------
  |  |  155|  84.1k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|  84.1k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 84.1k]
  |  |  ------------------
  ------------------
  936|  84.1k|	    "archive_read_data_skip");
  937|       |
  938|  84.1k|	if (a->format->read_data_skip != NULL)
  ------------------
  |  Branch (938:6): [True: 84.1k, False: 0]
  ------------------
  939|  84.1k|		r = (a->format->read_data_skip)(a);
  940|      0|	else {
  941|      0|		while ((r = archive_read_data_block(&a->archive,
  ------------------
  |  Branch (941:10): [True: 0, False: 0]
  ------------------
  942|      0|			    &buff, &size, &offset))
  943|      0|		    == ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  944|      0|			;
  945|      0|	}
  946|       |
  947|  84.1k|	if (r == ARCHIVE_EOF)
  ------------------
  |  |  232|  84.1k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (947:6): [True: 2, False: 84.1k]
  ------------------
  948|      2|		r = ARCHIVE_OK;
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  949|       |
  950|  84.1k|	if (r == ARCHIVE_FATAL)
  ------------------
  |  |  239|  84.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (950:6): [True: 252, False: 83.9k]
  ------------------
  951|    252|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|    252|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  952|  83.9k|	else
  953|  83.9k|		a->archive.state = ARCHIVE_STATE_HEADER;
  ------------------
  |  |   65|  83.9k|#define	ARCHIVE_STATE_HEADER	2U
  ------------------
  954|  84.1k|	return (r);
  955|  84.1k|}
archive_seek_data:
  959|  2.44k|{
  960|  2.44k|	struct archive_read *a = (struct archive_read *)_a;
  961|  2.44k|	la_int64_t r;
  962|       |
  963|  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]
  |  |  ------------------
  ------------------
  964|  2.44k|	    "archive_seek_data_block");
  965|       |
  966|      0|	if (a->format->seek_data == NULL) {
  ------------------
  |  Branch (966:6): [True: 0, False: 0]
  ------------------
  967|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
  968|      0|		    "Internal error: "
  969|      0|		    "No format_seek_data_block function registered");
  970|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  971|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  972|      0|	}
  973|       |
  974|      0|	r = (a->format->seek_data)(a, offset, whence);
  975|      0|	if (r == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (975:6): [True: 0, False: 0]
  ------------------
  976|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  977|      0|	return (r);
  978|      0|}
__archive_read_free_filters:
 1035|  2.54k|{
 1036|       |	/* Make sure filters are closed and their buffers are freed */
 1037|  2.54k|	close_filters(a);
 1038|       |
 1039|  5.40k|	while (a->filter != NULL) {
  ------------------
  |  Branch (1039:9): [True: 2.86k, False: 2.54k]
  ------------------
 1040|  2.86k|		struct archive_read_filter *t = a->filter->upstream;
 1041|  2.86k|		free(a->filter);
 1042|  2.86k|		a->filter = t;
 1043|  2.86k|	}
 1044|  2.54k|}
__archive_read_register_format:
 1216|  44.9k|{
 1217|  44.9k|	int i, number_slots;
 1218|       |
 1219|  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]
  |  |  ------------------
  ------------------
 1220|  44.9k|	    ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
 1221|  44.9k|	    "__archive_read_register_format");
 1222|       |
 1223|  44.9k|	number_slots = sizeof(a->formats) / sizeof(a->formats[0]);
 1224|       |
 1225|   362k|	for (i = 0; i < number_slots; i++) {
  ------------------
  |  Branch (1225:14): [True: 362k, False: 0]
  ------------------
 1226|   362k|		if (a->formats[i].bid == bid)
  ------------------
  |  Branch (1226:7): [True: 4.99k, False: 357k]
  ------------------
 1227|  4.99k|			return (ARCHIVE_WARN); /* We've already installed */
  ------------------
  |  |  235|  4.99k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1228|   357k|		if (a->formats[i].bid == NULL) {
  ------------------
  |  Branch (1228:7): [True: 39.9k, False: 317k]
  ------------------
 1229|  39.9k|			a->formats[i].bid = bid;
 1230|  39.9k|			a->formats[i].options = options;
 1231|  39.9k|			a->formats[i].read_header = read_header;
 1232|  39.9k|			a->formats[i].read_data = read_data;
 1233|  39.9k|			a->formats[i].read_data_skip = read_data_skip;
 1234|  39.9k|			a->formats[i].seek_data = seek_data;
 1235|  39.9k|			a->formats[i].cleanup = cleanup;
 1236|  39.9k|			a->formats[i].data = format_data;
 1237|  39.9k|			a->formats[i].name = name;
 1238|  39.9k|			a->formats[i].format_capabilties = format_capabilities;
 1239|  39.9k|			a->formats[i].has_encrypted_entries = has_encrypted_entries;
 1240|  39.9k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  39.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1241|  39.9k|		}
 1242|   357k|	}
 1243|       |
 1244|      0|	archive_set_error(&a->archive, ENOMEM,
 1245|      0|	    "Not enough slots for format registration");
 1246|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1247|  44.9k|}
__archive_read_register_bidder:
 1258|  32.4k|{
 1259|  32.4k|	struct archive_read_filter_bidder *bidder;
 1260|  32.4k|	int i, number_slots;
 1261|       |
 1262|  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]
  |  |  ------------------
  ------------------
 1263|  32.4k|	    ARCHIVE_STATE_NEW, "__archive_read_register_bidder");
 1264|       |
 1265|  32.4k|	number_slots = sizeof(a->bidders) / sizeof(a->bidders[0]);
 1266|       |
 1267|   227k|	for (i = 0; i < number_slots; i++) {
  ------------------
  |  Branch (1267:14): [True: 227k, False: 0]
  ------------------
 1268|   227k|		if (a->bidders[i].vtable != NULL)
  ------------------
  |  Branch (1268:7): [True: 194k, False: 32.4k]
  ------------------
 1269|   194k|			continue;
 1270|  32.4k|		memset(a->bidders + i, 0, sizeof(a->bidders[0]));
 1271|  32.4k|		bidder = (a->bidders + i);
 1272|  32.4k|		bidder->data = bidder_data;
 1273|  32.4k|		bidder->name = name;
 1274|  32.4k|		bidder->vtable = vtable;
 1275|  32.4k|		if (bidder->vtable->bid == NULL || bidder->vtable->init == NULL) {
  ------------------
  |  Branch (1275:7): [True: 0, False: 32.4k]
  |  Branch (1275:38): [True: 0, False: 32.4k]
  ------------------
 1276|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1277|      0|					"Internal error: "
 1278|      0|					"no bid/init for filter bidder");
 1279|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1280|      0|		}
 1281|       |
 1282|  32.4k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  32.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1283|  32.4k|	}
 1284|       |
 1285|      0|	archive_set_error(&a->archive, ENOMEM,
 1286|      0|	    "Not enough slots for filter registration");
 1287|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1288|  32.4k|}
__archive_read_ahead:
 1343|  13.1M|{
 1344|  13.1M|	return (__archive_read_filter_ahead(a->filter, min, avail));
 1345|  13.1M|}
__archive_read_filter_ahead:
 1350|  13.2M|{
 1351|  13.2M|	ssize_t bytes_read;
 1352|  13.2M|	size_t tocopy;
 1353|       |
 1354|  13.2M|	if (filter->fatal) {
  ------------------
  |  Branch (1354:6): [True: 609, False: 13.2M]
  ------------------
 1355|    609|		if (avail)
  ------------------
  |  Branch (1355:7): [True: 219, False: 390]
  ------------------
 1356|    219|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|    219|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1357|    609|		return (NULL);
 1358|    609|	}
 1359|       |
 1360|       |	/*
 1361|       |	 * Keep pulling more data until we can satisfy the request.
 1362|       |	 */
 1363|  13.2M|	for (;;) {
 1364|       |
 1365|       |		/*
 1366|       |		 * If we can satisfy from the copy buffer (and the
 1367|       |		 * copy buffer isn't empty), we're done.  In particular,
 1368|       |		 * note that min == 0 is a perfectly well-defined
 1369|       |		 * request.
 1370|       |		 */
 1371|  13.2M|		if (filter->avail >= min && filter->avail > 0) {
  ------------------
  |  Branch (1371:7): [True: 136k, False: 13.1M]
  |  Branch (1371:31): [True: 90.5k, False: 45.9k]
  ------------------
 1372|  90.5k|			if (avail != NULL)
  ------------------
  |  Branch (1372:8): [True: 14.4k, False: 76.0k]
  ------------------
 1373|  14.4k|				*avail = filter->avail;
 1374|  90.5k|			return (filter->next);
 1375|  90.5k|		}
 1376|       |
 1377|       |		/*
 1378|       |		 * We can satisfy directly from client buffer if everything
 1379|       |		 * currently in the copy buffer is still in the client buffer.
 1380|       |		 */
 1381|  13.1M|		if (filter->client_total >= filter->client_avail + filter->avail
  ------------------
  |  Branch (1381:7): [True: 13.1M, False: 11.1k]
  ------------------
 1382|  13.1M|		    && filter->client_avail + filter->avail >= min) {
  ------------------
  |  Branch (1382:10): [True: 13.1M, False: 13.5k]
  ------------------
 1383|       |			/* "Roll back" to client buffer. */
 1384|  13.1M|			filter->client_avail += filter->avail;
 1385|  13.1M|			filter->client_next -= filter->avail;
 1386|       |			/* Copy buffer is now empty. */
 1387|  13.1M|			filter->avail = 0;
 1388|  13.1M|			filter->next = filter->buffer;
 1389|       |			/* Return data from client buffer. */
 1390|  13.1M|			if (avail != NULL)
  ------------------
  |  Branch (1390:8): [True: 12.8M, False: 251k]
  ------------------
 1391|  12.8M|				*avail = filter->client_avail;
 1392|  13.1M|			return (filter->client_next);
 1393|  13.1M|		}
 1394|       |
 1395|       |		/* Move data forward in copy buffer if necessary. */
 1396|  24.7k|		if (filter->next > filter->buffer &&
  ------------------
  |  Branch (1396:7): [True: 3.29k, False: 21.4k]
  ------------------
 1397|  3.29k|		    min > filter->buffer_size - (filter->next - filter->buffer)) {
  ------------------
  |  Branch (1397:7): [True: 372, False: 2.92k]
  ------------------
 1398|    372|			if (filter->avail > 0)
  ------------------
  |  Branch (1398:8): [True: 370, False: 2]
  ------------------
 1399|    370|				memmove(filter->buffer, filter->next,
 1400|    370|				    filter->avail);
 1401|    372|			filter->next = filter->buffer;
 1402|    372|		}
 1403|       |
 1404|       |		/* If we've used up the client data, get more. */
 1405|  24.7k|		if (filter->client_avail <= 0) {
  ------------------
  |  Branch (1405:7): [True: 16.3k, False: 8.36k]
  ------------------
 1406|  16.3k|			if (filter->end_of_file) {
  ------------------
  |  Branch (1406:8): [True: 2.49k, False: 13.8k]
  ------------------
 1407|  2.49k|				if (avail != NULL)
  ------------------
  |  Branch (1407:9): [True: 2.11k, False: 381]
  ------------------
 1408|  2.11k|					*avail = filter->avail;
 1409|  2.49k|				return (NULL);
 1410|  2.49k|			}
 1411|  13.8k|			bytes_read = (filter->vtable->read)(filter,
 1412|  13.8k|			    &filter->client_buff);
 1413|  13.8k|			if (bytes_read < 0) {		/* Read error. */
  ------------------
  |  Branch (1413:8): [True: 100, False: 13.7k]
  ------------------
 1414|    100|				filter->client_total = filter->client_avail = 0;
 1415|    100|				filter->client_next =
 1416|    100|				    filter->client_buff = NULL;
 1417|    100|				filter->fatal = 1;
 1418|    100|				if (avail != NULL)
  ------------------
  |  Branch (1418:9): [True: 59, False: 41]
  ------------------
 1419|     59|					*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|     59|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1420|    100|				return (NULL);
 1421|    100|			}
 1422|  13.7k|			if (bytes_read == 0) {
  ------------------
  |  Branch (1422:8): [True: 2.55k, False: 11.2k]
  ------------------
 1423|       |				/* Check for another client object first */
 1424|  2.55k|				if (filter->archive->client.cursor !=
  ------------------
  |  Branch (1424:9): [True: 0, False: 2.55k]
  ------------------
 1425|  2.55k|				      filter->archive->client.nodes - 1) {
 1426|      0|					if (client_switch_proxy(filter,
  ------------------
  |  Branch (1426:10): [True: 0, False: 0]
  ------------------
 1427|      0|					    filter->archive->client.cursor + 1)
 1428|      0|					    == ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1429|      0|						continue;
 1430|      0|				}
 1431|       |				/* Premature end-of-file. */
 1432|  2.55k|				filter->client_total = filter->client_avail = 0;
 1433|  2.55k|				filter->client_next =
 1434|  2.55k|				    filter->client_buff = NULL;
 1435|  2.55k|				filter->end_of_file = 1;
 1436|       |				/* Return whatever we do have. */
 1437|  2.55k|				if (avail != NULL)
  ------------------
  |  Branch (1437:9): [True: 2.40k, False: 151]
  ------------------
 1438|  2.40k|					*avail = filter->avail;
 1439|  2.55k|				return (NULL);
 1440|  2.55k|			}
 1441|  11.2k|			filter->client_total = bytes_read;
 1442|  11.2k|			filter->client_avail = filter->client_total;
 1443|  11.2k|			filter->client_next = filter->client_buff;
 1444|  11.2k|		} else {
 1445|       |			/*
 1446|       |			 * We can't satisfy the request from the copy
 1447|       |			 * buffer or the existing client data, so we
 1448|       |			 * need to copy more client data over to the
 1449|       |			 * copy buffer.
 1450|       |			 */
 1451|       |
 1452|       |			/* Ensure the buffer is big enough. */
 1453|  8.36k|			if (min > filter->buffer_size) {
  ------------------
  |  Branch (1453:8): [True: 1.66k, False: 6.69k]
  ------------------
 1454|  1.66k|				size_t s, t;
 1455|  1.66k|				char *p;
 1456|       |
 1457|       |				/* Double the buffer; watch for overflow. */
 1458|  1.66k|				s = t = filter->buffer_size;
 1459|  1.66k|				if (s == 0)
  ------------------
  |  Branch (1459:9): [True: 1.60k, False: 64]
  ------------------
 1460|  1.60k|					s = min;
 1461|  1.88k|				while (s < min) {
  ------------------
  |  Branch (1461:12): [True: 222, False: 1.66k]
  ------------------
 1462|    222|					t *= 2;
 1463|    222|					if (t <= s) { /* Integer overflow! */
  ------------------
  |  Branch (1463:10): [True: 0, False: 222]
  ------------------
 1464|      0|						archive_set_error(
 1465|      0|						    &filter->archive->archive,
 1466|      0|						    ENOMEM,
 1467|      0|						    "Unable to allocate copy"
 1468|      0|						    " buffer");
 1469|      0|						filter->fatal = 1;
 1470|      0|						if (avail != NULL)
  ------------------
  |  Branch (1470:11): [True: 0, False: 0]
  ------------------
 1471|      0|							*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1472|      0|						return (NULL);
 1473|      0|					}
 1474|    222|					s = t;
 1475|    222|				}
 1476|       |				/* Now s >= min, so allocate a new buffer. */
 1477|  1.66k|				p = malloc(s);
 1478|  1.66k|				if (p == NULL) {
  ------------------
  |  Branch (1478:9): [True: 0, False: 1.66k]
  ------------------
 1479|      0|					archive_set_error(
 1480|      0|						&filter->archive->archive,
 1481|      0|						ENOMEM,
 1482|      0|					    "Unable to allocate copy buffer");
 1483|      0|					filter->fatal = 1;
 1484|      0|					if (avail != NULL)
  ------------------
  |  Branch (1484:10): [True: 0, False: 0]
  ------------------
 1485|      0|						*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1486|      0|					return (NULL);
 1487|      0|				}
 1488|       |				/* Move data into newly-enlarged buffer. */
 1489|  1.66k|				if (filter->avail > 0)
  ------------------
  |  Branch (1489:9): [True: 36, False: 1.63k]
  ------------------
 1490|     36|					memmove(p, filter->next, filter->avail);
 1491|  1.66k|				free(filter->buffer);
 1492|  1.66k|				filter->next = filter->buffer = p;
 1493|  1.66k|				filter->buffer_size = s;
 1494|  1.66k|			}
 1495|       |
 1496|       |			/* We can add client data to copy buffer. */
 1497|       |			/* First estimate: copy to fill rest of buffer. */
 1498|  8.36k|			tocopy = (filter->buffer + filter->buffer_size)
 1499|  8.36k|			    - (filter->next + filter->avail);
 1500|       |			/* Don't waste time buffering more than we need to. */
 1501|  8.36k|			if (tocopy + filter->avail > min)
  ------------------
  |  Branch (1501:8): [True: 4.98k, False: 3.38k]
  ------------------
 1502|  4.98k|				tocopy = min - filter->avail;
 1503|       |			/* Don't copy more than is available. */
 1504|  8.36k|			if (tocopy > filter->client_avail)
  ------------------
  |  Branch (1504:8): [True: 5.00k, False: 3.36k]
  ------------------
 1505|  5.00k|				tocopy = filter->client_avail;
 1506|       |
 1507|  8.36k|			memcpy(filter->next + filter->avail,
 1508|  8.36k|			    filter->client_next, tocopy);
 1509|       |			/* Remove this data from client buffer. */
 1510|  8.36k|			filter->client_next += tocopy;
 1511|  8.36k|			filter->client_avail -= tocopy;
 1512|       |			/* add it to copy buffer. */
 1513|  8.36k|			filter->avail += tocopy;
 1514|  8.36k|		}
 1515|  24.7k|	}
 1516|  13.2M|}
__archive_read_consume:
 1523|  12.4M|{
 1524|  12.4M|	return (__archive_read_filter_consume(a->filter, request));
 1525|  12.4M|}
__archive_read_filter_consume:
 1530|  12.4M|{
 1531|  12.4M|	int64_t skipped;
 1532|       |
 1533|  12.4M|	if (request < 0)
  ------------------
  |  Branch (1533:6): [True: 8, False: 12.4M]
  ------------------
 1534|      8|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1535|  12.4M|	if (request == 0)
  ------------------
  |  Branch (1535:6): [True: 228k, False: 12.2M]
  ------------------
 1536|   228k|		return 0;
 1537|       |
 1538|  12.2M|	skipped = advance_file_pointer(filter, request);
 1539|  12.2M|	if (skipped == request)
  ------------------
  |  Branch (1539:6): [True: 12.2M, False: 433]
  ------------------
 1540|  12.2M|		return (skipped);
 1541|       |	/* We hit EOF before we satisfied the skip request. */
 1542|    433|	if (skipped < 0)  /* Map error code to 0 for error message below. */
  ------------------
  |  Branch (1542:6): [True: 4, False: 429]
  ------------------
 1543|      4|		skipped = 0;
 1544|    433|	archive_set_error(&filter->archive->archive,
 1545|    433|	    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    433|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1546|    433|	    "Truncated input file (needed %jd bytes, only %jd available)",
 1547|    433|	    (intmax_t)request, (intmax_t)skipped);
 1548|    433|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    433|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1549|  12.2M|}
__archive_read_seek:
 1646|  3.36k|{
 1647|  3.36k|	return __archive_read_filter_seek(a->filter, offset, whence);
 1648|  3.36k|}
__archive_read_filter_seek:
 1653|  3.36k|{
 1654|  3.36k|	struct archive_read_client *client;
 1655|  3.36k|	int64_t r;
 1656|  3.36k|	unsigned int cursor;
 1657|       |
 1658|  3.36k|	if (filter->closed || filter->fatal)
  ------------------
  |  Branch (1658:6): [True: 0, False: 3.36k]
  |  Branch (1658:24): [True: 17, False: 3.34k]
  ------------------
 1659|     17|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     17|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1660|  3.34k|	if (filter->can_seek == 0)
  ------------------
  |  Branch (1660:6): [True: 58, False: 3.28k]
  ------------------
 1661|     58|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     58|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1662|       |
 1663|  3.28k|	client = &(filter->archive->client);
 1664|  3.28k|	switch (whence) {
 1665|      0|	case SEEK_CUR:
  ------------------
  |  Branch (1665:2): [True: 0, False: 3.28k]
  ------------------
 1666|       |		/* Adjust the offset and use SEEK_SET instead */
 1667|      0|		offset += filter->position;
 1668|      0|		__LA_FALLTHROUGH;
 1669|    801|	case SEEK_SET:
  ------------------
  |  Branch (1669:2): [True: 801, False: 2.48k]
  ------------------
 1670|    801|		cursor = 0;
 1671|    801|		while (1)
  ------------------
  |  Branch (1671:10): [True: 801, Folded]
  ------------------
 1672|    801|		{
 1673|    801|			if (client->dataset[cursor].begin_position < 0 ||
  ------------------
  |  Branch (1673:8): [True: 0, False: 801]
  ------------------
 1674|    801|			    client->dataset[cursor].total_size < 0 ||
  ------------------
  |  Branch (1674:8): [True: 151, False: 650]
  ------------------
 1675|    650|			    client->dataset[cursor].begin_position +
  ------------------
  |  Branch (1675:8): [True: 650, False: 0]
  ------------------
 1676|    650|			      client->dataset[cursor].total_size - 1 > offset ||
 1677|      0|			    cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1677:8): [True: 0, False: 0]
  ------------------
 1678|    801|				break;
 1679|      0|			r = client->dataset[cursor].begin_position +
 1680|      0|				client->dataset[cursor].total_size;
 1681|      0|			client->dataset[++cursor].begin_position = r;
 1682|      0|		}
 1683|    801|		while (1) {
  ------------------
  |  Branch (1683:10): [True: 801, Folded]
  ------------------
 1684|    801|			r = client_switch_proxy(filter, cursor);
 1685|    801|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    801|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1685:8): [True: 0, False: 801]
  ------------------
 1686|      0|				return r;
 1687|    801|			if ((r = client_seek_proxy(filter, 0, SEEK_END)) < 0)
  ------------------
  |  Branch (1687:8): [True: 0, False: 801]
  ------------------
 1688|      0|				return r;
 1689|    801|			client->dataset[cursor].total_size = r;
 1690|    801|			if (client->dataset[cursor].begin_position +
  ------------------
  |  Branch (1690:8): [True: 797, False: 4]
  ------------------
 1691|    801|			    client->dataset[cursor].total_size - 1 > offset ||
 1692|      4|			    cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1692:8): [True: 4, False: 0]
  ------------------
 1693|    801|				break;
 1694|      0|			r = client->dataset[cursor].begin_position +
 1695|      0|				client->dataset[cursor].total_size;
 1696|      0|			client->dataset[++cursor].begin_position = r;
 1697|      0|		}
 1698|    801|		offset -= client->dataset[cursor].begin_position;
 1699|    801|		if (offset < 0
  ------------------
  |  Branch (1699:7): [True: 0, False: 801]
  ------------------
 1700|    801|		    || offset > client->dataset[cursor].total_size)
  ------------------
  |  Branch (1700:10): [True: 4, False: 797]
  ------------------
 1701|      4|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1702|    797|		if ((r = client_seek_proxy(filter, offset, SEEK_SET)) < 0)
  ------------------
  |  Branch (1702:7): [True: 0, False: 797]
  ------------------
 1703|      0|			return r;
 1704|    797|		break;
 1705|       |
 1706|  2.48k|	case SEEK_END:
  ------------------
  |  Branch (1706:2): [True: 2.48k, False: 801]
  ------------------
 1707|  2.48k|		cursor = 0;
 1708|  2.48k|		while (1) {
  ------------------
  |  Branch (1708:10): [True: 2.48k, Folded]
  ------------------
 1709|  2.48k|			if (client->dataset[cursor].begin_position < 0 ||
  ------------------
  |  Branch (1709:8): [True: 0, False: 2.48k]
  ------------------
 1710|  2.48k|			    client->dataset[cursor].total_size < 0 ||
  ------------------
  |  Branch (1710:8): [True: 1.23k, False: 1.25k]
  ------------------
 1711|  1.25k|			    cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1711:8): [True: 1.25k, False: 0]
  ------------------
 1712|  2.48k|				break;
 1713|      0|			r = client->dataset[cursor].begin_position +
 1714|      0|				client->dataset[cursor].total_size;
 1715|      0|			client->dataset[++cursor].begin_position = r;
 1716|      0|		}
 1717|  2.48k|		while (1) {
  ------------------
  |  Branch (1717:10): [True: 2.48k, Folded]
  ------------------
 1718|  2.48k|			r = client_switch_proxy(filter, cursor);
 1719|  2.48k|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.48k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1719:8): [True: 0, False: 2.48k]
  ------------------
 1720|      0|				return r;
 1721|  2.48k|			if ((r = client_seek_proxy(filter, 0, SEEK_END)) < 0)
  ------------------
  |  Branch (1721:8): [True: 0, False: 2.48k]
  ------------------
 1722|      0|				return r;
 1723|  2.48k|			client->dataset[cursor].total_size = r;
 1724|  2.48k|			r = client->dataset[cursor].begin_position +
 1725|  2.48k|				client->dataset[cursor].total_size;
 1726|  2.48k|			if (cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1726:8): [True: 2.48k, False: 0]
  ------------------
 1727|  2.48k|				break;
 1728|      0|			client->dataset[++cursor].begin_position = r;
 1729|      0|		}
 1730|  2.48k|		while (1) {
  ------------------
  |  Branch (1730:10): [True: 2.48k, Folded]
  ------------------
 1731|  2.48k|			if (r + offset >=
  ------------------
  |  Branch (1731:8): [True: 2.48k, False: 0]
  ------------------
 1732|  2.48k|			    client->dataset[cursor].begin_position)
 1733|  2.48k|				break;
 1734|      0|			offset += client->dataset[cursor].total_size;
 1735|      0|			if (cursor == 0)
  ------------------
  |  Branch (1735:8): [True: 0, False: 0]
  ------------------
 1736|      0|				break;
 1737|      0|			cursor--;
 1738|      0|			r = client->dataset[cursor].begin_position +
 1739|      0|				client->dataset[cursor].total_size;
 1740|      0|		}
 1741|  2.48k|		offset = (r + offset) - client->dataset[cursor].begin_position;
 1742|  2.48k|		if ((r = client_switch_proxy(filter, cursor)) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.48k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1742:7): [True: 0, False: 2.48k]
  ------------------
 1743|      0|			return r;
 1744|  2.48k|		r = client_seek_proxy(filter, offset, SEEK_SET);
 1745|  2.48k|		if (r < ARCHIVE_OK)
  ------------------
  |  |  233|  2.48k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1745:7): [True: 0, False: 2.48k]
  ------------------
 1746|      0|			return r;
 1747|  2.48k|		break;
 1748|       |
 1749|  2.48k|	default:
  ------------------
  |  Branch (1749:2): [True: 0, False: 3.28k]
  ------------------
 1750|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1751|  3.28k|	}
 1752|  3.28k|	r += client->dataset[cursor].begin_position;
 1753|       |
 1754|  3.28k|	if (r >= 0) {
  ------------------
  |  Branch (1754:6): [True: 3.28k, False: 0]
  ------------------
 1755|       |		/*
 1756|       |		 * Ouch.  Clearing the buffer like this hurts, especially
 1757|       |		 * at bid time.  A lot of our efficiency at bid time comes
 1758|       |		 * from having bidders reuse the data we've already read.
 1759|       |		 *
 1760|       |		 * TODO: If the seek request is in data we already
 1761|       |		 * have, then don't call the seek callback.
 1762|       |		 *
 1763|       |		 * TODO: Zip seeks to end-of-file at bid time.  If
 1764|       |		 * other formats also start doing this, we may need to
 1765|       |		 * find a way for clients to fudge the seek offset to
 1766|       |		 * a block boundary.
 1767|       |		 *
 1768|       |		 * Hmmm... If whence was SEEK_END, we know the file
 1769|       |		 * size is (r - offset).  Can we use that to simplify
 1770|       |		 * the TODO items above?
 1771|       |		 */
 1772|  3.28k|		filter->avail = filter->client_avail = 0;
 1773|  3.28k|		filter->next = filter->buffer;
 1774|  3.28k|		filter->position = r;
 1775|  3.28k|		filter->end_of_file = 0;
 1776|  3.28k|	}
 1777|  3.28k|	return r;
 1778|  3.28k|}
archive_read.c:_archive_read_free:
 1093|  2.49k|{
 1094|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
 1095|  2.49k|	struct archive_read_passphrase *p;
 1096|  2.49k|	int i, n;
 1097|  2.49k|	int slots;
 1098|  2.49k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1099|       |
 1100|  2.49k|	if (_a == NULL)
  ------------------
  |  Branch (1100:6): [True: 0, False: 2.49k]
  ------------------
 1101|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1102|  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]
  |  |  ------------------
  ------------------
 1103|  2.49k|	    ARCHIVE_STATE_ANY | ARCHIVE_STATE_FATAL, "archive_read_free");
 1104|  2.49k|	if (a->archive.state != ARCHIVE_STATE_CLOSED
  ------------------
  |  |   68|  4.99k|#define	ARCHIVE_STATE_CLOSED	0x20U
  ------------------
  |  Branch (1104:6): [True: 2.49k, False: 0]
  ------------------
 1105|  2.49k|	    && a->archive.state != ARCHIVE_STATE_FATAL)
  ------------------
  |  |   69|  2.49k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  |  Branch (1105:9): [True: 0, False: 2.49k]
  ------------------
 1106|      0|		r = archive_read_close(&a->archive);
 1107|       |
 1108|       |	/* Call cleanup functions registered by optional components. */
 1109|  2.49k|	if (a->cleanup_archive_extract != NULL)
  ------------------
  |  Branch (1109:6): [True: 0, False: 2.49k]
  ------------------
 1110|      0|		r = (a->cleanup_archive_extract)(a);
 1111|       |
 1112|       |	/* Cleanup format-specific data. */
 1113|  2.49k|	slots = sizeof(a->formats) / sizeof(a->formats[0]);
 1114|  42.4k|	for (i = 0; i < slots; i++) {
  ------------------
  |  Branch (1114:14): [True: 39.9k, False: 2.49k]
  ------------------
 1115|  39.9k|		a->format = &(a->formats[i]);
 1116|  39.9k|		if (a->formats[i].cleanup)
  ------------------
  |  Branch (1116:7): [True: 37.4k, False: 2.49k]
  ------------------
 1117|  37.4k|			(a->formats[i].cleanup)(a);
 1118|  39.9k|	}
 1119|       |
 1120|       |	/* Free the filters */
 1121|  2.49k|	__archive_read_free_filters(a);
 1122|       |
 1123|       |	/* Release the bidder objects. */
 1124|  2.49k|	n = sizeof(a->bidders)/sizeof(a->bidders[0]);
 1125|  42.4k|	for (i = 0; i < n; i++) {
  ------------------
  |  Branch (1125:14): [True: 39.9k, False: 2.49k]
  ------------------
 1126|  39.9k|		if (a->bidders[i].vtable == NULL ||
  ------------------
  |  Branch (1126:7): [True: 7.49k, False: 32.4k]
  ------------------
 1127|  32.4k|		    a->bidders[i].vtable->free == NULL)
  ------------------
  |  Branch (1127:7): [True: 32.4k, False: 0]
  ------------------
 1128|  39.9k|			continue;
 1129|      0|		(a->bidders[i].vtable->free)(&a->bidders[i]);
 1130|      0|	}
 1131|       |
 1132|       |	/* Release passphrase list. */
 1133|  2.49k|	p = a->passphrases.first;
 1134|  4.99k|	while (p != NULL) {
  ------------------
  |  Branch (1134:9): [True: 2.49k, False: 2.49k]
  ------------------
 1135|  2.49k|		struct archive_read_passphrase *np = p->next;
 1136|       |
 1137|       |		/* A passphrase should be cleaned. */
 1138|  2.49k|		memset(p->passphrase, 0, strlen(p->passphrase));
 1139|  2.49k|		free(p->passphrase);
 1140|  2.49k|		free(p);
 1141|  2.49k|		p = np;
 1142|  2.49k|	}
 1143|       |
 1144|  2.49k|	archive_string_free(&a->archive.error_string);
 1145|  2.49k|	archive_entry_free(a->entry);
 1146|  2.49k|	a->archive.magic = 0;
 1147|  2.49k|	__archive_clean(&a->archive);
 1148|  2.49k|	free(a->client.dataset);
 1149|  2.49k|	free(a);
 1150|  2.49k|	return (r);
 1151|  2.49k|}
archive_read.c:_archive_read_next_header:
  686|   298k|{
  687|   298k|	int ret;
  688|   298k|	struct archive_read *a = (struct archive_read *)_a;
  689|       |	*entryp = NULL;
  690|   298k|	ret = _archive_read_next_header2(_a, a->entry);
  691|   298k|	*entryp = a->entry;
  692|   298k|	return ret;
  693|   298k|}
archive_read.c:_archive_read_next_header2:
  622|   298k|{
  623|   298k|	struct archive_read *a = (struct archive_read *)_a;
  624|   298k|	int r1 = ARCHIVE_OK, r2;
  ------------------
  |  |  233|   298k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  625|       |
  626|   298k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  151|   298k|	do { \
  |  |  152|   298k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|   298k|			(allowed_states), (function_name)); \
  |  |  154|   298k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|   298k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 0, False: 298k]
  |  |  ------------------
  |  |  155|   298k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|   298k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 298k]
  |  |  ------------------
  ------------------
  627|   298k|	    ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA,
  628|   298k|	    "archive_read_next_header");
  629|       |
  630|   298k|	archive_entry_clear(entry);
  631|   298k|	archive_clear_error(&a->archive);
  632|       |
  633|       |	/*
  634|       |	 * If client didn't consume entire data, skip any remainder
  635|       |	 * (This is especially important for GNU incremental directories.)
  636|       |	 */
  637|   298k|	if (a->archive.state == ARCHIVE_STATE_DATA) {
  ------------------
  |  |   66|   298k|#define	ARCHIVE_STATE_DATA	4U
  ------------------
  |  Branch (637:6): [True: 84.1k, False: 214k]
  ------------------
  638|  84.1k|		r1 = archive_read_data_skip(&a->archive);
  639|  84.1k|		if (r1 == ARCHIVE_EOF)
  ------------------
  |  |  232|  84.1k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (639:7): [True: 0, False: 84.1k]
  ------------------
  640|      0|			archive_set_error(&a->archive, EIO,
  641|      0|			    "Premature end-of-file");
  642|  84.1k|		if (r1 == ARCHIVE_EOF || r1 == ARCHIVE_FATAL) {
  ------------------
  |  |  232|   168k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
              		if (r1 == ARCHIVE_EOF || r1 == ARCHIVE_FATAL) {
  ------------------
  |  |  239|  84.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (642:7): [True: 0, False: 84.1k]
  |  Branch (642:28): [True: 252, False: 83.9k]
  ------------------
  643|    252|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|    252|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  644|    252|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    252|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  645|    252|		}
  646|  84.1k|	}
  647|       |
  648|       |	/* Record start-of-header offset in uncompressed stream. */
  649|   298k|	a->header_position = a->filter->position;
  650|       |
  651|   298k|	++_a->file_count;
  652|   298k|	r2 = (a->format->read_header)(a, entry);
  653|       |
  654|       |	/*
  655|       |	 * EOF and FATAL are persistent at this layer.  By
  656|       |	 * modifying the state, we guarantee that future calls to
  657|       |	 * read a header or read data will fail.
  658|       |	 */
  659|   298k|	switch (r2) {
  ------------------
  |  Branch (659:10): [True: 298k, False: 1]
  ------------------
  660|    311|	case ARCHIVE_EOF:
  ------------------
  |  |  232|    311|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (660:2): [True: 311, False: 298k]
  ------------------
  661|    311|		a->archive.state = ARCHIVE_STATE_EOF;
  ------------------
  |  |   67|    311|#define	ARCHIVE_STATE_EOF	0x10U
  ------------------
  662|    311|		--_a->file_count;/* Revert a file counter. */
  663|    311|		break;
  664|  71.1k|	case ARCHIVE_OK:
  ------------------
  |  |  233|  71.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (664:2): [True: 71.1k, False: 227k]
  ------------------
  665|  71.1k|		a->archive.state = ARCHIVE_STATE_DATA;
  ------------------
  |  |   66|  71.1k|#define	ARCHIVE_STATE_DATA	4U
  ------------------
  666|  71.1k|		break;
  667|  13.3k|	case ARCHIVE_WARN:
  ------------------
  |  |  235|  13.3k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (667:2): [True: 13.3k, False: 285k]
  ------------------
  668|  13.3k|		a->archive.state = ARCHIVE_STATE_DATA;
  ------------------
  |  |   66|  13.3k|#define	ARCHIVE_STATE_DATA	4U
  ------------------
  669|  13.3k|		break;
  670|   212k|	case ARCHIVE_RETRY:
  ------------------
  |  |  234|   212k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (670:2): [True: 212k, False: 86.3k]
  ------------------
  671|   212k|		break;
  672|  1.48k|	case ARCHIVE_FATAL:
  ------------------
  |  |  239|  1.48k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (672:2): [True: 1.48k, False: 297k]
  ------------------
  673|  1.48k|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|  1.48k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  674|  1.48k|		break;
  675|   298k|	}
  676|       |
  677|   298k|	__archive_reset_read_data(&a->archive);
  678|       |
  679|   298k|	a->data_start_node = a->client.cursor;
  680|       |	/* EOF always wins; otherwise return the worst error. */
  681|   298k|	return (r2 < r1 || r2 == ARCHIVE_EOF) ? r2 : r1;
  ------------------
  |  |  232|  71.6k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (681:10): [True: 226k, False: 71.6k]
  |  Branch (681:21): [True: 311, False: 71.3k]
  ------------------
  682|   298k|}
archive_read.c:_archive_read_data_block:
  991|   150k|{
  992|   150k|	struct archive_read *a = (struct archive_read *)_a;
  993|   150k|	int r;
  994|       |
  995|   150k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_DATA,
  ------------------
  |  |  151|   150k|	do { \
  |  |  152|   150k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  153|   150k|			(allowed_states), (function_name)); \
  |  |  154|   150k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|   150k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (154:7): [True: 1, False: 150k]
  |  |  ------------------
  |  |  155|   150k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  156|   150k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (156:11): [Folded, False: 150k]
  |  |  ------------------
  ------------------
  996|   150k|	    "archive_read_data_block");
  997|       |
  998|   150k|	if (a->format->read_data == NULL) {
  ------------------
  |  Branch (998:6): [True: 0, False: 150k]
  ------------------
  999|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1000|      0|		    "Internal error: "
 1001|      0|		    "No format->read_data function registered");
 1002|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
 1003|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1004|      0|	}
 1005|       |
 1006|   150k|	r = (a->format->read_data)(a, buff, size, offset);
 1007|   150k|	if (r == ARCHIVE_FATAL)
  ------------------
  |  |  239|   150k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1007:6): [True: 392, False: 149k]
  ------------------
 1008|    392|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   69|    392|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
 1009|   150k|	return (r);
 1010|   150k|}
archive_read.c:_archive_filter_bytes:
 1194|    263|{
 1195|    263|	struct archive_read_filter *f = get_filter(_a, n);
 1196|    263|	return f == NULL ? -1 : f->position;
  ------------------
  |  Branch (1196:9): [True: 0, False: 263]
  ------------------
 1197|    263|}
archive_read.c:get_filter:
 1155|    263|{
 1156|    263|	struct archive_read *a = (struct archive_read *)_a;
 1157|    263|	struct archive_read_filter *f = a->filter;
 1158|       |	/* We use n == -1 for 'the last filter', which is always the
 1159|       |	 * client proxy. */
 1160|    263|	if (n == -1 && f != NULL) {
  ------------------
  |  Branch (1160:6): [True: 0, False: 263]
  |  Branch (1160:17): [True: 0, False: 0]
  ------------------
 1161|      0|		struct archive_read_filter *last = f;
 1162|      0|		f = f->upstream;
 1163|      0|		while (f != NULL) {
  ------------------
  |  Branch (1163:10): [True: 0, False: 0]
  ------------------
 1164|      0|			last = f;
 1165|      0|			f = f->upstream;
 1166|      0|		}
 1167|      0|		return (last);
 1168|      0|	}
 1169|    263|	if (n < 0)
  ------------------
  |  Branch (1169:6): [True: 0, False: 263]
  ------------------
 1170|      0|		return NULL;
 1171|    263|	while (n > 0 && f != NULL) {
  ------------------
  |  Branch (1171:9): [True: 0, False: 263]
  |  Branch (1171:18): [True: 0, False: 0]
  ------------------
 1172|      0|		f = f->upstream;
 1173|      0|		--n;
 1174|      0|	}
 1175|    263|	return (f);
 1176|    263|}
archive_read.c:read_client_close_proxy:
  236|  2.49k|{
  237|  2.49k|	int r = ARCHIVE_OK, r2;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  238|  2.49k|	unsigned int i;
  239|       |
  240|  2.49k|	if (a->client.closer == NULL)
  ------------------
  |  Branch (240:6): [True: 0, False: 2.49k]
  ------------------
  241|      0|		return (r);
  242|  4.99k|	for (i = 0; i < a->client.nodes; i++)
  ------------------
  |  Branch (242:14): [True: 2.49k, False: 2.49k]
  ------------------
  243|  2.49k|	{
  244|  2.49k|		r2 = (a->client.closer)
  245|  2.49k|			((struct archive *)a, a->client.dataset[i].data);
  246|  2.49k|		if (r > r2)
  ------------------
  |  Branch (246:7): [True: 0, False: 2.49k]
  ------------------
  247|      0|			r = r2;
  248|  2.49k|	}
  249|  2.49k|	return (r);
  250|  2.49k|}
archive_read.c:client_read_proxy:
  166|  7.25k|{
  167|  7.25k|	ssize_t r;
  168|  7.25k|	r = (self->archive->client.reader)(&self->archive->archive,
  169|  7.25k|	    self->data, buff);
  170|  7.25k|	return (r);
  171|  7.25k|}
archive_read.c:client_close_proxy:
  254|  2.49k|{
  255|  2.49k|	return read_client_close_proxy(self->archive);
  256|  2.49k|}
archive_read.c:client_switch_proxy:
  260|  8.21k|{
  261|  8.21k|	struct archive_read *a;
  262|  8.21k|	int r1 = ARCHIVE_OK, r2 = ARCHIVE_OK;
  ------------------
  |  |  233|  8.21k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	int r1 = ARCHIVE_OK, r2 = ARCHIVE_OK;
  ------------------
  |  |  233|  8.21k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  263|  8.21k|	void *data2;
  264|       |
  265|  8.50k|	while (self->upstream != NULL)
  ------------------
  |  Branch (265:9): [True: 287, False: 8.21k]
  ------------------
  266|    287|		self = self->upstream;
  267|  8.21k|	a = self->archive;
  268|       |
  269|       |	/* Don't do anything if already in the specified data node */
  270|  8.21k|	if (a->client.cursor == iindex)
  ------------------
  |  Branch (270:6): [True: 8.21k, False: 0]
  ------------------
  271|  8.21k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  8.21k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  272|       |
  273|      0|	a->client.cursor = iindex;
  274|      0|	data2 = a->client.dataset[a->client.cursor].data;
  275|      0|	if (a->client.switcher != NULL)
  ------------------
  |  Branch (275:6): [True: 0, False: 0]
  ------------------
  276|      0|	{
  277|      0|		r1 = r2 = (a->client.switcher)
  278|      0|			((struct archive *)a, self->data, data2);
  279|      0|		self->data = data2;
  280|      0|	}
  281|      0|	else
  282|      0|	{
  283|       |		/* Attempt to call close and open instead */
  284|      0|		if (a->client.closer != NULL)
  ------------------
  |  Branch (284:7): [True: 0, False: 0]
  ------------------
  285|      0|			r1 = (a->client.closer)
  286|      0|				((struct archive *)a, self->data);
  287|      0|		self->data = data2;
  288|      0|		if (a->client.opener != NULL)
  ------------------
  |  Branch (288:7): [True: 0, False: 0]
  ------------------
  289|      0|			r2 = (a->client.opener)
  290|      0|				((struct archive *)a, self->data);
  291|      0|	}
  292|      0|	return (r1 < r2) ? r1 : r2;
  ------------------
  |  Branch (292:9): [True: 0, False: 0]
  ------------------
  293|  8.21k|}
archive_read.c:choose_filters:
  556|  2.49k|{
  557|  2.49k|	int number_bidders, i, bid, best_bid, number_filters;
  558|  2.49k|	struct archive_read_filter_bidder *bidder, *best_bidder;
  559|  2.49k|	struct archive_read_filter *filter;
  560|  2.49k|	ssize_t avail;
  561|  2.49k|	int r;
  562|       |
  563|  2.86k|	for (number_filters = 0; number_filters < MAX_NUMBER_FILTERS; ++number_filters) {
  ------------------
  |  |  552|  2.86k|#define MAX_NUMBER_FILTERS 25
  ------------------
  |  Branch (563:27): [True: 2.86k, False: 0]
  ------------------
  564|  2.86k|		number_bidders = sizeof(a->bidders) / sizeof(a->bidders[0]);
  565|       |
  566|  2.86k|		best_bid = 0;
  567|  2.86k|		best_bidder = NULL;
  568|       |
  569|  2.86k|		bidder = a->bidders;
  570|  48.6k|		for (i = 0; i < number_bidders; i++, bidder++) {
  ------------------
  |  Branch (570:15): [True: 45.8k, False: 2.86k]
  ------------------
  571|  45.8k|			if (bidder->vtable == NULL)
  ------------------
  |  Branch (571:8): [True: 8.58k, False: 37.2k]
  ------------------
  572|  8.58k|				continue;
  573|  37.2k|			bid = (bidder->vtable->bid)(bidder, a->filter);
  574|  37.2k|			if (bid > best_bid) {
  ------------------
  |  Branch (574:8): [True: 364, False: 36.8k]
  ------------------
  575|    364|				best_bid = bid;
  576|    364|				best_bidder = bidder;
  577|    364|			}
  578|  37.2k|		}
  579|       |
  580|       |		/* If no bidder, we're done. */
  581|  2.86k|		if (best_bidder == NULL) {
  ------------------
  |  Branch (581:7): [True: 2.49k, False: 364]
  ------------------
  582|       |			/* Verify the filter by asking it for some data. */
  583|  2.49k|			__archive_read_filter_ahead(a->filter, 1, &avail);
  584|  2.49k|			if (avail < 0) {
  ------------------
  |  Branch (584:8): [True: 41, False: 2.45k]
  ------------------
  585|     41|				__archive_read_free_filters(a);
  586|     41|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     41|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  587|     41|			}
  588|  2.45k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.45k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  589|  2.49k|		}
  590|       |
  591|    364|		filter = calloc(1, sizeof(*filter));
  592|    364|		if (filter == NULL)
  ------------------
  |  Branch (592:7): [True: 0, False: 364]
  ------------------
  593|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  594|    364|		filter->bidder = best_bidder;
  595|    364|		filter->archive = a;
  596|    364|		filter->upstream = a->filter;
  597|    364|		a->filter = filter;
  598|    364|		r = (best_bidder->vtable->init)(a->filter);
  599|    364|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|    364|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (599:7): [True: 0, False: 364]
  ------------------
  600|      0|			__archive_read_free_filters(a);
  601|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  602|      0|		}
  603|    364|	}
  604|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  605|      0|	    "Input requires too many filters for decoding");
  606|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  607|  2.49k|}
archive_read.c:choose_format:
  701|  2.45k|{
  702|  2.45k|	int slots;
  703|  2.45k|	int i;
  704|  2.45k|	int bid, best_bid;
  705|  2.45k|	int best_bid_slot;
  706|       |
  707|  2.45k|	slots = sizeof(a->formats) / sizeof(a->formats[0]);
  708|  2.45k|	best_bid = -1;
  709|  2.45k|	best_bid_slot = -1;
  710|       |
  711|       |	/* Set up a->format for convenience of bidders. */
  712|  2.45k|	a->format = &(a->formats[0]);
  713|  41.7k|	for (i = 0; i < slots; i++, a->format++) {
  ------------------
  |  Branch (713:14): [True: 39.3k, False: 2.45k]
  ------------------
  714|  39.3k|		if (a->format->bid) {
  ------------------
  |  Branch (714:7): [True: 39.3k, False: 0]
  ------------------
  715|  39.3k|			bid = (a->format->bid)(a, best_bid);
  716|  39.3k|			if (bid == ARCHIVE_FATAL)
  ------------------
  |  |  239|  39.3k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (716:8): [True: 0, False: 39.3k]
  ------------------
  717|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  718|  39.3k|			if (a->filter->position != 0)
  ------------------
  |  Branch (718:8): [True: 547, False: 38.7k]
  ------------------
  719|    547|				__archive_read_seek(a, 0, SEEK_SET);
  720|  39.3k|			if ((bid > best_bid) || (best_bid_slot < 0)) {
  ------------------
  |  Branch (720:8): [True: 4.94k, False: 34.3k]
  |  Branch (720:28): [True: 2.43k, False: 31.9k]
  ------------------
  721|  7.38k|				best_bid = bid;
  722|  7.38k|				best_bid_slot = i;
  723|  7.38k|			}
  724|  39.3k|		}
  725|  39.3k|	}
  726|       |
  727|       |	/*
  728|       |	 * There were no bidders; this is a serious programmer error
  729|       |	 * and demands a quick and definitive abort.
  730|       |	 */
  731|  2.45k|	if (best_bid_slot < 0) {
  ------------------
  |  Branch (731:6): [True: 0, False: 2.45k]
  ------------------
  732|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  733|      0|		    "No formats registered");
  734|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  735|      0|	}
  736|       |
  737|       |	/*
  738|       |	 * There were bidders, but no non-zero bids; this means we
  739|       |	 * can't support this stream.
  740|       |	 */
  741|  2.45k|	if (best_bid < 1) {
  ------------------
  |  Branch (741:6): [True: 17, False: 2.44k]
  ------------------
  742|     17|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     17|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  743|     17|		    "Unrecognized archive format");
  744|     17|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     17|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  745|     17|	}
  746|       |
  747|  2.44k|	return (best_bid_slot);
  748|  2.45k|}
archive_read.c:close_filters:
 1014|  2.55k|{
 1015|  2.55k|	struct archive_read_filter *f = a->filter;
 1016|  2.55k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  2.55k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1017|       |	/* Close each filter in the pipeline. */
 1018|  5.45k|	while (f != NULL) {
  ------------------
  |  Branch (1018:9): [True: 2.89k, False: 2.55k]
  ------------------
 1019|  2.89k|		struct archive_read_filter *t = f->upstream;
 1020|  2.89k|		if (!f->closed && f->vtable != NULL) {
  ------------------
  |  Branch (1020:7): [True: 2.86k, False: 35]
  |  Branch (1020:21): [True: 2.86k, False: 0]
  ------------------
 1021|  2.86k|			int r1 = (f->vtable->close)(f);
 1022|  2.86k|			f->closed = 1;
 1023|  2.86k|			if (r1 < r)
  ------------------
  |  Branch (1023:8): [True: 0, False: 2.86k]
  ------------------
 1024|      0|				r = r1;
 1025|  2.86k|		}
 1026|  2.89k|		free(f->buffer);
 1027|       |		f->buffer = NULL;
 1028|  2.89k|		f = t;
 1029|  2.89k|	}
 1030|  2.55k|	return r;
 1031|  2.55k|}
archive_read.c:advance_file_pointer:
 1559|  12.2M|{
 1560|  12.2M|	int64_t bytes_skipped, total_bytes_skipped = 0;
 1561|  12.2M|	ssize_t bytes_read;
 1562|  12.2M|	size_t min;
 1563|       |
 1564|  12.2M|	if (filter->fatal)
  ------------------
  |  Branch (1564:6): [True: 1, False: 12.2M]
  ------------------
 1565|      1|		return (-1);
 1566|       |
 1567|       |	/* Use up the copy buffer first. */
 1568|  12.2M|	if (filter->avail > 0) {
  ------------------
  |  Branch (1568:6): [True: 86.8k, False: 12.1M]
  ------------------
 1569|  86.8k|		min = (size_t)minimum(request, (int64_t)filter->avail);
  ------------------
  |  |   58|  86.8k|#define minimum(a, b) (a < b ? a : b)
  |  |  ------------------
  |  |  |  Branch (58:24): [True: 86.6k, False: 144]
  |  |  ------------------
  ------------------
 1570|  86.8k|		filter->next += min;
 1571|  86.8k|		filter->avail -= min;
 1572|  86.8k|		request -= min;
 1573|  86.8k|		filter->position += min;
 1574|  86.8k|		total_bytes_skipped += min;
 1575|  86.8k|	}
 1576|       |
 1577|       |	/* Then use up the client buffer. */
 1578|  12.2M|	if (filter->client_avail > 0) {
  ------------------
  |  Branch (1578:6): [True: 12.1M, False: 83.7k]
  ------------------
 1579|  12.1M|		min = (size_t)minimum(request, (int64_t)filter->client_avail);
  ------------------
  |  |   58|  12.1M|#define minimum(a, b) (a < b ? a : b)
  |  |  ------------------
  |  |  |  Branch (58:24): [True: 12.1M, False: 4.38k]
  |  |  ------------------
  ------------------
 1580|  12.1M|		filter->client_next += min;
 1581|  12.1M|		filter->client_avail -= min;
 1582|  12.1M|		request -= min;
 1583|  12.1M|		filter->position += min;
 1584|  12.1M|		total_bytes_skipped += min;
 1585|  12.1M|	}
 1586|  12.2M|	if (request == 0)
  ------------------
  |  Branch (1586:6): [True: 12.2M, False: 511]
  ------------------
 1587|  12.2M|		return (total_bytes_skipped);
 1588|       |
 1589|       |	/* If there's an optimized skip function, use it. */
 1590|    511|	if (filter->can_skip != 0) {
  ------------------
  |  Branch (1590:6): [True: 424, False: 87]
  ------------------
 1591|    424|		bytes_skipped = client_skip_proxy(filter, request);
 1592|    424|		if (bytes_skipped < 0) {	/* error */
  ------------------
  |  Branch (1592:7): [True: 0, False: 424]
  ------------------
 1593|      0|			filter->fatal = 1;
 1594|      0|			return (bytes_skipped);
 1595|      0|		}
 1596|    424|		filter->position += bytes_skipped;
 1597|    424|		total_bytes_skipped += bytes_skipped;
 1598|    424|		request -= bytes_skipped;
 1599|    424|		if (request == 0)
  ------------------
  |  Branch (1599:7): [True: 0, False: 424]
  ------------------
 1600|      0|			return (total_bytes_skipped);
 1601|    424|	}
 1602|       |
 1603|       |	/* Use ordinary reads as necessary to complete the request. */
 1604|    843|	for (;;) {
 1605|    843|		bytes_read = (filter->vtable->read)(filter, &filter->client_buff);
 1606|    843|		if (bytes_read < 0) {
  ------------------
  |  Branch (1606:7): [True: 3, False: 840]
  ------------------
 1607|      3|			filter->client_buff = NULL;
 1608|      3|			filter->fatal = 1;
 1609|      3|			return (bytes_read);
 1610|      3|		}
 1611|       |
 1612|    840|		if (bytes_read == 0) {
  ------------------
  |  Branch (1612:7): [True: 429, False: 411]
  ------------------
 1613|    429|			if (filter->archive->client.cursor !=
  ------------------
  |  Branch (1613:8): [True: 0, False: 429]
  ------------------
 1614|    429|			      filter->archive->client.nodes - 1) {
 1615|      0|				if (client_switch_proxy(filter,
  ------------------
  |  Branch (1615:9): [True: 0, False: 0]
  ------------------
 1616|      0|				    filter->archive->client.cursor + 1)
 1617|      0|				    == ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1618|      0|					continue;
 1619|      0|			}
 1620|    429|			filter->client_buff = NULL;
 1621|    429|			filter->end_of_file = 1;
 1622|    429|			return (total_bytes_skipped);
 1623|    429|		}
 1624|       |
 1625|    411|		if (bytes_read >= request) {
  ------------------
  |  Branch (1625:7): [True: 79, False: 332]
  ------------------
 1626|     79|			filter->client_next =
 1627|     79|			    ((const char *)filter->client_buff) + request;
 1628|     79|			filter->client_avail = (size_t)(bytes_read - request);
 1629|     79|			filter->client_total = bytes_read;
 1630|     79|			total_bytes_skipped += request;
 1631|     79|			filter->position += request;
 1632|     79|			return (total_bytes_skipped);
 1633|     79|		}
 1634|       |
 1635|    332|		filter->position += bytes_read;
 1636|    332|		total_bytes_skipped += bytes_read;
 1637|    332|		request -= bytes_read;
 1638|    332|	}
 1639|    511|}
archive_read.c:client_skip_proxy:
  175|    424|{
  176|    424|	if (request < 0)
  ------------------
  |  Branch (176:6): [True: 0, False: 424]
  ------------------
  177|      0|		__archive_errx(1, "Negative skip requested");
  178|    424|	if (request == 0)
  ------------------
  |  Branch (178:6): [True: 0, False: 424]
  ------------------
  179|      0|		return 0;
  180|       |
  181|    424|	if (self->archive->client.skipper != NULL) {
  ------------------
  |  Branch (181:6): [True: 424, False: 0]
  ------------------
  182|    424|		int64_t total = 0;
  183|    424|		for (;;) {
  184|    424|			int64_t get, ask = request;
  185|    424|			get = (self->archive->client.skipper)
  186|    424|				(&self->archive->archive, self->data, ask);
  187|    424|			total += get;
  188|    424|			if (get == 0 || get == request)
  ------------------
  |  Branch (188:8): [True: 424, False: 0]
  |  Branch (188:20): [True: 0, False: 0]
  ------------------
  189|    424|				return (total);
  190|      0|			if (get > request)
  ------------------
  |  Branch (190:8): [True: 0, False: 0]
  ------------------
  191|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  192|      0|			request -= get;
  193|      0|		}
  194|    424|	} else if (self->archive->client.seeker != NULL
  ------------------
  |  Branch (194:13): [True: 0, False: 0]
  ------------------
  195|      0|		&& request > 64 * 1024) {
  ------------------
  |  Branch (195:6): [True: 0, False: 0]
  ------------------
  196|       |		/* If the client provided a seeker but not a skipper,
  197|       |		 * we can use the seeker to skip forward.
  198|       |		 *
  199|       |		 * Note: This isn't always a good idea.  The client
  200|       |		 * skipper is allowed to skip by less than requested
  201|       |		 * if it needs to maintain block alignment.  The
  202|       |		 * seeker is not allowed to play such games, so using
  203|       |		 * the seeker here may be a performance loss compared
  204|       |		 * to just reading and discarding.  That's why we
  205|       |		 * only do this for skips of over 64k.
  206|       |		 */
  207|      0|		int64_t before = self->position;
  208|      0|		int64_t after = (self->archive->client.seeker)
  209|      0|		    (&self->archive->archive, self->data, request, SEEK_CUR);
  210|      0|		if (after != before + request)
  ------------------
  |  Branch (210:7): [True: 0, False: 0]
  ------------------
  211|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  212|      0|		return after - before;
  213|      0|	}
  214|      0|	return 0;
  215|    424|}
archive_read.c:client_seek_proxy:
  219|  6.57k|{
  220|       |	/* DO NOT use the skipper here!  If we transparently handled
  221|       |	 * forward seek here by using the skipper, that will break
  222|       |	 * other libarchive code that assumes a successful forward
  223|       |	 * seek means it can also seek backwards.
  224|       |	 */
  225|  6.57k|	if (self->archive->client.seeker == NULL) {
  ------------------
  |  Branch (225:6): [True: 0, False: 6.57k]
  ------------------
  226|      0|		archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  227|      0|		    "Current client reader does not support seeking a device");
  228|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  229|      0|	}
  230|  6.57k|	return (self->archive->client.seeker)(&self->archive->archive,
  231|  6.57k|	    self->data, offset, whence);
  232|  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.25k|{
  110|  7.25k|	struct read_memory_data *mine = (struct read_memory_data *)client_data;
  111|  7.25k|	ssize_t size;
  112|       |
  113|  7.25k|	(void)a; /* UNUSED */
  114|  7.25k|	*buff = mine->p;
  115|  7.25k|	size = mine->end - mine->p;
  116|  7.25k|	if (size > mine->read_size)
  ------------------
  |  Branch (116:6): [True: 0, False: 7.25k]
  ------------------
  117|      0|		size = mine->read_size;
  118|  7.25k|        mine->p += size;
  119|  7.25k|	return (size);
  120|  7.25k|}
archive_read_open_memory.c:memory_read_skip:
  129|    424|{
  130|    424|	struct read_memory_data *mine = (struct read_memory_data *)client_data;
  131|       |
  132|    424|	(void)a; /* UNUSED */
  133|    424|	if ((int64_t)skip > (int64_t)(mine->end - mine->p))
  ------------------
  |  Branch (133:6): [True: 424, False: 0]
  ------------------
  134|    424|		skip = mine->end - mine->p;
  135|       |	/* Round down to block size. */
  136|    424|	skip /= mine->read_size;
  137|    424|	skip *= mine->read_size;
  138|    424|	mine->p += skip;
  139|    424|	return (skip);
  140|    424|}
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.28k]
  ------------------
  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.28k|	case SEEK_END:
  ------------------
  |  Branch (158:2): [True: 3.28k, False: 3.28k]
  ------------------
  159|  3.28k|		mine->p = mine->end + offset;
  160|  3.28k|		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 "bzip2 -d" 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 "lzip -d -q" command-line. */
   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 "lzma -d -qq" command-line. */
   58|  2.49k|	archive_read_support_filter_lzma(a);
   59|       |	/* Xz falls back to "xz -d -qq" command-line. */
   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 -d -q" 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 -q" command-line. */
   72|  2.49k|	archive_read_support_filter_lz4(a);
   73|       |	/* Zstd falls back to "zstd -d -qq" command-line. */
   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:
   91|  2.49k|{
   92|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
   93|       |
   94|  2.49k|	if (__archive_read_register_bidder(a, NULL, "bzip2",
  ------------------
  |  Branch (94:6): [True: 0, False: 2.49k]
  ------------------
   95|  2.49k|				&bzip2_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   96|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
   97|       |
   98|  2.49k|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
   99|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  100|       |#else
  101|       |	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  102|       |	    "Using external bzip2 program");
  103|       |	return (ARCHIVE_WARN);
  104|       |#endif
  105|  2.49k|}
archive_read_support_filter_bzip2.c:bzip2_reader_bid:
  116|  2.86k|{
  117|  2.86k|	const unsigned char *buffer;
  118|  2.86k|	int bits_checked;
  119|       |
  120|  2.86k|	(void)self; /* UNUSED */
  121|       |
  122|       |	/* Minimal bzip2 archive is 14 bytes. */
  123|  2.86k|	buffer = __archive_read_filter_ahead(filter, 14, NULL);
  124|  2.86k|	if (buffer == NULL)
  ------------------
  |  Branch (124:6): [True: 57, False: 2.80k]
  ------------------
  125|     57|		return (0);
  126|       |
  127|       |	/* First three bytes must be "BZh" */
  128|  2.80k|	bits_checked = 0;
  129|  2.80k|	if (memcmp(buffer, "BZh", 3) != 0)
  ------------------
  |  Branch (129:6): [True: 2.78k, False: 19]
  ------------------
  130|  2.78k|		return (0);
  131|     19|	bits_checked += 24;
  132|       |
  133|       |	/* Next follows a compression flag which must be an ASCII digit. */
  134|     19|	if (buffer[3] < '1' || buffer[3] > '9')
  ------------------
  |  Branch (134:6): [True: 0, False: 19]
  |  Branch (134:25): [True: 15, False: 4]
  ------------------
  135|     15|		return (0);
  136|      4|	bits_checked += 5;
  137|       |
  138|       |	/* After BZh[1-9], there must be either a data block
  139|       |	 * which begins with 0x314159265359 or an end-of-data
  140|       |	 * marker of 0x177245385090. */
  141|      4|	if (memcmp(buffer + 4, "\x31\x41\x59\x26\x53\x59", 6) == 0)
  ------------------
  |  Branch (141:6): [True: 4, False: 0]
  ------------------
  142|      4|		bits_checked += 48;
  143|      0|	else if (memcmp(buffer + 4, "\x17\x72\x45\x38\x50\x90", 6) == 0)
  ------------------
  |  Branch (143:11): [True: 0, False: 0]
  ------------------
  144|      0|		bits_checked += 48;
  145|      0|	else
  146|      0|		return (0);
  147|       |
  148|      4|	return (bits_checked);
  149|      4|}
archive_read_support_filter_bzip2.c:bzip2_reader_init:
  186|      2|{
  187|      2|	static const size_t out_block_size = 64 * 1024;
  188|      2|	void *out_block;
  189|      2|	struct private_data *state;
  190|       |
  191|      2|	self->code = ARCHIVE_FILTER_BZIP2;
  ------------------
  |  |  311|      2|#define	ARCHIVE_FILTER_BZIP2	2
  ------------------
  192|      2|	self->name = "bzip2";
  193|       |
  194|      2|	state = calloc(1, sizeof(*state));
  195|      2|	out_block = malloc(out_block_size);
  196|      2|	if (state == NULL || out_block == NULL) {
  ------------------
  |  Branch (196:6): [True: 0, False: 2]
  |  Branch (196:23): [True: 0, False: 2]
  ------------------
  197|      0|		archive_set_error(&self->archive->archive, ENOMEM,
  198|      0|		    "Can't allocate data for bzip2 decompression");
  199|      0|		free(out_block);
  200|      0|		free(state);
  201|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  202|      0|	}
  203|       |
  204|      2|	self->data = state;
  205|      2|	state->out_block_size = out_block_size;
  206|      2|	state->out_block = out_block;
  207|      2|	self->vtable = &bzip2_reader_vtable;
  208|       |
  209|      2|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  210|      2|}
archive_read_support_filter_bzip2.c:bzip2_filter_read:
  217|     17|{
  218|     17|	struct private_data *state;
  219|     17|	size_t decompressed;
  220|     17|	const char *read_buf;
  221|     17|	ssize_t ret;
  222|       |
  223|     17|	state = (struct private_data *)self->data;
  224|       |
  225|     17|	if (state->eof) {
  ------------------
  |  Branch (225:6): [True: 0, False: 17]
  ------------------
  226|      0|		*p = NULL;
  227|      0|		return (0);
  228|      0|	}
  229|       |
  230|       |	/* Empty our output buffer. */
  231|     17|	state->stream.next_out = state->out_block;
  232|     17|	state->stream.avail_out = (uint32_t)state->out_block_size;
  233|       |
  234|       |	/* Try to fill the output buffer. */
  235|     17|	for (;;) {
  236|     17|		ssize_t max_in;
  237|       |
  238|     17|		if (!state->valid) {
  ------------------
  |  Branch (238:7): [True: 2, False: 15]
  ------------------
  239|      2|			if (bzip2_reader_bid(self->bidder, self->upstream) == 0) {
  ------------------
  |  Branch (239:8): [True: 0, False: 2]
  ------------------
  240|      0|				state->eof = 1;
  241|      0|				*p = state->out_block;
  242|      0|				decompressed = state->stream.next_out
  243|      0|				    - state->out_block;
  244|      0|				return (decompressed);
  245|      0|			}
  246|       |			/* Initialize compression library. */
  247|      2|			ret = BZ2_bzDecompressInit(&(state->stream),
  248|      2|					   0 /* library verbosity */,
  249|      2|					   0 /* don't use low-mem algorithm */);
  250|       |
  251|       |			/* If init fails, try low-memory algorithm instead. */
  252|      2|			if (ret == BZ_MEM_ERROR)
  ------------------
  |  Branch (252:8): [True: 0, False: 2]
  ------------------
  253|      0|				ret = BZ2_bzDecompressInit(&(state->stream),
  254|      0|					   0 /* library verbosity */,
  255|      0|					   1 /* do use low-mem algo */);
  256|       |
  257|      2|			if (ret != BZ_OK) {
  ------------------
  |  Branch (257:8): [True: 0, False: 2]
  ------------------
  258|      0|				const char *detail = NULL;
  259|      0|				int err = ARCHIVE_ERRNO_MISC;
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  260|      0|				switch (ret) {
  ------------------
  |  Branch (260:13): [True: 0, False: 0]
  ------------------
  261|      0|				case BZ_PARAM_ERROR:
  ------------------
  |  Branch (261:5): [True: 0, False: 0]
  ------------------
  262|      0|					detail = "invalid setup parameter";
  263|      0|					break;
  264|      0|				case BZ_MEM_ERROR:
  ------------------
  |  Branch (264:5): [True: 0, False: 0]
  ------------------
  265|      0|					err = ENOMEM;
  266|      0|					detail = "out of memory";
  267|      0|					break;
  268|      0|				case BZ_CONFIG_ERROR:
  ------------------
  |  Branch (268:5): [True: 0, False: 0]
  ------------------
  269|      0|					detail = "mis-compiled library";
  270|      0|					break;
  271|      0|				}
  272|      0|				archive_set_error(&self->archive->archive, err,
  273|      0|				    "Internal error initializing decompressor%s%s",
  274|      0|				    detail == NULL ? "" : ": ",
  ------------------
  |  Branch (274:9): [True: 0, False: 0]
  ------------------
  275|      0|				    detail);
  276|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  277|      0|			}
  278|      2|			state->valid = 1;
  279|      2|		}
  280|       |
  281|       |		/* stream.next_in is really const, but bzlib
  282|       |		 * doesn't declare it so. <sigh> */
  283|     17|		read_buf =
  284|     17|		    __archive_read_filter_ahead(self->upstream, 1, &ret);
  285|     17|		if (read_buf == NULL) {
  ------------------
  |  Branch (285:7): [True: 0, False: 17]
  ------------------
  286|      0|			archive_set_error(&self->archive->archive,
  287|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  288|      0|			    "truncated bzip2 input");
  289|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  290|      0|		}
  291|     17|		state->stream.next_in = (char *)(uintptr_t)read_buf;
  292|     17|		if (UINT_MAX >= SSIZE_MAX)
  ------------------
  |  Branch (292:7): [Folded, False: 17]
  ------------------
  293|      0|			max_in = SSIZE_MAX;
  294|     17|		else
  295|     17|			max_in = UINT_MAX;
  296|     17|		if (ret > max_in)
  ------------------
  |  Branch (296:7): [True: 0, False: 17]
  ------------------
  297|      0|			ret = max_in;
  298|     17|		state->stream.avail_in = (uint32_t)ret;
  299|       |
  300|       |		/* Decompress as much as we can in one pass. */
  301|     17|		ret = BZ2_bzDecompress(&(state->stream));
  302|     17|		__archive_read_filter_consume(self->upstream,
  303|     17|		    state->stream.next_in - read_buf);
  304|       |
  305|     17|		switch (ret) {
  306|      0|		case BZ_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (306:3): [True: 0, False: 17]
  ------------------
  307|      0|			switch (BZ2_bzDecompressEnd(&(state->stream))) {
  308|      0|			case BZ_OK:
  ------------------
  |  Branch (308:4): [True: 0, False: 0]
  ------------------
  309|      0|				break;
  310|      0|			default:
  ------------------
  |  Branch (310:4): [True: 0, False: 0]
  ------------------
  311|      0|				archive_set_error(&(self->archive->archive),
  312|      0|					  ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  313|      0|					  "Failed to clean up decompressor");
  314|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  315|      0|			}
  316|      0|			state->valid = 0;
  317|       |			/* FALLTHROUGH */
  318|     15|		case BZ_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (318:3): [True: 15, False: 2]
  ------------------
  319|       |			/* If we filled our buffer, update stats and return. */
  320|     15|			if (state->stream.avail_out == 0) {
  ------------------
  |  Branch (320:8): [True: 15, False: 0]
  ------------------
  321|     15|				*p = state->out_block;
  322|     15|				decompressed = state->stream.next_out
  323|     15|				    - state->out_block;
  324|     15|				return (decompressed);
  325|     15|			}
  326|      0|			break;
  327|      2|		default: /* Return an error. */
  ------------------
  |  Branch (327:3): [True: 2, False: 15]
  ------------------
  328|      2|			archive_set_error(&self->archive->archive,
  329|      2|			    ARCHIVE_ERRNO_MISC, "bzip decompression failed");
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  330|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  331|     17|		}
  332|     17|	}
  333|     17|}
archive_read_support_filter_bzip2.c:bzip2_filter_close:
  340|      2|{
  341|      2|	struct private_data *state;
  342|      2|	int ret = ARCHIVE_OK;
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  343|       |
  344|      2|	state = (struct private_data *)self->data;
  345|       |
  346|      2|	if (state->valid) {
  ------------------
  |  Branch (346:6): [True: 2, False: 0]
  ------------------
  347|      2|		switch (BZ2_bzDecompressEnd(&state->stream)) {
  348|      2|		case BZ_OK:
  ------------------
  |  Branch (348:3): [True: 2, False: 0]
  ------------------
  349|      2|			break;
  350|      0|		default:
  ------------------
  |  Branch (350:3): [True: 0, False: 2]
  ------------------
  351|      0|			archive_set_error(&self->archive->archive,
  352|      0|					  ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  353|      0|					  "Failed to clean up decompressor");
  354|      0|			ret = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  355|      2|		}
  356|      2|		state->valid = 0;
  357|      2|	}
  358|       |
  359|      2|	free(state->out_block);
  360|      2|	free(state);
  361|      2|	return (ret);
  362|      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|	int bits_checked;
  177|       |
  178|  2.86k|	(void)self; /* UNUSED */
  179|       |
  180|       |	/* Shortest valid compress file is 3 bytes. */
  181|  2.86k|	buffer = __archive_read_filter_ahead(filter, 3, NULL);
  182|       |
  183|  2.86k|	if (buffer == NULL)
  ------------------
  |  Branch (183:6): [True: 57, False: 2.80k]
  ------------------
  184|     57|		return (0);
  185|       |
  186|  2.80k|	bits_checked = 0;
  187|       |	/* First two bytes are the magic value */
  188|  2.80k|	if (buffer[0] != 0x1F || buffer[1] != 0x9D)
  ------------------
  |  Branch (188:6): [True: 2.58k, False: 219]
  |  Branch (188:27): [True: 143, False: 76]
  ------------------
  189|  2.73k|		return (0);
  190|       |	/* Third byte holds compression parameters. */
  191|     76|	if (buffer[2] & 0x20) /* Reserved bit, must be zero. */
  ------------------
  |  Branch (191:6): [True: 0, False: 76]
  ------------------
  192|      0|		return (0);
  193|     76|	if (buffer[2] & 0x40) /* Reserved bit, must be zero. */
  ------------------
  |  Branch (193:6): [True: 0, False: 76]
  ------------------
  194|      0|		return (0);
  195|     76|	bits_checked += 18;
  196|       |
  197|     76|	return (bits_checked);
  198|     76|}
archive_read_support_filter_compress.c:compress_bidder_init:
  211|     76|{
  212|     76|	struct private_data *state;
  213|     76|	static const size_t out_block_size = 64 * 1024;
  214|     76|	void *out_block;
  215|       |
  216|     76|	self->code = ARCHIVE_FILTER_COMPRESS;
  ------------------
  |  |  312|     76|#define	ARCHIVE_FILTER_COMPRESS	3
  ------------------
  217|     76|	self->name = "compress (.Z)";
  218|       |
  219|     76|	state = calloc(1, sizeof(*state));
  220|     76|	out_block = malloc(out_block_size);
  221|     76|	if (state == NULL || out_block == NULL) {
  ------------------
  |  Branch (221:6): [True: 0, False: 76]
  |  Branch (221:23): [True: 0, False: 76]
  ------------------
  222|      0|		free(out_block);
  223|      0|		free(state);
  224|      0|		archive_set_error(&self->archive->archive, ENOMEM,
  225|      0|		    "Can't allocate data for %s decompression",
  226|      0|		    self->name);
  227|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  228|      0|	}
  229|       |
  230|     76|	self->data = state;
  231|     76|	state->out_block_size = out_block_size;
  232|     76|	state->out_block = out_block;
  233|     76|	self->vtable = &compress_reader_vtable;
  234|       |
  235|     76|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     76|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  236|     76|}
archive_read_support_filter_compress.c:compress_filter_read:
  283|    280|{
  284|    280|	struct private_data *state;
  285|    280|	unsigned char *p, *start, *end;
  286|    280|	int ret;
  287|       |
  288|    280|	state = (struct private_data *)self->data;
  289|    280|	if (!state->initialized) {
  ------------------
  |  Branch (289:6): [True: 76, False: 204]
  ------------------
  290|     76|		ret = compress_filter_init(self);
  291|     76|		if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|     76|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (291:7): [True: 0, False: 76]
  ------------------
  292|      0|			return (ret);
  293|     76|	}
  294|    280|	if (state->end_of_stream) {
  ------------------
  |  Branch (294:6): [True: 52, False: 228]
  ------------------
  295|     52|		*pblock = NULL;
  296|     52|		return (0);
  297|     52|	}
  298|    228|	p = start = (unsigned char *)state->out_block;
  299|    228|	end = start + state->out_block_size;
  300|       |
  301|  18.4M|	while (p < end && !state->end_of_stream) {
  ------------------
  |  Branch (301:9): [True: 18.4M, False: 153]
  |  Branch (301:20): [True: 18.4M, False: 61]
  ------------------
  302|  18.4M|		if (state->stackp > state->stack) {
  ------------------
  |  Branch (302:7): [True: 11.4M, False: 6.96M]
  ------------------
  303|  11.4M|			*p++ = *--state->stackp;
  304|  11.4M|		} else {
  305|  6.96M|			ret = next_code(self);
  306|  6.96M|			if (ret == -1)
  ------------------
  |  Branch (306:8): [True: 61, False: 6.96M]
  ------------------
  307|     61|				state->end_of_stream = ret;
  308|  6.96M|			else if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|  6.96M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (308:13): [True: 14, False: 6.96M]
  ------------------
  309|     14|				return (ret);
  310|  6.96M|		}
  311|  18.4M|	}
  312|       |
  313|    214|	*pblock = start;
  314|    214|	return (p - start);
  315|    228|}
archive_read_support_filter_compress.c:compress_filter_init:
  240|     76|{
  241|     76|	struct private_data *state = (struct private_data *)self->data;
  242|     76|	int code;
  243|       |
  244|     76|	state->initialized = 1;
  245|       |
  246|     76|	(void)getbits(self, 8); /* Skip first signature byte. */
  247|     76|	(void)getbits(self, 8); /* Skip second signature byte. */
  248|       |
  249|       |	/* Get compression parameters. */
  250|     76|	code = getbits(self, 8);
  251|     76|	if (code < 0 || (code & 0x1f) > 16) {
  ------------------
  |  Branch (251:6): [True: 0, False: 76]
  |  Branch (251:18): [True: 0, False: 76]
  ------------------
  252|      0|		archive_set_error(&self->archive->archive, -1,
  253|      0|		    "Invalid compressed data");
  254|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  255|      0|	}
  256|     76|	state->maxcode_bits = code & 0x1f;
  257|     76|	state->maxcode = (1 << state->maxcode_bits);
  258|     76|	state->use_reset_code = code & 0x80;
  259|       |
  260|       |	/* Initialize decompressor. */
  261|     76|	state->free_ent = 256;
  262|     76|	state->stackp = state->stack;
  263|     76|	if (state->use_reset_code)
  ------------------
  |  Branch (263:6): [True: 52, False: 24]
  ------------------
  264|     52|		state->free_ent++;
  265|     76|	state->bits = 9;
  266|     76|	state->section_end_code = (1<<state->bits) - 1;
  267|     76|	state->oldcode = -1;
  268|  19.5k|	for (code = 255; code >= 0; code--) {
  ------------------
  |  Branch (268:19): [True: 19.4k, False: 76]
  ------------------
  269|  19.4k|		state->prefix[code] = 0;
  270|  19.4k|		state->suffix[code] = code;
  271|  19.4k|	}
  272|     76|	next_code(self);
  273|       |
  274|     76|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     76|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  275|     76|}
archive_read_support_filter_compress.c:getbits:
  422|  8.35M|{
  423|  8.35M|	struct private_data *state = (struct private_data *)self->data;
  424|  8.35M|	int code;
  425|  8.35M|	ssize_t ret;
  426|  8.35M|	static const int mask[] = {
  427|  8.35M|		0x00, 0x01, 0x03, 0x07, 0x0f, 0x1f, 0x3f, 0x7f, 0xff,
  428|  8.35M|		0x1ff, 0x3ff, 0x7ff, 0xfff, 0x1fff, 0x3fff, 0x7fff, 0xffff
  429|  8.35M|	};
  430|       |
  431|  19.2M|	while (state->bits_avail < n) {
  ------------------
  |  Branch (431:9): [True: 10.9M, False: 8.35M]
  ------------------
  432|  10.9M|		if (state->avail_in <= 0) {
  ------------------
  |  Branch (432:7): [True: 265, False: 10.9M]
  ------------------
  433|    265|			if (state->consume_unnotified) {
  ------------------
  |  Branch (433:8): [True: 189, False: 76]
  ------------------
  434|    189|				__archive_read_filter_consume(self->upstream,
  435|    189|					state->consume_unnotified);
  436|    189|				state->consume_unnotified = 0;
  437|    189|			}
  438|    265|			state->next_in
  439|    265|			    = __archive_read_filter_ahead(self->upstream,
  440|    265|				1, &ret);
  441|    265|			if (ret == 0)
  ------------------
  |  Branch (441:8): [True: 61, False: 204]
  ------------------
  442|     61|				return (-1);
  443|    204|			if (state->next_in == NULL)
  ------------------
  |  Branch (443:8): [True: 4, False: 200]
  ------------------
  444|      4|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  445|    200|			state->consume_unnotified = state->avail_in = ret;
  446|    200|		}
  447|  10.9M|		state->bit_buffer |= *state->next_in++ << state->bits_avail;
  448|  10.9M|		state->avail_in--;
  449|  10.9M|		state->bits_avail += 8;
  450|  10.9M|		state->bytes_in_section++;
  451|  10.9M|	}
  452|       |
  453|  8.35M|	code = state->bit_buffer;
  454|  8.35M|	state->bit_buffer >>= n;
  455|  8.35M|	state->bits_avail -= n;
  456|       |
  457|  8.35M|	return (code & mask[n]);
  458|  8.35M|}
archive_read_support_filter_compress.c:next_code:
  337|  6.96M|{
  338|  6.96M|	struct private_data *state = (struct private_data *)self->data;
  339|  6.96M|	int code, newcode;
  340|       |
  341|  7.14M|again:
  342|  7.14M|	code = newcode = getbits(self, state->bits);
  343|  7.14M|	if (code < 0)
  ------------------
  |  Branch (343:6): [True: 62, False: 7.14M]
  ------------------
  344|     62|		return (code);
  345|       |
  346|       |	/* If it's a reset code, reset the dictionary. */
  347|  7.14M|	if ((code == 256) && state->use_reset_code) {
  ------------------
  |  Branch (347:6): [True: 183k, False: 6.95M]
  |  Branch (347:23): [True: 173k, False: 9.58k]
  ------------------
  348|       |		/*
  349|       |		 * The original 'compress' implementation blocked its
  350|       |		 * I/O in a manner that resulted in junk bytes being
  351|       |		 * inserted after every reset.  The next section skips
  352|       |		 * this junk.  (Yes, the number of *bytes* to skip is
  353|       |		 * a function of the current *bit* length.)
  354|       |		 */
  355|   173k|		int skip_bytes =  state->bits -
  356|   173k|		    (state->bytes_in_section % state->bits);
  357|   173k|		skip_bytes %= state->bits;
  358|   173k|		state->bits_avail = 0; /* Discard rest of this byte. */
  359|  1.38M|		while (skip_bytes-- > 0) {
  ------------------
  |  Branch (359:10): [True: 1.21M, False: 173k]
  ------------------
  360|  1.21M|			code = getbits(self, 8);
  361|  1.21M|			if (code < 0)
  ------------------
  |  Branch (361:8): [True: 3, False: 1.21M]
  ------------------
  362|      3|				return (code);
  363|  1.21M|		}
  364|       |		/* Now, actually do the reset. */
  365|   173k|		state->bytes_in_section = 0;
  366|   173k|		state->bits = 9;
  367|   173k|		state->section_end_code = (1 << state->bits) - 1;
  368|   173k|		state->free_ent = 257;
  369|   173k|		state->oldcode = -1;
  370|   173k|		goto again;
  371|   173k|	}
  372|       |
  373|  6.96M|	if (code > state->free_ent
  ------------------
  |  Branch (373:6): [True: 10, False: 6.96M]
  ------------------
  374|  6.96M|	    || (code == state->free_ent && state->oldcode < 0)) {
  ------------------
  |  Branch (374:10): [True: 8.70k, False: 6.95M]
  |  Branch (374:37): [True: 19, False: 8.68k]
  ------------------
  375|       |		/* An invalid code is a fatal error. */
  376|     29|		archive_set_error(&(self->archive->archive), -1,
  377|     29|		    "Invalid compressed data");
  378|     29|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     29|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  379|     29|	}
  380|       |
  381|       |	/* Special case for KwKwK string. */
  382|  6.96M|	if (code >= state->free_ent) {
  ------------------
  |  Branch (382:6): [True: 8.68k, False: 6.95M]
  ------------------
  383|  8.68k|		*state->stackp++ = state->finbyte;
  384|  8.68k|		code = state->oldcode;
  385|  8.68k|	}
  386|       |
  387|       |	/* Generate output characters in reverse order. */
  388|  11.4M|	while (code >= 256) {
  ------------------
  |  Branch (388:9): [True: 4.47M, False: 6.96M]
  ------------------
  389|  4.47M|		*state->stackp++ = state->suffix[code];
  390|  4.47M|		code = state->prefix[code];
  391|  4.47M|	}
  392|  6.96M|	*state->stackp++ = state->finbyte = code;
  393|       |
  394|       |	/* Generate the new entry. */
  395|  6.96M|	code = state->free_ent;
  396|  6.96M|	if (code < state->maxcode && state->oldcode >= 0) {
  ------------------
  |  Branch (396:6): [True: 429k, False: 6.53M]
  |  Branch (396:31): [True: 428k, False: 1.12k]
  ------------------
  397|   428k|		state->prefix[code] = state->oldcode;
  398|   428k|		state->suffix[code] = state->finbyte;
  399|   428k|		++state->free_ent;
  400|   428k|	}
  401|  6.96M|	if (state->free_ent > state->section_end_code) {
  ------------------
  |  Branch (401:6): [True: 1.05k, False: 6.96M]
  ------------------
  402|  1.05k|		state->bits++;
  403|  1.05k|		state->bytes_in_section = 0;
  404|  1.05k|		if (state->bits == state->maxcode_bits)
  ------------------
  |  Branch (404:7): [True: 931, False: 122]
  ------------------
  405|    931|			state->section_end_code = state->maxcode;
  406|    122|		else
  407|    122|			state->section_end_code = (1 << state->bits) - 1;
  408|  1.05k|	}
  409|       |
  410|       |	/* Remember previous code. */
  411|  6.96M|	state->oldcode = newcode;
  412|  6.96M|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  6.96M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  413|  6.96M|}
archive_read_support_filter_compress.c:compress_filter_close:
  322|     76|{
  323|     76|	struct private_data *state = (struct private_data *)self->data;
  324|       |
  325|     76|	free(state->out_block);
  326|     76|	free(state);
  327|     76|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     76|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  328|     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|       |
   84|  2.86k|	(void)self; /* UNUSED */
   85|       |
   86|  2.86k|	p = __archive_read_filter_ahead(filter, sizeof(grzip_magic), NULL);
   87|  2.86k|	if (p == NULL)
  ------------------
  |  Branch (87:6): [True: 59, False: 2.80k]
  ------------------
   88|     59|		return (0);
   89|       |
   90|  2.80k|	if (memcmp(p, grzip_magic, sizeof(grzip_magic)))
  ------------------
  |  Branch (90:6): [True: 2.80k, False: 0]
  ------------------
   91|  2.80k|		return (0);
   92|       |
   93|      0|	return (sizeof(grzip_magic) * 8);
   94|  2.80k|}

archive_read_support_filter_gzip:
   96|  2.49k|{
   97|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
   98|       |
   99|  2.49k|	if (__archive_read_register_bidder(a, NULL, "gzip",
  ------------------
  |  Branch (99:6): [True: 0, False: 2.49k]
  ------------------
  100|  2.49k|				&gzip_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  101|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  102|       |
  103|       |	/* Signal the extent of gzip support with the return value here. */
  104|  2.49k|#if HAVE_ZLIB_H
  105|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  106|       |#else
  107|       |	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  108|       |	    "Using external gzip program");
  109|       |	return (ARCHIVE_WARN);
  110|       |#endif
  111|  2.49k|}
archive_read_support_filter_gzip.c:gzip_bidder_bid:
  241|  2.86k|{
  242|  2.86k|	int bits_checked;
  243|       |
  244|  2.86k|	(void)self; /* UNUSED */
  245|       |
  246|  2.86k|	if (peek_at_header(filter, &bits_checked, NULL))
  ------------------
  |  Branch (246:6): [True: 141, False: 2.72k]
  ------------------
  247|    141|		return (bits_checked);
  248|  2.72k|	return (0);
  249|  2.86k|}
archive_read_support_filter_gzip.c:peek_at_header:
  130|  3.12k|{
  131|  3.12k|	const unsigned char *p;
  132|  3.12k|	ssize_t avail, len;
  133|  3.12k|	int bits = 0;
  134|  3.12k|	int header_flags;
  135|       |#ifndef HAVE_ZLIB_H
  136|       |	(void)state; /* UNUSED */
  137|       |#endif
  138|       |
  139|       |	/* Start by looking at the first ten bytes of the header, which
  140|       |	 * is all fixed layout. */
  141|  3.12k|	len = 10;
  142|  3.12k|	p = __archive_read_filter_ahead(filter, len, &avail);
  143|  3.12k|	if (p == NULL)
  ------------------
  |  Branch (143:6): [True: 82, False: 3.04k]
  ------------------
  144|     82|		return (0);
  145|       |	/* We only support deflation- third byte must be 0x08. */
  146|  3.04k|	if (memcmp(p, "\x1F\x8B\x08", 3) != 0)
  ------------------
  |  Branch (146:6): [True: 2.73k, False: 304]
  ------------------
  147|  2.73k|		return (0);
  148|    304|	bits += 24;
  149|    304|	if ((p[3] & 0xE0)!= 0)	/* No reserved flags set. */
  ------------------
  |  Branch (149:6): [True: 2, False: 302]
  ------------------
  150|      2|		return (0);
  151|    302|	bits += 3;
  152|    302|	header_flags = p[3];
  153|       |	/* Bytes 4-7 are mod time in little endian. */
  154|    302|#ifdef HAVE_ZLIB_H
  155|    302|	if (state)
  ------------------
  |  Branch (155:6): [True: 161, False: 141]
  ------------------
  156|    161|		state->mtime = archive_le32dec(p + 4);
  157|    302|#endif
  158|       |	/* Byte 8 is deflate flags. */
  159|       |	/* XXXX TODO: return deflate flags back to consume_header for use
  160|       |	   in initializing the decompressor. */
  161|       |	/* Byte 9 is OS. */
  162|       |
  163|       |	/* Optional extra data:  2 byte length plus variable body. */
  164|    302|	if (header_flags & 4) {
  ------------------
  |  Branch (164:6): [True: 0, False: 302]
  ------------------
  165|      0|		p = __archive_read_filter_ahead(filter, len + 2, &avail);
  166|      0|		if (p == NULL)
  ------------------
  |  Branch (166:7): [True: 0, False: 0]
  ------------------
  167|      0|			return (0);
  168|      0|		len += archive_le16dec(p + len);
  169|      0|		len += 2;
  170|      0|	}
  171|       |
  172|       |	/* Null-terminated optional filename. */
  173|    302|	if (header_flags & 8) {
  ------------------
  |  Branch (173:6): [True: 10, False: 292]
  ------------------
  174|     10|#ifdef HAVE_ZLIB_H
  175|     10|		ssize_t file_start = len;
  176|     10|#endif
  177|     78|		do {
  178|     78|			++len;
  179|     78|			if (avail < len) {
  ------------------
  |  Branch (179:8): [True: 0, False: 78]
  ------------------
  180|      0|				if (avail > MAX_FILENAME_LENGTH) {
  ------------------
  |  |  120|      0|#define MAX_FILENAME_LENGTH (1024 * 1024L)
  ------------------
  |  Branch (180:9): [True: 0, False: 0]
  ------------------
  181|      0|					return (0);
  182|      0|				}
  183|      0|				p = __archive_read_filter_ahead(filter,
  184|      0|				    len, &avail);
  185|      0|			}
  186|     78|			if (p == NULL)
  ------------------
  |  Branch (186:8): [True: 0, False: 78]
  ------------------
  187|      0|				return (0);
  188|     78|		} while (p[len - 1] != 0);
  ------------------
  |  Branch (188:12): [True: 68, False: 10]
  ------------------
  189|       |
  190|     10|#ifdef HAVE_ZLIB_H
  191|     10|		if (state) {
  ------------------
  |  Branch (191:7): [True: 5, False: 5]
  ------------------
  192|       |			/* Reset the name in case of repeat header reads. */
  193|      5|			free(state->name);
  194|      5|			state->name = strdup((const char *)&p[file_start]);
  195|      5|		}
  196|     10|#endif
  197|     10|	}
  198|       |
  199|       |	/* Null-terminated optional comment. */
  200|    302|	if (header_flags & 16) {
  ------------------
  |  Branch (200:6): [True: 10, False: 292]
  ------------------
  201|     80|		do {
  202|     80|			++len;
  203|     80|			if (avail < len) {
  ------------------
  |  Branch (203:8): [True: 0, False: 80]
  ------------------
  204|      0|				if (avail > MAX_COMMENT_LENGTH) {
  ------------------
  |  |  121|      0|#define MAX_COMMENT_LENGTH (1024 * 1024L)
  ------------------
  |  Branch (204:9): [True: 0, False: 0]
  ------------------
  205|      0|					return (0);
  206|      0|				}
  207|      0|				p = __archive_read_filter_ahead(filter,
  208|      0|				    len, &avail);
  209|      0|			}
  210|     80|			if (p == NULL)
  ------------------
  |  Branch (210:8): [True: 0, False: 80]
  ------------------
  211|      0|				return (0);
  212|     80|		} while (p[len - 1] != 0);
  ------------------
  |  Branch (212:12): [True: 70, False: 10]
  ------------------
  213|     10|	}
  214|       |
  215|       |	/* Optional header CRC */
  216|    302|	if ((header_flags & 2)) {
  ------------------
  |  Branch (216:6): [True: 10, False: 292]
  ------------------
  217|     10|		p = __archive_read_filter_ahead(filter, len + 2, &avail);
  218|     10|		if (p == NULL)
  ------------------
  |  Branch (218:7): [True: 0, False: 10]
  ------------------
  219|      0|			return (0);
  220|       |#if 0
  221|       |	int hcrc = ((int)p[len + 1] << 8) | (int)p[len];
  222|       |	int crc = /* XXX TODO: Compute header CRC. */;
  223|       |	if (crc != hcrc)
  224|       |		return (0);
  225|       |	bits += 16;
  226|       |#endif
  227|     10|		len += 2;
  228|     10|	}
  229|       |
  230|    302|	if (pbits != NULL)
  ------------------
  |  Branch (230:6): [True: 141, False: 161]
  ------------------
  231|    141|		*pbits = bits;
  232|    302|	return (len);
  233|    302|}
archive_read_support_filter_gzip.c:gzip_bidder_init:
  306|    141|{
  307|    141|	struct private_data *state;
  308|    141|	static const size_t out_block_size = 64 * 1024;
  309|    141|	void *out_block;
  310|       |
  311|    141|	self->code = ARCHIVE_FILTER_GZIP;
  ------------------
  |  |  310|    141|#define	ARCHIVE_FILTER_GZIP	1
  ------------------
  312|    141|	self->name = "gzip";
  313|       |
  314|    141|	state = calloc(1, sizeof(*state));
  315|    141|	out_block = malloc(out_block_size);
  316|    141|	if (state == NULL || out_block == NULL) {
  ------------------
  |  Branch (316:6): [True: 0, False: 141]
  |  Branch (316:23): [True: 0, False: 141]
  ------------------
  317|      0|		free(out_block);
  318|      0|		free(state);
  319|      0|		archive_set_error(&self->archive->archive, ENOMEM,
  320|      0|		    "Can't allocate data for gzip decompression");
  321|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  322|      0|	}
  323|       |
  324|    141|	self->data = state;
  325|    141|	state->out_block_size = out_block_size;
  326|    141|	state->out_block = out_block;
  327|    141|	self->vtable = &gzip_reader_vtable;
  328|       |
  329|    141|	state->in_stream = 0; /* We're not actually within a stream yet. */
  330|       |
  331|    141|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    141|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  332|    141|}
archive_read_support_filter_gzip.c:gzip_filter_read:
  438|  3.59k|{
  439|  3.59k|	struct private_data *state;
  440|  3.59k|	size_t decompressed;
  441|  3.59k|	ssize_t avail_in, max_in;
  442|  3.59k|	int ret;
  443|       |
  444|  3.59k|	state = (struct private_data *)self->data;
  445|       |
  446|       |	/* Empty our output buffer. */
  447|  3.59k|	state->stream.next_out = state->out_block;
  448|  3.59k|	state->stream.avail_out = (uInt)state->out_block_size;
  449|       |
  450|       |	/* Try to fill the output buffer. */
  451|  7.10k|	while (state->stream.avail_out > 0 && !state->eof) {
  ------------------
  |  Branch (451:9): [True: 3.75k, False: 3.35k]
  |  Branch (451:40): [True: 3.64k, False: 101]
  ------------------
  452|       |		/* If we're not in a stream, read a header
  453|       |		 * and initialize the decompression library. */
  454|  3.64k|		if (!state->in_stream) {
  ------------------
  |  Branch (454:7): [True: 262, False: 3.38k]
  ------------------
  455|    262|			ret = consume_header(self);
  456|    262|			if (ret == ARCHIVE_EOF) {
  ------------------
  |  |  232|    262|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (456:8): [True: 101, False: 161]
  ------------------
  457|    101|				state->eof = 1;
  458|    101|				break;
  459|    101|			}
  460|    161|			if (ret < ARCHIVE_OK)
  ------------------
  |  |  233|    161|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (460:8): [True: 0, False: 161]
  ------------------
  461|      0|				return (ret);
  462|    161|		}
  463|       |
  464|       |		/* Peek at the next available data. */
  465|       |		/* ZLib treats stream.next_in as const but doesn't declare
  466|       |		 * it so, hence this ugly cast. */
  467|  3.54k|		state->stream.next_in = (unsigned char *)(uintptr_t)
  468|  3.54k|		    __archive_read_filter_ahead(self->upstream, 1, &avail_in);
  469|  3.54k|		if (state->stream.next_in == NULL) {
  ------------------
  |  Branch (469:7): [True: 38, False: 3.51k]
  ------------------
  470|     38|			archive_set_error(&self->archive->archive,
  471|     38|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     38|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  472|     38|			    "truncated gzip input");
  473|     38|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     38|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  474|     38|		}
  475|  3.51k|		if (UINT_MAX >= SSIZE_MAX)
  ------------------
  |  Branch (475:7): [Folded, False: 3.51k]
  ------------------
  476|      0|			max_in = SSIZE_MAX;
  477|  3.51k|		else
  478|  3.51k|			max_in = UINT_MAX;
  479|  3.51k|		if (avail_in > max_in)
  ------------------
  |  Branch (479:7): [True: 0, False: 3.51k]
  ------------------
  480|      0|			avail_in = max_in;
  481|  3.51k|		state->stream.avail_in = (uInt)avail_in;
  482|       |
  483|       |		/* Decompress and consume some of that data. */
  484|  3.51k|		ret = inflate(&(state->stream), 0);
  485|  3.51k|		switch (ret) {
  486|  3.38k|		case Z_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (486:3): [True: 3.38k, False: 121]
  ------------------
  487|  3.38k|			__archive_read_filter_consume(self->upstream,
  488|  3.38k|			    avail_in - state->stream.avail_in);
  489|  3.38k|			break;
  490|    121|		case Z_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (490:3): [True: 121, False: 3.38k]
  ------------------
  491|    121|			__archive_read_filter_consume(self->upstream,
  492|    121|			    avail_in - state->stream.avail_in);
  493|       |			/* Consume the stream trailer; release the
  494|       |			 * decompression library. */
  495|    121|			ret = consume_trailer(self);
  496|    121|			if (ret < ARCHIVE_OK)
  ------------------
  |  |  233|    121|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (496:8): [True: 0, False: 121]
  ------------------
  497|      0|				return (ret);
  498|    121|			break;
  499|    121|		default:
  ------------------
  |  Branch (499:3): [True: 0, False: 3.51k]
  ------------------
  500|       |			/* Return an error. */
  501|      0|			archive_set_error(&self->archive->archive,
  502|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  503|      0|			    "gzip decompression failed");
  504|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  505|  3.51k|		}
  506|  3.51k|	}
  507|       |
  508|       |	/* We've read as much as we can. */
  509|  3.55k|	decompressed = state->stream.next_out - state->out_block;
  510|  3.55k|	if (decompressed == 0)
  ------------------
  |  Branch (510:6): [True: 101, False: 3.45k]
  ------------------
  511|    101|		*p = NULL;
  512|  3.45k|	else
  513|  3.45k|		*p = state->out_block;
  514|  3.55k|	return (decompressed);
  515|  3.59k|}
archive_read_support_filter_gzip.c:consume_header:
  336|    262|{
  337|    262|	struct private_data *state;
  338|    262|	ssize_t avail, max_in;
  339|    262|	size_t len;
  340|    262|	int ret;
  341|       |
  342|    262|	state = (struct private_data *)self->data;
  343|       |
  344|       |	/* If this is a real header, consume it. */
  345|    262|	len = peek_at_header(self->upstream, NULL, state);
  346|    262|	if (len == 0)
  ------------------
  |  Branch (346:6): [True: 101, False: 161]
  ------------------
  347|    101|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|    101|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  348|    161|	__archive_read_filter_consume(self->upstream, len);
  349|       |
  350|       |	/* Initialize CRC accumulator. */
  351|    161|	state->crc = crc32(0L, NULL, 0);
  352|       |
  353|       |	/* Initialize compression library. */
  354|    161|	state->stream.next_in = (unsigned char *)(uintptr_t)
  355|    161|	    __archive_read_filter_ahead(self->upstream, 1, &avail);
  356|    161|	if (avail < 0) {
  ------------------
  |  Branch (356:6): [True: 0, False: 161]
  ------------------
  357|      0|		archive_set_error(&self->archive->archive,
  358|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  359|      0|		    "Failed to read gzip input");
  360|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  361|      0|	}
  362|    161|	if (UINT_MAX >= SSIZE_MAX)
  ------------------
  |  Branch (362:6): [Folded, False: 161]
  ------------------
  363|      0|		max_in = SSIZE_MAX;
  364|    161|	else
  365|    161|		max_in = UINT_MAX;
  366|    161|	if (avail > max_in)
  ------------------
  |  Branch (366:6): [True: 0, False: 161]
  ------------------
  367|      0|		avail = max_in;
  368|    161|	state->stream.avail_in = (uInt)avail;
  369|    161|	ret = inflateInit2(&(state->stream),
  370|    161|	    -15 /* Don't check for zlib header */);
  371|       |
  372|       |	/* Decipher the error code. */
  373|    161|	switch (ret) {
  374|    161|	case Z_OK:
  ------------------
  |  Branch (374:2): [True: 161, False: 0]
  ------------------
  375|    161|		state->in_stream = 1;
  376|    161|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    161|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  377|      0|	case Z_STREAM_ERROR:
  ------------------
  |  Branch (377:2): [True: 0, False: 161]
  ------------------
  378|      0|		archive_set_error(&self->archive->archive,
  379|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  380|      0|		    "Internal error initializing compression library: "
  381|      0|		    "invalid setup parameter");
  382|      0|		break;
  383|      0|	case Z_MEM_ERROR:
  ------------------
  |  Branch (383:2): [True: 0, False: 161]
  ------------------
  384|      0|		archive_set_error(&self->archive->archive, ENOMEM,
  385|      0|		    "Internal error initializing compression library: "
  386|      0|		    "out of memory");
  387|      0|		break;
  388|      0|	case Z_VERSION_ERROR:
  ------------------
  |  Branch (388:2): [True: 0, False: 161]
  ------------------
  389|      0|		archive_set_error(&self->archive->archive,
  390|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  391|      0|		    "Internal error initializing compression library: "
  392|      0|		    "invalid library version");
  393|      0|		break;
  394|      0|	default:
  ------------------
  |  Branch (394:2): [True: 0, False: 161]
  ------------------
  395|      0|		archive_set_error(&self->archive->archive,
  396|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  397|      0|		    "Internal error initializing compression library: "
  398|      0|		    " Zlib error %d", ret);
  399|      0|		break;
  400|    161|	}
  401|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  402|    161|}
archive_read_support_filter_gzip.c:consume_trailer:
  406|    121|{
  407|    121|	struct private_data *state;
  408|    121|	const unsigned char *p;
  409|       |
  410|    121|	state = (struct private_data *)self->data;
  411|       |
  412|    121|	state->in_stream = 0;
  413|    121|	switch (inflateEnd(&(state->stream))) {
  414|    121|	case Z_OK:
  ------------------
  |  Branch (414:2): [True: 121, False: 0]
  ------------------
  415|    121|		break;
  416|      0|	default:
  ------------------
  |  Branch (416:2): [True: 0, False: 121]
  ------------------
  417|      0|		archive_set_error(&self->archive->archive,
  418|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  419|      0|		    "Failed to clean up gzip decompressor");
  420|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  421|    121|	}
  422|       |
  423|       |	/* GZip trailer is a fixed 8 byte structure. */
  424|    121|	p = __archive_read_filter_ahead(self->upstream, 8, NULL);
  425|    121|	if (p == NULL)
  ------------------
  |  Branch (425:6): [True: 0, False: 121]
  ------------------
  426|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  427|       |
  428|       |	/* XXX TODO: Verify the length and CRC. */
  429|       |
  430|       |	/* We've verified the trailer, so consume it now. */
  431|    121|	__archive_read_filter_consume(self->upstream, 8);
  432|       |
  433|    121|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    121|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  434|    121|}
archive_read_support_filter_gzip.c:gzip_filter_close:
  522|    141|{
  523|    141|	struct private_data *state;
  524|    141|	int ret;
  525|       |
  526|    141|	state = (struct private_data *)self->data;
  527|    141|	ret = ARCHIVE_OK;
  ------------------
  |  |  233|    141|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  528|       |
  529|    141|	if (state->in_stream) {
  ------------------
  |  Branch (529:6): [True: 40, False: 101]
  ------------------
  530|     40|		switch (inflateEnd(&(state->stream))) {
  531|     40|		case Z_OK:
  ------------------
  |  Branch (531:3): [True: 40, False: 0]
  ------------------
  532|     40|			break;
  533|      0|		default:
  ------------------
  |  Branch (533:3): [True: 0, False: 40]
  ------------------
  534|      0|			archive_set_error(&(self->archive->archive),
  535|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  536|      0|			    "Failed to clean up gzip compressor");
  537|      0|			ret = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  538|     40|		}
  539|     40|	}
  540|       |
  541|    141|	free(state->name);
  542|    141|	free(state->out_block);
  543|    141|	free(state);
  544|    141|	return (ret);
  545|    141|}
archive_read_support_filter_gzip.c:gzip_read_header:
  276|      1|{
  277|      1|	struct private_data *state;
  278|       |
  279|      1|	state = (struct private_data *)self->data;
  280|       |
  281|       |	/* An mtime of 0 is considered invalid/missing. */
  282|      1|	if (state->mtime != 0)
  ------------------
  |  Branch (282:6): [True: 1, False: 0]
  ------------------
  283|      1|		archive_entry_set_mtime(entry, state->mtime, 0);
  284|       |
  285|       |	/* If the name is available, extract it. */
  286|      1|	if (state->name)
  ------------------
  |  Branch (286:6): [True: 0, False: 1]
  ------------------
  287|      0|		archive_entry_set_pathname(entry, state->name);
  288|       |
  289|      1|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  290|      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 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, NULL);
   90|  2.86k|	if (p == NULL)
  ------------------
  |  Branch (90:6): [True: 59, False: 2.80k]
  ------------------
   91|     59|		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:
  117|  2.49k|{
  118|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  119|       |
  120|  2.49k|	if (__archive_read_register_bidder(a, NULL, "lz4",
  ------------------
  |  Branch (120:6): [True: 0, False: 2.49k]
  ------------------
  121|  2.49k|				&lz4_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  122|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  123|       |
  124|  2.49k|#if defined(HAVE_LIBLZ4)
  125|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  126|       |#else
  127|       |	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  128|       |	    "Using external lz4 program");
  129|       |	return (ARCHIVE_WARN);
  130|       |#endif
  131|  2.49k|}
archive_read_support_filter_lz4.c:lz4_reader_bid:
  143|  2.86k|{
  144|  2.86k|	const unsigned char *buffer;
  145|  2.86k|	ssize_t avail;
  146|  2.86k|	int bits_checked = 0;
  147|  2.86k|	const size_t min_lz4_archive_size = 11;
  148|       |
  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.
  152|       |	 * Regular frames contain a 4 byte magic number followed by a 2-14
  153|       |	 * byte frame header, some data, and a 3 byte end marker.
  154|       |	 */
  155|  2.86k|	const size_t min_lz4_frame_size = 8;
  156|       |
  157|  2.86k|	size_t offset_in_buffer = 0;
  158|  2.86k|	const size_t max_lookahead = 64 * 1024;
  159|  2.86k|	uint32_t magic_number;
  160|       |
  161|  2.86k|	(void)self; /* UNUSED */
  162|       |
  163|       |	/*
  164|       |	 * Zstd and LZ4 skippable frame magic numbers are identical. To
  165|       |	 * differentiate these two, we need to look for a non-skippable
  166|       |	 * frame.
  167|       |	 */
  168|       |
  169|       |	/* Minimal lz4 archive is 11 bytes. */
  170|  2.86k|	buffer = __archive_read_filter_ahead(filter, min_lz4_archive_size,
  171|  2.86k|	    &avail);
  172|  2.86k|	if (buffer == NULL)
  ------------------
  |  Branch (172:6): [True: 59, False: 2.80k]
  ------------------
  173|     59|		return (0);
  174|       |
  175|  2.80k|	magic_number = archive_le32dec(buffer);
  176|       |
  177|  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 (177:9): [True: 0, False: 2.80k]
  ------------------
  178|      0|		uint32_t frame_data_size;
  179|       |
  180|       |		/* Skip over the magic number */
  181|      0|		offset_in_buffer += 4;
  182|       |
  183|       |		/* Ensure that we can read another 4 bytes. */
  184|      0|		if (offset_in_buffer + 4 > (size_t)avail) {
  ------------------
  |  Branch (184:7): [True: 0, False: 0]
  ------------------
  185|      0|			buffer = __archive_read_filter_ahead(filter,
  186|      0|			    offset_in_buffer + 4, &avail);
  187|      0|			if (buffer == NULL)
  ------------------
  |  Branch (187:8): [True: 0, False: 0]
  ------------------
  188|      0|				return (0);
  189|      0|		}
  190|       |
  191|      0|		frame_data_size = archive_le32dec(buffer + offset_in_buffer);
  192|       |
  193|       |		/* Skip over the 4 frame data size bytes */
  194|      0|		offset_in_buffer += 4;
  195|       |
  196|       |		/* Skip over the value stored there. */
  197|      0|		if (frame_data_size > SIZE_MAX - offset_in_buffer)
  ------------------
  |  Branch (197:7): [True: 0, False: 0]
  ------------------
  198|      0|			return (0);
  199|      0|		offset_in_buffer += frame_data_size;
  200|       |
  201|       |		/*
  202|       |		 * There should be at least one more frame
  203|       |		 * if this is LZ4 data.
  204|       |		 */
  205|      0|		if (min_lz4_frame_size > SIZE_MAX - offset_in_buffer)
  ------------------
  |  Branch (205:7): [True: 0, False: 0]
  ------------------
  206|      0|			return (0);
  207|       |		/* TODO: should this be >= ? */
  208|      0|		if (offset_in_buffer + min_lz4_frame_size > (size_t)avail) {
  ------------------
  |  Branch (208:7): [True: 0, False: 0]
  ------------------
  209|      0|			if (offset_in_buffer + min_lz4_frame_size >
  ------------------
  |  Branch (209:8): [True: 0, False: 0]
  ------------------
  210|      0|			    max_lookahead)
  211|      0|				return (0); 
  212|       |
  213|      0|			buffer = __archive_read_filter_ahead(filter,
  214|      0|			    offset_in_buffer + min_lz4_frame_size, &avail);
  215|      0|			if (buffer == NULL)
  ------------------
  |  Branch (215:8): [True: 0, False: 0]
  ------------------
  216|      0|				return (0); 
  217|      0|		}
  218|       |
  219|      0|		magic_number = archive_le32dec(buffer + offset_in_buffer);
  220|      0|	}
  221|       |
  222|       |	/*
  223|       |	 * We have skipped over any skippable frames. Either a regular LZ4 frame
  224|       |	 * follows, or this isn't LZ4 data.
  225|       |	 */
  226|       |
  227|  2.80k|	bits_checked = offset_in_buffer;
  228|  2.80k|	buffer = buffer + offset_in_buffer;
  229|       |
  230|  2.80k|	if (magic_number == LZ4_MAGICNUMBER) {
  ------------------
  |  |   51|  2.80k|#define LZ4_MAGICNUMBER		0x184d2204
  ------------------
  |  Branch (230:6): [True: 16, False: 2.78k]
  ------------------
  231|     16|		unsigned char flag, BD;
  232|       |
  233|     16|		bits_checked += 32;
  234|       |		/* Next follows a stream descriptor. */
  235|       |		/* Descriptor Flags. */
  236|     16|		flag = buffer[4];
  237|       |		/* A version number must be "01". */
  238|     16|		if (((flag & 0xc0) >> 6) != 1)
  ------------------
  |  Branch (238:7): [True: 0, False: 16]
  ------------------
  239|      0|			return (0);
  240|       |		/* A reserved bit must be "0". */
  241|     16|		if (flag & 2)
  ------------------
  |  Branch (241:7): [True: 0, False: 16]
  ------------------
  242|      0|			return (0);
  243|     16|		bits_checked += 8;
  244|     16|		BD = buffer[5];
  245|       |		/* A block maximum size should be more than 3. */
  246|     16|		if (((BD & 0x70) >> 4) < 4)
  ------------------
  |  Branch (246:7): [True: 0, False: 16]
  ------------------
  247|      0|			return (0);
  248|       |		/* Reserved bits must be "0". */
  249|     16|		if (BD & ~0x70)
  ------------------
  |  Branch (249:7): [True: 0, False: 16]
  ------------------
  250|      0|			return (0);
  251|     16|		bits_checked += 8;
  252|       |
  253|     16|		return (bits_checked);
  254|     16|	}
  255|       |
  256|  2.78k|	if (magic_number == LZ4_LEGACY) {
  ------------------
  |  |   52|  2.78k|#define LZ4_LEGACY		0x184c2102
  ------------------
  |  Branch (256:6): [True: 0, False: 2.78k]
  ------------------
  257|      0|		bits_checked += 32;
  258|      0|		return (bits_checked);
  259|      0|	}
  260|       |
  261|  2.78k|	return (0);
  262|  2.78k|}
archive_read_support_filter_lz4.c:lz4_reader_init:
  299|     16|{
  300|     16|	struct private_data *state;
  301|       |
  302|     16|	self->code = ARCHIVE_FILTER_LZ4;
  ------------------
  |  |  322|     16|#define	ARCHIVE_FILTER_LZ4	13
  ------------------
  303|     16|	self->name = "lz4";
  304|       |
  305|     16|	state = calloc(1, sizeof(*state));
  306|     16|	if (state == NULL) {
  ------------------
  |  Branch (306:6): [True: 0, False: 16]
  ------------------
  307|      0|		archive_set_error(&self->archive->archive, ENOMEM,
  308|      0|		    "Can't allocate data for lz4 decompression");
  309|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  310|      0|	}
  311|       |
  312|     16|	self->data = state;
  313|     16|	state->stage = SELECT_STREAM;
  314|     16|	self->vtable = &lz4_reader_vtable;
  315|       |
  316|     16|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     16|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  317|     16|}
archive_read_support_filter_lz4.c:lz4_filter_read:
  374|  2.23k|{
  375|  2.23k|	struct private_data *state = (struct private_data *)self->data;
  376|  2.23k|	ssize_t ret;
  377|       |
  378|  2.23k|	if (state->eof) {
  ------------------
  |  Branch (378:6): [True: 0, False: 2.23k]
  ------------------
  379|      0|		*p = NULL;
  380|      0|		return (0);
  381|      0|	}
  382|       |
  383|  2.23k|	__archive_read_filter_consume(self->upstream, state->unconsumed);
  384|  2.23k|	state->unconsumed = 0;
  385|       |
  386|  2.23k|	switch (state->stage) {
  387|     16|	case SELECT_STREAM:
  ------------------
  |  Branch (387:2): [True: 16, False: 2.22k]
  ------------------
  388|     16|		break;
  389|      0|	case READ_DEFAULT_STREAM:
  ------------------
  |  Branch (389:2): [True: 0, False: 2.23k]
  ------------------
  390|      0|	case READ_LEGACY_STREAM:
  ------------------
  |  Branch (390:2): [True: 0, False: 2.23k]
  ------------------
  391|       |		/* Reading an lz4 stream already failed. */
  392|      0|		archive_set_error(&self->archive->archive,
  393|      0|		    ARCHIVE_ERRNO_MISC, "Invalid sequence");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  394|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  395|  2.22k|	case READ_DEFAULT_BLOCK:
  ------------------
  |  Branch (395:2): [True: 2.22k, False: 16]
  ------------------
  396|  2.22k|		ret = lz4_filter_read_default_stream(self, p);
  397|  2.22k|		if (ret != 0 || state->stage != SELECT_STREAM)
  ------------------
  |  Branch (397:7): [True: 1.83k, False: 384]
  |  Branch (397:19): [True: 0, False: 384]
  ------------------
  398|  1.83k|			return ret;
  399|    384|		break;
  400|    384|	case READ_LEGACY_BLOCK:
  ------------------
  |  Branch (400:2): [True: 0, False: 2.23k]
  ------------------
  401|      0|		ret = lz4_filter_read_legacy_stream(self, p);
  402|      0|		if (ret != 0 || state->stage != SELECT_STREAM)
  ------------------
  |  Branch (402:7): [True: 0, False: 0]
  |  Branch (402:19): [True: 0, False: 0]
  ------------------
  403|      0|			return ret;
  404|      0|		break;
  405|      0|	default:
  ------------------
  |  Branch (405:2): [True: 0, False: 2.23k]
  ------------------
  406|      0|		archive_set_error(&self->archive->archive,
  407|      0|		    ARCHIVE_ERRNO_MISC, "Program error");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  408|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  409|  2.23k|	}
  410|       |
  411|    400|	while (state->stage == SELECT_STREAM) {
  ------------------
  |  Branch (411:9): [True: 400, False: 0]
  ------------------
  412|    400|		const char *read_buf;
  413|       |
  414|       |		/* Read a magic number. */
  415|    400|		read_buf = __archive_read_filter_ahead(self->upstream, 4,
  416|    400|				NULL);
  417|    400|		if (read_buf == NULL) {
  ------------------
  |  Branch (417:7): [True: 0, False: 400]
  ------------------
  418|      0|			state->eof = 1;
  419|      0|			*p = NULL;
  420|      0|			return (0);
  421|      0|		}
  422|    400|		uint32_t number = archive_le32dec(read_buf);
  423|    400|		__archive_read_filter_consume(self->upstream, 4);
  424|    400|		if (number == LZ4_MAGICNUMBER)
  ------------------
  |  |   51|    400|#define LZ4_MAGICNUMBER		0x184d2204
  ------------------
  |  Branch (424:7): [True: 400, False: 0]
  ------------------
  425|    400|			return lz4_filter_read_default_stream(self, p);
  426|      0|		else if (number == LZ4_LEGACY)
  ------------------
  |  |   52|      0|#define LZ4_LEGACY		0x184c2102
  ------------------
  |  Branch (426:12): [True: 0, False: 0]
  ------------------
  427|      0|			return lz4_filter_read_legacy_stream(self, p);
  428|      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 (428:12): [True: 0, False: 0]
  ------------------
  429|      0|			read_buf = __archive_read_filter_ahead(
  430|      0|				self->upstream, 4, NULL);
  431|      0|			if (read_buf == NULL) {
  ------------------
  |  Branch (431:8): [True: 0, False: 0]
  ------------------
  432|      0|				archive_set_error(
  433|      0|				    &self->archive->archive,
  434|      0|		    		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  435|      0|				    "Malformed lz4 data");
  436|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  437|      0|			}
  438|      0|			int64_t skip_bytes = archive_le32dec(read_buf);
  439|      0|			if (__archive_read_filter_consume(self->upstream,
  ------------------
  |  Branch (439:8): [True: 0, False: 0]
  ------------------
  440|      0|			    4 + skip_bytes) < 0) {
  441|      0|				archive_set_error(
  442|      0|				    &self->archive->archive,
  443|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  444|      0|				    "Malformed lz4 data");
  445|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  446|      0|			}
  447|      0|		} else {
  448|       |			/* Ignore following unrecognized data. */
  449|      0|			state->eof = 1;
  450|      0|			*p = NULL;
  451|      0|			return (0);
  452|      0|		}
  453|    400|	}
  454|      0|	state->eof = 1;
  455|       |	*p = NULL;
  456|      0|	return (0);
  457|    400|}
archive_read_support_filter_lz4.c:lz4_filter_read_default_stream:
  707|  2.62k|{
  708|  2.62k|	struct private_data *state = (struct private_data *)self->data;
  709|  2.62k|	const char *read_buf;
  710|  2.62k|	ssize_t ret;
  711|       |
  712|  2.62k|	if (state->stage == SELECT_STREAM) {
  ------------------
  |  Branch (712:6): [True: 400, False: 2.22k]
  ------------------
  713|    400|		state->stage = READ_DEFAULT_STREAM;
  714|       |		/* First, read a descriptor. */
  715|    400|		if((ret = lz4_filter_read_descriptor(self)) != ARCHIVE_OK)
  ------------------
  |  |  233|    400|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (715:6): [True: 1, False: 399]
  ------------------
  716|      1|			return (ret);
  717|    399|		state->stage = READ_DEFAULT_BLOCK;
  718|    399|	}
  719|       |	/* Decompress a block. */
  720|  2.61k|	ret = lz4_filter_read_data_block(self, p);
  721|       |
  722|       |	/* If the end of block is detected, change the filter status
  723|       |	   to read next stream. */
  724|  2.61k|	if (ret == 0 && *p == NULL)
  ------------------
  |  Branch (724:6): [True: 384, False: 2.23k]
  |  Branch (724:18): [True: 384, False: 0]
  ------------------
  725|    384|		state->stage = SELECT_STREAM;
  726|       |
  727|       |	/* Optional processing, checking a stream sum. */
  728|  2.61k|	if (state->flags.stream_checksum) {
  ------------------
  |  Branch (728:6): [True: 2.37k, False: 245]
  ------------------
  729|  2.37k|		if (state->stage == SELECT_STREAM) {
  ------------------
  |  Branch (729:7): [True: 263, False: 2.11k]
  ------------------
  730|    263|			unsigned int checksum;
  731|    263|			unsigned int checksum_stream;
  732|    263|			read_buf = __archive_read_filter_ahead(self->upstream,
  733|    263|			    4, NULL);
  734|    263|			if (read_buf == NULL) {
  ------------------
  |  Branch (734:8): [True: 0, False: 263]
  ------------------
  735|      0|				archive_set_error(&self->archive->archive,
  736|      0|				    ARCHIVE_ERRNO_MISC, "truncated lz4 input");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  737|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  738|      0|			}
  739|    263|			checksum = archive_le32dec(read_buf);
  740|    263|			__archive_read_filter_consume(self->upstream, 4);
  741|    263|			checksum_stream = __archive_xxhash.XXH32_digest(
  742|    263|			    state->xxh32_state);
  743|    263|			state->xxh32_state = NULL;
  744|    263|			if (checksum != checksum_stream) {
  ------------------
  |  Branch (744:8): [True: 263, False: 0]
  ------------------
  745|       |#ifndef DONT_FAIL_ON_CRC_ERROR
  746|       |				archive_set_error(&self->archive->archive,
  747|       |				    ARCHIVE_ERRNO_MISC,
  748|       |				    "lz4 stream checksum error");
  749|       |				return (ARCHIVE_FATAL);
  750|       |#endif
  751|    263|			}
  752|  2.11k|		} else if (ret > 0)
  ------------------
  |  Branch (752:14): [True: 2.09k, False: 13]
  ------------------
  753|  2.09k|			__archive_xxhash.XXH32_update(state->xxh32_state,
  754|  2.09k|			    *p, (int)ret);
  755|  2.37k|	}
  756|  2.61k|	return (ret);
  757|  2.61k|}
archive_read_support_filter_lz4.c:lz4_filter_read_descriptor:
  461|    400|{
  462|    400|	struct private_data *state = (struct private_data *)self->data;
  463|    400|	const char *read_buf;
  464|    400|	ssize_t bytes_remaining;
  465|    400|	ssize_t descriptor_bytes;
  466|    400|	unsigned char flag, bd;
  467|    400|	unsigned int chsum, chsum_verifier;
  468|       |
  469|       |	/* Make sure we have 2 bytes for flags. */
  470|    400|	read_buf = __archive_read_filter_ahead(self->upstream, 2,
  471|    400|	    &bytes_remaining);
  472|    400|	if (read_buf == NULL) {
  ------------------
  |  Branch (472:6): [True: 1, False: 399]
  ------------------
  473|      1|		archive_set_error(&self->archive->archive,
  474|      1|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  475|      1|		    "truncated lz4 input");
  476|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  477|      1|	}
  478|       |
  479|       |	/*
  480|       |	   Parse flags.
  481|       |	 */
  482|    399|	flag = (unsigned char)read_buf[0];
  483|       |	/* Verify version number. */
  484|    399|	if ((flag & 0xc0) != 1<<6)
  ------------------
  |  Branch (484:6): [True: 0, False: 399]
  ------------------
  485|      0|		goto malformed_error;
  486|       |	/* A reserved bit must be zero. */
  487|    399|	if (flag & 0x02)
  ------------------
  |  Branch (487:6): [True: 0, False: 399]
  ------------------
  488|      0|		goto malformed_error;
  489|    399|	state->flags.block_independence = (flag & 0x20) != 0;
  490|    399|	state->flags.block_checksum = (flag & 0x10)?4:0;
  ------------------
  |  Branch (490:32): [True: 5, False: 394]
  ------------------
  491|    399|	state->flags.stream_size = (flag & 0x08) != 0;
  492|    399|	state->flags.stream_checksum = (flag & 0x04) != 0;
  493|    399|	state->flags.preset_dictionary = (flag & 0x01) != 0;
  494|       |
  495|       |	/* BD */
  496|    399|	bd = (unsigned char)read_buf[1];
  497|       |	/* Reserved bits must be zero. */
  498|    399|	if (bd & 0x8f)
  ------------------
  |  Branch (498:6): [True: 0, False: 399]
  ------------------
  499|      0|		goto malformed_error;
  500|       |	/* Get a maximum block size. */
  501|    399|	switch (read_buf[1] >> 4) {
  502|     11|	case 4: /* 64 KB */
  ------------------
  |  Branch (502:2): [True: 11, False: 388]
  ------------------
  503|     11|		state->flags.block_maximum_size = 64 * 1024;
  504|     11|		break;
  505|    266|	case 5: /* 256 KB */
  ------------------
  |  Branch (505:2): [True: 266, False: 133]
  ------------------
  506|    266|		state->flags.block_maximum_size = 256 * 1024;
  507|    266|		break;
  508|      0|	case 6: /* 1 MB */
  ------------------
  |  Branch (508:2): [True: 0, False: 399]
  ------------------
  509|      0|		state->flags.block_maximum_size = 1024 * 1024;
  510|      0|		break;
  511|    122|	case 7: /* 4 MB */
  ------------------
  |  Branch (511:2): [True: 122, False: 277]
  ------------------
  512|    122|		state->flags.block_maximum_size = 4 * 1024 * 1024;
  513|    122|		break;
  514|      0|	default:
  ------------------
  |  Branch (514:2): [True: 0, False: 399]
  ------------------
  515|      0|		goto malformed_error;
  516|    399|	}
  517|       |
  518|       |	/* Read the whole descriptor in a stream block. */
  519|    399|	descriptor_bytes = 3;
  520|    399|	if (state->flags.stream_size)
  ------------------
  |  Branch (520:6): [True: 0, False: 399]
  ------------------
  521|      0|		descriptor_bytes += 8;
  522|    399|	if (state->flags.preset_dictionary)
  ------------------
  |  Branch (522:6): [True: 0, False: 399]
  ------------------
  523|      0|		descriptor_bytes += 4;
  524|    399|	if (bytes_remaining < descriptor_bytes) {
  ------------------
  |  Branch (524:6): [True: 0, False: 399]
  ------------------
  525|      0|		read_buf = __archive_read_filter_ahead(self->upstream,
  526|      0|		    descriptor_bytes, &bytes_remaining);
  527|      0|		if (read_buf == NULL) {
  ------------------
  |  Branch (527:7): [True: 0, False: 0]
  ------------------
  528|      0|			archive_set_error(&self->archive->archive,
  529|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  530|      0|			    "truncated lz4 input");
  531|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  532|      0|		}
  533|      0|	}
  534|       |	/* Check if a descriptor is corrupted */
  535|    399|	chsum = __archive_xxhash.XXH32(read_buf, (int)descriptor_bytes -1, 0);
  536|    399|	chsum = (chsum >> 8) & 0xff;
  537|    399|	chsum_verifier = read_buf[descriptor_bytes-1] & 0xff;
  538|       |#ifndef DONT_FAIL_ON_CRC_ERROR
  539|       |	if (chsum != chsum_verifier)
  540|       |		goto malformed_error;
  541|       |#endif
  542|       |
  543|    399|	__archive_read_filter_consume(self->upstream, descriptor_bytes);
  544|       |
  545|       |	/* Make sure we have a large enough buffer for uncompressed data. */
  546|    399|	if (lz4_allocate_out_block(self) != ARCHIVE_OK)
  ------------------
  |  |  233|    399|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (546:6): [True: 0, False: 399]
  ------------------
  547|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  548|    399|	if (state->flags.stream_checksum) {
  ------------------
  |  Branch (548:6): [True: 276, False: 123]
  ------------------
  549|    276|		state->xxh32_state = __archive_xxhash.XXH32_init(0);
  550|    276|		if (state->xxh32_state == NULL)
  ------------------
  |  Branch (550:7): [True: 0, False: 276]
  ------------------
  551|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  552|    276|	}
  553|       |
  554|    399|	state->decoded_size = 0;
  555|       |	/* Success */
  556|    399|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    399|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  557|      0|malformed_error:
  558|      0|	archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  559|      0|	    "malformed lz4 data");
  560|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  561|    399|}
archive_read_support_filter_lz4.c:lz4_allocate_out_block:
  321|    399|{
  322|    399|	struct private_data *state = (struct private_data *)self->data;
  323|    399|	size_t out_block_size = state->flags.block_maximum_size;
  324|    399|	void *out_block;
  325|       |
  326|    399|	if (!state->flags.block_independence)
  ------------------
  |  Branch (326:6): [True: 272, False: 127]
  ------------------
  327|    272|		out_block_size += 64 * 1024;
  328|    399|	if (state->out_block_size < out_block_size) {
  ------------------
  |  Branch (328:6): [True: 16, False: 383]
  ------------------
  329|     16|		free(state->out_block);
  330|     16|		state->out_block = NULL;
  331|     16|		out_block = malloc(out_block_size);
  332|     16|		if (out_block == NULL) {
  ------------------
  |  Branch (332:7): [True: 0, False: 16]
  ------------------
  333|      0|			state->out_block_size = 0;
  334|      0|			archive_set_error(&self->archive->archive, ENOMEM,
  335|      0|			    "Can't allocate data for lz4 decompression");
  336|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  337|      0|		}
  338|     16|		state->out_block_size = out_block_size;
  339|     16|		state->out_block = out_block;
  340|     16|	}
  341|    399|	if (!state->flags.block_independence)
  ------------------
  |  Branch (341:6): [True: 272, False: 127]
  ------------------
  342|    272|		memset(state->out_block, 0, 64 * 1024);
  343|    399|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    399|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  344|    399|}
archive_read_support_filter_lz4.c:lz4_filter_read_data_block:
  565|  2.61k|{
  566|  2.61k|	struct private_data *state = (struct private_data *)self->data;
  567|  2.61k|	ssize_t compressed_size;
  568|  2.61k|	const char *read_buf;
  569|  2.61k|	int checksum_size;
  570|  2.61k|	ssize_t uncompressed_size;
  571|  2.61k|	size_t prefix64k;
  572|       |
  573|  2.61k|	*p = NULL;
  574|       |
  575|       |	/* Make sure we have 4 bytes for a block size. */
  576|  2.61k|	read_buf = __archive_read_filter_ahead(self->upstream, 4, NULL);
  577|  2.61k|	if (read_buf == NULL)
  ------------------
  |  Branch (577:6): [True: 2, False: 2.61k]
  ------------------
  578|      2|		goto truncated_error;
  579|  2.61k|	compressed_size = archive_le32dec(read_buf);
  580|  2.61k|	if ((compressed_size & 0x7fffffff) > state->flags.block_maximum_size)
  ------------------
  |  Branch (580:6): [True: 8, False: 2.60k]
  ------------------
  581|      8|		goto malformed_error;
  582|       |	/* A compressed size == 0 means the end of stream blocks. */
  583|  2.60k|	if (compressed_size == 0) {
  ------------------
  |  Branch (583:6): [True: 384, False: 2.22k]
  ------------------
  584|    384|		__archive_read_filter_consume(self->upstream, 4);
  585|    384|		return 0;
  586|    384|	}
  587|       |
  588|  2.22k|	checksum_size = state->flags.block_checksum;
  589|       |	/* Check if the block is uncompressed. */
  590|  2.22k|	if (compressed_size & 0x80000000U) {
  ------------------
  |  Branch (590:6): [True: 2.22k, False: 4]
  ------------------
  591|  2.22k|		compressed_size &= 0x7fffffff;
  592|  2.22k|		uncompressed_size = compressed_size;
  593|  2.22k|	} else
  594|      4|		uncompressed_size = 0;/* Unknown yet. */
  595|       |
  596|       |	/*
  597|       |	  Unfortunately, lz4 decompression API requires a whole block
  598|       |	  for its decompression speed, so we read a whole block and allocate
  599|       |	  a huge buffer used for decoded data.
  600|       |	*/
  601|  2.22k|	read_buf = __archive_read_filter_ahead(self->upstream,
  602|  2.22k|	    4 + compressed_size + checksum_size, NULL);
  603|  2.22k|	if (read_buf == NULL)
  ------------------
  |  Branch (603:6): [True: 1, False: 2.22k]
  ------------------
  604|      1|		goto truncated_error;
  605|       |
  606|       |	/* Optional processing, checking a block sum. */
  607|  2.22k|	if (checksum_size) {
  ------------------
  |  Branch (607:6): [True: 363, False: 1.86k]
  ------------------
  608|    363|		unsigned int chsum = __archive_xxhash.XXH32(
  609|    363|			read_buf + 4, (int)compressed_size, 0);
  610|    363|		unsigned int chsum_block =
  611|    363|		    archive_le32dec(read_buf + 4 + compressed_size);
  612|       |#ifndef DONT_FAIL_ON_CRC_ERROR
  613|       |		if (chsum != chsum_block)
  614|       |			goto malformed_error;
  615|       |#endif
  616|    363|	}
  617|       |
  618|       |
  619|       |	/* If the block is uncompressed, there is nothing to do. */
  620|  2.22k|	if (uncompressed_size) {
  ------------------
  |  Branch (620:6): [True: 2.22k, False: 4]
  ------------------
  621|       |		/* Prepare a prefix 64k block for next block. */
  622|  2.22k|		if (!state->flags.block_independence) {
  ------------------
  |  Branch (622:7): [True: 629, False: 1.59k]
  ------------------
  623|    629|			prefix64k = 64 * 1024;
  624|    629|			if (uncompressed_size < (ssize_t)prefix64k) {
  ------------------
  |  Branch (624:8): [True: 629, False: 0]
  ------------------
  625|    629|				memcpy(state->out_block
  626|    629|					+ prefix64k - uncompressed_size,
  627|    629|				    read_buf + 4,
  628|    629|				    uncompressed_size);
  629|    629|				memset(state->out_block, 0,
  630|    629|				    prefix64k - uncompressed_size);
  631|    629|			} else {
  632|      0|				memcpy(state->out_block,
  633|      0|				    read_buf + 4
  634|      0|					+ uncompressed_size - prefix64k,
  635|      0|				    prefix64k);
  636|      0|			}
  637|    629|			state->decoded_size = 0;
  638|    629|		}
  639|  2.22k|		state->unconsumed = 4 + uncompressed_size + checksum_size;
  640|  2.22k|		*p = read_buf + 4;
  641|  2.22k|		return uncompressed_size;
  642|  2.22k|	}
  643|       |
  644|       |	/*
  645|       |	   Decompress a block data.
  646|       |	 */
  647|      4|	if (state->flags.block_independence) {
  ------------------
  |  Branch (647:6): [True: 1, False: 3]
  ------------------
  648|      1|		prefix64k = 0;
  649|      1|		uncompressed_size = LZ4_decompress_safe(read_buf + 4,
  650|      1|		    state->out_block, (int)compressed_size,
  651|      1|		    state->flags.block_maximum_size);
  652|      3|	} else {
  653|      3|		prefix64k = 64 * 1024;
  654|      3|		if (state->decoded_size) {
  ------------------
  |  Branch (654:7): [True: 0, False: 3]
  ------------------
  655|      0|			if (state->decoded_size < prefix64k) {
  ------------------
  |  Branch (655:8): [True: 0, False: 0]
  ------------------
  656|      0|				memmove(state->out_block
  657|      0|					+ prefix64k - state->decoded_size,
  658|      0|				    state->out_block + prefix64k,
  659|      0|				    state->decoded_size);
  660|      0|				memset(state->out_block, 0,
  661|      0|				    prefix64k - state->decoded_size);
  662|      0|			} else {
  663|      0|				memmove(state->out_block,
  664|      0|				    state->out_block + state->decoded_size,
  665|      0|				    prefix64k);
  666|      0|			}
  667|      0|		}
  668|      3|#if LZ4_VERSION_MAJOR >= 1 && LZ4_VERSION_MINOR >= 7
  669|      3|		uncompressed_size = LZ4_decompress_safe_usingDict(
  670|      3|		    read_buf + 4,
  671|      3|		    state->out_block + prefix64k, (int)compressed_size,
  672|      3|		    state->flags.block_maximum_size,
  673|      3|		    state->out_block,
  674|      3|		    (int)prefix64k);
  675|       |#else
  676|       |		uncompressed_size = LZ4_decompress_safe_withPrefix64k(
  677|       |		    read_buf + 4,
  678|       |		    state->out_block + prefix64k, (int)compressed_size,
  679|       |		    state->flags.block_maximum_size);
  680|       |#endif
  681|      3|	}
  682|       |
  683|       |	/* Check if an error occurred in the decompression process. */
  684|      4|	if (uncompressed_size < 0) {
  ------------------
  |  Branch (684:6): [True: 4, False: 0]
  ------------------
  685|      4|		archive_set_error(&(self->archive->archive),
  686|      4|		    ARCHIVE_ERRNO_MISC, "lz4 decompression failed");
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  687|      4|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  688|      4|	}
  689|       |
  690|      0|	state->unconsumed = 4 + compressed_size + checksum_size;
  691|      0|	*p = state->out_block + prefix64k;
  692|      0|	state->decoded_size = uncompressed_size;
  693|      0|	return uncompressed_size;
  694|       |
  695|      8|malformed_error:
  696|      8|	archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      8|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  697|      8|	    "malformed lz4 data");
  698|      8|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  699|      3|truncated_error:
  700|      3|	archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  701|      3|	    "truncated lz4 input");
  702|      3|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  703|      4|}
archive_read_support_filter_lz4.c:lz4_filter_close:
  817|     16|{
  818|     16|	struct private_data *state;
  819|     16|	int ret = ARCHIVE_OK;
  ------------------
  |  |  233|     16|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  820|       |
  821|     16|	state = (struct private_data *)self->data;
  822|     16|	free(state->xxh32_state);
  823|     16|	free(state->out_block);
  824|     16|	free(state);
  825|     16|	return (ret);
  826|     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|  2.49k|	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  2.49k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  121|  2.49k|	    "Using external lzop program for lzop decompression");
  122|  2.49k|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|  2.49k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  123|  2.49k|#endif
  124|  2.49k|}
archive_read_support_filter_lzop.c:lzop_bidder_bid:
  132|  2.86k|{
  133|  2.86k|	const unsigned char *p;
  134|       |
  135|  2.86k|	(void)self; /* UNUSED */
  136|       |
  137|  2.86k|	p = __archive_read_filter_ahead(filter, LZOP_HEADER_MAGIC_LEN, NULL);
  ------------------
  |  |   68|  2.86k|#define LZOP_HEADER_MAGIC_LEN 9
  ------------------
  138|  2.86k|	if (p == NULL)
  ------------------
  |  Branch (138:6): [True: 59, False: 2.80k]
  ------------------
  139|     59|		return (0);
  140|       |
  141|  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 (141:6): [True: 2.80k, False: 0]
  ------------------
  142|  2.80k|		return (0);
  143|       |
  144|      0|	return (LZOP_HEADER_MAGIC_LEN * 8);
  ------------------
  |  |   68|      0|#define LZOP_HEADER_MAGIC_LEN 9
  ------------------
  145|  2.80k|}

archive_read_support_filter_rpm:
   71|  2.49k|{
   72|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
   73|       |
   74|       |	return __archive_read_register_bidder(a, NULL, "rpm",
   75|  2.49k|			&rpm_bidder_vtable);
   76|  2.49k|}
archive_read_support_filter_rpm.c:rpm_bidder_bid:
   81|  2.86k|{
   82|  2.86k|	const unsigned char *b;
   83|  2.86k|	int bits_checked;
   84|       |
   85|  2.86k|	(void)self; /* UNUSED */
   86|       |
   87|  2.86k|	b = __archive_read_filter_ahead(filter, 8, NULL);
   88|  2.86k|	if (b == NULL)
  ------------------
  |  Branch (88:6): [True: 59, False: 2.80k]
  ------------------
   89|     59|		return (0);
   90|       |
   91|  2.80k|	bits_checked = 0;
   92|       |	/*
   93|       |	 * Verify Header Magic Bytes : 0XED 0XAB 0XEE 0XDB
   94|       |	 */
   95|  2.80k|	if (memcmp(b, "\xED\xAB\xEE\xDB", 4) != 0)
  ------------------
  |  Branch (95:6): [True: 2.72k, False: 79]
  ------------------
   96|  2.72k|		return (0);
   97|     79|	bits_checked += 32;
   98|       |	/*
   99|       |	 * Check major version.
  100|       |	 */
  101|     79|	if (b[4] != 3 && b[4] != 4)
  ------------------
  |  Branch (101:6): [True: 79, False: 0]
  |  Branch (101:19): [True: 0, False: 79]
  ------------------
  102|      0|		return (0);
  103|     79|	bits_checked += 8;
  104|       |	/*
  105|       |	 * Check package type; binary or source.
  106|       |	 */
  107|     79|	if (b[6] != 0)
  ------------------
  |  Branch (107:6): [True: 0, False: 79]
  ------------------
  108|      0|		return (0);
  109|     79|	bits_checked += 8;
  110|     79|	if (b[7] != 0 && b[7] != 1)
  ------------------
  |  Branch (110:6): [True: 41, False: 38]
  |  Branch (110:19): [True: 0, False: 41]
  ------------------
  111|      0|		return (0);
  112|     79|	bits_checked += 8;
  113|       |
  114|     79|	return (bits_checked);
  115|     79|}
archive_read_support_filter_rpm.c:rpm_bidder_init:
  125|     79|{
  126|     79|	struct rpm   *rpm;
  127|       |
  128|     79|	self->code = ARCHIVE_FILTER_RPM;
  ------------------
  |  |  317|     79|#define	ARCHIVE_FILTER_RPM	8
  ------------------
  129|     79|	self->name = "rpm";
  130|       |
  131|     79|	rpm = calloc(1, sizeof(*rpm));
  132|     79|	if (rpm == NULL) {
  ------------------
  |  Branch (132:6): [True: 0, False: 79]
  ------------------
  133|      0|		archive_set_error(&self->archive->archive, ENOMEM,
  134|      0|		    "Can't allocate data for rpm");
  135|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  136|      0|	}
  137|       |
  138|     79|	self->data = rpm;
  139|     79|	rpm->data_reached = 0;
  140|     79|	self->vtable = &rpm_reader_vtable;
  141|       |
  142|     79|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     79|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  143|     79|}
archive_read_support_filter_rpm.c:rpm_filter_read:
  222|    151|{
  223|    151|	struct rpm *rpm;
  224|    151|	ssize_t r;
  225|       |
  226|    151|	rpm = (struct rpm *)self->data;
  227|       |
  228|    151|	if (!rpm->data_reached) {
  ------------------
  |  Branch (228:6): [True: 79, False: 72]
  ------------------
  229|     79|		r = skip_prologue(self);
  230|     79|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|     79|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (230:7): [True: 2, False: 77]
  ------------------
  231|      2|			return (r);
  232|     77|		rpm->data_reached = 1;
  233|     77|	}
  234|       |
  235|    149|	*buff = __archive_read_filter_ahead(self->upstream, 1, &r);
  236|    149|	if (r > 0)
  ------------------
  |  Branch (236:6): [True: 77, False: 72]
  ------------------
  237|     77|		__archive_read_filter_consume(self->upstream, r);
  238|       |
  239|    149|	return r;
  240|    151|}
archive_read_support_filter_rpm.c:skip_prologue:
  167|     79|{
  168|     79|	const unsigned char *h;
  169|     79|	ssize_t r;
  170|     79|	int header, seen_header = 0;
  171|       |
  172|       |	/* Skip lead size. */
  173|     79|	r = __archive_read_filter_consume(self->upstream, RPM_LEAD_SIZE);
  ------------------
  |  |   43|     79|#define RPM_LEAD_SIZE		96	/* Size of 'Lead' section. */
  ------------------
  174|     79|	if (r < 0)
  ------------------
  |  Branch (174:6): [True: 0, False: 79]
  ------------------
  175|      0|		return (r);
  176|       |
  177|    156|	do {
  178|       |		/* Read header intro. */
  179|    156|		h = __archive_read_filter_ahead(self->upstream,
  180|    156|		    RPM_MIN_HEAD_SIZE, NULL);
  ------------------
  |  |   44|    156|#define RPM_MIN_HEAD_SIZE	16	/* Minimum size of 'Head'. */
  ------------------
  181|    156|		if (h == NULL)
  ------------------
  |  Branch (181:7): [True: 0, False: 156]
  ------------------
  182|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  183|       |
  184|    156|		header = (memcmp(h, "\x8E\xAD\xE8\x01", 4) == 0);
  185|    156|		if (header) {
  ------------------
  |  Branch (185:7): [True: 79, False: 77]
  ------------------
  186|     79|			int64_t bytes, length, section;
  187|       |
  188|     79|			seen_header = 1;
  189|       |
  190|       |			/* Calculate header length. */
  191|     79|			section = archive_be32dec(h + 8);
  192|     79|			bytes = archive_be32dec(h + 12);
  193|     79|			length = RPM_MIN_HEAD_SIZE + section * 16 + bytes;
  ------------------
  |  |   44|     79|#define RPM_MIN_HEAD_SIZE	16	/* Minimum size of 'Head'. */
  ------------------
  194|       |
  195|       |			/* Skip header. */
  196|     79|			r = __archive_read_filter_consume(self->upstream,
  197|     79|			     length);
  198|     79|			if (r < 0)
  ------------------
  |  Branch (198:8): [True: 2, False: 77]
  ------------------
  199|      2|				return (r);
  200|       |
  201|       |			/* Skip padding. */
  202|     77|			r = skip_padding(self);
  203|     77|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|     77|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (203:8): [True: 0, False: 77]
  ------------------
  204|      0|				return (r);
  205|     77|		}
  206|    156|	} while (header);
  ------------------
  |  Branch (206:11): [True: 77, False: 77]
  ------------------
  207|       |
  208|       |	/* At least one header must have been encountered. */
  209|     77|	if (!seen_header) {
  ------------------
  |  Branch (209:6): [True: 0, False: 77]
  ------------------
  210|      0|		archive_set_error(
  211|      0|		    &self->archive->archive,
  212|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  213|      0|		    "Unrecognized rpm header");
  214|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  215|      0|	}
  216|       |
  217|     77|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     77|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  218|     77|}
archive_read_support_filter_rpm.c:skip_padding:
  147|     77|{
  148|     77|	const unsigned char *h;
  149|     77|	ssize_t avail, count, r;
  150|       |
  151|     77|	do {
  152|     77|		h = __archive_read_filter_ahead(self->upstream, 1, &avail);
  153|     77|		if (h == NULL)
  ------------------
  |  Branch (153:7): [True: 0, False: 77]
  ------------------
  154|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  155|  1.22k|		for (count = 0; count < avail && *h++ == '\0'; count++)
  ------------------
  |  Branch (155:19): [True: 1.22k, False: 0]
  |  Branch (155:36): [True: 1.14k, False: 77]
  ------------------
  156|  1.14k|			;
  157|     77|		r = __archive_read_filter_consume(self->upstream, count);
  158|     77|		if (r < 0)
  ------------------
  |  Branch (158:7): [True: 0, False: 77]
  ------------------
  159|      0|			return (r);
  160|     77|	} while (count == avail);
  ------------------
  |  Branch (160:11): [True: 0, False: 77]
  ------------------
  161|       |
  162|     77|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     77|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  163|     77|}
archive_read_support_filter_rpm.c:rpm_filter_close:
  244|     79|{
  245|     79|	struct rpm *rpm;
  246|       |
  247|     79|	rpm = (struct rpm *)self->data;
  248|     79|	free(rpm);
  249|       |
  250|     79|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     79|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  251|     79|}

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

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

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

archive_read_support_format_7zip:
  492|  2.49k|{
  493|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  494|  2.49k|	struct _7zip *zip;
  495|  2.49k|	int r;
  496|       |
  497|  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]
  |  |  ------------------
  ------------------
  498|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_7zip");
  499|       |
  500|  2.49k|	zip = calloc(1, sizeof(*zip));
  501|  2.49k|	if (zip == NULL) {
  ------------------
  |  Branch (501:6): [True: 0, False: 2.49k]
  ------------------
  502|      0|		archive_set_error(&a->archive, ENOMEM,
  503|      0|		    "Can't allocate 7zip data");
  504|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  505|      0|	}
  506|       |
  507|       |	/*
  508|       |	 * Until enough data has been read, we cannot tell about
  509|       |	 * any encrypted entries yet.
  510|       |	 */
  511|  2.49k|	zip->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|  2.49k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  512|       |
  513|       |
  514|  2.49k|	r = __archive_read_register_format(a,
  515|  2.49k|	    zip,
  516|  2.49k|	    "7zip",
  517|  2.49k|	    archive_read_format_7zip_bid,
  518|  2.49k|	    NULL,
  519|  2.49k|	    archive_read_format_7zip_read_header,
  520|  2.49k|	    archive_read_format_7zip_read_data,
  521|  2.49k|	    archive_read_format_7zip_read_data_skip,
  522|  2.49k|	    NULL,
  523|  2.49k|	    archive_read_format_7zip_cleanup,
  524|  2.49k|	    archive_read_support_format_7zip_capabilities,
  525|  2.49k|	    archive_read_format_7zip_has_encrypted_entries);
  526|       |
  527|  2.49k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (527:6): [True: 0, False: 2.49k]
  ------------------
  528|      0|		free(zip);
  529|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  530|  2.49k|}
archive_read_support_format_7zip.c:archive_read_support_format_7zip_capabilities:
  534|    214|{
  535|    214|	(void)a; /* UNUSED */
  536|    214|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA |
  ------------------
  |  |  398|    214|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
  537|    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.) */
  ------------------
  538|    214|}
archive_read_support_format_7zip.c:archive_read_format_7zip_has_encrypted_entries:
  543|    107|{
  544|    107|	if (_a && _a->format) {
  ------------------
  |  Branch (544:6): [True: 107, False: 0]
  |  Branch (544:12): [True: 107, False: 0]
  ------------------
  545|    107|		struct _7zip * zip = (struct _7zip *)_a->format->data;
  546|    107|		if (zip) {
  ------------------
  |  Branch (546:7): [True: 107, False: 0]
  ------------------
  547|    107|			return zip->has_encrypted_entries;
  548|    107|		}
  549|    107|	}
  550|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  551|    107|}
archive_read_support_format_7zip.c:archive_read_format_7zip_bid:
  622|  2.45k|{
  623|  2.45k|	int64_t data_offset;
  624|       |
  625|       |	/* If someone has already bid more than 32, then avoid
  626|       |	   trashing the look-ahead buffers with a seek. */
  627|  2.45k|	if (best_bid > 32)
  ------------------
  |  Branch (627:6): [True: 799, False: 1.65k]
  ------------------
  628|    799|		return (-1);
  629|       |
  630|  1.65k|	if (get_data_offset(a, &data_offset, 0) < 0)
  ------------------
  |  Branch (630:6): [True: 1.55k, False: 107]
  ------------------
  631|  1.55k|		return (0);
  632|       |
  633|    107|	return (48);
  634|  1.65k|}
archive_read_support_format_7zip.c:get_data_offset:
  555|  1.76k|{
  556|  1.76k|	const unsigned char *p;
  557|  1.76k|	int64_t offset, sfx_offset;
  558|  1.76k|	int r, window;
  559|       |
  560|  1.76k|	if ((p = __archive_read_ahead(a, 6, NULL)) == NULL) {
  ------------------
  |  Branch (560:6): [True: 24, False: 1.74k]
  ------------------
  561|     24|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     24|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  562|     24|		    "Truncated 7-Zip file body");
  563|     24|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     24|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  564|     24|	}
  565|       |
  566|       |	/* If first six bytes are the 7-Zip signature,
  567|       |	 * return the offset right now. */
  568|  1.74k|	if (memcmp(p, _7ZIP_SIGNATURE, 6) == 0) {
  ------------------
  |  |   66|  1.74k|#define _7ZIP_SIGNATURE	"7z\xBC\xAF\x27\x1C"
  ------------------
  |  Branch (568:6): [True: 206, False: 1.53k]
  ------------------
  569|    206|		*data_offset = 0;
  570|    206|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    206|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  571|    206|	}
  572|       |
  573|       |	/*
  574|       |	 * It may be a 7-Zip SFX archive file. If first two bytes are
  575|       |	 * 'M' and 'Z' (PE, Windows) or first four bytes are
  576|       |	 * "\x7F\x45LF" (ELF, Posix-like systems), seek the 7-Zip
  577|       |	 * signature. While get_pe_sfx_offset can be performed without
  578|       |	 * performing a seek, get_elf_sfx_offset requires one,
  579|       |	 * thus a performance difference between the two is expected. 
  580|       |	 */
  581|  1.53k|	if ((p[0] == 'M' && p[1] == 'Z'))
  ------------------
  |  Branch (581:7): [True: 101, False: 1.43k]
  |  Branch (581:22): [True: 74, False: 27]
  ------------------
  582|     74|		r = get_pe_sfx_offset(a, &sfx_offset);
  583|  1.46k|	else if (memcmp(p, "\x7F\x45LF", 4) == 0)
  ------------------
  |  Branch (583:11): [True: 23, False: 1.43k]
  ------------------
  584|     23|		r = get_elf_sfx_offset(a, &sfx_offset, compat);
  585|  1.43k|	else
  586|  1.43k|		r = ARCHIVE_FATAL;
  ------------------
  |  |  239|  1.43k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  587|  1.53k|	if (r < ARCHIVE_WARN || sfx_offset > SFX_MAX_SEEK)
  ------------------
  |  |  235|  3.07k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
              	if (r < ARCHIVE_WARN || sfx_offset > SFX_MAX_SEEK)
  ------------------
  |  |   70|     42|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (587:6): [True: 1.49k, False: 42]
  |  Branch (587:26): [True: 6, False: 36]
  ------------------
  588|  1.50k|		goto fail;
  589|       |
  590|     36|	offset = sfx_offset;
  591|     36|	window = 4096;
  592|    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 (592:9): [True: 204, False: 2]
  ------------------
  593|    204|		ssize_t bytes_avail;
  594|    204|		const unsigned char *buff = __archive_read_ahead(a,
  595|    204|				offset + window, &bytes_avail);
  596|    204|		if (buff == NULL) {
  ------------------
  |  Branch (596:7): [True: 190, False: 14]
  ------------------
  597|       |			/* Remaining bytes are less than window. */
  598|    190|			window >>= 1;
  599|    190|			if (window < 0x40)
  ------------------
  |  Branch (599:8): [True: 26, False: 164]
  ------------------
  600|     26|				goto fail;
  601|    164|			continue;
  602|    190|		}
  603|     14|		p = buff + offset;
  604|   194k|		while (p + 32 < buff + bytes_avail) {
  ------------------
  |  Branch (604:10): [True: 194k, False: 6]
  ------------------
  605|   194k|			int step = check_7zip_header_in_sfx(p);
  606|   194k|			if (step == 0) {
  ------------------
  |  Branch (606:8): [True: 8, False: 194k]
  ------------------
  607|      8|				*data_offset = p - buff;
  608|      8|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      8|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  609|      8|			}
  610|   194k|			p += step;
  611|   194k|		}
  612|      6|		offset = p - buff;
  613|      6|	}
  614|  1.52k|fail:
  615|  1.52k|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.52k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  616|  1.52k|	    "Couldn't find out 7-Zip header");
  617|  1.52k|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|  1.52k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  618|     36|}
archive_read_support_format_7zip.c:get_pe_sfx_offset:
  663|     74|{
  664|     74|	const char *h;
  665|     74|	int64_t max_offset, offset;
  666|     74|	ssize_t bytes;
  667|     74|	uint16_t opt_hdr_sz, sec_cnt;
  668|       |
  669|       |	/*
  670|       |	 * If encounter any weirdness, revert to old brute-force style search
  671|       |	 */
  672|     74|	*sfx_offset = SFX_MIN_ADDR;
  ------------------
  |  |   67|     74|#define SFX_MIN_ADDR	0x27000
  ------------------
  673|       |
  674|     74|	for (;;) {
  675|       |		/*
  676|       |		 * Read Dos header to find e_lfanew
  677|       |		 */
  678|     74|		h = __archive_read_ahead(a, PE_DOS_HDR_LEN, &bytes);
  ------------------
  |  |   75|     74|#define PE_DOS_HDR_LEN				0x40
  ------------------
  679|     74|		if (h == NULL) {
  ------------------
  |  Branch (679:7): [True: 0, False: 74]
  ------------------
  680|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  681|      0|		}
  682|     74|		if (h[0] != 'M' || h[1] != 'Z') {
  ------------------
  |  Branch (682:7): [True: 0, False: 74]
  |  Branch (682:22): [True: 0, False: 74]
  ------------------
  683|      0|			break;
  684|      0|		}
  685|     74|		offset = archive_le32dec(h + PE_DOS_HDR_ELFANEW_OFFSET);
  ------------------
  |  |   76|     74|#define PE_DOS_HDR_ELFANEW_OFFSET	0x3c
  ------------------
  686|     74|		if (offset > SFX_MAX_SEEK) {
  ------------------
  |  |   70|     74|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (686:7): [True: 46, False: 28]
  ------------------
  687|     46|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     46|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  688|     46|		}
  689|       |
  690|       |		/*
  691|       |		 * Read COFF header to find opt header size and sec cnt
  692|       |		 */
  693|     28|		if (bytes < offset + PE_COFF_HDR_LEN) {
  ------------------
  |  |   77|     28|#define PE_COFF_HDR_LEN				0x18
  ------------------
  |  Branch (693:7): [True: 0, False: 28]
  ------------------
  694|      0|			h = __archive_read_ahead(a, offset + PE_COFF_HDR_LEN,
  ------------------
  |  |   77|      0|#define PE_COFF_HDR_LEN				0x18
  ------------------
  695|      0|			    &bytes);
  696|      0|			if (h == NULL) {
  ------------------
  |  Branch (696:8): [True: 0, False: 0]
  ------------------
  697|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  698|      0|			}
  699|      0|			if (h[offset] != 'P' || h[offset + 1] != 'E') {
  ------------------
  |  Branch (699:8): [True: 0, False: 0]
  |  Branch (699:28): [True: 0, False: 0]
  ------------------
  700|      0|				break;
  701|      0|			}
  702|      0|		}
  703|     28|		sec_cnt = archive_le16dec(
  704|     28|		    h + offset + PE_COFF_HDR_SEC_CNT_OFFSET);
  ------------------
  |  |   78|     28|#define PE_COFF_HDR_SEC_CNT_OFFSET	0x6
  ------------------
  705|     28|		opt_hdr_sz = archive_le16dec(
  706|     28|		    h + offset + PE_COFF_HDR_OPT_SZ_OFFSET);
  ------------------
  |  |   79|     28|#define PE_COFF_HDR_OPT_SZ_OFFSET	0x14
  ------------------
  707|       |
  708|       |		/*
  709|       |		 * Skip optional header
  710|       |		 */
  711|     28|		if (opt_hdr_sz != 0) {
  ------------------
  |  Branch (711:7): [True: 20, False: 8]
  ------------------
  712|     20|			offset += PE_COFF_HDR_LEN + opt_hdr_sz;
  ------------------
  |  |   77|     20|#define PE_COFF_HDR_LEN				0x18
  ------------------
  713|     20|		} else {
  714|      8|			break;
  715|      8|		}
  716|       |
  717|     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 (717:7): [True: 0, False: 20]
  ------------------
  718|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  719|      0|		}
  720|       |
  721|       |		/*
  722|       |		 * Traverse sec table to find max raw offset (i.e., overlay)
  723|       |		 */
  724|     20|		if (bytes < offset + sec_cnt * PE_SEC_HDR_LEN) {
  ------------------
  |  |   80|     20|#define PE_SEC_HDR_LEN 				0x28
  ------------------
  |  Branch (724:7): [True: 3, False: 17]
  ------------------
  725|      3|			h = __archive_read_ahead(a,
  726|      3|			    offset + sec_cnt * PE_SEC_HDR_LEN, NULL);
  ------------------
  |  |   80|      3|#define PE_SEC_HDR_LEN 				0x28
  ------------------
  727|      3|			if (h == NULL) {
  ------------------
  |  Branch (727:8): [True: 3, False: 0]
  ------------------
  728|      3|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  729|      3|			}
  730|      3|		}
  731|     17|		max_offset = offset;
  732|  17.0k|		while (sec_cnt > 0) {
  ------------------
  |  Branch (732:10): [True: 16.9k, False: 17]
  ------------------
  733|  16.9k|			int64_t sec_end;
  734|       |
  735|  16.9k|			sec_end = (int64_t)archive_le32dec(
  736|  16.9k|				      h + offset + PE_SEC_HDR_RAW_SZ_OFFSET) +
  ------------------
  |  |   82|  16.9k|#define PE_SEC_HDR_RAW_SZ_OFFSET	0x10
  ------------------
  737|  16.9k|			    archive_le32dec(
  738|  16.9k|				h + offset + PE_SEC_HDR_RAW_ADDR_OFFSET);
  ------------------
  |  |   81|  16.9k|#define PE_SEC_HDR_RAW_ADDR_OFFSET	0x14
  ------------------
  739|  16.9k|			if (sec_end > max_offset) {
  ------------------
  |  Branch (739:8): [True: 8.36k, False: 8.62k]
  ------------------
  740|  8.36k|				max_offset = sec_end;
  741|  8.36k|			}
  742|  16.9k|			offset += PE_SEC_HDR_LEN;
  ------------------
  |  |   80|  16.9k|#define PE_SEC_HDR_LEN 				0x28
  ------------------
  743|  16.9k|			sec_cnt--;
  744|  16.9k|		}
  745|     17|		*sfx_offset = max_offset;
  746|     17|		break;
  747|     20|	}
  748|       |
  749|     25|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     25|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  750|     74|}
archive_read_support_format_7zip.c:get_elf_sfx_offset:
  754|     23|{
  755|     23|	int64_t r;
  756|     23|	const char *h;
  757|     23|	char big_endian, format_64;
  758|     23|	ssize_t bytes;
  759|     23|	size_t request;
  760|     23|	uint64_t e_shoff, strtab_offset, strtab_size;
  761|     23|	uint16_t e_shentsize, e_shnum, e_shstrndx;
  762|     23|	uint16_t (*dec16)(const void *);
  763|     23|	uint32_t (*dec32)(const void *);
  764|     23|	uint64_t (*dec64)(const void *);
  765|       |
  766|       |	/*
  767|       |	 * If encounter any weirdness, revert to old brute-force style search
  768|       |	 */
  769|     23|	*sfx_offset = SFX_MIN_ADDR;
  ------------------
  |  |   67|     23|#define SFX_MIN_ADDR	0x27000
  ------------------
  770|       |
  771|     23|	for (;;) {
  772|       |		/*
  773|       |		 * Read Elf header to find bitness & endianness
  774|       |		 */
  775|     23|		h = __archive_read_ahead(a, ELF_HDR_MIN_LEN, &bytes);
  ------------------
  |  |   87|     23|#define ELF_HDR_MIN_LEN 0x40 /* sizeof(Elf64_Ehdr) */
  ------------------
  776|     23|		if (h == NULL) {
  ------------------
  |  Branch (776:7): [True: 0, False: 23]
  ------------------
  777|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  778|      0|		}
  779|     23|		if (memcmp(h, "\x7F\x45LF", 4) != 0) {
  ------------------
  |  Branch (779:7): [True: 0, False: 23]
  ------------------
  780|      0|			break;
  781|      0|		}
  782|     23|		format_64 = h[ELF_HDR_EI_CLASS_OFFSET] == 0x2;
  ------------------
  |  |   88|     23|#define ELF_HDR_EI_CLASS_OFFSET 0x04
  ------------------
  783|     23|		big_endian = h[ELF_HDR_EI_DATA_OFFSET] == 0x2;
  ------------------
  |  |   89|     23|#define ELF_HDR_EI_DATA_OFFSET 0x05
  ------------------
  784|     23|		if (big_endian) {
  ------------------
  |  Branch (784:7): [True: 3, False: 20]
  ------------------
  785|      3|			dec16 = &archive_be16dec;
  786|      3|			dec32 = &archive_be32dec;
  787|      3|			dec64 = &archive_be64dec;
  788|     20|		} else {
  789|     20|			dec16 = &archive_le16dec;
  790|     20|			dec32 = &archive_le32dec;
  791|     20|			dec64 = &archive_le64dec;
  792|     20|		}
  793|       |
  794|       |		/*
  795|       |		 * Read section header table info
  796|       |		 */
  797|     23|		if (format_64) {
  ------------------
  |  Branch (797:7): [True: 4, False: 19]
  ------------------
  798|      4|			e_shoff = (*dec64)(h + 0x28);
  799|      4|			e_shentsize = (*dec16)(h + 0x3A);
  800|      4|			e_shnum = (*dec16)(h + 0x3C);
  801|      4|			e_shstrndx = (*dec16)(h + 0x3E);
  802|      4|			if (e_shnum < e_shstrndx || e_shentsize < 0x28)
  ------------------
  |  Branch (802:8): [True: 2, False: 2]
  |  Branch (802:32): [True: 0, False: 2]
  ------------------
  803|      2|				break;
  804|       |
  805|     19|		} else {
  806|     19|			e_shoff = (*dec32)(h + 0x20);
  807|     19|			e_shentsize = (*dec16)(h + 0x2E);
  808|     19|			e_shnum = (*dec16)(h + 0x30);
  809|     19|			e_shstrndx = (*dec16)(h + 0x32);
  810|     19|			if (e_shnum < e_shstrndx || e_shentsize < 0x18)
  ------------------
  |  Branch (810:8): [True: 9, False: 10]
  |  Branch (810:32): [True: 0, False: 10]
  ------------------
  811|      9|				break;
  812|     19|		}
  813|       |
  814|     12|		if ((int64_t)e_shoff < 0) {
  ------------------
  |  Branch (814:7): [True: 1, False: 11]
  ------------------
  815|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  816|      1|		}
  817|       |
  818|       |		/*
  819|       |		 * Reading the section table to find strtab section
  820|       |		 */
  821|     11|		if (seek_compat(a, e_shoff, SEEK_SET, compat) < 0) {
  ------------------
  |  Branch (821:7): [True: 2, False: 9]
  ------------------
  822|      2|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  823|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  824|      2|		}
  825|      9|		if (format_64) {
  ------------------
  |  Branch (825:7): [True: 1, False: 8]
  ------------------
  826|      1|			request = (size_t)e_shnum * e_shentsize + 0x28;
  827|      8|		} else {
  828|      8|			request = (size_t)e_shnum * e_shentsize + 0x18;
  829|      8|		}
  830|      9|		if (request > SFX_MAX_SEEK) {
  ------------------
  |  |   70|      9|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (830:7): [True: 1, False: 8]
  ------------------
  831|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  832|      1|		}
  833|      8|		h = __archive_read_ahead(a, request, &bytes);
  834|      8|		if (h == NULL) {
  ------------------
  |  Branch (834:7): [True: 0, False: 8]
  ------------------
  835|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  836|      0|		}
  837|      8|		if (format_64) {
  ------------------
  |  Branch (837:7): [True: 1, False: 7]
  ------------------
  838|      1|			strtab_offset = (*dec64)(
  839|      1|			    h + e_shstrndx * e_shentsize + 0x18);
  840|      1|			strtab_size = (*dec64)(
  841|      1|			    h + e_shstrndx * e_shentsize + 0x20);
  842|      7|		} else {
  843|      7|			strtab_offset = (*dec32)(
  844|      7|			    h + e_shstrndx * e_shentsize + 0x10);
  845|      7|			strtab_size = (*dec32)(
  846|      7|			    h + e_shstrndx * e_shentsize + 0x14);
  847|      7|		}
  848|      8|		if ((int64_t)strtab_offset < 0 || strtab_size < 6 ||
  ------------------
  |  Branch (848:7): [True: 0, False: 8]
  |  Branch (848:37): [True: 1, False: 7]
  ------------------
  849|      7|		    strtab_size > SFX_MAX_SEEK)
  ------------------
  |  |   70|      7|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (849:7): [True: 1, False: 6]
  ------------------
  850|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  851|       |
  852|       |		/*
  853|       |		 * Read the STRTAB section to find the .data offset
  854|       |		 */
  855|      6|		if (seek_compat(a, strtab_offset, SEEK_SET, compat) < 0) {
  ------------------
  |  Branch (855:7): [True: 0, False: 6]
  ------------------
  856|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  857|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  858|      0|		}
  859|      6|		h = __archive_read_ahead(a, strtab_size, NULL);
  860|      6|		if (h == NULL) {
  ------------------
  |  Branch (860:7): [True: 0, False: 6]
  ------------------
  861|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  862|      0|		}
  863|      6|		size_t data_sym_offset = strtab_size;
  864|  5.51k|		for (size_t offset = 0; offset < strtab_size - 6; offset++) {
  ------------------
  |  Branch (864:27): [True: 5.51k, False: 2]
  ------------------
  865|  5.51k|			if (memcmp(h + offset, ".data\00", 6) == 0) {
  ------------------
  |  Branch (865:8): [True: 4, False: 5.50k]
  ------------------
  866|      4|				data_sym_offset = offset;
  867|      4|				break;
  868|      4|			}
  869|  5.51k|		}
  870|      6|		if (data_sym_offset == strtab_size) {
  ------------------
  |  Branch (870:7): [True: 2, False: 4]
  ------------------
  871|      2|			break;
  872|      2|		}
  873|       |
  874|       |		/*
  875|       |		 * Find the section with the .data name
  876|       |		 */
  877|      4|		if (seek_compat(a, e_shoff, SEEK_SET, compat) < 0) {
  ------------------
  |  Branch (877:7): [True: 0, False: 4]
  ------------------
  878|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  879|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  880|      0|		}
  881|      4|		h = __archive_read_ahead(a, (size_t)e_shnum * e_shentsize, NULL);
  882|      4|		if (h == NULL) {
  ------------------
  |  Branch (882:7): [True: 0, False: 4]
  ------------------
  883|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  884|      0|		}
  885|      4|		size_t sec_tbl_offset = 0;
  886|    216|		while (e_shnum > 0) {
  ------------------
  |  Branch (886:10): [True: 213, False: 3]
  ------------------
  887|    213|			uint32_t name_offset;
  888|       |
  889|    213|			name_offset = (*dec32)(h + sec_tbl_offset);
  890|    213|			if (name_offset == data_sym_offset) {
  ------------------
  |  Branch (890:8): [True: 1, False: 212]
  ------------------
  891|      1|				int64_t sel_offset;
  892|       |
  893|      1|				if (format_64) {
  ------------------
  |  Branch (893:9): [True: 0, False: 1]
  ------------------
  894|      0|					sel_offset = (*dec64)(
  895|      0|					    h + sec_tbl_offset + 0x18);
  896|      1|				} else {
  897|      1|					sel_offset = (*dec32)(
  898|      1|					    h + sec_tbl_offset + 0x10);
  899|      1|				}
  900|      1|				if (sel_offset >= 0)
  ------------------
  |  Branch (900:9): [True: 1, False: 0]
  ------------------
  901|      1|					*sfx_offset = sel_offset;
  902|      1|				break;
  903|      1|			}
  904|    212|			sec_tbl_offset += e_shentsize;
  905|    212|			e_shnum--;
  906|    212|		}
  907|      4|		break;
  908|      4|	}
  909|       |
  910|     17|	r = seek_compat(a, 0, SEEK_SET, compat);
  911|     17|	if (r < 0)
  ------------------
  |  Branch (911:6): [True: 0, False: 17]
  ------------------
  912|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  913|     17|	return (int)r;
  914|     23|}
archive_read_support_format_7zip.c:seek_compat:
 4580|    112|{
 4581|    112|	int64_t ret = ARCHIVE_FAILED;
  ------------------
  |  |  237|    112|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 4582|       |
 4583|    112|	if (a->filter->can_seek)
  ------------------
  |  Branch (4583:6): [True: 112, False: 0]
  ------------------
 4584|    112|		ret = __archive_read_seek(a, offset, whence);
 4585|      0|	else if (compat) {
  ------------------
  |  Branch (4585:11): [True: 0, False: 0]
  ------------------
 4586|      0|		switch (whence) {
 4587|      0|		case SEEK_CUR:
  ------------------
  |  Branch (4587:3): [True: 0, False: 0]
  ------------------
 4588|      0|			ret = __archive_read_consume(a, offset);
 4589|      0|			break;
 4590|      0|		case SEEK_SET:
  ------------------
  |  Branch (4590:3): [True: 0, False: 0]
  ------------------
 4591|      0|			if (a->filter->position > offset)
  ------------------
  |  Branch (4591:8): [True: 0, False: 0]
  ------------------
 4592|      0|				break;
 4593|      0|			ret = __archive_read_consume(a,
 4594|      0|			    offset - a->filter->position);
 4595|      0|			break;
 4596|      0|		default:
  ------------------
  |  Branch (4596:3): [True: 0, False: 0]
  ------------------
 4597|      0|			break;
 4598|      0|		}
 4599|      0|	}
 4600|       |
 4601|    112|	return (ret);
 4602|    112|}
archive_read_support_format_7zip.c:check_7zip_header_in_sfx:
  638|   194k|{
  639|   194k|	switch (p[5]) {
  640|    110|	case 0x1C:
  ------------------
  |  Branch (640:2): [True: 110, False: 194k]
  ------------------
  641|    110|		if (memcmp(p, _7ZIP_SIGNATURE, 6) != 0)
  ------------------
  |  |   66|    110|#define _7ZIP_SIGNATURE	"7z\xBC\xAF\x27\x1C"
  ------------------
  |  Branch (641:7): [True: 72, False: 38]
  ------------------
  642|     72|			return (6);
  643|       |		/*
  644|       |		 * Test the CRC because its extraction code has 7-Zip
  645|       |		 * Magic Code, so we should do this in order not to
  646|       |		 * make a mis-detection.
  647|       |		 */
  648|     38|		if (crc32(0, p + 12, 20) != archive_le32dec(p + 8))
  ------------------
  |  Branch (648:7): [True: 30, False: 8]
  ------------------
  649|     30|			return (6);
  650|       |		/* Hit the header! */
  651|      8|		return (0);
  652|     25|	case 0x37: return (5);
  ------------------
  |  Branch (652:2): [True: 25, False: 194k]
  ------------------
  653|      5|	case 0x7A: return (4);
  ------------------
  |  Branch (653:2): [True: 5, False: 194k]
  ------------------
  654|     20|	case 0xBC: return (3);
  ------------------
  |  Branch (654:2): [True: 20, False: 194k]
  ------------------
  655|    151|	case 0xAF: return (2);
  ------------------
  |  Branch (655:2): [True: 151, False: 194k]
  ------------------
  656|     12|	case 0x27: return (1);
  ------------------
  |  Branch (656:2): [True: 12, False: 194k]
  ------------------
  657|   194k|	default: return (6);
  ------------------
  |  Branch (657:2): [True: 194k, False: 323]
  ------------------
  658|   194k|	}
  659|   194k|}
archive_read_support_format_7zip.c:archive_read_format_7zip_read_header:
  919|  1.10k|{
  920|  1.10k|	struct _7zip *zip = (struct _7zip *)a->format->data;
  921|  1.10k|	struct _7zip_entry *zip_entry;
  922|  1.10k|	int r, ret = ARCHIVE_OK;
  ------------------
  |  |  233|  1.10k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  923|  1.10k|	struct _7z_folder *folder = 0;
  924|  1.10k|	uint64_t fidx = 0;
  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.10k|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|  1.10k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (933:6): [True: 107, False: 994]
  ------------------
  934|    107|		zip->has_encrypted_entries = 0;
  935|    107|	}
  936|       |
  937|  1.10k|	a->archive.archive_format = ARCHIVE_FORMAT_7ZIP;
  ------------------
  |  |  385|  1.10k|#define	ARCHIVE_FORMAT_7ZIP			0xE0000
  ------------------
  938|  1.10k|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (938:6): [True: 107, False: 994]
  ------------------
  939|    107|		a->archive.archive_format_name = "7-Zip";
  940|       |
  941|  1.10k|	if (zip->entries == NULL) {
  ------------------
  |  Branch (941:6): [True: 107, False: 994]
  ------------------
  942|    107|		struct _7z_header_info header;
  943|       |
  944|    107|		memset(&header, 0, sizeof(header));
  945|    107|		r = slurp_central_directory(a, zip, &header);
  946|    107|		free_Header(&header);
  947|    107|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    107|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (947:7): [True: 89, False: 18]
  ------------------
  948|     89|			return (r);
  949|     18|		zip->entries_remaining = (size_t)zip->numFiles;
  950|     18|		zip->entry = zip->entries;
  951|    994|	} else {
  952|    994|		++zip->entry;
  953|    994|	}
  954|  1.01k|	zip_entry = zip->entry;
  955|       |
  956|  1.01k|	if (zip->entries_remaining <= 0 || zip_entry == NULL)
  ------------------
  |  Branch (956:6): [True: 14, False: 998]
  |  Branch (956:37): [True: 0, False: 998]
  ------------------
  957|     14|		return ARCHIVE_EOF;
  ------------------
  |  |  232|     14|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  958|    998|	--zip->entries_remaining;
  959|       |
  960|    998|	zip->entry_offset = 0;
  961|    998|	zip->end_of_entry = 0;
  962|    998|	zip->entry_crc32 = crc32(0, NULL, 0);
  963|       |
  964|       |	/* Setup a string conversion for a filename. */
  965|    998|	if (zip->sconv == NULL) {
  ------------------
  |  Branch (965:6): [True: 18, False: 980]
  ------------------
  966|     18|		zip->sconv = archive_string_conversion_from_charset(
  967|     18|		    &a->archive, "UTF-16LE", 1);
  968|     18|		if (zip->sconv == NULL)
  ------------------
  |  Branch (968:7): [True: 0, False: 18]
  ------------------
  969|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  970|     18|	}
  971|       |
  972|       |	/* Figure out if the entry is encrypted by looking at the folder
  973|       |	   that is associated to the current 7zip entry. If the folder
  974|       |	   has a coder with a _7Z_CRYPTO codec then the folder is encrypted.
  975|       |	   Hence the entry must also be encrypted. */
  976|    998|	if (zip_entry && zip_entry->folderIndex < zip->si.ci.numFolders) {
  ------------------
  |  Branch (976:6): [True: 998, False: 0]
  |  Branch (976:19): [True: 8, False: 990]
  ------------------
  977|      8|		folder = &(zip->si.ci.folders[zip_entry->folderIndex]);
  978|     16|		for (fidx=0; folder && fidx<folder->numCoders; fidx++) {
  ------------------
  |  Branch (978:16): [True: 16, False: 0]
  |  Branch (978:26): [True: 8, False: 8]
  ------------------
  979|      8|			switch(folder->coders[fidx].codec) {
  ------------------
  |  Branch (979:11): [True: 0, False: 8]
  ------------------
  980|      0|				case _7Z_CRYPTO_MAIN_ZIP:
  ------------------
  |  |  101|      0|#define _7Z_CRYPTO_MAIN_ZIP			0x06F10101 /* Main Zip crypto algo */
  ------------------
  |  Branch (980:5): [True: 0, False: 8]
  ------------------
  981|      0|				case _7Z_CRYPTO_RAR_29:
  ------------------
  |  |  102|      0|#define _7Z_CRYPTO_RAR_29			0x06F10303 /* Rar29 AES-128 + (modified SHA-1) */
  ------------------
  |  Branch (981:5): [True: 0, False: 8]
  ------------------
  982|      0|				case _7Z_CRYPTO_AES_256_SHA_256: {
  ------------------
  |  |  103|      0|#define _7Z_CRYPTO_AES_256_SHA_256	0x06F10701 /* AES-256 + SHA-256 */
  ------------------
  |  Branch (982:5): [True: 0, False: 8]
  ------------------
  983|      0|					archive_entry_set_is_data_encrypted(entry, 1);
  984|      0|					zip->has_encrypted_entries = 1;
  985|      0|					break;
  986|      0|				}
  987|      8|			}
  988|      8|		}
  989|      8|	}
  990|       |
  991|       |	/* Now that we've checked for encryption, if there were still no
  992|       |	 * encrypted entries found we can say for sure that there are none.
  993|       |	 */
  994|    998|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|    998|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (994:6): [True: 0, False: 998]
  ------------------
  995|      0|		zip->has_encrypted_entries = 0;
  996|      0|	}
  997|       |
  998|    998|	if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|    998|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (998:6): [True: 441, False: 557]
  ------------------
  999|    998|	    (const char *)zip_entry->utf16name,
 1000|    998|	    zip_entry->name_len, zip->sconv) != 0) {
 1001|    441|		if (errno == ENOMEM) {
  ------------------
  |  Branch (1001:7): [True: 0, False: 441]
  ------------------
 1002|      0|			archive_set_error(&a->archive, ENOMEM,
 1003|      0|			    "Can't allocate memory for Pathname");
 1004|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1005|      0|		}
 1006|    441|		archive_set_error(&a->archive,
 1007|    441|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    441|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1008|    441|		    "Pathname cannot be converted "
 1009|    441|		    "from %s to current locale",
 1010|    441|		    archive_string_conversion_charset_name(zip->sconv));
 1011|    441|		ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    441|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1012|    441|	}
 1013|       |
 1014|       |	/* Populate some additional entry fields: */
 1015|    998|	archive_entry_set_mode(entry, zip_entry->mode);
 1016|    998|	if (zip_entry->flg & MTIME_IS_SET)
  ------------------
  |  |  248|    998|#define MTIME_IS_SET	(1<<0)
  ------------------
  |  Branch (1016:6): [True: 0, False: 998]
  ------------------
 1017|      0|		archive_entry_set_mtime(entry, zip_entry->mtime,
 1018|      0|			zip_entry->mtime_ns);
 1019|    998|	if (zip_entry->flg & CTIME_IS_SET)
  ------------------
  |  |  250|    998|#define CTIME_IS_SET	(1<<2)
  ------------------
  |  Branch (1019:6): [True: 0, False: 998]
  ------------------
 1020|      0|		archive_entry_set_ctime(entry, zip_entry->ctime,
 1021|      0|		    zip_entry->ctime_ns);
 1022|    998|	if (zip_entry->flg & ATIME_IS_SET)
  ------------------
  |  |  249|    998|#define ATIME_IS_SET	(1<<1)
  ------------------
  |  Branch (1022:6): [True: 0, False: 998]
  ------------------
 1023|      0|		archive_entry_set_atime(entry, zip_entry->atime,
 1024|      0|		    zip_entry->atime_ns);
 1025|    998|	if (zip_entry->ssIndex != (uint32_t)-1) {
  ------------------
  |  Branch (1025:6): [True: 8, False: 990]
  ------------------
 1026|      8|		zip->entry_bytes_remaining =
 1027|      8|		    zip->si.ss.unpackSizes[zip_entry->ssIndex];
 1028|      8|		archive_entry_set_size(entry, zip->entry_bytes_remaining);
 1029|    990|	} else {
 1030|    990|		zip->entry_bytes_remaining = 0;
 1031|    990|		archive_entry_set_size(entry, 0);
 1032|    990|	}
 1033|       |
 1034|       |	// These attributes are supported by the windows implementation of archive_write_disk.
 1035|    998|	const int supported_attrs = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
  ------------------
  |  |  149|    998|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
              	const int supported_attrs = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
  ------------------
  |  |  153|    998|#define FILE_ATTRIBUTE_HIDDEN 0x00000002
  ------------------
              	const int supported_attrs = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
  ------------------
  |  |  157|    998|#define FILE_ATTRIBUTE_SYSTEM 0x00000004
  ------------------
 1036|       |
 1037|    998|	if (zip_entry->attr & supported_attrs) {
  ------------------
  |  Branch (1037:6): [True: 0, False: 998]
  ------------------
 1038|      0|		char buf[sizeof(",rdonly,hidden,system")];
 1039|      0|		char *fflags[3] = { "", "", "" };
 1040|      0|		char **flag = fflags;
 1041|       |
 1042|      0|		if (zip_entry->attr & FILE_ATTRIBUTE_READONLY)
  ------------------
  |  |  149|      0|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (1042:7): [True: 0, False: 0]
  ------------------
 1043|      0|			*flag++ = ",rdonly";
 1044|      0|		if (zip_entry->attr & FILE_ATTRIBUTE_HIDDEN)
  ------------------
  |  |  153|      0|#define FILE_ATTRIBUTE_HIDDEN 0x00000002
  ------------------
  |  Branch (1044:7): [True: 0, False: 0]
  ------------------
 1045|      0|			*flag++ = ",hidden";
 1046|      0|		if (zip_entry->attr & FILE_ATTRIBUTE_SYSTEM)
  ------------------
  |  |  157|      0|#define FILE_ATTRIBUTE_SYSTEM 0x00000004
  ------------------
  |  Branch (1046:7): [True: 0, False: 0]
  ------------------
 1047|      0|			*flag++ = ",system";
 1048|       |
 1049|      0|		snprintf(buf, sizeof(buf), "%s%s%s", fflags[0], fflags[1], fflags[2]);
 1050|      0|		archive_entry_copy_fflags_text(entry, buf + 1);
 1051|      0|	}
 1052|       |
 1053|       |	/* If there's no body, force read_data() to return EOF immediately. */
 1054|    998|	if (zip->entry_bytes_remaining < 1)
  ------------------
  |  Branch (1054:6): [True: 990, False: 8]
  ------------------
 1055|    990|		zip->end_of_entry = 1;
 1056|       |
 1057|    998|	if ((zip_entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  215|    998|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip_entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  217|    998|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (1057:6): [True: 0, False: 998]
  ------------------
 1058|      0|		unsigned char *symname = NULL;
 1059|      0|		size_t symsize = 0;
 1060|       |
 1061|      0|		if (zip->entry_bytes_remaining > 1024 * 1024) {
  ------------------
  |  Branch (1061:7): [True: 0, False: 0]
  ------------------
 1062|      0|			archive_set_error(&a->archive, ENOMEM,
 1063|      0|			    "Rejecting malformed 7zip archive: "
 1064|      0|			    "symlink contents exceed 1 megabyte");
 1065|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1066|      0|		}
 1067|       |
 1068|       |		/*
 1069|       |		 * Symbolic-name is recorded as its contents. We have to
 1070|       |		 * read the contents at this time.
 1071|       |		 */
 1072|      0|		while (zip->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (1072:10): [True: 0, False: 0]
  ------------------
 1073|      0|			const void *buff;
 1074|      0|			unsigned char *mem;
 1075|      0|			size_t size;
 1076|      0|			int64_t offset;
 1077|       |
 1078|      0|			r = archive_read_format_7zip_read_data(a, &buff,
 1079|      0|				&size, &offset);
 1080|      0|			if (r < ARCHIVE_WARN) {
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1080:8): [True: 0, False: 0]
  ------------------
 1081|      0|				free(symname);
 1082|      0|				return (r);
 1083|      0|			}
 1084|      0|			mem = realloc(symname, symsize + size + 1);
 1085|      0|			if (mem == NULL) {
  ------------------
  |  Branch (1085:8): [True: 0, False: 0]
  ------------------
 1086|      0|				free(symname);
 1087|      0|				archive_set_error(&a->archive, ENOMEM,
 1088|      0|				    "Can't allocate memory for Symname");
 1089|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1090|      0|			}
 1091|      0|			symname = mem;
 1092|      0|			memcpy(symname+symsize, buff, size);
 1093|      0|			symsize += size;
 1094|      0|		}
 1095|      0|		if (symsize == 0) {
  ------------------
  |  Branch (1095:7): [True: 0, False: 0]
  ------------------
 1096|       |			/* If there is no symname, handle it as a regular
 1097|       |			 * file. */
 1098|      0|			zip_entry->mode &= ~AE_IFMT;
  ------------------
  |  |  215|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1099|      0|			zip_entry->mode |= AE_IFREG;
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1100|      0|			archive_entry_set_mode(entry, zip_entry->mode);
 1101|      0|		} else {
 1102|      0|			struct archive_string_conv* utf8_conv;
 1103|       |
 1104|      0|			symname[symsize] = '\0';
 1105|       |
 1106|       |			/* Symbolic links are embedded as UTF-8 strings */
 1107|      0|			utf8_conv = archive_string_conversion_from_charset(&a->archive,
 1108|      0|			    "UTF-8", 1);
 1109|      0|			if (utf8_conv == NULL) {
  ------------------
  |  Branch (1109:8): [True: 0, False: 0]
  ------------------
 1110|      0|				free(symname);
 1111|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1112|      0|			}
 1113|       |
 1114|      0|			archive_entry_copy_symlink_l(entry, (const char*)symname, symsize,
  ------------------
  |  |   83|      0|#define archive_entry_copy_symlink_l	_archive_entry_copy_symlink_l
  ------------------
 1115|      0|			    utf8_conv);
 1116|      0|		}
 1117|      0|		free(symname);
 1118|      0|		archive_entry_set_size(entry, 0);
 1119|      0|	}
 1120|       |
 1121|       |	/* Set up a more descriptive format name. */
 1122|    998|	snprintf(zip->format_name, sizeof(zip->format_name), "7-Zip");
 1123|    998|	a->archive.archive_format_name = zip->format_name;
 1124|       |
 1125|    998|	return (ret);
 1126|    998|}
archive_read_support_format_7zip.c:slurp_central_directory:
 3262|    107|{
 3263|    107|	const unsigned char *p;
 3264|    107|	uint64_t next_header_offset;
 3265|    107|	uint64_t next_header_size;
 3266|    107|	uint32_t next_header_crc;
 3267|    107|	ssize_t bytes_avail;
 3268|    107|	int64_t data_offset;
 3269|    107|	int check_header_crc, r;
 3270|       |
 3271|    107|	if (get_data_offset(a, &data_offset, 1) < 0)
  ------------------
  |  Branch (3271:6): [True: 0, False: 107]
  ------------------
 3272|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3273|    107|	if (__archive_read_consume(a, data_offset) < 0) {
  ------------------
  |  Branch (3273:6): [True: 0, False: 107]
  ------------------
 3274|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3275|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3276|      0|	}
 3277|    107|	if ((p = __archive_read_ahead(a, 32, &bytes_avail)) == NULL) {
  ------------------
  |  Branch (3277:6): [True: 0, False: 107]
  ------------------
 3278|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3279|      0|		    "Truncated 7-Zip file header");
 3280|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3281|      0|	}
 3282|       |
 3283|    107|	zip->seek_base = (uint64_t)data_offset + 32;
 3284|       |
 3285|    107|	if (memcmp(p, _7ZIP_SIGNATURE, 6) != 0) {
  ------------------
  |  |   66|    107|#define _7ZIP_SIGNATURE	"7z\xBC\xAF\x27\x1C"
  ------------------
  |  Branch (3285:6): [True: 0, False: 107]
  ------------------
 3286|      0|		archive_set_error(&a->archive, -1, "Not 7-Zip archive file");
 3287|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3288|      0|	}
 3289|       |
 3290|       |	/* CRC check. */
 3291|    107|	if (crc32(0, p + 12, 20)
  ------------------
  |  Branch (3291:6): [True: 103, False: 4]
  ------------------
 3292|    107|	    != archive_le32dec(p + 8)) {
 3293|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 3294|       |		archive_set_error(&a->archive, -1, "Header CRC error");
 3295|       |		return (ARCHIVE_FATAL);
 3296|       |#endif
 3297|    103|	}
 3298|       |
 3299|    107|	next_header_offset = archive_le64dec(p + 12);
 3300|    107|	next_header_size = archive_le64dec(p + 20);
 3301|    107|	next_header_crc = archive_le32dec(p + 28);
 3302|       |
 3303|    107|	if (next_header_size == 0)
  ------------------
  |  Branch (3303:6): [True: 0, False: 107]
  ------------------
 3304|       |		/* There is no entry in an archive file. */
 3305|      0|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3306|       |
 3307|    107|	if (((int64_t)next_header_offset) < 0) {
  ------------------
  |  Branch (3307:6): [True: 0, False: 107]
  ------------------
 3308|      0|		archive_set_error(&a->archive, -1, "Malformed 7-Zip archive");
 3309|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3310|      0|	}
 3311|    107|	__archive_read_consume(a, 32);
 3312|    107|	if (next_header_offset != 0) {
  ------------------
  |  Branch (3312:6): [True: 105, False: 2]
  ------------------
 3313|    105|		if (bytes_avail >= (ssize_t)next_header_offset)
  ------------------
  |  Branch (3313:7): [True: 103, False: 2]
  ------------------
 3314|    103|			__archive_read_consume(a, next_header_offset);
 3315|      2|		else if (seek_compat(a,
  ------------------
  |  Branch (3315:12): [True: 2, False: 0]
  ------------------
 3316|      2|		    next_header_offset + zip->seek_base, SEEK_SET, 1) < 0) {
 3317|      2|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3318|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3319|      2|		}
 3320|    105|	}
 3321|    105|	zip->stream_offset = next_header_offset;
 3322|    105|	zip->header_offset = next_header_offset;
 3323|    105|	zip->header_bytes_remaining = next_header_size;
 3324|    105|	zip->header_crc32 = 0;
 3325|    105|	zip->header_is_encoded = 0;
 3326|    105|	zip->header_is_being_read = 1;
 3327|    105|	zip->has_encrypted_entries = 0;
 3328|    105|	check_header_crc = 1;
 3329|       |
 3330|    105|	if ((p = header_bytes(a, 1)) == NULL) {
  ------------------
  |  Branch (3330:6): [True: 0, False: 105]
  ------------------
 3331|      0|		archive_set_error(&a->archive,
 3332|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3333|      0|		    "Truncated 7-Zip file body");
 3334|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3335|      0|	}
 3336|       |	/* Parse ArchiveProperties. */
 3337|    105|	switch (p[0]) {
 3338|     65|	case kEncodedHeader:
  ------------------
  |  |  143|     65|#define kEncodedHeader		0x17
  ------------------
  |  Branch (3338:2): [True: 65, False: 40]
  ------------------
 3339|       |		/*
 3340|       |		 * The archive has an encoded header and we have to decode it
 3341|       |		 * in order to parse the header correctly.
 3342|       |		 */
 3343|     65|		r = decode_encoded_header_info(a, &(zip->si));
 3344|       |
 3345|       |		/* Check the EncodedHeader CRC.*/
 3346|     65|		if (r == 0 && zip->header_crc32 != next_header_crc) {
  ------------------
  |  Branch (3346:7): [True: 64, False: 1]
  |  Branch (3346:17): [True: 64, False: 0]
  ------------------
 3347|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 3348|       |			archive_set_error(&a->archive, -1,
 3349|       |			    "Damaged 7-Zip archive");
 3350|       |			r = -1;
 3351|       |#endif
 3352|     64|		}
 3353|     65|		if (r == 0) {
  ------------------
  |  Branch (3353:7): [True: 64, False: 1]
  ------------------
 3354|     64|			if (zip->si.ci.folders[0].digest_defined)
  ------------------
  |  Branch (3354:8): [True: 17, False: 47]
  ------------------
 3355|     17|				next_header_crc = zip->si.ci.folders[0].digest;
 3356|     47|			else
 3357|     47|				check_header_crc = 0;
 3358|     64|			if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (3358:8): [True: 64, False: 0]
  ------------------
 3359|     64|				read_consume(a);
 3360|     64|			r = setup_decode_folder(a, zip->si.ci.folders, 1);
 3361|     64|			if (r == 0) {
  ------------------
  |  Branch (3361:8): [True: 64, False: 0]
  ------------------
 3362|     64|				zip->header_bytes_remaining =
 3363|     64|					zip->folder_outbytes_remaining;
 3364|     64|				r = seek_pack(a);
 3365|     64|			}
 3366|     64|		}
 3367|       |		/* Clean up StreamsInfo. */
 3368|     65|		free_StreamsInfo(&(zip->si));
 3369|     65|		memset(&(zip->si), 0, sizeof(zip->si));
 3370|     65|		if (r < 0)
  ------------------
  |  Branch (3370:7): [True: 1, False: 64]
  ------------------
 3371|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3372|     64|		zip->header_is_encoded = 1;
 3373|     64|		zip->header_crc32 = 0;
 3374|       |		/* FALL THROUGH */
 3375|    100|	case kHeader:
  ------------------
  |  |  122|    100|#define kHeader			0x01
  ------------------
  |  Branch (3375:2): [True: 36, False: 69]
  ------------------
 3376|       |		/*
 3377|       |		 * Parse the header.
 3378|       |		 */
 3379|    100|		errno = 0;
 3380|    100|		r = read_Header(a, header, zip->header_is_encoded);
 3381|    100|		if (r < 0) {
  ------------------
  |  Branch (3381:7): [True: 82, False: 18]
  ------------------
 3382|     82|			if (errno == ENOMEM)
  ------------------
  |  Branch (3382:8): [True: 0, False: 82]
  ------------------
 3383|      0|				archive_set_error(&a->archive, -1,
 3384|      0|				    "Couldn't allocate memory");
 3385|     82|			else
 3386|     82|				archive_set_error(&a->archive, -1,
 3387|     82|				    "Damaged 7-Zip archive");
 3388|     82|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     82|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3389|     82|		}
 3390|       |
 3391|       |		/*
 3392|       |		 *  Must be kEnd.
 3393|       |		 */
 3394|     18|		if ((p = header_bytes(a, 1)) == NULL ||*p != kEnd) {
  ------------------
  |  |  121|     18|#define kEnd			0x00
  ------------------
  |  Branch (3394:7): [True: 0, False: 18]
  |  Branch (3394:42): [True: 0, False: 18]
  ------------------
 3395|      0|			archive_set_error(&a->archive, -1,
 3396|      0|			    "Malformed 7-Zip archive");
 3397|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3398|      0|		}
 3399|       |
 3400|       |		/* Check the Header CRC.*/
 3401|     18|		if (check_header_crc && zip->header_crc32 != next_header_crc) {
  ------------------
  |  Branch (3401:7): [True: 18, False: 0]
  |  Branch (3401:27): [True: 18, False: 0]
  ------------------
 3402|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 3403|       |			archive_set_error(&a->archive, -1,
 3404|       |			    "Malformed 7-Zip archive");
 3405|       |			return (ARCHIVE_FATAL);
 3406|       |#endif
 3407|     18|		}
 3408|     18|		break;
 3409|      4|	default:
  ------------------
  |  Branch (3409:2): [True: 4, False: 101]
  ------------------
 3410|      4|		archive_set_error(&a->archive, -1,
 3411|      4|		    "Unexpected Property ID = %X", p[0]);
 3412|      4|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3413|    105|	}
 3414|       |
 3415|       |	/* Clean up variables be used for decoding the archive header */
 3416|     18|	zip->pack_stream_remaining = 0;
 3417|     18|	zip->pack_stream_index = 0;
 3418|     18|	zip->folder_outbytes_remaining = 0;
 3419|     18|	zip->uncompressed_buffer_bytes_remaining = 0;
 3420|     18|	zip->pack_stream_bytes_unconsumed = 0;
 3421|     18|	zip->header_is_being_read = 0;
 3422|       |
 3423|     18|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     18|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3424|    105|}
archive_read_support_format_7zip.c:header_bytes:
 3228|  66.8k|{
 3229|  66.8k|	struct _7zip *zip = (struct _7zip *)a->format->data;
 3230|  66.8k|	const unsigned char *p;
 3231|       |
 3232|  66.8k|	if (zip->header_bytes_remaining < rbytes)
  ------------------
  |  Branch (3232:6): [True: 0, False: 66.8k]
  ------------------
 3233|      0|		return (NULL);
 3234|  66.8k|	if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (3234:6): [True: 66.5k, False: 242]
  ------------------
 3235|  66.5k|		read_consume(a);
 3236|       |
 3237|  66.8k|	if (zip->header_is_encoded == 0) {
  ------------------
  |  Branch (3237:6): [True: 66.7k, False: 64]
  ------------------
 3238|  66.7k|		p = __archive_read_ahead(a, rbytes, NULL);
 3239|  66.7k|		if (p == NULL)
  ------------------
  |  Branch (3239:7): [True: 7, False: 66.7k]
  ------------------
 3240|      7|			return (NULL);
 3241|  66.7k|		zip->header_bytes_remaining -= rbytes;
 3242|  66.7k|		zip->pack_stream_bytes_unconsumed = rbytes;
 3243|  66.7k|	} else {
 3244|     64|		const void *buff;
 3245|     64|		ssize_t bytes;
 3246|       |
 3247|     64|		bytes = read_stream(a, &buff, rbytes, rbytes);
 3248|     64|		if (bytes <= 0)
  ------------------
  |  Branch (3248:7): [True: 64, False: 0]
  ------------------
 3249|     64|			return (NULL);
 3250|      0|		zip->header_bytes_remaining -= bytes;
 3251|      0|		p = buff;
 3252|      0|	}
 3253|       |
 3254|       |	/* Update checksum */
 3255|  66.7k|	zip->header_crc32 = crc32(zip->header_crc32, p, (unsigned)rbytes);
 3256|  66.7k|	return (p);
 3257|  66.8k|}
archive_read_support_format_7zip.c:read_stream:
 3670|     72|{
 3671|     72|	struct _7zip *zip = (struct _7zip *)a->format->data;
 3672|     72|	uint64_t skip_bytes = 0;
 3673|     72|	ssize_t r;
 3674|       |
 3675|     72|	if (zip->uncompressed_buffer_bytes_remaining == 0) {
  ------------------
  |  Branch (3675:6): [True: 72, False: 0]
  ------------------
 3676|     72|		if (zip->pack_stream_inbytes_remaining > 0) {
  ------------------
  |  Branch (3676:7): [True: 64, False: 8]
  ------------------
 3677|     64|			r = extract_pack_stream(a, 0);
 3678|     64|			if (r < 0)
  ------------------
  |  Branch (3678:8): [True: 64, False: 0]
  ------------------
 3679|     64|				return (r);
 3680|      0|			return (get_uncompressed_data(a, buff, size, minimum));
 3681|     64|		} else if (zip->folder_outbytes_remaining > 0) {
  ------------------
  |  Branch (3681:14): [True: 0, False: 8]
  ------------------
 3682|       |			/* Extract a remaining pack stream. */
 3683|      0|			r = extract_pack_stream(a, 0);
 3684|      0|			if (r < 0)
  ------------------
  |  Branch (3684:8): [True: 0, False: 0]
  ------------------
 3685|      0|				return (r);
 3686|      0|			return (get_uncompressed_data(a, buff, size, minimum));
 3687|      0|		}
 3688|     72|	} else
 3689|      0|		return (get_uncompressed_data(a, buff, size, minimum));
 3690|       |
 3691|       |	/*
 3692|       |	 * Current pack stream has been consumed.
 3693|       |	 */
 3694|      8|	if (zip->pack_stream_remaining == 0) {
  ------------------
  |  Branch (3694:6): [True: 8, False: 0]
  ------------------
 3695|      8|		if (zip->header_is_being_read) {
  ------------------
  |  Branch (3695:7): [True: 0, False: 8]
  ------------------
 3696|       |			/* Invalid sequence. This might happen when
 3697|       |			 * reading a malformed archive. */
 3698|      0|			archive_set_error(&(a->archive),
 3699|      0|			    ARCHIVE_ERRNO_MISC, "Malformed 7-Zip archive");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3700|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3701|      0|		}
 3702|       |
 3703|       |		/*
 3704|       |		 * All current folder's pack streams have been
 3705|       |		 * consumed. Switch to next folder.
 3706|       |		 */
 3707|      8|		if (zip->folder_index == 0 &&
  ------------------
  |  Branch (3707:7): [True: 8, False: 0]
  ------------------
 3708|      8|		    (zip->si.ci.folders[zip->entry->folderIndex].skipped_bytes
  ------------------
  |  Branch (3708:8): [True: 0, False: 8]
  ------------------
 3709|      8|		     || zip->folder_index != zip->entry->folderIndex)) {
  ------------------
  |  Branch (3709:11): [True: 0, False: 8]
  ------------------
 3710|      0|			zip->folder_index = zip->entry->folderIndex;
 3711|      0|			skip_bytes =
 3712|      0|			    zip->si.ci.folders[zip->folder_index].skipped_bytes;
 3713|      0|		}
 3714|       |
 3715|      8|		if (zip->folder_index >= zip->si.ci.numFolders) {
  ------------------
  |  Branch (3715:7): [True: 0, False: 8]
  ------------------
 3716|       |			/*
 3717|       |			 * We have consumed all folders and its pack streams.
 3718|       |			 */
 3719|      0|			*buff = NULL;
 3720|      0|			return (0);
 3721|      0|		}
 3722|      8|		r = setup_decode_folder(a,
 3723|      8|			&(zip->si.ci.folders[zip->folder_index]), 0);
 3724|      8|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      8|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3724:7): [True: 0, False: 8]
  ------------------
 3725|      0|			return (r);
 3726|       |
 3727|      8|		zip->folder_index++;
 3728|      8|	}
 3729|       |
 3730|       |	/*
 3731|       |	 * Switch to next pack stream.
 3732|       |	 */
 3733|      8|	r = seek_pack(a);
 3734|      8|	if (r < 0)
  ------------------
  |  Branch (3734:6): [True: 0, False: 8]
  ------------------
 3735|      0|		return (r);
 3736|       |
 3737|       |	/* Extract a new pack stream. */
 3738|      8|	r = extract_pack_stream(a, 0);
 3739|      8|	if (r < 0)
  ------------------
  |  Branch (3739:6): [True: 0, False: 8]
  ------------------
 3740|      0|		return (r);
 3741|       |
 3742|       |	/*
 3743|       |	 * Skip the bytes we already has skipped in skip_stream().
 3744|       |	 */
 3745|      8|	while (1) {
  ------------------
  |  Branch (3745:9): [True: 8, Folded]
  ------------------
 3746|      8|		ssize_t skipped;
 3747|       |
 3748|      8|		if (zip->uncompressed_buffer_bytes_remaining == 0) {
  ------------------
  |  Branch (3748:7): [True: 4, False: 4]
  ------------------
 3749|      4|			if (zip->pack_stream_inbytes_remaining > 0) {
  ------------------
  |  Branch (3749:8): [True: 0, False: 4]
  ------------------
 3750|      0|				r = extract_pack_stream(a, 0);
 3751|      0|				if (r < 0)
  ------------------
  |  Branch (3751:9): [True: 0, False: 0]
  ------------------
 3752|      0|					return (r);
 3753|      4|			} else if (zip->folder_outbytes_remaining > 0) {
  ------------------
  |  Branch (3753:15): [True: 4, False: 0]
  ------------------
 3754|       |				/* Extract a remaining pack stream. */
 3755|      4|				r = extract_pack_stream(a, 0);
 3756|      4|				if (r < 0)
  ------------------
  |  Branch (3756:9): [True: 0, False: 4]
  ------------------
 3757|      0|					return (r);
 3758|      4|			} else {
 3759|      0|				archive_set_error(&a->archive,
 3760|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3761|      0|				    "Truncated 7-Zip file body");
 3762|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3763|      0|			}
 3764|      4|		}
 3765|       |
 3766|      8|		if (!skip_bytes)
  ------------------
  |  Branch (3766:7): [True: 8, False: 0]
  ------------------
 3767|      8|			break;
 3768|       |
 3769|      0|		skipped = get_uncompressed_data(
 3770|      0|			a, buff, (size_t)skip_bytes, 0);
 3771|      0|		if (skipped < 0)
  ------------------
  |  Branch (3771:7): [True: 0, False: 0]
  ------------------
 3772|      0|			return (skipped);
 3773|      0|		skip_bytes -= skipped;
 3774|      0|		if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (3774:7): [True: 0, False: 0]
  ------------------
 3775|      0|			read_consume(a);
 3776|      0|	}
 3777|       |
 3778|      8|	return (get_uncompressed_data(a, buff, size, minimum));
 3779|      8|}
archive_read_support_format_7zip.c:extract_pack_stream:
 3481|     76|{
 3482|     76|	struct _7zip *zip = (struct _7zip *)a->format->data;
 3483|     76|	ssize_t bytes_avail;
 3484|     76|	int r;
 3485|       |
 3486|     76|	if (zip->codec == _7Z_COPY && zip->codec2 == (unsigned long)-1) {
  ------------------
  |  |   94|    152|#define _7Z_COPY	0
  ------------------
  |  Branch (3486:6): [True: 12, False: 64]
  |  Branch (3486:32): [True: 12, False: 0]
  ------------------
 3487|     12|		if (minimum == 0)
  ------------------
  |  Branch (3487:7): [True: 12, False: 0]
  ------------------
 3488|     12|			minimum = 1;
 3489|     12|		if (__archive_read_ahead(a, minimum, &bytes_avail) == NULL
  ------------------
  |  Branch (3489:7): [True: 0, False: 12]
  ------------------
 3490|     12|		    || bytes_avail <= 0) {
  ------------------
  |  Branch (3490:10): [True: 0, False: 12]
  ------------------
 3491|      0|			archive_set_error(&a->archive,
 3492|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3493|      0|			    "Truncated 7-Zip file body");
 3494|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3495|      0|		}
 3496|     12|		if ((uint64_t)bytes_avail > zip->pack_stream_inbytes_remaining)
  ------------------
  |  Branch (3496:7): [True: 12, False: 0]
  ------------------
 3497|     12|			bytes_avail = (ssize_t)zip->pack_stream_inbytes_remaining;
 3498|     12|		zip->pack_stream_inbytes_remaining -= bytes_avail;
 3499|     12|		if ((uint64_t)bytes_avail > zip->folder_outbytes_remaining)
  ------------------
  |  Branch (3499:7): [True: 4, False: 8]
  ------------------
 3500|      4|			bytes_avail = (ssize_t)zip->folder_outbytes_remaining;
 3501|     12|		zip->folder_outbytes_remaining -= bytes_avail;
 3502|     12|		zip->uncompressed_buffer_bytes_remaining = bytes_avail;
 3503|     12|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     12|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3504|     12|	}
 3505|       |
 3506|       |	/* If the buffer hasn't been allocated, allocate it now. */
 3507|     64|	if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (3507:6): [True: 64, False: 0]
  ------------------
 3508|     64|		zip->uncompressed_buffer_size = UBUFF_SIZE;
  ------------------
  |  |  296|     64|#define UBUFF_SIZE	(64 * 1024)
  ------------------
 3509|     64|		if (zip->uncompressed_buffer_size < minimum) {
  ------------------
  |  Branch (3509:7): [True: 0, False: 64]
  ------------------
 3510|      0|			zip->uncompressed_buffer_size = minimum + 1023;
 3511|      0|			zip->uncompressed_buffer_size &= ~0x3ff;
 3512|      0|		}
 3513|     64|		zip->uncompressed_buffer =
 3514|     64|		    malloc(zip->uncompressed_buffer_size);
 3515|     64|		if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (3515:7): [True: 0, False: 64]
  ------------------
 3516|      0|			archive_set_error(&a->archive, ENOMEM,
 3517|      0|			    "No memory for 7-Zip decompression");
 3518|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3519|      0|		}
 3520|     64|		zip->uncompressed_buffer_bytes_remaining = 0;
 3521|     64|	} else if (zip->uncompressed_buffer_size < minimum ||
  ------------------
  |  Branch (3521:13): [True: 0, False: 0]
  ------------------
 3522|      0|	    zip->uncompressed_buffer_bytes_remaining < minimum) {
  ------------------
  |  Branch (3522:6): [True: 0, False: 0]
  ------------------
 3523|       |		/*
 3524|       |		 * Make sure the uncompressed buffer can have bytes
 3525|       |		 * at least `minimum' bytes.
 3526|       |		 * NOTE: This case happen when reading the header.
 3527|       |		 */
 3528|      0|		size_t used;
 3529|      0|		if (zip->uncompressed_buffer_pointer != 0)
  ------------------
  |  Branch (3529:7): [True: 0, False: 0]
  ------------------
 3530|      0|			used = zip->uncompressed_buffer_pointer -
 3531|      0|				zip->uncompressed_buffer;
 3532|      0|		else
 3533|      0|			used = 0;
 3534|      0|		if (zip->uncompressed_buffer_size < minimum) {
  ------------------
  |  Branch (3534:7): [True: 0, False: 0]
  ------------------
 3535|       |			/*
 3536|       |			 * Expand the uncompressed buffer up to
 3537|       |			 * the minimum size.
 3538|       |			 */
 3539|      0|			void *p;
 3540|      0|			size_t new_size;
 3541|       |
 3542|      0|			new_size = minimum + 1023;
 3543|      0|			new_size &= ~0x3ff;
 3544|      0|			p = realloc(zip->uncompressed_buffer, new_size);
 3545|      0|			if (p == NULL) {
  ------------------
  |  Branch (3545:8): [True: 0, False: 0]
  ------------------
 3546|      0|				archive_set_error(&a->archive, ENOMEM,
 3547|      0|				    "No memory for 7-Zip decompression");
 3548|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3549|      0|			}
 3550|      0|			zip->uncompressed_buffer = (unsigned char *)p;
 3551|      0|			zip->uncompressed_buffer_size = new_size;
 3552|      0|		}
 3553|       |		/*
 3554|       |		 * Move unconsumed bytes to the head.
 3555|       |		 */
 3556|      0|		if (used) {
  ------------------
  |  Branch (3556:7): [True: 0, False: 0]
  ------------------
 3557|      0|			memmove(zip->uncompressed_buffer,
 3558|      0|				zip->uncompressed_buffer + used,
 3559|      0|				zip->uncompressed_buffer_bytes_remaining);
 3560|      0|		}
 3561|      0|	} else
 3562|      0|		zip->uncompressed_buffer_bytes_remaining = 0;
 3563|     64|	zip->uncompressed_buffer_pointer = NULL;
 3564|    437|	for (;;) {
 3565|    437|		size_t bytes_in, bytes_out;
 3566|    437|		const void *buff_in;
 3567|    437|		unsigned char *buff_out;
 3568|    437|		int end_of_data;
 3569|       |
 3570|       |		/*
 3571|       |		 * Note: '1' here is a performance optimization.
 3572|       |		 * Recall that the decompression layer returns a count of
 3573|       |		 * available bytes; asking for more than that forces the
 3574|       |		 * decompressor to combine reads by copying data.
 3575|       |		 */
 3576|    437|		buff_in = __archive_read_ahead(a, 1, &bytes_avail);
 3577|    437|		if (bytes_avail <= 0) {
  ------------------
  |  Branch (3577:7): [True: 18, False: 419]
  ------------------
 3578|     18|			archive_set_error(&a->archive,
 3579|     18|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     18|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3580|     18|			    "Truncated 7-Zip file body");
 3581|     18|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     18|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3582|     18|		}
 3583|       |
 3584|    419|		buff_out = zip->uncompressed_buffer
 3585|    419|			+ zip->uncompressed_buffer_bytes_remaining;
 3586|    419|		bytes_out = zip->uncompressed_buffer_size
 3587|    419|			- zip->uncompressed_buffer_bytes_remaining;
 3588|    419|		bytes_in = bytes_avail;
 3589|    419|		if (bytes_in > zip->pack_stream_inbytes_remaining)
  ------------------
  |  Branch (3589:7): [True: 108, False: 311]
  ------------------
 3590|    108|			bytes_in = (size_t)zip->pack_stream_inbytes_remaining;
 3591|       |		/* Drive decompression. */
 3592|    419|		r = decompress(a, zip, buff_out, &bytes_out,
 3593|    419|			buff_in, &bytes_in);
 3594|    419|		switch (r) {
 3595|    373|		case ARCHIVE_OK:
  ------------------
  |  |  233|    373|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3595:3): [True: 373, False: 46]
  ------------------
 3596|    373|			end_of_data = 0;
 3597|    373|			break;
 3598|      0|		case ARCHIVE_EOF:
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (3598:3): [True: 0, False: 419]
  ------------------
 3599|      0|			end_of_data = 1;
 3600|      0|			break;
 3601|     46|		default:
  ------------------
  |  Branch (3601:3): [True: 46, False: 373]
  ------------------
 3602|     46|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     46|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3603|    419|		}
 3604|    373|		zip->pack_stream_inbytes_remaining -= bytes_in;
 3605|    373|		if (bytes_out > zip->folder_outbytes_remaining)
  ------------------
  |  Branch (3605:7): [True: 329, False: 44]
  ------------------
 3606|    329|			bytes_out = (size_t)zip->folder_outbytes_remaining;
 3607|    373|		zip->folder_outbytes_remaining -= bytes_out;
 3608|    373|		zip->uncompressed_buffer_bytes_remaining += bytes_out;
 3609|    373|		zip->pack_stream_bytes_unconsumed = bytes_in;
 3610|       |
 3611|       |		/*
 3612|       |		 * Continue decompression until uncompressed_buffer is full.
 3613|       |		 */
 3614|    373|		if (zip->uncompressed_buffer_bytes_remaining ==
  ------------------
  |  Branch (3614:7): [True: 0, False: 373]
  ------------------
 3615|    373|		    zip->uncompressed_buffer_size)
 3616|      0|			break;
 3617|    373|		if (zip->codec2 == _7Z_X86 && zip->odd_bcj_size &&
  ------------------
  |  |  106|    746|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (3617:7): [True: 0, False: 373]
  |  Branch (3617:33): [True: 0, False: 0]
  ------------------
 3618|      0|		    zip->uncompressed_buffer_bytes_remaining + 5 >
  ------------------
  |  Branch (3618:7): [True: 0, False: 0]
  ------------------
 3619|      0|		    zip->uncompressed_buffer_size)
 3620|      0|			break;
 3621|    373|		if (zip->pack_stream_inbytes_remaining == 0 &&
  ------------------
  |  Branch (3621:7): [True: 44, False: 329]
  ------------------
 3622|     44|		    zip->folder_outbytes_remaining == 0)
  ------------------
  |  Branch (3622:7): [True: 0, False: 44]
  ------------------
 3623|      0|			break;
 3624|    373|		if (end_of_data || (bytes_in == 0 && bytes_out == 0)) {
  ------------------
  |  Branch (3624:7): [True: 0, False: 373]
  |  Branch (3624:23): [True: 0, False: 373]
  |  Branch (3624:40): [True: 0, False: 0]
  ------------------
 3625|      0|			archive_set_error(&(a->archive),
 3626|      0|			    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3627|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3628|      0|		}
 3629|    373|		read_consume(a);
 3630|    373|	}
 3631|      0|	if (zip->uncompressed_buffer_bytes_remaining < minimum) {
  ------------------
  |  Branch (3631:6): [True: 0, False: 0]
  ------------------
 3632|      0|		archive_set_error(&(a->archive),
 3633|      0|		    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3634|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3635|      0|	}
 3636|      0|	zip->uncompressed_buffer_pointer = zip->uncompressed_buffer;
 3637|      0|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3638|      0|}
archive_read_support_format_7zip.c:decompress:
 1704|    419|{
 1705|    419|	const uint8_t *t_next_in;
 1706|    419|	uint8_t *t_next_out;
 1707|    419|	size_t o_avail_in, o_avail_out;
 1708|    419|	size_t t_avail_in, t_avail_out;
 1709|    419|	uint8_t *bcj2_next_out;
 1710|    419|	size_t bcj2_avail_out;
 1711|    419|	int r, ret = ARCHIVE_OK;
  ------------------
  |  |  233|    419|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1712|       |
 1713|    419|	t_avail_in = o_avail_in = *used;
 1714|    419|	t_avail_out = o_avail_out = *outbytes;
 1715|    419|	t_next_in = b;
 1716|    419|	t_next_out = buff;
 1717|       |
 1718|    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 (1718:6): [True: 419, False: 0]
  |  Branch (1718:33): [True: 0, False: 419]
  ------------------
 1719|      0|		int i;
 1720|       |
 1721|       |		/* Do not copy out the BCJ remaining bytes when the output
 1722|       |		 * buffer size is less than five bytes. */
 1723|      0|		if (o_avail_in != 0 && t_avail_out < 5 && zip->odd_bcj_size) {
  ------------------
  |  Branch (1723:7): [True: 0, False: 0]
  |  Branch (1723:26): [True: 0, False: 0]
  |  Branch (1723:45): [True: 0, False: 0]
  ------------------
 1724|      0|			*used = 0;
 1725|      0|			*outbytes = 0;
 1726|      0|			return (ret);
 1727|      0|		}
 1728|      0|		for (i = 0; zip->odd_bcj_size > 0 && t_avail_out; i++) {
  ------------------
  |  Branch (1728:15): [True: 0, False: 0]
  |  Branch (1728:40): [True: 0, False: 0]
  ------------------
 1729|      0|			*t_next_out++ = zip->odd_bcj[i];
 1730|      0|			t_avail_out--;
 1731|      0|			zip->odd_bcj_size--;
 1732|      0|		}
 1733|      0|		if (o_avail_in == 0 || t_avail_out == 0) {
  ------------------
  |  Branch (1733:7): [True: 0, False: 0]
  |  Branch (1733:26): [True: 0, False: 0]
  ------------------
 1734|      0|			*used = o_avail_in - t_avail_in;
 1735|      0|			*outbytes = o_avail_out - t_avail_out;
 1736|      0|			if (o_avail_in == 0)
  ------------------
  |  Branch (1736:8): [True: 0, False: 0]
  ------------------
 1737|      0|				ret = ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1738|      0|			return (ret);
 1739|      0|		}
 1740|      0|	}
 1741|       |
 1742|    419|	bcj2_next_out = t_next_out;
 1743|    419|	bcj2_avail_out = t_avail_out;
 1744|    419|	if (zip->codec2 == _7Z_X86_BCJ2) {
  ------------------
  |  |  107|    419|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1744:6): [True: 0, False: 419]
  ------------------
 1745|       |		/*
 1746|       |		 * Decord a remaining decompressed main stream for BCJ2.
 1747|       |		 */
 1748|      0|		if (zip->tmp_stream_bytes_remaining) {
  ------------------
  |  Branch (1748:7): [True: 0, False: 0]
  ------------------
 1749|      0|			ssize_t bytes;
 1750|      0|			size_t remaining = zip->tmp_stream_bytes_remaining;
 1751|      0|			bytes = Bcj2_Decode(zip, t_next_out, t_avail_out);
 1752|      0|			if (bytes < 0) {
  ------------------
  |  Branch (1752:8): [True: 0, False: 0]
  ------------------
 1753|      0|				archive_set_error(&(a->archive),
 1754|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1755|      0|				    "BCJ2 conversion failed");
 1756|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1757|      0|			}
 1758|      0|			zip->main_stream_bytes_remaining -=
 1759|      0|			    remaining - zip->tmp_stream_bytes_remaining;
 1760|      0|			t_avail_out -= bytes;
 1761|      0|			if (o_avail_in == 0 || t_avail_out == 0) {
  ------------------
  |  Branch (1761:8): [True: 0, False: 0]
  |  Branch (1761:27): [True: 0, False: 0]
  ------------------
 1762|      0|				*used = 0;
 1763|      0|				*outbytes = o_avail_out - t_avail_out;
 1764|      0|				if (o_avail_in == 0 &&
  ------------------
  |  Branch (1764:9): [True: 0, False: 0]
  ------------------
 1765|      0|				    zip->tmp_stream_bytes_remaining)
  ------------------
  |  Branch (1765:9): [True: 0, False: 0]
  ------------------
 1766|      0|					ret = ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1767|      0|				return (ret);
 1768|      0|			}
 1769|      0|			t_next_out += bytes;
 1770|      0|			bcj2_next_out = t_next_out;
 1771|      0|			bcj2_avail_out = t_avail_out;
 1772|      0|		}
 1773|      0|		t_next_out = zip->tmp_stream_buff;
 1774|      0|		t_avail_out = zip->tmp_stream_buff_size;
 1775|      0|	}
 1776|       |
 1777|    419|	switch (zip->codec) {
 1778|      0|	case _7Z_COPY:
  ------------------
  |  |   94|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (1778:2): [True: 0, False: 419]
  ------------------
 1779|      0|	{
 1780|      0|		size_t bytes =
 1781|      0|		    (t_avail_in > t_avail_out)?t_avail_out:t_avail_in;
  ------------------
  |  Branch (1781:7): [True: 0, False: 0]
  ------------------
 1782|       |
 1783|      0|		memcpy(t_next_out, t_next_in, bytes);
 1784|      0|		t_avail_in -= bytes;
 1785|      0|		t_avail_out -= bytes;
 1786|      0|		if (o_avail_in == 0)
  ------------------
  |  Branch (1786:7): [True: 0, False: 0]
  ------------------
 1787|      0|			ret = ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1788|      0|		break;
 1789|      0|	}
 1790|      0|#ifdef HAVE_LZMA_H
 1791|      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 (1791:2): [True: 0, False: 419]
  |  Branch (1791:17): [True: 0, False: 419]
  ------------------
 1792|      0|		zip->lzstream.next_in = t_next_in;
 1793|      0|		zip->lzstream.avail_in = t_avail_in;
 1794|      0|		zip->lzstream.next_out = t_next_out;
 1795|      0|		zip->lzstream.avail_out = t_avail_out;
 1796|       |
 1797|      0|		r = lzma_code(&(zip->lzstream), LZMA_RUN);
 1798|      0|		switch (r) {
 1799|      0|		case LZMA_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1799:3): [True: 0, False: 0]
  ------------------
 1800|      0|			lzma_end(&(zip->lzstream));
 1801|      0|			zip->lzstream_valid = 0;
 1802|      0|			ret = ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1803|      0|			break;
 1804|      0|		case LZMA_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (1804:3): [True: 0, False: 0]
  ------------------
 1805|      0|			break;
 1806|      0|		default:
  ------------------
  |  Branch (1806:3): [True: 0, False: 0]
  ------------------
 1807|      0|			archive_set_error(&(a->archive),
 1808|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1809|      0|				"Decompression failed (%d)",
 1810|      0|			    r);
 1811|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1812|      0|		}
 1813|      0|		t_avail_in = zip->lzstream.avail_in;
 1814|      0|		t_avail_out = zip->lzstream.avail_out;
 1815|      0|		break;
 1816|      0|#endif
 1817|      0|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 1818|      0|	case _7Z_BZ2:
  ------------------
  |  |   98|      0|#define _7Z_BZ2		0x040202
  ------------------
  |  Branch (1818:2): [True: 0, False: 419]
  ------------------
 1819|      0|		zip->bzstream.next_in = (char *)(uintptr_t)t_next_in;
 1820|      0|		zip->bzstream.avail_in = (uint32_t)t_avail_in;
 1821|      0|		zip->bzstream.next_out = (char *)(uintptr_t)t_next_out;
 1822|      0|		zip->bzstream.avail_out = (uint32_t)t_avail_out;
 1823|      0|		r = BZ2_bzDecompress(&(zip->bzstream));
 1824|      0|		switch (r) {
 1825|      0|		case BZ_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1825:3): [True: 0, False: 0]
  ------------------
 1826|      0|			switch (BZ2_bzDecompressEnd(&(zip->bzstream))) {
 1827|      0|			case BZ_OK:
  ------------------
  |  Branch (1827:4): [True: 0, False: 0]
  ------------------
 1828|      0|				break;
 1829|      0|			default:
  ------------------
  |  Branch (1829:4): [True: 0, False: 0]
  ------------------
 1830|      0|				archive_set_error(&(a->archive),
 1831|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1832|      0|				    "Failed to clean up decompressor");
 1833|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1834|      0|			}
 1835|      0|			zip->bzstream_valid = 0;
 1836|      0|			ret = ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1837|      0|			break;
 1838|      0|		case BZ_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (1838:3): [True: 0, False: 0]
  ------------------
 1839|      0|			break;
 1840|      0|		default:
  ------------------
  |  Branch (1840:3): [True: 0, False: 0]
  ------------------
 1841|      0|			archive_set_error(&(a->archive),
 1842|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1843|      0|			    "bzip decompression failed");
 1844|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1845|      0|		}
 1846|      0|		t_avail_in = zip->bzstream.avail_in;
 1847|      0|		t_avail_out = zip->bzstream.avail_out;
 1848|      0|		break;
 1849|      0|#endif
 1850|      0|#ifdef HAVE_ZLIB_H
 1851|      0|	case _7Z_DEFLATE:
  ------------------
  |  |   97|      0|#define _7Z_DEFLATE	0x040108
  ------------------
  |  Branch (1851:2): [True: 0, False: 419]
  ------------------
 1852|      0|		zip->stream.next_in = (Bytef *)(uintptr_t)t_next_in;
 1853|      0|		zip->stream.avail_in = (uInt)t_avail_in;
 1854|      0|		zip->stream.next_out = t_next_out;
 1855|      0|		zip->stream.avail_out = (uInt)t_avail_out;
 1856|      0|		r = inflate(&(zip->stream), 0);
 1857|      0|		switch (r) {
 1858|      0|		case Z_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1858:3): [True: 0, False: 0]
  ------------------
 1859|      0|			ret = ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1860|      0|			break;
 1861|      0|		case Z_OK: /* Decompressor made some progress.*/
  ------------------
  |  Branch (1861:3): [True: 0, False: 0]
  ------------------
 1862|      0|			break;
 1863|      0|		default:
  ------------------
  |  Branch (1863:3): [True: 0, False: 0]
  ------------------
 1864|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1865|      0|			    "File decompression failed (%d)", r);
 1866|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1867|      0|		}
 1868|      0|		t_avail_in = zip->stream.avail_in;
 1869|      0|		t_avail_out = zip->stream.avail_out;
 1870|      0|		break;
 1871|      0|#endif
 1872|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 1873|       |	case _7Z_ZSTD:
 1874|       |	{
 1875|       |		ZSTD_inBuffer input = { t_next_in, t_avail_in, 0 }; // src, size, pos
 1876|       |		ZSTD_outBuffer output = { t_next_out, t_avail_out, 0 }; // dst, size, pos
 1877|       |
 1878|       |		size_t const zret = ZSTD_decompressStream(zip->zstd_dstream, &output, &input);
 1879|       |		if (ZSTD_isError(zret)) {
 1880|       |			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Zstd decompression failed: %s", ZSTD_getErrorName(zret));
 1881|       |			return ARCHIVE_FAILED;
 1882|       |		}
 1883|       |		t_avail_in -= input.pos;
 1884|       |		t_avail_out -= output.pos;
 1885|       |		break;
 1886|       |	}
 1887|       |#endif
 1888|    419|	case _7Z_PPMD:
  ------------------
  |  |   99|    419|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (1888:2): [True: 419, False: 0]
  ------------------
 1889|    419|	{
 1890|    419|		uint64_t flush_bytes;
 1891|       |
 1892|    419|		if (!zip->ppmd7_valid || zip->ppmd7_stat < 0 ||
  ------------------
  |  Branch (1892:7): [True: 0, False: 419]
  |  Branch (1892:28): [True: 0, False: 419]
  ------------------
 1893|    419|		    t_avail_out <= 0) {
  ------------------
  |  Branch (1893:7): [True: 0, False: 419]
  ------------------
 1894|      0|			archive_set_error(&(a->archive),
 1895|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1896|      0|			    "Decompression internal error");
 1897|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1898|      0|		}
 1899|    419|		zip->ppstream.next_in = t_next_in;
 1900|    419|		zip->ppstream.avail_in = t_avail_in;
 1901|    419|		zip->ppstream.stream_in = 0;
 1902|    419|		zip->ppstream.next_out = t_next_out;
 1903|    419|		zip->ppstream.avail_out = t_avail_out;
 1904|    419|		if (zip->ppmd7_stat == 0) {
  ------------------
  |  Branch (1904:7): [True: 64, False: 355]
  ------------------
 1905|     64|			zip->bytein.a = a;
 1906|     64|			zip->bytein.Read = &ppmd_read;
 1907|     64|			zip->range_dec.Stream = &zip->bytein;
 1908|     64|			r = __archive_ppmd7_functions.Ppmd7z_RangeDec_Init(
 1909|     64|				&(zip->range_dec));
 1910|     64|			if (r == 0) {
  ------------------
  |  Branch (1910:8): [True: 0, False: 64]
  ------------------
 1911|      0|				zip->ppmd7_stat = -1;
 1912|      0|				archive_set_error(&a->archive,
 1913|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1914|      0|				    "Failed to initialize PPMd range decoder");
 1915|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1916|      0|			}
 1917|     64|			if (zip->ppstream.overconsumed) {
  ------------------
  |  Branch (1917:8): [True: 0, False: 64]
  ------------------
 1918|      0|				zip->ppmd7_stat = -1;
 1919|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1920|      0|			}
 1921|     64|			zip->ppmd7_stat = 1;
 1922|     64|		}
 1923|       |
 1924|    419|		if (t_avail_in == 0)
  ------------------
  |  Branch (1924:7): [True: 44, False: 375]
  ------------------
 1925|       |			/* XXX Flush out remaining decoded data XXX */
 1926|     44|			flush_bytes = zip->folder_outbytes_remaining;
 1927|    375|		else
 1928|    375|			flush_bytes = 0;
 1929|       |
 1930|  22.2M|		do {
 1931|  22.2M|			int sym;
 1932|       |
 1933|  22.2M|			sym = __archive_ppmd7_functions.Ppmd7_DecodeSymbol(
 1934|  22.2M|				&(zip->ppmd7_context), &(zip->range_dec.p));
 1935|  22.2M|			if (sym < 0) {
  ------------------
  |  Branch (1935:8): [True: 13, False: 22.2M]
  ------------------
 1936|     13|				zip->ppmd7_stat = -1;
 1937|     13|				archive_set_error(&a->archive,
 1938|     13|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     13|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1939|     13|				    "Failed to decode PPMd");
 1940|     13|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     13|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1941|     13|			}
 1942|  22.2M|			if (zip->ppstream.overconsumed) {
  ------------------
  |  Branch (1942:8): [True: 33, False: 22.2M]
  ------------------
 1943|     33|				zip->ppmd7_stat = -1;
 1944|     33|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     33|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1945|     33|			}
 1946|  22.2M|			*zip->ppstream.next_out++ = (unsigned char)sym;
 1947|  22.2M|			zip->ppstream.avail_out--;
 1948|  22.2M|			if (flush_bytes)
  ------------------
  |  Branch (1948:8): [True: 165k, False: 22.0M]
  ------------------
 1949|   165k|				flush_bytes--;
 1950|  22.2M|		} while (zip->ppstream.avail_out &&
  ------------------
  |  Branch (1950:12): [True: 22.2M, False: 311]
  ------------------
 1951|  22.2M|			(zip->ppstream.avail_in || flush_bytes));
  ------------------
  |  Branch (1951:5): [True: 22.2M, False: 67]
  |  Branch (1951:31): [True: 5, False: 62]
  ------------------
 1952|       |
 1953|    373|		t_avail_in = (size_t)zip->ppstream.avail_in;
 1954|    373|		t_avail_out = (size_t)zip->ppstream.avail_out;
 1955|    373|		break;
 1956|    419|	}
 1957|      0|	default:
  ------------------
  |  Branch (1957:2): [True: 0, False: 419]
  ------------------
 1958|      0|		archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1959|      0|		    "Decompression internal error");
 1960|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1961|    419|	}
 1962|    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 (1962:6): [True: 0, False: 373]
  |  Branch (1962:27): [True: 0, False: 0]
  ------------------
 1963|      0|		return (ret);
 1964|       |
 1965|    373|	*used = o_avail_in - t_avail_in;
 1966|    373|	*outbytes = o_avail_out - t_avail_out;
 1967|       |
 1968|       |	/*
 1969|       |	 * Decord BCJ.
 1970|       |	 */
 1971|    373|	if (zip->codec != _7Z_LZMA2) {
  ------------------
  |  |   96|    373|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1971:6): [True: 373, False: 0]
  ------------------
 1972|    373|		if (zip->codec2 == _7Z_X86) {
  ------------------
  |  |  106|    373|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1972:7): [True: 0, False: 373]
  ------------------
 1973|      0|			size_t l = x86_Convert(zip, buff, *outbytes);
 1974|       |
 1975|      0|			zip->odd_bcj_size = *outbytes - l;
 1976|      0|			if (zip->odd_bcj_size > 0 && zip->odd_bcj_size <= 4 &&
  ------------------
  |  Branch (1976:8): [True: 0, False: 0]
  |  Branch (1976:33): [True: 0, False: 0]
  ------------------
 1977|      0|		    	o_avail_in && ret != ARCHIVE_EOF) {
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1977:8): [True: 0, False: 0]
  |  Branch (1977:22): [True: 0, False: 0]
  ------------------
 1978|      0|				memcpy(zip->odd_bcj, ((unsigned char *)buff) + l,
 1979|      0|			    	zip->odd_bcj_size);
 1980|      0|				*outbytes = l;
 1981|      0|			} else
 1982|      0|				zip->odd_bcj_size = 0;
 1983|    373|		} else if (zip->codec2 == _7Z_ARM) {
  ------------------
  |  |  110|    373|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1983:14): [True: 0, False: 373]
  ------------------
 1984|      0|			*outbytes = arm_Convert(zip, buff, *outbytes);
 1985|    373|		} else if (zip->codec2 == _7Z_ARM64) {
  ------------------
  |  |  112|    373|#define _7Z_ARM64	0xa
  ------------------
  |  Branch (1985:14): [True: 0, False: 373]
  ------------------
 1986|      0|			*outbytes = arm64_Convert(zip, buff, *outbytes);
 1987|    373|		} else if (zip->codec2 == _7Z_SPARC) {
  ------------------
  |  |  114|    373|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1987:14): [True: 0, False: 373]
  ------------------
 1988|      0|			*outbytes = sparc_Convert(zip, buff, *outbytes);
 1989|    373|		} else if (zip->codec2 == _7Z_POWERPC) {
  ------------------
  |  |  108|    373|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1989:14): [True: 0, False: 373]
  ------------------
 1990|      0|			*outbytes = powerpc_Convert(zip, buff, *outbytes);
 1991|      0|		}
 1992|    373|	}
 1993|       |
 1994|       |	/*
 1995|       |	 * Decord BCJ2 with a decompressed main stream.
 1996|       |	 */
 1997|    373|	if (zip->codec2 == _7Z_X86_BCJ2) {
  ------------------
  |  |  107|    373|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1997:6): [True: 0, False: 373]
  ------------------
 1998|      0|		ssize_t bytes;
 1999|       |
 2000|      0|		zip->tmp_stream_bytes_avail =
 2001|      0|		    zip->tmp_stream_buff_size - t_avail_out;
 2002|      0|		if (zip->tmp_stream_bytes_avail >
  ------------------
  |  Branch (2002:7): [True: 0, False: 0]
  ------------------
 2003|      0|		      zip->main_stream_bytes_remaining)
 2004|      0|			zip->tmp_stream_bytes_avail =
 2005|      0|			    zip->main_stream_bytes_remaining;
 2006|      0|		zip->tmp_stream_bytes_remaining = zip->tmp_stream_bytes_avail;
 2007|      0|		bytes = Bcj2_Decode(zip, bcj2_next_out, bcj2_avail_out);
 2008|      0|		if (bytes < 0) {
  ------------------
  |  Branch (2008:7): [True: 0, False: 0]
  ------------------
 2009|      0|			archive_set_error(&(a->archive),
 2010|      0|			    ARCHIVE_ERRNO_MISC, "BCJ2 conversion failed");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2011|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2012|      0|		}
 2013|      0|		zip->main_stream_bytes_remaining -=
 2014|      0|		    zip->tmp_stream_bytes_avail
 2015|      0|		      - zip->tmp_stream_bytes_remaining;
 2016|      0|		bcj2_avail_out -= bytes;
 2017|      0|		*outbytes = o_avail_out - bcj2_avail_out;
 2018|      0|	}
 2019|       |
 2020|    373|	return (ret);
 2021|    373|}
archive_read_support_format_7zip.c:ppmd_read:
 1330|  1.68M|{
 1331|  1.68M|	struct archive_read *a = ((IByteIn*)p)->a;
 1332|  1.68M|	struct _7zip *zip = (struct _7zip *)(a->format->data);
 1333|  1.68M|	Byte b;
 1334|       |
 1335|  1.68M|	if (zip->ppstream.avail_in <= 0) {
  ------------------
  |  Branch (1335:6): [True: 837k, False: 842k]
  ------------------
 1336|       |		/*
 1337|       |		 * Ppmd7_DecodeSymbol might require reading multiple bytes
 1338|       |		 * and we are on boundary;
 1339|       |		 * last resort to read using __archive_read_ahead.
 1340|       |		 */
 1341|   837k|		ssize_t bytes_avail = 0;
 1342|   837k|		const uint8_t* data = __archive_read_ahead(a,
 1343|   837k|		    (size_t)zip->ppstream.stream_in+1, &bytes_avail);
 1344|   837k|		if(data == NULL || bytes_avail < zip->ppstream.stream_in+1) {
  ------------------
  |  Branch (1344:6): [True: 40, False: 837k]
  |  Branch (1344:22): [True: 0, False: 837k]
  ------------------
 1345|     40|			archive_set_error(&a->archive,
 1346|     40|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     40|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1347|     40|			    "Truncated 7z file data");
 1348|     40|			zip->ppstream.overconsumed = 1;
 1349|     40|			return (0);
 1350|     40|		}
 1351|   837k|		zip->ppstream.next_in++;
 1352|   837k|		b = data[zip->ppstream.stream_in];
 1353|   842k|	} else {
 1354|   842k|		b = *zip->ppstream.next_in++;
 1355|   842k|	}
 1356|  1.68M|	zip->ppstream.avail_in--;
 1357|  1.68M|	zip->ppstream.stream_in++;
 1358|  1.68M|	return (b);
 1359|  1.68M|}
archive_read_support_format_7zip.c:get_uncompressed_data:
 3429|      8|{
 3430|      8|	struct _7zip *zip = (struct _7zip *)a->format->data;
 3431|      8|	ssize_t bytes_avail;
 3432|       |
 3433|      8|	if (zip->codec == _7Z_COPY && zip->codec2 == (unsigned long)-1) {
  ------------------
  |  |   94|     16|#define _7Z_COPY	0
  ------------------
  |  Branch (3433:6): [True: 8, False: 0]
  |  Branch (3433:32): [True: 8, False: 0]
  ------------------
 3434|       |		/* Copy mode. */
 3435|       |
 3436|      8|		*buff = __archive_read_ahead(a, minimum, &bytes_avail);
 3437|      8|		if (*buff == NULL) {
  ------------------
  |  Branch (3437:7): [True: 0, False: 8]
  ------------------
 3438|      0|			archive_set_error(&a->archive,
 3439|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3440|      0|			    "Truncated 7-Zip file data");
 3441|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3442|      0|		}
 3443|      8|		if ((size_t)bytes_avail >
  ------------------
  |  Branch (3443:7): [True: 8, False: 0]
  ------------------
 3444|      8|		    zip->uncompressed_buffer_bytes_remaining)
 3445|      8|			bytes_avail = (ssize_t)
 3446|      8|			    zip->uncompressed_buffer_bytes_remaining;
 3447|      8|		if ((size_t)bytes_avail > size)
  ------------------
  |  Branch (3447:7): [True: 0, False: 8]
  ------------------
 3448|      0|			bytes_avail = (ssize_t)size;
 3449|       |
 3450|      8|		zip->pack_stream_bytes_unconsumed = bytes_avail;
 3451|      8|	} else if (zip->uncompressed_buffer_pointer == NULL) {
  ------------------
  |  Branch (3451:13): [True: 0, False: 0]
  ------------------
 3452|       |		/* Decompression has failed. */
 3453|      0|		archive_set_error(&(a->archive),
 3454|      0|		    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3455|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3456|      0|	} else {
 3457|       |		/* Packed mode. */
 3458|      0|		if (minimum > zip->uncompressed_buffer_bytes_remaining) {
  ------------------
  |  Branch (3458:7): [True: 0, False: 0]
  ------------------
 3459|       |			/*
 3460|       |			 * If remaining uncompressed data size is less than
 3461|       |			 * the minimum size, fill the buffer up to the
 3462|       |			 * minimum size.
 3463|       |			 */
 3464|      0|			if (extract_pack_stream(a, minimum) < 0)
  ------------------
  |  Branch (3464:8): [True: 0, False: 0]
  ------------------
 3465|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3466|      0|		}
 3467|      0|		if (size > zip->uncompressed_buffer_bytes_remaining)
  ------------------
  |  Branch (3467:7): [True: 0, False: 0]
  ------------------
 3468|      0|			bytes_avail = (ssize_t)
 3469|      0|			    zip->uncompressed_buffer_bytes_remaining;
 3470|      0|		else
 3471|      0|			bytes_avail = (ssize_t)size;
 3472|      0|		*buff = zip->uncompressed_buffer_pointer;
 3473|      0|		zip->uncompressed_buffer_pointer += bytes_avail;
 3474|      0|	}
 3475|      8|	zip->uncompressed_buffer_bytes_remaining -= bytes_avail;
 3476|      8|	return (bytes_avail);
 3477|      8|}
archive_read_support_format_7zip.c:decode_encoded_header_info:
 3197|     65|{
 3198|     65|	struct _7zip *zip = (struct _7zip *)a->format->data;
 3199|       |
 3200|     65|	errno = 0;
 3201|     65|	if (read_StreamsInfo(a, si) < 0) {
  ------------------
  |  Branch (3201:6): [True: 1, False: 64]
  ------------------
 3202|      1|		if (errno == ENOMEM)
  ------------------
  |  Branch (3202:7): [True: 0, False: 1]
  ------------------
 3203|      0|			archive_set_error(&a->archive, -1,
 3204|      0|			    "Couldn't allocate memory");
 3205|      1|		else
 3206|      1|			archive_set_error(&a->archive, -1,
 3207|      1|			    "Malformed 7-Zip archive");
 3208|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3209|      1|	}
 3210|       |
 3211|     64|	if (si->pi.numPackStreams == 0 || si->ci.numFolders == 0) {
  ------------------
  |  Branch (3211:6): [True: 0, False: 64]
  |  Branch (3211:36): [True: 0, False: 64]
  ------------------
 3212|      0|		archive_set_error(&a->archive, -1, "Malformed 7-Zip archive");
 3213|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3214|      0|	}
 3215|       |
 3216|     64|	if (zip->header_offset < si->pi.pos + si->pi.sizes[0] ||
  ------------------
  |  Branch (3216:6): [True: 0, False: 64]
  ------------------
 3217|     64|	    (int64_t)(si->pi.pos + si->pi.sizes[0]) < 0 ||
  ------------------
  |  Branch (3217:6): [True: 0, False: 64]
  ------------------
 3218|     64|	    si->pi.sizes[0] == 0 || (int64_t)si->pi.pos < 0) {
  ------------------
  |  Branch (3218:6): [True: 0, False: 64]
  |  Branch (3218:30): [True: 0, False: 64]
  ------------------
 3219|      0|		archive_set_error(&a->archive, -1, "Malformed Header offset");
 3220|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3221|      0|	}
 3222|       |
 3223|     64|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     64|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3224|     64|}
archive_read_support_format_7zip.c:read_StreamsInfo:
 2694|     89|{
 2695|     89|	struct _7zip *zip = (struct _7zip *)a->format->data;
 2696|     89|	const unsigned char *p;
 2697|     89|	unsigned i;
 2698|       |
 2699|     89|	memset(si, 0, sizeof(*si));
 2700|       |
 2701|     89|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2701:6): [True: 0, False: 89]
  ------------------
 2702|      0|		return (-1);
 2703|     89|	if (*p == kPackInfo) {
  ------------------
  |  |  127|     89|#define kPackInfo		0x06
  ------------------
  |  Branch (2703:6): [True: 89, False: 0]
  ------------------
 2704|     89|		uint64_t packPos;
 2705|       |
 2706|     89|		if (read_PackInfo(a, &(si->pi)) < 0)
  ------------------
  |  Branch (2706:7): [True: 1, False: 88]
  ------------------
 2707|      1|			return (-1);
 2708|       |
 2709|     88|		if (si->pi.positions == NULL || si->pi.sizes == NULL)
  ------------------
  |  Branch (2709:7): [True: 0, False: 88]
  |  Branch (2709:35): [True: 0, False: 88]
  ------------------
 2710|      0|			return (-1);
 2711|       |		/*
 2712|       |		 * Calculate packed stream positions.
 2713|       |		 */
 2714|     88|		packPos = si->pi.pos;
 2715|    176|		for (i = 0; i < si->pi.numPackStreams; i++) {
  ------------------
  |  Branch (2715:15): [True: 88, False: 88]
  ------------------
 2716|     88|			si->pi.positions[i] = packPos;
 2717|     88|			if (packPos > UINT64_MAX - si->pi.sizes[i])
  ------------------
  |  Branch (2717:8): [True: 0, False: 88]
  ------------------
 2718|      0|				return (-1);
 2719|     88|			packPos += si->pi.sizes[i];
 2720|     88|			if (packPos > zip->header_offset)
  ------------------
  |  Branch (2720:8): [True: 0, False: 88]
  ------------------
 2721|      0|				return (-1);
 2722|     88|		}
 2723|     88|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2723:7): [True: 0, False: 88]
  ------------------
 2724|      0|			return (-1);
 2725|     88|	}
 2726|     88|	if (*p == kUnPackInfo) {
  ------------------
  |  |  128|     88|#define kUnPackInfo		0x07
  ------------------
  |  Branch (2726:6): [True: 88, False: 0]
  ------------------
 2727|     88|		uint32_t packIndex;
 2728|     88|		struct _7z_folder *f;
 2729|       |
 2730|     88|		if (read_CodersInfo(a, &(si->ci)) < 0)
  ------------------
  |  Branch (2730:7): [True: 6, False: 82]
  ------------------
 2731|      6|			return (-1);
 2732|       |
 2733|       |		/*
 2734|       |		 * Calculate packed stream indexes.
 2735|       |		 */
 2736|     82|		packIndex = 0;
 2737|     82|		f = si->ci.folders;
 2738|    164|		for (i = 0; i < si->ci.numFolders; i++) {
  ------------------
  |  Branch (2738:15): [True: 82, False: 82]
  ------------------
 2739|     82|			f[i].packIndex = packIndex;
 2740|     82|			if (f[i].numPackedStreams > UINT32_MAX)
  ------------------
  |  Branch (2740:8): [True: 0, False: 82]
  ------------------
 2741|      0|				return (-1);
 2742|     82|			if (packIndex > UINT32_MAX - (uint32_t)f[i].numPackedStreams)
  ------------------
  |  Branch (2742:8): [True: 0, False: 82]
  ------------------
 2743|      0|				return (-1);
 2744|     82|			packIndex += (uint32_t)f[i].numPackedStreams;
 2745|     82|			if (packIndex > si->pi.numPackStreams)
  ------------------
  |  Branch (2745:8): [True: 0, False: 82]
  ------------------
 2746|      0|				return (-1);
 2747|     82|		}
 2748|     82|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2748:7): [True: 0, False: 82]
  ------------------
 2749|      0|			return (-1);
 2750|     82|	}
 2751|       |
 2752|     82|	if (*p == kSubStreamsInfo) {
  ------------------
  |  |  129|     82|#define kSubStreamsInfo		0x08
  ------------------
  |  Branch (2752:6): [True: 18, False: 64]
  ------------------
 2753|     18|		if (read_SubStreamsInfo(a, &(si->ss),
  ------------------
  |  Branch (2753:7): [True: 7, False: 11]
  ------------------
 2754|     18|		    si->ci.folders, (size_t)si->ci.numFolders) < 0)
 2755|      7|			return (-1);
 2756|     11|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2756:7): [True: 0, False: 11]
  ------------------
 2757|      0|			return (-1);
 2758|     11|	}
 2759|       |
 2760|       |	/*
 2761|       |	 *  Must be kEnd.
 2762|       |	 */
 2763|     75|	if (*p != kEnd)
  ------------------
  |  |  121|     75|#define kEnd			0x00
  ------------------
  |  Branch (2763:6): [True: 0, False: 75]
  ------------------
 2764|      0|		return (-1);
 2765|     75|	return (0);
 2766|     75|}
archive_read_support_format_7zip.c:read_PackInfo:
 2171|     89|{
 2172|     89|	const unsigned char *p;
 2173|     89|	unsigned i;
 2174|       |
 2175|     89|	memset(pi, 0, sizeof(*pi));
 2176|       |
 2177|       |	/*
 2178|       |	 * Read PackPos.
 2179|       |	 */
 2180|     89|	if (parse_7zip_uint64(a, &(pi->pos)) < 0)
  ------------------
  |  Branch (2180:6): [True: 0, False: 89]
  ------------------
 2181|      0|		return (-1);
 2182|       |
 2183|       |	/*
 2184|       |	 * Read NumPackStreams.
 2185|       |	 */
 2186|     89|	if (parse_7zip_uint64(a, &(pi->numPackStreams)) < 0)
  ------------------
  |  Branch (2186:6): [True: 0, False: 89]
  ------------------
 2187|      0|		return (-1);
 2188|     89|	if (pi->numPackStreams == 0)
  ------------------
  |  Branch (2188:6): [True: 0, False: 89]
  ------------------
 2189|      0|		return (-1);
 2190|     89|	if (UMAX_ENTRY < pi->numPackStreams)
  ------------------
  |  |  398|     89|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|     89|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2190:6): [True: 1, False: 88]
  ------------------
 2191|      1|		return (-1);
 2192|       |
 2193|       |	/*
 2194|       |	 * Read PackSizes[num]
 2195|       |	 */
 2196|     88|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2196:6): [True: 0, False: 88]
  ------------------
 2197|      0|		return (-1);
 2198|     88|	if (*p == kEnd)
  ------------------
  |  |  121|     88|#define kEnd			0x00
  ------------------
  |  Branch (2198:6): [True: 0, False: 88]
  ------------------
 2199|       |		/* PackSizes[num] are not present. */
 2200|      0|		return (0);
 2201|     88|	if (*p != kSize)
  ------------------
  |  |  130|     88|#define kSize			0x09
  ------------------
  |  Branch (2201:6): [True: 0, False: 88]
  ------------------
 2202|      0|		return (-1);
 2203|     88|	pi->sizes = calloc((size_t)pi->numPackStreams, sizeof(uint64_t));
 2204|     88|	pi->positions = calloc((size_t)pi->numPackStreams, sizeof(uint64_t));
 2205|     88|	if (pi->sizes == NULL || pi->positions == NULL)
  ------------------
  |  Branch (2205:6): [True: 0, False: 88]
  |  Branch (2205:27): [True: 0, False: 88]
  ------------------
 2206|      0|		return (-1);
 2207|       |
 2208|    176|	for (i = 0; i < pi->numPackStreams; i++) {
  ------------------
  |  Branch (2208:14): [True: 88, False: 88]
  ------------------
 2209|     88|		if (parse_7zip_uint64(a, &(pi->sizes[i])) < 0)
  ------------------
  |  Branch (2209:7): [True: 0, False: 88]
  ------------------
 2210|      0|			return (-1);
 2211|     88|	}
 2212|       |
 2213|       |	/*
 2214|       |	 * Read PackStreamDigests[num]
 2215|       |	 */
 2216|     88|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2216:6): [True: 0, False: 88]
  ------------------
 2217|      0|		return (-1);
 2218|     88|	if (*p == kEnd) {
  ------------------
  |  |  121|     88|#define kEnd			0x00
  ------------------
  |  Branch (2218:6): [True: 88, False: 0]
  ------------------
 2219|       |		/* PackStreamDigests[num] are not present. */
 2220|     88|		pi->digest.defineds =
 2221|     88|		    calloc((size_t)pi->numPackStreams, sizeof(*pi->digest.defineds));
 2222|     88|		pi->digest.digests =
 2223|     88|		    calloc((size_t)pi->numPackStreams, sizeof(*pi->digest.digests));
 2224|     88|		if (pi->digest.defineds == NULL || pi->digest.digests == NULL)
  ------------------
  |  Branch (2224:7): [True: 0, False: 88]
  |  Branch (2224:38): [True: 0, False: 88]
  ------------------
 2225|      0|			return (-1);
 2226|     88|		return (0);
 2227|     88|	}
 2228|       |
 2229|      0|	if (*p != kCRC)
  ------------------
  |  |  131|      0|#define kCRC			0x0A
  ------------------
  |  Branch (2229:6): [True: 0, False: 0]
  ------------------
 2230|      0|		return (-1);
 2231|       |
 2232|      0|	if (read_Digests(a, &(pi->digest), (size_t)pi->numPackStreams) < 0)
  ------------------
  |  Branch (2232:6): [True: 0, False: 0]
  ------------------
 2233|      0|		return (-1);
 2234|       |
 2235|       |	/*
 2236|       |	 *  Must be marked by kEnd.
 2237|       |	 */
 2238|      0|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2238:6): [True: 0, False: 0]
  ------------------
 2239|      0|		return (-1);
 2240|      0|	if (*p != kEnd)
  ------------------
  |  |  121|      0|#define kEnd			0x00
  ------------------
  |  Branch (2240:6): [True: 0, False: 0]
  ------------------
 2241|      0|		return (-1);
 2242|      0|	return (0);
 2243|      0|}
archive_read_support_format_7zip.c:parse_7zip_uint64:
 2072|  28.5k|{
 2073|  28.5k|	const unsigned char *p;
 2074|  28.5k|	unsigned char avail, mask;
 2075|  28.5k|	int i;
 2076|       |
 2077|  28.5k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2077:6): [True: 4, False: 28.5k]
  ------------------
 2078|      4|		return (-1);
 2079|  28.5k|	avail = *p;
 2080|  28.5k|	mask = 0x80;
 2081|  28.5k|	*val = 0;
 2082|  59.0k|	for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (2082:14): [True: 58.4k, False: 597]
  ------------------
 2083|  58.4k|		if (avail & mask) {
  ------------------
  |  Branch (2083:7): [True: 30.5k, False: 27.9k]
  ------------------
 2084|  30.5k|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2084:8): [True: 1, False: 30.5k]
  ------------------
 2085|      1|				return (-1);
 2086|  30.5k|			*val |= ((uint64_t)*p) << (8 * i);
 2087|  30.5k|			mask >>= 1;
 2088|  30.5k|			continue;
 2089|  30.5k|		}
 2090|  27.9k|		*val += ((uint64_t)(avail & (mask -1))) << (8 * i);
 2091|  27.9k|		break;
 2092|  58.4k|	}
 2093|  28.5k|	return (0);
 2094|  28.5k|}
archive_read_support_format_7zip.c:read_Digests:
 2124|     49|{
 2125|     49|	const unsigned char *p;
 2126|     49|	unsigned i;
 2127|       |
 2128|     49|	if (num == 0)
  ------------------
  |  Branch (2128:6): [True: 0, False: 49]
  ------------------
 2129|      0|		return (-1);
 2130|     49|	memset(d, 0, sizeof(*d));
 2131|       |
 2132|     49|	d->defineds = malloc(num);
 2133|     49|	if (d->defineds == NULL)
  ------------------
  |  Branch (2133:6): [True: 0, False: 49]
  ------------------
 2134|      0|		return (-1);
 2135|       |	/*
 2136|       |	 * Read Bools.
 2137|       |	 */
 2138|     49|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2138:6): [True: 0, False: 49]
  ------------------
 2139|      0|		return (-1);
 2140|     49|	if (*p == 0) {
  ------------------
  |  Branch (2140:6): [True: 21, False: 28]
  ------------------
 2141|     21|		if (read_Bools(a, d->defineds, num) < 0)
  ------------------
  |  Branch (2141:7): [True: 0, False: 21]
  ------------------
 2142|      0|			return (-1);
 2143|     21|	} else
 2144|       |		/* All are defined */
 2145|     28|		memset(d->defineds, 1, num);
 2146|       |
 2147|     49|	d->digests = calloc(num, sizeof(*d->digests));
 2148|     49|	if (d->digests == NULL)
  ------------------
  |  Branch (2148:6): [True: 0, False: 49]
  ------------------
 2149|      0|		return (-1);
 2150|     98|	for (i = 0; i < num; i++) {
  ------------------
  |  Branch (2150:14): [True: 49, False: 49]
  ------------------
 2151|     49|		if (d->defineds[i]) {
  ------------------
  |  Branch (2151:7): [True: 28, False: 21]
  ------------------
 2152|     28|			if ((p = header_bytes(a, 4)) == NULL)
  ------------------
  |  Branch (2152:8): [True: 0, False: 28]
  ------------------
 2153|      0|				return (-1);
 2154|     28|			d->digests[i] = archive_le32dec(p);
 2155|     28|		}
 2156|     49|	}
 2157|       |
 2158|     49|	return (0);
 2159|     49|}
archive_read_support_format_7zip.c:read_Bools:
 2098|     52|{
 2099|     52|	const unsigned char *p;
 2100|     52|	unsigned i, mask = 0, avail = 0;
 2101|       |
 2102|  1.20k|	for (i = 0; i < num; i++) {
  ------------------
  |  Branch (2102:14): [True: 1.15k, False: 52]
  ------------------
 2103|  1.15k|		if (mask == 0) {
  ------------------
  |  Branch (2103:7): [True: 186, False: 966]
  ------------------
 2104|    186|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2104:8): [True: 0, False: 186]
  ------------------
 2105|      0|				return (-1);
 2106|    186|			avail = *p;
 2107|    186|			mask = 0x80;
 2108|    186|		}
 2109|  1.15k|		data[i] = (avail & mask)?1:0;
  ------------------
  |  Branch (2109:13): [True: 1.02k, False: 130]
  ------------------
 2110|  1.15k|		mask >>= 1;
 2111|  1.15k|	}
 2112|     52|	return (0);
 2113|     52|}
archive_read_support_format_7zip.c:read_CodersInfo:
 2421|     88|{
 2422|     88|	const unsigned char *p;
 2423|     88|	struct _7z_digests digest;
 2424|     88|	unsigned i;
 2425|       |
 2426|     88|	memset(ci, 0, sizeof(*ci));
 2427|     88|	memset(&digest, 0, sizeof(digest));
 2428|       |
 2429|     88|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2429:6): [True: 0, False: 88]
  ------------------
 2430|      0|		goto failed;
 2431|     88|	if (*p != kFolder)
  ------------------
  |  |  132|     88|#define kFolder			0x0B
  ------------------
  |  Branch (2431:6): [True: 0, False: 88]
  ------------------
 2432|      0|		goto failed;
 2433|       |
 2434|       |	/*
 2435|       |	 * Read NumFolders.
 2436|       |	 */
 2437|     88|	if (parse_7zip_uint64(a, &(ci->numFolders)) < 0)
  ------------------
  |  Branch (2437:6): [True: 0, False: 88]
  ------------------
 2438|      0|		goto failed;
 2439|     88|	if (UMAX_ENTRY < ci->numFolders)
  ------------------
  |  |  398|     88|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|     88|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2439:6): [True: 1, False: 87]
  ------------------
 2440|      1|		return (-1);
 2441|       |
 2442|       |	/*
 2443|       |	 * Read External.
 2444|       |	 */
 2445|     87|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2445:6): [True: 0, False: 87]
  ------------------
 2446|      0|		goto failed;
 2447|     87|	switch (*p) {
 2448|     87|	case 0:
  ------------------
  |  Branch (2448:2): [True: 87, False: 0]
  ------------------
 2449|     87|		ci->folders =
 2450|     87|			calloc((size_t)ci->numFolders, sizeof(*ci->folders));
 2451|     87|		if (ci->folders == NULL)
  ------------------
  |  Branch (2451:7): [True: 0, False: 87]
  ------------------
 2452|      0|			return (-1);
 2453|    169|		for (i = 0; i < ci->numFolders; i++) {
  ------------------
  |  Branch (2453:15): [True: 87, False: 82]
  ------------------
 2454|     87|			if (read_Folder(a, &(ci->folders[i])) < 0)
  ------------------
  |  Branch (2454:8): [True: 5, False: 82]
  ------------------
 2455|      5|				goto failed;
 2456|     87|		}
 2457|     82|		break;
 2458|     82|	case 1:
  ------------------
  |  Branch (2458:2): [True: 0, False: 87]
  ------------------
 2459|      0|		if (parse_7zip_uint64(a, &(ci->dataStreamIndex)) < 0)
  ------------------
  |  Branch (2459:7): [True: 0, False: 0]
  ------------------
 2460|      0|			return (-1);
 2461|      0|		if (UMAX_ENTRY < ci->dataStreamIndex)
  ------------------
  |  |  398|      0|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|      0|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2461:7): [True: 0, False: 0]
  ------------------
 2462|      0|			return (-1);
 2463|      0|		if (ci->numFolders > 0) {
  ------------------
  |  Branch (2463:7): [True: 0, False: 0]
  ------------------
 2464|      0|			archive_set_error(&a->archive, -1,
 2465|      0|			    "Malformed 7-Zip archive");
 2466|      0|			goto failed;
 2467|      0|		}
 2468|      0|		break;
 2469|      0|	default:
  ------------------
  |  Branch (2469:2): [True: 0, False: 87]
  ------------------
 2470|      0|		archive_set_error(&a->archive, -1,
 2471|      0|		    "Malformed 7-Zip archive");
 2472|      0|		goto failed;
 2473|     87|	}
 2474|       |
 2475|     82|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2475:6): [True: 0, False: 82]
  ------------------
 2476|      0|		goto failed;
 2477|     82|	if (*p != kCodersUnPackSize)
  ------------------
  |  |  133|     82|#define kCodersUnPackSize	0x0C
  ------------------
  |  Branch (2477:6): [True: 0, False: 82]
  ------------------
 2478|      0|		goto failed;
 2479|       |
 2480|    164|	for (i = 0; i < ci->numFolders; i++) {
  ------------------
  |  Branch (2480:14): [True: 82, False: 82]
  ------------------
 2481|     82|		struct _7z_folder *folder = &(ci->folders[i]);
 2482|     82|		unsigned j;
 2483|       |
 2484|     82|		folder->unPackSize =
 2485|     82|		    calloc((size_t)folder->numOutStreams, sizeof(*folder->unPackSize));
 2486|     82|		if (folder->unPackSize == NULL)
  ------------------
  |  Branch (2486:7): [True: 0, False: 82]
  ------------------
 2487|      0|			goto failed;
 2488|    164|		for (j = 0; j < folder->numOutStreams; j++) {
  ------------------
  |  Branch (2488:15): [True: 82, False: 82]
  ------------------
 2489|     82|			if (parse_7zip_uint64(a, &(folder->unPackSize[j])) < 0)
  ------------------
  |  Branch (2489:8): [True: 0, False: 82]
  ------------------
 2490|      0|				goto failed;
 2491|     82|		}
 2492|     82|	}
 2493|       |
 2494|       |	/*
 2495|       |	 * Read CRCs.
 2496|       |	 */
 2497|     82|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2497:6): [True: 0, False: 82]
  ------------------
 2498|      0|		goto failed;
 2499|     82|	if (*p == kEnd)
  ------------------
  |  |  121|     82|#define kEnd			0x00
  ------------------
  |  Branch (2499:6): [True: 44, False: 38]
  ------------------
 2500|     44|		return (0);
 2501|     38|	if (*p != kCRC)
  ------------------
  |  |  131|     38|#define kCRC			0x0A
  ------------------
  |  Branch (2501:6): [True: 0, False: 38]
  ------------------
 2502|      0|		goto failed;
 2503|     38|	if (read_Digests(a, &digest, (size_t)ci->numFolders) < 0)
  ------------------
  |  Branch (2503:6): [True: 0, False: 38]
  ------------------
 2504|      0|		goto failed;
 2505|     76|	for (i = 0; i < ci->numFolders; i++) {
  ------------------
  |  Branch (2505:14): [True: 38, False: 38]
  ------------------
 2506|     38|		ci->folders[i].digest_defined = digest.defineds[i];
 2507|     38|		ci->folders[i].digest = digest.digests[i];
 2508|     38|	}
 2509|       |
 2510|       |	/*
 2511|       |	 *  Must be kEnd.
 2512|       |	 */
 2513|     38|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2513:6): [True: 0, False: 38]
  ------------------
 2514|      0|		goto failed;
 2515|     38|	if (*p != kEnd)
  ------------------
  |  |  121|     38|#define kEnd			0x00
  ------------------
  |  Branch (2515:6): [True: 0, False: 38]
  ------------------
 2516|      0|		goto failed;
 2517|     38|	free_Digest(&digest);
 2518|     38|	return (0);
 2519|      5|failed:
 2520|      5|	free_Digest(&digest);
 2521|      5|	return (-1);
 2522|     38|}
archive_read_support_format_7zip.c:read_Folder:
 2263|     87|{
 2264|     87|	struct _7zip *zip = (struct _7zip *)a->format->data;
 2265|     87|	const unsigned char *p;
 2266|     87|	uint64_t numInStreamsTotal = 0;
 2267|     87|	uint64_t numOutStreamsTotal = 0;
 2268|     87|	unsigned i;
 2269|       |
 2270|     87|	memset(f, 0, sizeof(*f));
 2271|       |
 2272|       |	/*
 2273|       |	 * Read NumCoders.
 2274|       |	 */
 2275|     87|	if (parse_7zip_uint64(a, &(f->numCoders)) < 0)
  ------------------
  |  Branch (2275:6): [True: 0, False: 87]
  ------------------
 2276|      0|		return (-1);
 2277|     87|	if (f->numCoders > 4)
  ------------------
  |  Branch (2277:6): [True: 0, False: 87]
  ------------------
 2278|       |		/* Too many coders. */
 2279|      0|		return (-1);
 2280|       |
 2281|     87|	f->coders = calloc((size_t)f->numCoders, sizeof(*f->coders));
 2282|     87|	if (f->coders == NULL)
  ------------------
  |  Branch (2282:6): [True: 0, False: 87]
  ------------------
 2283|      0|		return (-1);
 2284|    175|	for (i = 0; i< f->numCoders; i++) {
  ------------------
  |  Branch (2284:14): [True: 89, False: 86]
  ------------------
 2285|     89|		size_t codec_size;
 2286|     89|		int simple, attr;
 2287|       |
 2288|     89|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2288:7): [True: 0, False: 89]
  ------------------
 2289|      0|			return (-1);
 2290|       |		/*
 2291|       |		 * 0:3 CodecIdSize
 2292|       |		 * 4:  0 - IsSimple
 2293|       |		 *     1 - Is not Simple
 2294|       |		 * 5:  0 - No Attributes
 2295|       |		 *     1 - There are Attributes;
 2296|       |		 * 7:  Must be zero.
 2297|       |		 */
 2298|     89|		codec_size = *p & 0xf;
 2299|     89|		simple = (*p & 0x10)?0:1;
  ------------------
  |  Branch (2299:12): [True: 5, False: 84]
  ------------------
 2300|     89|		attr = *p & 0x20;
 2301|     89|		if (*p & 0x80)
  ------------------
  |  Branch (2301:7): [True: 0, False: 89]
  ------------------
 2302|      0|			return (-1);/* Not supported. */
 2303|       |
 2304|       |		/*
 2305|       |		 * Read Decompression Method IDs.
 2306|       |		 */
 2307|     89|		if ((p = header_bytes(a, codec_size)) == NULL)
  ------------------
  |  Branch (2307:7): [True: 0, False: 89]
  ------------------
 2308|      0|			return (-1);
 2309|       |
 2310|     89|		if (decode_codec_id(p, codec_size, &f->coders[i].codec) < 0)
  ------------------
  |  Branch (2310:7): [True: 0, False: 89]
  ------------------
 2311|      0|			return (-1);
 2312|       |
 2313|     89|		if (simple) {
  ------------------
  |  Branch (2313:7): [True: 84, False: 5]
  ------------------
 2314|     84|			f->coders[i].numInStreams = 1;
 2315|     84|			f->coders[i].numOutStreams = 1;
 2316|     84|		} else {
 2317|      5|			if (parse_7zip_uint64(
  ------------------
  |  Branch (2317:8): [True: 0, False: 5]
  ------------------
 2318|      5|			    a, &(f->coders[i].numInStreams)) < 0)
 2319|      0|				return (-1);
 2320|      5|			if (UMAX_ENTRY < f->coders[i].numInStreams)
  ------------------
  |  |  398|      5|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|      5|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2320:8): [True: 0, False: 5]
  ------------------
 2321|      0|				return (-1);
 2322|      5|			if (parse_7zip_uint64(
  ------------------
  |  Branch (2322:8): [True: 0, False: 5]
  ------------------
 2323|      5|			    a, &(f->coders[i].numOutStreams)) < 0)
 2324|      0|				return (-1);
 2325|      5|			if (UMAX_ENTRY < f->coders[i].numOutStreams)
  ------------------
  |  |  398|      5|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|      5|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2325:8): [True: 1, False: 4]
  ------------------
 2326|      1|				return (-1);
 2327|      5|		}
 2328|       |
 2329|     88|		if (attr) {
  ------------------
  |  Branch (2329:7): [True: 85, False: 3]
  ------------------
 2330|     85|			if (parse_7zip_uint64(
  ------------------
  |  Branch (2330:8): [True: 0, False: 85]
  ------------------
 2331|     85|			    a, &(f->coders[i].propertiesSize)) < 0)
 2332|      0|				return (-1);
 2333|     85|			if (UMAX_ENTRY < f->coders[i].propertiesSize)
  ------------------
  |  |  398|     85|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|     85|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2333:8): [True: 0, False: 85]
  ------------------
 2334|      0|				return (-1);
 2335|     85|			if ((p = header_bytes(
  ------------------
  |  Branch (2335:8): [True: 0, False: 85]
  ------------------
 2336|     85|			    a, (size_t)f->coders[i].propertiesSize)) == NULL)
 2337|      0|				return (-1);
 2338|     85|			f->coders[i].properties =
 2339|     85|			    malloc((size_t)f->coders[i].propertiesSize);
 2340|     85|			if (f->coders[i].properties == NULL)
  ------------------
  |  Branch (2340:8): [True: 0, False: 85]
  ------------------
 2341|      0|				return (-1);
 2342|     85|			memcpy(f->coders[i].properties, p,
 2343|     85|			    (size_t)f->coders[i].propertiesSize);
 2344|     85|		}
 2345|       |
 2346|     88|		numInStreamsTotal += f->coders[i].numInStreams;
 2347|     88|		numOutStreamsTotal += f->coders[i].numOutStreams;
 2348|     88|	}
 2349|       |
 2350|     86|	if (numOutStreamsTotal == 0 ||
  ------------------
  |  Branch (2350:6): [True: 0, False: 86]
  ------------------
 2351|     86|	    numInStreamsTotal < numOutStreamsTotal-1)
  ------------------
  |  Branch (2351:6): [True: 0, False: 86]
  ------------------
 2352|      0|		return (-1);
 2353|       |
 2354|     86|	f->numBindPairs = numOutStreamsTotal - 1;
 2355|     86|	if (zip->header_bytes_remaining < f->numBindPairs)
  ------------------
  |  Branch (2355:6): [True: 0, False: 86]
  ------------------
 2356|      0|			return (-1);
 2357|     86|	if (f->numBindPairs > 0) {
  ------------------
  |  Branch (2357:6): [True: 4, False: 82]
  ------------------
 2358|      4|		f->bindPairs =
 2359|      4|			calloc((size_t)f->numBindPairs, sizeof(*f->bindPairs));
 2360|      4|		if (f->bindPairs == NULL)
  ------------------
  |  Branch (2360:7): [True: 0, False: 4]
  ------------------
 2361|      0|			return (-1);
 2362|      4|	} else
 2363|     82|		f->bindPairs = NULL;
 2364|    147|	for (i = 0; i < f->numBindPairs; i++) {
  ------------------
  |  Branch (2364:14): [True: 64, False: 83]
  ------------------
 2365|     64|		if (parse_7zip_uint64(a, &(f->bindPairs[i].inIndex)) < 0)
  ------------------
  |  Branch (2365:7): [True: 0, False: 64]
  ------------------
 2366|      0|			return (-1);
 2367|     64|		if (UMAX_ENTRY < f->bindPairs[i].inIndex)
  ------------------
  |  |  398|     64|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|     64|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2367:7): [True: 2, False: 62]
  ------------------
 2368|      2|			return (-1);
 2369|     62|		if (parse_7zip_uint64(a, &(f->bindPairs[i].outIndex)) < 0)
  ------------------
  |  Branch (2369:7): [True: 0, False: 62]
  ------------------
 2370|      0|			return (-1);
 2371|     62|		if (UMAX_ENTRY < f->bindPairs[i].outIndex)
  ------------------
  |  |  398|     62|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|     62|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2371:7): [True: 1, False: 61]
  ------------------
 2372|      1|			return (-1);
 2373|     62|	}
 2374|       |
 2375|     83|	f->numPackedStreams = numInStreamsTotal - f->numBindPairs;
 2376|     83|	f->packedStreams =
 2377|     83|	    calloc((size_t)f->numPackedStreams, sizeof(*f->packedStreams));
 2378|     83|	if (f->packedStreams == NULL)
  ------------------
  |  Branch (2378:6): [True: 0, False: 83]
  ------------------
 2379|      0|		return (-1);
 2380|     83|	if (f->numPackedStreams == 1) {
  ------------------
  |  Branch (2380:6): [True: 82, False: 1]
  ------------------
 2381|     82|		for (i = 0; i < numInStreamsTotal; i++) {
  ------------------
  |  Branch (2381:15): [True: 82, False: 0]
  ------------------
 2382|     82|			unsigned j;
 2383|     82|			for (j = 0; j < f->numBindPairs; j++) {
  ------------------
  |  Branch (2383:16): [True: 0, False: 82]
  ------------------
 2384|      0|				if (f->bindPairs[j].inIndex == i)
  ------------------
  |  Branch (2384:9): [True: 0, False: 0]
  ------------------
 2385|      0|					break;
 2386|      0|			}
 2387|     82|			if (j == f->numBindPairs)
  ------------------
  |  Branch (2387:8): [True: 82, False: 0]
  ------------------
 2388|     82|				break;
 2389|     82|		}
 2390|     82|		if (i == numInStreamsTotal)
  ------------------
  |  Branch (2390:7): [True: 0, False: 82]
  ------------------
 2391|      0|			return (-1);
 2392|     82|		f->packedStreams[0] = i;
 2393|     82|	} else {
 2394|  2.71k|		for (i = 0; i < f->numPackedStreams; i++) {
  ------------------
  |  Branch (2394:15): [True: 2.71k, False: 0]
  ------------------
 2395|  2.71k|			if (parse_7zip_uint64(a, &(f->packedStreams[i])) < 0)
  ------------------
  |  Branch (2395:8): [True: 1, False: 2.71k]
  ------------------
 2396|      1|				return (-1);
 2397|  2.71k|			if (UMAX_ENTRY < f->packedStreams[i])
  ------------------
  |  |  398|  2.71k|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|  2.71k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (2397:8): [True: 0, False: 2.71k]
  ------------------
 2398|      0|				return (-1);
 2399|  2.71k|		}
 2400|      1|	}
 2401|     82|	f->numInStreams = numInStreamsTotal;
 2402|     82|	f->numOutStreams = numOutStreamsTotal;
 2403|       |
 2404|     82|	return (0);
 2405|     83|}
archive_read_support_format_7zip.c:decode_codec_id:
 1314|     89|{
 1315|     89|	unsigned i;
 1316|     89|	uint64_t v = 0;
 1317|       |
 1318|    323|	for (i = 0; i < id_size; i++) {
  ------------------
  |  Branch (1318:14): [True: 234, False: 89]
  ------------------
 1319|    234|		if (v > (uint64_t)INT64_MAX / 256)
  ------------------
  |  Branch (1319:7): [True: 0, False: 234]
  ------------------
 1320|      0|			return (-1);
 1321|    234|		v <<= 8;
 1322|    234|		v += codecId[i];
 1323|    234|	}
 1324|     89|	*id = v;
 1325|     89|	return (0);
 1326|     89|}
archive_read_support_format_7zip.c:free_Digest:
 2117|  2.61k|{
 2118|  2.61k|	free(d->defineds);
 2119|  2.61k|	free(d->digests);
 2120|  2.61k|}
archive_read_support_format_7zip.c:read_SubStreamsInfo:
 2553|     18|{
 2554|     18|	const unsigned char *p;
 2555|     18|	uint64_t *usizes;
 2556|     18|	size_t unpack_streams;
 2557|     18|	int type;
 2558|     18|	unsigned i;
 2559|     18|	uint32_t numDigests;
 2560|       |
 2561|     18|	memset(ss, 0, sizeof(*ss));
 2562|       |
 2563|     36|	for (i = 0; i < numFolders; i++)
  ------------------
  |  Branch (2563:14): [True: 18, False: 18]
  ------------------
 2564|     18|		f[i].numUnpackStreams = 1;
 2565|       |
 2566|     18|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2566:6): [True: 0, False: 18]
  ------------------
 2567|      0|		return (-1);
 2568|     18|	type = *p;
 2569|       |
 2570|     18|	if (type == kNumUnPackStream) {
  ------------------
  |  |  134|     18|#define kNumUnPackStream	0x0D
  ------------------
  |  Branch (2570:6): [True: 7, False: 11]
  ------------------
 2571|      7|		unpack_streams = 0;
 2572|     14|		for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2572:15): [True: 7, False: 7]
  ------------------
 2573|      7|			if (parse_7zip_uint64(a, &(f[i].numUnpackStreams)) < 0)
  ------------------
  |  Branch (2573:8): [True: 0, False: 7]
  ------------------
 2574|      0|				return (-1);
 2575|      7|			if (f[i].numUnpackStreams >
  ------------------
  |  Branch (2575:8): [True: 0, False: 7]
  ------------------
 2576|      7|			    UMAX_ENTRY - unpack_streams) {
  ------------------
  |  |  398|      7|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|      7|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
 2577|      0|				return (-1);
 2578|      0|			}
 2579|      7|			unpack_streams += (size_t)f[i].numUnpackStreams;
 2580|      7|		}
 2581|      7|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2581:7): [True: 0, False: 7]
  ------------------
 2582|      0|			return (-1);
 2583|      7|		type = *p;
 2584|      7|	} else
 2585|     11|		unpack_streams = numFolders;
 2586|       |
 2587|     18|	if (type != kSize) {
  ------------------
  |  |  130|     18|#define kSize			0x09
  ------------------
  |  Branch (2587:6): [True: 12, False: 6]
  ------------------
 2588|     23|		for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2588:15): [True: 12, False: 11]
  ------------------
 2589|     12|			if (f[i].numUnpackStreams > 1)
  ------------------
  |  Branch (2589:8): [True: 1, False: 11]
  ------------------
 2590|      1|				return (-1);
 2591|     12|		}
 2592|     12|	}
 2593|       |
 2594|     17|	ss->unpack_streams = unpack_streams;
 2595|     17|	if (unpack_streams) {
  ------------------
  |  Branch (2595:6): [True: 17, False: 0]
  ------------------
 2596|     17|		ss->unpackSizes = calloc(unpack_streams,
 2597|     17|		    sizeof(*ss->unpackSizes));
 2598|     17|		ss->digestsDefined = calloc(unpack_streams,
 2599|     17|		    sizeof(*ss->digestsDefined));
 2600|     17|		ss->digests = calloc(unpack_streams,
 2601|     17|		    sizeof(*ss->digests));
 2602|     17|		if (ss->unpackSizes == NULL || ss->digestsDefined == NULL ||
  ------------------
  |  Branch (2602:7): [True: 0, False: 17]
  |  Branch (2602:34): [True: 0, False: 17]
  ------------------
 2603|     17|		    ss->digests == NULL)
  ------------------
  |  Branch (2603:7): [True: 0, False: 17]
  ------------------
 2604|      0|			return (-1);
 2605|     17|	}
 2606|       |
 2607|     17|	usizes = ss->unpackSizes;
 2608|     28|	for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2608:14): [True: 17, False: 11]
  ------------------
 2609|     17|		unsigned pack;
 2610|     17|		uint64_t size, sum;
 2611|       |
 2612|     17|		if (f[i].numUnpackStreams == 0)
  ------------------
  |  Branch (2612:7): [True: 0, False: 17]
  ------------------
 2613|      0|			continue;
 2614|       |
 2615|     17|		sum = 0;
 2616|     17|		if (type == kSize) {
  ------------------
  |  |  130|     17|#define kSize			0x09
  ------------------
  |  Branch (2616:7): [True: 6, False: 11]
  ------------------
 2617|  22.8k|			for (pack = 1; pack < f[i].numUnpackStreams; pack++) {
  ------------------
  |  Branch (2617:19): [True: 22.8k, False: 1]
  ------------------
 2618|  22.8k|				if (parse_7zip_uint64(a, usizes) < 0)
  ------------------
  |  Branch (2618:9): [True: 3, False: 22.8k]
  ------------------
 2619|      3|					return (-1);
 2620|  22.8k|				if (*usizes > UINT64_MAX - sum)
  ------------------
  |  Branch (2620:9): [True: 2, False: 22.8k]
  ------------------
 2621|      2|					return (-1);
 2622|  22.8k|				sum += *usizes++;
 2623|  22.8k|			}
 2624|      6|		}
 2625|     12|		size = folder_uncompressed_size(&f[i]);
 2626|     12|		if (size < sum)
  ------------------
  |  Branch (2626:7): [True: 1, False: 11]
  ------------------
 2627|      1|			return (-1);
 2628|     11|		*usizes++ = size - sum;
 2629|     11|	}
 2630|       |
 2631|     11|	if (type == kSize) {
  ------------------
  |  |  130|     11|#define kSize			0x09
  ------------------
  |  Branch (2631:6): [True: 0, False: 11]
  ------------------
 2632|      0|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2632:7): [True: 0, False: 0]
  ------------------
 2633|      0|			return (-1);
 2634|      0|		type = *p;
 2635|      0|	}
 2636|       |
 2637|     11|	numDigests = 0;
 2638|     22|	for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2638:14): [True: 11, False: 11]
  ------------------
 2639|     11|		if (f[i].numUnpackStreams != 1 || !f[i].digest_defined)
  ------------------
  |  Branch (2639:7): [True: 0, False: 11]
  |  Branch (2639:37): [True: 11, False: 0]
  ------------------
 2640|     11|			numDigests += (uint32_t)f[i].numUnpackStreams;
 2641|     11|	}
 2642|       |
 2643|     11|	if (type == kCRC) {
  ------------------
  |  |  131|     11|#define kCRC			0x0A
  ------------------
  |  Branch (2643:6): [True: 11, False: 0]
  ------------------
 2644|     11|		struct _7z_digests tmpDigests;
 2645|     11|		unsigned char *digestsDefined = ss->digestsDefined;
 2646|     11|		uint32_t * digests = ss->digests;
 2647|     11|		int di = 0;
 2648|       |
 2649|     11|		memset(&tmpDigests, 0, sizeof(tmpDigests));
 2650|     11|		if (read_Digests(a, &(tmpDigests), numDigests) < 0) {
  ------------------
  |  Branch (2650:7): [True: 0, False: 11]
  ------------------
 2651|      0|			free_Digest(&tmpDigests);
 2652|      0|			return (-1);
 2653|      0|		}
 2654|     22|		for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2654:15): [True: 11, False: 11]
  ------------------
 2655|     11|			if (f[i].numUnpackStreams == 1 && f[i].digest_defined) {
  ------------------
  |  Branch (2655:8): [True: 11, False: 0]
  |  Branch (2655:38): [True: 0, False: 11]
  ------------------
 2656|      0|				*digestsDefined++ = 1;
 2657|      0|				*digests++ = f[i].digest;
 2658|     11|			} else {
 2659|     11|				unsigned j;
 2660|       |
 2661|     22|				for (j = 0; j < f[i].numUnpackStreams;
  ------------------
  |  Branch (2661:17): [True: 11, False: 11]
  ------------------
 2662|     11|				    j++, di++) {
 2663|     11|					*digestsDefined++ =
 2664|     11|					    tmpDigests.defineds[di];
 2665|     11|					*digests++ =
 2666|     11|					    tmpDigests.digests[di];
 2667|     11|				}
 2668|     11|			}
 2669|     11|		}
 2670|     11|		free_Digest(&tmpDigests);
 2671|     11|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2671:7): [True: 0, False: 11]
  ------------------
 2672|      0|			return (-1);
 2673|     11|		type = *p;
 2674|     11|	}
 2675|       |
 2676|       |	/*
 2677|       |	 *  Must be kEnd.
 2678|       |	 */
 2679|     11|	if (type != kEnd)
  ------------------
  |  |  121|     11|#define kEnd			0x00
  ------------------
  |  Branch (2679:6): [True: 0, False: 11]
  ------------------
 2680|      0|		return (-1);
 2681|     11|	return (0);
 2682|     11|}
archive_read_support_format_7zip.c:folder_uncompressed_size:
 2526|     84|{
 2527|     84|	int n = (int)f->numOutStreams;
 2528|     84|	unsigned pairs = (unsigned)f->numBindPairs;
 2529|       |
 2530|     84|	while (--n >= 0) {
  ------------------
  |  Branch (2530:9): [True: 84, False: 0]
  ------------------
 2531|     84|		unsigned i;
 2532|     84|		for (i = 0; i < pairs; i++) {
  ------------------
  |  Branch (2532:15): [True: 0, False: 84]
  ------------------
 2533|      0|			if (f->bindPairs[i].outIndex == (uint64_t)n)
  ------------------
  |  Branch (2533:8): [True: 0, False: 0]
  ------------------
 2534|      0|				break;
 2535|      0|		}
 2536|     84|		if (i >= pairs)
  ------------------
  |  Branch (2536:7): [True: 84, False: 0]
  ------------------
 2537|     84|			return (f->unPackSize[n]);
 2538|     84|	}
 2539|      0|	return (0);
 2540|     84|}
archive_read_support_format_7zip.c:read_consume:
 1250|  67.0k|{
 1251|  67.0k|	struct _7zip *zip = (struct _7zip *)a->format->data;
 1252|       |
 1253|  67.0k|	if (zip->pack_stream_bytes_unconsumed) {
  ------------------
  |  Branch (1253:6): [True: 67.0k, False: 0]
  ------------------
 1254|  67.0k|		__archive_read_consume(a, zip->pack_stream_bytes_unconsumed);
 1255|  67.0k|		zip->stream_offset += zip->pack_stream_bytes_unconsumed;
 1256|  67.0k|		zip->pack_stream_bytes_unconsumed = 0;
 1257|  67.0k|	}
 1258|  67.0k|}
archive_read_support_format_7zip.c:setup_decode_folder:
 3784|     72|{
 3785|     72|	struct _7zip *zip = (struct _7zip *)a->format->data;
 3786|     72|	const struct _7z_coder *coder1, *coder2;
 3787|     72|	const char *cname = (header)?"archive header":"file content";
  ------------------
  |  Branch (3787:22): [True: 64, False: 8]
  ------------------
 3788|     72|	unsigned i;
 3789|     72|	int r, found_bcj2 = 0;
 3790|       |
 3791|       |	/*
 3792|       |	 * Release the memory which the previous folder used for BCJ2.
 3793|       |	 */
 3794|    288|	for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (3794:14): [True: 216, False: 72]
  ------------------
 3795|    216|		free(zip->sub_stream_buff[i]);
 3796|    216|		zip->sub_stream_buff[i] = NULL;
 3797|    216|	}
 3798|       |
 3799|       |	/*
 3800|       |	 * Check coder types before modifying any stream-reader state, so that
 3801|       |	 * an early return leaves zip unchanged (avoids partially-initialized
 3802|       |	 * state that callers would have to reason about).
 3803|       |	 */
 3804|    144|	for (i = 0; i < folder->numCoders; i++) {
  ------------------
  |  Branch (3804:14): [True: 72, False: 72]
  ------------------
 3805|     72|		switch(folder->coders[i].codec) {
  ------------------
  |  Branch (3805:10): [True: 0, False: 72]
  ------------------
 3806|      0|			case _7Z_CRYPTO_MAIN_ZIP:
  ------------------
  |  |  101|      0|#define _7Z_CRYPTO_MAIN_ZIP			0x06F10101 /* Main Zip crypto algo */
  ------------------
  |  Branch (3806:4): [True: 0, False: 72]
  ------------------
 3807|      0|			case _7Z_CRYPTO_RAR_29:
  ------------------
  |  |  102|      0|#define _7Z_CRYPTO_RAR_29			0x06F10303 /* Rar29 AES-128 + (modified SHA-1) */
  ------------------
  |  Branch (3807:4): [True: 0, False: 72]
  ------------------
 3808|      0|			case _7Z_CRYPTO_AES_256_SHA_256: {
  ------------------
  |  |  103|      0|#define _7Z_CRYPTO_AES_256_SHA_256	0x06F10701 /* AES-256 + SHA-256 */
  ------------------
  |  Branch (3808:4): [True: 0, False: 72]
  ------------------
 3809|       |				/* For entry that is associated with this folder, mark
 3810|       |				   it as encrypted (data+metadata). */
 3811|      0|				zip->has_encrypted_entries = 1;
 3812|      0|				if (a->entry) {
  ------------------
  |  Branch (3812:9): [True: 0, False: 0]
  ------------------
 3813|      0|					archive_entry_set_is_data_encrypted(a->entry, 1);
 3814|      0|					archive_entry_set_is_metadata_encrypted(a->entry, 1);
 3815|      0|				}
 3816|      0|				archive_set_error(&(a->archive),
 3817|      0|					ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3818|      0|					"The %s is encrypted, "
 3819|      0|					"but currently not supported", cname);
 3820|      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 (3820:13): [True: 0, False: 0]
  ------------------
 3821|      0|			}
 3822|      0|			case _7Z_X86_BCJ2: {
  ------------------
  |  |  107|      0|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (3822:4): [True: 0, False: 72]
  ------------------
 3823|      0|				found_bcj2++;
 3824|      0|				break;
 3825|      0|			}
 3826|     72|		}
 3827|     72|	}
 3828|       |	/* Now that we've checked for encryption, if there were still no
 3829|       |	 * encrypted entries found we can say for sure that there are none.
 3830|       |	 */
 3831|     72|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|     72|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (3831:6): [True: 0, False: 72]
  ------------------
 3832|      0|		zip->has_encrypted_entries = 0;
 3833|      0|	}
 3834|       |
 3835|     72|	if ((folder->numCoders > 2 && !found_bcj2) || found_bcj2 > 1) {
  ------------------
  |  Branch (3835:7): [True: 0, False: 72]
  |  Branch (3835:32): [True: 0, False: 0]
  |  Branch (3835:48): [True: 0, False: 72]
  ------------------
 3836|      0|		archive_set_error(&(a->archive),
 3837|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3838|      0|		    "The %s is encoded with many filters, "
 3839|      0|		    "but currently not supported", cname);
 3840|      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 (3840:11): [True: 0, False: 0]
  ------------------
 3841|      0|	}
 3842|       |
 3843|       |	/*
 3844|       |	 * Initialize a stream reader.
 3845|       |	 */
 3846|     72|	zip->pack_stream_remaining = (unsigned)folder->numPackedStreams;
 3847|     72|	zip->pack_stream_index = (unsigned)folder->packIndex;
 3848|     72|	zip->folder_outbytes_remaining = folder_uncompressed_size(folder);
 3849|     72|	zip->uncompressed_buffer_bytes_remaining = 0;
 3850|     72|	coder1 = &(folder->coders[0]);
 3851|     72|	if (folder->numCoders == 2)
  ------------------
  |  Branch (3851:6): [True: 0, False: 72]
  ------------------
 3852|      0|		coder2 = &(folder->coders[1]);
 3853|     72|	else
 3854|     72|		coder2 = NULL;
 3855|       |
 3856|     72|	if (found_bcj2) {
  ------------------
  |  Branch (3856:6): [True: 0, False: 72]
  ------------------
 3857|       |		/*
 3858|       |		 * Preparation to decode BCJ2.
 3859|       |		 * Decoding BCJ2 requires four sources. Those are at least,
 3860|       |		 * as far as I know, two types of the storage form.
 3861|       |		 */
 3862|      0|		const struct _7z_coder *fc = folder->coders;
 3863|      0|		static const struct _7z_coder coder_copy = {0, 1, 1, 0, NULL};
 3864|      0|		const struct _7z_coder *scoder[3] =
 3865|      0|			{&coder_copy, &coder_copy, &coder_copy};
 3866|      0|		const void *buff;
 3867|      0|		ssize_t bytes;
 3868|      0|		unsigned char *b[3] = {NULL, NULL, NULL};
 3869|      0|		uint64_t sunpack[3] ={-1, -1, -1};
 3870|      0|		uint64_t remaining;
 3871|      0|		size_t s[3] = {0, 0, 0};
 3872|      0|		int idx[3] = {0, 1, 2};
 3873|       |
 3874|      0|		if (folder->numCoders == 4 && fc[3].codec == _7Z_X86_BCJ2 &&
  ------------------
  |  |  107|      0|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (3874:7): [True: 0, False: 0]
  |  Branch (3874:33): [True: 0, False: 0]
  ------------------
 3875|      0|		    folder->numInStreams == 7 && folder->numOutStreams == 4 &&
  ------------------
  |  Branch (3875:7): [True: 0, False: 0]
  |  Branch (3875:36): [True: 0, False: 0]
  ------------------
 3876|      0|		    zip->pack_stream_remaining == 4) {
  ------------------
  |  Branch (3876:7): [True: 0, False: 0]
  ------------------
 3877|       |			/* Source type 1 made by 7zr or 7z with -m options. */
 3878|      0|			if (folder->bindPairs[0].inIndex == 5) {
  ------------------
  |  Branch (3878:8): [True: 0, False: 0]
  ------------------
 3879|       |				/* The form made by 7zr */
 3880|      0|				idx[0] = 1; idx[1] = 2; idx[2] = 0;
 3881|      0|				scoder[1] = &(fc[1]);
 3882|      0|				scoder[2] = &(fc[0]);
 3883|      0|				sunpack[1] = folder->unPackSize[1];
 3884|      0|				sunpack[2] = folder->unPackSize[0];
 3885|      0|				coder1 = &(fc[2]);
 3886|      0|			} else {
 3887|       |				/*
 3888|       |				 * NOTE: Some patterns do not work.
 3889|       |				 * work:
 3890|       |				 *  7z a -m0=BCJ2 -m1=COPY -m2=COPY
 3891|       |				 *       -m3=(any)
 3892|       |				 *  7z a -m0=BCJ2 -m1=COPY -m2=(any)
 3893|       |				 *       -m3=COPY
 3894|       |				 *  7z a -m0=BCJ2 -m1=(any) -m2=COPY
 3895|       |				 *       -m3=COPY
 3896|       |				 * not work:
 3897|       |				 *  other patterns.
 3898|       |				 *
 3899|       |				 * We have to handle this like `pipe' or
 3900|       |				 * our libarchive7s filter frame work,
 3901|       |				 * decoding the BCJ2 main stream sequentially,
 3902|       |				 * m3 -> m2 -> m1 -> BCJ2.
 3903|       |				 *
 3904|       |				 */
 3905|      0|				if (fc[0].codec == _7Z_COPY &&
  ------------------
  |  |   94|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3905:9): [True: 0, False: 0]
  ------------------
 3906|      0|				    fc[1].codec == _7Z_COPY)
  ------------------
  |  |   94|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3906:9): [True: 0, False: 0]
  ------------------
 3907|      0|					coder1 = &(folder->coders[2]);
 3908|      0|				else if (fc[0].codec == _7Z_COPY &&
  ------------------
  |  |   94|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3908:14): [True: 0, False: 0]
  ------------------
 3909|      0|				    fc[2].codec == _7Z_COPY)
  ------------------
  |  |   94|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3909:9): [True: 0, False: 0]
  ------------------
 3910|      0|					coder1 = &(folder->coders[1]);
 3911|      0|				else if (fc[1].codec == _7Z_COPY &&
  ------------------
  |  |   94|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3911:14): [True: 0, False: 0]
  ------------------
 3912|      0|				    fc[2].codec == _7Z_COPY)
  ------------------
  |  |   94|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3912:9): [True: 0, False: 0]
  ------------------
 3913|      0|					coder1 = &(folder->coders[0]);
 3914|      0|				else {
 3915|      0|					archive_set_error(&(a->archive),
 3916|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3917|      0|					    "Unsupported form of "
 3918|      0|					    "BCJ2 streams");
 3919|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3920|      0|				}
 3921|      0|			}
 3922|      0|			coder2 = &(fc[3]);
 3923|      0|			zip->main_stream_bytes_remaining =
 3924|      0|				(size_t)folder->unPackSize[2];
 3925|      0|			remaining = folder->unPackSize[2];
 3926|      0|		} else if (coder2 != NULL && coder2->codec == _7Z_X86_BCJ2 &&
  ------------------
  |  |  107|      0|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (3926:14): [True: 0, False: 0]
  |  Branch (3926:32): [True: 0, False: 0]
  ------------------
 3927|      0|		    zip->pack_stream_remaining == 4 &&
  ------------------
  |  Branch (3927:7): [True: 0, False: 0]
  ------------------
 3928|      0|		    folder->numInStreams == 5 && folder->numOutStreams == 2) {
  ------------------
  |  Branch (3928:7): [True: 0, False: 0]
  |  Branch (3928:36): [True: 0, False: 0]
  ------------------
 3929|       |			/* Source type 0 made by 7z */
 3930|      0|			zip->main_stream_bytes_remaining =
 3931|      0|				(size_t)folder->unPackSize[0];
 3932|      0|			remaining = folder->unPackSize[0];
 3933|      0|		} else {
 3934|       |			/* We got an unexpected form. */
 3935|      0|			archive_set_error(&(a->archive),
 3936|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3937|      0|			    "Unsupported form of BCJ2 streams");
 3938|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3939|      0|		}
 3940|      0|		if (remaining > SIZE_MAX) {
  ------------------
  |  Branch (3940:7): [True: 0, False: 0]
  ------------------
 3941|      0|			archive_set_error(&(a->archive),
 3942|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3943|      0|			    "7-Zip sub-stream size exceeds "
 3944|      0|			    "platform maximum");
 3945|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3946|      0|		}
 3947|      0|		zip->main_stream_bytes_remaining = remaining;
 3948|       |
 3949|       |
 3950|       |		/* Skip the main stream at this time. */
 3951|      0|		if ((r = seek_pack(a)) < 0)
  ------------------
  |  Branch (3951:7): [True: 0, False: 0]
  ------------------
 3952|      0|			return (r);
 3953|      0|		zip->pack_stream_bytes_unconsumed =
 3954|      0|		    (size_t)zip->pack_stream_inbytes_remaining;
 3955|      0|		read_consume(a);
 3956|       |
 3957|       |		/* Read following three sub streams. */
 3958|      0|		for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (3958:15): [True: 0, False: 0]
  ------------------
 3959|      0|			const struct _7z_coder *coder = scoder[i];
 3960|       |
 3961|      0|			if ((r = seek_pack(a)) < 0) {
  ------------------
  |  Branch (3961:8): [True: 0, False: 0]
  ------------------
 3962|      0|				free(b[0]); free(b[1]); free(b[2]);
 3963|      0|				return (r);
 3964|      0|			}
 3965|       |
 3966|      0|			if (sunpack[i] == (uint64_t)-1)
  ------------------
  |  Branch (3966:8): [True: 0, False: 0]
  ------------------
 3967|      0|				zip->folder_outbytes_remaining =
 3968|      0|				    zip->pack_stream_inbytes_remaining;
 3969|      0|			else
 3970|      0|				zip->folder_outbytes_remaining = sunpack[i];
 3971|       |
 3972|      0|			r = init_decompression(a, zip, coder, NULL);
 3973|      0|			if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3973:8): [True: 0, False: 0]
  ------------------
 3974|      0|				free(b[0]); free(b[1]); free(b[2]);
 3975|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3976|      0|			}
 3977|       |
 3978|       |			/* Allocate memory for the decoded data of a sub
 3979|       |			 * stream. */
 3980|      0|			if (zip->folder_outbytes_remaining > SIZE_MAX) {
  ------------------
  |  Branch (3980:8): [True: 0, False: 0]
  ------------------
 3981|      0|				free(b[0]); free(b[1]); free(b[2]);
 3982|      0|				archive_set_error(&a->archive,
 3983|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3984|      0|				    "7-Zip sub-stream size exceeds "
 3985|      0|				    "platform maximum");
 3986|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3987|      0|			}
 3988|      0|			b[i] = malloc((size_t)zip->folder_outbytes_remaining);
 3989|      0|			if (b[i] == NULL) {
  ------------------
  |  Branch (3989:8): [True: 0, False: 0]
  ------------------
 3990|      0|				free(b[0]); free(b[1]); free(b[2]);
 3991|      0|				archive_set_error(&a->archive, ENOMEM,
 3992|      0|				    "No memory for 7-Zip decompression");
 3993|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3994|      0|			}
 3995|       |
 3996|       |			/* Extract a sub stream. */
 3997|      0|			while (zip->pack_stream_inbytes_remaining > 0) {
  ------------------
  |  Branch (3997:11): [True: 0, False: 0]
  ------------------
 3998|      0|				r = (int)extract_pack_stream(a, 0);
 3999|      0|				if (r < 0) {
  ------------------
  |  Branch (3999:9): [True: 0, False: 0]
  ------------------
 4000|      0|					free(b[0]); free(b[1]); free(b[2]);
 4001|      0|					return (r);
 4002|      0|				}
 4003|      0|				bytes = get_uncompressed_data(a, &buff,
 4004|      0|				    zip->uncompressed_buffer_bytes_remaining,
 4005|      0|				    0);
 4006|      0|				if (bytes < 0) {
  ------------------
  |  Branch (4006:9): [True: 0, False: 0]
  ------------------
 4007|      0|					free(b[0]); free(b[1]); free(b[2]);
 4008|      0|					return ((int)bytes);
 4009|      0|				}
 4010|      0|				memcpy(b[i]+s[i], buff, bytes);
 4011|      0|				s[i] += bytes;
 4012|      0|				if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (4012:9): [True: 0, False: 0]
  ------------------
 4013|      0|					read_consume(a);
 4014|      0|			}
 4015|      0|		}
 4016|       |
 4017|       |		/* Set the sub streams to the right place. */
 4018|      0|		for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (4018:15): [True: 0, False: 0]
  ------------------
 4019|      0|			zip->sub_stream_buff[i] = b[idx[i]];
 4020|      0|			zip->sub_stream_size[i] = s[idx[i]];
 4021|      0|			zip->sub_stream_bytes_remaining[i] = s[idx[i]];
 4022|      0|		}
 4023|       |
 4024|       |		/* Allocate memory used for decoded main stream bytes. */
 4025|      0|		if (zip->tmp_stream_buff == NULL) {
  ------------------
  |  Branch (4025:7): [True: 0, False: 0]
  ------------------
 4026|      0|			zip->tmp_stream_buff_size = 32 * 1024;
 4027|      0|			zip->tmp_stream_buff =
 4028|      0|			    malloc(zip->tmp_stream_buff_size);
 4029|      0|			if (zip->tmp_stream_buff == NULL) {
  ------------------
  |  Branch (4029:8): [True: 0, False: 0]
  ------------------
 4030|      0|				archive_set_error(&a->archive, ENOMEM,
 4031|      0|				    "No memory for 7-Zip decompression");
 4032|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4033|      0|			}
 4034|      0|		}
 4035|      0|		zip->tmp_stream_bytes_avail = 0;
 4036|      0|		zip->tmp_stream_bytes_remaining = 0;
 4037|      0|		zip->odd_bcj_size = 0;
 4038|      0|		zip->bcj2_outPos = 0;
 4039|       |
 4040|       |		/*
 4041|       |		 * Reset a stream reader in order to read the main stream
 4042|       |		 * of BCJ2.
 4043|       |		 */
 4044|      0|		zip->pack_stream_remaining = 1;
 4045|      0|		zip->pack_stream_index = (unsigned)folder->packIndex;
 4046|      0|		zip->folder_outbytes_remaining =
 4047|      0|		    folder_uncompressed_size(folder);
 4048|      0|		zip->uncompressed_buffer_bytes_remaining = 0;
 4049|      0|	}
 4050|       |
 4051|       |	/*
 4052|       |	 * Initialize the decompressor for the new folder's pack streams.
 4053|       |	 */
 4054|     72|	r = init_decompression(a, zip, coder1, coder2);
 4055|     72|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|     72|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4055:6): [True: 0, False: 72]
  ------------------
 4056|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4057|     72|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     72|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4058|     72|}
archive_read_support_format_7zip.c:init_decompression:
 1364|     72|{
 1365|     72|	int r;
 1366|       |
 1367|     72|	zip->codec = coder1->codec;
 1368|     72|	zip->codec2 = -1;
 1369|       |
 1370|     72|	switch (zip->codec) {
 1371|      8|	case _7Z_COPY:
  ------------------
  |  |   94|      8|#define _7Z_COPY	0
  ------------------
  |  Branch (1371:2): [True: 8, False: 64]
  ------------------
 1372|      8|	case _7Z_BZ2:
  ------------------
  |  |   98|      8|#define _7Z_BZ2		0x040202
  ------------------
  |  Branch (1372:2): [True: 0, False: 72]
  ------------------
 1373|      8|	case _7Z_DEFLATE:
  ------------------
  |  |   97|      8|#define _7Z_DEFLATE	0x040108
  ------------------
  |  Branch (1373:2): [True: 0, False: 72]
  ------------------
 1374|      8|	case _7Z_ZSTD:
  ------------------
  |  |  116|      8|#define _7Z_ZSTD	0x4F71101 /* Copied from https://github.com/mcmilk/7-Zip-zstd.git */
  ------------------
  |  Branch (1374:2): [True: 0, False: 72]
  ------------------
 1375|     72|	case _7Z_PPMD:
  ------------------
  |  |   99|     72|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (1375:2): [True: 64, False: 8]
  ------------------
 1376|     72|		if (coder2 != NULL) {
  ------------------
  |  Branch (1376:7): [True: 0, False: 72]
  ------------------
 1377|      0|			if (coder2->codec != _7Z_X86 &&
  ------------------
  |  |  106|      0|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1377:8): [True: 0, False: 0]
  ------------------
 1378|      0|			    coder2->codec != _7Z_X86_BCJ2 &&
  ------------------
  |  |  107|      0|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1378:8): [True: 0, False: 0]
  ------------------
 1379|      0|			    coder2->codec != _7Z_ARM &&
  ------------------
  |  |  110|      0|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1379:8): [True: 0, False: 0]
  ------------------
 1380|      0|			    coder2->codec != _7Z_ARM64 &&
  ------------------
  |  |  112|      0|#define _7Z_ARM64	0xa
  ------------------
  |  Branch (1380:8): [True: 0, False: 0]
  ------------------
 1381|      0|			    coder2->codec != _7Z_POWERPC &&
  ------------------
  |  |  108|      0|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1381:8): [True: 0, False: 0]
  ------------------
 1382|      0|			    coder2->codec != _7Z_SPARC) {
  ------------------
  |  |  114|      0|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1382:8): [True: 0, False: 0]
  ------------------
 1383|      0|				archive_set_error(&a->archive,
 1384|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1385|      0|				    "Unsupported filter %jx for %jx",
 1386|      0|				    (uintmax_t)coder2->codec,
 1387|      0|				    (uintmax_t)coder1->codec);
 1388|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1389|      0|			}
 1390|      0|			zip->codec2 = coder2->codec;
 1391|      0|			zip->bcj_state = 0;
 1392|      0|			if (coder2->codec == _7Z_X86)
  ------------------
  |  |  106|      0|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1392:8): [True: 0, False: 0]
  ------------------
 1393|      0|				x86_Init(zip);
 1394|      0|			else if (coder2->codec == _7Z_ARM)
  ------------------
  |  |  110|      0|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1394:13): [True: 0, False: 0]
  ------------------
 1395|      0|				arm_Init(zip);
 1396|      0|		}
 1397|     72|		break;
 1398|     72|	default:
  ------------------
  |  Branch (1398:2): [True: 0, False: 72]
  ------------------
 1399|      0|		break;
 1400|     72|	}
 1401|       |
 1402|     72|	switch (zip->codec) {
 1403|      8|	case _7Z_COPY:
  ------------------
  |  |   94|      8|#define _7Z_COPY	0
  ------------------
  |  Branch (1403:2): [True: 8, False: 64]
  ------------------
 1404|      8|		break;
 1405|       |
 1406|      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 (1406:2): [True: 0, False: 72]
  |  Branch (1406:17): [True: 0, False: 72]
  ------------------
 1407|      0|#ifdef HAVE_LZMA_H
 1408|      0|#if LZMA_VERSION_MAJOR >= 5
 1409|       |/* Effectively disable the limiter. */
 1410|      0|#define LZMA_MEMLIMIT   UINT64_MAX
 1411|       |#else
 1412|       |/* NOTE: This needs to check memory size which running system has. */
 1413|       |#define LZMA_MEMLIMIT   (1U << 30)
 1414|       |#endif
 1415|      0|	{
 1416|      0|		lzma_options_delta delta_opt;
 1417|      0|		lzma_filter filters[LZMA_FILTERS_MAX], *ff;
 1418|      0|		int fi = 0;
 1419|       |
 1420|      0|		if (zip->lzstream_valid) {
  ------------------
  |  Branch (1420:7): [True: 0, False: 0]
  ------------------
 1421|      0|			lzma_end(&(zip->lzstream));
 1422|      0|			zip->lzstream_valid = 0;
 1423|      0|		}
 1424|       |
 1425|       |		/*
 1426|       |		 * NOTE: liblzma incompletely handle the BCJ+LZMA compressed
 1427|       |		 * data made by 7-Zip because 7-Zip does not add End-Of-
 1428|       |		 * Payload Marker(EOPM) at the end of LZMA compressed data,
 1429|       |		 * and so liblzma cannot know the end of the compressed data
 1430|       |		 * without EOPM. So consequently liblzma will not return last
 1431|       |		 * three or four bytes of uncompressed data because
 1432|       |		 * LZMA_FILTER_X86 filter does not handle input data if its
 1433|       |		 * data size is less than five bytes. If liblzma detect EOPM
 1434|       |		 * or know the uncompressed data size, liblzma will flush out
 1435|       |		 * the remaining that three or four bytes of uncompressed
 1436|       |		 * data. That is why we have to use our converting program
 1437|       |		 * for BCJ+LZMA. If we were able to tell the uncompressed
 1438|       |		 * size to liblzma when using lzma_raw_decoder() liblzma
 1439|       |		 * could correctly deal with BCJ+LZMA. But unfortunately
 1440|       |		 * there is no way to do that.
 1441|       |		 *
 1442|       |		 * Reference: https://web.archive.org/web/20240405171610/https://www.mail-archive.com/xz-devel@tukaani.org/msg00373.html
 1443|       |		 */
 1444|      0|		if (coder2 != NULL) {
  ------------------
  |  Branch (1444:7): [True: 0, False: 0]
  ------------------
 1445|      0|			zip->codec2 = coder2->codec;
 1446|       |
 1447|      0|			filters[fi].options = NULL;
 1448|      0|			switch (zip->codec2) {
 1449|      0|			case _7Z_X86:
  ------------------
  |  |  106|      0|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1449:4): [True: 0, False: 0]
  ------------------
 1450|      0|				if (zip->codec == _7Z_LZMA2) {
  ------------------
  |  |   96|      0|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1450:9): [True: 0, False: 0]
  ------------------
 1451|      0|					filters[fi].id = LZMA_FILTER_X86;
 1452|      0|					fi++;
 1453|      0|				} else
 1454|       |					/* Use our filter. */
 1455|      0|					x86_Init(zip);
 1456|      0|				break;
 1457|      0|			case _7Z_X86_BCJ2:
  ------------------
  |  |  107|      0|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1457:4): [True: 0, False: 0]
  ------------------
 1458|       |				/* Use our filter. */
 1459|      0|				zip->bcj_state = 0;
 1460|      0|				break;
 1461|      0|			case _7Z_DELTA:
  ------------------
  |  |  100|      0|#define _7Z_DELTA	0x03
  ------------------
  |  Branch (1461:4): [True: 0, False: 0]
  ------------------
 1462|      0|				if (coder2->propertiesSize != 1) {
  ------------------
  |  Branch (1462:9): [True: 0, False: 0]
  ------------------
 1463|      0|					archive_set_error(&a->archive,
 1464|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1465|      0|					    "Invalid Delta parameter");
 1466|      0|					return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1467|      0|				}
 1468|      0|				filters[fi].id = LZMA_FILTER_DELTA;
 1469|      0|				memset(&delta_opt, 0, sizeof(delta_opt));
 1470|      0|				delta_opt.type = LZMA_DELTA_TYPE_BYTE;
 1471|      0|				delta_opt.dist =
 1472|      0|				    (uint32_t)coder2->properties[0] + 1;
 1473|      0|				filters[fi].options = &delta_opt;
 1474|      0|				fi++;
 1475|      0|				break;
 1476|       |			/* Following filters have not been tested yet. */
 1477|      0|			case _7Z_POWERPC:
  ------------------
  |  |  108|      0|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1477:4): [True: 0, False: 0]
  ------------------
 1478|      0|				filters[fi].id = LZMA_FILTER_POWERPC;
 1479|      0|				fi++;
 1480|      0|				break;
 1481|      0|			case _7Z_IA64:
  ------------------
  |  |  109|      0|#define _7Z_IA64	0x03030401
  ------------------
  |  Branch (1481:4): [True: 0, False: 0]
  ------------------
 1482|      0|				filters[fi].id = LZMA_FILTER_IA64;
 1483|      0|				fi++;
 1484|      0|				break;
 1485|      0|			case _7Z_ARM:
  ------------------
  |  |  110|      0|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1485:4): [True: 0, False: 0]
  ------------------
 1486|      0|				filters[fi].id = LZMA_FILTER_ARM;
 1487|      0|				fi++;
 1488|      0|				break;
 1489|      0|			case _7Z_ARMTHUMB:
  ------------------
  |  |  111|      0|#define _7Z_ARMTHUMB	0x03030701
  ------------------
  |  Branch (1489:4): [True: 0, False: 0]
  ------------------
 1490|      0|				filters[fi].id = LZMA_FILTER_ARMTHUMB;
 1491|      0|				fi++;
 1492|      0|				break;
 1493|       |#ifdef LZMA_FILTER_ARM64
 1494|       |			case _7Z_ARM64:
 1495|       |				filters[fi].id = LZMA_FILTER_ARM64;
 1496|       |				fi++;
 1497|       |				break;
 1498|       |#endif
 1499|       |#ifdef LZMA_FILTER_RISCV
 1500|       |			case _7Z_RISCV:
 1501|       |				filters[fi].id = LZMA_FILTER_RISCV;
 1502|       |				fi++;
 1503|       |				break;
 1504|       |#endif
 1505|      0|			case _7Z_SPARC:
  ------------------
  |  |  114|      0|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1505:4): [True: 0, False: 0]
  ------------------
 1506|      0|				filters[fi].id = LZMA_FILTER_SPARC;
 1507|      0|				fi++;
 1508|      0|				break;
 1509|      0|			default:
  ------------------
  |  Branch (1509:4): [True: 0, False: 0]
  ------------------
 1510|      0|				archive_set_error(&a->archive,
 1511|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1512|      0|				    "Unexpected codec ID: %lX", zip->codec2);
 1513|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1514|      0|			}
 1515|      0|		}
 1516|       |
 1517|      0|		if (zip->codec == _7Z_LZMA2)
  ------------------
  |  |   96|      0|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1517:7): [True: 0, False: 0]
  ------------------
 1518|      0|			filters[fi].id = LZMA_FILTER_LZMA2;
 1519|      0|		else
 1520|      0|			filters[fi].id = LZMA_FILTER_LZMA1;
 1521|      0|		filters[fi].options = NULL;
 1522|      0|		ff = &filters[fi];
 1523|      0|		r = lzma_properties_decode(&filters[fi], NULL,
 1524|      0|		    coder1->properties, (size_t)coder1->propertiesSize);
 1525|      0|		if (r != LZMA_OK) {
  ------------------
  |  Branch (1525:7): [True: 0, False: 0]
  ------------------
 1526|      0|			set_error(a, r);
 1527|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1528|      0|		}
 1529|      0|		fi++;
 1530|       |
 1531|      0|		filters[fi].id = LZMA_VLI_UNKNOWN;
 1532|      0|		filters[fi].options = NULL;
 1533|      0|		r = lzma_raw_decoder(&(zip->lzstream), filters);
 1534|      0|		free(ff->options);
 1535|      0|		if (r != LZMA_OK) {
  ------------------
  |  Branch (1535:7): [True: 0, False: 0]
  ------------------
 1536|      0|			set_error(a, r);
 1537|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1538|      0|		}
 1539|      0|		zip->lzstream_valid = 1;
 1540|      0|		zip->lzstream.total_in = 0;
 1541|      0|		zip->lzstream.total_out = 0;
 1542|      0|		break;
 1543|      0|	}
 1544|       |#else
 1545|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
 1546|       |		    "LZMA codec is unsupported");
 1547|       |		return (ARCHIVE_FAILED);
 1548|       |#endif
 1549|      0|	case _7Z_BZ2:
  ------------------
  |  |   98|      0|#define _7Z_BZ2		0x040202
  ------------------
  |  Branch (1549:2): [True: 0, False: 72]
  ------------------
 1550|      0|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 1551|      0|		if (zip->bzstream_valid) {
  ------------------
  |  Branch (1551:7): [True: 0, False: 0]
  ------------------
 1552|      0|			BZ2_bzDecompressEnd(&(zip->bzstream));
 1553|      0|			zip->bzstream_valid = 0;
 1554|      0|		}
 1555|      0|		r = BZ2_bzDecompressInit(&(zip->bzstream), 0, 0);
 1556|      0|		if (r == BZ_MEM_ERROR)
  ------------------
  |  Branch (1556:7): [True: 0, False: 0]
  ------------------
 1557|      0|			r = BZ2_bzDecompressInit(&(zip->bzstream), 0, 1);
 1558|      0|		if (r != BZ_OK) {
  ------------------
  |  Branch (1558:7): [True: 0, False: 0]
  ------------------
 1559|      0|			int err = ARCHIVE_ERRNO_MISC;
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1560|      0|			const char *detail = NULL;
 1561|      0|			switch (r) {
  ------------------
  |  Branch (1561:12): [True: 0, False: 0]
  ------------------
 1562|      0|			case BZ_PARAM_ERROR:
  ------------------
  |  Branch (1562:4): [True: 0, False: 0]
  ------------------
 1563|      0|				detail = "invalid setup parameter";
 1564|      0|				break;
 1565|      0|			case BZ_MEM_ERROR:
  ------------------
  |  Branch (1565:4): [True: 0, False: 0]
  ------------------
 1566|      0|				err = ENOMEM;
 1567|      0|				detail = "out of memory";
 1568|      0|				break;
 1569|      0|			case BZ_CONFIG_ERROR:
  ------------------
  |  Branch (1569:4): [True: 0, False: 0]
  ------------------
 1570|      0|				detail = "mis-compiled library";
 1571|      0|				break;
 1572|      0|			}
 1573|      0|			archive_set_error(&a->archive, err,
 1574|      0|			    "Internal error initializing decompressor: %s",
 1575|      0|			    detail != NULL ? detail : "??");
  ------------------
  |  Branch (1575:8): [True: 0, False: 0]
  ------------------
 1576|      0|			zip->bzstream_valid = 0;
 1577|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1578|      0|		}
 1579|      0|		zip->bzstream_valid = 1;
 1580|      0|		zip->bzstream.total_in_lo32 = 0;
 1581|      0|		zip->bzstream.total_in_hi32 = 0;
 1582|      0|		zip->bzstream.total_out_lo32 = 0;
 1583|      0|		zip->bzstream.total_out_hi32 = 0;
 1584|      0|		break;
 1585|       |#else
 1586|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
 1587|       |		    "BZ2 codec is unsupported");
 1588|       |		return (ARCHIVE_FAILED);
 1589|       |#endif
 1590|      0|	case _7Z_ZSTD:
  ------------------
  |  |  116|      0|#define _7Z_ZSTD	0x4F71101 /* Copied from https://github.com/mcmilk/7-Zip-zstd.git */
  ------------------
  |  Branch (1590:2): [True: 0, False: 72]
  ------------------
 1591|      0|	{
 1592|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 1593|       |		if (zip->zstdstream_valid) {
 1594|       |			ZSTD_freeDStream(zip->zstd_dstream);
 1595|       |			zip->zstdstream_valid = 0;
 1596|       |		}
 1597|       |		zip->zstd_dstream = ZSTD_createDStream();
 1598|       |		zip->zstdstream_valid = 1;
 1599|       |		break;
 1600|       |#else
 1601|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1602|      0|			"ZSTD codec is unsupported");
 1603|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1604|      0|#endif
 1605|      0|	}
 1606|      0|	case _7Z_DEFLATE:
  ------------------
  |  |   97|      0|#define _7Z_DEFLATE	0x040108
  ------------------
  |  Branch (1606:2): [True: 0, False: 72]
  ------------------
 1607|      0|#ifdef HAVE_ZLIB_H
 1608|      0|		if (zip->stream_valid)
  ------------------
  |  Branch (1608:7): [True: 0, False: 0]
  ------------------
 1609|      0|			r = inflateReset(&(zip->stream));
 1610|      0|		else
 1611|      0|			r = inflateInit2(&(zip->stream),
 1612|      0|			    -15 /* Don't check for zlib header */);
 1613|      0|		if (r != Z_OK) {
  ------------------
  |  Branch (1613:7): [True: 0, False: 0]
  ------------------
 1614|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1615|      0|			    "Couldn't initialize zlib stream");
 1616|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1617|      0|		}
 1618|      0|		zip->stream_valid = 1;
 1619|      0|		zip->stream.total_in = 0;
 1620|      0|		zip->stream.total_out = 0;
 1621|      0|		break;
 1622|       |#else
 1623|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
 1624|       |		    "DEFLATE codec is unsupported");
 1625|       |		return (ARCHIVE_FAILED);
 1626|       |#endif
 1627|     64|	case _7Z_PPMD:
  ------------------
  |  |   99|     64|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (1627:2): [True: 64, False: 8]
  ------------------
 1628|     64|	{
 1629|     64|		unsigned order;
 1630|     64|		uint32_t msize;
 1631|       |
 1632|     64|		if (zip->ppmd7_valid) {
  ------------------
  |  Branch (1632:7): [True: 0, False: 64]
  ------------------
 1633|      0|			__archive_ppmd7_functions.Ppmd7_Free(
 1634|      0|			    &zip->ppmd7_context);
 1635|      0|			zip->ppmd7_valid = 0;
 1636|      0|		}
 1637|       |
 1638|     64|		if (coder1->propertiesSize < 5) {
  ------------------
  |  Branch (1638:7): [True: 0, False: 64]
  ------------------
 1639|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1640|      0|			    "Malformed PPMd parameter");
 1641|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1642|      0|		}
 1643|     64|		order = coder1->properties[0];
 1644|     64|		msize = archive_le32dec(&(coder1->properties[1]));
 1645|     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 (1645:7): [True: 0, False: 64]
  |  Branch (1645:34): [True: 0, False: 64]
  ------------------
 1646|     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 (1646:7): [True: 0, False: 64]
  |  Branch (1646:37): [True: 0, False: 64]
  ------------------
 1647|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1648|      0|			    "Malformed PPMd parameter");
 1649|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1650|      0|		}
 1651|     64|		__archive_ppmd7_functions.Ppmd7_Construct(&zip->ppmd7_context);
 1652|     64|		r = __archive_ppmd7_functions.Ppmd7_Alloc(
 1653|     64|			&zip->ppmd7_context, msize);
 1654|     64|		if (r == 0) {
  ------------------
  |  Branch (1654:7): [True: 0, False: 64]
  ------------------
 1655|      0|			archive_set_error(&a->archive, ENOMEM,
 1656|      0|			    "Coludn't allocate memory for PPMd");
 1657|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1658|      0|		}
 1659|     64|		__archive_ppmd7_functions.Ppmd7_Init(
 1660|     64|			&zip->ppmd7_context, order);
 1661|     64|		__archive_ppmd7_functions.Ppmd7z_RangeDec_CreateVTable(
 1662|     64|			&zip->range_dec);
 1663|     64|		zip->ppmd7_valid = 1;
 1664|     64|		zip->ppmd7_stat = 0;
 1665|     64|		zip->ppstream.overconsumed = 0;
 1666|     64|		break;
 1667|     64|	}
 1668|      0|	case _7Z_X86:
  ------------------
  |  |  106|      0|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1668:2): [True: 0, False: 72]
  ------------------
 1669|      0|	case _7Z_X86_BCJ2:
  ------------------
  |  |  107|      0|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1669:2): [True: 0, False: 72]
  ------------------
 1670|      0|	case _7Z_POWERPC:
  ------------------
  |  |  108|      0|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1670:2): [True: 0, False: 72]
  ------------------
 1671|      0|	case _7Z_IA64:
  ------------------
  |  |  109|      0|#define _7Z_IA64	0x03030401
  ------------------
  |  Branch (1671:2): [True: 0, False: 72]
  ------------------
 1672|      0|	case _7Z_ARM:
  ------------------
  |  |  110|      0|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1672:2): [True: 0, False: 72]
  ------------------
 1673|      0|	case _7Z_ARMTHUMB:
  ------------------
  |  |  111|      0|#define _7Z_ARMTHUMB	0x03030701
  ------------------
  |  Branch (1673:2): [True: 0, False: 72]
  ------------------
 1674|      0|	case _7Z_ARM64:
  ------------------
  |  |  112|      0|#define _7Z_ARM64	0xa
  ------------------
  |  Branch (1674:2): [True: 0, False: 72]
  ------------------
 1675|      0|	case _7Z_RISCV:
  ------------------
  |  |  113|      0|#define _7Z_RISCV	0xb
  ------------------
  |  Branch (1675:2): [True: 0, False: 72]
  ------------------
 1676|      0|	case _7Z_SPARC:
  ------------------
  |  |  114|      0|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1676:2): [True: 0, False: 72]
  ------------------
 1677|      0|	case _7Z_DELTA:
  ------------------
  |  |  100|      0|#define _7Z_DELTA	0x03
  ------------------
  |  Branch (1677:2): [True: 0, False: 72]
  ------------------
 1678|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1679|      0|		    "Unexpected codec ID: %lX", zip->codec);
 1680|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1681|      0|	case _7Z_CRYPTO_MAIN_ZIP:
  ------------------
  |  |  101|      0|#define _7Z_CRYPTO_MAIN_ZIP			0x06F10101 /* Main Zip crypto algo */
  ------------------
  |  Branch (1681:2): [True: 0, False: 72]
  ------------------
 1682|      0|	case _7Z_CRYPTO_RAR_29:
  ------------------
  |  |  102|      0|#define _7Z_CRYPTO_RAR_29			0x06F10303 /* Rar29 AES-128 + (modified SHA-1) */
  ------------------
  |  Branch (1682:2): [True: 0, False: 72]
  ------------------
 1683|      0|	case _7Z_CRYPTO_AES_256_SHA_256:
  ------------------
  |  |  103|      0|#define _7Z_CRYPTO_AES_256_SHA_256	0x06F10701 /* AES-256 + SHA-256 */
  ------------------
  |  Branch (1683:2): [True: 0, False: 72]
  ------------------
 1684|      0|		if (a->entry) {
  ------------------
  |  Branch (1684:7): [True: 0, False: 0]
  ------------------
 1685|      0|			archive_entry_set_is_metadata_encrypted(a->entry, 1);
 1686|      0|			archive_entry_set_is_data_encrypted(a->entry, 1);
 1687|      0|			zip->has_encrypted_entries = 1;
 1688|      0|		}
 1689|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1690|      0|		    "Crypto codec not supported yet (ID: 0x%lX)", zip->codec);
 1691|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1692|      0|	default:
  ------------------
  |  Branch (1692:2): [True: 0, False: 72]
  ------------------
 1693|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1694|      0|		    "Unknown codec ID: %lX", zip->codec);
 1695|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1696|     72|	}
 1697|       |
 1698|     72|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     72|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1699|     72|}
archive_read_support_format_7zip.c:seek_pack:
 3642|     72|{
 3643|     72|	struct _7zip *zip = (struct _7zip *)a->format->data;
 3644|     72|	int64_t pack_offset;
 3645|       |
 3646|     72|	if (zip->pack_stream_remaining <= 0) {
  ------------------
  |  Branch (3646:6): [True: 0, False: 72]
  ------------------
 3647|      0|		archive_set_error(&(a->archive),
 3648|      0|		    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3649|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3650|      0|	}
 3651|     72|	zip->pack_stream_inbytes_remaining =
 3652|     72|	    zip->si.pi.sizes[zip->pack_stream_index];
 3653|     72|	pack_offset = zip->si.pi.positions[zip->pack_stream_index];
 3654|     72|	if (zip->stream_offset != pack_offset) {
  ------------------
  |  Branch (3654:6): [True: 72, False: 0]
  ------------------
 3655|     72|		if (0 > seek_compat(a, pack_offset + zip->seek_base,
  ------------------
  |  Branch (3655:7): [True: 0, False: 72]
  ------------------
 3656|     72|		    SEEK_SET, 1)) {
 3657|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3658|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3659|      0|		}
 3660|     72|		zip->stream_offset = pack_offset;
 3661|     72|	}
 3662|     72|	zip->pack_stream_index++;
 3663|     72|	zip->pack_stream_remaining--;
 3664|     72|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     72|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3665|     72|}
archive_read_support_format_7zip.c:free_StreamsInfo:
 2686|  2.56k|{
 2687|  2.56k|	free_PackInfo(&(si->pi));
 2688|  2.56k|	free_CodersInfo(&(si->ci));
 2689|  2.56k|	free_SubStreamsInfo(&(si->ss));
 2690|  2.56k|}
archive_read_support_format_7zip.c:free_PackInfo:
 2163|  2.56k|{
 2164|  2.56k|	free(pi->sizes);
 2165|  2.56k|	free(pi->positions);
 2166|  2.56k|	free_Digest(&(pi->digest));
 2167|  2.56k|}
archive_read_support_format_7zip.c:free_CodersInfo:
 2409|  2.56k|{
 2410|  2.56k|	unsigned i;
 2411|       |
 2412|  2.56k|	if (ci->folders) {
  ------------------
  |  Branch (2412:6): [True: 87, False: 2.47k]
  ------------------
 2413|    174|		for (i = 0; i < ci->numFolders; i++)
  ------------------
  |  Branch (2413:15): [True: 87, False: 87]
  ------------------
 2414|     87|			free_Folder(&(ci->folders[i]));
 2415|     87|		free(ci->folders);
 2416|     87|	}
 2417|  2.56k|}
archive_read_support_format_7zip.c:free_Folder:
 2247|     87|{
 2248|     87|	unsigned i;
 2249|       |
 2250|     87|	if (f->coders) {
  ------------------
  |  Branch (2250:6): [True: 87, False: 0]
  ------------------
 2251|    178|		for (i = 0; i< f->numCoders; i++) {
  ------------------
  |  Branch (2251:15): [True: 91, False: 87]
  ------------------
 2252|     91|			free(f->coders[i].properties);
 2253|     91|		}
 2254|     87|		free(f->coders);
 2255|     87|	}
 2256|     87|	free(f->bindPairs);
 2257|     87|	free(f->packedStreams);
 2258|     87|	free(f->unPackSize);
 2259|     87|}
archive_read_support_format_7zip.c:free_SubStreamsInfo:
 2544|  2.56k|{
 2545|  2.56k|	free(ss->unpackSizes);
 2546|  2.56k|	free(ss->digestsDefined);
 2547|  2.56k|	free(ss->digests);
 2548|  2.56k|}
archive_read_support_format_7zip.c:read_Header:
 2780|    100|{
 2781|    100|	struct _7zip *zip = (struct _7zip *)a->format->data;
 2782|    100|	const unsigned char *p;
 2783|    100|	struct _7z_folder *folders;
 2784|    100|	struct _7z_stream_info *si = &(zip->si);
 2785|    100|	struct _7zip_entry *entries;
 2786|    100|	uint32_t folderIndex, indexInFolder;
 2787|    100|	unsigned i;
 2788|    100|	int eindex, empty_streams, sindex;
 2789|       |
 2790|    100|	if (check_header_id) {
  ------------------
  |  Branch (2790:6): [True: 64, False: 36]
  ------------------
 2791|       |		/*
 2792|       |		 * Read Header.
 2793|       |		 */
 2794|     64|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2794:7): [True: 64, False: 0]
  ------------------
 2795|     64|			return (-1);
 2796|      0|		if (*p != kHeader)
  ------------------
  |  |  122|      0|#define kHeader			0x01
  ------------------
  |  Branch (2796:7): [True: 0, False: 0]
  ------------------
 2797|      0|			return (-1);
 2798|      0|	}
 2799|       |
 2800|       |	/*
 2801|       |	 * Read ArchiveProperties.
 2802|       |	 */
 2803|     36|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2803:6): [True: 0, False: 36]
  ------------------
 2804|      0|		return (-1);
 2805|     36|	if (*p == kArchiveProperties) {
  ------------------
  |  |  123|     36|#define kArchiveProperties	0x02
  ------------------
  |  Branch (2805:6): [True: 0, False: 36]
  ------------------
 2806|      0|		for (;;) {
 2807|      0|			uint64_t size;
 2808|      0|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2808:8): [True: 0, False: 0]
  ------------------
 2809|      0|				return (-1);
 2810|      0|			if (*p == 0)
  ------------------
  |  Branch (2810:8): [True: 0, False: 0]
  ------------------
 2811|      0|				break;
 2812|      0|			if (parse_7zip_uint64(a, &size) < 0)
  ------------------
  |  Branch (2812:8): [True: 0, False: 0]
  ------------------
 2813|      0|				return (-1);
 2814|      0|		}
 2815|      0|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2815:7): [True: 0, False: 0]
  ------------------
 2816|      0|			return (-1);
 2817|      0|	}
 2818|       |
 2819|       |	/*
 2820|       |	 * Read MainStreamsInfo.
 2821|       |	 */
 2822|     36|	if (*p == kMainStreamsInfo) {
  ------------------
  |  |  125|     36|#define kMainStreamsInfo	0x04
  ------------------
  |  Branch (2822:6): [True: 24, False: 12]
  ------------------
 2823|     24|		if (read_StreamsInfo(a, &(zip->si)) < 0)
  ------------------
  |  Branch (2823:7): [True: 13, False: 11]
  ------------------
 2824|     13|			return (-1);
 2825|     11|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2825:7): [True: 0, False: 11]
  ------------------
 2826|      0|			return (-1);
 2827|     11|	}
 2828|     23|	if (*p == kEnd)
  ------------------
  |  |  121|     23|#define kEnd			0x00
  ------------------
  |  Branch (2828:6): [True: 0, False: 23]
  ------------------
 2829|      0|		return (0);
 2830|       |
 2831|       |	/*
 2832|       |	 * Read FilesInfo.
 2833|       |	 */
 2834|     23|	if (*p != kFilesInfo)
  ------------------
  |  |  126|     23|#define kFilesInfo		0x05
  ------------------
  |  Branch (2834:6): [True: 1, False: 22]
  ------------------
 2835|      1|		return (-1);
 2836|       |
 2837|     22|	if (parse_7zip_uint64(a, &(zip->numFiles)) < 0)
  ------------------
  |  Branch (2837:6): [True: 0, False: 22]
  ------------------
 2838|      0|		return (-1);
 2839|     22|	if (!files_info_numfiles_is_sane(zip))
  ------------------
  |  Branch (2839:6): [True: 0, False: 22]
  ------------------
 2840|      0|		return (-1);
 2841|       |
 2842|     22|	zip->entries = calloc((size_t)zip->numFiles, sizeof(*zip->entries));
 2843|     22|	if (zip->entries == NULL)
  ------------------
  |  Branch (2843:6): [True: 0, False: 22]
  ------------------
 2844|      0|		return (-1);
 2845|     22|	entries = zip->entries;
 2846|       |
 2847|     22|	empty_streams = 0;
 2848|  1.42k|	for (;;) {
 2849|  1.42k|		int type;
 2850|  1.42k|		uint64_t size;
 2851|  1.42k|		size_t ll;
 2852|       |
 2853|  1.42k|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2853:7): [True: 0, False: 1.42k]
  ------------------
 2854|      0|			return (-1);
 2855|  1.42k|		type = *p;
 2856|  1.42k|		if (type == kEnd)
  ------------------
  |  |  121|  1.42k|#define kEnd			0x00
  ------------------
  |  Branch (2856:7): [True: 19, False: 1.40k]
  ------------------
 2857|     19|			break;
 2858|       |
 2859|  1.40k|		if (parse_7zip_uint64(a, &size) < 0)
  ------------------
  |  Branch (2859:7): [True: 0, False: 1.40k]
  ------------------
 2860|      0|			return (-1);
 2861|  1.40k|		if (zip->header_bytes_remaining < size || size > SIZE_MAX / 4)
  ------------------
  |  Branch (2861:7): [True: 0, False: 1.40k]
  |  Branch (2861:45): [True: 0, False: 1.40k]
  ------------------
 2862|      0|			return (-1);
 2863|  1.40k|		ll = (size_t)size;
 2864|       |
 2865|  1.40k|		switch (type) {
 2866|     10|		case kEmptyStream:
  ------------------
  |  |  135|     10|#define kEmptyStream		0x0E
  ------------------
  |  Branch (2866:3): [True: 10, False: 1.39k]
  ------------------
 2867|     10|			if (h->emptyStreamBools != NULL)
  ------------------
  |  Branch (2867:8): [True: 0, False: 10]
  ------------------
 2868|      0|				return (-1);
 2869|     10|			h->emptyStreamBools = calloc((size_t)zip->numFiles,
 2870|     10|			    sizeof(*h->emptyStreamBools));
 2871|     10|			if (h->emptyStreamBools == NULL)
  ------------------
  |  Branch (2871:8): [True: 0, False: 10]
  ------------------
 2872|      0|				return (-1);
 2873|     10|			if (read_Bools(
  ------------------
  |  Branch (2873:8): [True: 0, False: 10]
  ------------------
 2874|     10|			    a, h->emptyStreamBools, (size_t)zip->numFiles) < 0)
 2875|      0|				return (-1);
 2876|     10|			empty_streams = 0;
 2877|  1.00k|			for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (2877:16): [True: 990, False: 10]
  ------------------
 2878|    990|				if (h->emptyStreamBools[i])
  ------------------
  |  Branch (2878:9): [True: 990, False: 0]
  ------------------
 2879|    990|					empty_streams++;
 2880|    990|			}
 2881|     10|			break;
 2882|    385|		case kEmptyFile:
  ------------------
  |  |  136|    385|#define kEmptyFile		0x0F
  ------------------
  |  Branch (2882:3): [True: 385, False: 1.02k]
  ------------------
 2883|    385|			if (empty_streams <= 0) {
  ------------------
  |  Branch (2883:8): [True: 385, False: 0]
  ------------------
 2884|       |				/* Unexcepted sequence. Skip this. */
 2885|    385|				if (header_bytes(a, ll) == NULL)
  ------------------
  |  Branch (2885:9): [True: 0, False: 385]
  ------------------
 2886|      0|					return (-1);
 2887|    385|				break;
 2888|    385|			}
 2889|      0|			if (h->emptyFileBools != NULL)
  ------------------
  |  Branch (2889:8): [True: 0, False: 0]
  ------------------
 2890|      0|				return (-1);
 2891|      0|			h->emptyFileBools = calloc(empty_streams,
 2892|      0|			    sizeof(*h->emptyFileBools));
 2893|      0|			if (h->emptyFileBools == NULL)
  ------------------
  |  Branch (2893:8): [True: 0, False: 0]
  ------------------
 2894|      0|				return (-1);
 2895|      0|			if (read_Bools(a, h->emptyFileBools, empty_streams) < 0)
  ------------------
  |  Branch (2895:8): [True: 0, False: 0]
  ------------------
 2896|      0|				return (-1);
 2897|      0|			break;
 2898|      0|		case kAnti:
  ------------------
  |  |  137|      0|#define kAnti			0x10
  ------------------
  |  Branch (2898:3): [True: 0, False: 1.40k]
  ------------------
 2899|      0|			if (empty_streams <= 0) {
  ------------------
  |  Branch (2899:8): [True: 0, False: 0]
  ------------------
 2900|       |				/* Unexcepted sequence. Skip this. */
 2901|      0|				if (header_bytes(a, ll) == NULL)
  ------------------
  |  Branch (2901:9): [True: 0, False: 0]
  ------------------
 2902|      0|					return (-1);
 2903|      0|				break;
 2904|      0|			}
 2905|      0|			if (h->antiBools != NULL)
  ------------------
  |  Branch (2905:8): [True: 0, False: 0]
  ------------------
 2906|      0|				return (-1);
 2907|      0|			h->antiBools = calloc(empty_streams,
 2908|      0|			    sizeof(*h->antiBools));
 2909|      0|			if (h->antiBools == NULL)
  ------------------
  |  Branch (2909:8): [True: 0, False: 0]
  ------------------
 2910|      0|				return (-1);
 2911|      0|			if (read_Bools(a, h->antiBools, empty_streams) < 0)
  ------------------
  |  Branch (2911:8): [True: 0, False: 0]
  ------------------
 2912|      0|				return (-1);
 2913|      0|			break;
 2914|      3|		case kCTime:
  ------------------
  |  |  139|      3|#define kCTime			0x12
  ------------------
  |  Branch (2914:3): [True: 3, False: 1.40k]
  ------------------
 2915|    789|		case kATime:
  ------------------
  |  |  140|    789|#define kATime			0x13
  ------------------
  |  Branch (2915:3): [True: 786, False: 621]
  ------------------
 2916|    789|		case kMTime:
  ------------------
  |  |  141|    789|#define kMTime			0x14
  ------------------
  |  Branch (2916:3): [True: 0, False: 1.40k]
  ------------------
 2917|    789|			if (read_Times(a, h, type) < 0)
  ------------------
  |  Branch (2917:8): [True: 2, False: 787]
  ------------------
 2918|      2|				return (-1);
 2919|    787|			break;
 2920|    787|		case kName:
  ------------------
  |  |  138|     14|#define kName			0x11
  ------------------
  |  Branch (2920:3): [True: 14, False: 1.39k]
  ------------------
 2921|     14|		{
 2922|     14|			unsigned char *np;
 2923|     14|			size_t nl, nb;
 2924|       |
 2925|       |			/* Skip one byte. */
 2926|     14|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2926:8): [True: 0, False: 14]
  ------------------
 2927|      0|				return (-1);
 2928|     14|			ll--;
 2929|       |
 2930|     14|			if ((ll & 1) || ll < zip->numFiles * 4)
  ------------------
  |  Branch (2930:8): [True: 0, False: 14]
  |  Branch (2930:20): [True: 0, False: 14]
  ------------------
 2931|      0|				return (-1);
 2932|       |
 2933|     14|			if (zip->entry_names != NULL)
  ------------------
  |  Branch (2933:8): [True: 0, False: 14]
  ------------------
 2934|      0|				return (-1);
 2935|     14|			zip->entry_names = malloc(ll);
 2936|     14|			if (zip->entry_names == NULL)
  ------------------
  |  Branch (2936:8): [True: 0, False: 14]
  ------------------
 2937|      0|				return (-1);
 2938|     14|			np = zip->entry_names;
 2939|     14|			nb = ll;
 2940|       |			/*
 2941|       |			 * Copy whole file names.
 2942|       |			 * NOTE: This loop prevents from expanding
 2943|       |			 * the uncompressed buffer in order not to
 2944|       |			 * use extra memory resource.
 2945|       |			 */
 2946|     28|			while (nb) {
  ------------------
  |  Branch (2946:11): [True: 14, False: 14]
  ------------------
 2947|     14|				size_t b;
 2948|     14|				if (nb > UBUFF_SIZE)
  ------------------
  |  |  296|     14|#define UBUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (2948:9): [True: 0, False: 14]
  ------------------
 2949|      0|					b = UBUFF_SIZE;
  ------------------
  |  |  296|      0|#define UBUFF_SIZE	(64 * 1024)
  ------------------
 2950|     14|				else
 2951|     14|					b = nb;
 2952|     14|				if ((p = header_bytes(a, b)) == NULL)
  ------------------
  |  Branch (2952:9): [True: 0, False: 14]
  ------------------
 2953|      0|					return (-1);
 2954|     14|				memcpy(np, p, b);
 2955|     14|				np += b;
 2956|     14|				nb -= b;
 2957|     14|			}
 2958|     14|			np = zip->entry_names;
 2959|     14|			nl = ll;
 2960|       |
 2961|  1.00k|			for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (2961:16): [True: 994, False: 14]
  ------------------
 2962|    994|				entries[i].utf16name = np;
 2963|       |#if defined(_WIN32) && !defined(__CYGWIN__) && defined(_DEBUG)
 2964|       |				entries[i].wname = (wchar_t *)np;
 2965|       |#endif
 2966|       |
 2967|       |				/* Find a terminator. */
 2968|  38.7k|				while (nl >= 2 && (np[0] || np[1])) {
  ------------------
  |  Branch (2968:12): [True: 38.7k, False: 0]
  |  Branch (2968:24): [True: 37.1k, False: 1.63k]
  |  Branch (2968:33): [True: 640, False: 994]
  ------------------
 2969|  37.7k|					np += 2;
 2970|  37.7k|					nl -= 2;
 2971|  37.7k|				}
 2972|    994|				if (nl < 2)
  ------------------
  |  Branch (2972:9): [True: 0, False: 994]
  ------------------
 2973|      0|					return (-1);/* Terminator not found */
 2974|    994|				entries[i].name_len = np - entries[i].utf16name;
 2975|    994|				np += 2;
 2976|    994|				nl -= 2;
 2977|    994|			}
 2978|     14|			break;
 2979|     14|		}
 2980|     14|		case kAttributes:
  ------------------
  |  |  142|      1|#define kAttributes		0x15
  ------------------
  |  Branch (2980:3): [True: 1, False: 1.40k]
  ------------------
 2981|      1|		{
 2982|      1|			int allAreDefined;
 2983|       |
 2984|      1|			if ((p = header_bytes(a, 2)) == NULL)
  ------------------
  |  Branch (2984:8): [True: 0, False: 1]
  ------------------
 2985|      0|				return (-1);
 2986|      1|			allAreDefined = *p;
 2987|      1|			if (h->attrBools != NULL)
  ------------------
  |  Branch (2987:8): [True: 0, False: 1]
  ------------------
 2988|      0|				return (-1);
 2989|      1|			h->attrBools = calloc((size_t)zip->numFiles,
 2990|      1|			    sizeof(*h->attrBools));
 2991|      1|			if (h->attrBools == NULL)
  ------------------
  |  Branch (2991:8): [True: 0, False: 1]
  ------------------
 2992|      0|				return (-1);
 2993|      1|			if (allAreDefined)
  ------------------
  |  Branch (2993:8): [True: 1, False: 0]
  ------------------
 2994|      1|				memset(h->attrBools, 1, (size_t)zip->numFiles);
 2995|      0|			else {
 2996|      0|				if (read_Bools(a, h->attrBools,
  ------------------
  |  Branch (2996:9): [True: 0, False: 0]
  ------------------
 2997|      0|				      (size_t)zip->numFiles) < 0)
 2998|      0|					return (-1);
 2999|      0|			}
 3000|     20|			for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (3000:16): [True: 19, False: 1]
  ------------------
 3001|     19|				if (h->attrBools[i]) {
  ------------------
  |  Branch (3001:9): [True: 19, False: 0]
  ------------------
 3002|     19|					if ((p = header_bytes(a, 4)) == NULL)
  ------------------
  |  Branch (3002:10): [True: 0, False: 19]
  ------------------
 3003|      0|						return (-1);
 3004|     19|					entries[i].attr = archive_le32dec(p);
 3005|     19|				}
 3006|     19|			}
 3007|      1|			break;
 3008|      1|		}
 3009|    138|		case kDummy:
  ------------------
  |  |  144|    138|#define kDummy			0x19
  ------------------
  |  Branch (3009:3): [True: 138, False: 1.26k]
  ------------------
 3010|    138|			if (ll == 0)
  ------------------
  |  Branch (3010:8): [True: 0, False: 138]
  ------------------
 3011|      0|				break;
 3012|    138|			__LA_FALLTHROUGH;
 3013|    208|		default:
  ------------------
  |  Branch (3013:3): [True: 70, False: 1.33k]
  ------------------
 3014|    208|			if (header_bytes(a, ll) == NULL)
  ------------------
  |  Branch (3014:8): [True: 1, False: 207]
  ------------------
 3015|      1|				return (-1);
 3016|    207|			break;
 3017|  1.40k|		}
 3018|  1.40k|	}
 3019|       |
 3020|       |	/*
 3021|       |	 * Set up entry's attributes.
 3022|       |	 */
 3023|     19|	folders = si->ci.folders;
 3024|     19|	eindex = sindex = 0;
 3025|     19|	folderIndex = indexInFolder = 0;
 3026|  1.01k|	for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (3026:14): [True: 999, False: 18]
  ------------------
 3027|    999|		if (h->emptyStreamBools == NULL || h->emptyStreamBools[i] == 0)
  ------------------
  |  Branch (3027:7): [True: 9, False: 990]
  |  Branch (3027:38): [True: 0, False: 990]
  ------------------
 3028|      9|			entries[i].flg |= HAS_STREAM;
  ------------------
  |  |  252|      9|#define HAS_STREAM	(1<<4)
  ------------------
 3029|       |		/* The high 16 bits of attributes is a posix file mode. */
 3030|    999|		entries[i].mode = entries[i].attr >> 16;
 3031|       |
 3032|    999|		if (!(entries[i].attr & FILE_ATTRIBUTE_UNIX_EXTENSION)) {
  ------------------
  |  |  168|    999|#define FILE_ATTRIBUTE_UNIX_EXTENSION 0x8000
  ------------------
  |  Branch (3032:7): [True: 999, False: 0]
  ------------------
 3033|       |			// Only windows permissions specified for this entry. Translate to
 3034|       |			// reasonable corresponding unix permissions.
 3035|       |
 3036|    999|			if (entries[i].attr & FILE_ATTRIBUTE_DIRECTORY) {
  ------------------
  |  |  161|    999|#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
  ------------------
  |  Branch (3036:8): [True: 0, False: 999]
  ------------------
 3037|      0|				if (entries[i].attr & FILE_ATTRIBUTE_READONLY) {
  ------------------
  |  |  149|      0|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (3037:9): [True: 0, False: 0]
  ------------------
 3038|       |					// Read-only directory.
 3039|      0|					entries[i].mode = AE_IFDIR | 0555;
  ------------------
  |  |  221|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3040|      0|				} else {
 3041|       |					// Read-write directory.
 3042|      0|					entries[i].mode = AE_IFDIR | 0755;
  ------------------
  |  |  221|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3043|      0|				}
 3044|    999|			} else if (entries[i].attr & FILE_ATTRIBUTE_READONLY) {
  ------------------
  |  |  149|    999|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (3044:15): [True: 0, False: 999]
  ------------------
 3045|       |				// Readonly file.
 3046|      0|				entries[i].mode = AE_IFREG | 0444;
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3047|    999|			} else {
 3048|       |				// Assume read-write file.
 3049|    999|				entries[i].mode = AE_IFREG | 0644;
  ------------------
  |  |  216|    999|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3050|    999|			}
 3051|    999|		}
 3052|       |
 3053|    999|		if (entries[i].flg & HAS_STREAM) {
  ------------------
  |  |  252|    999|#define HAS_STREAM	(1<<4)
  ------------------
  |  Branch (3053:7): [True: 9, False: 990]
  ------------------
 3054|      9|			if ((size_t)sindex >= si->ss.unpack_streams)
  ------------------
  |  Branch (3054:8): [True: 1, False: 8]
  ------------------
 3055|      1|				return (-1);
 3056|      8|			if (entries[i].mode == 0)
  ------------------
  |  Branch (3056:8): [True: 0, False: 8]
  ------------------
 3057|      0|				entries[i].mode = AE_IFREG | 0666;
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3058|      8|			if (si->ss.digestsDefined[sindex])
  ------------------
  |  Branch (3058:8): [True: 8, False: 0]
  ------------------
 3059|      8|				entries[i].flg |= CRC32_IS_SET;
  ------------------
  |  |  251|      8|#define CRC32_IS_SET	(1<<3)
  ------------------
 3060|      8|			entries[i].ssIndex = sindex;
 3061|      8|			sindex++;
 3062|    990|		} else {
 3063|    990|			int dir;
 3064|    990|			if (h->emptyFileBools == NULL)
  ------------------
  |  Branch (3064:8): [True: 990, False: 0]
  ------------------
 3065|    990|				dir = 1;
 3066|      0|			else {
 3067|      0|				if (h->emptyFileBools[eindex])
  ------------------
  |  Branch (3067:9): [True: 0, False: 0]
  ------------------
 3068|      0|					dir = 0;
 3069|      0|				else
 3070|      0|					dir = 1;
 3071|      0|				eindex++;
 3072|      0|			}
 3073|    990|			if (entries[i].mode == 0) {
  ------------------
  |  Branch (3073:8): [True: 0, False: 990]
  ------------------
 3074|      0|				if (dir)
  ------------------
  |  Branch (3074:9): [True: 0, False: 0]
  ------------------
 3075|      0|					entries[i].mode = AE_IFDIR | 0777;
  ------------------
  |  |  221|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3076|      0|				else
 3077|      0|					entries[i].mode = AE_IFREG | 0666;
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3078|    990|			} else if (dir &&
  ------------------
  |  Branch (3078:15): [True: 990, False: 0]
  ------------------
 3079|    990|			    (entries[i].mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  215|    990|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    (entries[i].mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  221|    990|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (3079:8): [True: 990, False: 0]
  ------------------
 3080|    990|				entries[i].mode &= ~AE_IFMT;
  ------------------
  |  |  215|    990|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 3081|    990|				entries[i].mode |= AE_IFDIR;
  ------------------
  |  |  221|    990|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3082|    990|			}
 3083|    990|			if ((entries[i].mode & AE_IFMT) == AE_IFDIR &&
  ------------------
  |  |  215|    990|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			if ((entries[i].mode & AE_IFMT) == AE_IFDIR &&
  ------------------
  |  |  221|  1.98k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (3083:8): [True: 990, False: 0]
  ------------------
 3084|    990|			    entries[i].name_len >= 2 &&
  ------------------
  |  Branch (3084:8): [True: 453, False: 537]
  ------------------
 3085|    453|			    (entries[i].utf16name[entries[i].name_len-2] != '/' ||
  ------------------
  |  Branch (3085:9): [True: 451, False: 2]
  ------------------
 3086|    451|			     entries[i].utf16name[entries[i].name_len-1] != 0)) {
  ------------------
  |  Branch (3086:9): [True: 0, False: 2]
  ------------------
 3087|    451|				entries[i].utf16name[entries[i].name_len] = '/';
 3088|    451|				entries[i].utf16name[entries[i].name_len+1] = 0;
 3089|    451|				entries[i].name_len += 2;
 3090|    451|			}
 3091|    990|			entries[i].ssIndex = -1;
 3092|    990|		}
 3093|    998|		if (entries[i].attr & FILE_ATTRIBUTE_READONLY)
  ------------------
  |  |  149|    998|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (3093:7): [True: 0, False: 998]
  ------------------
 3094|      0|			entries[i].mode &= ~0222;/* Read only. */
 3095|       |
 3096|    998|		if ((entries[i].flg & HAS_STREAM) == 0 && indexInFolder == 0) {
  ------------------
  |  |  252|    998|#define HAS_STREAM	(1<<4)
  ------------------
  |  Branch (3096:7): [True: 990, False: 8]
  |  Branch (3096:45): [True: 990, False: 0]
  ------------------
 3097|       |			/*
 3098|       |			 * The entry is an empty file or a directory file,
 3099|       |			 * those both have no contents.
 3100|       |			 */
 3101|    990|			entries[i].folderIndex = -1;
 3102|    990|			continue;
 3103|    990|		}
 3104|      8|		if (indexInFolder == 0) {
  ------------------
  |  Branch (3104:7): [True: 8, False: 0]
  ------------------
 3105|      8|			for (;;) {
 3106|      8|				if (folderIndex >= si->ci.numFolders)
  ------------------
  |  Branch (3106:9): [True: 0, False: 8]
  ------------------
 3107|      0|					return (-1);
 3108|      8|				if (folders[folderIndex].numUnpackStreams)
  ------------------
  |  Branch (3108:9): [True: 8, False: 0]
  ------------------
 3109|      8|					break;
 3110|      0|				folderIndex++;
 3111|      0|			}
 3112|      8|		}
 3113|      8|		entries[i].folderIndex = folderIndex;
 3114|      8|		if ((entries[i].flg & HAS_STREAM) == 0)
  ------------------
  |  |  252|      8|#define HAS_STREAM	(1<<4)
  ------------------
  |  Branch (3114:7): [True: 0, False: 8]
  ------------------
 3115|      0|			continue;
 3116|      8|		indexInFolder++;
 3117|      8|		if (indexInFolder >= folders[folderIndex].numUnpackStreams) {
  ------------------
  |  Branch (3117:7): [True: 8, False: 0]
  ------------------
 3118|      8|			folderIndex++;
 3119|      8|			indexInFolder = 0;
 3120|      8|		}
 3121|      8|	}
 3122|       |
 3123|     18|	return (0);
 3124|     19|}
archive_read_support_format_7zip.c:files_info_numfiles_is_sane:
  406|     22|{
  407|     22|	uint64_t empty_stream_map_bytes;
  408|       |
  409|     22|	if (zip->numFiles > UMAX_ENTRY)
  ------------------
  |  |  398|     22|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|     22|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (409:6): [True: 0, False: 22]
  ------------------
  410|      0|		return (0);
  411|     22|	if (zip->numFiles > SIZE_MAX / sizeof(*zip->entries))
  ------------------
  |  Branch (411:6): [True: 0, False: 22]
  ------------------
  412|      0|		return (0);
  413|       |
  414|     22|	if (zip->numFiles <= zip->si.ss.unpack_streams)
  ------------------
  |  Branch (414:6): [True: 9, False: 13]
  ------------------
  415|      9|		return (1);
  416|       |
  417|     13|	empty_stream_map_bytes = (zip->numFiles + 7) / 8;
  418|     13|	return (empty_stream_map_bytes <= zip->header_bytes_remaining);
  419|     22|}
archive_read_support_format_7zip.c:read_Times:
 3128|    789|{
 3129|    789|	struct _7zip *zip = (struct _7zip *)a->format->data;
 3130|    789|	const unsigned char *p;
 3131|    789|	struct _7zip_entry *entries = zip->entries;
 3132|    789|	unsigned char *timeBools;
 3133|    789|	int allAreDefined;
 3134|    789|	unsigned i;
 3135|       |
 3136|    789|	timeBools = calloc((size_t)zip->numFiles, sizeof(*timeBools));
 3137|    789|	if (timeBools == NULL)
  ------------------
  |  Branch (3137:6): [True: 0, False: 789]
  ------------------
 3138|      0|		return (-1);
 3139|       |
 3140|       |	/* Read allAreDefined. */
 3141|    789|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (3141:6): [True: 0, False: 789]
  ------------------
 3142|      0|		goto failed;
 3143|    789|	allAreDefined = *p;
 3144|    789|	if (allAreDefined)
  ------------------
  |  Branch (3144:6): [True: 768, False: 21]
  ------------------
 3145|    768|		memset(timeBools, 1, (size_t)zip->numFiles);
 3146|     21|	else {
 3147|     21|		if (read_Bools(a, timeBools, (size_t)zip->numFiles) < 0)
  ------------------
  |  Branch (3147:7): [True: 0, False: 21]
  ------------------
 3148|      0|			goto failed;
 3149|     21|	}
 3150|       |
 3151|       |	/* Read external. */
 3152|    789|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (3152:6): [True: 0, False: 789]
  ------------------
 3153|      0|		goto failed;
 3154|    789|	if (*p) {
  ------------------
  |  Branch (3154:6): [True: 769, False: 20]
  ------------------
 3155|    769|		if (parse_7zip_uint64(a, &(h->dataIndex)) < 0)
  ------------------
  |  Branch (3155:7): [True: 1, False: 768]
  ------------------
 3156|      1|			goto failed;
 3157|    768|		if (UMAX_ENTRY < h->dataIndex)
  ------------------
  |  |  398|    768|#define UMAX_ENTRY	ARCHIVE_LITERAL_ULL(100000000)
  |  |  ------------------
  |  |  |  |  180|    768|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  |  Branch (3157:7): [True: 0, False: 768]
  ------------------
 3158|      0|			goto failed;
 3159|    768|	}
 3160|       |
 3161|  3.38k|	for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (3161:14): [True: 2.59k, False: 787]
  ------------------
 3162|  2.59k|		if (!timeBools[i])
  ------------------
  |  Branch (3162:7): [True: 109, False: 2.48k]
  ------------------
 3163|    109|			continue;
 3164|  2.48k|		if ((p = header_bytes(a, 8)) == NULL)
  ------------------
  |  Branch (3164:7): [True: 1, False: 2.48k]
  ------------------
 3165|      1|			goto failed;
 3166|  2.48k|		switch (type) {
  ------------------
  |  Branch (3166:11): [True: 2.48k, False: 0]
  ------------------
 3167|     12|		case kCTime:
  ------------------
  |  |  139|     12|#define kCTime			0x12
  ------------------
  |  Branch (3167:3): [True: 12, False: 2.47k]
  ------------------
 3168|     12|			ntfs_to_unix(archive_le64dec(p),
 3169|     12|			    &(entries[i].ctime),
 3170|     12|			    &(entries[i].ctime_ns));
 3171|     12|			entries[i].flg |= CTIME_IS_SET;
  ------------------
  |  |  250|     12|#define CTIME_IS_SET	(1<<2)
  ------------------
 3172|     12|			break;
 3173|  2.47k|		case kATime:
  ------------------
  |  |  140|  2.47k|#define kATime			0x13
  ------------------
  |  Branch (3173:3): [True: 2.47k, False: 12]
  ------------------
 3174|  2.47k|			ntfs_to_unix(archive_le64dec(p),
 3175|  2.47k|			    &(entries[i].atime),
 3176|  2.47k|			    &(entries[i].atime_ns));
 3177|  2.47k|			entries[i].flg |= ATIME_IS_SET;
  ------------------
  |  |  249|  2.47k|#define ATIME_IS_SET	(1<<1)
  ------------------
 3178|  2.47k|			break;
 3179|      0|		case kMTime:
  ------------------
  |  |  141|      0|#define kMTime			0x14
  ------------------
  |  Branch (3179:3): [True: 0, False: 2.48k]
  ------------------
 3180|      0|			ntfs_to_unix(archive_le64dec(p),
 3181|      0|			    &(entries[i].mtime),
 3182|      0|			    &(entries[i].mtime_ns));
 3183|      0|			entries[i].flg |= MTIME_IS_SET;
  ------------------
  |  |  248|      0|#define MTIME_IS_SET	(1<<0)
  ------------------
 3184|      0|			break;
 3185|  2.48k|		}
 3186|  2.48k|	}
 3187|       |
 3188|    787|	free(timeBools);
 3189|    787|	return (0);
 3190|      2|failed:
 3191|      2|	free(timeBools);
 3192|      2|	return (-1);
 3193|    788|}
archive_read_support_format_7zip.c:free_Header:
 2770|    107|{
 2771|    107|	free(h->emptyStreamBools);
 2772|    107|	free(h->emptyFileBools);
 2773|    107|	free(h->antiBools);
 2774|    107|	free(h->attrBools);
 2775|    107|}
archive_read_support_format_7zip.c:archive_read_format_7zip_read_data:
 1131|    998|{
 1132|    998|	struct _7zip *zip;
 1133|    998|	ssize_t bytes;
 1134|    998|	int ret = ARCHIVE_OK;
  ------------------
  |  |  233|    998|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1135|       |
 1136|    998|	zip = (struct _7zip *)(a->format->data);
 1137|       |
 1138|    998|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|    998|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (1138:6): [True: 0, False: 998]
  ------------------
 1139|      0|		zip->has_encrypted_entries = 0;
 1140|      0|	}
 1141|       |
 1142|    998|	if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (1142:6): [True: 0, False: 998]
  ------------------
 1143|      0|		read_consume(a);
 1144|       |
 1145|    998|	*offset = zip->entry_offset;
 1146|    998|	*size = 0;
 1147|    998|	*buff = NULL;
 1148|       |	/*
 1149|       |	 * If we hit end-of-entry last time, clean up and return
 1150|       |	 * ARCHIVE_EOF this time.
 1151|       |	 */
 1152|    998|	if (zip->end_of_entry)
  ------------------
  |  Branch (1152:6): [True: 990, False: 8]
  ------------------
 1153|    990|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|    990|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1154|       |
 1155|      8|	size_t bytes_to_read = 16 * 1024 * 1024;  // Don't try to read more than 16 MB at a time
 1156|      8|	if ((uint64_t)bytes_to_read > zip->entry_bytes_remaining) {
  ------------------
  |  Branch (1156:6): [True: 8, False: 0]
  ------------------
 1157|      8|		bytes_to_read = (size_t)zip->entry_bytes_remaining;
 1158|      8|	}
 1159|      8|	bytes = read_stream(a, buff, bytes_to_read, 0);
 1160|      8|	if (bytes < 0)
  ------------------
  |  Branch (1160:6): [True: 0, False: 8]
  ------------------
 1161|      0|		return ((int)bytes);
 1162|      8|	if (bytes == 0) {
  ------------------
  |  Branch (1162:6): [True: 4, False: 4]
  ------------------
 1163|      4|		archive_set_error(&a->archive,
 1164|      4|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1165|      4|		    "Truncated 7-Zip file body");
 1166|      4|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1167|      4|	}
 1168|      4|	zip->entry_bytes_remaining -= bytes;
 1169|      4|	if (zip->entry_bytes_remaining == 0)
  ------------------
  |  Branch (1169:6): [True: 4, False: 0]
  ------------------
 1170|      4|		zip->end_of_entry = 1;
 1171|       |
 1172|       |	/* Update checksum */
 1173|      4|	if ((zip->entry->flg & CRC32_IS_SET) && bytes)
  ------------------
  |  |  251|      4|#define CRC32_IS_SET	(1<<3)
  ------------------
  |  Branch (1173:6): [True: 4, False: 0]
  |  Branch (1173:42): [True: 4, False: 0]
  ------------------
 1174|      4|		zip->entry_crc32 = crc32(zip->entry_crc32, *buff,
 1175|      4|		    (unsigned)bytes);
 1176|       |
 1177|       |	/* If we hit the end, swallow any end-of-data marker. */
 1178|      4|	if (zip->end_of_entry) {
  ------------------
  |  Branch (1178:6): [True: 4, False: 0]
  ------------------
 1179|       |		/* Check computed CRC against file contents. */
 1180|      4|		if ((zip->entry->flg & CRC32_IS_SET) &&
  ------------------
  |  |  251|      4|#define CRC32_IS_SET	(1<<3)
  ------------------
  |  Branch (1180:7): [True: 4, False: 0]
  ------------------
 1181|      4|			zip->si.ss.digests[zip->entry->ssIndex] !=
  ------------------
  |  Branch (1181:4): [True: 4, False: 0]
  ------------------
 1182|      4|		    zip->entry_crc32) {
 1183|      4|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1184|      4|			    "7-Zip bad CRC: 0x%lx should be 0x%lx",
 1185|      4|			    (unsigned long)zip->entry_crc32,
 1186|      4|			    (unsigned long)zip->si.ss.digests[
 1187|      4|			    		zip->entry->ssIndex]);
 1188|      4|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|      4|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1189|      4|		}
 1190|      4|	}
 1191|       |
 1192|      4|	*size = bytes;
 1193|      4|	*offset = zip->entry_offset;
 1194|      4|	zip->entry_offset += bytes;
 1195|       |
 1196|      4|	return (ret);
 1197|      8|}
archive_read_support_format_7zip.c:archive_read_format_7zip_read_data_skip:
 1201|    994|{
 1202|    994|	struct _7zip *zip;
 1203|    994|	int64_t bytes_skipped;
 1204|       |
 1205|    994|	zip = (struct _7zip *)(a->format->data);
 1206|       |
 1207|    994|	if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (1207:6): [True: 4, False: 990]
  ------------------
 1208|      4|		read_consume(a);
 1209|       |
 1210|       |	/* If we've already read to end of data, we're done. */
 1211|    994|	if (zip->end_of_entry)
  ------------------
  |  Branch (1211:6): [True: 994, False: 0]
  ------------------
 1212|    994|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    994|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1213|       |
 1214|       |	/*
 1215|       |	 * If the length is at the beginning, we can skip the
 1216|       |	 * compressed data much more quickly.
 1217|       |	 */
 1218|      0|	bytes_skipped = skip_stream(a, (size_t)zip->entry_bytes_remaining);
 1219|      0|	if (bytes_skipped < 0)
  ------------------
  |  Branch (1219:6): [True: 0, False: 0]
  ------------------
 1220|      0|		return ((int)bytes_skipped);
 1221|      0|	zip->entry_bytes_remaining = 0;
 1222|       |
 1223|       |	/* This entry is finished and done. */
 1224|      0|	zip->end_of_entry = 1;
 1225|      0|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1226|      0|}
archive_read_support_format_7zip.c:archive_read_format_7zip_cleanup:
 1230|  2.49k|{
 1231|  2.49k|	struct _7zip *zip;
 1232|       |
 1233|  2.49k|	zip = (struct _7zip *)(a->format->data);
 1234|  2.49k|	free_StreamsInfo(&(zip->si));
 1235|  2.49k|	free(zip->entries);
 1236|  2.49k|	free(zip->entry_names);
 1237|  2.49k|	free_decompression(a, zip);
 1238|  2.49k|	free(zip->uncompressed_buffer);
 1239|  2.49k|	free(zip->sub_stream_buff[0]);
 1240|  2.49k|	free(zip->sub_stream_buff[1]);
 1241|  2.49k|	free(zip->sub_stream_buff[2]);
 1242|  2.49k|	free(zip->tmp_stream_buff);
 1243|  2.49k|	free(zip);
 1244|  2.49k|	(a->format->data) = NULL;
 1245|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1246|  2.49k|}
archive_read_support_format_7zip.c:free_decompression:
 2025|  2.49k|{
 2026|  2.49k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2027|       |
 2028|       |#if !defined(HAVE_ZLIB_H) &&\
 2029|       |	!(defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR))
 2030|       |	(void)a;/* UNUSED */
 2031|       |#endif
 2032|  2.49k|#ifdef HAVE_LZMA_H
 2033|  2.49k|	if (zip->lzstream_valid)
  ------------------
  |  Branch (2033:6): [True: 0, False: 2.49k]
  ------------------
 2034|      0|		lzma_end(&(zip->lzstream));
 2035|  2.49k|#endif
 2036|  2.49k|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 2037|  2.49k|	if (zip->bzstream_valid) {
  ------------------
  |  Branch (2037:6): [True: 0, False: 2.49k]
  ------------------
 2038|      0|		if (BZ2_bzDecompressEnd(&(zip->bzstream)) != BZ_OK) {
  ------------------
  |  Branch (2038:7): [True: 0, False: 0]
  ------------------
 2039|      0|			archive_set_error(&a->archive,
 2040|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2041|      0|			    "Failed to clean up bzip2 decompressor");
 2042|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2043|      0|		}
 2044|      0|		zip->bzstream_valid = 0;
 2045|      0|	}
 2046|  2.49k|#endif
 2047|  2.49k|#ifdef HAVE_ZLIB_H
 2048|  2.49k|	if (zip->stream_valid) {
  ------------------
  |  Branch (2048:6): [True: 0, False: 2.49k]
  ------------------
 2049|      0|		if (inflateEnd(&(zip->stream)) != Z_OK) {
  ------------------
  |  Branch (2049:7): [True: 0, False: 0]
  ------------------
 2050|      0|			archive_set_error(&a->archive,
 2051|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2052|      0|			    "Failed to clean up zlib decompressor");
 2053|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2054|      0|		}
 2055|      0|		zip->stream_valid = 0;
 2056|      0|	}
 2057|  2.49k|#endif
 2058|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 2059|       |	if (zip->zstdstream_valid)
 2060|       |		ZSTD_freeDStream(zip->zstd_dstream);
 2061|       |#endif
 2062|  2.49k|	if (zip->ppmd7_valid) {
  ------------------
  |  Branch (2062:6): [True: 64, False: 2.43k]
  ------------------
 2063|     64|		__archive_ppmd7_functions.Ppmd7_Free(
 2064|     64|			&zip->ppmd7_context);
 2065|     64|		zip->ppmd7_valid = 0;
 2066|     64|	}
 2067|  2.49k|	return (r);
 2068|  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.45k|{
  149|  2.45k|	const void *h;
  150|       |
  151|  2.45k|	(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.45k|	if ((h = __archive_read_ahead(a, 8, NULL)) == NULL)
  ------------------
  |  Branch (157:6): [True: 18, False: 2.44k]
  ------------------
  158|     18|		return (-1);
  159|  2.44k|	if (memcmp(h, "!<arch>\n", 8) == 0) {
  ------------------
  |  Branch (159:6): [True: 19, False: 2.42k]
  ------------------
  160|     19|		return (64);
  161|     19|	}
  162|  2.42k|	return (-1);
  163|  2.44k|}
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.45k|{
  419|  2.45k|	const char *p;
  420|  2.45k|	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.45k|	if (best_bid > 64)
  ------------------
  |  Branch (424:6): [True: 249, False: 2.20k]
  ------------------
  425|    249|		return (-1);
  426|       |
  427|  2.20k|	if ((p = __archive_read_ahead(a, 8, NULL)) == NULL)
  ------------------
  |  Branch (427:6): [True: 24, False: 2.18k]
  ------------------
  428|     24|		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 an '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|    457|		while (offset < (1024 * 128)) {
  ------------------
  |  Branch (441:10): [True: 446, False: 11]
  ------------------
  442|    446|			const char *h = __archive_read_ahead(a, offset + window,
  443|    446|			    &bytes_avail);
  444|    446|			if (h == NULL) {
  ------------------
  |  Branch (444:8): [True: 320, False: 126]
  ------------------
  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|    126|			p = h + offset;
  452|  1.59M|			while (p + 8 < h + bytes_avail) {
  ------------------
  |  Branch (452:11): [True: 1.59M, False: 81]
  ------------------
  453|  1.59M|				int next;
  454|  1.59M|				if ((next = find_cab_magic(p)) == 0)
  ------------------
  |  Branch (454:9): [True: 45, False: 1.59M]
  ------------------
  455|     45|					return (64);
  456|  1.59M|				p += next;
  457|  1.59M|			}
  458|     81|			offset = p - h;
  459|     81|		}
  460|    109|	}
  461|  2.06k|	return (0);
  462|  2.15k|}
archive_read_support_format_cab.c:find_cab_magic:
  395|  1.63M|{
  396|  1.63M|	switch (p[4]) {
  397|   872k|	case 0:
  ------------------
  |  Branch (397:2): [True: 872k, False: 759k]
  ------------------
  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|   872k|		if (memcmp(p, "MSCF\0\0\0\0", 8) == 0)
  ------------------
  |  Branch (405:7): [True: 90, False: 872k]
  ------------------
  406|     90|			return 0;
  407|   872k|		return 5;
  408|  1.02k|	case 'F': return 1;
  ------------------
  |  Branch (408:2): [True: 1.02k, False: 1.63M]
  ------------------
  409|  2.76k|	case 'C': return 2;
  ------------------
  |  Branch (409:2): [True: 2.76k, False: 1.62M]
  ------------------
  410|  4.46k|	case 'S': return 3;
  ------------------
  |  Branch (410:2): [True: 4.46k, False: 1.62M]
  ------------------
  411|  12.2k|	case 'M': return 4;
  ------------------
  |  Branch (411:2): [True: 12.2k, False: 1.61M]
  ------------------
  412|   738k|	default:  return 5;
  ------------------
  |  Branch (412:2): [True: 738k, False: 893k]
  ------------------
  413|  1.63M|	}
  414|  1.63M|}
archive_read_support_format_cab.c:archive_read_format_cab_read_header:
  889|    100|{
  890|    100|	struct cab *cab;
  891|    100|	struct cfheader *hd;
  892|    100|	struct cffolder *prev_folder;
  893|    100|	struct cffile *file;
  894|    100|	struct archive_string_conv *sconv;
  895|    100|	int err = ARCHIVE_OK, r;
  ------------------
  |  |  233|    100|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  896|       |	
  897|    100|	cab = (struct cab *)(a->format->data);
  898|    100|	if (cab->found_header == 0) {
  ------------------
  |  Branch (898:6): [True: 72, False: 28]
  ------------------
  899|     72|		err = cab_read_header(a); 
  900|     72|		if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|     72|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (900:7): [True: 2, False: 70]
  ------------------
  901|      2|			return (err);
  902|       |		/* We've found the header. */
  903|     70|		cab->found_header = 1;
  904|     70|	}
  905|     98|	hd = &cab->cfheader;
  906|       |
  907|     98|	if (hd->file_index >= hd->file_count) {
  ------------------
  |  Branch (907:6): [True: 12, False: 86]
  ------------------
  908|     12|		cab->end_of_archive = 1;
  909|     12|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|     12|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  910|     12|	}
  911|     86|	file = &hd->file_array[hd->file_index++];
  912|       |
  913|     86|	cab->end_of_entry = 0;
  914|     86|	cab->end_of_entry_cleanup = 0;
  915|     86|	cab->entry_compressed_bytes_read = 0;
  916|     86|	cab->entry_uncompressed_bytes_read = 0;
  917|     86|	cab->entry_unconsumed = 0;
  918|     86|	cab->entry_cffile = file;
  919|       |
  920|       |	/*
  921|       |	 * Choose a proper folder.
  922|       |	 */
  923|     86|	prev_folder = cab->entry_cffolder;
  924|     86|	switch (file->folder) {
  925|      3|	case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  233|      3|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (925:2): [True: 3, False: 83]
  ------------------
  926|      3|	case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  235|      3|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (926:2): [True: 0, False: 86]
  ------------------
  927|      3|		cab->entry_cffolder = &hd->folder_array[0];
  928|      3|		break;
  929|      9|	case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  234|      9|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (929:2): [True: 9, False: 77]
  ------------------
  930|      9|		cab->entry_cffolder = &hd->folder_array[hd->folder_count-1];
  931|      9|		break;
  932|     74|	default:
  ------------------
  |  Branch (932:2): [True: 74, False: 12]
  ------------------
  933|     74|		cab->entry_cffolder = &hd->folder_array[file->folder];
  934|     74|		break;
  935|     86|	}
  936|       |	/* If a cffolder of this file is changed, reset a cfdata to read
  937|       |	 * file contents from next cfdata. */
  938|     86|	if (prev_folder != cab->entry_cffolder)
  ------------------
  |  Branch (938:6): [True: 70, False: 16]
  ------------------
  939|     70|		cab->entry_cfdata = NULL;
  940|       |
  941|       |	/* If a pathname is UTF-8, prepare a string conversion object
  942|       |	 * for UTF-8 and use it. */
  943|     86|	if (file->attr & ATTR_NAME_IS_UTF) {
  ------------------
  |  |  238|     86|#define ATTR_NAME_IS_UTF	0x80
  ------------------
  |  Branch (943:6): [True: 3, False: 83]
  ------------------
  944|      3|		if (cab->sconv_utf8 == NULL) {
  ------------------
  |  Branch (944:7): [True: 3, False: 0]
  ------------------
  945|      3|			cab->sconv_utf8 =
  946|      3|			    archive_string_conversion_from_charset(
  947|      3|				&(a->archive), "UTF-8", 1);
  948|      3|			if (cab->sconv_utf8 == NULL)
  ------------------
  |  Branch (948:8): [True: 0, False: 3]
  ------------------
  949|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  950|      3|		}
  951|      3|		sconv = cab->sconv_utf8;
  952|     83|	} else if (cab->sconv != NULL) {
  ------------------
  |  Branch (952:13): [True: 0, False: 83]
  ------------------
  953|       |		/* Choose the conversion specified by the option. */
  954|      0|		sconv = cab->sconv;
  955|     83|	} else {
  956|       |		/* Choose the default conversion. */
  957|     83|		if (!cab->init_default_conversion) {
  ------------------
  |  Branch (957:7): [True: 67, False: 16]
  ------------------
  958|     67|			cab->sconv_default =
  959|     67|			    archive_string_default_conversion_for_read(
  960|     67|			      &(a->archive));
  961|     67|			cab->init_default_conversion = 1;
  962|     67|		}
  963|     83|		sconv = cab->sconv_default;
  964|     83|	}
  965|       |
  966|       |	/*
  967|       |	 * Set a default value and common data
  968|       |	 */
  969|     86|	r = cab_convert_path_separator_1(&(file->pathname), file->attr);
  970|     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 (970:6): [True: 3, False: 83]
  ------------------
  971|     86|	    archive_strlen(&(file->pathname)), sconv) != 0) {
  ------------------
  |  |  178|     86|#define	archive_strlen(a) ((a)->length)
  ------------------
  972|      3|		if (errno == ENOMEM) {
  ------------------
  |  Branch (972:7): [True: 0, False: 3]
  ------------------
  973|      0|			archive_set_error(&a->archive, ENOMEM,
  974|      0|			    "Can't allocate memory for Pathname");
  975|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  976|      0|		}
  977|      3|		archive_set_error(&a->archive,
  978|      3|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  979|      3|		    "Pathname cannot be converted "
  980|      3|		    "from %s to current locale",
  981|      3|		    archive_string_conversion_charset_name(sconv));
  982|      3|		err = ARCHIVE_WARN;
  ------------------
  |  |  235|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  983|      3|	}
  984|     86|	if (r < 0) {
  ------------------
  |  Branch (984:6): [True: 0, False: 86]
  ------------------
  985|       |		/* Convert a path separator '\' -> '/' */
  986|      0|		cab_convert_path_separator_2(cab, entry);
  987|      0|	}
  988|       |
  989|     86|	archive_entry_set_size(entry, file->uncompressed_size);
  990|     86|	if (file->attr & ATTR_RDONLY)
  ------------------
  |  |  237|     86|#define ATTR_RDONLY		0x01
  ------------------
  |  Branch (990:6): [True: 14, False: 72]
  ------------------
  991|     14|		archive_entry_set_mode(entry, AE_IFREG | 0555);
  ------------------
  |  |  216|     14|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  992|     72|	else
  993|     72|		archive_entry_set_mode(entry, AE_IFREG | 0666);
  ------------------
  |  |  216|     72|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  994|     86|	archive_entry_set_mtime(entry, file->mtime, 0);
  995|       |
  996|     86|	cab->entry_bytes_remaining = file->uncompressed_size;
  997|     86|	cab->entry_offset = 0;
  998|       |	/* We don't need compress data. */
  999|     86|	if (file->uncompressed_size == 0)
  ------------------
  |  Branch (999:6): [True: 0, False: 86]
  ------------------
 1000|      0|		cab->end_of_entry_cleanup = cab->end_of_entry = 1;
 1001|       |
 1002|       |	/* Set up a more descriptive format name. */
 1003|     86|	snprintf(cab->format_name, sizeof(cab->format_name), "CAB %d.%d (%s)",
 1004|     86|	    hd->major, hd->minor, cab->entry_cffolder->compname);
 1005|     86|	a->archive.archive_format_name = cab->format_name;
 1006|       |
 1007|     86|	return (err);
 1008|     86|}
archive_read_support_format_cab.c:cab_read_header:
  622|     72|{
  623|     72|	const unsigned char *p;
  624|     72|	struct cab *cab;
  625|     72|	struct cfheader *hd;
  626|     72|	size_t bytes, used;
  627|     72|	ssize_t len;
  628|     72|	int64_t skip;
  629|     72|	int err, i;
  630|     72|	int cur_folder, prev_folder;
  631|     72|	uint32_t offset32;
  632|       |	
  633|     72|	a->archive.archive_format = ARCHIVE_FORMAT_CAB;
  ------------------
  |  |  383|     72|#define	ARCHIVE_FORMAT_CAB			0xC0000
  ------------------
  634|     72|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (634:6): [True: 72, False: 0]
  ------------------
  635|     72|		a->archive.archive_format_name = "CAB";
  636|       |
  637|     72|	if ((p = __archive_read_ahead(a, 42, NULL)) == NULL)
  ------------------
  |  Branch (637:6): [True: 0, False: 72]
  ------------------
  638|      0|		return (truncated_error(a));
  639|       |
  640|     72|	cab = (struct cab *)(a->format->data);
  641|     72|	if (cab->found_header == 0 &&
  ------------------
  |  Branch (641:6): [True: 72, False: 0]
  ------------------
  642|     72|	    p[0] == 'M' && p[1] == 'Z') {
  ------------------
  |  Branch (642:6): [True: 72, False: 0]
  |  Branch (642:21): [True: 45, False: 27]
  ------------------
  643|       |		/* This is an executable?  Must be self-extracting... */
  644|     45|		err = cab_skip_sfx(a);
  645|     45|		if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|     45|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (645:7): [True: 0, False: 45]
  ------------------
  646|      0|			return (err);
  647|       |
  648|       |		/* Re-read header after processing the SFX. */
  649|     45|		if ((p = __archive_read_ahead(a, 42, NULL)) == NULL)
  ------------------
  |  Branch (649:7): [True: 0, False: 45]
  ------------------
  650|      0|			return (truncated_error(a));
  651|     45|	}
  652|       |
  653|     72|	cab->cab_offset = 0;
  654|       |	/*
  655|       |	 * Read CFHEADER.
  656|       |	 */
  657|     72|	hd = &cab->cfheader;
  658|     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 (658:6): [True: 0, False: 72]
  |  Branch (658:40): [True: 0, False: 72]
  ------------------
  659|     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 (659:6): [True: 0, False: 72]
  |  Branch (659:40): [True: 0, False: 72]
  ------------------
  660|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  661|      0|		    "Couldn't find out CAB header");
  662|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  663|      0|	}
  664|     72|	hd->total_bytes = archive_le32dec(p + CFHEADER_cbCabinet);
  ------------------
  |  |  151|     72|#define CFHEADER_cbCabinet	8
  ------------------
  665|     72|	hd->files_offset = archive_le32dec(p + CFHEADER_coffFiles);
  ------------------
  |  |  152|     72|#define CFHEADER_coffFiles	16
  ------------------
  666|     72|	hd->minor = p[CFHEADER_versionMinor];
  ------------------
  |  |  153|     72|#define CFHEADER_versionMinor	24
  ------------------
  667|     72|	hd->major = p[CFHEADER_versionMajor];
  ------------------
  |  |  154|     72|#define CFHEADER_versionMajor	25
  ------------------
  668|     72|	hd->folder_count = archive_le16dec(p + CFHEADER_cFolders);
  ------------------
  |  |  155|     72|#define CFHEADER_cFolders	26
  ------------------
  669|     72|	if (hd->folder_count == 0)
  ------------------
  |  Branch (669:6): [True: 0, False: 72]
  ------------------
  670|      0|		goto invalid;
  671|     72|	hd->file_count = archive_le16dec(p + CFHEADER_cFiles);
  ------------------
  |  |  156|     72|#define CFHEADER_cFiles		28
  ------------------
  672|     72|	if (hd->file_count == 0)
  ------------------
  |  Branch (672:6): [True: 0, False: 72]
  ------------------
  673|      0|		goto invalid;
  674|     72|	hd->flags = archive_le16dec(p + CFHEADER_flags);
  ------------------
  |  |  157|     72|#define CFHEADER_flags		30
  ------------------
  675|     72|	hd->setid = archive_le16dec(p + CFHEADER_setID);
  ------------------
  |  |  158|     72|#define CFHEADER_setID		32
  ------------------
  676|     72|	hd->cabinet = archive_le16dec(p + CFHEADER_iCabinet);
  ------------------
  |  |  159|     72|#define CFHEADER_iCabinet	34
  ------------------
  677|     72|	used = CFHEADER_iCabinet + 2;
  ------------------
  |  |  159|     72|#define CFHEADER_iCabinet	34
  ------------------
  678|     72|	if (hd->flags & RESERVE_PRESENT) {
  ------------------
  |  |  251|     72|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (678:6): [True: 0, False: 72]
  ------------------
  679|      0|		uint16_t cfheader;
  680|      0|		cfheader = archive_le16dec(p + CFHEADER_cbCFHeader);
  ------------------
  |  |  160|      0|#define CFHEADER_cbCFHeader	36
  ------------------
  681|      0|		if (cfheader > 60000U)
  ------------------
  |  Branch (681:7): [True: 0, False: 0]
  ------------------
  682|      0|			goto invalid;
  683|      0|		hd->cffolder = p[CFHEADER_cbCFFolder];
  ------------------
  |  |  161|      0|#define CFHEADER_cbCFFolder	38
  ------------------
  684|      0|		hd->cfdata = p[CFHEADER_cbCFData];
  ------------------
  |  |  162|      0|#define CFHEADER_cbCFData	39
  ------------------
  685|      0|		used += 4;/* cbCFHeader, cbCFFolder and cbCFData */
  686|      0|		used += cfheader;/* abReserve */
  687|      0|	} else
  688|     72|		hd->cffolder = 0;/* Avoid compiling warning. */
  689|     72|	if (hd->flags & PREV_CABINET) {
  ------------------
  |  |  249|     72|#define PREV_CABINET	0x0001
  ------------------
  |  Branch (689:6): [True: 0, False: 72]
  ------------------
  690|       |		/* How many bytes are used for szCabinetPrev. */
  691|      0|		if ((p = __archive_read_ahead(a, used+256, NULL)) == NULL)
  ------------------
  |  Branch (691:7): [True: 0, False: 0]
  ------------------
  692|      0|			return (truncated_error(a));
  693|      0|		if ((len = cab_strnlen(p + used, 255)) <= 0)
  ------------------
  |  Branch (693:7): [True: 0, False: 0]
  ------------------
  694|      0|			goto invalid;
  695|      0|		used += len + 1;
  696|       |		/* How many bytes are used for szDiskPrev. */
  697|      0|		if ((p = __archive_read_ahead(a, used+256, NULL)) == NULL)
  ------------------
  |  Branch (697:7): [True: 0, False: 0]
  ------------------
  698|      0|			return (truncated_error(a));
  699|      0|		if ((len = cab_strnlen(p + used, 255)) <= 0)
  ------------------
  |  Branch (699:7): [True: 0, False: 0]
  ------------------
  700|      0|			goto invalid;
  701|      0|		used += len + 1;
  702|      0|	}
  703|     72|	if (hd->flags & NEXT_CABINET) {
  ------------------
  |  |  250|     72|#define NEXT_CABINET	0x0002
  ------------------
  |  Branch (703:6): [True: 2, False: 70]
  ------------------
  704|       |		/* How many bytes are used for szCabinetNext. */
  705|      2|		if ((p = __archive_read_ahead(a, used+256, NULL)) == NULL)
  ------------------
  |  Branch (705:7): [True: 0, False: 2]
  ------------------
  706|      0|			return (truncated_error(a));
  707|      2|		if ((len = cab_strnlen(p + used, 255)) <= 0)
  ------------------
  |  Branch (707:7): [True: 0, False: 2]
  ------------------
  708|      0|			goto invalid;
  709|      2|		used += len + 1;
  710|       |		/* How many bytes are used for szDiskNext. */
  711|      2|		if ((p = __archive_read_ahead(a, used+256, NULL)) == NULL)
  ------------------
  |  Branch (711:7): [True: 0, False: 2]
  ------------------
  712|      0|			return (truncated_error(a));
  713|      2|		if ((len = cab_strnlen(p + used, 255)) <= 0)
  ------------------
  |  Branch (713:7): [True: 0, False: 2]
  ------------------
  714|      0|			goto invalid;
  715|      2|		used += len + 1;
  716|      2|	}
  717|     72|	__archive_read_consume(a, used);
  718|     72|	cab->cab_offset += used;
  719|     72|	used = 0;
  720|       |
  721|       |	/*
  722|       |	 * Read CFFOLDER.
  723|       |	 */
  724|     72|	hd->folder_array = calloc(
  725|     72|	    hd->folder_count, sizeof(struct cffolder));
  726|     72|	if (hd->folder_array == NULL)
  ------------------
  |  Branch (726:6): [True: 0, False: 72]
  ------------------
  727|      0|		goto nomem;
  728|       |	
  729|     72|	bytes = 8;
  730|     72|	if (hd->flags & RESERVE_PRESENT)
  ------------------
  |  |  251|     72|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (730:6): [True: 0, False: 72]
  ------------------
  731|      0|		bytes += hd->cffolder;
  732|     72|	bytes *= hd->folder_count;
  733|     72|	if ((p = __archive_read_ahead(a, bytes, NULL)) == NULL)
  ------------------
  |  Branch (733:6): [True: 0, False: 72]
  ------------------
  734|      0|		return (truncated_error(a));
  735|     72|	offset32 = 0;
  736|    575|	for (i = 0; i < hd->folder_count; i++) {
  ------------------
  |  Branch (736:14): [True: 505, False: 70]
  ------------------
  737|    505|		struct cffolder *folder = &(hd->folder_array[i]);
  738|    505|		folder->cfdata_offset_in_cab =
  739|    505|		    archive_le32dec(p + CFFOLDER_coffCabStart);
  ------------------
  |  |  165|    505|#define CFFOLDER_coffCabStart	0
  ------------------
  740|    505|		folder->cfdata_count = archive_le16dec(p+CFFOLDER_cCFData);
  ------------------
  |  |  166|    505|#define CFFOLDER_cCFData	4
  ------------------
  741|    505|		folder->comptype =
  742|    505|		    archive_le16dec(p+CFFOLDER_typeCompress) & 0x0F;
  ------------------
  |  |  167|    505|#define CFFOLDER_typeCompress	6
  ------------------
  743|    505|		folder->compdata =
  744|    505|		    archive_le16dec(p+CFFOLDER_typeCompress) >> 8;
  ------------------
  |  |  167|    505|#define CFFOLDER_typeCompress	6
  ------------------
  745|       |		/* Get a compression name. */
  746|    505|		if (folder->comptype <
  ------------------
  |  Branch (746:7): [True: 329, False: 176]
  ------------------
  747|    505|		    sizeof(compression_name) / sizeof(compression_name[0]))
  748|    329|			folder->compname = compression_name[folder->comptype];
  749|    176|		else
  750|    176|			folder->compname = "UNKNOWN";
  751|    505|		p += 8;
  752|    505|		used += 8;
  753|    505|		if (hd->flags & RESERVE_PRESENT) {
  ------------------
  |  |  251|    505|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (753:7): [True: 0, False: 505]
  ------------------
  754|      0|			p += hd->cffolder;/* abReserve */
  755|      0|			used += hd->cffolder;
  756|      0|		}
  757|       |		/*
  758|       |		 * Sanity check if each data is acceptable.
  759|       |		 */
  760|    505|		if (offset32 >= folder->cfdata_offset_in_cab)
  ------------------
  |  Branch (760:7): [True: 2, False: 503]
  ------------------
  761|      2|			goto invalid;
  762|    503|		offset32 = folder->cfdata_offset_in_cab;
  763|       |
  764|       |		/* Set a request to initialize zlib for the CFDATA of
  765|       |		 * this folder. */
  766|    503|		folder->decompress_init = 0;
  767|    503|	}
  768|     70|	__archive_read_consume(a, used);
  769|     70|	cab->cab_offset += used;
  770|       |
  771|       |	/*
  772|       |	 * Read CFFILE.
  773|       |	 */
  774|       |	/* Seek read pointer to the offset of CFFILE if needed. */
  775|     70|	skip = (int64_t)hd->files_offset - cab->cab_offset;
  776|     70|	if (skip < 0) {
  ------------------
  |  Branch (776:6): [True: 0, False: 70]
  ------------------
  777|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  778|      0|		    "Invalid offset of CFFILE %jd < %jd",
  779|      0|		    (intmax_t)hd->files_offset, (intmax_t)cab->cab_offset);
  780|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  781|      0|	}
  782|     70|	if (skip) {
  ------------------
  |  Branch (782:6): [True: 0, False: 70]
  ------------------
  783|      0|		__archive_read_consume(a, skip);
  784|      0|		cab->cab_offset += skip;
  785|      0|	}
  786|       |	/* Allocate memory for CFDATA */
  787|     70|	hd->file_array = calloc(
  788|     70|	    hd->file_count, sizeof(struct cffile));
  789|     70|	if (hd->file_array == NULL)
  ------------------
  |  Branch (789:6): [True: 0, False: 70]
  ------------------
  790|      0|		goto nomem;
  791|       |
  792|     70|	prev_folder = -1;
  793|    160|	for (i = 0; i < hd->file_count; i++) {
  ------------------
  |  Branch (793:14): [True: 90, False: 70]
  ------------------
  794|     90|		struct cffile *file = &(hd->file_array[i]);
  795|     90|		ssize_t avail;
  796|       |
  797|     90|		if ((p = __archive_read_ahead(a, 16, NULL)) == NULL)
  ------------------
  |  Branch (797:7): [True: 0, False: 90]
  ------------------
  798|      0|			return (truncated_error(a));
  799|     90|		file->uncompressed_size = archive_le32dec(p + CFFILE_cbFile);
  ------------------
  |  |  171|     90|#define CFFILE_cbFile		0
  ------------------
  800|     90|		file->offset = archive_le32dec(p + CFFILE_uoffFolderStart);
  ------------------
  |  |  172|     90|#define CFFILE_uoffFolderStart	4
  ------------------
  801|     90|		file->folder = archive_le16dec(p + CFFILE_iFolder);
  ------------------
  |  |  173|     90|#define CFFILE_iFolder		8
  ------------------
  802|     90|		file->mtime = cab_dos_time(p + CFFILE_date_time);
  ------------------
  |  |  174|     90|#define CFFILE_date_time	10
  ------------------
  803|     90|		file->attr = (uint8_t)archive_le16dec(p + CFFILE_attribs);
  ------------------
  |  |  175|     90|#define CFFILE_attribs		14
  ------------------
  804|     90|		__archive_read_consume(a, 16);
  805|       |
  806|     90|		cab->cab_offset += 16;
  807|     90|		if ((p = cab_read_ahead_remaining(a, 256, &avail)) == NULL)
  ------------------
  |  Branch (807:7): [True: 0, False: 90]
  ------------------
  808|      0|			return (truncated_error(a));
  809|     90|		if ((len = cab_strnlen(p, avail-1)) <= 0)
  ------------------
  |  Branch (809:7): [True: 0, False: 90]
  ------------------
  810|      0|			goto invalid;
  811|       |
  812|       |		/* Copy a pathname.  */
  813|     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]
  |  |  ------------------
  ------------------
  814|     90|		archive_strncpy(&(file->pathname), p, len);
  ------------------
  |  |  173|     90|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
  815|     90|		__archive_read_consume(a, len + 1);
  816|     90|		cab->cab_offset += len + 1;
  817|       |
  818|       |		/*
  819|       |		 * Sanity check if each data is acceptable.
  820|       |		 */
  821|     90|		if (file->uncompressed_size > 0x7FFF8000)
  ------------------
  |  Branch (821:7): [True: 0, False: 90]
  ------------------
  822|      0|			goto invalid;/* Too large */
  823|     90|		if ((int64_t)file->offset + (int64_t)file->uncompressed_size
  ------------------
  |  Branch (823:7): [True: 0, False: 90]
  ------------------
  824|     90|		    > ARCHIVE_LITERAL_LL(0x7FFF8000))
  ------------------
  |  |  179|     90|# define	ARCHIVE_LITERAL_LL(x)	x##ll
  ------------------
  825|      0|			goto invalid;/* Too large */
  826|     90|		switch (file->folder) {
  827|     10|		case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  234|     10|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (827:3): [True: 10, False: 80]
  ------------------
  828|       |			/* This must be last file in a folder. */
  829|     10|			if (i != hd->file_count -1)
  ------------------
  |  Branch (829:8): [True: 0, False: 10]
  ------------------
  830|      0|				goto invalid;
  831|     10|			cur_folder = hd->folder_count -1;
  832|     10|			break;
  833|      0|		case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  235|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (833:3): [True: 0, False: 90]
  ------------------
  834|       |			/* This must be only one file in a folder. */
  835|      0|			if (hd->file_count != 1)
  ------------------
  |  Branch (835:8): [True: 0, False: 0]
  ------------------
  836|      0|				goto invalid;
  837|       |			/* FALL THROUGH */
  838|      3|		case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  233|      3|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (838:3): [True: 3, False: 87]
  ------------------
  839|       |			/* This must be first file in a folder. */
  840|      3|			if (i != 0)
  ------------------
  |  Branch (840:8): [True: 0, False: 3]
  ------------------
  841|      0|				goto invalid;
  842|      3|			prev_folder = cur_folder = 0;
  843|      3|			offset32 = file->offset;
  844|      3|			break;
  845|     77|		default:
  ------------------
  |  Branch (845:3): [True: 77, False: 13]
  ------------------
  846|     77|			if (file->folder >= hd->folder_count)
  ------------------
  |  Branch (846:8): [True: 0, False: 77]
  ------------------
  847|      0|				goto invalid;
  848|     77|			cur_folder = file->folder;
  849|     77|			break;
  850|     90|		}
  851|       |		/* Dot not back track. */
  852|     90|		if (cur_folder < prev_folder)
  ------------------
  |  Branch (852:7): [True: 0, False: 90]
  ------------------
  853|      0|			goto invalid;
  854|     90|		if (cur_folder != prev_folder)
  ------------------
  |  Branch (854:7): [True: 67, False: 23]
  ------------------
  855|     67|			offset32 = 0;
  856|     90|		prev_folder = cur_folder;
  857|       |
  858|       |		/* Make sure there are not any blanks from last file
  859|       |		 * contents. */
  860|     90|		if (offset32 != file->offset)
  ------------------
  |  Branch (860:7): [True: 0, False: 90]
  ------------------
  861|      0|			goto invalid;
  862|     90|		offset32 += file->uncompressed_size;
  863|       |
  864|       |		/* CFDATA is available for file contents. */
  865|     90|		if (file->uncompressed_size > 0 &&
  ------------------
  |  Branch (865:7): [True: 90, False: 0]
  ------------------
  866|     90|		    hd->folder_array[cur_folder].cfdata_count == 0)
  ------------------
  |  Branch (866:7): [True: 0, False: 90]
  ------------------
  867|      0|			goto invalid;
  868|     90|	}
  869|       |
  870|     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 (870:6): [True: 2, False: 68]
  |  Branch (870:26): [True: 0, False: 68]
  ------------------
  871|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  872|      2|		    "Multivolume cabinet file is unsupported");
  873|      2|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      2|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  874|      2|	}
  875|     68|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     68|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  876|      2|invalid:
  877|      2|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  878|      2|	    "Invalid CAB header");
  879|      2|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  880|      0|nomem:
  881|      0|	archive_set_error(&a->archive, ENOMEM,
  882|      0|	    "Can't allocate memory for CAB data");
  883|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  884|     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 is 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:
 2071|     90|{
 2072|     90|	int msTime, msDate;
 2073|     90|	struct tm ts;
 2074|       |
 2075|     90|	msDate = archive_le16dec(p);
 2076|     90|	msTime = archive_le16dec(p+2);
 2077|       |
 2078|     90|	memset(&ts, 0, sizeof(ts));
 2079|     90|	ts.tm_year = ((msDate >> 9) & 0x7f) + 80;   /* Years since 1900. */
 2080|     90|	ts.tm_mon = ((msDate >> 5) & 0x0f) - 1;     /* Month number.     */
 2081|     90|	ts.tm_mday = msDate & 0x1f;		    /* Day of month.     */
 2082|     90|	ts.tm_hour = (msTime >> 11) & 0x1f;
 2083|     90|	ts.tm_min = (msTime >> 5) & 0x3f;
 2084|     90|	ts.tm_sec = (msTime << 1) & 0x3e;
 2085|     90|	ts.tm_isdst = -1;
 2086|     90|	return (mktime(&ts));
 2087|     90|}
archive_read_support_format_cab.c:cab_read_ahead_remaining:
  560|     90|{
  561|     90|	const void *p = __archive_read_ahead(a, min, avail);
  562|       |
  563|     90|	if (p == NULL && *avail > 0)
  ------------------
  |  Branch (563:6): [True: 0, False: 90]
  |  Branch (563:19): [True: 0, False: 0]
  ------------------
  564|      0|		p = __archive_read_ahead(a, *avail, avail);
  565|       |
  566|     90|	return (p);
  567|     90|}
archive_read_support_format_cab.c:cab_convert_path_separator_1:
  572|     86|{
  573|     86|	size_t i;
  574|     86|	int mb;
  575|       |
  576|       |	/* Easy check if we have '\' in multi-byte string. */
  577|     86|	mb = 0;
  578|  23.4k|	for (i = 0; i < archive_strlen(fn); i++) {
  ------------------
  |  |  178|  23.4k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (578:14): [True: 23.3k, False: 86]
  ------------------
  579|  23.3k|		if (fn->s[i] == '\\') {
  ------------------
  |  Branch (579:7): [True: 37, False: 23.2k]
  ------------------
  580|     37|			if (mb) {
  ------------------
  |  Branch (580:8): [True: 0, False: 37]
  ------------------
  581|       |				/* This may be second byte of multi-byte
  582|       |				 * character. */
  583|      0|				break;
  584|      0|			}
  585|     37|			fn->s[i] = '/';
  586|     37|			mb = 0;
  587|  23.2k|		} else if ((fn->s[i] & 0x80) && !(attr & ATTR_NAME_IS_UTF))
  ------------------
  |  |  238|  6.59k|#define ATTR_NAME_IS_UTF	0x80
  ------------------
  |  Branch (587:14): [True: 6.59k, False: 16.6k]
  |  Branch (587:35): [True: 62, False: 6.53k]
  ------------------
  588|     62|			mb = 1;
  589|  23.2k|		else
  590|  23.2k|			mb = 0;
  591|  23.3k|	}
  592|     86|	if (i == archive_strlen(fn))
  ------------------
  |  |  178|     86|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (592:6): [True: 86, False: 0]
  ------------------
  593|     86|		return (0);
  594|      0|	return (-1);
  595|     86|}
archive_read_support_format_cab.c:archive_read_format_cab_read_data:
 1013|    146|{
 1014|    146|	struct cab *cab = (struct cab *)(a->format->data);
 1015|    146|	int r;
 1016|       |
 1017|    146|	switch (cab->entry_cffile->folder) {
 1018|      3|	case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  233|      3|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1018:2): [True: 3, False: 143]
  ------------------
 1019|     12|	case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  234|     12|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1019:2): [True: 9, False: 137]
  ------------------
 1020|     12|	case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  235|     12|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1020:2): [True: 0, False: 146]
  ------------------
 1021|     12|		*buff = NULL;
 1022|     12|		*size = 0;
 1023|     12|		*offset = 0;
 1024|     12|		archive_clear_error(&a->archive);
 1025|     12|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     12|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1026|     12|		    "Cannot restore this file split in multivolume");
 1027|     12|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     12|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1028|    134|	default:
  ------------------
  |  Branch (1028:2): [True: 134, False: 12]
  ------------------
 1029|    134|		break;
 1030|    146|	}
 1031|    134|	if (cab->read_data_invoked == 0) {
  ------------------
  |  Branch (1031:6): [True: 70, False: 64]
  ------------------
 1032|     70|		if (cab->bytes_skipped) {
  ------------------
  |  Branch (1032:7): [True: 3, False: 67]
  ------------------
 1033|      3|			if (cab->entry_cfdata == NULL) {
  ------------------
  |  Branch (1033:8): [True: 3, False: 0]
  ------------------
 1034|      3|				r = cab_next_cfdata(a);
 1035|      3|				if (r < 0)
  ------------------
  |  Branch (1035:9): [True: 0, False: 3]
  ------------------
 1036|      0|					return (r);
 1037|      3|			}
 1038|      3|			if (cab_consume_cfdata(a, cab->bytes_skipped) < 0)
  ------------------
  |  Branch (1038:8): [True: 0, False: 3]
  ------------------
 1039|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1040|      3|			cab->bytes_skipped = 0;
 1041|      3|		}
 1042|     70|		cab->read_data_invoked = 1;
 1043|     70|	}
 1044|    134|	if (cab->entry_unconsumed) {
  ------------------
  |  Branch (1044:6): [True: 37, False: 97]
  ------------------
 1045|       |		/* Consume as much as the compressor actually used. */
 1046|     37|		r = (int)cab_consume_cfdata(a, cab->entry_unconsumed);
 1047|     37|		cab->entry_unconsumed = 0;
 1048|     37|		if (r < 0)
  ------------------
  |  Branch (1048:7): [True: 0, False: 37]
  ------------------
 1049|      0|			return (r);
 1050|     37|	}
 1051|    134|	if (cab->end_of_archive || cab->end_of_entry) {
  ------------------
  |  Branch (1051:6): [True: 0, False: 134]
  |  Branch (1051:29): [True: 46, False: 88]
  ------------------
 1052|     46|		if (!cab->end_of_entry_cleanup) {
  ------------------
  |  Branch (1052:7): [True: 23, False: 23]
  ------------------
 1053|       |			/* End-of-entry cleanup done. */
 1054|     23|			cab->end_of_entry_cleanup = 1;
 1055|     23|		}
 1056|     46|		*offset = cab->entry_offset;
 1057|     46|		*size = 0;
 1058|     46|		*buff = NULL;
 1059|     46|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|     46|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1060|     46|	}
 1061|       |
 1062|     88|	return (cab_read_data(a, buff, size, offset));
 1063|    134|}
archive_read_support_format_cab.c:cab_next_cfdata:
 1198|    105|{
 1199|    105|	struct cab *cab = (struct cab *)(a->format->data);
 1200|    105|	struct cfdata *cfdata = cab->entry_cfdata;
 1201|       |
 1202|       |	/* There are remaining bytes in current CFDATA, use it first. */
 1203|    105|	if (cfdata != NULL && cfdata->uncompressed_bytes_remaining > 0)
  ------------------
  |  Branch (1203:6): [True: 35, False: 70]
  |  Branch (1203:24): [True: 14, False: 21]
  ------------------
 1204|     14|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     14|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1205|       |
 1206|     91|	if (cfdata == NULL) {
  ------------------
  |  Branch (1206:6): [True: 70, False: 21]
  ------------------
 1207|     70|		int64_t skip;
 1208|       |
 1209|     70|		cab->entry_cffolder->cfdata_index = 0;
 1210|       |
 1211|       |		/* Seek read pointer to the offset of CFDATA if needed. */
 1212|     70|		skip = cab->entry_cffolder->cfdata_offset_in_cab
 1213|     70|			- cab->cab_offset;
 1214|     70|		if (skip < 0) {
  ------------------
  |  Branch (1214:7): [True: 2, False: 68]
  ------------------
 1215|      2|			int folder_index;
 1216|      2|			switch (cab->entry_cffile->folder) {
 1217|      0|			case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  233|      0|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1217:4): [True: 0, False: 2]
  ------------------
 1218|      0|			case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  235|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1218:4): [True: 0, False: 2]
  ------------------
 1219|      0|				folder_index = 0;
 1220|      0|				break;
 1221|      0|			case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  234|      0|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1221:4): [True: 0, False: 2]
  ------------------
 1222|      0|				folder_index = cab->cfheader.folder_count-1;
 1223|      0|				break;
 1224|      2|			default:
  ------------------
  |  Branch (1224:4): [True: 2, False: 0]
  ------------------
 1225|      2|				folder_index = cab->entry_cffile->folder;
 1226|      2|				break;
 1227|      2|			}
 1228|      2|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1229|      2|			    "Invalid offset of CFDATA in folder(%d) %jd < %jd",
 1230|      2|			    folder_index,
 1231|      2|			    (intmax_t)cab->entry_cffolder->cfdata_offset_in_cab,
 1232|      2|			    (intmax_t)cab->cab_offset);
 1233|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1234|      2|		}
 1235|     68|		if (skip > 0) {
  ------------------
  |  Branch (1235:7): [True: 14, False: 54]
  ------------------
 1236|     14|			if (__archive_read_consume(a, skip) < 0)
  ------------------
  |  Branch (1236:8): [True: 0, False: 14]
  ------------------
 1237|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1238|     14|			cab->cab_offset =
 1239|     14|			    cab->entry_cffolder->cfdata_offset_in_cab;
 1240|     14|		}
 1241|     68|	}
 1242|       |
 1243|       |	/*
 1244|       |	 * Read a CFDATA.
 1245|       |	 */
 1246|     89|	if (cab->entry_cffolder->cfdata_index <
  ------------------
  |  Branch (1246:6): [True: 82, False: 7]
  ------------------
 1247|     89|	    cab->entry_cffolder->cfdata_count) {
 1248|     82|		const unsigned char *p;
 1249|     82|		int l;
 1250|       |
 1251|     82|		cfdata = &(cab->entry_cffolder->cfdata);
 1252|     82|		cab->entry_cffolder->cfdata_index++;
 1253|     82|		cab->entry_cfdata = cfdata;
 1254|     82|		cfdata->sum_calculated = 0;
 1255|     82|		cfdata->sum_extra_avail = 0;
 1256|     82|		cfdata->sum_ptr = NULL;
 1257|     82|		l = 8;
 1258|     82|		if (cab->cfheader.flags & RESERVE_PRESENT)
  ------------------
  |  |  251|     82|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (1258:7): [True: 0, False: 82]
  ------------------
 1259|      0|			l += cab->cfheader.cfdata;
 1260|     82|		if ((p = __archive_read_ahead(a, l, NULL)) == NULL)
  ------------------
  |  Branch (1260:7): [True: 2, False: 80]
  ------------------
 1261|      2|			return (truncated_error(a));
 1262|     80|		cfdata->sum = archive_le32dec(p + CFDATA_csum);
  ------------------
  |  |  178|     80|#define CFDATA_csum		0
  ------------------
 1263|     80|		cfdata->compressed_size = archive_le16dec(p + CFDATA_cbData);
  ------------------
  |  |  179|     80|#define CFDATA_cbData		4
  ------------------
 1264|     80|		cfdata->compressed_bytes_remaining = cfdata->compressed_size;
 1265|     80|		cfdata->uncompressed_size =
 1266|     80|		    archive_le16dec(p + CFDATA_cbUncomp);
  ------------------
  |  |  180|     80|#define CFDATA_cbUncomp		6
  ------------------
 1267|     80|		cfdata->uncompressed_bytes_remaining =
 1268|     80|		    cfdata->uncompressed_size;
 1269|     80|		cfdata->uncompressed_avail = 0;
 1270|     80|		cfdata->read_offset = 0;
 1271|     80|		cfdata->unconsumed = 0;
 1272|       |
 1273|       |		/*
 1274|       |		 * Sanity check if data size is acceptable.
 1275|       |		 */
 1276|     80|		if (cfdata->compressed_size == 0 ||
  ------------------
  |  Branch (1276:7): [True: 0, False: 80]
  ------------------
 1277|     80|		    cfdata->compressed_size > (0x8000+6144))
  ------------------
  |  Branch (1277:7): [True: 0, False: 80]
  ------------------
 1278|      0|			goto invalid;
 1279|     80|		if (cfdata->uncompressed_size > 0x8000)
  ------------------
  |  Branch (1279:7): [True: 0, False: 80]
  ------------------
 1280|      0|			goto invalid;
 1281|     80|		if (cfdata->uncompressed_size == 0) {
  ------------------
  |  Branch (1281:7): [True: 1, False: 79]
  ------------------
 1282|      1|			switch (cab->entry_cffile->folder) {
 1283|      0|			case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  235|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1283:4): [True: 0, False: 1]
  ------------------
 1284|      1|			case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  234|      1|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1284:4): [True: 1, False: 0]
  ------------------
 1285|      1|				break;
 1286|      0|			case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  233|      0|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1286:4): [True: 0, False: 1]
  ------------------
 1287|      0|			default:
  ------------------
  |  Branch (1287:4): [True: 0, False: 1]
  ------------------
 1288|      0|				goto invalid;
 1289|      1|			}
 1290|      1|		}
 1291|       |		/* If CFDATA is not last in a folder, an uncompressed
 1292|       |		 * size must be 0x8000(32KBi) */
 1293|     80|		if ((cab->entry_cffolder->cfdata_index <
  ------------------
  |  Branch (1293:7): [True: 46, False: 34]
  ------------------
 1294|     80|		     cab->entry_cffolder->cfdata_count) &&
 1295|     46|		       cfdata->uncompressed_size != 0x8000)
  ------------------
  |  Branch (1295:10): [True: 0, False: 46]
  ------------------
 1296|      0|			goto invalid;
 1297|       |
 1298|       |		/* A compressed data size and an uncompressed data size must
 1299|       |		 * be the same in no compression mode. */
 1300|     80|		if (cab->entry_cffolder->comptype == COMPTYPE_NONE &&
  ------------------
  |  |  215|    160|#define COMPTYPE_NONE		0x0000
  ------------------
  |  Branch (1300:7): [True: 3, False: 77]
  ------------------
 1301|      3|		    cfdata->compressed_size != cfdata->uncompressed_size)
  ------------------
  |  Branch (1301:7): [True: 0, False: 3]
  ------------------
 1302|      0|			goto invalid;
 1303|       |
 1304|       |		/*
 1305|       |		 * Save CFDATA image for sum check.
 1306|       |		 */
 1307|     80|		if (cfdata->memimage_size < (size_t)l) {
  ------------------
  |  Branch (1307:7): [True: 68, False: 12]
  ------------------
 1308|     68|			free(cfdata->memimage);
 1309|     68|			cfdata->memimage = malloc(l);
 1310|     68|			if (cfdata->memimage == NULL) {
  ------------------
  |  Branch (1310:8): [True: 0, False: 68]
  ------------------
 1311|      0|				archive_set_error(&a->archive, ENOMEM,
 1312|      0|				    "Can't allocate memory for CAB data");
 1313|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1314|      0|			}
 1315|     68|			cfdata->memimage_size = l;
 1316|     68|		}
 1317|     80|		memcpy(cfdata->memimage, p, l);
 1318|       |
 1319|       |		/* Consume bytes as much as we used. */
 1320|     80|		__archive_read_consume(a, l);
 1321|     80|		cab->cab_offset += l;
 1322|     80|	} else if (cab->entry_cffolder->cfdata_count > 0) {
  ------------------
  |  Branch (1322:13): [True: 7, False: 0]
  ------------------
 1323|       |		/* Run out of all CFDATA in a folder. */
 1324|      7|		cfdata->compressed_size = 0;
 1325|      7|		cfdata->uncompressed_size = 0;
 1326|      7|		cfdata->compressed_bytes_remaining = 0;
 1327|      7|		cfdata->uncompressed_bytes_remaining = 0;
 1328|      7|	} else {
 1329|       |		/* Current folder does not have any CFDATA. */
 1330|      0|		cfdata = &(cab->entry_cffolder->cfdata);
 1331|      0|		cab->entry_cfdata = cfdata;
 1332|      0|		memset(cfdata, 0, sizeof(*cfdata));
 1333|      0|	}
 1334|     87|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     87|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1335|      0|invalid:
 1336|      0|	cfdata->compressed_size = 0;
 1337|      0|	cfdata->compressed_bytes_remaining = 0;
 1338|      0|	cfdata->uncompressed_size = 0;
 1339|      0|	cfdata->uncompressed_bytes_remaining = 0;
 1340|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1341|      0|	    "Invalid CFDATA");
 1342|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1343|     89|}
archive_read_support_format_cab.c:cab_consume_cfdata:
 1790|     49|{
 1791|     49|	struct cab *cab = (struct cab *)(a->format->data);
 1792|     49|	struct cfdata *cfdata;
 1793|     49|	int64_t cbytes, rbytes;
 1794|     49|	int err;
 1795|       |
 1796|     49|	rbytes = cab_minimum_consume_cfdata(a, consumed_bytes);
 1797|     49|	if (rbytes < 0)
  ------------------
  |  Branch (1797:6): [True: 0, False: 49]
  ------------------
 1798|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1799|       |
 1800|     49|	cfdata = cab->entry_cfdata;
 1801|     56|	while (rbytes > 0) {
  ------------------
  |  Branch (1801:9): [True: 14, False: 42]
  ------------------
 1802|     14|		ssize_t avail;
 1803|       |
 1804|     14|		if (cfdata->compressed_size == 0) {
  ------------------
  |  Branch (1804:7): [True: 0, False: 14]
  ------------------
 1805|      0|			archive_set_error(&a->archive,
 1806|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1807|      0|			    "Invalid CFDATA");
 1808|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1809|      0|		}
 1810|     14|		cbytes = cfdata->uncompressed_bytes_remaining;
 1811|     14|		if (cbytes > rbytes)
  ------------------
  |  Branch (1811:7): [True: 3, False: 11]
  ------------------
 1812|      3|			cbytes = rbytes;
 1813|     14|		rbytes -= cbytes;
 1814|       |
 1815|     14|		if (cfdata->uncompressed_avail == 0 &&
  ------------------
  |  Branch (1815:7): [True: 7, False: 7]
  ------------------
 1816|      7|		   (cab->entry_cffile->folder == iFoldCONTINUED_PREV_AND_NEXT ||
  ------------------
  |  |  235|     14|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1816:7): [True: 0, False: 7]
  ------------------
 1817|      7|		    cab->entry_cffile->folder == iFoldCONTINUED_FROM_PREV)) {
  ------------------
  |  |  233|      7|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1817:7): [True: 0, False: 7]
  ------------------
 1818|       |			/* We have not read any data yet. */
 1819|      0|			if (cbytes == cfdata->uncompressed_bytes_remaining) {
  ------------------
  |  Branch (1819:8): [True: 0, False: 0]
  ------------------
 1820|       |				/* Skip whole current CFDATA. */
 1821|      0|				__archive_read_consume(a,
 1822|      0|				    cfdata->compressed_size);
 1823|      0|				cab->cab_offset += cfdata->compressed_size;
 1824|      0|				cfdata->compressed_bytes_remaining = 0;
 1825|      0|				cfdata->uncompressed_bytes_remaining = 0;
 1826|      0|				err = cab_next_cfdata(a);
 1827|      0|				if (err < 0)
  ------------------
  |  Branch (1827:9): [True: 0, False: 0]
  ------------------
 1828|      0|					return (err);
 1829|      0|				cfdata = cab->entry_cfdata;
 1830|      0|				if (cfdata->uncompressed_size == 0) {
  ------------------
  |  Branch (1830:9): [True: 0, False: 0]
  ------------------
 1831|      0|					switch (cab->entry_cffile->folder) {
 1832|      0|					case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  235|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1832:6): [True: 0, False: 0]
  ------------------
 1833|      0|					case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  234|      0|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1833:6): [True: 0, False: 0]
  ------------------
 1834|      0|					case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  233|      0|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1834:6): [True: 0, False: 0]
  ------------------
 1835|      0|						rbytes = 0;
 1836|      0|						break;
 1837|      0|					default:
  ------------------
  |  Branch (1837:6): [True: 0, False: 0]
  ------------------
 1838|      0|						break;
 1839|      0|					}
 1840|      0|				}
 1841|      0|				continue;
 1842|      0|			}
 1843|      0|			cfdata->read_offset += (uint16_t)cbytes;
 1844|      0|			cfdata->uncompressed_bytes_remaining -= (uint16_t)cbytes;
 1845|      0|			break;
 1846|     14|		} else if (cbytes == 0) {
  ------------------
  |  Branch (1846:14): [True: 7, False: 7]
  ------------------
 1847|      7|			err = cab_next_cfdata(a);
 1848|      7|			if (err < 0)
  ------------------
  |  Branch (1848:8): [True: 1, False: 6]
  ------------------
 1849|      1|				return (err);
 1850|      6|			cfdata = cab->entry_cfdata;
 1851|      6|			if (cfdata->uncompressed_size == 0) {
  ------------------
  |  Branch (1851:8): [True: 2, False: 4]
  ------------------
 1852|      2|				switch (cab->entry_cffile->folder) {
 1853|      0|				case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  235|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1853:5): [True: 0, False: 2]
  ------------------
 1854|      2|				case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  234|      2|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1854:5): [True: 2, False: 0]
  ------------------
 1855|      2|				case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  233|      2|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1855:5): [True: 0, False: 2]
  ------------------
 1856|      2|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1857|      0|				default:
  ------------------
  |  Branch (1857:5): [True: 0, False: 2]
  ------------------
 1858|      0|					break;
 1859|      2|				}
 1860|      2|			}
 1861|      4|			continue;
 1862|      6|		}
 1863|     10|		while (cbytes > 0) {
  ------------------
  |  Branch (1863:10): [True: 7, False: 3]
  ------------------
 1864|      7|			(void)cab_read_ahead_cfdata(a, &avail);
 1865|      7|			if (avail <= 0)
  ------------------
  |  Branch (1865:8): [True: 4, False: 3]
  ------------------
 1866|      4|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1867|      3|			if (avail > cbytes)
  ------------------
  |  Branch (1867:8): [True: 3, False: 0]
  ------------------
 1868|      3|				avail = (ssize_t)cbytes;
 1869|      3|			if (cab_minimum_consume_cfdata(a, avail) < 0)
  ------------------
  |  Branch (1869:8): [True: 0, False: 3]
  ------------------
 1870|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1871|      3|			cbytes -= avail;
 1872|      3|		}
 1873|      7|	}
 1874|     42|	return (consumed_bytes);
 1875|     49|}
archive_read_support_format_cab.c:cab_minimum_consume_cfdata:
 1883|    605|{
 1884|    605|	struct cab *cab = (struct cab *)(a->format->data);
 1885|    605|	struct cfdata *cfdata;
 1886|    605|	int64_t cbytes, rbytes;
 1887|    605|	int err;
 1888|       |
 1889|    605|	cfdata = cab->entry_cfdata;
 1890|    605|	rbytes = consumed_bytes;
 1891|    605|	if (cab->entry_cffolder->comptype == COMPTYPE_NONE) {
  ------------------
  |  |  215|    605|#define COMPTYPE_NONE		0x0000
  ------------------
  |  Branch (1891:6): [True: 9, False: 596]
  ------------------
 1892|      9|		if (consumed_bytes < cfdata->unconsumed)
  ------------------
  |  Branch (1892:7): [True: 3, False: 6]
  ------------------
 1893|      3|			cbytes = consumed_bytes;
 1894|      6|		else
 1895|      6|			cbytes = cfdata->unconsumed;
 1896|      9|		rbytes -= cbytes; 
 1897|      9|		cfdata->read_offset += (uint16_t)cbytes;
 1898|      9|		cfdata->uncompressed_bytes_remaining -= (uint16_t)cbytes;
 1899|      9|		cfdata->unconsumed -= cbytes;
 1900|    596|	} else {
 1901|    596|		cbytes = cfdata->uncompressed_avail - cfdata->read_offset;
 1902|    596|		if (cbytes > 0) {
  ------------------
  |  Branch (1902:7): [True: 43, False: 553]
  ------------------
 1903|     43|			if (consumed_bytes < cbytes)
  ------------------
  |  Branch (1903:8): [True: 23, False: 20]
  ------------------
 1904|     23|				cbytes = consumed_bytes;
 1905|     43|			rbytes -= cbytes;
 1906|     43|			cfdata->read_offset += (uint16_t)cbytes;
 1907|     43|			cfdata->uncompressed_bytes_remaining -= (uint16_t)cbytes;
 1908|     43|		}
 1909|       |
 1910|    596|		if (cfdata->unconsumed) {
  ------------------
  |  Branch (1910:7): [True: 552, False: 44]
  ------------------
 1911|    552|			cbytes = cfdata->unconsumed;
 1912|    552|			cfdata->unconsumed = 0;
 1913|    552|		} else
 1914|     44|			cbytes = 0;
 1915|    596|	}
 1916|    605|	if (cbytes) {
  ------------------
  |  Branch (1916:6): [True: 558, False: 47]
  ------------------
 1917|       |		/* Compute the sum. */
 1918|    558|		cab_checksum_update(a, (size_t)cbytes);
 1919|       |
 1920|       |		/* Consume as much as the compressor actually used. */
 1921|    558|		__archive_read_consume(a, cbytes);
 1922|    558|		cab->cab_offset += cbytes;
 1923|    558|		cfdata->compressed_bytes_remaining -= (uint16_t)cbytes;
 1924|    558|		if (cfdata->compressed_bytes_remaining == 0) {
  ------------------
  |  Branch (1924:7): [True: 32, False: 526]
  ------------------
 1925|     32|			err = cab_checksum_finish(a);
 1926|     32|			if (err < 0)
  ------------------
  |  Branch (1926:8): [True: 0, False: 32]
  ------------------
 1927|      0|				return (err);
 1928|     32|		}
 1929|    558|	}
 1930|    605|	return (rbytes);
 1931|    605|}
archive_read_support_format_cab.c:cab_checksum_update:
 1113|    558|{
 1114|    558|	struct cab *cab = (struct cab *)(a->format->data);
 1115|    558|	struct cfdata *cfdata = cab->entry_cfdata;
 1116|    558|	const unsigned char *p;
 1117|    558|	size_t sumbytes;
 1118|       |
 1119|    558|	if (cfdata->sum == 0 || cfdata->sum_ptr == NULL)
  ------------------
  |  Branch (1119:6): [True: 56, False: 502]
  |  Branch (1119:26): [True: 9, False: 493]
  ------------------
 1120|     65|		return;
 1121|       |	/*
 1122|       |	 * Calculate the sum of this CFDATA.
 1123|       |	 * Make sure CFDATA must be calculated in four bytes.
 1124|       |	 */
 1125|    493|	p = cfdata->sum_ptr;
 1126|    493|	sumbytes = bytes;
 1127|    493|	if (cfdata->sum_extra_avail) {
  ------------------
  |  Branch (1127:6): [True: 209, False: 284]
  ------------------
 1128|    625|		while (cfdata->sum_extra_avail < 4 && sumbytes > 0) {
  ------------------
  |  Branch (1128:10): [True: 416, False: 209]
  |  Branch (1128:41): [True: 416, False: 0]
  ------------------
 1129|    416|			cfdata->sum_extra[
 1130|    416|			    cfdata->sum_extra_avail++] = *p++;
 1131|    416|			sumbytes--;
 1132|    416|		}
 1133|    209|		if (cfdata->sum_extra_avail == 4) {
  ------------------
  |  Branch (1133:7): [True: 209, False: 0]
  ------------------
 1134|    209|			cfdata->sum_calculated = cab_checksum_cfdata_4(
 1135|    209|			    cfdata->sum_extra, 4, cfdata->sum_calculated);
 1136|    209|			cfdata->sum_extra_avail = 0;
 1137|    209|		}
 1138|    209|	}
 1139|    493|	if (sumbytes) {
  ------------------
  |  Branch (1139:6): [True: 493, False: 0]
  ------------------
 1140|    493|		int odd = sumbytes & 3;
 1141|    493|		if ((int)(sumbytes - odd) > 0)
  ------------------
  |  Branch (1141:7): [True: 486, False: 7]
  ------------------
 1142|    486|			cfdata->sum_calculated = cab_checksum_cfdata_4(
 1143|    486|			    p, sumbytes - odd, cfdata->sum_calculated);
 1144|    493|		if (odd)
  ------------------
  |  Branch (1144:7): [True: 245, False: 248]
  ------------------
 1145|    245|			memcpy(cfdata->sum_extra, p + sumbytes - odd, odd);
 1146|    493|		cfdata->sum_extra_avail = odd;
 1147|    493|	}
 1148|       |	cfdata->sum_ptr = NULL;
 1149|    493|}
archive_read_support_format_cab.c:cab_checksum_cfdata_4:
 1067|    739|{
 1068|    739|	const unsigned char *b;
 1069|    739|	unsigned u32num;
 1070|    739|	uint32_t sum;
 1071|       |
 1072|    739|	u32num = (unsigned)bytes / 4;
 1073|    739|	sum = seed;
 1074|    739|	b = p;
 1075|   142k|	for (;u32num > 0; --u32num) {
  ------------------
  |  Branch (1075:8): [True: 142k, False: 739]
  ------------------
 1076|   142k|		sum ^= archive_le32dec(b);
 1077|   142k|		b += 4;
 1078|   142k|	}
 1079|    739|	return (sum);
 1080|    739|}
archive_read_support_format_cab.c:cab_checksum_finish:
 1153|     32|{
 1154|     32|	struct cab *cab = (struct cab *)(a->format->data);
 1155|     32|	struct cfdata *cfdata = cab->entry_cfdata;
 1156|     32|	int l;
 1157|       |
 1158|       |	/* Do not need to compute a sum. */
 1159|     32|	if (cfdata->sum == 0)
  ------------------
  |  Branch (1159:6): [True: 2, False: 30]
  ------------------
 1160|      2|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1161|       |
 1162|       |	/*
 1163|       |	 * Calculate the sum of remaining CFDATA.
 1164|       |	 */
 1165|     30|	if (cfdata->sum_extra_avail) {
  ------------------
  |  Branch (1165:6): [True: 14, False: 16]
  ------------------
 1166|     14|		cfdata->sum_calculated =
 1167|     14|		    cab_checksum_cfdata(cfdata->sum_extra,
 1168|     14|		       cfdata->sum_extra_avail, cfdata->sum_calculated);
 1169|     14|		cfdata->sum_extra_avail = 0;
 1170|     14|	}
 1171|       |
 1172|     30|	l = 4;
 1173|     30|	if (cab->cfheader.flags & RESERVE_PRESENT)
  ------------------
  |  |  251|     30|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (1173:6): [True: 0, False: 30]
  ------------------
 1174|      0|		l += cab->cfheader.cfdata;
 1175|     30|	if (cfdata->memimage == NULL) {
  ------------------
  |  Branch (1175:6): [True: 0, False: 30]
  ------------------
 1176|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1177|      0|	}
 1178|     30|	cfdata->sum_calculated = cab_checksum_cfdata(
 1179|     30|	    cfdata->memimage + CFDATA_cbData, l, cfdata->sum_calculated);
  ------------------
  |  |  179|     30|#define CFDATA_cbData		4
  ------------------
 1180|     30|	if (cfdata->sum_calculated != cfdata->sum) {
  ------------------
  |  Branch (1180:6): [True: 30, False: 0]
  ------------------
 1181|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 1182|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 1183|       |		    "Checksum error CFDATA[%d] %" PRIx32 ":%" PRIx32 " in %d bytes",
 1184|       |		    cab->entry_cffolder->cfdata_index -1,
 1185|       |		    cfdata->sum, cfdata->sum_calculated,
 1186|       |		    cfdata->compressed_size);
 1187|       |		return (ARCHIVE_FAILED);
 1188|       |#endif
 1189|     30|	}
 1190|     30|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     30|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1191|     30|}
archive_read_support_format_cab.c:cab_checksum_cfdata:
 1084|     44|{
 1085|     44|	const unsigned char *b;
 1086|     44|	uint32_t sum;
 1087|     44|	uint32_t t;
 1088|       |
 1089|     44|	sum = cab_checksum_cfdata_4(p, bytes, seed);
 1090|     44|	b = p;
 1091|     44|	b += bytes & ~3;
 1092|     44|	t = 0;
 1093|     44|	switch (bytes & 3) {
 1094|      5|	case 3:
  ------------------
  |  Branch (1094:2): [True: 5, False: 39]
  ------------------
 1095|      5|		t |= ((uint32_t)(*b++)) << 16;
 1096|       |		/* FALL THROUGH */
 1097|      5|	case 2:
  ------------------
  |  Branch (1097:2): [True: 0, False: 44]
  ------------------
 1098|      5|		t |= ((uint32_t)(*b++)) << 8;
 1099|       |		/* FALL THROUGH */
 1100|     14|	case 1:
  ------------------
  |  Branch (1100:2): [True: 9, False: 35]
  ------------------
 1101|     14|		t |= *b;
 1102|       |		/* FALL THROUGH */
 1103|     44|	default:
  ------------------
  |  Branch (1103:2): [True: 30, False: 14]
  ------------------
 1104|     44|		break;
 1105|     44|	}
 1106|     44|	sum ^= t;
 1107|       |
 1108|     44|	return (sum);
 1109|     44|}
archive_read_support_format_cab.c:cab_read_ahead_cfdata:
 1350|     95|{
 1351|     95|	struct cab *cab = (struct cab *)(a->format->data);
 1352|     95|	int err;
 1353|       |
 1354|     95|	err = cab_next_cfdata(a);
 1355|     95|	if (err < ARCHIVE_OK) {
  ------------------
  |  |  233|     95|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1355:6): [True: 3, False: 92]
  ------------------
 1356|      3|		*avail = err;
 1357|      3|		return (NULL);
 1358|      3|	}
 1359|       |
 1360|     92|	switch (cab->entry_cffolder->comptype) {
 1361|      7|	case COMPTYPE_NONE:
  ------------------
  |  |  215|      7|#define COMPTYPE_NONE		0x0000
  ------------------
  |  Branch (1361:2): [True: 7, False: 85]
  ------------------
 1362|      7|		return (cab_read_ahead_cfdata_none(a, avail));
 1363|     28|	case COMPTYPE_MSZIP:
  ------------------
  |  |  216|     28|#define COMPTYPE_MSZIP		0x0001
  ------------------
  |  Branch (1363:2): [True: 28, False: 64]
  ------------------
 1364|     28|		return (cab_read_ahead_cfdata_deflate(a, avail));
 1365|     57|	case COMPTYPE_LZX:
  ------------------
  |  |  218|     57|#define COMPTYPE_LZX		0x0003
  ------------------
  |  Branch (1365:2): [True: 57, False: 35]
  ------------------
 1366|     57|		return (cab_read_ahead_cfdata_lzx(a, avail));
 1367|      0|	default: /* Unsupported compression. */
  ------------------
  |  Branch (1367:2): [True: 0, False: 92]
  ------------------
 1368|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1369|      0|		    "Unsupported CAB compression: %s",
 1370|      0|		    cab->entry_cffolder->compname);
 1371|      0|		*avail = ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1372|       |		return (NULL);
 1373|     92|	}
 1374|     92|}
archive_read_support_format_cab.c:cab_read_ahead_cfdata_none:
 1381|      7|{
 1382|      7|	struct cab *cab = (struct cab *)(a->format->data);
 1383|      7|	struct cfdata *cfdata;
 1384|      7|	const void *d;
 1385|       |
 1386|      7|	cfdata = cab->entry_cfdata;
 1387|       |
 1388|       |	/*
 1389|       |	 * Note: '1' here is a performance optimization.
 1390|       |	 * Recall that the decompression layer returns a count of
 1391|       |	 * available bytes; asking for more than that forces the
 1392|       |	 * decompressor to combine reads by copying data.
 1393|       |	 */
 1394|      7|	d = __archive_read_ahead(a, 1, avail);
 1395|      7|	if (*avail <= 0) {
  ------------------
  |  Branch (1395:6): [True: 0, False: 7]
  ------------------
 1396|      0|		*avail = truncated_error(a);
 1397|      0|		return (NULL);
 1398|      0|	}
 1399|      7|	if (*avail > cfdata->uncompressed_bytes_remaining)
  ------------------
  |  Branch (1399:6): [True: 3, False: 4]
  ------------------
 1400|      3|		*avail = cfdata->uncompressed_bytes_remaining;
 1401|      7|	cfdata->uncompressed_avail = cfdata->uncompressed_size;
 1402|      7|	cfdata->unconsumed = *avail;
 1403|      7|	cfdata->sum_ptr = d;
 1404|      7|	return (d);
 1405|      7|}
archive_read_support_format_cab.c:cab_read_ahead_cfdata_deflate:
 1413|     28|{
 1414|     28|	struct cab *cab = (struct cab *)(a->format->data);
 1415|     28|	struct cfdata *cfdata;
 1416|     28|	const void *d;
 1417|     28|	int r, mszip;
 1418|     28|	uint16_t uavail;
 1419|     28|	char eod = 0;
 1420|       |
 1421|     28|	cfdata = cab->entry_cfdata;
 1422|       |	/* If the buffer hasn't been allocated, allocate it now. */
 1423|     28|	if (cab->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (1423:6): [True: 18, False: 10]
  ------------------
 1424|     18|		cab->uncompressed_buffer_size = 0x8000;
 1425|     18|		cab->uncompressed_buffer
 1426|     18|		    = malloc(cab->uncompressed_buffer_size);
 1427|     18|		if (cab->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (1427:7): [True: 0, False: 18]
  ------------------
 1428|      0|			archive_set_error(&a->archive, ENOMEM,
 1429|      0|			    "No memory for CAB reader");
 1430|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1431|      0|			return (NULL);
 1432|      0|		}
 1433|     18|	}
 1434|       |
 1435|     28|	uavail = cfdata->uncompressed_avail;
 1436|     28|	if (uavail == cfdata->uncompressed_size) {
  ------------------
  |  Branch (1436:6): [True: 4, False: 24]
  ------------------
 1437|      4|		d = cab->uncompressed_buffer + cfdata->read_offset;
 1438|      4|		*avail = uavail - cfdata->read_offset;
 1439|      4|		return (d);
 1440|      4|	}
 1441|       |
 1442|     24|	if (!cab->entry_cffolder->decompress_init) {
  ------------------
  |  Branch (1442:6): [True: 18, False: 6]
  ------------------
 1443|     18|		cab->stream.next_in = NULL;
 1444|     18|		cab->stream.avail_in = 0;
 1445|     18|		cab->stream.total_in = 0;
 1446|     18|		cab->stream.next_out = NULL;
 1447|     18|		cab->stream.avail_out = 0;
 1448|     18|		cab->stream.total_out = 0;
 1449|     18|		if (cab->stream_valid)
  ------------------
  |  Branch (1449:7): [True: 0, False: 18]
  ------------------
 1450|      0|			r = inflateReset(&cab->stream);
 1451|     18|		else
 1452|     18|			r = inflateInit2(&cab->stream,
 1453|     18|			    -15 /* Don't check for zlib header */);
 1454|     18|		if (r != Z_OK) {
  ------------------
  |  Branch (1454:7): [True: 0, False: 18]
  ------------------
 1455|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1456|      0|			    "Can't initialize deflate decompression");
 1457|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1458|      0|			return (NULL);
 1459|      0|		}
 1460|       |		/* Stream structure has been set up. */
 1461|     18|		cab->stream_valid = 1;
 1462|       |		/* We've initialized decompression for this stream. */
 1463|     18|		cab->entry_cffolder->decompress_init = 1;
 1464|     18|	}
 1465|       |
 1466|     24|	if (cfdata->compressed_bytes_remaining == cfdata->compressed_size)
  ------------------
  |  Branch (1466:6): [True: 24, False: 0]
  ------------------
 1467|     24|		mszip = 2;
 1468|      0|	else
 1469|      0|		mszip = 0;
 1470|     24|	eod = 0;
 1471|     24|	cab->stream.total_out = uavail;
 1472|       |	/*
 1473|       |	 * We always uncompress all data in current CFDATA.
 1474|       |	 */
 1475|     39|	while (!eod && cab->stream.total_out < cfdata->uncompressed_size) {
  ------------------
  |  Branch (1475:9): [True: 39, False: 0]
  |  Branch (1475:17): [True: 25, False: 14]
  ------------------
 1476|     25|		ssize_t bytes_avail;
 1477|       |
 1478|     25|		cab->stream.next_out =
 1479|     25|		    cab->uncompressed_buffer + cab->stream.total_out;
 1480|     25|		cab->stream.avail_out =
 1481|     25|		    cfdata->uncompressed_size - cab->stream.total_out;
 1482|     25|		if ((size_t)cfdata->uncompressed_size >
  ------------------
  |  Branch (1482:7): [True: 0, False: 25]
  ------------------
 1483|     25|		    cab->uncompressed_buffer_size) {
 1484|      0|			archive_set_error(&a->archive,
 1485|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1486|      0|			    "Invalid CFDATA uncompressed size");
 1487|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1488|      0|			return (NULL);
 1489|      0|		}
 1490|       |
 1491|     25|		d = __archive_read_ahead(a, 1, &bytes_avail);
 1492|     25|		if (bytes_avail <= 0) {
  ------------------
  |  Branch (1492:7): [True: 0, False: 25]
  ------------------
 1493|      0|			*avail = truncated_error(a);
 1494|      0|			return (NULL);
 1495|      0|		}
 1496|     25|		if (bytes_avail > cfdata->compressed_bytes_remaining)
  ------------------
  |  Branch (1496:7): [True: 13, False: 12]
  ------------------
 1497|     13|			bytes_avail = cfdata->compressed_bytes_remaining;
 1498|       |		/*
 1499|       |		 * A bug in zlib.h: stream.next_in should be marked 'const'
 1500|       |		 * but isn't (the library never alters data through the
 1501|       |		 * next_in pointer, only reads it).  The result: this ugly
 1502|       |		 * cast to remove 'const'.
 1503|       |		 */
 1504|     25|		cab->stream.next_in = (Bytef *)(uintptr_t)d;
 1505|     25|		cab->stream.avail_in = (uInt)bytes_avail;
 1506|     25|		cab->stream.total_in = 0;
 1507|       |
 1508|       |		/* Cut out a tow-byte MSZIP signature(0x43, 0x4b). */
 1509|     25|		if (mszip > 0) {
  ------------------
  |  Branch (1509:7): [True: 24, False: 1]
  ------------------
 1510|     24|			if (bytes_avail <= 0)
  ------------------
  |  Branch (1510:8): [True: 0, False: 24]
  ------------------
 1511|      0|				goto nomszip;
 1512|     24|			if (bytes_avail <= mszip) {
  ------------------
  |  Branch (1512:8): [True: 1, False: 23]
  ------------------
 1513|      1|				if (mszip == 2) {
  ------------------
  |  Branch (1513:9): [True: 1, False: 0]
  ------------------
 1514|      1|					if (cab->stream.next_in[0] != 0x43)
  ------------------
  |  Branch (1514:10): [True: 1, False: 0]
  ------------------
 1515|      1|						goto nomszip;
 1516|      0|					if (bytes_avail > 1 &&
  ------------------
  |  Branch (1516:10): [True: 0, False: 0]
  ------------------
 1517|      0|					    cab->stream.next_in[1] != 0x4b)
  ------------------
  |  Branch (1517:10): [True: 0, False: 0]
  ------------------
 1518|      0|						goto nomszip;
 1519|      0|				} else if (cab->stream.next_in[0] != 0x4b)
  ------------------
  |  Branch (1519:16): [True: 0, False: 0]
  ------------------
 1520|      0|					goto nomszip;
 1521|      0|				cfdata->unconsumed = bytes_avail;
 1522|      0|				cfdata->sum_ptr = d;
 1523|      0|				if (cab_minimum_consume_cfdata(
  ------------------
  |  Branch (1523:9): [True: 0, False: 0]
  ------------------
 1524|      0|				    a, cfdata->unconsumed) < 0) {
 1525|      0|					*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1526|      0|					return (NULL);
 1527|      0|				}
 1528|      0|				mszip -= (int)bytes_avail;
 1529|      0|				continue;
 1530|      0|			}
 1531|     23|			if (mszip == 1 && cab->stream.next_in[0] != 0x4b)
  ------------------
  |  Branch (1531:8): [True: 0, False: 23]
  |  Branch (1531:22): [True: 0, False: 0]
  ------------------
 1532|      0|				goto nomszip;
 1533|     23|			else if (mszip == 2 && (cab->stream.next_in[0] != 0x43 ||
  ------------------
  |  Branch (1533:13): [True: 23, False: 0]
  |  Branch (1533:28): [True: 5, False: 18]
  ------------------
 1534|     18|			    cab->stream.next_in[1] != 0x4b))
  ------------------
  |  Branch (1534:8): [True: 1, False: 17]
  ------------------
 1535|      6|				goto nomszip;
 1536|     17|			cab->stream.next_in += mszip;
 1537|     17|			cab->stream.avail_in -= mszip;
 1538|     17|			cab->stream.total_in += mszip;
 1539|     17|			mszip = 0;
 1540|     17|		}
 1541|       |
 1542|     18|		r = inflate(&cab->stream, 0);
 1543|     18|		switch (r) {
 1544|     15|		case Z_OK:
  ------------------
  |  Branch (1544:3): [True: 15, False: 3]
  ------------------
 1545|     15|			break;
 1546|      0|		case Z_STREAM_END:
  ------------------
  |  Branch (1546:3): [True: 0, False: 18]
  ------------------
 1547|      0|			eod = 1;
 1548|      0|			break;
 1549|      3|		default:
  ------------------
  |  Branch (1549:3): [True: 3, False: 15]
  ------------------
 1550|      3|			goto zlibfailed;
 1551|     18|		}
 1552|     15|		cfdata->unconsumed = cab->stream.total_in;
 1553|     15|		cfdata->sum_ptr = d;
 1554|     15|		if (cab_minimum_consume_cfdata(a, cfdata->unconsumed) < 0) {
  ------------------
  |  Branch (1554:7): [True: 0, False: 15]
  ------------------
 1555|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1556|      0|			return (NULL);
 1557|      0|		}
 1558|     15|	}
 1559|     14|	uavail = (uint16_t)cab->stream.total_out;
 1560|       |
 1561|     14|	if (uavail < cfdata->uncompressed_size) {
  ------------------
  |  Branch (1561:6): [True: 0, False: 14]
  ------------------
 1562|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1563|      0|		    "Invalid uncompressed size (%d < %d)",
 1564|      0|		    uavail, cfdata->uncompressed_size);
 1565|      0|		*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1566|      0|		return (NULL);
 1567|      0|	}
 1568|       |
 1569|       |	/*
 1570|       |	 * Note: I suspect there is a bug in makecab.exe because, in rare
 1571|       |	 * case, compressed bytes are still remaining regardless we have
 1572|       |	 * gotten all uncompressed bytes, which size is recorded in CFDATA,
 1573|       |	 * as much as we need, and we have to use the garbage so as to
 1574|       |	 * correctly compute the sum of CFDATA accordingly.
 1575|       |	 */
 1576|     14|	if (cfdata->compressed_bytes_remaining > 0) {
  ------------------
  |  Branch (1576:6): [True: 14, False: 0]
  ------------------
 1577|     14|		ssize_t bytes_avail;
 1578|       |
 1579|     14|		d = __archive_read_ahead(a, cfdata->compressed_bytes_remaining,
 1580|     14|		    &bytes_avail);
 1581|     14|		if (bytes_avail <= 0) {
  ------------------
  |  Branch (1581:7): [True: 0, False: 14]
  ------------------
 1582|      0|			*avail = truncated_error(a);
 1583|      0|			return (NULL);
 1584|      0|		}
 1585|     14|		cfdata->unconsumed = cfdata->compressed_bytes_remaining;
 1586|     14|		cfdata->sum_ptr = d;
 1587|     14|		if (cab_minimum_consume_cfdata(a, cfdata->unconsumed) < 0) {
  ------------------
  |  Branch (1587:7): [True: 0, False: 14]
  ------------------
 1588|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1589|      0|			return (NULL);
 1590|      0|		}
 1591|     14|	}
 1592|       |
 1593|       |	/*
 1594|       |	 * Set dictionary data for decompressing of next CFDATA, which
 1595|       |	 * in the same folder. This is why we always do decompress CFDATA
 1596|       |	 * even if beginning CFDATA or some of CFDATA are not used in
 1597|       |	 * skipping file data.
 1598|       |	 */
 1599|     14|	if (cab->entry_cffolder->cfdata_index <
  ------------------
  |  Branch (1599:6): [True: 12, False: 2]
  ------------------
 1600|     14|	    cab->entry_cffolder->cfdata_count) {
 1601|     12|		r = inflateReset(&cab->stream);
 1602|     12|		if (r != Z_OK)
  ------------------
  |  Branch (1602:7): [True: 0, False: 12]
  ------------------
 1603|      0|			goto zlibfailed;
 1604|     12|		r = inflateSetDictionary(&cab->stream,
 1605|     12|		    cab->uncompressed_buffer, cfdata->uncompressed_size);
 1606|     12|		if (r != Z_OK)
  ------------------
  |  Branch (1606:7): [True: 0, False: 12]
  ------------------
 1607|      0|			goto zlibfailed;
 1608|     12|	}
 1609|       |
 1610|     14|	d = cab->uncompressed_buffer + cfdata->read_offset;
 1611|     14|	*avail = uavail - cfdata->read_offset;
 1612|     14|	cfdata->uncompressed_avail = uavail;
 1613|       |
 1614|     14|	return (d);
 1615|       |
 1616|      3|zlibfailed:
 1617|      3|	switch (r) {
 1618|      0|	case Z_MEM_ERROR:
  ------------------
  |  Branch (1618:2): [True: 0, False: 3]
  ------------------
 1619|      0|		archive_set_error(&a->archive, ENOMEM,
 1620|      0|		    "Out of memory for deflate decompression");
 1621|      0|		break;
 1622|      3|	default:
  ------------------
  |  Branch (1622:2): [True: 3, False: 0]
  ------------------
 1623|      3|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1624|      3|		    "Deflate decompression failed (%d)", r);
 1625|      3|		break;
 1626|      3|	}
 1627|      3|	*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1628|      3|	return (NULL);
 1629|      7|nomszip:
 1630|      7|	archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      7|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1631|      7|	    "CFDATA incorrect(no MSZIP signature)");
 1632|      7|	*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1633|       |	return (NULL);
 1634|      3|}
archive_read_support_format_cab.c:cab_read_ahead_cfdata_lzx:
 1651|     57|{
 1652|     57|	struct cab *cab = (struct cab *)(a->format->data);
 1653|     57|	struct cfdata *cfdata;
 1654|     57|	const void *d;
 1655|     57|	int r;
 1656|     57|	uint16_t uavail;
 1657|       |
 1658|     57|	cfdata = cab->entry_cfdata;
 1659|       |	/* If the buffer hasn't been allocated, allocate it now. */
 1660|     57|	if (cab->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (1660:6): [True: 47, False: 10]
  ------------------
 1661|     47|		cab->uncompressed_buffer_size = 0x8000;
 1662|     47|		cab->uncompressed_buffer
 1663|     47|		    = malloc(cab->uncompressed_buffer_size);
 1664|     47|		if (cab->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (1664:7): [True: 0, False: 47]
  ------------------
 1665|      0|			archive_set_error(&a->archive, ENOMEM,
 1666|      0|			    "No memory for CAB reader");
 1667|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1668|      0|			return (NULL);
 1669|      0|		}
 1670|     47|	}
 1671|       |
 1672|     57|	uavail = cfdata->uncompressed_avail;
 1673|     57|	if (uavail == cfdata->uncompressed_size) {
  ------------------
  |  Branch (1673:6): [True: 0, False: 57]
  ------------------
 1674|      0|		d = cab->uncompressed_buffer + cfdata->read_offset;
 1675|      0|		*avail = uavail - cfdata->read_offset;
 1676|      0|		return (d);
 1677|      0|	}
 1678|       |
 1679|     57|	if (!cab->entry_cffolder->decompress_init) {
  ------------------
  |  Branch (1679:6): [True: 47, False: 10]
  ------------------
 1680|     47|		r = lzx_decode_init(&cab->xstrm,
 1681|     47|		    cab->entry_cffolder->compdata);
 1682|     47|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|     47|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1682:7): [True: 0, False: 47]
  ------------------
 1683|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1684|      0|			    "Can't initialize LZX decompression");
 1685|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1686|      0|			return (NULL);
 1687|      0|		}
 1688|       |		/* We've initialized decompression for this stream. */
 1689|     47|		cab->entry_cffolder->decompress_init = 1;
 1690|     47|	}
 1691|       |
 1692|       |	/* Clean up remaining bits of previous CFDATA. */
 1693|     57|	lzx_cleanup_bitstream(&cab->xstrm);
 1694|     57|	cab->xstrm.total_out = uavail;
 1695|    565|	while (cab->xstrm.total_out < cfdata->uncompressed_size) {
  ------------------
  |  Branch (1695:9): [True: 544, False: 21]
  ------------------
 1696|    544|		ssize_t bytes_avail;
 1697|       |
 1698|    544|		cab->xstrm.next_out =
 1699|    544|		    cab->uncompressed_buffer + cab->xstrm.total_out;
 1700|    544|		cab->xstrm.avail_out =
 1701|    544|		    cfdata->uncompressed_size - cab->xstrm.total_out;
 1702|       |		
 1703|    544|		if ((size_t)cfdata->uncompressed_size > cab->uncompressed_buffer_size) {
  ------------------
  |  Branch (1703:7): [True: 0, False: 544]
  ------------------
 1704|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1705|      0|				"Invalid CFDATA uncompressed size");
 1706|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1707|      0|			return (NULL);
 1708|      0|		}
 1709|       |
 1710|    544|		d = __archive_read_ahead(a, 1, &bytes_avail);
 1711|    544|		if (d == NULL) {
  ------------------
  |  Branch (1711:7): [True: 24, False: 520]
  ------------------
 1712|     24|			archive_set_error(&a->archive,
 1713|     24|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     24|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1714|     24|			    "Truncated CAB file data");
 1715|     24|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|     24|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1716|     24|			return (NULL);
 1717|     24|		}
 1718|    520|		if (bytes_avail > cfdata->compressed_bytes_remaining)
  ------------------
  |  Branch (1718:7): [True: 221, False: 299]
  ------------------
 1719|    221|			bytes_avail = cfdata->compressed_bytes_remaining;
 1720|       |
 1721|    520|		cab->xstrm.next_in = d;
 1722|    520|		cab->xstrm.avail_in = bytes_avail;
 1723|    520|		cab->xstrm.total_in = 0;
 1724|    520|		r = lzx_decode(&cab->xstrm,
 1725|    520|		    cfdata->compressed_bytes_remaining == bytes_avail);
 1726|    520|		switch (r) {
 1727|     38|		case ARCHIVE_OK:
  ------------------
  |  |  233|     38|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1727:3): [True: 38, False: 482]
  ------------------
 1728|    508|		case ARCHIVE_EOF:
  ------------------
  |  |  232|    508|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1728:3): [True: 470, False: 50]
  ------------------
 1729|    508|			break;
 1730|     12|		default:
  ------------------
  |  Branch (1730:3): [True: 12, False: 508]
  ------------------
 1731|     12|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     12|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1732|     12|			    "LZX decompression failed (%d)", r);
 1733|     12|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1734|     12|			return (NULL);
 1735|    520|		}
 1736|    508|		cfdata->unconsumed = cab->xstrm.total_in;
 1737|    508|		cfdata->sum_ptr = d;
 1738|    508|		if (cab_minimum_consume_cfdata(a, cfdata->unconsumed) < 0) {
  ------------------
  |  Branch (1738:7): [True: 0, False: 508]
  ------------------
 1739|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1740|      0|			return (NULL);
 1741|      0|		}
 1742|    508|	}
 1743|       |
 1744|     21|	uavail = (uint16_t)cab->xstrm.total_out;
 1745|       |	/*
 1746|       |	 * Make sure a read pointer advances to next CFDATA.
 1747|       |	 */
 1748|     21|	if (cfdata->compressed_bytes_remaining > 0) {
  ------------------
  |  Branch (1748:6): [True: 16, False: 5]
  ------------------
 1749|     16|		ssize_t bytes_avail;
 1750|       |
 1751|     16|		d = __archive_read_ahead(a, cfdata->compressed_bytes_remaining,
 1752|     16|		    &bytes_avail);
 1753|     16|		if (bytes_avail <= 0) {
  ------------------
  |  Branch (1753:7): [True: 0, False: 16]
  ------------------
 1754|      0|			*avail = truncated_error(a);
 1755|      0|			return (NULL);
 1756|      0|		}
 1757|     16|		cfdata->unconsumed = cfdata->compressed_bytes_remaining;
 1758|     16|		cfdata->sum_ptr = d;
 1759|     16|		if (cab_minimum_consume_cfdata(a, cfdata->unconsumed) < 0) {
  ------------------
  |  Branch (1759:7): [True: 0, False: 16]
  ------------------
 1760|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1761|      0|			return (NULL);
 1762|      0|		}
 1763|     16|	}
 1764|       |
 1765|       |	/*
 1766|       |	 * Translation reversal of x86 processor CALL byte sequence(E8).
 1767|       |	 */
 1768|     21|	lzx_translation(&cab->xstrm, cab->uncompressed_buffer,
 1769|     21|	    cfdata->uncompressed_size,
 1770|     21|	    (cab->entry_cffolder->cfdata_index-1) * 0x8000);
 1771|       |
 1772|     21|	d = cab->uncompressed_buffer + cfdata->read_offset;
 1773|     21|	*avail = uavail - cfdata->read_offset;
 1774|     21|	cfdata->uncompressed_avail = uavail;
 1775|       |
 1776|     21|	return (d);
 1777|     21|}
archive_read_support_format_cab.c:lzx_decode_init:
 2105|     47|{
 2106|     47|	struct lzx_dec *ds;
 2107|     47|	int slot, w_size, w_slot;
 2108|     47|	int base, footer;
 2109|     47|	int base_inc[18];
 2110|       |
 2111|     47|	if (strm->ds == NULL) {
  ------------------
  |  Branch (2111:6): [True: 47, False: 0]
  ------------------
 2112|     47|		strm->ds = calloc(1, sizeof(*strm->ds));
 2113|     47|		if (strm->ds == NULL)
  ------------------
  |  Branch (2113:7): [True: 0, False: 47]
  ------------------
 2114|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2115|     47|	}
 2116|     47|	ds = strm->ds;
 2117|     47|	ds->error = ARCHIVE_FAILED;
  ------------------
  |  |  237|     47|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2118|       |
 2119|       |	/* Allow bits from 15(32KBi) up to 21(2MBi) */
 2120|     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 (2120:6): [True: 0, False: 47]
  |  Branch (2120:28): [True: 0, False: 47]
  ------------------
 2121|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2122|       |
 2123|     47|	ds->error = ARCHIVE_FATAL;
  ------------------
  |  |  239|     47|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2124|       |
 2125|       |	/*
 2126|       |	 * Alloc window
 2127|       |	 */
 2128|     47|	w_size = ds->w_size;
 2129|     47|	w_slot = slots[w_bits - SLOT_BASE];
  ------------------
  |  |  133|     47|#define SLOT_BASE	15
  ------------------
 2130|     47|	ds->w_size = 1U << w_bits;
 2131|     47|	ds->w_mask = ds->w_size -1;
 2132|     47|	if (ds->w_buff == NULL || w_size != ds->w_size) {
  ------------------
  |  Branch (2132:6): [True: 47, False: 0]
  |  Branch (2132:28): [True: 0, False: 0]
  ------------------
 2133|     47|		free(ds->w_buff);
 2134|     47|		ds->w_buff = malloc(ds->w_size);
 2135|     47|		if (ds->w_buff == NULL)
  ------------------
  |  Branch (2135:7): [True: 0, False: 47]
  ------------------
 2136|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2137|     47|		free(ds->pos_tbl);
 2138|     47|		ds->pos_tbl = malloc(sizeof(ds->pos_tbl[0]) * w_slot);
 2139|     47|		if (ds->pos_tbl == NULL)
  ------------------
  |  Branch (2139:7): [True: 0, False: 47]
  ------------------
 2140|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2141|     47|	}
 2142|       |
 2143|    893|	for (footer = 0; footer < 18; footer++)
  ------------------
  |  Branch (2143:19): [True: 846, False: 47]
  ------------------
 2144|    846|		base_inc[footer] = 1 << footer;
 2145|     47|	base = footer = 0;
 2146|  2.11k|	for (slot = 0; slot < w_slot; slot++) {
  ------------------
  |  Branch (2146:17): [True: 2.06k, False: 47]
  ------------------
 2147|  2.06k|		int n;
 2148|  2.06k|		if (footer == 0)
  ------------------
  |  Branch (2148:7): [True: 235, False: 1.82k]
  ------------------
 2149|    235|			base = slot;
 2150|  1.82k|		else
 2151|  1.82k|			base += base_inc[footer];
 2152|  2.06k|		if (footer < 17) {
  ------------------
  |  Branch (2152:7): [True: 1.67k, False: 390]
  ------------------
 2153|  1.67k|			footer = -2;
 2154|  17.4k|			for (n = base; n; n >>= 1)
  ------------------
  |  Branch (2154:19): [True: 15.7k, False: 1.67k]
  ------------------
 2155|  15.7k|				footer++;
 2156|  1.67k|			if (footer <= 0)
  ------------------
  |  Branch (2156:8): [True: 188, False: 1.48k]
  ------------------
 2157|    188|				footer = 0;
 2158|  1.67k|		}
 2159|  2.06k|		ds->pos_tbl[slot].base = base;
 2160|  2.06k|		ds->pos_tbl[slot].footer_bits = footer;
 2161|  2.06k|	}
 2162|       |
 2163|     47|	ds->w_pos = 0;
 2164|     47|	ds->state = 0;
 2165|     47|	ds->br.cache_buffer = 0;
 2166|     47|	ds->br.cache_avail = 0;
 2167|     47|	ds->r0 = ds->r1 = ds->r2 = 1;
 2168|       |
 2169|       |	/* Initialize aligned offset tree. */
 2170|     47|	if (lzx_huffman_init(&(ds->at), 8, 8) != ARCHIVE_OK)
  ------------------
  |  |  233|     47|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2170:6): [True: 0, False: 47]
  ------------------
 2171|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2172|       |
 2173|       |	/* Initialize pre-tree. */
 2174|     47|	if (lzx_huffman_init(&(ds->pt), 20, 10) != ARCHIVE_OK)
  ------------------
  |  |  233|     47|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2174:6): [True: 0, False: 47]
  ------------------
 2175|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2176|       |
 2177|       |	/* Initialize Main tree. */
 2178|     47|	if (lzx_huffman_init(&(ds->mt), 256+(w_slot<<3), 16)
  ------------------
  |  Branch (2178:6): [True: 0, False: 47]
  ------------------
 2179|     47|	    != ARCHIVE_OK)
  ------------------
  |  |  233|     47|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2180|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2181|       |
 2182|       |	/* Initialize Length tree. */
 2183|     47|	if (lzx_huffman_init(&(ds->lt), 249, 16) != ARCHIVE_OK)
  ------------------
  |  |  233|     47|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2183:6): [True: 0, False: 47]
  ------------------
 2184|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2185|       |
 2186|     47|	ds->error = 0;
 2187|       |
 2188|     47|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     47|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2189|     47|}
archive_read_support_format_cab.c:lzx_huffman_init:
 3147|    188|{
 3148|       |
 3149|    188|	if (hf->bitlen == NULL || hf->len_size != (int)len_size) {
  ------------------
  |  Branch (3149:6): [True: 188, False: 0]
  |  Branch (3149:28): [True: 0, False: 0]
  ------------------
 3150|    188|		free(hf->bitlen);
 3151|    188|		hf->bitlen = calloc(len_size,  sizeof(hf->bitlen[0]));
 3152|    188|		if (hf->bitlen == NULL)
  ------------------
  |  Branch (3152:7): [True: 0, False: 188]
  ------------------
 3153|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3154|    188|		hf->len_size = (int)len_size;
 3155|    188|	} else
 3156|      0|		memset(hf->bitlen, 0, len_size *  sizeof(hf->bitlen[0]));
 3157|    188|	if (hf->tbl == NULL) {
  ------------------
  |  Branch (3157:6): [True: 188, False: 0]
  ------------------
 3158|    188|		hf->tbl = malloc(((size_t)1 << tbl_bits) * sizeof(hf->tbl[0]));
 3159|    188|		if (hf->tbl == NULL)
  ------------------
  |  Branch (3159:7): [True: 0, False: 188]
  ------------------
 3160|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3161|    188|		hf->tbl_bits = tbl_bits;
 3162|    188|	}
 3163|    188|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    188|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3164|    188|}
archive_read_support_format_cab.c:lzx_cleanup_bitstream:
 2378|     57|{
 2379|     57|	strm->ds->br.cache_avail = 0;
 2380|     57|	strm->ds->br.have_odd = 0;
 2381|     57|}
archive_read_support_format_cab.c:lzx_decode:
 2418|    520|{
 2419|    520|	struct lzx_dec *ds = strm->ds;
 2420|    520|	int64_t avail_in;
 2421|    520|	int r;
 2422|       |
 2423|    520|	if (ds->error)
  ------------------
  |  Branch (2423:6): [True: 0, False: 520]
  ------------------
 2424|      0|		return (ds->error);
 2425|       |
 2426|    520|	avail_in = strm->avail_in;
 2427|    520|	lzx_br_fixup(strm, &(ds->br));
 2428|    556|	do {
 2429|    556|		if (ds->state < ST_MAIN)
  ------------------
  |  | 2410|    556|#define ST_MAIN			18
  ------------------
  |  Branch (2429:7): [True: 518, False: 38]
  ------------------
 2430|    518|			r = lzx_read_blocks(strm, last);
 2431|     38|		else {
 2432|     38|			int64_t bytes_written = strm->avail_out;
 2433|     38|			r = lzx_decode_blocks(strm, last);
 2434|     38|			bytes_written -= strm->avail_out;
 2435|     38|			strm->next_out += bytes_written;
 2436|     38|			strm->total_out += bytes_written;
 2437|     38|		}
 2438|    556|	} while (r == 100);
  ------------------
  |  Branch (2438:11): [True: 36, False: 520]
  ------------------
 2439|    520|	strm->total_in += avail_in - strm->avail_in;
 2440|    520|	return (r);
 2441|    520|}
archive_read_support_format_cab.c:lzx_br_fixup:
 2362|    520|{
 2363|    520|	int n = CACHE_BITS - br->cache_avail;
  ------------------
  |  |   97|    520|#define CACHE_BITS		(8 * sizeof(CACHE_TYPE))
  ------------------
 2364|       |
 2365|    520|	if (br->have_odd && n >= 16 && strm->avail_in > 0) {
  ------------------
  |  Branch (2365:6): [True: 0, False: 520]
  |  Branch (2365:22): [True: 0, False: 0]
  |  Branch (2365:33): [True: 0, False: 0]
  ------------------
 2366|      0|		br->cache_buffer =
 2367|      0|		   (br->cache_buffer << 16) |
 2368|      0|		   ((uint16_t)(*strm->next_in)) << 8 | br->odd;
 2369|      0|		strm->next_in++;
 2370|      0|		strm->avail_in--;
 2371|      0|		br->cache_avail += 16;
 2372|      0|		br->have_odd = 0;
 2373|      0|	}
 2374|    520|}
archive_read_support_format_cab.c:lzx_read_blocks:
 2445|    518|{
 2446|    518|	struct lzx_dec *ds = strm->ds;
 2447|    518|	struct lzx_br *br = &(ds->br);
 2448|    518|	int i, r;
 2449|       |
 2450|    568|	for (;;) {
 2451|    568|		switch (ds->state) {
  ------------------
  |  Branch (2451:11): [True: 568, False: 0]
  ------------------
 2452|     47|		case ST_RD_TRANSLATION:
  ------------------
  |  | 2392|     47|#define ST_RD_TRANSLATION	0
  ------------------
  |  Branch (2452:3): [True: 47, False: 521]
  ------------------
 2453|     47|			if (!lzx_br_read_ahead(strm, br, 1)) {
  ------------------
  |  | 2263|     47|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2258|     94|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2244|     94|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2244:27): [True: 0, False: 47]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2258:28): [True: 47, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2244|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2244:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2454|      0|				ds->state = ST_RD_TRANSLATION;
  ------------------
  |  | 2392|      0|#define ST_RD_TRANSLATION	0
  ------------------
 2455|      0|				if (last)
  ------------------
  |  Branch (2455:9): [True: 0, False: 0]
  ------------------
 2456|      0|					goto failed;
 2457|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2458|      0|			}
 2459|     47|			ds->translation = lzx_br_bits(br, 1);
  ------------------
  |  | 2247|     47|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2248|     47|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2460|     47|			lzx_br_consume(br, 1);
  ------------------
  |  | 2266|     47|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2461|       |			/* FALL THROUGH */
 2462|     47|		case ST_RD_TRANSLATION_SIZE:
  ------------------
  |  | 2393|     47|#define ST_RD_TRANSLATION_SIZE	1
  ------------------
  |  Branch (2462:3): [True: 0, False: 568]
  ------------------
 2463|     47|			if (ds->translation) {
  ------------------
  |  Branch (2463:8): [True: 3, False: 44]
  ------------------
 2464|      3|				if (!lzx_br_read_ahead(strm, br, 32)) {
  ------------------
  |  | 2263|      3|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2258|      6|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2244|      6|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2244:27): [True: 3, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2258:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2244|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2244:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2465|      0|					ds->state = ST_RD_TRANSLATION_SIZE;
  ------------------
  |  | 2393|      0|#define ST_RD_TRANSLATION_SIZE	1
  ------------------
 2466|      0|					if (last)
  ------------------
  |  Branch (2466:10): [True: 0, False: 0]
  ------------------
 2467|      0|						goto failed;
 2468|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2469|      0|				}
 2470|      3|				ds->translation_size = lzx_br_bits(br, 16);
  ------------------
  |  | 2247|      3|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2248|      3|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2471|      3|				lzx_br_consume(br, 16);
  ------------------
  |  | 2266|      3|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2472|      3|				ds->translation_size <<= 16;
 2473|      3|				ds->translation_size |= lzx_br_bits(br, 16);
  ------------------
  |  | 2247|      3|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2248|      3|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2474|      3|				lzx_br_consume(br, 16);
  ------------------
  |  | 2266|      3|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2475|      3|			}
 2476|       |			/* FALL THROUGH */
 2477|    515|		case ST_RD_BLOCK_TYPE:
  ------------------
  |  | 2394|    515|#define ST_RD_BLOCK_TYPE	2
  ------------------
  |  Branch (2477:3): [True: 468, False: 100]
  ------------------
 2478|    515|			if (!lzx_br_read_ahead(strm, br, 3)) {
  ------------------
  |  | 2263|    515|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2258|  1.03k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2244|  1.03k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2244:27): [True: 69, False: 446]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2258:28): [True: 446, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2244|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2244:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2479|      0|				ds->state = ST_RD_BLOCK_TYPE;
  ------------------
  |  | 2394|      0|#define ST_RD_BLOCK_TYPE	2
  ------------------
 2480|      0|				if (last)
  ------------------
  |  Branch (2480:9): [True: 0, False: 0]
  ------------------
 2481|      0|					goto failed;
 2482|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2483|      0|			}
 2484|    515|			ds->block_type = lzx_br_bits(br, 3);
  ------------------
  |  | 2247|    515|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2248|    515|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2485|    515|			lzx_br_consume(br, 3);
  ------------------
  |  | 2266|    515|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2486|       |			/* Check a block type. */
 2487|    515|			switch (ds->block_type) {
 2488|     41|			case VERBATIM_BLOCK:
  ------------------
  |  |   75|     41|#define VERBATIM_BLOCK		1
  ------------------
  |  Branch (2488:4): [True: 41, False: 474]
  ------------------
 2489|     51|			case ALIGNED_OFFSET_BLOCK:
  ------------------
  |  |   76|     51|#define ALIGNED_OFFSET_BLOCK	2
  ------------------
  |  Branch (2489:4): [True: 10, False: 505]
  ------------------
 2490|    514|			case UNCOMPRESSED_BLOCK:
  ------------------
  |  |   77|    514|#define UNCOMPRESSED_BLOCK	3
  ------------------
  |  Branch (2490:4): [True: 463, False: 52]
  ------------------
 2491|    514|				break;
 2492|      1|			default:
  ------------------
  |  Branch (2492:4): [True: 1, False: 514]
  ------------------
 2493|      1|				goto failed;/* Invalid */
 2494|    515|			}
 2495|       |			/* FALL THROUGH */
 2496|    514|		case ST_RD_BLOCK_SIZE:
  ------------------
  |  | 2395|    514|#define ST_RD_BLOCK_SIZE	3
  ------------------
  |  Branch (2496:3): [True: 0, False: 568]
  ------------------
 2497|    514|			if (!lzx_br_read_ahead(strm, br, 24)) {
  ------------------
  |  | 2263|    514|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2258|  1.02k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2244|  1.02k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2244:27): [True: 496, False: 18]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2258:28): [True: 13, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2244|      5|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2244:27): [True: 4, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2498|      1|				ds->state = ST_RD_BLOCK_SIZE;
  ------------------
  |  | 2395|      1|#define ST_RD_BLOCK_SIZE	3
  ------------------
 2499|      1|				if (last)
  ------------------
  |  Branch (2499:9): [True: 0, False: 1]
  ------------------
 2500|      0|					goto failed;
 2501|      1|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2502|      1|			}
 2503|    513|			ds->block_size = lzx_br_bits(br, 8);
  ------------------
  |  | 2247|    513|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2248|    513|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2504|    513|			lzx_br_consume(br, 8);
  ------------------
  |  | 2266|    513|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2505|    513|			ds->block_size <<= 16;
 2506|    513|			ds->block_size |= lzx_br_bits(br, 16);
  ------------------
  |  | 2247|    513|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2248|    513|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2507|    513|			lzx_br_consume(br, 16);
  ------------------
  |  | 2266|    513|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2508|    513|			if (ds->block_size == 0)
  ------------------
  |  Branch (2508:8): [True: 0, False: 513]
  ------------------
 2509|      0|				goto failed;
 2510|    513|			ds->block_bytes_avail = ds->block_size;
 2511|    513|			if (ds->block_type != UNCOMPRESSED_BLOCK) {
  ------------------
  |  |   77|    513|#define UNCOMPRESSED_BLOCK	3
  ------------------
  |  Branch (2511:8): [True: 50, False: 463]
  ------------------
 2512|     50|				if (ds->block_type == VERBATIM_BLOCK)
  ------------------
  |  |   75|     50|#define VERBATIM_BLOCK		1
  ------------------
  |  Branch (2512:9): [True: 41, False: 9]
  ------------------
 2513|     41|					ds->state = ST_RD_VERBATIM;
  ------------------
  |  | 2403|     41|#define ST_RD_VERBATIM		11
  ------------------
 2514|      9|				else
 2515|      9|					ds->state = ST_RD_ALIGNED_OFFSET;
  ------------------
  |  | 2402|      9|#define ST_RD_ALIGNED_OFFSET	10
  ------------------
 2516|     50|				break;
 2517|     50|			}
 2518|       |			/* FALL THROUGH */
 2519|    463|		case ST_RD_ALIGNMENT:
  ------------------
  |  | 2396|    463|#define ST_RD_ALIGNMENT		4
  ------------------
  |  Branch (2519:3): [True: 0, False: 568]
  ------------------
 2520|       |			/*
 2521|       |			 * Handle an Uncompressed Block.
 2522|       |			 */
 2523|       |			/* Skip padding to align following field on
 2524|       |			 * 16-bit boundary. */
 2525|    463|			if (lzx_br_is_unaligned(br))
  ------------------
  |  | 2269|    463|#define lzx_br_is_unaligned(br)	((br)->cache_avail & 0x0f)
  |  |  ------------------
  |  |  |  Branch (2269:33): [True: 460, False: 3]
  |  |  ------------------
  ------------------
 2526|    460|				lzx_br_consume_unaligned_bits(br);
  ------------------
  |  | 2267|    460|#define lzx_br_consume_unaligned_bits(br) ((br)->cache_avail &= ~0x0f)
  ------------------
 2527|      3|			else {
 2528|      3|				if (lzx_br_read_ahead(strm, br, 16))
  ------------------
  |  | 2263|      3|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2258|      6|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2244|      6|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2244:27): [True: 3, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2258:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2244|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2244:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2529|      3|					lzx_br_consume(br, 16);
  ------------------
  |  | 2266|      3|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2530|      0|				else {
 2531|      0|					ds->state = ST_RD_ALIGNMENT;
  ------------------
  |  | 2396|      0|#define ST_RD_ALIGNMENT		4
  ------------------
 2532|      0|					if (last)
  ------------------
  |  Branch (2532:10): [True: 0, False: 0]
  ------------------
 2533|      0|						goto failed;
 2534|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2535|      0|				}
 2536|      3|			}
 2537|       |			/* Preparation to read repeated offsets R0,R1 and R2. */
 2538|    463|			ds->rbytes_avail = 0;
 2539|    463|			ds->state = ST_RD_R0;
  ------------------
  |  | 2397|    463|#define ST_RD_R0		5
  ------------------
 2540|       |			/* FALL THROUGH */
 2541|    463|		case ST_RD_R0:
  ------------------
  |  | 2397|    463|#define ST_RD_R0		5
  ------------------
  |  Branch (2541:3): [True: 0, False: 568]
  ------------------
 2542|    463|		case ST_RD_R1:
  ------------------
  |  | 2398|    463|#define ST_RD_R1		6
  ------------------
  |  Branch (2542:3): [True: 0, False: 568]
  ------------------
 2543|    463|		case ST_RD_R2:
  ------------------
  |  | 2399|    463|#define ST_RD_R2		7
  ------------------
  |  Branch (2543:3): [True: 0, False: 568]
  ------------------
 2544|  1.37k|			do {
 2545|  1.37k|				uint16_t u16;
 2546|       |				/* Drain bits in the cache buffer of
 2547|       |				 * bit-stream. */
 2548|  1.37k|				if (lzx_br_has(br, 32)) {
  ------------------
  |  | 2244|  1.37k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  ------------------
  |  |  |  Branch (2244:27): [True: 451, False: 922]
  |  |  ------------------
  ------------------
 2549|    451|					u16 = lzx_br_bits(br, 16);
  ------------------
  |  | 2247|    451|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2248|    451|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2550|    451|					lzx_br_consume(br, 16);
  ------------------
  |  | 2266|    451|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2551|    451|					archive_le16enc(ds->rbytes, u16);
 2552|    451|					u16 = lzx_br_bits(br, 16);
  ------------------
  |  | 2247|    451|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2248|    451|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2553|    451|					lzx_br_consume(br, 16);
  ------------------
  |  | 2266|    451|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2554|    451|					archive_le16enc(ds->rbytes+2, u16);
 2555|    451|					ds->rbytes_avail = 4;
 2556|    922|				} else if (lzx_br_has(br, 16)) {
  ------------------
  |  | 2244|    922|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  ------------------
  |  |  |  Branch (2244:27): [True: 8, False: 914]
  |  |  ------------------
  ------------------
 2557|      8|					u16 = lzx_br_bits(br, 16);
  ------------------
  |  | 2247|      8|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2248|      8|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2558|      8|					lzx_br_consume(br, 16);
  ------------------
  |  | 2266|      8|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2559|      8|					archive_le16enc(ds->rbytes, u16);
 2560|      8|					ds->rbytes_avail = 2;
 2561|      8|				}
 2562|  1.37k|				if (ds->rbytes_avail < 4 && ds->br.have_odd) {
  ------------------
  |  Branch (2562:9): [True: 922, False: 451]
  |  Branch (2562:33): [True: 2, False: 920]
  ------------------
 2563|      2|					ds->rbytes[ds->rbytes_avail++] =
 2564|      2|					    ds->br.odd;
 2565|      2|					ds->br.have_odd = 0;
 2566|      2|				}
 2567|  5.03k|				while (ds->rbytes_avail < 4) {
  ------------------
  |  Branch (2567:12): [True: 3.66k, False: 1.36k]
  ------------------
 2568|  3.66k|					if (strm->avail_in <= 0) {
  ------------------
  |  Branch (2568:10): [True: 4, False: 3.66k]
  ------------------
 2569|      4|						if (last)
  ------------------
  |  Branch (2569:11): [True: 0, False: 4]
  ------------------
 2570|      0|							goto failed;
 2571|      4|						return (ARCHIVE_OK);
  ------------------
  |  |  233|      4|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2572|      4|					}
 2573|  3.66k|					ds->rbytes[ds->rbytes_avail++] =
 2574|  3.66k|					    *strm->next_in++;
 2575|  3.66k|					strm->avail_in--;
 2576|  3.66k|				}
 2577|  1.36k|				ds->rbytes_avail = 0;
 2578|  1.36k|				if (ds->state == ST_RD_R0) {
  ------------------
  |  | 2397|  1.36k|#define ST_RD_R0		5
  ------------------
  |  Branch (2578:9): [True: 461, False: 908]
  ------------------
 2579|    461|					ds->r0 = archive_le32dec(ds->rbytes);
 2580|    461|					if (ds->r0 < 0)
  ------------------
  |  Branch (2580:10): [True: 4, False: 457]
  ------------------
 2581|      4|						goto failed;
 2582|    457|					ds->state = ST_RD_R1;
  ------------------
  |  | 2398|    457|#define ST_RD_R1		6
  ------------------
 2583|    908|				} else if (ds->state == ST_RD_R1) {
  ------------------
  |  | 2398|    908|#define ST_RD_R1		6
  ------------------
  |  Branch (2583:16): [True: 456, False: 452]
  ------------------
 2584|    456|					ds->r1 = archive_le32dec(ds->rbytes);
 2585|    456|					if (ds->r1 < 0)
  ------------------
  |  Branch (2585:10): [True: 3, False: 453]
  ------------------
 2586|      3|						goto failed;
 2587|    453|					ds->state = ST_RD_R2;
  ------------------
  |  | 2399|    453|#define ST_RD_R2		7
  ------------------
 2588|    453|				} else if (ds->state == ST_RD_R2) {
  ------------------
  |  | 2399|    452|#define ST_RD_R2		7
  ------------------
  |  Branch (2588:16): [True: 452, False: 0]
  ------------------
 2589|    452|					ds->r2 = archive_le32dec(ds->rbytes);
 2590|    452|					if (ds->r2 < 0)
  ------------------
  |  Branch (2590:10): [True: 0, False: 452]
  ------------------
 2591|      0|						goto failed;
 2592|       |					/* We've gotten all repeated offsets. */
 2593|    452|					ds->state = ST_COPY_UNCOMP1;
  ------------------
  |  | 2400|    452|#define ST_COPY_UNCOMP1		8
  ------------------
 2594|    452|				}
 2595|  1.36k|			} while (ds->state != ST_COPY_UNCOMP1);
  ------------------
  |  | 2400|  1.36k|#define ST_COPY_UNCOMP1		8
  ------------------
  |  Branch (2595:13): [True: 910, False: 452]
  ------------------
 2596|       |			/* FALL THROUGH */
 2597|    455|		case ST_COPY_UNCOMP1:
  ------------------
  |  | 2400|    455|#define ST_COPY_UNCOMP1		8
  ------------------
  |  Branch (2597:3): [True: 3, False: 565]
  ------------------
 2598|       |			/*
 2599|       |			 * Copy bytes form next_in to next_out directly.
 2600|       |			 */
 2601|    910|			while (ds->block_bytes_avail) {
  ------------------
  |  Branch (2601:11): [True: 464, False: 446]
  ------------------
 2602|    464|				int l;
 2603|       |
 2604|    464|				if (strm->avail_out <= 0)
  ------------------
  |  Branch (2604:9): [True: 6, False: 458]
  ------------------
 2605|       |					/* Output buffer is empty. */
 2606|      6|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      6|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2607|    458|				if (strm->avail_in <= 0) {
  ------------------
  |  Branch (2607:9): [True: 3, False: 455]
  ------------------
 2608|       |					/* Input buffer is empty. */
 2609|      3|					if (last)
  ------------------
  |  Branch (2609:10): [True: 0, False: 3]
  ------------------
 2610|      0|						goto failed;
 2611|      3|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2612|      3|				}
 2613|    455|				l = (int)ds->block_bytes_avail;
 2614|    455|				if (l > ds->w_size - ds->w_pos)
  ------------------
  |  Branch (2614:9): [True: 8, False: 447]
  ------------------
 2615|      8|					l = ds->w_size - ds->w_pos;
 2616|    455|				if (l > strm->avail_out)
  ------------------
  |  Branch (2616:9): [True: 9, False: 446]
  ------------------
 2617|      9|					l = (int)strm->avail_out;
 2618|    455|				if (l > strm->avail_in)
  ------------------
  |  Branch (2618:9): [True: 3, False: 452]
  ------------------
 2619|      3|					l = (int)strm->avail_in;
 2620|    455|				memcpy(strm->next_out, strm->next_in, l);
 2621|    455|				memcpy(&(ds->w_buff[ds->w_pos]),
 2622|    455|				    strm->next_in, l);
 2623|    455|				strm->next_in += l;
 2624|    455|				strm->avail_in -= l;
 2625|    455|				strm->next_out += l;
 2626|    455|				strm->avail_out -= l;
 2627|    455|				strm->total_out += l;
 2628|    455|				ds->w_pos = (ds->w_pos + l) & ds->w_mask;
 2629|    455|				ds->block_bytes_avail -= l;
 2630|    455|			}
 2631|       |			/* FALL THROUGH */
 2632|    446|		case ST_COPY_UNCOMP2:
  ------------------
  |  | 2401|    446|#define ST_COPY_UNCOMP2		9
  ------------------
  |  Branch (2632:3): [True: 0, False: 568]
  ------------------
 2633|       |			/* Re-align; skip padding byte. */
 2634|    446|			if (ds->block_size & 1) {
  ------------------
  |  Branch (2634:8): [True: 423, False: 23]
  ------------------
 2635|    423|				if (strm->avail_in <= 0) {
  ------------------
  |  Branch (2635:9): [True: 0, False: 423]
  ------------------
 2636|       |					/* Input buffer is empty. */
 2637|      0|					ds->state = ST_COPY_UNCOMP2;
  ------------------
  |  | 2401|      0|#define ST_COPY_UNCOMP2		9
  ------------------
 2638|      0|					if (last)
  ------------------
  |  Branch (2638:10): [True: 0, False: 0]
  ------------------
 2639|      0|						goto failed;
 2640|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2641|      0|				}
 2642|    423|				strm->next_in++;
 2643|    423|				strm->avail_in --;
 2644|    423|			}
 2645|       |			/* This block ended. */
 2646|    446|			ds->state = ST_RD_BLOCK_TYPE;
  ------------------
  |  | 2394|    446|#define ST_RD_BLOCK_TYPE	2
  ------------------
 2647|    446|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|    446|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2648|       |			/********************/
 2649|      9|		case ST_RD_ALIGNED_OFFSET:
  ------------------
  |  | 2402|      9|#define ST_RD_ALIGNED_OFFSET	10
  ------------------
  |  Branch (2649:3): [True: 9, False: 559]
  ------------------
 2650|       |			/*
 2651|       |			 * Read Aligned offset tree.
 2652|       |			 */
 2653|      9|			if (!lzx_br_read_ahead(strm, br, 3 * ds->at.len_size)) {
  ------------------
  |  | 2263|      9|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2258|     18|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2244|     18|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2244:27): [True: 8, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2258:28): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2244|      1|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2244:27): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2654|      1|				ds->state = ST_RD_ALIGNED_OFFSET;
  ------------------
  |  | 2402|      1|#define ST_RD_ALIGNED_OFFSET	10
  ------------------
 2655|      1|				if (last)
  ------------------
  |  Branch (2655:9): [True: 0, False: 1]
  ------------------
 2656|      0|					goto failed;
 2657|      1|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2658|      1|			}
 2659|      8|			memset(ds->at.freq, 0, sizeof(ds->at.freq));
 2660|     72|			for (i = 0; i < ds->at.len_size; i++) {
  ------------------
  |  Branch (2660:16): [True: 64, False: 8]
  ------------------
 2661|     64|				ds->at.bitlen[i] = lzx_br_bits(br, 3);
  ------------------
  |  | 2247|     64|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2248|     64|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2662|     64|				ds->at.freq[ds->at.bitlen[i]]++;
 2663|     64|				lzx_br_consume(br, 3);
  ------------------
  |  | 2266|     64|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2664|     64|			}
 2665|      8|			if (!lzx_make_huffman_table(&ds->at))
  ------------------
  |  Branch (2665:8): [True: 2, False: 6]
  ------------------
 2666|      2|				goto failed;
 2667|       |			/* FALL THROUGH */
 2668|     47|		case ST_RD_VERBATIM:
  ------------------
  |  | 2403|     47|#define ST_RD_VERBATIM		11
  ------------------
  |  Branch (2668:3): [True: 41, False: 527]
  ------------------
 2669|     47|			ds->loop = 0;
 2670|       |			/* FALL THROUGH */
 2671|     47|		case ST_RD_PRE_MAIN_TREE_256:
  ------------------
  |  | 2404|     47|#define ST_RD_PRE_MAIN_TREE_256	12
  ------------------
  |  Branch (2671:3): [True: 0, False: 568]
  ------------------
 2672|       |			/*
 2673|       |			 * Read Pre-tree for first 256 elements of main tree.
 2674|       |			 */
 2675|     47|			if (!lzx_read_pre_tree(strm)) {
  ------------------
  |  Branch (2675:8): [True: 2, False: 45]
  ------------------
 2676|      2|				ds->state = ST_RD_PRE_MAIN_TREE_256;
  ------------------
  |  | 2404|      2|#define ST_RD_PRE_MAIN_TREE_256	12
  ------------------
 2677|      2|				if (last)
  ------------------
  |  Branch (2677:9): [True: 0, False: 2]
  ------------------
 2678|      0|					goto failed;
 2679|      2|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2680|      2|			}
 2681|     45|			if (!lzx_make_huffman_table(&ds->pt))
  ------------------
  |  Branch (2681:8): [True: 2, False: 43]
  ------------------
 2682|      2|				goto failed;
 2683|     43|			ds->loop = 0;
 2684|       |			/* FALL THROUGH */
 2685|     43|		case ST_MAIN_TREE_256:
  ------------------
  |  | 2405|     43|#define ST_MAIN_TREE_256	13
  ------------------
  |  Branch (2685:3): [True: 0, False: 568]
  ------------------
 2686|       |			/*
 2687|       |			 * Get path lengths of first 256 elements of main tree.
 2688|       |			 */
 2689|     43|			r = lzx_read_bitlen(strm, &ds->mt, 256);
 2690|     43|			if (r < 0)
  ------------------
  |  Branch (2690:8): [True: 0, False: 43]
  ------------------
 2691|      0|				goto failed;
 2692|     43|			else if (!r) {
  ------------------
  |  Branch (2692:13): [True: 1, False: 42]
  ------------------
 2693|      1|				ds->state = ST_MAIN_TREE_256;
  ------------------
  |  | 2405|      1|#define ST_MAIN_TREE_256	13
  ------------------
 2694|      1|				if (last)
  ------------------
  |  Branch (2694:9): [True: 0, False: 1]
  ------------------
 2695|      0|					goto failed;
 2696|      1|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2697|      1|			}
 2698|     42|			ds->loop = 0;
 2699|       |			/* FALL THROUGH */
 2700|     42|		case ST_RD_PRE_MAIN_TREE_REM:
  ------------------
  |  | 2406|     42|#define ST_RD_PRE_MAIN_TREE_REM	14
  ------------------
  |  Branch (2700:3): [True: 0, False: 568]
  ------------------
 2701|       |			/*
 2702|       |			 * Read Pre-tree for remaining elements of main tree.
 2703|       |			 */
 2704|     42|			if (!lzx_read_pre_tree(strm)) {
  ------------------
  |  Branch (2704:8): [True: 1, False: 41]
  ------------------
 2705|      1|				ds->state = ST_RD_PRE_MAIN_TREE_REM;
  ------------------
  |  | 2406|      1|#define ST_RD_PRE_MAIN_TREE_REM	14
  ------------------
 2706|      1|				if (last)
  ------------------
  |  Branch (2706:9): [True: 0, False: 1]
  ------------------
 2707|      0|					goto failed;
 2708|      1|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2709|      1|			}
 2710|     41|			if (!lzx_make_huffman_table(&ds->pt))
  ------------------
  |  Branch (2710:8): [True: 0, False: 41]
  ------------------
 2711|      0|				goto failed;
 2712|     41|			ds->loop = 256;
 2713|       |			/* FALL THROUGH */
 2714|     41|		case ST_MAIN_TREE_REM:
  ------------------
  |  | 2407|     41|#define ST_MAIN_TREE_REM	15
  ------------------
  |  Branch (2714:3): [True: 0, False: 568]
  ------------------
 2715|       |			/*
 2716|       |			 * Get path lengths of remaining elements of main tree.
 2717|       |			 */
 2718|     41|			r = lzx_read_bitlen(strm, &ds->mt, -1);
 2719|     41|			if (r < 0)
  ------------------
  |  Branch (2719:8): [True: 0, False: 41]
  ------------------
 2720|      0|				goto failed;
 2721|     41|			else if (!r) {
  ------------------
  |  Branch (2721:13): [True: 3, False: 38]
  ------------------
 2722|      3|				ds->state = ST_MAIN_TREE_REM;
  ------------------
  |  | 2407|      3|#define ST_MAIN_TREE_REM	15
  ------------------
 2723|      3|				if (last)
  ------------------
  |  Branch (2723:9): [True: 0, False: 3]
  ------------------
 2724|      0|					goto failed;
 2725|      3|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2726|      3|			}
 2727|     38|			if (!lzx_make_huffman_table(&ds->mt))
  ------------------
  |  Branch (2727:8): [True: 0, False: 38]
  ------------------
 2728|      0|				goto failed;
 2729|     38|			ds->loop = 0;
 2730|       |			/* FALL THROUGH */
 2731|     38|		case ST_RD_PRE_LENGTH_TREE:
  ------------------
  |  | 2408|     38|#define ST_RD_PRE_LENGTH_TREE	16
  ------------------
  |  Branch (2731:3): [True: 0, False: 568]
  ------------------
 2732|       |			/*
 2733|       |			 * Read Pre-tree for remaining elements of main tree.
 2734|       |			 */
 2735|     38|			if (!lzx_read_pre_tree(strm)) {
  ------------------
  |  Branch (2735:8): [True: 1, False: 37]
  ------------------
 2736|      1|				ds->state = ST_RD_PRE_LENGTH_TREE;
  ------------------
  |  | 2408|      1|#define ST_RD_PRE_LENGTH_TREE	16
  ------------------
 2737|      1|				if (last)
  ------------------
  |  Branch (2737:9): [True: 0, False: 1]
  ------------------
 2738|      0|					goto failed;
 2739|      1|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2740|      1|			}
 2741|     37|			if (!lzx_make_huffman_table(&ds->pt))
  ------------------
  |  Branch (2741:8): [True: 0, False: 37]
  ------------------
 2742|      0|				goto failed;
 2743|     37|			ds->loop = 0;
 2744|       |			/* FALL THROUGH */
 2745|     37|		case ST_LENGTH_TREE:
  ------------------
  |  | 2409|     37|#define ST_LENGTH_TREE		17
  ------------------
  |  Branch (2745:3): [True: 0, False: 568]
  ------------------
 2746|       |			/*
 2747|       |			 * Get path lengths of remaining elements of main tree.
 2748|       |			 */
 2749|     37|			r = lzx_read_bitlen(strm, &ds->lt, -1);
 2750|     37|			if (r < 0)
  ------------------
  |  Branch (2750:8): [True: 0, False: 37]
  ------------------
 2751|      0|				goto failed;
 2752|     37|			else if (!r) {
  ------------------
  |  Branch (2752:13): [True: 1, False: 36]
  ------------------
 2753|      1|				ds->state = ST_LENGTH_TREE;
  ------------------
  |  | 2409|      1|#define ST_LENGTH_TREE		17
  ------------------
 2754|      1|				if (last)
  ------------------
  |  Branch (2754:9): [True: 0, False: 1]
  ------------------
 2755|      0|					goto failed;
 2756|      1|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2757|      1|			}
 2758|     36|			if (!lzx_make_huffman_table(&ds->lt))
  ------------------
  |  Branch (2758:8): [True: 0, False: 36]
  ------------------
 2759|      0|				goto failed;
 2760|     36|			ds->state = ST_MAIN;
  ------------------
  |  | 2410|     36|#define ST_MAIN			18
  ------------------
 2761|     36|			return (100);
 2762|    568|		}
 2763|    568|	}
 2764|     12|failed:
 2765|     12|	return (ds->error = ARCHIVE_FAILED);
  ------------------
  |  |  237|     12|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2766|    518|}
archive_read_support_format_cab.c:lzx_br_fillup:
 2292|  12.8k|{
 2293|       |/*
 2294|       | * x86 processor family can read misaligned data without an access error.
 2295|       | */
 2296|  12.8k|	int n = CACHE_BITS - br->cache_avail;
  ------------------
  |  |   97|  12.8k|#define CACHE_BITS		(8 * sizeof(CACHE_TYPE))
  ------------------
 2297|       |
 2298|  12.8k|	for (;;) {
 2299|  12.8k|		switch (n >> 4) {
 2300|  1.07k|		case 4:
  ------------------
  |  Branch (2300:3): [True: 1.07k, False: 11.8k]
  ------------------
 2301|  1.07k|			if (strm->avail_in >= 8) {
  ------------------
  |  Branch (2301:8): [True: 1.06k, False: 6]
  ------------------
 2302|  1.06k|				br->cache_buffer =
 2303|  1.06k|				    ((uint64_t)strm->next_in[1]) << 56 |
 2304|  1.06k|				    ((uint64_t)strm->next_in[0]) << 48 |
 2305|  1.06k|				    ((uint64_t)strm->next_in[3]) << 40 |
 2306|  1.06k|				    ((uint64_t)strm->next_in[2]) << 32 |
 2307|  1.06k|				    ((uint32_t)strm->next_in[5]) << 24 |
 2308|  1.06k|				    ((uint32_t)strm->next_in[4]) << 16 |
 2309|  1.06k|				    ((uint32_t)strm->next_in[7]) << 8 |
 2310|  1.06k|				     (uint32_t)strm->next_in[6];
 2311|  1.06k|				strm->next_in += 8;
 2312|  1.06k|				strm->avail_in -= 8;
 2313|  1.06k|				br->cache_avail += 8 * 8;
 2314|  1.06k|				return (1);
 2315|  1.06k|			}
 2316|      6|			break;
 2317|  11.7k|		case 3:
  ------------------
  |  Branch (2317:3): [True: 11.7k, False: 1.12k]
  ------------------
 2318|  11.7k|			if (strm->avail_in >= 6) {
  ------------------
  |  Branch (2318:8): [True: 11.7k, False: 25]
  ------------------
 2319|  11.7k|				br->cache_buffer =
 2320|  11.7k|		 		   (br->cache_buffer << 48) |
 2321|  11.7k|				    ((uint64_t)strm->next_in[1]) << 40 |
 2322|  11.7k|				    ((uint64_t)strm->next_in[0]) << 32 |
 2323|  11.7k|				    ((uint64_t)strm->next_in[3]) << 24 |
 2324|  11.7k|				    ((uint64_t)strm->next_in[2]) << 16 |
 2325|  11.7k|				    ((uint64_t)strm->next_in[5]) << 8 |
 2326|  11.7k|				     (uint64_t)strm->next_in[4];
 2327|  11.7k|				strm->next_in += 6;
 2328|  11.7k|				strm->avail_in -= 6;
 2329|  11.7k|				br->cache_avail += 6 * 8;
 2330|  11.7k|				return (1);
 2331|  11.7k|			}
 2332|     25|			break;
 2333|     25|		case 0:
  ------------------
  |  Branch (2333:3): [True: 8, False: 12.8k]
  ------------------
 2334|       |			/* We have enough compressed data in
 2335|       |			 * the cache buffer.*/
 2336|      8|			return (1);
 2337|     46|		default:
  ------------------
  |  Branch (2337:3): [True: 46, False: 12.8k]
  ------------------
 2338|     46|			break;
 2339|  12.8k|		}
 2340|     77|		if (strm->avail_in < 2) {
  ------------------
  |  Branch (2340:7): [True: 30, False: 47]
  ------------------
 2341|       |			/* There is not enough compressed data to
 2342|       |			 * fill up the cache buffer. */
 2343|     30|			if (strm->avail_in == 1) {
  ------------------
  |  Branch (2343:8): [True: 13, False: 17]
  ------------------
 2344|     13|				br->odd = *strm->next_in++;
 2345|     13|				strm->avail_in--;
 2346|     13|				br->have_odd = 1;
 2347|     13|			}
 2348|     30|			return (0);
 2349|     30|		}
 2350|     47|		br->cache_buffer =
 2351|     47|		   (br->cache_buffer << 16) |
 2352|     47|		    archive_le16dec(strm->next_in);
 2353|     47|		strm->next_in += 2;
 2354|     47|		strm->avail_in -= 2;
 2355|     47|		br->cache_avail += 16;
 2356|     47|		n -= 16;
 2357|     47|	}
 2358|  12.8k|}
archive_read_support_format_cab.c:lzx_make_huffman_table:
 3178|    205|{
 3179|    205|	uint16_t *tbl;
 3180|    205|	const unsigned char *bitlen;
 3181|    205|	int bitptn[17], weight[17];
 3182|    205|	int i, maxbits = 0, ptn, tbl_size, w;
 3183|    205|	int len_avail;
 3184|       |
 3185|       |	/*
 3186|       |	 * Initialize bit patterns.
 3187|       |	 */
 3188|    205|	ptn = 0;
 3189|  3.48k|	for (i = 1, w = 1 << 15; i <= 16; i++, w >>= 1) {
  ------------------
  |  Branch (3189:27): [True: 3.28k, False: 205]
  ------------------
 3190|  3.28k|		bitptn[i] = ptn;
 3191|  3.28k|		weight[i] = w;
 3192|  3.28k|		if (hf->freq[i]) {
  ------------------
  |  Branch (3192:7): [True: 204, False: 3.07k]
  ------------------
 3193|    204|			ptn += hf->freq[i] * w;
 3194|    204|			maxbits = i;
 3195|    204|		}
 3196|  3.28k|	}
 3197|    205|	if ((ptn & 0xffff) != 0 || maxbits > hf->tbl_bits)
  ------------------
  |  Branch (3197:6): [True: 4, False: 201]
  |  Branch (3197:29): [True: 0, False: 201]
  ------------------
 3198|      4|		return (0);/* Invalid */
 3199|       |
 3200|    201|	hf->max_bits = maxbits;
 3201|       |
 3202|       |	/*
 3203|       |	 * Cut out extra bits which we won't house in the table.
 3204|       |	 * This preparation reduces the same calculation in the for-loop
 3205|       |	 * making the table.
 3206|       |	 */
 3207|    201|	if (maxbits < 16) {
  ------------------
  |  Branch (3207:6): [True: 201, False: 0]
  ------------------
 3208|    201|		int ebits = 16 - maxbits;
 3209|    427|		for (i = 1; i <= maxbits; i++) {
  ------------------
  |  Branch (3209:15): [True: 226, False: 201]
  ------------------
 3210|    226|			bitptn[i] >>= ebits;
 3211|    226|			weight[i] >>= ebits;
 3212|    226|		}
 3213|    201|	}
 3214|       |
 3215|       |	/*
 3216|       |	 * Make the table.
 3217|       |	 */
 3218|    201|	tbl_size = 1 << hf->tbl_bits;
 3219|    201|	tbl = hf->tbl;
 3220|    201|	bitlen = hf->bitlen;
 3221|    201|	len_avail = hf->len_size;
 3222|    201|	hf->tree_used = 0;
 3223|       |	/* Initialize table to invalid values */
 3224|  4.97M|	for (i = 0; i < tbl_size; i++) {
  ------------------
  |  Branch (3224:14): [True: 4.97M, False: 201]
  ------------------
 3225|  4.97M|		tbl[i] = (uint16_t)hf->len_size;
 3226|  4.97M|	}
 3227|  35.6k|	for (i = 0; i < len_avail; i++) {
  ------------------
  |  Branch (3227:14): [True: 35.4k, False: 201]
  ------------------
 3228|  35.4k|		uint16_t *p;
 3229|  35.4k|		int len, cnt;
 3230|       |
 3231|  35.4k|		if (bitlen[i] == 0)
  ------------------
  |  Branch (3231:7): [True: 21.3k, False: 14.1k]
  ------------------
 3232|  21.3k|			continue;
 3233|       |		/* Get a bit pattern */
 3234|  14.1k|		len = bitlen[i];
 3235|  14.1k|		if (len > tbl_size)
  ------------------
  |  Branch (3235:7): [True: 0, False: 14.1k]
  ------------------
 3236|      0|			return (0);
 3237|  14.1k|		ptn = bitptn[len];
 3238|  14.1k|		cnt = weight[len];
 3239|       |		/* Calculate next bit pattern */
 3240|  14.1k|		if ((bitptn[len] = ptn + cnt) > tbl_size)
  ------------------
  |  Branch (3240:7): [True: 0, False: 14.1k]
  ------------------
 3241|      0|			return (0);/* Invalid */
 3242|       |		/* Update the table */
 3243|  14.1k|		p = &(tbl[ptn]);
 3244|  31.0k|		while (--cnt >= 0)
  ------------------
  |  Branch (3244:10): [True: 16.8k, False: 14.1k]
  ------------------
 3245|  16.8k|			p[cnt] = (uint16_t)i;
 3246|  14.1k|	}
 3247|    201|	return (1);
 3248|    201|}
archive_read_support_format_cab.c:lzx_read_pre_tree:
 3044|    127|{
 3045|    127|	struct lzx_dec *ds = strm->ds;
 3046|    127|	struct lzx_br *br = &(ds->br);
 3047|    127|	int i;
 3048|       |
 3049|    127|	if (ds->loop == 0)
  ------------------
  |  Branch (3049:6): [True: 127, False: 0]
  ------------------
 3050|    127|		memset(ds->pt.freq, 0, sizeof(ds->pt.freq));
 3051|  2.62k|	for (i = ds->loop; i < ds->pt.len_size; i++) {
  ------------------
  |  Branch (3051:21): [True: 2.50k, False: 123]
  ------------------
 3052|  2.50k|		if (!lzx_br_read_ahead(strm, br, 4)) {
  ------------------
  |  | 2263|  2.50k|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2258|  5.00k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2244|  5.00k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2244:27): [True: 2.35k, False: 146]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2258:28): [True: 139, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2244|      7|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2244:27): [True: 3, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3053|      4|			ds->loop = i;
 3054|      4|			return (0);
 3055|      4|		}
 3056|  2.49k|		ds->pt.bitlen[i] = lzx_br_bits(br, 4);
  ------------------
  |  | 2247|  2.49k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2248|  2.49k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3057|  2.49k|		ds->pt.freq[ds->pt.bitlen[i]]++;
 3058|  2.49k|		lzx_br_consume(br, 4);
  ------------------
  |  | 2266|  2.49k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3059|  2.49k|	}
 3060|    123|	ds->loop = i;
 3061|    123|	return (1);
 3062|    127|}
archive_read_support_format_cab.c:lzx_read_bitlen:
 3069|    121|{
 3070|    121|	struct lzx_dec *ds = strm->ds;
 3071|    121|	struct lzx_br *br = &(ds->br);
 3072|    121|	int c, i, j, ret, same;
 3073|    121|	unsigned rbits;
 3074|       |
 3075|    121|	i = ds->loop;
 3076|    121|	if (i == 0)
  ------------------
  |  Branch (3076:6): [True: 80, False: 41]
  ------------------
 3077|     80|		memset(d->freq, 0, sizeof(d->freq));
 3078|    121|	ret = 0;
 3079|    121|	if (end < 0)
  ------------------
  |  Branch (3079:6): [True: 78, False: 43]
  ------------------
 3080|     78|		end = d->len_size;
 3081|  31.6k|	while (i < end) {
  ------------------
  |  Branch (3081:9): [True: 31.5k, False: 116]
  ------------------
 3082|  31.5k|		ds->loop = i;
 3083|  31.5k|		if (!lzx_br_read_ahead(strm, br, ds->pt.max_bits))
  ------------------
  |  | 2263|  31.5k|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2258|  63.0k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2244|  63.0k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2244:27): [True: 31.0k, False: 450]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2258:28): [True: 445, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2244|      5|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2244:27): [True: 2, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3084|      3|			goto getdata;
 3085|  31.5k|		rbits = lzx_br_bits(br, ds->pt.max_bits);
  ------------------
  |  | 2247|  31.5k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2248|  31.5k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3086|  31.5k|		c = lzx_decode_huffman(&(ds->pt), rbits);
 3087|  31.5k|		switch (c) {
 3088|    234|		case 17:/* several zero lengths, from 4 to 19. */
  ------------------
  |  Branch (3088:3): [True: 234, False: 31.3k]
  ------------------
 3089|    234|			if (!lzx_br_read_ahead(strm, br, ds->pt.bitlen[c]+4))
  ------------------
  |  | 2263|    234|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2258|    468|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2244|    468|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2244:27): [True: 229, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2258:28): [True: 4, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2244|      1|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2244:27): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3090|      1|				goto getdata;
 3091|    233|			lzx_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 2266|    233|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3092|    233|			same = lzx_br_bits(br, 4) + 4;
  ------------------
  |  | 2247|    233|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2248|    233|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3093|    233|			if (i + same > end)
  ------------------
  |  Branch (3093:8): [True: 0, False: 233]
  ------------------
 3094|      0|				return (-1);/* Invalid */
 3095|    233|			lzx_br_consume(br, 4);
  ------------------
  |  | 2266|    233|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3096|  1.54k|			for (j = 0; j < same; j++)
  ------------------
  |  Branch (3096:16): [True: 1.31k, False: 233]
  ------------------
 3097|  1.31k|				d->bitlen[i++] = 0;
 3098|    233|			break;
 3099|     92|		case 18:/* many zero lengths, from 20 to 51. */
  ------------------
  |  Branch (3099:3): [True: 92, False: 31.4k]
  ------------------
 3100|     92|			if (!lzx_br_read_ahead(strm, br, ds->pt.bitlen[c]+5))
  ------------------
  |  | 2263|     92|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2258|    184|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2244|    184|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2244:27): [True: 91, False: 1]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2258:28): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2244|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2244:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3101|      0|				goto getdata;
 3102|     92|			lzx_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 2266|     92|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3103|     92|			same = lzx_br_bits(br, 5) + 20;
  ------------------
  |  | 2247|     92|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2248|     92|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3104|     92|			if (i + same > end)
  ------------------
  |  Branch (3104:8): [True: 0, False: 92]
  ------------------
 3105|      0|				return (-1);/* Invalid */
 3106|     92|			lzx_br_consume(br, 5);
  ------------------
  |  | 2266|     92|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3107|     92|			memset(d->bitlen + i, 0, same);
 3108|     92|			i += same;
 3109|     92|			break;
 3110|     79|		case 19:/* a few same lengths. */
  ------------------
  |  Branch (3110:3): [True: 79, False: 31.4k]
  ------------------
 3111|     79|			if (!lzx_br_read_ahead(strm, br,
  ------------------
  |  | 2263|     79|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2258|    158|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2244|    158|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2244:27): [True: 76, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2258:28): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2244|      3|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2244:27): [True: 2, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3112|     79|			    ds->pt.bitlen[c]+1+ds->pt.max_bits))
 3113|      1|				goto getdata;
 3114|     78|			lzx_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 2266|     78|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3115|     78|			same = lzx_br_bits(br, 1) + 4;
  ------------------
  |  | 2247|     78|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2248|     78|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3116|     78|			if (i + same > end)
  ------------------
  |  Branch (3116:8): [True: 0, False: 78]
  ------------------
 3117|      0|				return (-1);
 3118|     78|			lzx_br_consume(br, 1);
  ------------------
  |  | 2266|     78|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3119|     78|			rbits = lzx_br_bits(br, ds->pt.max_bits);
  ------------------
  |  | 2247|     78|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2248|     78|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3120|     78|			c = lzx_decode_huffman(&(ds->pt), rbits);
 3121|     78|			lzx_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 2266|     78|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3122|     78|			c = (d->bitlen[i] - c + 17) % 17;
 3123|     78|			if (c < 0)
  ------------------
  |  Branch (3123:8): [True: 0, False: 78]
  ------------------
 3124|      0|				return (-1);/* Invalid */
 3125|    431|			for (j = 0; j < same; j++)
  ------------------
  |  Branch (3125:16): [True: 353, False: 78]
  ------------------
 3126|    353|				d->bitlen[i++] = c;
 3127|     78|			d->freq[c] += same;
 3128|     78|			break;
 3129|  31.1k|		default:
  ------------------
  |  Branch (3129:3): [True: 31.1k, False: 405]
  ------------------
 3130|  31.1k|			lzx_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 2266|  31.1k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3131|  31.1k|			c = (d->bitlen[i] - c + 17) % 17;
 3132|  31.1k|			if (c < 0)
  ------------------
  |  Branch (3132:8): [True: 0, False: 31.1k]
  ------------------
 3133|      0|				return (-1);/* Invalid */
 3134|  31.1k|			d->freq[c]++;
 3135|  31.1k|			d->bitlen[i++] = c;
 3136|  31.1k|			break;
 3137|  31.5k|		}
 3138|  31.5k|	}
 3139|    116|	ret = 1;
 3140|    121|getdata:
 3141|    121|	ds->loop = i;
 3142|    121|	return (ret);
 3143|    116|}
archive_read_support_format_cab.c:lzx_decode_huffman:
 3252|   206k|{
 3253|   206k|	int c;
 3254|   206k|	c = hf->tbl[rbits];
 3255|   206k|	if (c < hf->len_size)
  ------------------
  |  Branch (3255:6): [True: 116k, False: 89.9k]
  ------------------
 3256|   116k|		return (c);
 3257|  89.9k|	return (0);
 3258|   206k|}
archive_read_support_format_cab.c:lzx_decode_blocks:
 2770|     38|{
 2771|     38|	struct lzx_dec *ds = strm->ds;
 2772|     38|	struct lzx_br bre = ds->br;
 2773|     38|	struct huffman *at = &(ds->at), *lt = &(ds->lt), *mt = &(ds->mt);
 2774|     38|	const struct lzx_pos_tbl *pos_tbl = ds->pos_tbl;
 2775|     38|	unsigned char *noutp = strm->next_out;
 2776|     38|	unsigned char *endp = noutp + strm->avail_out;
 2777|     38|	unsigned char *w_buff = ds->w_buff;
 2778|     38|	unsigned char *at_bitlen = at->bitlen;
 2779|     38|	unsigned char *lt_bitlen = lt->bitlen;
 2780|     38|	unsigned char *mt_bitlen = mt->bitlen;
 2781|     38|	size_t block_bytes_avail = ds->block_bytes_avail;
 2782|     38|	int at_max_bits = at->max_bits;
 2783|     38|	int lt_max_bits = lt->max_bits;
 2784|     38|	int mt_max_bits = mt->max_bits;
 2785|     38|	int c, copy_len = ds->copy_len, copy_pos = ds->copy_pos;
 2786|     38|	int w_pos = ds->w_pos, w_mask = ds->w_mask, w_size = ds->w_size;
 2787|     38|	int length_header = ds->length_header;
 2788|     38|	int offset_bits = ds->offset_bits;
 2789|     38|	int position_slot = ds->position_slot;
 2790|     38|	int r0 = ds->r0, r1 = ds->r1, r2 = ds->r2;
 2791|     38|	int state = ds->state;
 2792|     38|	char block_type = ds->block_type;
 2793|       |
 2794|   107k|	for (;;) {
 2795|   107k|		switch (state) {
  ------------------
  |  Branch (2795:11): [True: 107k, False: 0]
  ------------------
 2796|  94.1k|		case ST_MAIN:
  ------------------
  |  | 2410|  94.1k|#define ST_MAIN			18
  ------------------
  |  Branch (2796:3): [True: 94.1k, False: 13.5k]
  ------------------
 2797|   169k|			for (;;) {
 2798|   169k|				if (block_bytes_avail == 0) {
  ------------------
  |  Branch (2798:9): [True: 24, False: 169k]
  ------------------
 2799|       |					/* This block ended. */
 2800|     24|					ds->state = ST_RD_BLOCK_TYPE;
  ------------------
  |  | 2394|     24|#define ST_RD_BLOCK_TYPE	2
  ------------------
 2801|     24|					ds->br = bre;
 2802|     24|					ds->block_bytes_avail =
 2803|     24|					    block_bytes_avail;
 2804|     24|					ds->copy_len = copy_len;
 2805|     24|					ds->copy_pos = copy_pos;
 2806|     24|					ds->length_header = length_header;
 2807|     24|					ds->position_slot = position_slot;
 2808|     24|					ds->r0 = r0; ds->r1 = r1; ds->r2 = r2;
 2809|     24|					ds->w_pos = w_pos;
 2810|     24|					strm->avail_out = endp - noutp;
 2811|     24|					return (ARCHIVE_EOF);
  ------------------
  |  |  232|     24|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2812|     24|				}
 2813|   169k|				if (noutp >= endp)
  ------------------
  |  Branch (2813:9): [True: 5, False: 169k]
  ------------------
 2814|       |					/* Output buffer is empty. */
 2815|      5|					goto next_data;
 2816|       |
 2817|   169k|				if (!lzx_br_read_ahead(strm, &bre,
  ------------------
  |  | 2263|   169k|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2258|   339k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2244|   339k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2244:27): [True: 168k, False: 1.85k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2258:28): [True: 1.85k, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2244|      1|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2244:27): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2818|   169k|				    mt_max_bits)) {
 2819|      1|					if (!last)
  ------------------
  |  Branch (2819:10): [True: 1, False: 0]
  ------------------
 2820|      1|						goto next_data;
 2821|       |					/* Remaining bits are less than
 2822|       |					 * maximum bits(mt.max_bits) but maybe
 2823|       |					 * it still remains as much as we need,
 2824|       |					 * so we should try to use it with
 2825|       |					 * dummy bits. */
 2826|      0|					c = lzx_decode_huffman(mt,
 2827|      0|					      lzx_br_bits_forced(
  ------------------
  |  | 2250|      0|	(((uint32_t)((br)->cache_buffer <<		\
  |  | 2251|      0|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 2828|      0|				 	        &bre, mt_max_bits));
 2829|      0|					lzx_br_consume(&bre, mt_bitlen[c]);
  ------------------
  |  | 2266|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2830|      0|					if (!lzx_br_has(&bre, 0))
  ------------------
  |  | 2244|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (2830:10): [True: 0, False: 0]
  ------------------
 2831|      0|						goto failed;/* Over read. */
 2832|   169k|				} else {
 2833|   169k|					c = lzx_decode_huffman(mt,
 2834|   169k|					      lzx_br_bits(&bre, mt_max_bits));
  ------------------
  |  | 2247|   169k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2248|   169k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2835|   169k|					lzx_br_consume(&bre, mt_bitlen[c]);
  ------------------
  |  | 2266|   169k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2836|   169k|				}
 2837|   169k|				if ((unsigned int)c > UCHAR_MAX)
  ------------------
  |  Branch (2837:9): [True: 94.0k, False: 75.8k]
  ------------------
 2838|  94.0k|					break;
 2839|       |				/*
 2840|       |				 * 'c' is exactly literal code.
 2841|       |				 */
 2842|       |				/* Save a decoded code to reference it
 2843|       |				 * afterward. */
 2844|  75.8k|				w_buff[w_pos] = c;
 2845|  75.8k|				w_pos = (w_pos + 1) & w_mask;
 2846|       |				/* Store the decoded code to output buffer. */
 2847|  75.8k|				*noutp++ = c;
 2848|  75.8k|				block_bytes_avail--;
 2849|  75.8k|			}
 2850|       |			/*
 2851|       |			 * Get a match code, its length and offset.
 2852|       |			 */
 2853|  94.0k|			c -= UCHAR_MAX + 1;
 2854|  94.0k|			length_header = c & 7;
 2855|  94.0k|			position_slot = c >> 3;
 2856|       |			/* FALL THROUGH */
 2857|  94.0k|		case ST_LENGTH:
  ------------------
  |  | 2411|  94.0k|#define ST_LENGTH		19
  ------------------
  |  Branch (2857:3): [True: 0, False: 107k]
  ------------------
 2858|       |			/*
 2859|       |			 * Get a length.
 2860|       |			 */
 2861|  94.0k|			if (length_header == 7) {
  ------------------
  |  Branch (2861:8): [True: 1.47k, False: 92.6k]
  ------------------
 2862|  1.47k|				if (!lzx_br_read_ahead(strm, &bre,
  ------------------
  |  | 2263|  1.47k|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2258|  2.95k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2244|  2.95k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2244:27): [True: 1.42k, False: 47]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2258:28): [True: 47, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2244|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2244:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2863|  1.47k|				    lt_max_bits)) {
 2864|      0|					if (!last) {
  ------------------
  |  Branch (2864:10): [True: 0, False: 0]
  ------------------
 2865|      0|						state = ST_LENGTH;
  ------------------
  |  | 2411|      0|#define ST_LENGTH		19
  ------------------
 2866|      0|						goto next_data;
 2867|      0|					}
 2868|      0|					c = lzx_decode_huffman(lt,
 2869|      0|					      lzx_br_bits_forced(
  ------------------
  |  | 2250|      0|	(((uint32_t)((br)->cache_buffer <<		\
  |  | 2251|      0|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 2870|      0|					        &bre, lt_max_bits));
 2871|      0|					lzx_br_consume(&bre, lt_bitlen[c]);
  ------------------
  |  | 2266|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2872|      0|					if (!lzx_br_has(&bre, 0))
  ------------------
  |  | 2244|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (2872:10): [True: 0, False: 0]
  ------------------
 2873|      0|						goto failed;/* Over read. */
 2874|  1.47k|				} else {
 2875|  1.47k|					c = lzx_decode_huffman(lt,
 2876|  1.47k|					    lzx_br_bits(&bre, lt_max_bits));
  ------------------
  |  | 2247|  1.47k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2248|  1.47k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2877|  1.47k|					lzx_br_consume(&bre, lt_bitlen[c]);
  ------------------
  |  | 2266|  1.47k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2878|  1.47k|				}
 2879|  1.47k|				copy_len = c + 7 + 2;
 2880|  1.47k|			} else
 2881|  92.6k|				copy_len = length_header + 2;
 2882|  94.0k|			if ((size_t)copy_len > block_bytes_avail)
  ------------------
  |  Branch (2882:8): [True: 0, False: 94.0k]
  ------------------
 2883|      0|				goto failed;
 2884|       |			/*
 2885|       |			 * Get an offset.
 2886|       |			 */
 2887|  94.0k|			switch (position_slot) {
 2888|  12.0k|			case 0: /* Use repeated offset 0. */
  ------------------
  |  Branch (2888:4): [True: 12.0k, False: 82.0k]
  ------------------
 2889|  12.0k|				copy_pos = r0;
 2890|  12.0k|				state = ST_REAL_POS;
  ------------------
  |  | 2413|  12.0k|#define ST_REAL_POS		21
  ------------------
 2891|  12.0k|				continue;
 2892|    738|			case 1: /* Use repeated offset 1. */
  ------------------
  |  Branch (2892:4): [True: 738, False: 93.3k]
  ------------------
 2893|    738|				copy_pos = r1;
 2894|       |				/* Swap repeated offset. */
 2895|    738|				r1 = r0;
 2896|    738|				r0 = copy_pos;
 2897|    738|				state = ST_REAL_POS;
  ------------------
  |  | 2413|    738|#define ST_REAL_POS		21
  ------------------
 2898|    738|				continue;
 2899|    718|			case 2: /* Use repeated offset 2. */
  ------------------
  |  Branch (2899:4): [True: 718, False: 93.3k]
  ------------------
 2900|    718|				copy_pos = r2;
 2901|       |				/* Swap repeated offset. */
 2902|    718|				r2 = r0;
 2903|    718|				r0 = copy_pos;
 2904|    718|				state = ST_REAL_POS;
  ------------------
  |  | 2413|    718|#define ST_REAL_POS		21
  ------------------
 2905|    718|				continue;
 2906|  80.5k|			default:
  ------------------
  |  Branch (2906:4): [True: 80.5k, False: 13.5k]
  ------------------
 2907|  80.5k|				offset_bits =
 2908|  80.5k|				    pos_tbl[position_slot].footer_bits;
 2909|  80.5k|				break;
 2910|  94.0k|			}
 2911|       |			/* FALL THROUGH */
 2912|  80.5k|		case ST_OFFSET:
  ------------------
  |  | 2412|  80.5k|#define ST_OFFSET		20
  ------------------
  |  Branch (2912:3): [True: 0, False: 107k]
  ------------------
 2913|       |			/*
 2914|       |			 * Get the offset, which is a distance from
 2915|       |			 * current window position.
 2916|       |			 */
 2917|  80.5k|			if (block_type == ALIGNED_OFFSET_BLOCK &&
  ------------------
  |  |   76|   161k|#define ALIGNED_OFFSET_BLOCK	2
  ------------------
  |  Branch (2917:8): [True: 3.49k, False: 77.0k]
  ------------------
 2918|  3.49k|			    offset_bits >= 3) {
  ------------------
  |  Branch (2918:8): [True: 3.09k, False: 400]
  ------------------
 2919|  3.09k|				int offbits = offset_bits - 3;
 2920|       |
 2921|  3.09k|				if (!lzx_br_read_ahead(strm, &bre, offbits)) {
  ------------------
  |  | 2263|  3.09k|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2258|  6.18k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2244|  6.18k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2244:27): [True: 2.91k, False: 171]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2258:28): [True: 171, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2244|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2244:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2922|      0|					state = ST_OFFSET;
  ------------------
  |  | 2412|      0|#define ST_OFFSET		20
  ------------------
 2923|      0|					if (last)
  ------------------
  |  Branch (2923:10): [True: 0, False: 0]
  ------------------
 2924|      0|						goto failed;
 2925|      0|					goto next_data;
 2926|      0|				}
 2927|  3.09k|				copy_pos = lzx_br_bits(&bre, offbits) << 3;
  ------------------
  |  | 2247|  3.09k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2248|  3.09k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2928|       |
 2929|       |				/* Get an aligned number. */
 2930|  3.09k|				if (!lzx_br_read_ahead(strm, &bre,
  ------------------
  |  | 2263|  3.09k|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2258|  6.18k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2244|  6.18k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2244:27): [True: 3.07k, False: 20]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2258:28): [True: 20, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2244|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2244:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2931|  3.09k|				    offbits + at_max_bits)) {
 2932|      0|					if (!last) {
  ------------------
  |  Branch (2932:10): [True: 0, False: 0]
  ------------------
 2933|      0|						state = ST_OFFSET;
  ------------------
  |  | 2412|      0|#define ST_OFFSET		20
  ------------------
 2934|      0|						goto next_data;
 2935|      0|					}
 2936|      0|					lzx_br_consume(&bre, offbits);
  ------------------
  |  | 2266|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2937|      0|					c = lzx_decode_huffman(at,
 2938|      0|					      lzx_br_bits_forced(&bre,
  ------------------
  |  | 2250|      0|	(((uint32_t)((br)->cache_buffer <<		\
  |  | 2251|      0|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 2939|      0|					        at_max_bits));
 2940|      0|					lzx_br_consume(&bre, at_bitlen[c]);
  ------------------
  |  | 2266|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2941|      0|					if (!lzx_br_has(&bre, 0))
  ------------------
  |  | 2244|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (2941:10): [True: 0, False: 0]
  ------------------
 2942|      0|						goto failed;/* Over read. */
 2943|  3.09k|				} else {
 2944|  3.09k|					lzx_br_consume(&bre, offbits);
  ------------------
  |  | 2266|  3.09k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2945|  3.09k|					c = lzx_decode_huffman(at,
 2946|  3.09k|					      lzx_br_bits(&bre, at_max_bits));
  ------------------
  |  | 2247|  3.09k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2248|  3.09k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2947|  3.09k|					lzx_br_consume(&bre, at_bitlen[c]);
  ------------------
  |  | 2266|  3.09k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2948|  3.09k|				}
 2949|       |				/* Add an aligned number. */
 2950|  3.09k|				copy_pos += c;
 2951|  77.4k|			} else {
 2952|  77.4k|				if (!lzx_br_read_ahead(strm, &bre,
  ------------------
  |  | 2263|  77.4k|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2258|   154k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 2244|   154k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2244:27): [True: 67.8k, False: 9.63k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2258:28): [True: 9.62k, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2244|      7|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2244:27): [True: 4, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2953|  77.4k|				    offset_bits)) {
 2954|      3|					state = ST_OFFSET;
  ------------------
  |  | 2412|      3|#define ST_OFFSET		20
  ------------------
 2955|      3|					if (last)
  ------------------
  |  Branch (2955:10): [True: 0, False: 3]
  ------------------
 2956|      0|						goto failed;
 2957|      3|					goto next_data;
 2958|      3|				}
 2959|  77.4k|				copy_pos = lzx_br_bits(&bre, offset_bits);
  ------------------
  |  | 2247|  77.4k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2248|  77.4k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2960|  77.4k|				lzx_br_consume(&bre, offset_bits);
  ------------------
  |  | 2266|  77.4k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2961|  77.4k|			}
 2962|  80.5k|			copy_pos += pos_tbl[position_slot].base -2;
 2963|       |
 2964|       |			/* Update repeated offset LRU queue. */
 2965|  80.5k|			r2 = r1;
 2966|  80.5k|			r1 = r0;
 2967|  80.5k|			r0 = copy_pos;
 2968|       |			/* FALL THROUGH */
 2969|  94.0k|		case ST_REAL_POS:
  ------------------
  |  | 2413|  94.0k|#define ST_REAL_POS		21
  ------------------
  |  Branch (2969:3): [True: 13.5k, False: 94.1k]
  ------------------
 2970|       |			/*
 2971|       |			 * Compute a real position in window.
 2972|       |			 */
 2973|  94.0k|			copy_pos = (w_pos - copy_pos) & w_mask;
 2974|       |			/* FALL THROUGH */
 2975|  94.0k|		case ST_COPY:
  ------------------
  |  | 2414|  94.0k|#define ST_COPY			22
  ------------------
  |  Branch (2975:3): [True: 1, False: 107k]
  ------------------
 2976|       |			/*
 2977|       |			 * Copy several bytes as extracted data from the window
 2978|       |			 * into the output buffer.
 2979|       |			 */
 2980|  94.1k|			for (;;) {
 2981|  94.1k|				const unsigned char *s;
 2982|  94.1k|				int l;
 2983|       |
 2984|  94.1k|				l = copy_len;
 2985|  94.1k|				if (copy_pos > w_pos) {
  ------------------
  |  Branch (2985:9): [True: 2.30k, False: 91.8k]
  ------------------
 2986|  2.30k|					if (l > w_size - copy_pos)
  ------------------
  |  Branch (2986:10): [True: 50, False: 2.25k]
  ------------------
 2987|     50|						l = w_size - copy_pos;
 2988|  91.8k|				} else {
 2989|  91.8k|					if (l > w_size - w_pos)
  ------------------
  |  Branch (2989:10): [True: 0, False: 91.8k]
  ------------------
 2990|      0|						l = w_size - w_pos;
 2991|  91.8k|				}
 2992|  94.1k|				if (noutp + l >= endp)
  ------------------
  |  Branch (2992:9): [True: 5, False: 94.1k]
  ------------------
 2993|      5|					l = (int)(endp - noutp);
 2994|  94.1k|				s = w_buff + copy_pos;
 2995|  94.1k|				if (l >= 8 && ((copy_pos + l < w_pos)
  ------------------
  |  Branch (2995:9): [True: 30.8k, False: 63.2k]
  |  Branch (2995:20): [True: 28.8k, False: 2.01k]
  ------------------
 2996|  29.0k|				  || (w_pos + l < copy_pos))) {
  ------------------
  |  Branch (2996:10): [True: 203, False: 1.81k]
  ------------------
 2997|  29.0k|					memcpy(w_buff + w_pos, s, l);
 2998|  29.0k|					memcpy(noutp, s, l);
 2999|  65.0k|				} else {
 3000|  65.0k|					unsigned char *d;
 3001|  65.0k|					int li;
 3002|       |
 3003|  65.0k|					d = w_buff + w_pos;
 3004|   421k|					for (li = 0; li < l; li++)
  ------------------
  |  Branch (3004:19): [True: 356k, False: 65.0k]
  ------------------
 3005|   356k|						noutp[li] = d[li] = s[li];
 3006|  65.0k|				}
 3007|  94.1k|				noutp += l;
 3008|  94.1k|				copy_pos = (copy_pos + l) & w_mask;
 3009|  94.1k|				w_pos = (w_pos + l) & w_mask;
 3010|  94.1k|				block_bytes_avail -= l;
 3011|  94.1k|				if (copy_len <= l)
  ------------------
  |  Branch (3011:9): [True: 94.0k, False: 55]
  ------------------
 3012|       |					/* A copy of current pattern ended. */
 3013|  94.0k|					break;
 3014|     55|				copy_len -= l;
 3015|     55|				if (noutp >= endp) {
  ------------------
  |  Branch (3015:9): [True: 5, False: 50]
  ------------------
 3016|       |					/* Output buffer is empty. */
 3017|      5|					state = ST_COPY;
  ------------------
  |  | 2414|      5|#define ST_COPY			22
  ------------------
 3018|      5|					goto next_data;
 3019|      5|				}
 3020|     55|			}
 3021|  94.0k|			state = ST_MAIN;
  ------------------
  |  | 2410|  94.0k|#define ST_MAIN			18
  ------------------
 3022|  94.0k|			break;
 3023|   107k|		}
 3024|   107k|	}
 3025|      0|failed:
 3026|      0|	return (ds->error = ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3027|     14|next_data:
 3028|     14|	ds->br = bre;
 3029|     14|	ds->block_bytes_avail = block_bytes_avail;
 3030|     14|	ds->copy_len = copy_len;
 3031|     14|	ds->copy_pos = copy_pos;
 3032|     14|	ds->length_header = length_header;
 3033|     14|	ds->offset_bits = offset_bits;
 3034|     14|	ds->position_slot = position_slot;
 3035|     14|	ds->r0 = r0; ds->r1 = r1; ds->r2 = r2;
 3036|     14|	ds->state = state;
 3037|     14|	ds->w_pos = w_pos;
 3038|     14|	strm->avail_out = endp - noutp;
 3039|     14|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     14|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3040|     38|}
archive_read_support_format_cab.c:lzx_translation:
 2215|     21|{
 2216|     21|	struct lzx_dec *ds = strm->ds;
 2217|     21|	unsigned char *b, *end;
 2218|       |
 2219|     21|	if (!ds->translation || size <= 10)
  ------------------
  |  Branch (2219:6): [True: 13, False: 8]
  |  Branch (2219:26): [True: 3, False: 5]
  ------------------
 2220|     16|		return;
 2221|      5|	b = p;
 2222|      5|	end = b + size - 10;
 2223|    102|	while (b < end && (b = memchr(b, 0xE8, end - b)) != NULL) {
  ------------------
  |  Branch (2223:9): [True: 102, False: 0]
  |  Branch (2223:20): [True: 97, False: 5]
  ------------------
 2224|     97|		size_t i = b - (unsigned char *)p;
 2225|     97|		int32_t cp, displacement, value;
 2226|       |
 2227|     97|		cp = (int32_t)(offset + (uint32_t)i);
 2228|     97|		value = archive_le32dec(&b[1]);
 2229|     97|		if (value >= -cp && value < (int32_t)ds->translation_size) {
  ------------------
  |  Branch (2229:7): [True: 49, False: 48]
  |  Branch (2229:23): [True: 48, False: 1]
  ------------------
 2230|     48|			if (value >= 0)
  ------------------
  |  Branch (2230:8): [True: 25, False: 23]
  ------------------
 2231|     25|				displacement = value - cp;
 2232|     23|			else
 2233|     23|				displacement = value + ds->translation_size;
 2234|     48|			archive_le32enc(&b[1], (uint32_t)displacement);
 2235|     48|		}
 2236|     97|		b += 5;
 2237|     97|	}
 2238|      5|}
archive_read_support_format_cab.c:cab_read_data:
 1940|     88|{
 1941|     88|	struct cab *cab = (struct cab *)(a->format->data);
 1942|     88|	ssize_t bytes_avail;
 1943|       |
 1944|     88|	if (cab->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (1944:6): [True: 0, False: 88]
  ------------------
 1945|      0|		*buff = NULL;
 1946|      0|		*size = 0;
 1947|      0|		*offset = cab->entry_offset;
 1948|      0|		cab->end_of_entry = 1;
 1949|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1950|      0|	}
 1951|       |
 1952|     88|	*buff = cab_read_ahead_cfdata(a, &bytes_avail);
 1953|     88|	if (bytes_avail <= 0) {
  ------------------
  |  Branch (1953:6): [True: 51, False: 37]
  ------------------
 1954|     51|		*buff = NULL;
 1955|     51|		*size = 0;
 1956|     51|		*offset = 0;
 1957|     51|		if (bytes_avail == 0 &&
  ------------------
  |  Branch (1957:7): [True: 6, False: 45]
  ------------------
 1958|      6|		    cab->entry_cfdata->uncompressed_size == 0) {
  ------------------
  |  Branch (1958:7): [True: 6, False: 0]
  ------------------
 1959|       |			/* All of CFDATA in a folder has been handled. */
 1960|      6|			archive_set_error(&a->archive,
 1961|      6|			    ARCHIVE_ERRNO_FILE_FORMAT, "Invalid CFDATA");
  ------------------
  |  |  192|      6|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1962|      6|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1963|      6|		} else
 1964|     45|			return ((int)bytes_avail);
 1965|     51|	}
 1966|     37|	if (bytes_avail > cab->entry_bytes_remaining)
  ------------------
  |  Branch (1966:6): [True: 23, False: 14]
  ------------------
 1967|     23|		bytes_avail = (ssize_t)cab->entry_bytes_remaining;
 1968|       |
 1969|     37|	*size = bytes_avail;
 1970|     37|	*offset = cab->entry_offset;
 1971|     37|	cab->entry_offset += bytes_avail;
 1972|     37|	cab->entry_bytes_remaining -= bytes_avail;
 1973|     37|	if (cab->entry_bytes_remaining == 0)
  ------------------
  |  Branch (1973:6): [True: 23, False: 14]
  ------------------
 1974|     23|		cab->end_of_entry = 1;
 1975|     37|	cab->entry_unconsumed = bytes_avail;
 1976|     37|	if (cab->entry_cffolder->comptype == COMPTYPE_NONE) {
  ------------------
  |  |  215|     37|#define COMPTYPE_NONE		0x0000
  ------------------
  |  Branch (1976:6): [True: 3, False: 34]
  ------------------
 1977|       |		/* Don't consume more than current entry used. */
 1978|      3|		if (cab->entry_cfdata->unconsumed > cab->entry_unconsumed)
  ------------------
  |  Branch (1978:7): [True: 2, False: 1]
  ------------------
 1979|      2|			cab->entry_cfdata->unconsumed = cab->entry_unconsumed;
 1980|      3|	}
 1981|     37|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     37|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1982|     88|}
archive_read_support_format_cab.c:archive_read_format_cab_read_data_skip:
 1986|     35|{
 1987|     35|	struct cab *cab;
 1988|     35|	int64_t bytes_skipped;
 1989|     35|	int r;
 1990|       |
 1991|     35|	cab = (struct cab *)(a->format->data);
 1992|       |
 1993|     35|	if (cab->end_of_archive)
  ------------------
  |  Branch (1993:6): [True: 0, False: 35]
  ------------------
 1994|      0|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1995|       |
 1996|     35|	if (!cab->read_data_invoked) {
  ------------------
  |  Branch (1996:6): [True: 3, False: 32]
  ------------------
 1997|      3|		cab->bytes_skipped += cab->entry_bytes_remaining;
 1998|      3|		cab->entry_bytes_remaining = 0;
 1999|       |		/* This entry is finished and done. */
 2000|      3|		cab->end_of_entry_cleanup = cab->end_of_entry = 1;
 2001|      3|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2002|      3|	}
 2003|       |
 2004|     32|	if (cab->entry_unconsumed) {
  ------------------
  |  Branch (2004:6): [True: 0, False: 32]
  ------------------
 2005|       |		/* Consume as much as the compressor actually used. */
 2006|      0|		r = (int)cab_consume_cfdata(a, cab->entry_unconsumed);
 2007|      0|		cab->entry_unconsumed = 0;
 2008|      0|		if (r < 0)
  ------------------
  |  Branch (2008:7): [True: 0, False: 0]
  ------------------
 2009|      0|			return (r);
 2010|     32|	} else if (cab->entry_cfdata == NULL) {
  ------------------
  |  Branch (2010:13): [True: 0, False: 32]
  ------------------
 2011|      0|		r = cab_next_cfdata(a);
 2012|      0|		if (r < 0)
  ------------------
  |  Branch (2012:7): [True: 0, False: 0]
  ------------------
 2013|      0|			return (r);
 2014|      0|	}
 2015|       |
 2016|       |	/* if we've already read to end of data, we're done. */
 2017|     32|	if (cab->end_of_entry_cleanup)
  ------------------
  |  Branch (2017:6): [True: 23, False: 9]
  ------------------
 2018|     23|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     23|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2019|       |
 2020|       |	/*
 2021|       |	 * If the length is at the beginning, we can skip the
 2022|       |	 * compressed data much more quickly.
 2023|       |	 */
 2024|      9|	bytes_skipped = cab_consume_cfdata(a, cab->entry_bytes_remaining);
 2025|      9|	if (bytes_skipped < 0)
  ------------------
  |  Branch (2025:6): [True: 7, False: 2]
  ------------------
 2026|      7|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2027|       |
 2028|       |	/* If the compression type is none(uncompressed), we've already
 2029|       |	 * consumed data as much as the current entry size. */
 2030|      2|	if (cab->entry_cffolder->comptype == COMPTYPE_NONE &&
  ------------------
  |  |  215|      4|#define COMPTYPE_NONE		0x0000
  ------------------
  |  Branch (2030:6): [True: 0, False: 2]
  ------------------
 2031|      0|	    cab->entry_cfdata != NULL)
  ------------------
  |  Branch (2031:6): [True: 0, False: 0]
  ------------------
 2032|      0|		cab->entry_cfdata->unconsumed = 0;
 2033|       |
 2034|       |	/* This entry is finished and done. */
 2035|      2|	cab->end_of_entry_cleanup = cab->end_of_entry = 1;
 2036|      2|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2037|      9|}
archive_read_support_format_cab.c:archive_read_format_cab_cleanup:
 2041|  2.49k|{
 2042|  2.49k|	struct cab *cab = (struct cab *)(a->format->data);
 2043|  2.49k|	struct cfheader *hd = &cab->cfheader;
 2044|  2.49k|	int i;
 2045|       |
 2046|  2.49k|	if (hd->folder_array != NULL) {
  ------------------
  |  Branch (2046:6): [True: 72, False: 2.42k]
  ------------------
 2047|  5.34k|		for (i = 0; i < hd->folder_count; i++)
  ------------------
  |  Branch (2047:15): [True: 5.27k, False: 72]
  ------------------
 2048|  5.27k|			free(hd->folder_array[i].cfdata.memimage);
 2049|     72|		free(hd->folder_array);
 2050|     72|	}
 2051|  2.49k|	if (hd->file_array != NULL) {
  ------------------
  |  Branch (2051:6): [True: 70, False: 2.42k]
  ------------------
 2052|    160|		for (i = 0; i < cab->cfheader.file_count; i++)
  ------------------
  |  Branch (2052:15): [True: 90, False: 70]
  ------------------
 2053|     90|			archive_string_free(&(hd->file_array[i].pathname));
 2054|     70|		free(hd->file_array);
 2055|     70|	}
 2056|  2.49k|#ifdef HAVE_ZLIB_H
 2057|  2.49k|	if (cab->stream_valid)
  ------------------
  |  Branch (2057:6): [True: 18, False: 2.48k]
  ------------------
 2058|     18|		inflateEnd(&cab->stream);
 2059|  2.49k|#endif
 2060|  2.49k|	lzx_decode_free(&cab->xstrm);
 2061|  2.49k|	archive_wstring_free(&cab->ws);
 2062|  2.49k|	free(cab->uncompressed_buffer);
 2063|  2.49k|	free(cab);
 2064|  2.49k|	(a->format->data) = NULL;
 2065|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2066|  2.49k|}
archive_read_support_format_cab.c:lzx_decode_free:
 2196|  2.49k|{
 2197|       |
 2198|  2.49k|	if (strm->ds == NULL)
  ------------------
  |  Branch (2198:6): [True: 2.45k, False: 47]
  ------------------
 2199|  2.45k|		return;
 2200|     47|	free(strm->ds->w_buff);
 2201|     47|	free(strm->ds->pos_tbl);
 2202|     47|	lzx_huffman_free(&(strm->ds->at));
 2203|     47|	lzx_huffman_free(&(strm->ds->pt));
 2204|     47|	lzx_huffman_free(&(strm->ds->mt));
 2205|     47|	lzx_huffman_free(&(strm->ds->lt));
 2206|     47|	free(strm->ds);
 2207|       |	strm->ds = NULL;
 2208|     47|}
archive_read_support_format_cab.c:lzx_huffman_free:
 3168|    188|{
 3169|    188|	free(hf->bitlen);
 3170|    188|	free(hf->tbl);
 3171|    188|}

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

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;
  ------------------
  |  |  323|  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.45k|{
  506|  2.45k|	struct iso9660 *iso9660;
  507|  2.45k|	ssize_t bytes_read;
  508|  2.45k|	const unsigned char *p;
  509|  2.45k|	int seenTerminator;
  510|       |
  511|       |	/* If there's already a better bid than we can ever
  512|       |	   make, don't bother testing. */
  513|  2.45k|	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: 572]
  ------------------
  528|  1.18k|	    return (-1);
  529|       |
  530|       |	/* Skip the reserved area. */
  531|    572|	bytes_read -= RESERVED_AREA;
  ------------------
  |  |  523|    572|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|    572|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   81|    572|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
  532|    572|	p += RESERVED_AREA;
  ------------------
  |  |  523|    572|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|    572|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   81|    572|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
  533|       |
  534|       |	/* Check each volume descriptor. */
  535|    572|	seenTerminator = 0;
  536|    896|	for (; bytes_read > LOGICAL_BLOCK_SIZE;
  ------------------
  |  |   81|    896|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  |  Branch (536:9): [True: 896, False: 0]
  ------------------
  537|    896|	    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|    896|		if (p[0] >= 4 && p[0] <= 254)
  ------------------
  |  Branch (539:7): [True: 446, False: 450]
  |  Branch (539:20): [True: 235, False: 211]
  ------------------
  540|    235|			return (0);
  541|       |		/* Standard Identifier must be "CD001" */
  542|    661|		if (memcmp(p + 1, "CD001", 5) != 0)
  ------------------
  |  Branch (542:7): [True: 85, False: 576]
  ------------------
  543|     85|			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:
 3270|  1.31k|{
 3271|  1.31k|	return (p[0] == p[7]
  ------------------
  |  Branch (3271:10): [True: 1.31k, False: 8]
  ------------------
 3272|  1.31k|		&& p[1] == p[6]
  ------------------
  |  Branch (3272:6): [True: 1.30k, False: 6]
  ------------------
 3273|  1.30k|		&& p[2] == p[5]
  ------------------
  |  Branch (3273:6): [True: 1.29k, False: 6]
  ------------------
 3274|  1.29k|		&& p[3] == p[4]);
  ------------------
  |  Branch (3274:6): [True: 1.29k, False: 4]
  ------------------
 3275|  1.31k|}
archive_read_support_format_iso9660.c:isValid723Integer:
 3264|  1.12k|isValid723Integer(const unsigned char *p) {
 3265|  1.12k|	return (p[0] == p[3] && p[1] == p[2]);
  ------------------
  |  Branch (3265:10): [True: 1.12k, False: 4]
  |  Branch (3265:26): [True: 1.12k, False: 2]
  ------------------
 3266|  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);
  ------------------
  |  |  377|      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);
  ------------------
  |  |  377|      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) {
  ------------------
  |  |  377|     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))
  ------------------
  |  |  310|    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))
  ------------------
  |  |  311|    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))
  ------------------
  |  |  313|    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))
  ------------------
  |  |  312|    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 = archive_le32dec(isodirrec + DR_size_offset);
  ------------------
  |  |  201|    972|#define DR_size_offset 10
  ------------------
 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;
  ------------------
  |  |  311|    347|#define MTIME_IS_SET 2
  ------------------
              		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  312|    347|#define ATIME_IS_SET 4
  ------------------
              		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  313|    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 (archive_le16dec(isodirrec + DR_volume_sequence_number_offset) != 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:isodate7_valid:
 3279|  1.00k|{
 3280|  1.00k|	int year = v[0];
 3281|  1.00k|	int month = v[1];
 3282|  1.00k|	int day = v[2];
 3283|  1.00k|	int hour = v[3];
 3284|  1.00k|	int minute = v[4];
 3285|  1.00k|	int second = v[5];
 3286|  1.00k|	int gmt_off = (signed char)v[6];
 3287|       |
 3288|       |	/* ECMA-119 9.1.5 "If all seven values are zero, it shall mean
 3289|       |	 * that the date is unspecified" */
 3290|  1.00k|	if (year == 0
  ------------------
  |  Branch (3290:6): [True: 423, False: 583]
  ------------------
 3291|    423|	    && month == 0
  ------------------
  |  Branch (3291:9): [True: 381, False: 42]
  ------------------
 3292|    381|	    && day == 0
  ------------------
  |  Branch (3292:9): [True: 369, False: 12]
  ------------------
 3293|    369|	    && hour == 0
  ------------------
  |  Branch (3293:9): [True: 363, False: 6]
  ------------------
 3294|    363|	    && minute == 0
  ------------------
  |  Branch (3294:9): [True: 355, False: 8]
  ------------------
 3295|    355|	    && second == 0
  ------------------
  |  Branch (3295:9): [True: 338, False: 17]
  ------------------
 3296|    338|	    && gmt_off == 0)
  ------------------
  |  Branch (3296:9): [True: 283, False: 55]
  ------------------
 3297|    283|		return 0;
 3298|       |	/*
 3299|       |	 * Sanity-test each individual field
 3300|       |	 */
 3301|       |	/* Year can have any value */
 3302|       |	/* Month must be 1-12 */
 3303|    723|	if (month < 1 || month > 12)
  ------------------
  |  Branch (3303:6): [True: 103, False: 620]
  |  Branch (3303:19): [True: 82, False: 538]
  ------------------
 3304|    185|		return 0;
 3305|       |	/* Day must be 1-31 */
 3306|    538|	if (day < 1 || day > 31)
  ------------------
  |  Branch (3306:6): [True: 66, False: 472]
  |  Branch (3306:17): [True: 50, False: 422]
  ------------------
 3307|    116|		return 0;
 3308|       |	/* Hour must be 0-23 */
 3309|    422|	if (hour > 23)
  ------------------
  |  Branch (3309:6): [True: 22, False: 400]
  ------------------
 3310|     22|		return 0;
 3311|       |	/* Minute must be 0-59 */
 3312|    400|	if (minute > 59)
  ------------------
  |  Branch (3312:6): [True: 17, False: 383]
  ------------------
 3313|     17|		return 0;
 3314|       |	/* second must be 0-59 according to ECMA-119 9.1.5 */
 3315|       |	/* BUT: we should probably allow for the time being in UTC, which
 3316|       |	   allows up to 61 seconds in a minute in certain cases */
 3317|    383|	if (second > 61)
  ------------------
  |  Branch (3317:6): [True: 13, False: 370]
  ------------------
 3318|     13|		return 0;
 3319|       |	/* Offset from GMT must be -48 to +52 */
 3320|    370|	if (gmt_off < -48 || gmt_off > +52)
  ------------------
  |  Branch (3320:6): [True: 4, False: 366]
  |  Branch (3320:23): [True: 9, False: 357]
  ------------------
 3321|     13|		return 0;
 3322|       |
 3323|       |	/* All tests pass, this is OK */
 3324|    357|	return 1;
 3325|    370|}
archive_read_support_format_iso9660.c:isodate7:
 3329|    357|{
 3330|    357|	struct tm tm;
 3331|    357|	int offset;
 3332|    357|	time_t t;
 3333|       |
 3334|    357|	memset(&tm, 0, sizeof(tm));
 3335|    357|	tm.tm_year = v[0];
 3336|    357|	tm.tm_mon = v[1] - 1;
 3337|    357|	tm.tm_mday = v[2];
 3338|    357|	tm.tm_hour = v[3];
 3339|    357|	tm.tm_min = v[4];
 3340|    357|	tm.tm_sec = v[5];
 3341|       |	/* v[6] is the signed timezone offset, in 1/4-hour increments. */
 3342|    357|	offset = ((const signed char *)v)[6];
 3343|    357|	if (offset > -48 && offset < 52) {
  ------------------
  |  Branch (3343:6): [True: 353, False: 4]
  |  Branch (3343:22): [True: 348, False: 5]
  ------------------
 3344|    348|		tm.tm_hour -= offset / 4;
 3345|    348|		tm.tm_min -= (offset % 4) * 15;
 3346|    348|	}
 3347|    357|	t = time_from_tm(&tm);
 3348|    357|	if (t == (time_t)-1)
  ------------------
  |  Branch (3348:6): [True: 0, False: 357]
  ------------------
 3349|      0|		return ((time_t)0);
 3350|    357|	return (t);
 3351|    357|}
archive_read_support_format_iso9660.c:time_from_tm:
 3444|    364|{
 3445|       |#if HAVE__MKGMTIME
 3446|       |        return _mkgmtime(t);
 3447|       |#elif HAVE_TIMEGM
 3448|       |        /* Use platform timegm() if available. */
 3449|    364|        return (timegm(t));
 3450|       |#else
 3451|       |        /* Else use direct calculation using POSIX assumptions. */
 3452|       |        /* First, fix up tm_yday based on the year/month/day. */
 3453|       |        if (mktime(t) == (time_t)-1)
 3454|       |                return ((time_t)-1);
 3455|       |        /* Then we can compute timegm() from first principles. */
 3456|       |        return (t->tm_sec
 3457|       |            + t->tm_min * 60
 3458|       |            + t->tm_hour * 3600
 3459|       |            + t->tm_yday * 86400
 3460|       |            + (t->tm_year - 70) * 31536000
 3461|       |            + ((t->tm_year - 69) / 4) * 86400
 3462|       |            - ((t->tm_year - 1) / 100) * 86400
 3463|       |            + ((t->tm_year + 299) / 400) * 86400);
 3464|       |#endif
 3465|    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 = archive_le32dec(data);
 2259|      0|					file->rdev <<= 32;
 2260|      0|					file->rdev |=
 2261|      0|					    archive_le32dec(data + 8);
 2262|      0|					iso9660->seenRockridge = 1;
 2263|      0|				}
 2264|      2|			}
 2265|      3|			else if (p[1] == 'X') {
  ------------------
  |  Branch (2265:13): [True: 1, False: 2]
  ------------------
 2266|       |				/*
 2267|       |				 * PX extension comprises:
 2268|       |				 *   8 bytes for mode,
 2269|       |				 *   8 bytes for nlinks,
 2270|       |				 *   8 bytes for uid,
 2271|       |				 *   8 bytes for gid,
 2272|       |				 *   8 bytes for inode.
 2273|       |				 */
 2274|      1|				if (version == 1) {
  ------------------
  |  Branch (2274:9): [True: 0, False: 1]
  ------------------
 2275|      0|					if (data_length >= 8)
  ------------------
  |  Branch (2275:10): [True: 0, False: 0]
  ------------------
 2276|      0|						file->mode = (__LA_MODE_T)
 2277|      0|						    archive_le32dec(data);
 2278|      0|					if (data_length >= 16)
  ------------------
  |  Branch (2278:10): [True: 0, False: 0]
  ------------------
 2279|      0|						file->nlinks =
 2280|      0|						    archive_le32dec(data + 8);
 2281|      0|					if (data_length >= 24)
  ------------------
  |  Branch (2281:10): [True: 0, False: 0]
  ------------------
 2282|      0|						file->uid =
 2283|      0|						    archive_le32dec(data + 16);
 2284|      0|					if (data_length >= 32)
  ------------------
  |  Branch (2284:10): [True: 0, False: 0]
  ------------------
 2285|      0|						file->gid =
 2286|      0|						    archive_le32dec(data + 24);
 2287|      0|					if (data_length >= 40)
  ------------------
  |  Branch (2287:10): [True: 0, False: 0]
  ------------------
 2288|      0|						file->number =
 2289|      0|						    archive_le32dec(data + 32);
 2290|      0|					iso9660->seenRockridge = 1;
 2291|      0|				}
 2292|      1|			}
 2293|      5|			break;
 2294|      4|		case 'R':
  ------------------
  |  Branch (2294:3): [True: 4, False: 116]
  ------------------
 2295|      4|			if (p[1] == 'E' && version == 1) {
  ------------------
  |  Branch (2295:8): [True: 1, False: 3]
  |  Branch (2295:23): [True: 1, False: 0]
  ------------------
 2296|      1|				file->re = 1;
 2297|      1|				iso9660->seenRockridge = 1;
 2298|      1|			}
 2299|      3|			else if (p[1] == 'R' && version == 1) {
  ------------------
  |  Branch (2299:13): [True: 0, False: 3]
  |  Branch (2299:28): [True: 0, False: 0]
  ------------------
 2300|       |				/*
 2301|       |				 * RR extension comprises:
 2302|       |				 *    one byte flag value
 2303|       |				 * This extension is obsolete,
 2304|       |				 * so contents are always ignored.
 2305|       |				 */
 2306|      0|			}
 2307|      4|			break;
 2308|     50|		case 'S':
  ------------------
  |  Branch (2308:3): [True: 50, False: 70]
  ------------------
 2309|     50|			if (p[1] == 'L') {
  ------------------
  |  Branch (2309:8): [True: 23, False: 27]
  ------------------
 2310|     23|				if (version == 1) {
  ------------------
  |  Branch (2310:9): [True: 22, False: 1]
  ------------------
 2311|     22|					parse_rockridge_SL1(file,
 2312|     22|					    data, data_length);
 2313|     22|					iso9660->seenRockridge = 1;
 2314|     22|				}
 2315|     23|			}
 2316|     27|			else if (p[1] == 'T'
  ------------------
  |  Branch (2316:13): [True: 2, False: 25]
  ------------------
 2317|      2|			    && data_length == 0 && version == 1) {
  ------------------
  |  Branch (2317:11): [True: 1, False: 1]
  |  Branch (2317:31): [True: 1, False: 0]
  ------------------
 2318|       |				/*
 2319|       |				 * ST extension marks end of this
 2320|       |				 * block of SUSP entries.
 2321|       |				 *
 2322|       |				 * It allows SUSP to coexist with
 2323|       |				 * non-SUSP uses of the System
 2324|       |				 * Use Area by placing non-SUSP data
 2325|       |				 * after SUSP data.
 2326|       |				 */
 2327|      1|				iso9660->seenSUSP = 0;
 2328|      1|				iso9660->seenRockridge = 0;
 2329|      1|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2330|      1|			}
 2331|     49|			break;
 2332|     51|		case 'T':
  ------------------
  |  Branch (2332:3): [True: 51, False: 69]
  ------------------
 2333|     51|			if (p[1] == 'F') {
  ------------------
  |  Branch (2333:8): [True: 50, False: 1]
  ------------------
 2334|     50|				if (version == 1) {
  ------------------
  |  Branch (2334:9): [True: 49, False: 1]
  ------------------
 2335|     49|					parse_rockridge_TF1(file,
 2336|     49|					    data, data_length);
 2337|     49|					iso9660->seenRockridge = 1;
 2338|     49|				}
 2339|     50|			}
 2340|     51|			break;
 2341|      2|		case 'Z':
  ------------------
  |  Branch (2341:3): [True: 2, False: 118]
  ------------------
 2342|      2|			if (p[1] == 'F') {
  ------------------
  |  Branch (2342:8): [True: 2, False: 0]
  ------------------
 2343|      2|				if (version == 1)
  ------------------
  |  Branch (2343:9): [True: 1, False: 1]
  ------------------
 2344|      1|					parse_rockridge_ZF1(file,
 2345|      1|					    data, data_length);
 2346|      2|			}
 2347|      2|			break;
 2348|      4|		default:
  ------------------
  |  Branch (2348:3): [True: 4, False: 116]
  ------------------
 2349|      4|			break;
 2350|    120|		}
 2351|       |
 2352|    119|		p += p[2];
 2353|    119|		entry_seen = 1;
 2354|    119|	}
 2355|       |
 2356|     86|	if (entry_seen)
  ------------------
  |  Branch (2356:6): [True: 85, False: 1]
  ------------------
 2357|     85|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     85|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2358|      1|	else {
 2359|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2360|      1|				  "Tried to parse Rockridge extensions, but none found");
 2361|      1|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      1|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2362|      1|	}
 2363|     86|}
archive_read_support_format_iso9660.c:parse_rockridge_SL1:
 2679|     22|{
 2680|     22|	const char *separator = "";
 2681|       |
 2682|     22|	if (!file->symlink_continues || file->symlink.length < 1)
  ------------------
  |  Branch (2682:6): [True: 22, False: 0]
  |  Branch (2682:34): [True: 0, False: 0]
  ------------------
 2683|     22|		archive_string_empty(&file->symlink);
  ------------------
  |  |  181|     22|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 2684|     22|	file->symlink_continues = 0;
 2685|       |
 2686|       |	/*
 2687|       |	 * Defined flag values:
 2688|       |	 *  0: This is the last SL record for this symbolic link
 2689|       |	 *  1: this symbolic link field continues in next SL entry
 2690|       |	 *  All other values are reserved.
 2691|       |	 */
 2692|     22|	if (data_length < 1)
  ------------------
  |  Branch (2692:6): [True: 1, False: 21]
  ------------------
 2693|      1|		return;
 2694|     21|	switch(*data) {
 2695|     18|	case 0:
  ------------------
  |  Branch (2695:2): [True: 18, False: 3]
  ------------------
 2696|     18|		break;
 2697|      2|	case 1:
  ------------------
  |  Branch (2697:2): [True: 2, False: 19]
  ------------------
 2698|      2|		file->symlink_continues = 1;
 2699|      2|		break;
 2700|      1|	default:
  ------------------
  |  Branch (2700:2): [True: 1, False: 20]
  ------------------
 2701|      1|		return;
 2702|     21|	}
 2703|     20|	++data;  /* Skip flag byte. */
 2704|     20|	--data_length;
 2705|       |
 2706|       |	/*
 2707|       |	 * SL extension body stores "components".
 2708|       |	 * Basically, this is a complicated way of storing
 2709|       |	 * a POSIX path.  It also interferes with using
 2710|       |	 * symlinks for storing non-path data. <sigh>
 2711|       |	 *
 2712|       |	 * Each component is 2 bytes (flag and length)
 2713|       |	 * possibly followed by name data.
 2714|       |	 */
 2715|    110|	while (data_length >= 2) {
  ------------------
  |  Branch (2715:9): [True: 97, False: 13]
  ------------------
 2716|     97|		unsigned char flag = *data++;
 2717|     97|		unsigned char nlen = *data++;
 2718|     97|		data_length -= 2;
 2719|       |
 2720|     97|		archive_strcat(&file->symlink, separator);
 2721|     97|		separator = "/";
 2722|       |
 2723|     97|		switch(flag) {
 2724|     38|		case 0: /* Usual case, this is text. */
  ------------------
  |  Branch (2724:3): [True: 38, False: 59]
  ------------------
 2725|     38|			if (data_length < nlen)
  ------------------
  |  Branch (2725:8): [True: 1, False: 37]
  ------------------
 2726|      1|				return;
 2727|     37|			archive_strncat(&file->symlink,
 2728|     37|			    (const char *)data, nlen);
 2729|     37|			break;
 2730|     24|		case 0x01: /* Text continues in next component. */
  ------------------
  |  Branch (2730:3): [True: 24, False: 73]
  ------------------
 2731|     24|			if (data_length < nlen)
  ------------------
  |  Branch (2731:8): [True: 2, False: 22]
  ------------------
 2732|      2|				return;
 2733|     22|			archive_strncat(&file->symlink,
 2734|     22|			    (const char *)data, nlen);
 2735|     22|			separator = "";
 2736|     22|			break;
 2737|     13|		case 0x02: /* Current dir. */
  ------------------
  |  Branch (2737:3): [True: 13, False: 84]
  ------------------
 2738|     13|			archive_strcat(&file->symlink, ".");
 2739|     13|			break;
 2740|      6|		case 0x04: /* Parent dir. */
  ------------------
  |  Branch (2740:3): [True: 6, False: 91]
  ------------------
 2741|      6|			archive_strcat(&file->symlink, "..");
 2742|      6|			break;
 2743|      1|		case 0x08: /* Root of filesystem. */
  ------------------
  |  Branch (2743:3): [True: 1, False: 96]
  ------------------
 2744|      1|			archive_strcat(&file->symlink, "/");
 2745|      1|			separator = "";
 2746|      1|			break;
 2747|      5|		case 0x10: /* Undefined (historically "volume root" */
  ------------------
  |  Branch (2747:3): [True: 5, False: 92]
  ------------------
 2748|      5|			archive_string_empty(&file->symlink);
  ------------------
  |  |  181|      5|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 2749|      5|			archive_strcat(&file->symlink, "ROOT");
 2750|      5|			break;
 2751|      6|		case 0x20: /* Undefined (historically "hostname") */
  ------------------
  |  Branch (2751:3): [True: 6, False: 91]
  ------------------
 2752|      6|			archive_strcat(&file->symlink, "hostname");
 2753|      6|			break;
 2754|      4|		default:
  ------------------
  |  Branch (2754:3): [True: 4, False: 93]
  ------------------
 2755|       |			/* TODO: issue a warning ? */
 2756|      4|			return;
 2757|     97|		}
 2758|     90|		data += nlen;
 2759|     90|		data_length -= nlen;
 2760|     90|	}
 2761|     20|}
archive_read_support_format_iso9660.c:parse_rockridge_TF1:
 2584|     49|{
 2585|     49|	char flag;
 2586|       |	/*
 2587|       |	 * TF extension comprises:
 2588|       |	 *   one byte flag
 2589|       |	 *   create time (optional)
 2590|       |	 *   modify time (optional)
 2591|       |	 *   access time (optional)
 2592|       |	 *   attribute time (optional)
 2593|       |	 *  Time format and presence of fields
 2594|       |	 *  is controlled by flag bits.
 2595|       |	 */
 2596|     49|	if (data_length < 1)
  ------------------
  |  Branch (2596:6): [True: 1, False: 48]
  ------------------
 2597|      1|		return;
 2598|     48|	flag = data[0];
 2599|     48|	++data;
 2600|     48|	--data_length;
 2601|     48|	if (flag & 0x80) {
  ------------------
  |  Branch (2601:6): [True: 31, False: 17]
  ------------------
 2602|       |		/* Use 17-byte time format. */
 2603|     31|		if ((flag & 1) && data_length >= 17) {
  ------------------
  |  Branch (2603:7): [True: 28, False: 3]
  |  Branch (2603:21): [True: 28, False: 0]
  ------------------
 2604|       |			/* Create time. */
 2605|     28|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2605:8): [True: 0, False: 28]
  ------------------
 2606|      0|				file->time_is_set |= BIRTHTIME_IS_SET;
  ------------------
  |  |  310|      0|#define BIRTHTIME_IS_SET 1
  ------------------
 2607|      0|				file->birthtime = isodate17(data);
 2608|      0|			}
 2609|     28|			data += 17;
 2610|     28|			data_length -= 17;
 2611|     28|		}
 2612|     31|		if ((flag & 2) && data_length >= 17) {
  ------------------
  |  Branch (2612:7): [True: 28, False: 3]
  |  Branch (2612:21): [True: 27, False: 1]
  ------------------
 2613|       |			/* Modify time. */
 2614|     27|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2614:8): [True: 1, False: 26]
  ------------------
 2615|      1|				file->time_is_set |= MTIME_IS_SET;
  ------------------
  |  |  311|      1|#define MTIME_IS_SET 2
  ------------------
 2616|      1|				file->mtime = isodate17(data);
 2617|      1|			}
 2618|     27|			data += 17;
 2619|     27|			data_length -= 17;
 2620|     27|		}
 2621|     31|		if ((flag & 4) && data_length >= 17) {
  ------------------
  |  Branch (2621:7): [True: 28, False: 3]
  |  Branch (2621:21): [True: 26, False: 2]
  ------------------
 2622|       |			/* Access time. */
 2623|     26|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2623:8): [True: 4, False: 22]
  ------------------
 2624|      4|				file->time_is_set |= ATIME_IS_SET;
  ------------------
  |  |  312|      4|#define ATIME_IS_SET 4
  ------------------
 2625|      4|				file->atime = isodate17(data);
 2626|      4|			}
 2627|     26|			data += 17;
 2628|     26|			data_length -= 17;
 2629|     26|		}
 2630|     31|		if ((flag & 8) && data_length >= 17) {
  ------------------
  |  Branch (2630:7): [True: 28, False: 3]
  |  Branch (2630:21): [True: 24, False: 4]
  ------------------
 2631|       |			/* Attribute change time. */
 2632|     24|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2632:8): [True: 2, False: 22]
  ------------------
 2633|      2|				file->time_is_set |= CTIME_IS_SET;
  ------------------
  |  |  313|      2|#define CTIME_IS_SET 8
  ------------------
 2634|      2|				file->ctime = isodate17(data);
 2635|      2|			}
 2636|     24|		}
 2637|     31|	} else {
 2638|       |		/* Use 7-byte time format. */
 2639|     17|		if ((flag & 1) && data_length >= 7) {
  ------------------
  |  Branch (2639:7): [True: 12, False: 5]
  |  Branch (2639:21): [True: 11, False: 1]
  ------------------
 2640|       |			/* Create time. */
 2641|     11|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2641:8): [True: 2, False: 9]
  ------------------
 2642|      2|				file->time_is_set |= BIRTHTIME_IS_SET;
  ------------------
  |  |  310|      2|#define BIRTHTIME_IS_SET 1
  ------------------
 2643|      2|				file->birthtime = isodate7(data);
 2644|      2|			}
 2645|     11|			data += 7;
 2646|     11|			data_length -= 7;
 2647|     11|		}
 2648|     17|		if ((flag & 2) && data_length >= 7) {
  ------------------
  |  Branch (2648:7): [True: 13, False: 4]
  |  Branch (2648:21): [True: 12, False: 1]
  ------------------
 2649|       |			/* Modify time. */
 2650|     12|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2650:8): [True: 4, False: 8]
  ------------------
 2651|      4|				file->time_is_set |= MTIME_IS_SET;
  ------------------
  |  |  311|      4|#define MTIME_IS_SET 2
  ------------------
 2652|      4|				file->mtime = isodate7(data);
 2653|      4|			}
 2654|     12|			data += 7;
 2655|     12|			data_length -= 7;
 2656|     12|		}
 2657|     17|		if ((flag & 4) && data_length >= 7) {
  ------------------
  |  Branch (2657:7): [True: 15, False: 2]
  |  Branch (2657:21): [True: 14, False: 1]
  ------------------
 2658|       |			/* Access time. */
 2659|     14|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2659:8): [True: 2, False: 12]
  ------------------
 2660|      2|				file->time_is_set |= ATIME_IS_SET;
  ------------------
  |  |  312|      2|#define ATIME_IS_SET 4
  ------------------
 2661|      2|				file->atime = isodate7(data);
 2662|      2|			}
 2663|     14|			data += 7;
 2664|     14|			data_length -= 7;
 2665|     14|		}
 2666|     17|		if ((flag & 8) && data_length >= 7) {
  ------------------
  |  Branch (2666:7): [True: 16, False: 1]
  |  Branch (2666:21): [True: 15, False: 1]
  ------------------
 2667|       |			/* Attribute change time. */
 2668|     15|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2668:8): [True: 2, False: 13]
  ------------------
 2669|      2|				file->time_is_set |= CTIME_IS_SET;
  ------------------
  |  |  313|      2|#define CTIME_IS_SET 8
  ------------------
 2670|      2|				file->ctime = isodate7(data);
 2671|      2|			}
 2672|     15|		}
 2673|     17|	}
 2674|     48|}
archive_read_support_format_iso9660.c:isodate17_valid:
 3355|    105|{
 3356|       |	/* First 16 bytes are all ASCII digits */
 3357|    935|	for (int i = 0; i < 16; i++) {
  ------------------
  |  Branch (3357:18): [True: 898, False: 37]
  ------------------
 3358|    898|		if (v[i] < '0' || v[i] > '9')
  ------------------
  |  Branch (3358:7): [True: 22, False: 876]
  |  Branch (3358:21): [True: 46, False: 830]
  ------------------
 3359|     68|			return 0;
 3360|    898|	}
 3361|       |
 3362|     37|	int year = (v[0] - '0') * 1000 + (v[1] - '0') * 100
 3363|     37|		+ (v[2] - '0') * 10 + (v[3] - '0');
 3364|     37|	int month = (v[4] - '0') * 10 + (v[5] - '0');
 3365|     37|	int day = (v[6] - '0') * 10 + (v[7] - '0');
 3366|     37|	int hour = (v[8] - '0') * 10 + (v[9] - '0');
 3367|     37|	int minute = (v[10] - '0') * 10 + (v[11] - '0');
 3368|     37|	int second = (v[12] - '0') * 10 + (v[13] - '0');
 3369|     37|	int hundredths = (v[14] - '0') * 10 + (v[15] - '0');
 3370|     37|	int gmt_off = (signed char)v[16];
 3371|       |
 3372|     37|	if (year == 0 && month == 0 && day == 0
  ------------------
  |  Branch (3372:6): [True: 10, False: 27]
  |  Branch (3372:19): [True: 8, False: 2]
  |  Branch (3372:33): [True: 8, False: 0]
  ------------------
 3373|      8|	    && hour == 0 && minute == 0 && second == 0
  ------------------
  |  Branch (3373:9): [True: 8, False: 0]
  |  Branch (3373:22): [True: 6, False: 2]
  |  Branch (3373:37): [True: 5, False: 1]
  ------------------
 3374|      5|	    && hundredths == 0 && gmt_off == 0)
  ------------------
  |  Branch (3374:9): [True: 4, False: 1]
  |  Branch (3374:28): [True: 1, False: 3]
  ------------------
 3375|      1|		return 0;
 3376|       |	/*
 3377|       |	 * Sanity-test each individual field
 3378|       |	 */
 3379|       |
 3380|       |	/* Year must be 1900-2300 */
 3381|       |	/* (Not specified in ECMA-119, but these seem
 3382|       |	   like reasonable limits. */
 3383|     36|	if (year < 1900 || year > 2300)
  ------------------
  |  Branch (3383:6): [True: 9, False: 27]
  |  Branch (3383:21): [True: 11, False: 16]
  ------------------
 3384|     20|		return 0;
 3385|       |	/* Month must be 1-12 */
 3386|     16|	if (month < 1 || month > 12)
  ------------------
  |  Branch (3386:6): [True: 0, False: 16]
  |  Branch (3386:19): [True: 1, False: 15]
  ------------------
 3387|      1|		return 0;
 3388|       |	/* Day must be 1-31 */
 3389|     15|	if (day < 1 || day > 31)
  ------------------
  |  Branch (3389:6): [True: 1, False: 14]
  |  Branch (3389:17): [True: 1, False: 13]
  ------------------
 3390|      2|		return 0;
 3391|       |	/* Hour must be 0-23 */
 3392|     13|	if (hour > 23)
  ------------------
  |  Branch (3392:6): [True: 4, False: 9]
  ------------------
 3393|      4|		return 0;
 3394|       |	/* Minute must be 0-59 */
 3395|      9|	if (minute > 59)
  ------------------
  |  Branch (3395:6): [True: 0, False: 9]
  ------------------
 3396|      0|		return 0;
 3397|       |	/* second must be 0-59 according to ECMA-119 9.1.5 */
 3398|       |	/* BUT: we should probably allow for the time being in UTC, which
 3399|       |	   allows up to 61 seconds in a minute in certain cases */
 3400|      9|	if (second > 61)
  ------------------
  |  Branch (3400:6): [True: 1, False: 8]
  ------------------
 3401|      1|		return 0;
 3402|       |	/* Hundredths must be 0-99 */
 3403|      8|	if (hundredths > 99)
  ------------------
  |  Branch (3403:6): [True: 0, False: 8]
  ------------------
 3404|      0|		return 0;
 3405|       |	/* Offset from GMT must be -48 to +52 */
 3406|      8|	if (gmt_off < -48 || gmt_off > +52)
  ------------------
  |  Branch (3406:6): [True: 0, False: 8]
  |  Branch (3406:23): [True: 1, False: 7]
  ------------------
 3407|      1|		return 0;
 3408|       |
 3409|       |	/* All tests pass, this is OK */
 3410|      7|	return 1;
 3411|       |
 3412|      8|}
archive_read_support_format_iso9660.c:isodate17:
 3416|      7|{
 3417|      7|	struct tm tm;
 3418|      7|	int offset;
 3419|      7|	time_t t;
 3420|       |
 3421|      7|	memset(&tm, 0, sizeof(tm));
 3422|      7|	tm.tm_year = (v[0] - '0') * 1000 + (v[1] - '0') * 100
 3423|      7|	    + (v[2] - '0') * 10 + (v[3] - '0')
 3424|      7|	    - 1900;
 3425|      7|	tm.tm_mon = (v[4] - '0') * 10 + (v[5] - '0') - 1;
 3426|      7|	tm.tm_mday = (v[6] - '0') * 10 + (v[7] - '0');
 3427|      7|	tm.tm_hour = (v[8] - '0') * 10 + (v[9] - '0');
 3428|      7|	tm.tm_min = (v[10] - '0') * 10 + (v[11] - '0');
 3429|      7|	tm.tm_sec = (v[12] - '0') * 10 + (v[13] - '0');
 3430|       |	/* v[16] is the signed timezone offset, in 1/4-hour increments. */
 3431|      7|	offset = ((const signed char *)v)[16];
 3432|      7|	if (offset > -48 && offset < 52) {
  ------------------
  |  Branch (3432:6): [True: 7, False: 0]
  |  Branch (3432:22): [True: 4, False: 3]
  ------------------
 3433|      4|		tm.tm_hour -= offset / 4;
 3434|      4|		tm.tm_min -= (offset % 4) * 15;
 3435|      4|	}
 3436|      7|	t = time_from_tm(&tm);
 3437|      7|	if (t == (time_t)-1)
  ------------------
  |  Branch (3437:6): [True: 0, False: 7]
  ------------------
 3438|      0|		return ((time_t)0);
 3439|      7|	return (t);
 3440|      7|}
archive_read_support_format_iso9660.c:parse_rockridge_ZF1:
 2766|      1|{
 2767|       |
 2768|      1|	if (data[0] == 0x70 && data[1] == 0x7a && data_length == 12) {
  ------------------
  |  Branch (2768:6): [True: 0, False: 1]
  |  Branch (2768:25): [True: 0, False: 0]
  |  Branch (2768:44): [True: 0, False: 0]
  ------------------
 2769|       |        /* paged zlib */
 2770|      0|        file->pz = 1;
 2771|      0|        file->pz_log2_bs = data[3];
 2772|      0|        if (file->pz_log2_bs < 15 || file->pz_log2_bs > 17) {
  ------------------
  |  Branch (2772:13): [True: 0, False: 0]
  |  Branch (2772:38): [True: 0, False: 0]
  ------------------
 2773|       |            /* TODO: Return an error here instead of silently
 2774|       |             * disabling zisofs. That requires propagating an
 2775|       |             * error return through parse_rockridge() and its
 2776|       |             * callers. */
 2777|      0|            file->pz = 0;
 2778|      0|            return;
 2779|      0|        }
 2780|      0|        file->pz_uncompressed_size = archive_le32dec(&data[4]);
 2781|      0|    }
 2782|      1|}
archive_read_support_format_iso9660.c:register_file:
 2786|    952|{
 2787|       |
 2788|    952|	file->use_next = iso9660->use_files;
 2789|    952|	iso9660->use_files = file;
 2790|    952|}
archive_read_support_format_iso9660.c:heap_add_entry:
 3145|    871|{
 3146|    871|	uint64_t file_key, parent_key;
 3147|    871|	int hole, parent;
 3148|       |
 3149|       |	/* Reserve 16 bits for possible key collisions (needed for linked items) */
 3150|       |	/* For ISO files with more than 65535 entries, reordering will still occur */
 3151|    871|	key <<= 16;
 3152|    871|	key += heap->used & 0xFFFF;
 3153|       |
 3154|       |	/* Expand our pending files list as necessary. */
 3155|    871|	if (heap->used >= heap->allocated) {
  ------------------
  |  Branch (3155:6): [True: 173, False: 698]
  ------------------
 3156|    173|		struct file_info **new_pending_files;
 3157|    173|		int new_size = heap->allocated * 2;
 3158|       |
 3159|    173|		if (heap->allocated < 1024)
  ------------------
  |  Branch (3159:7): [True: 173, False: 0]
  ------------------
 3160|    173|			new_size = 1024;
 3161|       |		/* Overflow might keep us from growing the list. */
 3162|    173|		if (new_size <= heap->allocated) {
  ------------------
  |  Branch (3162:7): [True: 0, False: 173]
  ------------------
 3163|      0|			archive_set_error(&a->archive,
 3164|      0|			    ENOMEM, "Out of memory");
 3165|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3166|      0|		}
 3167|    173|		new_pending_files = (struct file_info **)
 3168|    173|		    calloc(new_size, sizeof(new_pending_files[0]));
 3169|    173|		if (new_pending_files == NULL) {
  ------------------
  |  Branch (3169:7): [True: 0, False: 173]
  ------------------
 3170|      0|			archive_set_error(&a->archive,
 3171|      0|			    ENOMEM, "Out of memory");
 3172|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3173|      0|		}
 3174|    173|		if (heap->allocated)
  ------------------
  |  Branch (3174:7): [True: 0, False: 173]
  ------------------
 3175|      0|			memcpy(new_pending_files, heap->files,
 3176|      0|			    heap->allocated * sizeof(new_pending_files[0]));
 3177|    173|		free(heap->files);
 3178|    173|		heap->files = new_pending_files;
 3179|    173|		heap->allocated = new_size;
 3180|    173|	}
 3181|       |
 3182|    871|	file_key = file->key = key;
 3183|       |
 3184|       |	/*
 3185|       |	 * Start with hole at end, walk it up tree to find insertion point.
 3186|       |	 */
 3187|    871|	hole = heap->used++;
 3188|  1.26k|	while (hole > 0) {
  ------------------
  |  Branch (3188:9): [True: 914, False: 354]
  ------------------
 3189|    914|		parent = (hole - 1)/2;
 3190|    914|		parent_key = heap->files[parent]->key;
 3191|    914|		if (file_key >= parent_key) {
  ------------------
  |  Branch (3191:7): [True: 517, False: 397]
  ------------------
 3192|    517|			heap->files[hole] = file;
 3193|    517|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    517|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3194|    517|		}
 3195|       |		/* Move parent into hole <==> move hole up tree. */
 3196|    397|		heap->files[hole] = heap->files[parent];
 3197|    397|		hole = parent;
 3198|    397|	}
 3199|    354|	heap->files[0] = file;
 3200|       |
 3201|    354|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    354|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3202|    871|}
archive_read_support_format_iso9660.c:next_entry_seek:
 2819|    853|{
 2820|    853|	struct file_info *file;
 2821|    853|	int r;
 2822|       |
 2823|    853|	r = next_cache_entry(a, iso9660, pfile);
 2824|    853|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    853|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2824:6): [True: 214, False: 639]
  ------------------
 2825|    214|		return (r);
 2826|    639|	file = *pfile;
 2827|       |
 2828|       |	/* Don't waste time seeking for zero-length bodies. */
 2829|    639|	if (file->size == 0)
  ------------------
  |  Branch (2829:6): [True: 240, False: 399]
  ------------------
 2830|    240|		file->offset = iso9660->current_position;
 2831|       |
 2832|       |	/* flush any remaining bytes from the last round to ensure
 2833|       |	 * we're positioned */
 2834|    639|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (2834:6): [True: 0, False: 639]
  ------------------
 2835|      0|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 2836|      0|		iso9660->entry_bytes_unconsumed = 0;
 2837|      0|	}
 2838|       |
 2839|       |	/* Seek forward to the start of the entry. */
 2840|    639|	if (iso9660->current_position < file->offset) {
  ------------------
  |  Branch (2840:6): [True: 29, False: 610]
  ------------------
 2841|     29|		int64_t step;
 2842|       |
 2843|     29|		step = file->offset - iso9660->current_position;
 2844|     29|		step = __archive_read_consume(a, step);
 2845|     29|		if (step < 0)
  ------------------
  |  Branch (2845:7): [True: 17, False: 12]
  ------------------
 2846|     17|			return ((int)step);
 2847|     12|		iso9660->current_position = file->offset;
 2848|     12|	}
 2849|       |
 2850|       |	/* We found body of file; handle it now. */
 2851|    622|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    622|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2852|    639|}
archive_read_support_format_iso9660.c:next_cache_entry:
 2857|    853|{
 2858|    853|	struct file_info *file;
 2859|    853|	struct {
 2860|    853|		struct file_info	*first;
 2861|    853|		struct file_info	**last;
 2862|    853|	}	empty_files;
 2863|    853|	int64_t number;
 2864|    853|	int count;
 2865|       |
 2866|    853|	file = cache_get_entry(iso9660);
 2867|    853|	if (file != NULL) {
  ------------------
  |  Branch (2867:6): [True: 251, False: 602]
  ------------------
 2868|    251|		*pfile = file;
 2869|    251|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    251|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2870|    251|	}
 2871|       |
 2872|    602|	for (;;) {
 2873|    602|		struct file_info *re, *d;
 2874|       |
 2875|    602|		*pfile = file = next_entry(iso9660);
  ------------------
  |  |  454|    602|	heap_get_entry(&((iso9660)->pending_files))
  ------------------
 2876|    602|		if (file == NULL) {
  ------------------
  |  Branch (2876:7): [True: 125, False: 477]
  ------------------
 2877|       |			/*
 2878|       |			 * If directory entries all which are descendant of
 2879|       |			 * rr_moved are still remaining, expose their.
 2880|       |			 */
 2881|    125|			if (iso9660->re_files.first != NULL &&
  ------------------
  |  Branch (2881:8): [True: 0, False: 125]
  ------------------
 2882|      0|			    iso9660->rr_moved != NULL &&
  ------------------
  |  Branch (2882:8): [True: 0, False: 0]
  ------------------
 2883|      0|			    iso9660->rr_moved->rr_moved_has_re_only)
  ------------------
  |  Branch (2883:8): [True: 0, False: 0]
  ------------------
 2884|       |				/* Expose "rr_moved" entry. */
 2885|      0|				cache_add_entry(iso9660, iso9660->rr_moved);
 2886|    125|			while ((re = re_get_entry(iso9660)) != NULL) {
  ------------------
  |  Branch (2886:11): [True: 0, False: 125]
  ------------------
 2887|       |				/* Expose its descendant dirs. */
 2888|      0|				while ((d = rede_get_entry(re)) != NULL)
  ------------------
  |  Branch (2888:12): [True: 0, False: 0]
  ------------------
 2889|      0|					cache_add_entry(iso9660, d);
 2890|      0|			}
 2891|    125|			if (iso9660->cache_files.first != NULL)
  ------------------
  |  Branch (2891:8): [True: 0, False: 125]
  ------------------
 2892|      0|				return (next_cache_entry(a, iso9660, pfile));
 2893|    125|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|    125|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2894|    125|		}
 2895|       |
 2896|    477|		if (file->cl_offset) {
  ------------------
  |  Branch (2896:7): [True: 0, False: 477]
  ------------------
 2897|      0|			struct file_info *first_re = NULL;
 2898|      0|			int nexted_re = 0;
 2899|       |
 2900|       |			/*
 2901|       |			 * Find "RE" dir for the current file, which
 2902|       |			 * has "CL" flag.
 2903|       |			 */
 2904|      0|			while ((re = re_get_entry(iso9660))
  ------------------
  |  Branch (2904:11): [True: 0, False: 0]
  ------------------
 2905|      0|			    != first_re) {
 2906|      0|				if (first_re == NULL)
  ------------------
  |  Branch (2906:9): [True: 0, False: 0]
  ------------------
 2907|      0|					first_re = re;
 2908|      0|				if (re->offset == file->cl_offset) {
  ------------------
  |  Branch (2908:9): [True: 0, False: 0]
  ------------------
 2909|      0|					re->parent->subdirs--;
 2910|      0|					re->parent = file->parent;
 2911|      0|					re->re = 0;
 2912|      0|					if (re->parent->re_descendant) {
  ------------------
  |  Branch (2912:10): [True: 0, False: 0]
  ------------------
 2913|      0|						nexted_re = 1;
 2914|      0|						re->re_descendant = 1;
 2915|      0|						if (rede_add_entry(re) < 0)
  ------------------
  |  Branch (2915:11): [True: 0, False: 0]
  ------------------
 2916|      0|							goto fatal_rr;
 2917|       |						/* Move a list of descendants
 2918|       |						 * to a new ancestor. */
 2919|      0|						while ((d = rede_get_entry(
  ------------------
  |  Branch (2919:14): [True: 0, False: 0]
  ------------------
 2920|      0|						    re)) != NULL)
 2921|      0|							if (rede_add_entry(d)
  ------------------
  |  Branch (2921:12): [True: 0, False: 0]
  ------------------
 2922|      0|							    < 0)
 2923|      0|								goto fatal_rr;
 2924|      0|						break;
 2925|      0|					}
 2926|       |					/* Replace the current file
 2927|       |					 * with "RE" dir */
 2928|      0|					*pfile = file = re;
 2929|       |					/* Expose its descendant */
 2930|      0|					while ((d = rede_get_entry(
  ------------------
  |  Branch (2930:13): [True: 0, False: 0]
  ------------------
 2931|      0|					    file)) != NULL)
 2932|      0|						cache_add_entry(
 2933|      0|						    iso9660, d);
 2934|      0|					break;
 2935|      0|				} else
 2936|      0|					re_add_entry(iso9660, re);
 2937|      0|			}
 2938|      0|			if (nexted_re) {
  ------------------
  |  Branch (2938:8): [True: 0, False: 0]
  ------------------
 2939|       |				/*
 2940|       |				 * Do not expose this at this time
 2941|       |				 * because we have not gotten its full-path
 2942|       |				 * name yet.
 2943|       |				 */
 2944|      0|				continue;
 2945|      0|			}
 2946|    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 (2946:14): [True: 215, False: 262]
  ------------------
 2947|    215|			int r;
 2948|       |
 2949|       |			/* Read file entries in this dir. */
 2950|    215|			r = read_children(a, file);
 2951|    215|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    215|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2951:8): [True: 89, False: 126]
  ------------------
 2952|     89|				return (r);
 2953|       |
 2954|       |			/*
 2955|       |			 * Handle a special dir of Rockridge extensions,
 2956|       |			 * "rr_moved".
 2957|       |			 */
 2958|    126|			if (file->rr_moved) {
  ------------------
  |  Branch (2958:8): [True: 0, False: 126]
  ------------------
 2959|       |				/*
 2960|       |				 * If this has only the subdirectories which
 2961|       |				 * have "RE" flags, do not expose at this time.
 2962|       |				 */
 2963|      0|				if (file->rr_moved_has_re_only)
  ------------------
  |  Branch (2963:9): [True: 0, False: 0]
  ------------------
 2964|      0|					continue;
 2965|       |				/* Otherwise expose "rr_moved" entry. */
 2966|    126|			} else if (file->re) {
  ------------------
  |  Branch (2966:15): [True: 0, False: 126]
  ------------------
 2967|       |				/*
 2968|       |				 * Do not expose this at this time
 2969|       |				 * because we have not gotten its full-path
 2970|       |				 * name yet.
 2971|       |				 */
 2972|      0|				re_add_entry(iso9660, file);
 2973|      0|				continue;
 2974|    126|			} else if (file->re_descendant) {
  ------------------
  |  Branch (2974:15): [True: 0, False: 126]
  ------------------
 2975|       |				/*
 2976|       |				 * If the top level "RE" entry of this entry
 2977|       |				 * is not exposed, we, accordingly, should not
 2978|       |				 * expose this entry at this time because
 2979|       |				 * we cannot make its proper full-path name.
 2980|       |				 */
 2981|      0|				if (rede_add_entry(file) == 0)
  ------------------
  |  Branch (2981:9): [True: 0, False: 0]
  ------------------
 2982|      0|					continue;
 2983|       |				/* Otherwise we can expose this entry because
 2984|       |				 * it seems its top level "RE" has already been
 2985|       |				 * exposed. */
 2986|      0|			}
 2987|    126|		}
 2988|    388|		break;
 2989|    477|	}
 2990|       |
 2991|    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 (2991:6): [True: 126, False: 262]
  |  Branch (2991:44): [True: 33, False: 229]
  ------------------
 2992|    159|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    159|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2993|       |
 2994|    229|	count = 0;
 2995|    229|	number = file->number;
 2996|    229|	iso9660->cache_files.first = NULL;
 2997|    229|	iso9660->cache_files.last = &(iso9660->cache_files.first);
 2998|    229|	empty_files.first = NULL;
 2999|    229|	empty_files.last = &empty_files.first;
 3000|       |	/* Collect files which has the same file serial number.
 3001|       |	 * Peek pending_files so that file which number is different
 3002|       |	 * is not put back. */
 3003|    510|	while (iso9660->pending_files.used > 0 &&
  ------------------
  |  Branch (3003:9): [True: 385, False: 125]
  ------------------
 3004|    385|	    (iso9660->pending_files.files[0]->number == -1 ||
  ------------------
  |  Branch (3004:7): [True: 116, False: 269]
  ------------------
 3005|    281|	     iso9660->pending_files.files[0]->number == number)) {
  ------------------
  |  Branch (3005:7): [True: 165, False: 104]
  ------------------
 3006|    281|		if (file->number == -1) {
  ------------------
  |  Branch (3006:7): [True: 84, False: 197]
  ------------------
 3007|       |			/* This file has the same offset
 3008|       |			 * but it's wrong offset which empty files
 3009|       |			 * and symlink files have.
 3010|       |			 * NOTE: This wrong offset was recorded by
 3011|       |			 * old mkisofs utility. If ISO images is
 3012|       |			 * created by latest mkisofs, this does not
 3013|       |			 * happen.
 3014|       |			 */
 3015|     84|			file->next = NULL;
 3016|     84|			*empty_files.last = file;
 3017|     84|			empty_files.last = &(file->next);
 3018|    197|		} else {
 3019|    197|			count++;
 3020|    197|			cache_add_entry(iso9660, file);
 3021|    197|		}
 3022|    281|		file = next_entry(iso9660);
  ------------------
  |  |  454|    281|	heap_get_entry(&((iso9660)->pending_files))
  ------------------
 3023|    281|	}
 3024|       |
 3025|    229|	if (count == 0) {
  ------------------
  |  Branch (3025:6): [True: 132, False: 97]
  ------------------
 3026|    132|		*pfile = file;
 3027|    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 (3027:11): [True: 0, False: 132]
  ------------------
 3028|    132|	}
 3029|     97|	if (file->number == -1) {
  ------------------
  |  Branch (3029:6): [True: 32, False: 65]
  ------------------
 3030|     32|		file->next = NULL;
 3031|     32|		*empty_files.last = file;
 3032|     32|		empty_files.last = &(file->next);
 3033|     65|	} else {
 3034|     65|		count++;
 3035|     65|		cache_add_entry(iso9660, file);
 3036|     65|	}
 3037|       |
 3038|     97|	if (count > 1) {
  ------------------
  |  Branch (3038:6): [True: 75, False: 22]
  ------------------
 3039|       |		/* The count is the same as number of hardlink,
 3040|       |		 * so much so that each nlinks of files in cache_file
 3041|       |		 * is overwritten by value of the count.
 3042|       |		 */
 3043|     75|		for (file = iso9660->cache_files.first;
 3044|    315|		    file != NULL; file = file->next)
  ------------------
  |  Branch (3044:7): [True: 240, False: 75]
  ------------------
 3045|    240|			file->nlinks = count;
 3046|     75|	}
 3047|       |	/* If there are empty files, that files are added
 3048|       |	 * to the tail of the cache_files. */
 3049|     97|	if (empty_files.first != NULL) {
  ------------------
  |  Branch (3049:6): [True: 32, False: 65]
  ------------------
 3050|     32|		*iso9660->cache_files.last = empty_files.first;
 3051|     32|		iso9660->cache_files.last = empty_files.last;
 3052|     32|	}
 3053|     97|	*pfile = cache_get_entry(iso9660);
 3054|     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 (3054:10): [True: 0, False: 97]
  ------------------
 3055|       |
 3056|      0|fatal_rr:
 3057|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3058|      0|	    "Failed to connect 'CL' pointer to 'RE' rr_moved pointer of "
 3059|      0|	    "Rockridge extensions: current position = %jd, CL offset = %jd",
 3060|      0|	    (intmax_t)iso9660->current_position, (intmax_t)file->cl_offset);
 3061|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3062|    229|}
archive_read_support_format_iso9660.c:cache_get_entry:
 3130|    950|{
 3131|    950|	struct file_info *file;
 3132|       |
 3133|    950|	if ((file = iso9660->cache_files.first) != NULL) {
  ------------------
  |  Branch (3133:6): [True: 348, False: 602]
  ------------------
 3134|    348|		iso9660->cache_files.first = file->next;
 3135|    348|		if (iso9660->cache_files.first == NULL)
  ------------------
  |  Branch (3135:7): [True: 81, False: 267]
  ------------------
 3136|     81|			iso9660->cache_files.last =
 3137|     81|			    &(iso9660->cache_files.first);
 3138|    348|	}
 3139|    950|	return (file);
 3140|    950|}
archive_read_support_format_iso9660.c:heap_get_entry:
 3206|    883|{
 3207|    883|	uint64_t a_key, b_key, c_key;
 3208|    883|	int a, b, c;
 3209|    883|	struct file_info *r, *tmp;
 3210|       |
 3211|    883|	if (heap->used < 1)
  ------------------
  |  Branch (3211:6): [True: 125, False: 758]
  ------------------
 3212|    125|		return (NULL);
 3213|       |
 3214|       |	/*
 3215|       |	 * The first file in the list is the earliest; we'll return this.
 3216|       |	 */
 3217|    758|	r = heap->files[0];
 3218|       |
 3219|       |	/*
 3220|       |	 * Move the last item in the heap to the root of the tree
 3221|       |	 */
 3222|    758|	heap->files[0] = heap->files[--(heap->used)];
 3223|       |
 3224|       |	/*
 3225|       |	 * Rebalance the heap.
 3226|       |	 */
 3227|    758|	a = 0; /* Starting element and its heap key */
 3228|    758|	a_key = heap->files[a]->key;
 3229|  1.53k|	for (;;) {
 3230|  1.53k|		b = a + a + 1; /* First child */
 3231|  1.53k|		if (b >= heap->used)
  ------------------
  |  Branch (3231:7): [True: 648, False: 888]
  ------------------
 3232|    648|			return (r);
 3233|    888|		b_key = heap->files[b]->key;
 3234|    888|		c = b + 1; /* Use second child if it is smaller. */
 3235|    888|		if (c < heap->used) {
  ------------------
  |  Branch (3235:7): [True: 736, False: 152]
  ------------------
 3236|    736|			c_key = heap->files[c]->key;
 3237|    736|			if (c_key < b_key) {
  ------------------
  |  Branch (3237:8): [True: 297, False: 439]
  ------------------
 3238|    297|				b = c;
 3239|    297|				b_key = c_key;
 3240|    297|			}
 3241|    736|		}
 3242|    888|		if (a_key <= b_key)
  ------------------
  |  Branch (3242:7): [True: 110, False: 778]
  ------------------
 3243|    110|			return (r);
 3244|    778|		tmp = heap->files[a];
 3245|    778|		heap->files[a] = heap->files[b];
 3246|    778|		heap->files[b] = tmp;
 3247|    778|		a = b;
 3248|    778|	}
 3249|    758|}
archive_read_support_format_iso9660.c:cache_add_entry:
 3122|    262|{
 3123|       |	file->next = NULL;
 3124|    262|	*iso9660->cache_files.last = file;
 3125|    262|	iso9660->cache_files.last = &(file->next);
 3126|    262|}
archive_read_support_format_iso9660.c:re_get_entry:
 3074|    125|{
 3075|    125|	struct file_info *file;
 3076|       |
 3077|    125|	if ((file = iso9660->re_files.first) != NULL) {
  ------------------
  |  Branch (3077:6): [True: 0, False: 125]
  ------------------
 3078|      0|		iso9660->re_files.first = file->re_next;
 3079|      0|		if (iso9660->re_files.first == NULL)
  ------------------
  |  Branch (3079:7): [True: 0, False: 0]
  ------------------
 3080|      0|			iso9660->re_files.last =
 3081|      0|			    &(iso9660->re_files.first);
 3082|      0|	}
 3083|    125|	return (file);
 3084|    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:
 2482|    126|{
 2483|    126|	struct read_ce_queue *heap;
 2484|    126|	const unsigned char *b, *p, *end;
 2485|    126|	struct file_info *file;
 2486|    126|	size_t step;
 2487|    126|	uint64_t ce_start, ce_end;
 2488|    126|	int r;
 2489|       |
 2490|       |	/* Read data which RRIP "CE" extension points. */
 2491|    126|	heap = &(iso9660->read_ce_req);
 2492|    126|	step = iso9660->logical_block_size;
 2493|    126|	while (heap->cnt &&
  ------------------
  |  Branch (2493:9): [True: 0, False: 126]
  ------------------
 2494|      0|	    heap->reqs[0].offset == iso9660->current_position) {
  ------------------
  |  Branch (2494:6): [True: 0, False: 0]
  ------------------
 2495|      0|		b = __archive_read_ahead(a, step, NULL);
 2496|      0|		if (b == NULL) {
  ------------------
  |  Branch (2496:7): [True: 0, False: 0]
  ------------------
 2497|      0|			archive_set_error(&a->archive,
 2498|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2499|      0|			    "Failed to read full block when scanning "
 2500|      0|			    "ISO9660 directory list");
 2501|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2502|      0|		}
 2503|      0|		do {
 2504|      0|			file = heap->reqs[0].file;
 2505|      0|			if (file->ce_offset + file->ce_size > step) {
  ------------------
  |  Branch (2505:8): [True: 0, False: 0]
  ------------------
 2506|      0|				archive_set_error(&a->archive,
 2507|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2508|      0|				    "Malformed CE information");
 2509|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2510|      0|			}
 2511|      0|			ce_start = heap->reqs[0].offset + file->ce_offset;
 2512|      0|			ce_end = ce_start + file->ce_size;
 2513|      0|			if (ce_start < file->ce_processed_end) {
  ------------------
  |  Branch (2513:8): [True: 0, False: 0]
  ------------------
 2514|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2515|      0|				    "Invalid parameter in SUSP \"CE\" extension");
 2516|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2517|      0|			}
 2518|      0|			p = b + file->ce_offset;
 2519|      0|			end = p + file->ce_size;
 2520|      0|			file->ce_processed_end = ce_end;
 2521|      0|			next_CE(heap);
 2522|      0|			r = parse_rockridge(a, file, p, end);
 2523|      0|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2523:8): [True: 0, False: 0]
  ------------------
 2524|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2525|      0|		} while (heap->cnt &&
  ------------------
  |  Branch (2525:12): [True: 0, False: 0]
  ------------------
 2526|      0|		    heap->reqs[0].offset == iso9660->current_position);
  ------------------
  |  Branch (2526:7): [True: 0, False: 0]
  ------------------
 2527|       |		/* NOTE: Do not move this consume's code to front of
 2528|       |		 * do-while loop. Registration of nested CE extension
 2529|       |		 * might cause error because of current position. */
 2530|      0|		__archive_read_consume(a, step);
 2531|      0|		iso9660->current_position += step;
 2532|      0|	}
 2533|    126|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    126|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2534|    126|}
archive_read_support_format_iso9660.c:build_pathname_utf16be:
 3491|     12|{
 3492|     12|	if (file->parent != NULL && file->parent->utf16be_bytes > 0) {
  ------------------
  |  Branch (3492:6): [True: 6, False: 6]
  |  Branch (3492:30): [True: 0, False: 6]
  ------------------
 3493|      0|		if (build_pathname_utf16be(p, max, len, file->parent) != 0)
  ------------------
  |  Branch (3493:7): [True: 0, False: 0]
  ------------------
 3494|      0|			return (-1);
 3495|      0|		if (*len + 2 > max)
  ------------------
  |  Branch (3495:7): [True: 0, False: 0]
  ------------------
 3496|      0|			return (-1);/* Path is too long! */
 3497|      0|		p[*len] = 0;
 3498|      0|		p[*len + 1] = '/';
 3499|      0|		*len += 2;
 3500|      0|	}
 3501|     12|	if (file->utf16be_bytes == 0) {
  ------------------
  |  Branch (3501:6): [True: 7, False: 5]
  ------------------
 3502|      7|		if (*len + 2 > max)
  ------------------
  |  Branch (3502:7): [True: 0, False: 7]
  ------------------
 3503|      0|			return (-1);/* Path is too long! */
 3504|      7|		p[*len] = 0;
 3505|      7|		p[*len + 1] = '.';
 3506|      7|		*len += 2;
 3507|      7|	} else {
 3508|      5|		if (*len + file->utf16be_bytes > max)
  ------------------
  |  Branch (3508:7): [True: 0, False: 5]
  ------------------
 3509|      0|			return (-1);/* Path is too long! */
 3510|      5|		memcpy(p + *len, file->utf16be_name, file->utf16be_bytes);
 3511|      5|		*len += file->utf16be_bytes;
 3512|      5|	}
 3513|     12|	return (0);
 3514|     12|}
archive_read_support_format_iso9660.c:build_pathname:
 3469|    752|{
 3470|       |	// Plain ISO9660 only allows 8 dir levels; if we get
 3471|       |	// to 1000, then something is very, very wrong.
 3472|    752|	if (depth > 1000) {
  ------------------
  |  Branch (3472:6): [True: 0, False: 752]
  ------------------
 3473|      0|		return NULL;
 3474|      0|	}
 3475|    752|	if (file->parent != NULL && archive_strlen(&file->parent->name) > 0) {
  ------------------
  |  |  178|    571|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (3475:6): [True: 571, False: 181]
  |  Branch (3475:30): [True: 142, False: 429]
  ------------------
 3476|    142|		if (build_pathname(as, file->parent, depth + 1) == NULL) {
  ------------------
  |  Branch (3476:7): [True: 0, False: 142]
  ------------------
 3477|      0|			return NULL;
 3478|      0|		}
 3479|    142|		archive_strcat(as, "/");
 3480|    142|	}
 3481|    752|	if (archive_strlen(&file->name) == 0)
  ------------------
  |  |  178|    752|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (3481:6): [True: 70, False: 682]
  ------------------
 3482|     70|		archive_strcat(as, ".");
 3483|    682|	else
 3484|    682|		archive_string_concat(as, &file->name);
 3485|    752|	return (as->s);
 3486|    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:
 2794|  2.49k|{
 2795|  2.49k|	struct content *con, *connext;
 2796|  2.49k|	struct file_info *file;
 2797|       |
 2798|  2.49k|	file = iso9660->use_files;
 2799|  3.45k|	while (file != NULL) {
  ------------------
  |  Branch (2799:9): [True: 952, False: 2.49k]
  ------------------
 2800|    952|		struct file_info *next = file->use_next;
 2801|       |
 2802|    952|		archive_string_free(&file->name);
 2803|    952|		archive_string_free(&file->symlink);
 2804|    952|		free(file->utf16be_name);
 2805|    952|		con = file->contents.first;
 2806|  1.07k|		while (con != NULL) {
  ------------------
  |  Branch (2806:10): [True: 127, False: 952]
  ------------------
 2807|    127|			connext = con->next;
 2808|    127|			free(con);
 2809|    127|			con = connext;
 2810|    127|		}
 2811|    952|		free(file);
 2812|    952|		file = next;
 2813|    952|	}
 2814|  2.49k|}

archive_read_support_format_lha:
  257|  2.49k|{
  258|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  259|  2.49k|	struct lha *lha;
  260|  2.49k|	int r;
  261|       |
  262|  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]
  |  |  ------------------
  ------------------
  263|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_lha");
  264|       |
  265|  2.49k|	lha = calloc(1, sizeof(*lha));
  266|  2.49k|	if (lha == NULL) {
  ------------------
  |  Branch (266:6): [True: 0, False: 2.49k]
  ------------------
  267|      0|		archive_set_error(&a->archive, ENOMEM,
  268|      0|		    "Can't allocate lha data");
  269|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  270|      0|	}
  271|  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]
  |  |  ------------------
  ------------------
  272|       |
  273|  2.49k|	r = __archive_read_register_format(a,
  274|  2.49k|	    lha,
  275|  2.49k|	    "lha",
  276|  2.49k|	    archive_read_format_lha_bid,
  277|  2.49k|	    archive_read_format_lha_options,
  278|  2.49k|	    archive_read_format_lha_read_header,
  279|  2.49k|	    archive_read_format_lha_read_data,
  280|  2.49k|	    archive_read_format_lha_read_data_skip,
  281|  2.49k|	    NULL,
  282|  2.49k|	    archive_read_format_lha_cleanup,
  283|  2.49k|	    NULL,
  284|  2.49k|	    NULL);
  285|       |
  286|  2.49k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (286:6): [True: 0, False: 2.49k]
  ------------------
  287|      0|		free(lha);
  288|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  289|  2.49k|}
archive_read_support_format_lha.c:archive_read_format_lha_bid:
  346|  2.45k|{
  347|  2.45k|	const char *p;
  348|  2.45k|	const void *buff;
  349|  2.45k|	ssize_t bytes_avail, offset, window;
  350|  2.45k|	size_t next;
  351|       |
  352|       |	/* If there's already a better bid than we can ever
  353|       |	   make, don't bother testing. */
  354|  2.45k|	if (best_bid > 30)
  ------------------
  |  Branch (354:6): [True: 152, False: 2.30k]
  ------------------
  355|    152|		return (-1);
  356|       |
  357|  2.30k|	if ((p = __archive_read_ahead(a, H_SIZE, NULL)) == NULL)
  ------------------
  |  |  211|  2.30k|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (357:6): [True: 19, False: 2.28k]
  ------------------
  358|     19|		return (-1);
  359|       |
  360|  2.28k|	if (lha_check_header_format(p) == 0)
  ------------------
  |  Branch (360:6): [True: 19, False: 2.26k]
  ------------------
  361|     19|		return (30);
  362|       |
  363|  2.26k|	if (p[0] == 'M' && p[1] == 'Z') {
  ------------------
  |  Branch (363:6): [True: 137, False: 2.13k]
  |  Branch (363:21): [True: 109, False: 28]
  ------------------
  364|       |		/* PE file */
  365|    109|		offset = 0;
  366|    109|		window = 4096;
  367|    269|		while (offset < (1024 * 20)) {
  ------------------
  |  Branch (367:10): [True: 250, False: 19]
  ------------------
  368|    250|			buff = __archive_read_ahead(a, offset + window,
  369|    250|			    &bytes_avail);
  370|    250|			if (buff == NULL) {
  ------------------
  |  Branch (370:8): [True: 141, False: 109]
  ------------------
  371|       |				/* Remaining bytes are less than window. */
  372|    141|				window >>= 1;
  373|    141|				if (window < (H_SIZE + 3))
  ------------------
  |  |  211|    141|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (373:9): [True: 17, False: 124]
  ------------------
  374|     17|					return (0);
  375|    124|				continue;
  376|    141|			}
  377|    109|			p = (const char *)buff + offset;
  378|  1.77M|			while (p + H_SIZE < (const char *)buff + bytes_avail) {
  ------------------
  |  |  211|  1.77M|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (378:11): [True: 1.77M, False: 36]
  ------------------
  379|  1.77M|				if ((next = lha_check_header_format(p)) == 0)
  ------------------
  |  Branch (379:9): [True: 73, False: 1.77M]
  ------------------
  380|     73|					return (30);
  381|  1.77M|				p += next;
  382|  1.77M|			}
  383|     36|			offset = p - (const char *)buff;
  384|     36|		}
  385|    109|	}
  386|  2.17k|	return (0);
  387|  2.26k|}
archive_read_support_format_lha.c:lha_check_header_format:
  293|  1.78M|{
  294|  1.78M|	const unsigned char *p = h;
  295|  1.78M|	size_t next_skip_bytes;
  296|       |
  297|  1.78M|	switch (p[H_METHOD_OFFSET+3]) {
  ------------------
  |  |  208|  1.78M|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  298|       |	/*
  299|       |	 * "-lh0-" ... "-lh7-" "-lhd-"
  300|       |	 * "-lzs-" "-lz5-"
  301|       |	 */
  302|  7.09k|	case '0': case '1': case '2': case '3':
  ------------------
  |  Branch (302:2): [True: 3.89k, False: 1.78M]
  |  Branch (302:12): [True: 904, False: 1.78M]
  |  Branch (302:22): [True: 784, False: 1.78M]
  |  Branch (302:32): [True: 1.51k, False: 1.78M]
  ------------------
  303|  12.7k|	case '4': case '5': case '6': case '7':
  ------------------
  |  Branch (303:2): [True: 622, False: 1.78M]
  |  Branch (303:12): [True: 3.13k, False: 1.78M]
  |  Branch (303:22): [True: 1.02k, False: 1.78M]
  |  Branch (303:32): [True: 824, False: 1.78M]
  ------------------
  304|  13.2k|	case 'd':
  ------------------
  |  Branch (304:2): [True: 521, False: 1.78M]
  ------------------
  305|  13.7k|	case 's':
  ------------------
  |  Branch (305:2): [True: 538, False: 1.78M]
  ------------------
  306|  13.7k|		next_skip_bytes = 4;
  307|       |
  308|       |		/* b0 == 0 means the end of an LHa archive file.	*/
  309|  13.7k|		if (p[0] == 0)
  ------------------
  |  Branch (309:7): [True: 2.28k, False: 11.4k]
  ------------------
  310|  2.28k|			break;
  311|  11.4k|		if (p[H_METHOD_OFFSET] != '-' || p[H_METHOD_OFFSET+1] != 'l'
  ------------------
  |  |  208|  11.4k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
              		if (p[H_METHOD_OFFSET] != '-' || p[H_METHOD_OFFSET+1] != 'l'
  ------------------
  |  |  208|  3.13k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (311:7): [True: 8.33k, False: 3.13k]
  |  Branch (311:36): [True: 125, False: 3.01k]
  ------------------
  312|  3.01k|		    ||  p[H_METHOD_OFFSET+4] != '-')
  ------------------
  |  |  208|  3.01k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (312:11): [True: 0, False: 3.01k]
  ------------------
  313|  8.46k|			break;
  314|       |
  315|  3.01k|		if (p[H_METHOD_OFFSET+2] == 'h') {
  ------------------
  |  |  208|  3.01k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (315:7): [True: 3.01k, False: 0]
  ------------------
  316|       |			/* "-lh?-" */
  317|  3.01k|			if (p[H_METHOD_OFFSET+3] == 's')
  ------------------
  |  |  208|  3.01k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (317:8): [True: 0, False: 3.01k]
  ------------------
  318|      0|				break;
  319|  3.01k|			if (p[H_LEVEL_OFFSET] == 0)
  ------------------
  |  |  210|  3.01k|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  |  Branch (319:8): [True: 31, False: 2.98k]
  ------------------
  320|     31|				return (0);
  321|  2.98k|			if (p[H_LEVEL_OFFSET] <= 3 && p[H_ATTR_OFFSET] == 0x20)
  ------------------
  |  |  210|  2.98k|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
              			if (p[H_LEVEL_OFFSET] <= 3 && p[H_ATTR_OFFSET] == 0x20)
  ------------------
  |  |  209|  2.96k|#define H_ATTR_OFFSET	19	/* DOS attribute. */
  ------------------
  |  Branch (321:8): [True: 2.96k, False: 12]
  |  Branch (321:34): [True: 2.96k, False: 0]
  ------------------
  322|  2.96k|				return (0);
  323|  2.98k|		}
  324|     12|		if (p[H_METHOD_OFFSET+2] == 'z') {
  ------------------
  |  |  208|     12|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (324:7): [True: 0, False: 12]
  ------------------
  325|       |			/* LArc extensions: -lzs-,-lz4- and -lz5- */
  326|      0|			if (p[H_LEVEL_OFFSET] != 0)
  ------------------
  |  |  210|      0|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  |  Branch (326:8): [True: 0, False: 0]
  ------------------
  327|      0|				break;
  328|      0|			if (p[H_METHOD_OFFSET+3] == 's'
  ------------------
  |  |  208|      0|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (328:8): [True: 0, False: 0]
  ------------------
  329|      0|			    || p[H_METHOD_OFFSET+3] == '4'
  ------------------
  |  |  208|      0|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (329:11): [True: 0, False: 0]
  ------------------
  330|      0|			    || p[H_METHOD_OFFSET+3] == '5')
  ------------------
  |  |  208|      0|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (330:11): [True: 0, False: 0]
  ------------------
  331|      0|				return (0);
  332|      0|		}
  333|     12|		break;
  334|    404|	case 'h': next_skip_bytes = 1; break;
  ------------------
  |  Branch (334:2): [True: 404, False: 1.78M]
  ------------------
  335|    127|	case 'z': next_skip_bytes = 1; break;
  ------------------
  |  Branch (335:2): [True: 127, False: 1.78M]
  ------------------
  336|    486|	case 'l': next_skip_bytes = 2; break;
  ------------------
  |  Branch (336:2): [True: 486, False: 1.78M]
  ------------------
  337|    457|	case '-': next_skip_bytes = 3; break;
  ------------------
  |  Branch (337:2): [True: 457, False: 1.78M]
  ------------------
  338|  1.76M|	default : next_skip_bytes = 4; break;
  ------------------
  |  Branch (338:2): [True: 1.76M, False: 15.2k]
  ------------------
  339|  1.78M|	}
  340|       |
  341|  1.78M|	return (next_skip_bytes);
  342|  1.78M|}
archive_read_support_format_lha.c:archive_read_format_lha_read_header:
  474|  2.90k|{
  475|  2.90k|	struct archive_wstring linkname;
  476|  2.90k|	struct archive_wstring pathname;
  477|  2.90k|	struct lha *lha;
  478|  2.90k|	const unsigned char *p;
  479|  2.90k|	const char *signature;
  480|  2.90k|	int err;
  481|  2.90k|	struct archive_mstring conv_buffer;
  482|  2.90k|	const wchar_t *conv_buffer_p;
  483|       |
  484|  2.90k|	a->archive.archive_format = ARCHIVE_FORMAT_LHA;
  ------------------
  |  |  382|  2.90k|#define	ARCHIVE_FORMAT_LHA			0xB0000
  ------------------
  485|  2.90k|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (485:6): [True: 58, False: 2.84k]
  ------------------
  486|     58|		a->archive.archive_format_name = "lha";
  487|       |
  488|  2.90k|	lha = (struct lha *)(a->format->data);
  489|  2.90k|	lha->decompress_init = 0;
  490|  2.90k|	lha->end_of_entry = 0;
  491|  2.90k|	lha->end_of_entry_cleanup = 0;
  492|  2.90k|	lha->entry_unconsumed = 0;
  493|       |
  494|  2.90k|	if ((p = __archive_read_ahead(a, H_SIZE, NULL)) == NULL) {
  ------------------
  |  |  211|  2.90k|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (494:6): [True: 7, False: 2.89k]
  ------------------
  495|       |		/*
  496|       |		 * LHa archiver added 0 to the tail of its archive file as
  497|       |		 * the mark of the end of the archive.
  498|       |		 */
  499|      7|		signature = __archive_read_ahead(a, sizeof(signature[0]), NULL);
  500|      7|		if (signature == NULL || signature[0] == 0)
  ------------------
  |  Branch (500:7): [True: 0, False: 7]
  |  Branch (500:28): [True: 0, False: 7]
  ------------------
  501|      0|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  502|      7|		return (truncated_error(a));
  503|      7|	}
  504|       |
  505|  2.89k|	signature = (const char *)p;
  506|  2.89k|	if (lha->found_first_header == 0 &&
  ------------------
  |  Branch (506:6): [True: 58, False: 2.83k]
  ------------------
  507|     58|	    signature[0] == 'M' && signature[1] == 'Z') {
  ------------------
  |  Branch (507:6): [True: 39, False: 19]
  |  Branch (507:29): [True: 39, False: 0]
  ------------------
  508|       |                /* This is an executable?  Must be self-extracting... 	*/
  509|     39|		err = lha_skip_sfx(a);
  510|     39|		if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|     39|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (510:7): [True: 0, False: 39]
  ------------------
  511|      0|			return (err);
  512|       |
  513|     39|		if ((p = __archive_read_ahead(a, sizeof(*p), NULL)) == NULL)
  ------------------
  |  Branch (513:7): [True: 0, False: 39]
  ------------------
  514|      0|			return (truncated_error(a));
  515|     39|		signature = (const char *)p;
  516|     39|	}
  517|       |	/* signature[0] == 0 means the end of an LHa archive file. */
  518|  2.89k|	if (signature[0] == 0)
  ------------------
  |  Branch (518:6): [True: 17, False: 2.87k]
  ------------------
  519|     17|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|     17|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  520|       |
  521|       |	/*
  522|       |	 * Check the header format and method type.
  523|       |	 */
  524|  2.87k|	if (lha_check_header_format(p) != 0) {
  ------------------
  |  Branch (524:6): [True: 9, False: 2.86k]
  ------------------
  525|      9|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      9|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  526|      9|		    "Bad LHa file");
  527|      9|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      9|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  528|      9|	}
  529|       |
  530|       |	/* We've found the first header. */
  531|  2.86k|	lha->found_first_header = 1;
  532|       |	/* Set a default value and common data */
  533|  2.86k|	lha->header_size = 0;
  534|  2.86k|	lha->level = p[H_LEVEL_OFFSET];
  ------------------
  |  |  210|  2.86k|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  535|  2.86k|	lha->method[0] = p[H_METHOD_OFFSET+1];
  ------------------
  |  |  208|  2.86k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  536|  2.86k|	lha->method[1] = p[H_METHOD_OFFSET+2];
  ------------------
  |  |  208|  2.86k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  537|  2.86k|	lha->method[2] = p[H_METHOD_OFFSET+3];
  ------------------
  |  |  208|  2.86k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  538|  2.86k|	if (memcmp(lha->method, "lhd", 3) == 0)
  ------------------
  |  Branch (538:6): [True: 0, False: 2.86k]
  ------------------
  539|      0|		lha->directory = 1;
  540|  2.86k|	else
  541|  2.86k|		lha->directory = 0;
  542|  2.86k|	if (memcmp(lha->method, "lh0", 3) == 0 ||
  ------------------
  |  Branch (542:6): [True: 304, False: 2.56k]
  ------------------
  543|  2.56k|	    memcmp(lha->method, "lz4", 3) == 0)
  ------------------
  |  Branch (543:6): [True: 0, False: 2.56k]
  ------------------
  544|    304|		lha->entry_is_compressed = 0;
  545|  2.56k|	else
  546|  2.56k|		lha->entry_is_compressed = 1;
  547|       |
  548|  2.86k|	lha->compsize = 0;
  549|  2.86k|	lha->origsize = 0;
  550|  2.86k|	lha->setflag = 0;
  551|  2.86k|	lha->birthtime = 0;
  552|  2.86k|	lha->birthtime_tv_nsec = 0;
  553|  2.86k|	lha->mtime = 0;
  554|  2.86k|	lha->mtime_tv_nsec = 0;
  555|  2.86k|	lha->atime = 0;
  556|  2.86k|	lha->atime_tv_nsec = 0;
  557|  2.86k|	lha->mode = (lha->directory)? 0777 : 0666;
  ------------------
  |  Branch (557:14): [True: 0, False: 2.86k]
  ------------------
  558|  2.86k|	lha->uid = 0;
  559|  2.86k|	lha->gid = 0;
  560|  2.86k|	archive_string_empty(&lha->dirname);
  ------------------
  |  |  181|  2.86k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  561|  2.86k|	archive_string_empty(&lha->filename);
  ------------------
  |  |  181|  2.86k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  562|  2.86k|	lha->dos_attr = 0;
  563|  2.86k|	if (lha->opt_sconv != NULL) {
  ------------------
  |  Branch (563:6): [True: 0, False: 2.86k]
  ------------------
  564|      0|		lha->sconv_dir = lha->opt_sconv;
  565|      0|		lha->sconv_fname = lha->opt_sconv;
  566|  2.86k|	} else {
  567|  2.86k|		lha->sconv_dir = NULL;
  568|  2.86k|		lha->sconv_fname = NULL;
  569|  2.86k|	}
  570|       |
  571|  2.86k|	switch (p[H_LEVEL_OFFSET]) {
  ------------------
  |  |  210|  2.86k|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  572|      0|	case 0:
  ------------------
  |  Branch (572:2): [True: 0, False: 2.86k]
  ------------------
  573|      0|		err = lha_read_file_header_0(a, lha);
  574|      0|		break;
  575|      3|	case 1:
  ------------------
  |  Branch (575:2): [True: 3, False: 2.86k]
  ------------------
  576|      3|		err = lha_read_file_header_1(a, lha);
  577|      3|		break;
  578|  2.86k|	case 2:
  ------------------
  |  Branch (578:2): [True: 2.86k, False: 4]
  ------------------
  579|  2.86k|		err = lha_read_file_header_2(a, lha);
  580|  2.86k|		break;
  581|      1|	case 3:
  ------------------
  |  Branch (581:2): [True: 1, False: 2.86k]
  ------------------
  582|      1|		err = lha_read_file_header_3(a, lha);
  583|      1|		break;
  584|      0|	default:
  ------------------
  |  Branch (584:2): [True: 0, False: 2.86k]
  ------------------
  585|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  586|      0|		    "Unsupported LHa header level %d", p[H_LEVEL_OFFSET]);
  ------------------
  |  |  210|      0|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  587|      0|		err = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  588|      0|		break;
  589|  2.86k|	}
  590|  2.86k|	if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|  2.86k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (590:6): [True: 13, False: 2.85k]
  ------------------
  591|     13|		return (err);
  592|       |
  593|       |
  594|  2.85k|	if (!lha->directory && archive_strlen(&lha->filename) == 0)
  ------------------
  |  |  178|  2.85k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (594:6): [True: 2.85k, False: 0]
  |  Branch (594:25): [True: 0, False: 2.85k]
  ------------------
  595|       |		/* The filename has not been set */
  596|      0|		return (truncated_error(a));
  597|       |
  598|       |	/*
  599|       |	 * Make a pathname from a dirname and a filename, after converting to Unicode.
  600|       |	 * This is because codepages might differ between dirname and filename.
  601|       |	*/
  602|  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]
  |  |  ------------------
  ------------------
  603|  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]
  |  |  ------------------
  ------------------
  604|  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]
  |  |  ------------------
  ------------------
  605|  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]
  |  |  ------------------
  ------------------
  606|  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]
  |  |  ------------------
  ------------------
  607|  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]
  |  |  ------------------
  ------------------
  608|  2.85k|	if (0 != archive_mstring_copy_mbs_len_l(&conv_buffer, lha->dirname.s, lha->dirname.length, lha->sconv_dir)) {
  ------------------
  |  Branch (608:6): [True: 0, False: 2.85k]
  ------------------
  609|      0|		archive_set_error(&a->archive,
  610|      0|			ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  611|      0|			"Pathname cannot be converted "
  612|      0|			"from %s to Unicode",
  613|      0|			archive_string_conversion_charset_name(lha->sconv_dir));
  614|      0|		err = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  615|  2.85k|	} else if (0 != archive_mstring_get_wcs(&a->archive, &conv_buffer, &conv_buffer_p))
  ------------------
  |  Branch (615:13): [True: 0, False: 2.85k]
  ------------------
  616|      0|		err = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  617|  2.85k|	if (err == ARCHIVE_FATAL) {
  ------------------
  |  |  239|  2.85k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (617:6): [True: 0, False: 2.85k]
  ------------------
  618|      0|		archive_mstring_clean(&conv_buffer);
  619|      0|		archive_wstring_free(&pathname);
  620|      0|		archive_wstring_free(&linkname);
  621|      0|		return (err);
  622|      0|	}
  623|  2.85k|	archive_wstring_copy(&pathname, &conv_buffer.aes_wcs);
  ------------------
  |  |  135|  2.85k|	((dest)->length = 0, archive_wstring_concat((dest), (src)))
  ------------------
  624|       |
  625|  2.85k|	archive_string_empty(&conv_buffer.aes_mbs);
  ------------------
  |  |  181|  2.85k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  626|  2.85k|	archive_string_empty(&conv_buffer.aes_mbs_in_locale);
  ------------------
  |  |  181|  2.85k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  627|  2.85k|	archive_string_empty(&conv_buffer.aes_utf8);
  ------------------
  |  |  181|  2.85k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  628|  2.85k|	archive_wstring_empty(&conv_buffer.aes_wcs);
  ------------------
  |  |  182|  2.85k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
  629|  2.85k|	if (0 != archive_mstring_copy_mbs_len_l(&conv_buffer, lha->filename.s, lha->filename.length, lha->sconv_fname)) {
  ------------------
  |  Branch (629:6): [True: 0, False: 2.85k]
  ------------------
  630|      0|		archive_set_error(&a->archive,
  631|      0|			ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  632|      0|			"Pathname cannot be converted "
  633|      0|			"from %s to Unicode",
  634|      0|			archive_string_conversion_charset_name(lha->sconv_fname));
  635|      0|		err = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  636|      0|	}
  637|  2.85k|	else if (0 != archive_mstring_get_wcs(&a->archive, &conv_buffer, &conv_buffer_p))
  ------------------
  |  Branch (637:11): [True: 1, False: 2.85k]
  ------------------
  638|      1|		err = ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  639|  2.85k|	if (err == ARCHIVE_FATAL) {
  ------------------
  |  |  239|  2.85k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (639:6): [True: 1, False: 2.85k]
  ------------------
  640|      1|		archive_mstring_clean(&conv_buffer);
  641|      1|		archive_wstring_free(&pathname);
  642|      1|		archive_wstring_free(&linkname);
  643|      1|		return (err);
  644|      1|	}
  645|  2.85k|	archive_wstring_concat(&pathname, &conv_buffer.aes_wcs);
  646|  2.85k|	archive_mstring_clean(&conv_buffer);
  647|       |
  648|  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 (648:6): [True: 0, False: 2.85k]
  ------------------
  649|       |		/*
  650|       |	 	 * Extract the symlink-name if it's included in the pathname.
  651|       |	 	 */
  652|      0|		if (!lha_parse_linkname(&linkname, &pathname)) {
  ------------------
  |  Branch (652:7): [True: 0, False: 0]
  ------------------
  653|       |			/* We couldn't get the symlink-name. */
  654|      0|			archive_set_error(&a->archive,
  655|      0|		    	    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  656|      0|			    "Unknown symlink-name");
  657|      0|			archive_wstring_free(&pathname);
  658|      0|			archive_wstring_free(&linkname);
  659|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  660|      0|		}
  661|  2.85k|	} else {
  662|       |		/*
  663|       |		 * Make sure a file-type is set.
  664|       |		 * The mode has been overridden if it is in the extended data.
  665|       |		 */
  666|  2.85k|		lha->mode = (lha->mode & ~AE_IFMT) |
  ------------------
  |  |  215|  2.85k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  667|  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 (667:8): [True: 0, False: 2.85k]
  ------------------
  668|  2.85k|	}
  669|  2.85k|	if ((lha->setflag & UNIX_MODE_IS_SET) == 0 &&
  ------------------
  |  |  163|  2.85k|#define UNIX_MODE_IS_SET	4
  ------------------
  |  Branch (669:6): [True: 2.85k, False: 0]
  ------------------
  670|  2.85k|	    (lha->dos_attr & 1) != 0)
  ------------------
  |  Branch (670:6): [True: 5, False: 2.85k]
  ------------------
  671|      5|		lha->mode &= ~(0222);/* read only. */
  672|       |
  673|       |	/*
  674|       |	 * Set basic file parameters.
  675|       |	 */
  676|  2.85k|	archive_entry_copy_pathname_w(entry, pathname.s);
  677|  2.85k|	archive_wstring_free(&pathname);
  678|  2.85k|	if (archive_strlen(&linkname) > 0) {
  ------------------
  |  |  178|  2.85k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (678:6): [True: 0, False: 2.85k]
  ------------------
  679|      0|		archive_entry_copy_symlink_w(entry, linkname.s);
  680|      0|	} else
  681|  2.85k|		archive_entry_set_symlink(entry, NULL);
  682|  2.85k|	archive_wstring_free(&linkname);
  683|       |	/*
  684|       |	 * When a header level is 0, there is a possibility that
  685|       |	 * a pathname and a symlink has '\' character, a directory
  686|       |	 * separator in DOS/Windows. So we should convert it to '/'.
  687|       |	 */
  688|  2.85k|	if (lha->level == 0)
  ------------------
  |  Branch (688:6): [True: 0, False: 2.85k]
  ------------------
  689|      0|		lha_replace_path_separator(lha, entry);
  690|       |
  691|  2.85k|	archive_entry_set_mode(entry, lha->mode);
  692|  2.85k|	archive_entry_set_uid(entry, lha->uid);
  693|  2.85k|	archive_entry_set_gid(entry, lha->gid);
  694|  2.85k|	if (archive_strlen(&lha->uname) > 0)
  ------------------
  |  |  178|  2.85k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (694:6): [True: 18, False: 2.83k]
  ------------------
  695|     18|		archive_entry_set_uname(entry, lha->uname.s);
  696|  2.85k|	if (archive_strlen(&lha->gname) > 0)
  ------------------
  |  |  178|  2.85k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (696:6): [True: 318, False: 2.53k]
  ------------------
  697|    318|		archive_entry_set_gname(entry, lha->gname.s);
  698|  2.85k|	if (lha->setflag & BIRTHTIME_IS_SET) {
  ------------------
  |  |  161|  2.85k|#define BIRTHTIME_IS_SET	1
  ------------------
  |  Branch (698:6): [True: 0, False: 2.85k]
  ------------------
  699|      0|		archive_entry_set_birthtime(entry, lha->birthtime,
  700|      0|		    lha->birthtime_tv_nsec);
  701|      0|		archive_entry_set_ctime(entry, lha->birthtime,
  702|      0|		    lha->birthtime_tv_nsec);
  703|  2.85k|	} else {
  704|  2.85k|		archive_entry_unset_birthtime(entry);
  705|  2.85k|		archive_entry_unset_ctime(entry);
  706|  2.85k|	}
  707|  2.85k|	archive_entry_set_mtime(entry, lha->mtime, lha->mtime_tv_nsec);
  708|  2.85k|	if (lha->setflag & ATIME_IS_SET)
  ------------------
  |  |  162|  2.85k|#define ATIME_IS_SET		2
  ------------------
  |  Branch (708:6): [True: 0, False: 2.85k]
  ------------------
  709|      0|		archive_entry_set_atime(entry, lha->atime,
  710|      0|		    lha->atime_tv_nsec);
  711|  2.85k|	else
  712|  2.85k|		archive_entry_unset_atime(entry);
  713|  2.85k|	if (lha->directory || archive_entry_symlink(entry) != NULL)
  ------------------
  |  Branch (713:6): [True: 0, False: 2.85k]
  |  Branch (713:24): [True: 0, False: 2.85k]
  ------------------
  714|      0|		archive_entry_unset_size(entry);
  715|  2.85k|	else
  716|  2.85k|		archive_entry_set_size(entry, lha->origsize);
  717|       |
  718|       |	/*
  719|       |	 * Prepare variables used to read a file content.
  720|       |	 */
  721|  2.85k|	lha->entry_bytes_remaining = lha->compsize;
  722|  2.85k|	if (lha->entry_bytes_remaining < 0) {
  ------------------
  |  Branch (722:6): [True: 0, False: 2.85k]
  ------------------
  723|      0|		archive_set_error(&a->archive,
  724|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  725|      0|		    "Invalid LHa entry size");
  726|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  727|      0|	}
  728|  2.85k|	lha->entry_offset = 0;
  729|  2.85k|	lha->entry_crc_calculated = 0;
  730|       |
  731|       |	/*
  732|       |	 * This file does not have a content.
  733|       |	 */
  734|  2.85k|	if (lha->directory || lha->compsize == 0)
  ------------------
  |  Branch (734:6): [True: 0, False: 2.85k]
  |  Branch (734:24): [True: 0, False: 2.85k]
  ------------------
  735|      0|		lha->end_of_entry = 1;
  736|       |
  737|  2.85k|	snprintf(lha->format_name, sizeof(lha->format_name), "lha -%c%c%c-",
  738|  2.85k|	    lha->method[0], lha->method[1], lha->method[2]);
  739|  2.85k|	a->archive.archive_format_name = lha->format_name;
  740|       |
  741|  2.85k|	return (err);
  742|  2.85k|}
archive_read_support_format_lha.c:truncated_error:
  465|     13|{
  466|     13|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     13|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  467|     13|	    "Truncated LHa header");
  468|     13|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     13|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  469|     13|}
archive_read_support_format_lha.c:lha_skip_sfx:
  421|     39|{
  422|     39|	const void *h;
  423|     39|	const char *p, *q;
  424|     39|	size_t next, skip;
  425|     39|	ssize_t bytes, window;
  426|       |
  427|     39|	window = 4096;
  428|     42|	for (;;) {
  429|     42|		h = __archive_read_ahead(a, window, &bytes);
  430|     42|		if (h == NULL) {
  ------------------
  |  Branch (430:7): [True: 3, False: 39]
  ------------------
  431|       |			/* Remaining bytes are less than window. */
  432|      3|			window >>= 1;
  433|      3|			if (window < (H_SIZE + 3))
  ------------------
  |  |  211|      3|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (433:8): [True: 0, False: 3]
  ------------------
  434|      0|				goto fatal;
  435|      3|			continue;
  436|      3|		}
  437|     39|		if (bytes < H_SIZE)
  ------------------
  |  |  211|     39|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (437:7): [True: 0, False: 39]
  ------------------
  438|      0|			goto fatal;
  439|     39|		p = h;
  440|     39|		q = p + bytes;
  441|       |
  442|       |		/*
  443|       |		 * Scan ahead until we find something that looks
  444|       |		 * like the lha header.
  445|       |		 */
  446|  3.62k|		while (p + H_SIZE < q) {
  ------------------
  |  |  211|  3.62k|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (446:10): [True: 3.62k, False: 0]
  ------------------
  447|  3.62k|			if ((next = lha_check_header_format(p)) == 0) {
  ------------------
  |  Branch (447:8): [True: 39, False: 3.58k]
  ------------------
  448|     39|				skip = p - (const char *)h;
  449|     39|				__archive_read_consume(a, skip);
  450|     39|				return (ARCHIVE_OK);
  ------------------
  |  |  233|     39|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  451|     39|			}
  452|  3.58k|			p += next;
  453|  3.58k|		}
  454|      0|		skip = p - (const char *)h;
  455|      0|		__archive_read_consume(a, skip);
  456|      0|	}
  457|      0|fatal:
  458|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  459|      0|	    "Couldn't find out LHa header");
  460|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  461|     39|}
archive_read_support_format_lha.c:lha_calcsum:
 1722|      3|{
 1723|      3|	unsigned char const *p = (unsigned char const *)pp;
 1724|       |
 1725|      3|	p += offset;
 1726|    109|	for (;size > 0; --size)
  ------------------
  |  Branch (1726:8): [True: 106, False: 3]
  ------------------
 1727|    106|		sum += *p++;
 1728|      3|	return (sum);
 1729|      3|}
archive_read_support_format_lha.c:lha_read_file_header_1:
  900|      3|{
  901|      3|	const unsigned char *p;
  902|      3|	size_t extdsize;
  903|      3|	int i, err, err2;
  904|      3|	int namelen, padding;
  905|      3|	unsigned char headersum, sum_calculated;
  906|       |
  907|      3|	err = ARCHIVE_OK;
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  908|       |
  909|      3|	if ((p = __archive_read_ahead(a, H1_FIXED_SIZE, NULL)) == NULL)
  ------------------
  |  |  897|      3|#define H1_FIXED_SIZE		27
  ------------------
  |  Branch (909:6): [True: 0, False: 3]
  ------------------
  910|      0|		return (truncated_error(a));
  911|       |
  912|      3|	lha->header_size = p[H1_HEADER_SIZE_OFFSET] + 2;
  ------------------
  |  |  890|      3|#define H1_HEADER_SIZE_OFFSET	0
  ------------------
  913|      3|	headersum = p[H1_HEADER_SUM_OFFSET];
  ------------------
  |  |  891|      3|#define H1_HEADER_SUM_OFFSET	1
  ------------------
  914|       |	/* Note: An extended header size is included in a compsize. */
  915|      3|	lha->compsize = archive_le32dec(p + H1_COMP_SIZE_OFFSET);
  ------------------
  |  |  892|      3|#define H1_COMP_SIZE_OFFSET	7
  ------------------
  916|      3|	lha->origsize = archive_le32dec(p + H1_ORIG_SIZE_OFFSET);
  ------------------
  |  |  893|      3|#define H1_ORIG_SIZE_OFFSET	11
  ------------------
  917|      3|	lha->mtime = dos_to_unix(archive_le32dec(p + H1_DOS_TIME_OFFSET));
  ------------------
  |  |  894|      3|#define H1_DOS_TIME_OFFSET	15
  ------------------
  918|      3|	namelen = p[H1_NAME_LEN_OFFSET];
  ------------------
  |  |  895|      3|#define H1_NAME_LEN_OFFSET	21
  ------------------
  919|       |	/* Calculate a padding size. The result will be normally 0 only(?) */
  920|      3|	padding = ((int)lha->header_size) - H1_FIXED_SIZE - namelen;
  ------------------
  |  |  897|      3|#define H1_FIXED_SIZE		27
  ------------------
  921|       |
  922|      3|	if (namelen > 230 || padding < 0)
  ------------------
  |  Branch (922:6): [True: 0, False: 3]
  |  Branch (922:23): [True: 0, False: 3]
  ------------------
  923|      0|		goto invalid;
  924|       |
  925|      3|	if ((p = __archive_read_ahead(a, lha->header_size, NULL)) == NULL)
  ------------------
  |  Branch (925:6): [True: 0, False: 3]
  ------------------
  926|      0|		return (truncated_error(a));
  927|       |
  928|      3|	for (i = 0; i < namelen; i++) {
  ------------------
  |  Branch (928:14): [True: 0, False: 3]
  ------------------
  929|      0|		if (p[i + H1_FILE_NAME_OFFSET] == 0xff)
  ------------------
  |  |  896|      0|#define H1_FILE_NAME_OFFSET	22
  ------------------
  |  Branch (929:7): [True: 0, False: 0]
  ------------------
  930|      0|			goto invalid;/* Invalid filename. */
  931|      0|	}
  932|      3|	archive_strncpy(&lha->filename, p + H1_FILE_NAME_OFFSET, namelen);
  ------------------
  |  |  173|      3|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
  933|      3|	lha->crc = archive_le16dec(p + H1_FILE_NAME_OFFSET + namelen);
  ------------------
  |  |  896|      3|#define H1_FILE_NAME_OFFSET	22
  ------------------
  934|      3|	lha->setflag |= CRC_IS_SET;
  ------------------
  |  |  164|      3|#define CRC_IS_SET		8
  ------------------
  935|       |
  936|      3|	sum_calculated = lha_calcsum(0, p, 2, lha->header_size - 2);
  937|       |	/* Consume used bytes but not include `next header size' data
  938|       |	 * since it will be consumed in lha_read_file_extended_header(). */
  939|      3|	__archive_read_consume(a, lha->header_size - 2);
  940|       |
  941|       |	/* Read extended headers */
  942|      3|	err2 = lha_read_file_extended_header(a, lha, NULL, 2,
  943|      3|	    (uint64_t)(lha->compsize + 2), &extdsize);
  944|      3|	if (err2 < ARCHIVE_WARN)
  ------------------
  |  |  235|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (944:6): [True: 3, False: 0]
  ------------------
  945|      3|		return (err2);
  946|      0|	if (err2 < err)
  ------------------
  |  Branch (946:6): [True: 0, False: 0]
  ------------------
  947|      0|		err = err2;
  948|       |	/* Get a real compressed file size. */
  949|      0|	lha->compsize -= extdsize - 2;
  950|       |
  951|      0|	if (lha->compsize < 0)
  ------------------
  |  Branch (951:6): [True: 0, False: 0]
  ------------------
  952|      0|		goto invalid;	/* Invalid compressed file size */
  953|       |
  954|      0|	if (sum_calculated != headersum) {
  ------------------
  |  Branch (954:6): [True: 0, False: 0]
  ------------------
  955|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  956|      0|		    "LHa header sum error");
  957|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  958|      0|	}
  959|      0|	return (err);
  960|      0|invalid:
  961|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  962|      0|	    "Invalid LHa header");
  963|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  964|      0|}
archive_read_support_format_lha.c:lha_read_file_extended_header:
 1144|  2.86k|{
 1145|  2.86k|	const void *h;
 1146|  2.86k|	const unsigned char *extdheader;
 1147|  2.86k|	size_t	extdsize;
 1148|  2.86k|	size_t	datasize;
 1149|  2.86k|	unsigned int i;
 1150|  2.86k|	unsigned char extdtype;
 1151|       |
 1152|  2.86k|#define EXT_HEADER_CRC		0x00		/* Header CRC and information*/
 1153|  2.86k|#define EXT_FILENAME		0x01		/* Filename 		    */
 1154|  2.86k|#define EXT_DIRECTORY		0x02		/* Directory name	    */
 1155|  2.86k|#define EXT_DOS_ATTR		0x40		/* MS-DOS attribute	    */
 1156|  2.86k|#define EXT_TIMESTAMP		0x41		/* Windows time stamp	    */
 1157|  2.86k|#define EXT_FILESIZE		0x42		/* Large file size	    */
 1158|  2.86k|#define EXT_TIMEZONE		0x43		/* Time zone		    */
 1159|  2.86k|#define EXT_UTF16_FILENAME	0x44		/* UTF-16 filename 	    */
 1160|  2.86k|#define EXT_UTF16_DIRECTORY	0x45		/* UTF-16 directory name    */
 1161|  2.86k|#define EXT_CODEPAGE		0x46		/* Codepage		    */
 1162|  2.86k|#define EXT_UNIX_MODE		0x50		/* File permission	    */
 1163|  2.86k|#define EXT_UNIX_GID_UID	0x51		/* gid,uid		    */
 1164|  2.86k|#define EXT_UNIX_GNAME		0x52		/* Group name		    */
 1165|  2.86k|#define EXT_UNIX_UNAME		0x53		/* User name		    */
 1166|  2.86k|#define EXT_UNIX_MTIME		0x54		/* Modified time	    */
 1167|  2.86k|#define EXT_OS2_NEW_ATTR	0x7f		/* new attribute(OS/2 only) */
 1168|  2.86k|#define EXT_NEW_ATTR		0xff		/* new attribute	    */
 1169|       |
 1170|  2.86k|	*total_size = sizefield_length;
 1171|       |
 1172|  9.36k|	for (;;) {
 1173|       |		/* Read an extended header size. */
 1174|  9.36k|		if ((h =
  ------------------
  |  Branch (1174:7): [True: 1, False: 9.35k]
  ------------------
 1175|  9.36k|		    __archive_read_ahead(a, sizefield_length, NULL)) == NULL)
 1176|      1|			return (truncated_error(a));
 1177|       |		/* Check if the size is the zero indicates the end of the
 1178|       |		 * extended header. */
 1179|  9.35k|		if (sizefield_length == sizeof(uint16_t))
  ------------------
  |  Branch (1179:7): [True: 9.35k, False: 0]
  ------------------
 1180|  9.35k|			extdsize = archive_le16dec(h);
 1181|      0|		else
 1182|      0|			extdsize = archive_le32dec(h);
 1183|  9.35k|		if (extdsize == 0) {
  ------------------
  |  Branch (1183:7): [True: 2.85k, False: 6.50k]
  ------------------
 1184|       |			/* End of extended header */
 1185|  2.85k|			if (crc != NULL)
  ------------------
  |  Branch (1185:8): [True: 2.85k, False: 0]
  ------------------
 1186|  2.85k|				*crc = lha_crc16(*crc, h, sizefield_length);
 1187|  2.85k|			__archive_read_consume(a, sizefield_length);
 1188|  2.85k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.85k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1189|  2.85k|		}
 1190|       |
 1191|       |		/* Sanity check to the extended header size. */
 1192|  6.50k|		if (((uint64_t)*total_size + extdsize) > limitsize ||
  ------------------
  |  Branch (1192:7): [True: 5, False: 6.49k]
  ------------------
 1193|  6.49k|		    extdsize <= (size_t)sizefield_length)
  ------------------
  |  Branch (1193:7): [True: 0, False: 6.49k]
  ------------------
 1194|      5|			goto invalid;
 1195|       |
 1196|       |		/* Read the extended header. */
 1197|  6.49k|		if ((h = __archive_read_ahead(a, extdsize, NULL)) == NULL)
  ------------------
  |  Branch (1197:7): [True: 5, False: 6.49k]
  ------------------
 1198|      5|			return (truncated_error(a));
 1199|  6.49k|		*total_size += extdsize;
 1200|       |
 1201|  6.49k|		extdheader = (const unsigned char *)h;
 1202|       |		/* Get the extended header type. */
 1203|  6.49k|		extdtype = extdheader[sizefield_length];
 1204|       |		/* Calculate an extended data size. */
 1205|  6.49k|		datasize = extdsize - (1 + sizefield_length);
 1206|       |		/* Skip an extended header size field and type field. */
 1207|  6.49k|		extdheader += sizefield_length + 1;
 1208|       |
 1209|  6.49k|		if (crc != NULL && extdtype != EXT_HEADER_CRC)
  ------------------
  |  | 1152|  6.07k|#define EXT_HEADER_CRC		0x00		/* Header CRC and information*/
  ------------------
  |  Branch (1209:7): [True: 6.07k, False: 423]
  |  Branch (1209:22): [True: 3.51k, False: 2.55k]
  ------------------
 1210|  3.51k|			*crc = lha_crc16(*crc, h, extdsize);
 1211|  6.49k|		switch (extdtype) {
 1212|  2.55k|		case EXT_HEADER_CRC:
  ------------------
  |  | 1152|  2.55k|#define EXT_HEADER_CRC		0x00		/* Header CRC and information*/
  ------------------
  |  Branch (1212:3): [True: 2.55k, False: 3.93k]
  ------------------
 1213|       |			/* We only use a header CRC. Following data will not
 1214|       |			 * be used. */
 1215|  2.55k|			if (datasize >= 2) {
  ------------------
  |  Branch (1215:8): [True: 2.55k, False: 0]
  ------------------
 1216|  2.55k|				lha->header_crc = archive_le16dec(extdheader);
 1217|  2.55k|				if (crc != NULL) {
  ------------------
  |  Branch (1217:9): [True: 2.55k, False: 0]
  ------------------
 1218|  2.55k|					static const char zeros[2] = {0, 0};
 1219|  2.55k|					*crc = lha_crc16(*crc, h,
 1220|  2.55k|					    extdsize - datasize);
 1221|       |					/* CRC value itself as zero */
 1222|  2.55k|					*crc = lha_crc16(*crc, zeros, 2);
 1223|  2.55k|					*crc = lha_crc16(*crc,
 1224|  2.55k|					    extdheader+2, datasize - 2);
 1225|  2.55k|				}
 1226|  2.55k|			}
 1227|  2.55k|			break;
 1228|  2.85k|		case EXT_FILENAME:
  ------------------
  |  | 1153|  2.85k|#define EXT_FILENAME		0x01		/* Filename 		    */
  ------------------
  |  Branch (1228:3): [True: 2.85k, False: 3.63k]
  ------------------
 1229|  2.85k|			if (datasize == 0) {
  ------------------
  |  Branch (1229:8): [True: 0, False: 2.85k]
  ------------------
 1230|       |				/* maybe directory header */
 1231|      0|				archive_string_empty(&lha->filename);
  ------------------
  |  |  181|      0|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1232|      0|				break;
 1233|      0|			}
 1234|  2.85k|			if (extdheader[0] == '\0')
  ------------------
  |  Branch (1234:8): [True: 0, False: 2.85k]
  ------------------
 1235|      0|				goto invalid;
 1236|  2.85k|			archive_strncpy(&lha->filename,
  ------------------
  |  |  173|  2.85k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1237|  2.85k|			    (const char *)extdheader, datasize);
 1238|  2.85k|			break;
 1239|      0|		case EXT_UTF16_FILENAME:
  ------------------
  |  | 1159|      0|#define EXT_UTF16_FILENAME	0x44		/* UTF-16 filename 	    */
  ------------------
  |  Branch (1239:3): [True: 0, False: 6.49k]
  ------------------
 1240|      0|			if (datasize == 0) {
  ------------------
  |  Branch (1240:8): [True: 0, False: 0]
  ------------------
 1241|       |				/* maybe directory header */
 1242|      0|				archive_string_empty(&lha->filename);
  ------------------
  |  |  181|      0|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1243|      0|				break;
 1244|      0|			} else if (datasize & 1) {
  ------------------
  |  Branch (1244:15): [True: 0, False: 0]
  ------------------
 1245|       |				/* UTF-16 characters take always 2 or 4 bytes */
 1246|      0|				goto invalid;
 1247|      0|			}
 1248|      0|			if (extdheader[0] == '\0')
  ------------------
  |  Branch (1248:8): [True: 0, False: 0]
  ------------------
 1249|      0|				goto invalid;
 1250|      0|			archive_string_empty(&lha->filename);
  ------------------
  |  |  181|      0|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1251|      0|			archive_array_append(&lha->filename,
 1252|      0|				(const char *)extdheader, datasize);
 1253|       |			/* Setup a string conversion for a filename. */
 1254|      0|			lha->sconv_fname =
 1255|      0|			    archive_string_conversion_from_charset(&a->archive,
 1256|      0|			        "UTF-16LE", 1);
 1257|      0|			if (lha->sconv_fname == NULL)
  ------------------
  |  Branch (1257:8): [True: 0, False: 0]
  ------------------
 1258|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1259|      0|			break;
 1260|      1|		case EXT_DIRECTORY:
  ------------------
  |  | 1154|      1|#define EXT_DIRECTORY		0x02		/* Directory name	    */
  ------------------
  |  Branch (1260:3): [True: 1, False: 6.49k]
  ------------------
 1261|      1|			if (datasize == 0 || extdheader[0] == '\0')
  ------------------
  |  Branch (1261:8): [True: 0, False: 1]
  |  Branch (1261:25): [True: 0, False: 1]
  ------------------
 1262|       |				/* no directory name data. exit this case. */
 1263|      0|				goto invalid;
 1264|       |
 1265|      1|			archive_strncpy(&lha->dirname,
  ------------------
  |  |  173|      1|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1266|      1|		  	    (const char *)extdheader, datasize);
 1267|       |			/*
 1268|       |			 * Convert directory delimiter from 0xFF
 1269|       |			 * to '/' for local system.
 1270|       |	 		 */
 1271|      2|			for (i = 0; i < lha->dirname.length; i++) {
  ------------------
  |  Branch (1271:16): [True: 1, False: 1]
  ------------------
 1272|      1|				if ((unsigned char)lha->dirname.s[i] == 0xFF)
  ------------------
  |  Branch (1272:9): [True: 0, False: 1]
  ------------------
 1273|      0|					lha->dirname.s[i] = '/';
 1274|      1|			}
 1275|       |			/* Is last character directory separator? */
 1276|      1|			if (lha->dirname.s[lha->dirname.length-1] != '/')
  ------------------
  |  Branch (1276:8): [True: 1, False: 0]
  ------------------
 1277|       |				/* invalid directory data */
 1278|      1|				goto invalid;
 1279|      0|			break;
 1280|      0|		case EXT_UTF16_DIRECTORY:
  ------------------
  |  | 1160|      0|#define EXT_UTF16_DIRECTORY	0x45		/* UTF-16 directory name    */
  ------------------
  |  Branch (1280:3): [True: 0, False: 6.49k]
  ------------------
 1281|       |			/* UTF-16 characters take always 2 or 4 bytes */
 1282|      0|			if (datasize == 0 || (datasize & 1) ||
  ------------------
  |  Branch (1282:8): [True: 0, False: 0]
  |  Branch (1282:25): [True: 0, False: 0]
  ------------------
 1283|      0|			    extdheader[0] == '\0') {
  ------------------
  |  Branch (1283:8): [True: 0, False: 0]
  ------------------
 1284|       |				/* no directory name data. exit this case. */
 1285|      0|				goto invalid;
 1286|      0|			}
 1287|       |
 1288|      0|			archive_string_empty(&lha->dirname);
  ------------------
  |  |  181|      0|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1289|      0|			archive_array_append(&lha->dirname,
 1290|      0|				(const char *)extdheader, datasize);
 1291|      0|			lha->sconv_dir =
 1292|      0|			    archive_string_conversion_from_charset(&a->archive,
 1293|      0|			        "UTF-16LE", 1);
 1294|      0|			if (lha->sconv_dir == NULL)
  ------------------
  |  Branch (1294:8): [True: 0, False: 0]
  ------------------
 1295|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1296|      0|			else {
 1297|       |				/*
 1298|       |				 * Convert directory delimiter from 0xFFFF
 1299|       |				 * to '/' for local system.
 1300|       |				 */
 1301|      0|				uint16_t dirSep;
 1302|      0|				uint16_t d = 1;
 1303|      0|				if (archive_be16dec(&d) == 1)
  ------------------
  |  Branch (1303:9): [True: 0, False: 0]
  ------------------
 1304|      0|					dirSep = 0x2F00;
 1305|      0|				else
 1306|      0|					dirSep = 0x002F;
 1307|       |
 1308|       |				/* UTF-16LE character */
 1309|      0|				uint16_t *utf16name =
 1310|      0|				    (uint16_t *)lha->dirname.s;
 1311|      0|				for (i = 0; i < lha->dirname.length / 2; i++) {
  ------------------
  |  Branch (1311:17): [True: 0, False: 0]
  ------------------
 1312|      0|					if (utf16name[i] == 0xFFFF) {
  ------------------
  |  Branch (1312:10): [True: 0, False: 0]
  ------------------
 1313|      0|						utf16name[i] = dirSep;
 1314|      0|					}
 1315|      0|				}
 1316|       |				/* Is last character directory separator? */
 1317|      0|				if (utf16name[lha->dirname.length / 2 - 1] !=
  ------------------
  |  Branch (1317:9): [True: 0, False: 0]
  ------------------
 1318|      0|				    dirSep) {
 1319|       |					/* invalid directory data */
 1320|      0|					goto invalid;
 1321|      0|				}
 1322|      0|			}
 1323|      0|			break;
 1324|      5|		case EXT_DOS_ATTR:
  ------------------
  |  | 1155|      5|#define EXT_DOS_ATTR		0x40		/* MS-DOS attribute	    */
  ------------------
  |  Branch (1324:3): [True: 5, False: 6.48k]
  ------------------
 1325|      5|			if (datasize == 2)
  ------------------
  |  Branch (1325:8): [True: 5, False: 0]
  ------------------
 1326|      5|				lha->dos_attr = (unsigned char)
 1327|      5|				    (archive_le16dec(extdheader) & 0xff);
 1328|      5|			break;
 1329|      0|		case EXT_TIMESTAMP:
  ------------------
  |  | 1156|      0|#define EXT_TIMESTAMP		0x41		/* Windows time stamp	    */
  ------------------
  |  Branch (1329:3): [True: 0, False: 6.49k]
  ------------------
 1330|      0|			if (datasize == (sizeof(uint64_t) * 3)) {
  ------------------
  |  Branch (1330:8): [True: 0, False: 0]
  ------------------
 1331|      0|				ntfs_to_unix(archive_le64dec(extdheader),
 1332|      0|					&lha->birthtime,
 1333|      0|				    &lha->birthtime_tv_nsec);
 1334|      0|				extdheader += sizeof(uint64_t);
 1335|      0|				ntfs_to_unix(archive_le64dec(extdheader),
 1336|      0|					&lha->mtime,
 1337|      0|				    &lha->mtime_tv_nsec);
 1338|      0|				extdheader += sizeof(uint64_t);
 1339|      0|				ntfs_to_unix(archive_le64dec(extdheader),
 1340|      0|					&lha->atime,
 1341|      0|				    &lha->atime_tv_nsec);
 1342|      0|				lha->setflag |= BIRTHTIME_IS_SET |
  ------------------
  |  |  161|      0|#define BIRTHTIME_IS_SET	1
  ------------------
 1343|      0|				    ATIME_IS_SET;
  ------------------
  |  |  162|      0|#define ATIME_IS_SET		2
  ------------------
 1344|      0|			}
 1345|      0|			break;
 1346|      4|		case EXT_FILESIZE:
  ------------------
  |  | 1157|      4|#define EXT_FILESIZE		0x42		/* Large file size	    */
  ------------------
  |  Branch (1346:3): [True: 4, False: 6.48k]
  ------------------
 1347|      4|			if (datasize == sizeof(uint64_t) * 2) {
  ------------------
  |  Branch (1347:8): [True: 0, False: 4]
  ------------------
 1348|      0|				lha->compsize = archive_le64dec(extdheader);
 1349|      0|				extdheader += sizeof(uint64_t);
 1350|      0|				lha->origsize = archive_le64dec(extdheader);
 1351|      0|				if (lha->compsize < 0 || lha->origsize < 0)
  ------------------
  |  Branch (1351:9): [True: 0, False: 0]
  |  Branch (1351:30): [True: 0, False: 0]
  ------------------
 1352|      0|					goto invalid;
 1353|      0|			}
 1354|      4|			break;
 1355|      4|		case EXT_CODEPAGE:
  ------------------
  |  | 1161|      0|#define EXT_CODEPAGE		0x46		/* Codepage		    */
  ------------------
  |  Branch (1355:3): [True: 0, False: 6.49k]
  ------------------
 1356|       |			/* Get an archived filename charset from codepage.
 1357|       |			 * This overwrites the charset specified by
 1358|       |			 * hdrcharset option. */
 1359|      0|			if (datasize == sizeof(uint32_t)) {
  ------------------
  |  Branch (1359:8): [True: 0, False: 0]
  ------------------
 1360|      0|				struct archive_string cp;
 1361|      0|				const char *charset;
 1362|       |
 1363|      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]
  |  |  ------------------
  ------------------
 1364|      0|				switch (archive_le32dec(extdheader)) {
 1365|      0|				case 65001: /* UTF-8 */
  ------------------
  |  Branch (1365:5): [True: 0, False: 0]
  ------------------
 1366|      0|					charset = "UTF-8";
 1367|      0|					break;
 1368|      0|				default:
  ------------------
  |  Branch (1368:5): [True: 0, False: 0]
  ------------------
 1369|      0|					archive_string_sprintf(&cp, "CP%d",
 1370|      0|					    (int)archive_le32dec(extdheader));
 1371|      0|					charset = cp.s;
 1372|      0|					break;
 1373|      0|				}
 1374|      0|				lha->sconv_dir =
 1375|      0|				    archive_string_conversion_from_charset(
 1376|      0|					&(a->archive), charset, 1);
 1377|      0|				lha->sconv_fname =
 1378|      0|				    archive_string_conversion_from_charset(
 1379|      0|					&(a->archive), charset, 1);
 1380|      0|				archive_string_free(&cp);
 1381|      0|				if (lha->sconv_dir == NULL)
  ------------------
  |  Branch (1381:9): [True: 0, False: 0]
  ------------------
 1382|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1383|      0|				if (lha->sconv_fname == NULL)
  ------------------
  |  Branch (1383:9): [True: 0, False: 0]
  ------------------
 1384|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1385|      0|			}
 1386|      0|			break;
 1387|    175|		case EXT_UNIX_MODE:
  ------------------
  |  | 1162|    175|#define EXT_UNIX_MODE		0x50		/* File permission	    */
  ------------------
  |  Branch (1387:3): [True: 175, False: 6.31k]
  ------------------
 1388|    175|			if (datasize == sizeof(uint16_t)) {
  ------------------
  |  Branch (1388:8): [True: 0, False: 175]
  ------------------
 1389|      0|				lha->mode = archive_le16dec(extdheader);
 1390|      0|				lha->setflag |= UNIX_MODE_IS_SET;
  ------------------
  |  |  163|      0|#define UNIX_MODE_IS_SET	4
  ------------------
 1391|      0|			}
 1392|    175|			break;
 1393|    239|		case EXT_UNIX_GID_UID:
  ------------------
  |  | 1163|    239|#define EXT_UNIX_GID_UID	0x51		/* gid,uid		    */
  ------------------
  |  Branch (1393:3): [True: 239, False: 6.25k]
  ------------------
 1394|    239|			if (datasize == (sizeof(uint16_t) * 2)) {
  ------------------
  |  Branch (1394:8): [True: 239, False: 0]
  ------------------
 1395|    239|				lha->gid = archive_le16dec(extdheader);
 1396|    239|				lha->uid = archive_le16dec(extdheader+2);
 1397|    239|			}
 1398|    239|			break;
 1399|    179|		case EXT_UNIX_GNAME:
  ------------------
  |  | 1164|    179|#define EXT_UNIX_GNAME		0x52		/* Group name		    */
  ------------------
  |  Branch (1399:3): [True: 179, False: 6.31k]
  ------------------
 1400|    179|			if (datasize > 0)
  ------------------
  |  Branch (1400:8): [True: 179, False: 0]
  ------------------
 1401|    179|				archive_strncpy(&lha->gname,
  ------------------
  |  |  173|    179|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1402|    179|				    (const char *)extdheader, datasize);
 1403|    179|			break;
 1404|      1|		case EXT_UNIX_UNAME:
  ------------------
  |  | 1165|      1|#define EXT_UNIX_UNAME		0x53		/* User name		    */
  ------------------
  |  Branch (1404:3): [True: 1, False: 6.49k]
  ------------------
 1405|      1|			if (datasize > 0)
  ------------------
  |  Branch (1405:8): [True: 1, False: 0]
  ------------------
 1406|      1|				archive_strncpy(&lha->uname,
  ------------------
  |  |  173|      1|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1407|      1|				    (const char *)extdheader, datasize);
 1408|      1|			break;
 1409|      0|		case EXT_UNIX_MTIME:
  ------------------
  |  | 1166|      0|#define EXT_UNIX_MTIME		0x54		/* Modified time	    */
  ------------------
  |  Branch (1409:3): [True: 0, False: 6.49k]
  ------------------
 1410|      0|			if (datasize == sizeof(uint32_t))
  ------------------
  |  Branch (1410:8): [True: 0, False: 0]
  ------------------
 1411|      0|				lha->mtime = archive_le32dec(extdheader);
 1412|      0|			break;
 1413|      0|		case EXT_OS2_NEW_ATTR:
  ------------------
  |  | 1167|      0|#define EXT_OS2_NEW_ATTR	0x7f		/* new attribute(OS/2 only) */
  ------------------
  |  Branch (1413:3): [True: 0, False: 6.49k]
  ------------------
 1414|       |			/* This extended header is OS/2 depend. */
 1415|      0|			if (datasize == 16) {
  ------------------
  |  Branch (1415:8): [True: 0, False: 0]
  ------------------
 1416|      0|				lha->dos_attr = (unsigned char)
 1417|      0|				    (archive_le16dec(extdheader) & 0xff);
 1418|      0|				lha->mode = archive_le16dec(extdheader+2);
 1419|      0|				lha->gid = archive_le16dec(extdheader+4);
 1420|      0|				lha->uid = archive_le16dec(extdheader+6);
 1421|      0|				lha->birthtime = archive_le32dec(extdheader+8);
 1422|      0|				lha->atime = archive_le32dec(extdheader+12);
 1423|      0|				lha->setflag |= UNIX_MODE_IS_SET
  ------------------
  |  |  163|      0|#define UNIX_MODE_IS_SET	4
  ------------------
 1424|      0|				    | BIRTHTIME_IS_SET | ATIME_IS_SET;
  ------------------
  |  |  161|      0|#define BIRTHTIME_IS_SET	1
  ------------------
              				    | BIRTHTIME_IS_SET | ATIME_IS_SET;
  ------------------
  |  |  162|      0|#define ATIME_IS_SET		2
  ------------------
 1425|      0|			}
 1426|      0|			break;
 1427|      8|		case EXT_NEW_ATTR:
  ------------------
  |  | 1168|      8|#define EXT_NEW_ATTR		0xff		/* new attribute	    */
  ------------------
  |  Branch (1427:3): [True: 8, False: 6.48k]
  ------------------
 1428|      8|			if (datasize == 20) {
  ------------------
  |  Branch (1428:8): [True: 0, False: 8]
  ------------------
 1429|      0|				lha->mode = (mode_t)archive_le32dec(extdheader);
 1430|      0|				lha->gid = archive_le32dec(extdheader+4);
 1431|      0|				lha->uid = archive_le32dec(extdheader+8);
 1432|      0|				lha->birthtime = archive_le32dec(extdheader+12);
 1433|      0|				lha->atime = archive_le32dec(extdheader+16);
 1434|      0|				lha->setflag |= UNIX_MODE_IS_SET
  ------------------
  |  |  163|      0|#define UNIX_MODE_IS_SET	4
  ------------------
 1435|      0|				    | BIRTHTIME_IS_SET | ATIME_IS_SET;
  ------------------
  |  |  161|      0|#define BIRTHTIME_IS_SET	1
  ------------------
              				    | BIRTHTIME_IS_SET | ATIME_IS_SET;
  ------------------
  |  |  162|      0|#define ATIME_IS_SET		2
  ------------------
 1436|      0|			}
 1437|      8|			break;
 1438|      0|		case EXT_TIMEZONE:		/* Not supported */
  ------------------
  |  | 1158|      0|#define EXT_TIMEZONE		0x43		/* Time zone		    */
  ------------------
  |  Branch (1438:3): [True: 0, False: 6.49k]
  ------------------
 1439|      0|			break;
 1440|    467|		default:
  ------------------
  |  Branch (1440:3): [True: 467, False: 6.02k]
  ------------------
 1441|    467|			break;
 1442|  6.49k|		}
 1443|       |
 1444|  6.49k|		__archive_read_consume(a, extdsize);
 1445|  6.49k|	}
 1446|      6|invalid:
 1447|      6|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      6|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1448|      6|	    "Invalid extended LHa header");
 1449|      6|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1450|  2.86k|}
archive_read_support_format_lha.c:lha_crc16:
 1814|  26.8k|{
 1815|  26.8k|	const unsigned char *p = (const unsigned char *)pp;
 1816|  26.8k|	const uint16_t *buff;
 1817|  26.8k|	const union {
 1818|  26.8k|		uint32_t i;
 1819|  26.8k|		char c[4];
 1820|  26.8k|	} u = { 0x01020304 };
 1821|       |
 1822|  26.8k|	if (len == 0)
  ------------------
  |  Branch (1822:6): [True: 2.55k, False: 24.3k]
  ------------------
 1823|  2.55k|		return crc;
 1824|       |
 1825|       |	/* Process unaligned address. */
 1826|  24.3k|	if (((uintptr_t)p) & (uintptr_t)0x1) {
  ------------------
  |  Branch (1826:6): [True: 7.97k, False: 16.3k]
  ------------------
 1827|  7.97k|		crc = (crc >> 8) ^ crc16tbl[0][(crc ^ *p++) & 0xff];
 1828|  7.97k|		len--;
 1829|  7.97k|	}
 1830|  24.3k|	buff = (const uint16_t *)p;
 1831|       |	/*
 1832|       |	 * Modern C compiler such as GCC does not unroll automatically yet
 1833|       |	 * without unrolling pragma, and Clang is so. So we should
 1834|       |	 * unroll this loop for its performance.
 1835|       |	 */
 1836|   153M|	for (;len >= 8; len -= 8) {
  ------------------
  |  Branch (1836:8): [True: 153M, False: 24.3k]
  ------------------
 1837|       |		/* This if statement expects compiler optimization will
 1838|       |		 * remove the statement which will not be executed. */
 1839|   153M|#undef bswap16
 1840|       |#ifndef __has_builtin
 1841|       |#define __has_builtin(x) 0
 1842|       |#endif
 1843|       |#if defined(_MSC_VER) && _MSC_VER >= 1400  /* Visual Studio */
 1844|       |#  define bswap16(x) _byteswap_ushort(x)
 1845|       |#elif defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 8) || __GNUC__ > 4)
 1846|       |/* GCC 4.8 and later has __builtin_bswap16() */
 1847|       |#  define bswap16(x) __builtin_bswap16(x)
 1848|       |#elif defined(__clang__) && __has_builtin(__builtin_bswap16)
 1849|       |/* Newer clang versions have __builtin_bswap16() */
 1850|   153M|#  define bswap16(x) __builtin_bswap16(x)
 1851|       |#else
 1852|       |#  define bswap16(x) ((((x) >> 8) & 0xff) | ((x) << 8))
 1853|       |#endif
 1854|   153M|#define CRC16W	do { 	\
 1855|   153M|		if(u.c[0] == 1) { /* Big endian */		\
 1856|   153M|			crc ^= bswap16(*buff); buff++;		\
 1857|   153M|		} else						\
 1858|   153M|			crc ^= *buff++;				\
 1859|   153M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
 1860|   153M|} while (0)
 1861|   153M|		CRC16W;
  ------------------
  |  | 1854|   153M|#define CRC16W	do { 	\
  |  | 1855|   153M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1855:6): [True: 0, False: 153M]
  |  |  ------------------
  |  | 1856|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1850|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1857|      0|		} else						\
  |  | 1858|   153M|			crc ^= *buff++;				\
  |  | 1859|   153M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1860|   153M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1860:10): [Folded, False: 153M]
  |  |  ------------------
  ------------------
 1862|   153M|		CRC16W;
  ------------------
  |  | 1854|   153M|#define CRC16W	do { 	\
  |  | 1855|   153M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1855:6): [True: 0, False: 153M]
  |  |  ------------------
  |  | 1856|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1850|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1857|      0|		} else						\
  |  | 1858|   153M|			crc ^= *buff++;				\
  |  | 1859|   153M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1860|   153M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1860:10): [Folded, False: 153M]
  |  |  ------------------
  ------------------
 1863|   153M|		CRC16W;
  ------------------
  |  | 1854|   153M|#define CRC16W	do { 	\
  |  | 1855|   153M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1855:6): [True: 0, False: 153M]
  |  |  ------------------
  |  | 1856|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1850|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1857|      0|		} else						\
  |  | 1858|   153M|			crc ^= *buff++;				\
  |  | 1859|   153M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1860|   153M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1860:10): [Folded, False: 153M]
  |  |  ------------------
  ------------------
 1864|   153M|		CRC16W;
  ------------------
  |  | 1854|   153M|#define CRC16W	do { 	\
  |  | 1855|   153M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1855:6): [True: 0, False: 153M]
  |  |  ------------------
  |  | 1856|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1850|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1857|      0|		} else						\
  |  | 1858|   153M|			crc ^= *buff++;				\
  |  | 1859|   153M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1860|   153M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1860:10): [Folded, False: 153M]
  |  |  ------------------
  ------------------
 1865|   153M|#undef CRC16W
 1866|   153M|#undef bswap16
 1867|   153M|	}
 1868|       |
 1869|  24.3k|	p = (const unsigned char *)buff;
 1870|  69.9k|	for (;len; len--) {
  ------------------
  |  Branch (1870:8): [True: 45.5k, False: 24.3k]
  ------------------
 1871|  45.5k|		crc = (crc >> 8) ^ crc16tbl[0][(crc ^ *p++) & 0xff];
 1872|  45.5k|	}
 1873|  24.3k|	return crc;
 1874|  26.8k|}
archive_read_support_format_lha.c:lha_read_file_header_2:
  996|  2.86k|{
  997|  2.86k|	const unsigned char *p;
  998|  2.86k|	size_t extdsize;
  999|  2.86k|	int err, padding;
 1000|  2.86k|	uint16_t header_crc;
 1001|       |
 1002|  2.86k|	if ((p = __archive_read_ahead(a, H2_FIXED_SIZE, NULL)) == NULL)
  ------------------
  |  |  993|  2.86k|#define H2_FIXED_SIZE		24
  ------------------
  |  Branch (1002:6): [True: 0, False: 2.86k]
  ------------------
 1003|      0|		return (truncated_error(a));
 1004|       |
 1005|  2.86k|	lha->header_size =archive_le16dec(p + H2_HEADER_SIZE_OFFSET);
  ------------------
  |  |  988|  2.86k|#define H2_HEADER_SIZE_OFFSET	0
  ------------------
 1006|  2.86k|	lha->compsize = archive_le32dec(p + H2_COMP_SIZE_OFFSET);
  ------------------
  |  |  989|  2.86k|#define H2_COMP_SIZE_OFFSET	7
  ------------------
 1007|  2.86k|	lha->origsize = archive_le32dec(p + H2_ORIG_SIZE_OFFSET);
  ------------------
  |  |  990|  2.86k|#define H2_ORIG_SIZE_OFFSET	11
  ------------------
 1008|  2.86k|	lha->mtime = archive_le32dec(p + H2_TIME_OFFSET);
  ------------------
  |  |  991|  2.86k|#define H2_TIME_OFFSET		15
  ------------------
 1009|  2.86k|	lha->crc = archive_le16dec(p + H2_CRC_OFFSET);
  ------------------
  |  |  992|  2.86k|#define H2_CRC_OFFSET		21
  ------------------
 1010|  2.86k|	lha->setflag |= CRC_IS_SET;
  ------------------
  |  |  164|  2.86k|#define CRC_IS_SET		8
  ------------------
 1011|       |
 1012|  2.86k|	if (lha->header_size < H2_FIXED_SIZE) {
  ------------------
  |  |  993|  2.86k|#define H2_FIXED_SIZE		24
  ------------------
  |  Branch (1012:6): [True: 0, False: 2.86k]
  ------------------
 1013|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1014|      0|		    "Invalid LHa header size");
 1015|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1016|      0|	}
 1017|       |
 1018|  2.86k|	header_crc = lha_crc16(0, p, H2_FIXED_SIZE);
  ------------------
  |  |  993|  2.86k|#define H2_FIXED_SIZE		24
  ------------------
 1019|  2.86k|	__archive_read_consume(a, H2_FIXED_SIZE);
  ------------------
  |  |  993|  2.86k|#define H2_FIXED_SIZE		24
  ------------------
 1020|       |
 1021|       |	/* Read extended headers */
 1022|  2.86k|	err = lha_read_file_extended_header(a, lha, &header_crc, 2,
 1023|  2.86k|		  lha->header_size - H2_FIXED_SIZE, &extdsize);
  ------------------
  |  |  993|  2.86k|#define H2_FIXED_SIZE		24
  ------------------
 1024|  2.86k|	if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|  2.86k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1024:6): [True: 9, False: 2.85k]
  ------------------
 1025|      9|		return (err);
 1026|       |
 1027|       |	/* Calculate a padding size. The result will be normally 0 or 1. */
 1028|  2.85k|	padding = (int)lha->header_size - (int)(H2_FIXED_SIZE + extdsize);
  ------------------
  |  |  993|  2.85k|#define H2_FIXED_SIZE		24
  ------------------
 1029|  2.85k|	if (padding > 0) {
  ------------------
  |  Branch (1029:6): [True: 0, False: 2.85k]
  ------------------
 1030|      0|		if ((p = __archive_read_ahead(a, padding, NULL)) == NULL)
  ------------------
  |  Branch (1030:7): [True: 0, False: 0]
  ------------------
 1031|      0|			return (truncated_error(a));
 1032|      0|		header_crc = lha_crc16(header_crc, p, padding);
 1033|      0|		__archive_read_consume(a, padding);
 1034|      0|	}
 1035|       |
 1036|  2.85k|	if (header_crc != lha->header_crc) {
  ------------------
  |  Branch (1036:6): [True: 1.13k, False: 1.72k]
  ------------------
 1037|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 1038|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 1039|       |		    "LHa header CRC error");
 1040|       |		return (ARCHIVE_FATAL);
 1041|       |#endif
 1042|  1.13k|	}
 1043|  2.85k|	return (err);
 1044|  2.85k|}
archive_read_support_format_lha.c:lha_read_file_header_3:
 1077|      1|{
 1078|      1|	const unsigned char *p;
 1079|      1|	size_t extdsize;
 1080|      1|	int err;
 1081|      1|	uint16_t header_crc;
 1082|       |
 1083|      1|	if ((p = __archive_read_ahead(a, H3_FIXED_SIZE, NULL)) == NULL)
  ------------------
  |  | 1074|      1|#define H3_FIXED_SIZE		28
  ------------------
  |  Branch (1083:6): [True: 0, False: 1]
  ------------------
 1084|      0|		return (truncated_error(a));
 1085|       |
 1086|      1|	if (archive_le16dec(p + H3_FIELD_LEN_OFFSET) != 4)
  ------------------
  |  | 1068|      1|#define H3_FIELD_LEN_OFFSET	0
  ------------------
  |  Branch (1086:6): [True: 0, False: 1]
  ------------------
 1087|      0|		goto invalid;
 1088|      1|	lha->header_size = archive_le32dec(p + H3_HEADER_SIZE_OFFSET);
  ------------------
  |  | 1073|      1|#define H3_HEADER_SIZE_OFFSET	24
  ------------------
 1089|      1|	lha->compsize = archive_le32dec(p + H3_COMP_SIZE_OFFSET);
  ------------------
  |  | 1069|      1|#define H3_COMP_SIZE_OFFSET	7
  ------------------
 1090|      1|	lha->origsize = archive_le32dec(p + H3_ORIG_SIZE_OFFSET);
  ------------------
  |  | 1070|      1|#define H3_ORIG_SIZE_OFFSET	11
  ------------------
 1091|      1|	lha->mtime = archive_le32dec(p + H3_TIME_OFFSET);
  ------------------
  |  | 1071|      1|#define H3_TIME_OFFSET		15
  ------------------
 1092|      1|	lha->crc = archive_le16dec(p + H3_CRC_OFFSET);
  ------------------
  |  | 1072|      1|#define H3_CRC_OFFSET		21
  ------------------
 1093|      1|	lha->setflag |= CRC_IS_SET;
  ------------------
  |  |  164|      1|#define CRC_IS_SET		8
  ------------------
 1094|       |
 1095|      1|	if (lha->header_size < H3_FIXED_SIZE + 4)
  ------------------
  |  | 1074|      1|#define H3_FIXED_SIZE		28
  ------------------
  |  Branch (1095:6): [True: 0, False: 1]
  ------------------
 1096|      0|		goto invalid;
 1097|      1|	header_crc = lha_crc16(0, p, H3_FIXED_SIZE);
  ------------------
  |  | 1074|      1|#define H3_FIXED_SIZE		28
  ------------------
 1098|      1|	__archive_read_consume(a, H3_FIXED_SIZE);
  ------------------
  |  | 1074|      1|#define H3_FIXED_SIZE		28
  ------------------
 1099|       |
 1100|       |	/* Reject rediculously large header */
 1101|      1|	if (lha->header_size > 65536) {
  ------------------
  |  Branch (1101:6): [True: 1, False: 0]
  ------------------
 1102|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1103|      1|		    "LHa header size too large");
 1104|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1105|      1|	}
 1106|       |
 1107|       |	/* Read extended headers */
 1108|      0|	err = lha_read_file_extended_header(a, lha, &header_crc, 4,
 1109|      0|		  lha->header_size - H3_FIXED_SIZE, &extdsize);
  ------------------
  |  | 1074|      0|#define H3_FIXED_SIZE		28
  ------------------
 1110|      0|	if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1110:6): [True: 0, False: 0]
  ------------------
 1111|      0|		return (err);
 1112|       |
 1113|      0|	if (header_crc != lha->header_crc) {
  ------------------
  |  Branch (1113:6): [True: 0, False: 0]
  ------------------
 1114|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 1115|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 1116|       |		    "LHa header CRC error");
 1117|       |		return (ARCHIVE_FATAL);
 1118|       |#endif
 1119|      0|	}
 1120|      0|	return (err);
 1121|      0|invalid:
 1122|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1123|      0|	    "Invalid LHa header");
 1124|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1125|      0|}
archive_read_support_format_lha.c:archive_read_format_lha_read_data:
 1475|  12.8k|{
 1476|  12.8k|	struct lha *lha = (struct lha *)(a->format->data);
 1477|  12.8k|	int r;
 1478|       |
 1479|  12.8k|	if (lha->entry_unconsumed) {
  ------------------
  |  Branch (1479:6): [True: 1.16k, False: 11.6k]
  ------------------
 1480|       |		/* Consume as much as the decompressor actually used. */
 1481|  1.16k|		__archive_read_consume(a, lha->entry_unconsumed);
 1482|  1.16k|		lha->entry_unconsumed = 0;
 1483|  1.16k|	}
 1484|  12.8k|	if (lha->end_of_entry) {
  ------------------
  |  Branch (1484:6): [True: 300, False: 12.5k]
  ------------------
 1485|    300|		*offset = lha->entry_offset;
 1486|    300|		*size = 0;
 1487|    300|		*buff = NULL;
 1488|    300|		return (lha_end_of_entry(a));
 1489|    300|	}
 1490|       |
 1491|  12.5k|	if (lha->entry_is_compressed)
  ------------------
  |  Branch (1491:6): [True: 12.2k, False: 300]
  ------------------
 1492|  12.2k|		r =  lha_read_data_lzh(a, buff, size, offset);
 1493|    300|	else
 1494|       |		/* No compression. */
 1495|    300|		r =  lha_read_data_none(a, buff, size, offset);
 1496|  12.5k|	return (r);
 1497|  12.8k|}
archive_read_support_format_lha.c:lha_end_of_entry:
 1454|    615|{
 1455|    615|	struct lha *lha = (struct lha *)(a->format->data);
 1456|    615|	int r = ARCHIVE_EOF;
  ------------------
  |  |  232|    615|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1457|       |
 1458|    615|	if (!lha->end_of_entry_cleanup) {
  ------------------
  |  Branch (1458:6): [True: 615, False: 0]
  ------------------
 1459|    615|		if ((lha->setflag & CRC_IS_SET) &&
  ------------------
  |  |  164|    615|#define CRC_IS_SET		8
  ------------------
  |  Branch (1459:7): [True: 615, False: 0]
  ------------------
 1460|    615|		    lha->crc != lha->entry_crc_calculated) {
  ------------------
  |  Branch (1460:7): [True: 615, False: 0]
  ------------------
 1461|    615|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    615|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1462|    615|			    "LHa data CRC error");
 1463|    615|			r = ARCHIVE_WARN;
  ------------------
  |  |  235|    615|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1464|    615|		}
 1465|       |
 1466|       |		/* End-of-entry cleanup done. */
 1467|    615|		lha->end_of_entry_cleanup = 1;
 1468|    615|	}
 1469|    615|	return (r);
 1470|    615|}
archive_read_support_format_lha.c:lha_read_data_lzh:
 1555|  12.2k|{
 1556|  12.2k|	struct lha *lha = (struct lha *)(a->format->data);
 1557|  12.2k|	ssize_t bytes_avail;
 1558|  12.2k|	int r;
 1559|       |
 1560|       |	/* If we haven't yet read any data, initialize the decompressor. */
 1561|  12.2k|	if (!lha->decompress_init) {
  ------------------
  |  Branch (1561:6): [True: 2.55k, False: 9.67k]
  ------------------
 1562|  2.55k|		r = lzh_decode_init(&(lha->strm), lha->method);
 1563|  2.55k|		switch (r) {
 1564|  2.41k|		case ARCHIVE_OK:
  ------------------
  |  |  233|  2.41k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1564:3): [True: 2.41k, False: 143]
  ------------------
 1565|  2.41k|			break;
 1566|    143|		case ARCHIVE_FAILED:
  ------------------
  |  |  237|    143|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (1566:3): [True: 143, False: 2.41k]
  ------------------
 1567|       |        		/* Unsupported compression. */
 1568|    143|			*buff = NULL;
 1569|    143|			*size = 0;
 1570|    143|			*offset = 0;
 1571|    143|			archive_set_error(&a->archive,
 1572|    143|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    143|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1573|    143|			    "Unsupported lzh compression method -%c%c%c-",
 1574|    143|			    lha->method[0], lha->method[1], lha->method[2]);
 1575|       |			/* We know compressed size; just skip it. */
 1576|    143|			archive_read_format_lha_read_data_skip(a);
 1577|    143|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|    143|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1578|      0|		default:
  ------------------
  |  Branch (1578:3): [True: 0, False: 2.55k]
  ------------------
 1579|      0|			archive_set_error(&a->archive, ENOMEM,
 1580|      0|			    "Couldn't allocate memory "
 1581|      0|			    "for lzh decompression");
 1582|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1583|  2.55k|		}
 1584|       |		/* We've initialized decompression for this stream. */
 1585|  2.41k|		lha->decompress_init = 1;
 1586|  2.41k|		lha->strm.avail_out = 0;
 1587|  2.41k|	}
 1588|       |
 1589|       |	/*
 1590|       |	 * Note: '1' here is a performance optimization.
 1591|       |	 * Recall that the decompression layer returns a count of
 1592|       |	 * available bytes; asking for more than that forces the
 1593|       |	 * decompressor to combine reads by copying data.
 1594|       |	 */
 1595|  12.0k|	lha->strm.next_in = __archive_read_ahead(a, 1, &bytes_avail);
 1596|  12.0k|	if (bytes_avail <= 0) {
  ------------------
  |  Branch (1596:6): [True: 7, False: 12.0k]
  ------------------
 1597|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      7|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1598|      7|		    "Truncated LHa file body");
 1599|      7|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1600|      7|	}
 1601|  12.0k|	if (bytes_avail > lha->entry_bytes_remaining)
  ------------------
  |  Branch (1601:6): [True: 11.7k, False: 330]
  ------------------
 1602|  11.7k|		bytes_avail = (ssize_t)lha->entry_bytes_remaining;
 1603|       |
 1604|  12.0k|	lha->strm.avail_in = (int)bytes_avail;
 1605|  12.0k|	lha->strm.total_in = 0;
 1606|  12.0k|	lha->strm.avail_out = 0;
 1607|       |
 1608|  12.0k|	r = lzh_decode(&(lha->strm), bytes_avail == lha->entry_bytes_remaining);
 1609|  12.0k|	switch (r) {
 1610|  9.67k|	case ARCHIVE_OK:
  ------------------
  |  |  233|  9.67k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1610:2): [True: 9.67k, False: 2.40k]
  ------------------
 1611|  9.67k|		break;
 1612|    315|	case ARCHIVE_EOF:
  ------------------
  |  |  232|    315|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1612:2): [True: 315, False: 11.7k]
  ------------------
 1613|    315|		lha->end_of_entry = 1;
 1614|    315|		break;
 1615|  2.09k|	default:
  ------------------
  |  Branch (1615:2): [True: 2.09k, False: 9.98k]
  ------------------
 1616|  2.09k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  2.09k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1617|  2.09k|		    "Bad lzh data");
 1618|  2.09k|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  2.09k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1619|  12.0k|	}
 1620|  9.98k|	lha->entry_unconsumed = lha->strm.total_in;
 1621|  9.98k|	lha->entry_bytes_remaining -= lha->strm.total_in;
 1622|       |
 1623|  9.98k|	if (lha->strm.avail_out) {
  ------------------
  |  Branch (1623:6): [True: 9.66k, False: 322]
  ------------------
 1624|  9.66k|		*offset = lha->entry_offset;
 1625|  9.66k|		*size = lha->strm.avail_out;
 1626|  9.66k|		*buff = lha->strm.ref_ptr;
 1627|  9.66k|		lha->entry_crc_calculated =
 1628|  9.66k|		    lha_crc16(lha->entry_crc_calculated, *buff, *size);
 1629|  9.66k|		lha->entry_offset += *size;
 1630|  9.66k|	} else {
 1631|    322|		*offset = lha->entry_offset;
 1632|    322|		*size = 0;
 1633|    322|		*buff = NULL;
 1634|    322|		if (lha->end_of_entry)
  ------------------
  |  Branch (1634:7): [True: 315, False: 7]
  ------------------
 1635|    315|			return (lha_end_of_entry(a));
 1636|    322|	}
 1637|  9.67k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  9.67k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1638|  9.98k|}
archive_read_support_format_lha.c:lzh_decode_init:
 1886|  2.55k|{
 1887|  2.55k|	struct lzh_dec *ds;
 1888|  2.55k|	int w_bits, w_size;
 1889|       |
 1890|  2.55k|	if (strm->ds == NULL) {
  ------------------
  |  Branch (1890:6): [True: 52, False: 2.50k]
  ------------------
 1891|     52|		strm->ds = calloc(1, sizeof(*strm->ds));
 1892|     52|		if (strm->ds == NULL)
  ------------------
  |  Branch (1892:7): [True: 0, False: 52]
  ------------------
 1893|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1894|     52|	}
 1895|  2.55k|	ds = strm->ds;
 1896|  2.55k|	ds->error = ARCHIVE_FAILED;
  ------------------
  |  |  237|  2.55k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1897|  2.55k|	if (method == NULL || method[0] != 'l' || method[1] != 'h')
  ------------------
  |  Branch (1897:6): [True: 0, False: 2.55k]
  |  Branch (1897:24): [True: 0, False: 2.55k]
  |  Branch (1897:44): [True: 0, False: 2.55k]
  ------------------
 1898|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1899|  2.55k|	switch (method[2]) {
 1900|  2.40k|	case '5':
  ------------------
  |  Branch (1900:2): [True: 2.40k, False: 146]
  ------------------
 1901|  2.40k|		w_bits = 13;/* 8KiB for window */
 1902|  2.40k|		break;
 1903|      3|	case '6':
  ------------------
  |  Branch (1903:2): [True: 3, False: 2.55k]
  ------------------
 1904|      3|		w_bits = 15;/* 32KiB for window */
 1905|      3|		break;
 1906|      0|	case '7':
  ------------------
  |  Branch (1906:2): [True: 0, False: 2.55k]
  ------------------
 1907|      0|		w_bits = 16;/* 64KiB for window */
 1908|      0|		break;
 1909|    143|	default:
  ------------------
  |  Branch (1909:2): [True: 143, False: 2.41k]
  ------------------
 1910|    143|		return (ARCHIVE_FAILED);/* Not supported. */
  ------------------
  |  |  237|    143|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1911|  2.55k|	}
 1912|  2.41k|	ds->error = ARCHIVE_FATAL;
  ------------------
  |  |  239|  2.41k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1913|       |	/* Expand a window size up to 128 KiB for decompressing process
 1914|       |	 * performance whatever its original window size is. */
 1915|  2.41k|	ds->w_size = 1U << 17;
 1916|  2.41k|	ds->w_mask = ds->w_size -1;
 1917|  2.41k|	if (ds->w_buff == NULL) {
  ------------------
  |  Branch (1917:6): [True: 52, False: 2.36k]
  ------------------
 1918|     52|		ds->w_buff = malloc(ds->w_size);
 1919|     52|		if (ds->w_buff == NULL)
  ------------------
  |  Branch (1919:7): [True: 0, False: 52]
  ------------------
 1920|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1921|     52|	}
 1922|  2.41k|	w_size = 1U << w_bits;
 1923|  2.41k|	memset(ds->w_buff + ds->w_size - w_size, 0x20, w_size);
 1924|  2.41k|	ds->w_pos = 0;
 1925|  2.41k|	ds->state = 0;
 1926|  2.41k|	ds->pos_pt_len_size = w_bits + 1;
 1927|  2.41k|	ds->pos_pt_len_bits = (w_bits == 15 || w_bits == 16)? 5: 4;
  ------------------
  |  Branch (1927:25): [True: 3, False: 2.40k]
  |  Branch (1927:41): [True: 0, False: 2.40k]
  ------------------
 1928|  2.41k|	ds->literal_pt_len_size = PT_BITLEN_SIZE;
  ------------------
  |  |   65|  2.41k|#define PT_BITLEN_SIZE		(3 + 16)
  ------------------
 1929|  2.41k|	ds->literal_pt_len_bits = 5;
 1930|  2.41k|	ds->br.cache_buffer = 0;
 1931|  2.41k|	ds->br.cache_avail = 0;
 1932|       |
 1933|  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 (1933:6): [True: 0, False: 2.41k]
  ------------------
 1934|  2.41k|	    != ARCHIVE_OK)
  ------------------
  |  |  233|  2.41k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1935|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1936|  2.41k|	ds->lt.len_bits = 9;
 1937|  2.41k|	if (lzh_huffman_init(&(ds->pt), PT_BITLEN_SIZE, 16)
  ------------------
  |  |   65|  2.41k|#define PT_BITLEN_SIZE		(3 + 16)
  ------------------
  |  Branch (1937:6): [True: 0, False: 2.41k]
  ------------------
 1938|  2.41k|	    != ARCHIVE_OK)
  ------------------
  |  |  233|  2.41k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1939|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1940|  2.41k|	ds->error = 0;
 1941|       |
 1942|  2.41k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.41k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1943|  2.41k|}
archive_read_support_format_lha.c:lzh_huffman_init:
 2567|  4.82k|{
 2568|  4.82k|	int bits;
 2569|       |
 2570|  4.82k|	if (hf->bitlen == NULL) {
  ------------------
  |  Branch (2570:6): [True: 104, False: 4.72k]
  ------------------
 2571|    104|		hf->bitlen = malloc(len_size * sizeof(hf->bitlen[0]));
 2572|    104|		if (hf->bitlen == NULL)
  ------------------
  |  Branch (2572:7): [True: 0, False: 104]
  ------------------
 2573|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2574|    104|	}
 2575|  4.82k|	if (hf->tbl == NULL) {
  ------------------
  |  Branch (2575:6): [True: 104, False: 4.72k]
  ------------------
 2576|    104|		if (tbl_bits < HTBL_BITS)
  ------------------
  |  |  114|    104|#define HTBL_BITS	10
  ------------------
  |  Branch (2576:7): [True: 0, False: 104]
  ------------------
 2577|      0|			bits = tbl_bits;
 2578|    104|		else
 2579|    104|			bits = HTBL_BITS;
  ------------------
  |  |  114|    104|#define HTBL_BITS	10
  ------------------
 2580|    104|		hf->tbl = malloc(((size_t)1 << bits) * sizeof(hf->tbl[0]));
 2581|    104|		if (hf->tbl == NULL)
  ------------------
  |  Branch (2581:7): [True: 0, False: 104]
  ------------------
 2582|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2583|    104|	}
 2584|  4.82k|	if (hf->tree == NULL && tbl_bits > HTBL_BITS) {
  ------------------
  |  |  114|    104|#define HTBL_BITS	10
  ------------------
  |  Branch (2584:6): [True: 104, False: 4.72k]
  |  Branch (2584:26): [True: 104, False: 0]
  ------------------
 2585|    104|		hf->tree_avail = 1 << (tbl_bits - HTBL_BITS + 4);
  ------------------
  |  |  114|    104|#define HTBL_BITS	10
  ------------------
 2586|    104|		hf->tree = malloc(hf->tree_avail * sizeof(hf->tree[0]));
 2587|    104|		if (hf->tree == NULL)
  ------------------
  |  Branch (2587:7): [True: 0, False: 104]
  ------------------
 2588|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2589|    104|	}
 2590|  4.82k|	hf->len_size = (int)len_size;
 2591|  4.82k|	hf->tbl_bits = tbl_bits;
 2592|  4.82k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.82k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2593|  4.82k|}
archive_read_support_format_lha.c:lzh_decode:
 2114|  12.0k|{
 2115|  12.0k|	struct lzh_dec *ds = strm->ds;
 2116|  12.0k|	int avail_in;
 2117|  12.0k|	int r;
 2118|       |
 2119|  12.0k|	if (ds->error)
  ------------------
  |  Branch (2119:6): [True: 0, False: 12.0k]
  ------------------
 2120|      0|		return (ds->error);
 2121|       |
 2122|  12.0k|	avail_in = strm->avail_in;
 2123|  16.7k|	do {
 2124|  16.7k|		if (ds->state < ST_GET_LITERAL)
  ------------------
  |  | 2107|  16.7k|#define ST_GET_LITERAL		9
  ------------------
  |  Branch (2124:7): [True: 4.82k, False: 11.8k]
  ------------------
 2125|  4.82k|			r = lzh_read_blocks(strm, last);
 2126|  11.8k|		else
 2127|  11.8k|			r = lzh_decode_blocks(strm, last);
 2128|  16.7k|	} while (r == 100);
  ------------------
  |  Branch (2128:11): [True: 4.63k, False: 12.0k]
  ------------------
 2129|  12.0k|	strm->total_in += avail_in - strm->avail_in;
 2130|  12.0k|	return (r);
 2131|  12.0k|}
archive_read_support_format_lha.c:lzh_read_blocks:
 2142|  4.82k|{
 2143|  4.82k|	struct lzh_dec *ds = strm->ds;
 2144|  4.82k|	struct lzh_br *br = &(ds->br);
 2145|  4.82k|	int c = 0, i;
 2146|  4.82k|	unsigned rbits;
 2147|       |
 2148|  14.6k|	for (;;) {
 2149|  14.6k|		switch (ds->state) {
  ------------------
  |  Branch (2149:11): [True: 14.6k, False: 0]
  ------------------
 2150|  4.82k|		case ST_RD_BLOCK:
  ------------------
  |  | 2098|  4.82k|#define ST_RD_BLOCK		0
  ------------------
  |  Branch (2150:3): [True: 4.82k, False: 9.79k]
  ------------------
 2151|       |			/*
 2152|       |			 * Read a block number indicates how many blocks
 2153|       |			 * we will handle. The block is composed of a
 2154|       |			 * literal and a match, sometimes a literal only
 2155|       |			 * in particular, there are no reference data at
 2156|       |			 * the beginning of the decompression.
 2157|       |			 */
 2158|  4.82k|			if (!lzh_br_read_ahead_0(strm, br, 16)) {
  ------------------
  |  | 1979|  4.82k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  ------------------
  |  |  |  | 1965|  9.65k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1965:27): [True: 1.77k, False: 3.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (1979:26): [True: 2.41k, False: 630]
  |  |  ------------------
  ------------------
 2159|    630|				if (!last)
  ------------------
  |  Branch (2159:9): [True: 0, False: 630]
  ------------------
 2160|       |					/* We need following data. */
 2161|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2162|    630|				if (lzh_br_has(br, 8)) {
  ------------------
  |  | 1965|    630|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  ------------------
  |  |  |  Branch (1965:27): [True: 0, False: 630]
  |  |  ------------------
  ------------------
 2163|       |					/*
 2164|       |					 * It seems there are extra bits.
 2165|       |					 *  1. Compressed data is broken.
 2166|       |					 *  2. `last' flag does not properly
 2167|       |					 *     set.
 2168|       |					 */
 2169|      0|					goto failed;
 2170|      0|				}
 2171|    630|				if (ds->w_pos > 0) {
  ------------------
  |  Branch (2171:9): [True: 315, False: 315]
  ------------------
 2172|    315|					lzh_emit_window(strm, ds->w_pos);
 2173|    315|					ds->w_pos = 0;
 2174|    315|					return (ARCHIVE_OK);
  ------------------
  |  |  233|    315|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2175|    315|				}
 2176|       |				/* End of compressed data; we have completely
 2177|       |				 * handled all compressed data. */
 2178|    315|				return (ARCHIVE_EOF);
  ------------------
  |  |  232|    315|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2179|    630|			}
 2180|  4.19k|			ds->blocks_avail = lzh_br_bits(br, 16);
  ------------------
  |  | 1968|  4.19k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1969|  4.19k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2181|  4.19k|			if (ds->blocks_avail == 0)
  ------------------
  |  Branch (2181:8): [True: 27, False: 4.16k]
  ------------------
 2182|     27|				goto failed;
 2183|  4.16k|			lzh_br_consume(br, 16);
  ------------------
  |  | 1987|  4.16k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2184|       |			/*
 2185|       |			 * Read a literal table compressed in huffman
 2186|       |			 * coding.
 2187|       |			 */
 2188|  4.16k|			ds->pt.len_size = ds->literal_pt_len_size;
 2189|  4.16k|			ds->pt.len_bits = ds->literal_pt_len_bits;
 2190|  4.16k|			ds->reading_position = 0;
 2191|       |			/* FALL THROUGH */
 2192|  7.14k|		case ST_RD_PT_1:
  ------------------
  |  | 2099|  7.14k|#define ST_RD_PT_1		1
  ------------------
  |  Branch (2192:3): [True: 2.98k, False: 11.6k]
  ------------------
 2193|       |			/* Note: ST_RD_PT_1, ST_RD_PT_2 and ST_RD_PT_4 are
 2194|       |			 * used in reading both a literal table and a
 2195|       |			 * position table. */
 2196|  7.14k|			if (!lzh_br_read_ahead(strm, br, ds->pt.len_bits)) {
  ------------------
  |  | 1984|  7.14k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1979|  14.2k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1965|  14.2k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1965:27): [True: 7.14k, False: 5]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1979:26): [True: 4, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1965|      1|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1965:27): [True: 0, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2197|      1|				if (last)
  ------------------
  |  Branch (2197:9): [True: 1, False: 0]
  ------------------
 2198|      1|					goto failed;/* Truncated data. */
 2199|      0|				ds->state = ST_RD_PT_1;
  ------------------
  |  | 2099|      0|#define ST_RD_PT_1		1
  ------------------
 2200|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2201|      1|			}
 2202|  7.14k|			ds->pt.len_avail = lzh_br_bits(br, ds->pt.len_bits);
  ------------------
  |  | 1968|  7.14k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1969|  7.14k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2203|  7.14k|			lzh_br_consume(br, ds->pt.len_bits);
  ------------------
  |  | 1987|  7.14k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2204|       |			/* FALL THROUGH */
 2205|  7.14k|		case ST_RD_PT_2:
  ------------------
  |  | 2100|  7.14k|#define ST_RD_PT_2		2
  ------------------
  |  Branch (2205:3): [True: 0, False: 14.6k]
  ------------------
 2206|  7.14k|			if (ds->pt.len_avail == 0) {
  ------------------
  |  Branch (2206:8): [True: 1.28k, False: 5.86k]
  ------------------
 2207|       |				/* There is no bitlen. */
 2208|  1.28k|				if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 1984|  1.28k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1979|  2.57k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1965|  2.57k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1965:27): [True: 1.27k, False: 11]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1979:26): [True: 1, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1965|     10|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1965:27): [True: 10, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2209|  1.28k|				    ds->pt.len_bits)) {
 2210|      0|					if (last)
  ------------------
  |  Branch (2210:10): [True: 0, False: 0]
  ------------------
 2211|      0|						goto failed;/* Truncated data.*/
 2212|      0|					ds->state = ST_RD_PT_2;
  ------------------
  |  | 2100|      0|#define ST_RD_PT_2		2
  ------------------
 2213|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2214|      0|				}
 2215|  1.28k|				if (!lzh_make_fake_table(&(ds->pt),
  ------------------
  |  Branch (2215:9): [True: 1, False: 1.28k]
  ------------------
 2216|  1.28k|				    lzh_br_bits(br, ds->pt.len_bits)))
  ------------------
  |  | 1968|  1.28k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1969|  1.28k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2217|      1|					goto failed;/* Invalid data. */
 2218|  1.28k|				lzh_br_consume(br, ds->pt.len_bits);
  ------------------
  |  | 1987|  1.28k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2219|  1.28k|				if (ds->reading_position)
  ------------------
  |  Branch (2219:9): [True: 412, False: 874]
  ------------------
 2220|    412|					ds->state = ST_GET_LITERAL;
  ------------------
  |  | 2107|    412|#define ST_GET_LITERAL		9
  ------------------
 2221|    874|				else
 2222|    874|					ds->state = ST_RD_LITERAL_1;
  ------------------
  |  | 2103|    874|#define ST_RD_LITERAL_1		5
  ------------------
 2223|  1.28k|				break;
 2224|  5.86k|			} else if (ds->pt.len_avail > ds->pt.len_size)
  ------------------
  |  Branch (2224:15): [True: 71, False: 5.79k]
  ------------------
 2225|     71|				goto failed;/* Invalid data. */
 2226|  5.79k|			ds->loop = 0;
 2227|  5.79k|			memset(ds->pt.freq, 0, sizeof(ds->pt.freq));
 2228|  5.79k|			if (ds->pt.len_avail < 3 ||
  ------------------
  |  Branch (2228:8): [True: 6, False: 5.78k]
  ------------------
 2229|  5.78k|			    ds->pt.len_size == ds->pos_pt_len_size) {
  ------------------
  |  Branch (2229:8): [True: 2.56k, False: 3.21k]
  ------------------
 2230|  2.57k|				ds->state = ST_RD_PT_4;
  ------------------
  |  | 2102|  2.57k|#define ST_RD_PT_4		4
  ------------------
 2231|  2.57k|				break;
 2232|  2.57k|			}
 2233|       |			/* FALL THROUGH */
 2234|  3.21k|		case ST_RD_PT_3:
  ------------------
  |  | 2101|  3.21k|#define ST_RD_PT_3		3
  ------------------
  |  Branch (2234:3): [True: 0, False: 14.6k]
  ------------------
 2235|  3.21k|			ds->loop = lzh_read_pt_bitlen(strm, ds->loop, 3);
 2236|  3.21k|			if (ds->loop < 3) {
  ------------------
  |  Branch (2236:8): [True: 0, False: 3.21k]
  ------------------
 2237|      0|				if (ds->loop < 0 || last)
  ------------------
  |  Branch (2237:9): [True: 0, False: 0]
  |  Branch (2237:25): [True: 0, False: 0]
  ------------------
 2238|      0|					goto failed;/* Invalid data. */
 2239|       |				/* Not completed, get following data. */
 2240|      0|				ds->state = ST_RD_PT_3;
  ------------------
  |  | 2101|      0|#define ST_RD_PT_3		3
  ------------------
 2241|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2242|      0|			}
 2243|       |			/* There are some null in bitlen of the literal. */
 2244|  3.21k|			if (!lzh_br_read_ahead(strm, br, 2)) {
  ------------------
  |  | 1984|  3.21k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1979|  6.43k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1965|  6.43k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1965:27): [True: 3.18k, False: 30]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1979:26): [True: 1, False: 29]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1965|     29|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1965:27): [True: 29, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2245|      0|				if (last)
  ------------------
  |  Branch (2245:9): [True: 0, False: 0]
  ------------------
 2246|      0|					goto failed;/* Truncated data. */
 2247|      0|				ds->state = ST_RD_PT_3;
  ------------------
  |  | 2101|      0|#define ST_RD_PT_3		3
  ------------------
 2248|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2249|      0|			}
 2250|  3.21k|			c = lzh_br_bits(br, 2);
  ------------------
  |  | 1968|  3.21k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1969|  3.21k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2251|  3.21k|			lzh_br_consume(br, 2);
  ------------------
  |  | 1987|  3.21k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2252|  3.21k|			if (c > ds->pt.len_avail - 3)
  ------------------
  |  Branch (2252:8): [True: 0, False: 3.21k]
  ------------------
 2253|      0|				goto failed;/* Invalid data. */
 2254|  8.41k|			for (i = 3; c-- > 0 ;)
  ------------------
  |  Branch (2254:16): [True: 5.19k, False: 3.21k]
  ------------------
 2255|  5.19k|				ds->pt.bitlen[i++] = 0;
 2256|  3.21k|			ds->loop = i;
 2257|       |			/* FALL THROUGH */
 2258|  5.79k|		case ST_RD_PT_4:
  ------------------
  |  | 2102|  5.79k|#define ST_RD_PT_4		4
  ------------------
  |  Branch (2258:3): [True: 2.57k, False: 12.0k]
  ------------------
 2259|  5.79k|			ds->loop = lzh_read_pt_bitlen(strm, ds->loop,
 2260|  5.79k|			    ds->pt.len_avail);
 2261|  5.79k|			if (ds->loop < ds->pt.len_avail) {
  ------------------
  |  Branch (2261:8): [True: 257, False: 5.53k]
  ------------------
 2262|    257|				if (ds->loop < 0 || last)
  ------------------
  |  Branch (2262:9): [True: 119, False: 138]
  |  Branch (2262:25): [True: 138, False: 0]
  ------------------
 2263|    257|					goto failed;/* Invalid data. */
 2264|       |				/* Not completed, get following data. */
 2265|      0|				ds->state = ST_RD_PT_4;
  ------------------
  |  | 2102|      0|#define ST_RD_PT_4		4
  ------------------
 2266|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2267|    257|			}
 2268|  5.53k|			if (!lzh_make_huffman_table(&(ds->pt)))
  ------------------
  |  Branch (2268:8): [True: 1.09k, False: 4.43k]
  ------------------
 2269|  1.09k|				goto failed;/* Invalid data */
 2270|  4.43k|			if (ds->reading_position) {
  ------------------
  |  Branch (2270:8): [True: 2.12k, False: 2.31k]
  ------------------
 2271|  2.12k|				ds->state = ST_GET_LITERAL;
  ------------------
  |  | 2107|  2.12k|#define ST_GET_LITERAL		9
  ------------------
 2272|  2.12k|				break;
 2273|  2.12k|			}
 2274|       |			/* FALL THROUGH */
 2275|  3.18k|		case ST_RD_LITERAL_1:
  ------------------
  |  | 2103|  3.18k|#define ST_RD_LITERAL_1		5
  ------------------
  |  Branch (2275:3): [True: 874, False: 13.7k]
  ------------------
 2276|  3.18k|			if (!lzh_br_read_ahead(strm, br, ds->lt.len_bits)) {
  ------------------
  |  | 1984|  3.18k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1979|  6.37k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1965|  6.37k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1965:27): [True: 2.81k, False: 374]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1979:26): [True: 0, False: 374]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1965|    374|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1965:27): [True: 347, False: 27]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2277|     27|				if (last)
  ------------------
  |  Branch (2277:9): [True: 27, False: 0]
  ------------------
 2278|     27|					goto failed;/* Truncated data. */
 2279|      0|				ds->state = ST_RD_LITERAL_1;
  ------------------
  |  | 2103|      0|#define ST_RD_LITERAL_1		5
  ------------------
 2280|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2281|     27|			}
 2282|  3.16k|			ds->lt.len_avail = lzh_br_bits(br, ds->lt.len_bits);
  ------------------
  |  | 1968|  3.16k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1969|  3.16k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2283|  3.16k|			lzh_br_consume(br, ds->lt.len_bits);
  ------------------
  |  | 1987|  3.16k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2284|       |			/* FALL THROUGH */
 2285|  3.16k|		case ST_RD_LITERAL_2:
  ------------------
  |  | 2104|  3.16k|#define ST_RD_LITERAL_2		6
  ------------------
  |  Branch (2285:3): [True: 0, False: 14.6k]
  ------------------
 2286|  3.16k|			if (ds->lt.len_avail == 0) {
  ------------------
  |  Branch (2286:8): [True: 836, False: 2.32k]
  ------------------
 2287|       |				/* There is no bitlen. */
 2288|    836|				if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 1984|    836|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1979|  1.67k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1965|  1.67k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1965:27): [True: 354, False: 482]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1979:26): [True: 121, False: 361]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1965|    361|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1965:27): [True: 361, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2289|    836|				    ds->lt.len_bits)) {
 2290|      0|					if (last)
  ------------------
  |  Branch (2290:10): [True: 0, False: 0]
  ------------------
 2291|      0|						goto failed;/* Truncated data.*/
 2292|      0|					ds->state = ST_RD_LITERAL_2;
  ------------------
  |  | 2104|      0|#define ST_RD_LITERAL_2		6
  ------------------
 2293|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2294|      0|				}
 2295|    836|				if (!lzh_make_fake_table(&(ds->lt),
  ------------------
  |  Branch (2295:9): [True: 0, False: 836]
  ------------------
 2296|    836|				    lzh_br_bits(br, ds->lt.len_bits)))
  ------------------
  |  | 1968|    836|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1969|    836|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2297|      0|					goto failed;/* Invalid data */
 2298|    836|				lzh_br_consume(br, ds->lt.len_bits);
  ------------------
  |  | 1987|    836|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2299|    836|				ds->state = ST_RD_POS_DATA_1;
  ------------------
  |  | 2106|    836|#define ST_RD_POS_DATA_1	8
  ------------------
 2300|    836|				break;
 2301|  2.32k|			} else if (ds->lt.len_avail > ds->lt.len_size)
  ------------------
  |  Branch (2301:15): [True: 0, False: 2.32k]
  ------------------
 2302|      0|				goto failed;/* Invalid data */
 2303|  2.32k|			ds->loop = 0;
 2304|  2.32k|			memset(ds->lt.freq, 0, sizeof(ds->lt.freq));
 2305|       |			/* FALL THROUGH */
 2306|  2.32k|		case ST_RD_LITERAL_3:
  ------------------
  |  | 2105|  2.32k|#define ST_RD_LITERAL_3		7
  ------------------
  |  Branch (2306:3): [True: 0, False: 14.6k]
  ------------------
 2307|  2.32k|			i = ds->loop;
 2308|   112k|			while (i < ds->lt.len_avail) {
  ------------------
  |  Branch (2308:11): [True: 110k, False: 2.18k]
  ------------------
 2309|   110k|				if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 1984|   110k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1979|   220k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1965|   220k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1965:27): [True: 103k, False: 6.73k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1979:26): [True: 6.72k, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1965|      6|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1965:27): [True: 3, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2310|   110k|				    ds->pt.max_bits)) {
 2311|      3|					if (last)
  ------------------
  |  Branch (2311:10): [True: 0, False: 3]
  ------------------
 2312|      0|						goto failed;/* Truncated data.*/
 2313|      3|					ds->loop = i;
 2314|      3|					ds->state = ST_RD_LITERAL_3;
  ------------------
  |  | 2105|      3|#define ST_RD_LITERAL_3		7
  ------------------
 2315|      3|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2316|      3|				}
 2317|   110k|				rbits = lzh_br_bits(br, ds->pt.max_bits);
  ------------------
  |  | 1968|   110k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1969|   110k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2318|   110k|				c = lzh_decode_huffman(&(ds->pt), rbits);
 2319|   110k|				if (c > 2) {
  ------------------
  |  Branch (2319:9): [True: 74.3k, False: 36.1k]
  ------------------
 2320|       |					/* Note: 'c' will never be more than
 2321|       |					 * eighteen since it's limited by
 2322|       |					 * PT_BITLEN_SIZE, which is being set
 2323|       |					 * to ds->pt.len_size through
 2324|       |					 * ds->literal_pt_len_size. */
 2325|  74.3k|					lzh_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 1987|  74.3k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2326|  74.3k|					c -= 2;
 2327|  74.3k|					ds->lt.freq[c]++;
 2328|  74.3k|					ds->lt.bitlen[i++] = c;
 2329|  74.3k|				} else if (c == 0) {
  ------------------
  |  Branch (2329:16): [True: 13.5k, False: 22.5k]
  ------------------
 2330|  13.5k|					lzh_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 1987|  13.5k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2331|  13.5k|					ds->lt.bitlen[i++] = 0;
 2332|  22.5k|				} else {
 2333|       |					/* c == 1 or c == 2 */
 2334|  22.5k|					int n = (c == 1)?4:9;
  ------------------
  |  Branch (2334:14): [True: 18.0k, False: 4.56k]
  ------------------
 2335|  22.5k|					if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 1984|  22.5k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1979|  45.1k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1965|  45.1k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1965:27): [True: 22.4k, False: 86]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1979:26): [True: 86, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1965|      0|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1965:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2336|  22.5k|					     ds->pt.bitlen[c] + n)) {
 2337|      0|						if (last) /* Truncated data. */
  ------------------
  |  Branch (2337:11): [True: 0, False: 0]
  ------------------
 2338|      0|							goto failed;
 2339|      0|						ds->loop = i;
 2340|      0|						ds->state = ST_RD_LITERAL_3;
  ------------------
  |  | 2105|      0|#define ST_RD_LITERAL_3		7
  ------------------
 2341|      0|						return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2342|      0|					}
 2343|  22.5k|					lzh_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 1987|  22.5k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2344|  22.5k|					c = lzh_br_bits(br, n);
  ------------------
  |  | 1968|  22.5k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1969|  22.5k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2345|  22.5k|					lzh_br_consume(br, n);
  ------------------
  |  | 1987|  22.5k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2346|  22.5k|					c += (n == 4)?3:20;
  ------------------
  |  Branch (2346:11): [True: 18.0k, False: 4.56k]
  ------------------
 2347|  22.5k|					if (i + c > ds->lt.len_avail)
  ------------------
  |  Branch (2347:10): [True: 140, False: 22.4k]
  ------------------
 2348|    140|						goto failed;/* Invalid data */
 2349|  22.4k|					memset(&(ds->lt.bitlen[i]), 0, c);
 2350|  22.4k|					i += c;
 2351|  22.4k|				}
 2352|   110k|			}
 2353|  2.18k|			if (i > ds->lt.len_avail ||
  ------------------
  |  Branch (2353:8): [True: 0, False: 2.18k]
  ------------------
 2354|  2.18k|			    !lzh_make_huffman_table(&(ds->lt)))
  ------------------
  |  Branch (2354:8): [True: 36, False: 2.14k]
  ------------------
 2355|     36|				goto failed;/* Invalid data */
 2356|       |			/* FALL THROUGH */
 2357|  2.98k|		case ST_RD_POS_DATA_1:
  ------------------
  |  | 2106|  2.98k|#define ST_RD_POS_DATA_1	8
  ------------------
  |  Branch (2357:3): [True: 836, False: 13.7k]
  ------------------
 2358|       |			/*
 2359|       |			 * Read a position table compressed in huffman
 2360|       |			 * coding.
 2361|       |			 */
 2362|  2.98k|			ds->pt.len_size = ds->pos_pt_len_size;
 2363|  2.98k|			ds->pt.len_bits = ds->pos_pt_len_bits;
 2364|  2.98k|			ds->reading_position = 1;
 2365|  2.98k|			ds->state = ST_RD_PT_1;
  ------------------
  |  | 2099|  2.98k|#define ST_RD_PT_1		1
  ------------------
 2366|  2.98k|			break;
 2367|  2.53k|		case ST_GET_LITERAL:
  ------------------
  |  | 2107|  2.53k|#define ST_GET_LITERAL		9
  ------------------
  |  Branch (2367:3): [True: 2.53k, False: 12.0k]
  ------------------
 2368|  2.53k|			return (100);
 2369|  14.6k|		}
 2370|  14.6k|	}
 2371|  1.65k|failed:
 2372|  1.65k|	return (ds->error = ARCHIVE_FAILED);
  ------------------
  |  |  237|  1.65k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2373|  4.82k|}
archive_read_support_format_lha.c:lzh_br_fillup:
 2007|  39.2k|{
 2008|  39.2k|	int n = CACHE_BITS - br->cache_avail;
  ------------------
  |  |   92|  39.2k|#define CACHE_BITS		(8 * sizeof(CACHE_TYPE))
  ------------------
 2009|       |
 2010|  45.3k|	for (;;) {
 2011|  45.3k|		const int x = n >> 3;
 2012|  45.3k|		if (strm->avail_in >= x) {
  ------------------
  |  Branch (2012:7): [True: 35.1k, False: 10.1k]
  ------------------
 2013|  35.1k|			switch (x) {
 2014|  4.97k|			case 8:
  ------------------
  |  Branch (2014:4): [True: 4.97k, False: 30.1k]
  ------------------
 2015|  4.97k|				br->cache_buffer =
 2016|  4.97k|				    ((uint64_t)strm->next_in[0]) << 56 |
 2017|  4.97k|				    ((uint64_t)strm->next_in[1]) << 48 |
 2018|  4.97k|				    ((uint64_t)strm->next_in[2]) << 40 |
 2019|  4.97k|				    ((uint64_t)strm->next_in[3]) << 32 |
 2020|  4.97k|				    ((uint32_t)strm->next_in[4]) << 24 |
 2021|  4.97k|				    ((uint32_t)strm->next_in[5]) << 16 |
 2022|  4.97k|				    ((uint32_t)strm->next_in[6]) << 8 |
 2023|  4.97k|				     (uint32_t)strm->next_in[7];
 2024|  4.97k|				strm->next_in += 8;
 2025|  4.97k|				strm->avail_in -= 8;
 2026|  4.97k|				br->cache_avail += 8 * 8;
 2027|  4.97k|				return (1);
 2028|  30.1k|			case 7:
  ------------------
  |  Branch (2028:4): [True: 30.1k, False: 5.01k]
  ------------------
 2029|  30.1k|				br->cache_buffer =
 2030|  30.1k|		 		   (br->cache_buffer << 56) |
 2031|  30.1k|				    ((uint64_t)strm->next_in[0]) << 48 |
 2032|  30.1k|				    ((uint64_t)strm->next_in[1]) << 40 |
 2033|  30.1k|				    ((uint64_t)strm->next_in[2]) << 32 |
 2034|  30.1k|				    ((uint64_t)strm->next_in[3]) << 24 |
 2035|  30.1k|				    ((uint64_t)strm->next_in[4]) << 16 |
 2036|  30.1k|				    ((uint64_t)strm->next_in[5]) << 8 |
 2037|  30.1k|				     (uint64_t)strm->next_in[6];
 2038|  30.1k|				strm->next_in += 7;
 2039|  30.1k|				strm->avail_in -= 7;
 2040|  30.1k|				br->cache_avail += 7 * 8;
 2041|  30.1k|				return (1);
 2042|     41|			case 6:
  ------------------
  |  Branch (2042:4): [True: 41, False: 35.0k]
  ------------------
 2043|     41|				br->cache_buffer =
 2044|     41|		 		   (br->cache_buffer << 48) |
 2045|     41|				    ((uint64_t)strm->next_in[0]) << 40 |
 2046|     41|				    ((uint64_t)strm->next_in[1]) << 32 |
 2047|     41|				    ((uint64_t)strm->next_in[2]) << 24 |
 2048|     41|				    ((uint64_t)strm->next_in[3]) << 16 |
 2049|     41|				    ((uint64_t)strm->next_in[4]) << 8 |
 2050|     41|				     (uint64_t)strm->next_in[5];
 2051|     41|				strm->next_in += 6;
 2052|     41|				strm->avail_in -= 6;
 2053|     41|				br->cache_avail += 6 * 8;
 2054|     41|				return (1);
 2055|      0|			case 0:
  ------------------
  |  Branch (2055:4): [True: 0, False: 35.1k]
  ------------------
 2056|       |				/* We have enough compressed data in
 2057|       |				 * the cache buffer.*/
 2058|      0|				return (1);
 2059|      0|			default:
  ------------------
  |  Branch (2059:4): [True: 0, False: 35.1k]
  ------------------
 2060|      0|				break;
 2061|  35.1k|			}
 2062|  35.1k|		}
 2063|  10.1k|		if (strm->avail_in == 0) {
  ------------------
  |  Branch (2063:7): [True: 4.14k, False: 6.04k]
  ------------------
 2064|       |			/* There is not enough compressed data to fill up the
 2065|       |			 * cache buffer. */
 2066|  4.14k|			return (0);
 2067|  4.14k|		}
 2068|  6.04k|		br->cache_buffer =
 2069|  6.04k|		   (br->cache_buffer << 8) | *strm->next_in++;
 2070|  6.04k|		strm->avail_in--;
 2071|  6.04k|		br->cache_avail += 8;
 2072|  6.04k|		n -= 8;
 2073|  6.04k|	}
 2074|  39.2k|}
archive_read_support_format_lha.c:lzh_emit_window:
 2135|  9.66k|{
 2136|  9.66k|	strm->ref_ptr = strm->ds->w_buff;
 2137|  9.66k|	strm->avail_out = (int)s;
 2138|  9.66k|}
archive_read_support_format_lha.c:lzh_make_fake_table:
 2709|  2.12k|{
 2710|  2.12k|	if (c >= hf->len_size)
  ------------------
  |  Branch (2710:6): [True: 1, False: 2.12k]
  ------------------
 2711|      1|		return (0);
 2712|  2.12k|	hf->tbl[0] = c;
 2713|  2.12k|	hf->max_bits = 0;
 2714|  2.12k|	hf->shift_bits = 0;
 2715|  2.12k|	hf->bitlen[hf->tbl[0]] = 0;
 2716|  2.12k|	return (1);
 2717|  2.12k|}
archive_read_support_format_lha.c:lzh_read_pt_bitlen:
 2671|  9.00k|{
 2672|  9.00k|	struct lzh_dec *ds = strm->ds;
 2673|  9.00k|	struct lzh_br *br = &(ds->br);
 2674|  9.00k|	int c, i;
 2675|       |
 2676|  54.1k|	for (i = start; i < end; ) {
  ------------------
  |  Branch (2676:18): [True: 45.4k, False: 8.75k]
  ------------------
 2677|       |		/*
 2678|       |		 *  bit pattern     the number we need
 2679|       |		 *     000           ->  0
 2680|       |		 *     001           ->  1
 2681|       |		 *     010           ->  2
 2682|       |		 *     ...
 2683|       |		 *     110           ->  6
 2684|       |		 *     1110          ->  7
 2685|       |		 *     11110         ->  8
 2686|       |		 *     ...
 2687|       |		 *     1111111111110 ->  16
 2688|       |		 */
 2689|  45.4k|		if (!lzh_br_read_ahead(strm, br, 3))
  ------------------
  |  | 1984|  45.4k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1979|  90.8k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1965|  90.8k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1965:27): [True: 42.4k, False: 2.90k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1979:26): [True: 2.16k, False: 747]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1965|    747|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1965:27): [True: 648, False: 99]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2690|     99|			return (i);
 2691|  45.3k|		if ((c = lzh_br_bits(br, 3)) == 7) {
  ------------------
  |  | 1968|  45.3k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1969|  45.3k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
  |  Branch (2691:7): [True: 433, False: 44.8k]
  ------------------
 2692|    433|			if (!lzh_br_read_ahead(strm, br, 13))
  ------------------
  |  | 1984|    433|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1979|    866|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1965|    866|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1965:27): [True: 239, False: 194]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1979:26): [True: 35, False: 159]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1965|    159|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1965:27): [True: 120, False: 39]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2693|     39|				return (i);
 2694|    394|			c = bitlen_tbl[lzh_br_bits(br, 13) & 0x3FF];
  ------------------
  |  | 1968|    394|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1969|    394|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2695|    394|			if (c)
  ------------------
  |  Branch (2695:8): [True: 275, False: 119]
  ------------------
 2696|    275|				lzh_br_consume(br, c - 3);
  ------------------
  |  | 1987|    275|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2697|    119|			else
 2698|    119|				return (-1);/* Invalid data. */
 2699|    394|		} else
 2700|  44.8k|			lzh_br_consume(br, 3);
  ------------------
  |  | 1987|  44.8k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2701|  45.1k|		ds->pt.bitlen[i++] = c;
 2702|  45.1k|		ds->pt.freq[c]++;
 2703|  45.1k|	}
 2704|  8.75k|	return (i);
 2705|  9.00k|}
archive_read_support_format_lha.c:lzh_make_huffman_table:
 2724|  7.71k|{
 2725|  7.71k|	uint16_t *tbl;
 2726|  7.71k|	const unsigned char *bitlen;
 2727|  7.71k|	int bitptn[17], weight[17];
 2728|  7.71k|	int i, maxbits = 0, ptn, tbl_size, w;
 2729|  7.71k|	int diffbits, len_avail;
 2730|       |
 2731|       |	/*
 2732|       |	 * Initialize bit patterns.
 2733|       |	 */
 2734|  7.71k|	ptn = 0;
 2735|   131k|	for (i = 1, w = 1 << 15; i <= 16; i++, w >>= 1) {
  ------------------
  |  Branch (2735:27): [True: 123k, False: 7.71k]
  ------------------
 2736|   123k|		bitptn[i] = ptn;
 2737|   123k|		weight[i] = w;
 2738|   123k|		if (hf->freq[i]) {
  ------------------
  |  Branch (2738:7): [True: 25.3k, False: 98.0k]
  ------------------
 2739|  25.3k|			ptn += hf->freq[i] * w;
 2740|  25.3k|			maxbits = i;
 2741|  25.3k|		}
 2742|   123k|	}
 2743|  7.71k|	if (ptn != 0x10000 || maxbits > hf->tbl_bits)
  ------------------
  |  Branch (2743:6): [True: 1.13k, False: 6.58k]
  |  Branch (2743:24): [True: 0, False: 6.58k]
  ------------------
 2744|  1.13k|		return (0);/* Invalid */
 2745|       |
 2746|  6.58k|	hf->max_bits = maxbits;
 2747|       |
 2748|       |	/*
 2749|       |	 * Cut out extra bits which we won't house in the table.
 2750|       |	 * This preparation reduces the same calculation in the for-loop
 2751|       |	 * making the table.
 2752|       |	 */
 2753|  6.58k|	if (maxbits < 16) {
  ------------------
  |  Branch (2753:6): [True: 6.58k, False: 0]
  ------------------
 2754|  6.58k|		int ebits = 16 - maxbits;
 2755|  37.4k|		for (i = 1; i <= maxbits; i++) {
  ------------------
  |  Branch (2755:15): [True: 30.8k, False: 6.58k]
  ------------------
 2756|  30.8k|			bitptn[i] >>= ebits;
 2757|  30.8k|			weight[i] >>= ebits;
 2758|  30.8k|		}
 2759|  6.58k|	}
 2760|  6.58k|	if (maxbits > HTBL_BITS) {
  ------------------
  |  |  114|  6.58k|#define HTBL_BITS	10
  ------------------
  |  Branch (2760:6): [True: 0, False: 6.58k]
  ------------------
 2761|      0|		unsigned htbl_max;
 2762|      0|		uint16_t *p;
 2763|       |
 2764|      0|		diffbits = maxbits - HTBL_BITS;
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
 2765|      0|		for (i = 1; i <= HTBL_BITS; i++) {
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
  |  Branch (2765:15): [True: 0, False: 0]
  ------------------
 2766|      0|			bitptn[i] >>= diffbits;
 2767|      0|			weight[i] >>= diffbits;
 2768|      0|		}
 2769|      0|		htbl_max = bitptn[HTBL_BITS] +
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
 2770|      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
  ------------------
 2771|      0|		p = &(hf->tbl[htbl_max]);
 2772|      0|		while (p < &hf->tbl[1U<<HTBL_BITS])
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
  |  Branch (2772:10): [True: 0, False: 0]
  ------------------
 2773|      0|			*p++ = 0;
 2774|      0|	} else
 2775|  6.58k|		diffbits = 0;
 2776|  6.58k|	hf->shift_bits = diffbits;
 2777|       |
 2778|       |	/*
 2779|       |	 * Make the table.
 2780|       |	 */
 2781|  6.58k|	tbl_size = 1 << HTBL_BITS;
  ------------------
  |  |  114|  6.58k|#define HTBL_BITS	10
  ------------------
 2782|  6.58k|	tbl = hf->tbl;
 2783|  6.58k|	bitlen = hf->bitlen;
 2784|  6.58k|	len_avail = hf->len_avail;
 2785|  6.58k|	hf->tree_used = 0;
 2786|   604k|	for (i = 0; i < len_avail; i++) {
  ------------------
  |  Branch (2786:14): [True: 597k, False: 6.58k]
  ------------------
 2787|   597k|		uint16_t *p;
 2788|   597k|		int len, cnt;
 2789|   597k|		uint16_t bit;
 2790|   597k|		int extlen;
 2791|   597k|		struct htree_t *ht;
 2792|       |
 2793|   597k|		if (bitlen[i] == 0)
  ------------------
  |  Branch (2793:7): [True: 502k, False: 95.7k]
  ------------------
 2794|   502k|			continue;
 2795|       |		/* Get a bit pattern */
 2796|  95.7k|		len = bitlen[i];
 2797|  95.7k|		ptn = bitptn[len];
 2798|  95.7k|		cnt = weight[len];
 2799|  95.7k|		if (len <= HTBL_BITS) {
  ------------------
  |  |  114|  95.7k|#define HTBL_BITS	10
  ------------------
  |  Branch (2799:7): [True: 95.7k, False: 0]
  ------------------
 2800|       |			/* Calculate next bit pattern */
 2801|  95.7k|			if ((bitptn[len] = ptn + cnt) > tbl_size)
  ------------------
  |  Branch (2801:8): [True: 0, False: 95.7k]
  ------------------
 2802|      0|				return (0);/* Invalid */
 2803|       |			/* Update the table */
 2804|  95.7k|			p = &(tbl[ptn]);
 2805|  95.7k|			if (cnt > 7) {
  ------------------
  |  Branch (2805:8): [True: 15.2k, False: 80.4k]
  ------------------
 2806|  15.2k|				uint16_t *pc;
 2807|       |
 2808|  15.2k|				cnt -= 8;
 2809|  15.2k|				pc = &p[cnt];
 2810|  15.2k|				pc[0] = (uint16_t)i;
 2811|  15.2k|				pc[1] = (uint16_t)i;
 2812|  15.2k|				pc[2] = (uint16_t)i;
 2813|  15.2k|				pc[3] = (uint16_t)i;
 2814|  15.2k|				pc[4] = (uint16_t)i;
 2815|  15.2k|				pc[5] = (uint16_t)i;
 2816|  15.2k|				pc[6] = (uint16_t)i;
 2817|  15.2k|				pc[7] = (uint16_t)i;
 2818|  15.2k|				if (cnt > 7) {
  ------------------
  |  Branch (2818:9): [True: 6.61k, False: 8.58k]
  ------------------
 2819|  6.61k|					cnt -= 8;
 2820|  6.61k|					memcpy(&p[cnt], pc,
 2821|  6.61k|						8 * sizeof(uint16_t));
 2822|  6.61k|					pc = &p[cnt];
 2823|  6.63k|					while (cnt > 15) {
  ------------------
  |  Branch (2823:13): [True: 12, False: 6.61k]
  ------------------
 2824|     12|						cnt -= 16;
 2825|     12|						memcpy(&p[cnt], pc,
 2826|     12|							16 * sizeof(uint16_t));
 2827|     12|					}
 2828|  6.61k|				}
 2829|  15.2k|				if (cnt)
  ------------------
  |  Branch (2829:9): [True: 0, False: 15.2k]
  ------------------
 2830|      0|					memcpy(p, pc, cnt * sizeof(uint16_t));
 2831|  80.4k|			} else {
 2832|   165k|				while (cnt > 1) {
  ------------------
  |  Branch (2832:12): [True: 84.8k, False: 80.4k]
  ------------------
 2833|  84.8k|					p[--cnt] = (uint16_t)i;
 2834|  84.8k|					p[--cnt] = (uint16_t)i;
 2835|  84.8k|				}
 2836|  80.4k|				if (cnt)
  ------------------
  |  Branch (2836:9): [True: 13.1k, False: 67.3k]
  ------------------
 2837|  13.1k|					p[--cnt] = (uint16_t)i;
 2838|  80.4k|			}
 2839|  95.7k|			continue;
 2840|  95.7k|		}
 2841|       |
 2842|       |		/*
 2843|       |		 * A bit length is too big to be housed to a direct table,
 2844|       |		 * so we use a tree model for its extra bits.
 2845|       |		 */
 2846|      0|		bitptn[len] = ptn + cnt;
 2847|      0|		bit = 1U << (diffbits -1);
 2848|      0|		extlen = len - HTBL_BITS;
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
 2849|       |		
 2850|      0|		p = &(tbl[ptn >> diffbits]);
 2851|      0|		if (*p == 0) {
  ------------------
  |  Branch (2851:7): [True: 0, False: 0]
  ------------------
 2852|      0|			*p = len_avail + hf->tree_used;
 2853|      0|			ht = &(hf->tree[hf->tree_used++]);
 2854|      0|			if (hf->tree_used > hf->tree_avail)
  ------------------
  |  Branch (2854:8): [True: 0, False: 0]
  ------------------
 2855|      0|				return (0);/* Invalid */
 2856|      0|			ht->left = 0;
 2857|      0|			ht->right = 0;
 2858|      0|		} else {
 2859|      0|			if (*p < len_avail ||
  ------------------
  |  Branch (2859:8): [True: 0, False: 0]
  ------------------
 2860|      0|			    *p >= (len_avail + hf->tree_used))
  ------------------
  |  Branch (2860:8): [True: 0, False: 0]
  ------------------
 2861|      0|				return (0);/* Invalid */
 2862|      0|			ht = &(hf->tree[*p - len_avail]);
 2863|      0|		}
 2864|      0|		while (--extlen > 0) {
  ------------------
  |  Branch (2864:10): [True: 0, False: 0]
  ------------------
 2865|      0|			if (ptn & bit) {
  ------------------
  |  Branch (2865:8): [True: 0, False: 0]
  ------------------
 2866|      0|				if (ht->left < len_avail) {
  ------------------
  |  Branch (2866:9): [True: 0, False: 0]
  ------------------
 2867|      0|					ht->left = len_avail + hf->tree_used;
 2868|      0|					ht = &(hf->tree[hf->tree_used++]);
 2869|      0|					if (hf->tree_used > hf->tree_avail)
  ------------------
  |  Branch (2869:10): [True: 0, False: 0]
  ------------------
 2870|      0|						return (0);/* Invalid */
 2871|      0|					ht->left = 0;
 2872|      0|					ht->right = 0;
 2873|      0|				} else {
 2874|      0|					ht = &(hf->tree[ht->left - len_avail]);
 2875|      0|				}
 2876|      0|			} else {
 2877|      0|				if (ht->right < len_avail) {
  ------------------
  |  Branch (2877:9): [True: 0, False: 0]
  ------------------
 2878|      0|					ht->right = len_avail + hf->tree_used;
 2879|      0|					ht = &(hf->tree[hf->tree_used++]);
 2880|      0|					if (hf->tree_used > hf->tree_avail)
  ------------------
  |  Branch (2880:10): [True: 0, False: 0]
  ------------------
 2881|      0|						return (0);/* Invalid */
 2882|      0|					ht->left = 0;
 2883|      0|					ht->right = 0;
 2884|      0|				} else {
 2885|      0|					ht = &(hf->tree[ht->right - len_avail]);
 2886|      0|				}
 2887|      0|			}
 2888|      0|			bit >>= 1;
 2889|      0|		}
 2890|      0|		if (ptn & bit) {
  ------------------
  |  Branch (2890:7): [True: 0, False: 0]
  ------------------
 2891|      0|			if (ht->left != 0)
  ------------------
  |  Branch (2891:8): [True: 0, False: 0]
  ------------------
 2892|      0|				return (0);/* Invalid */
 2893|      0|			ht->left = (uint16_t)i;
 2894|      0|		} else {
 2895|      0|			if (ht->right != 0)
  ------------------
  |  Branch (2895:8): [True: 0, False: 0]
  ------------------
 2896|      0|				return (0);/* Invalid */
 2897|      0|			ht->right = (uint16_t)i;
 2898|      0|		}
 2899|      0|	}
 2900|  6.58k|	return (1);
 2901|  6.58k|}
archive_read_support_format_lha.c:lzh_decode_huffman:
 2925|  23.0M|{
 2926|  23.0M|	int c;
 2927|       |	/*
 2928|       |	 * At first search an index table for a bit pattern.
 2929|       |	 * If it fails, search a huffman tree for.
 2930|       |	 */
 2931|  23.0M|	c = hf->tbl[rbits >> hf->shift_bits];
 2932|  23.0M|	if (c < hf->len_avail || hf->len_avail == 0)
  ------------------
  |  Branch (2932:6): [True: 520k, False: 22.4M]
  |  Branch (2932:27): [True: 22.4M, False: 0]
  ------------------
 2933|  23.0M|		return (c);
 2934|       |	/* This bit pattern needs to be found out at a huffman tree. */
 2935|      0|	return (lzh_decode_huffman_tree(hf, rbits, c));
 2936|  23.0M|}
archive_read_support_format_lha.c:lzh_decode_blocks:
 2377|  11.8k|{
 2378|  11.8k|	struct lzh_dec *ds = strm->ds;
 2379|  11.8k|	struct lzh_br bre = ds->br;
 2380|  11.8k|	struct huffman *lt = &(ds->lt);
 2381|  11.8k|	struct huffman *pt = &(ds->pt);
 2382|  11.8k|	unsigned char *w_buff = ds->w_buff;
 2383|  11.8k|	unsigned char *lt_bitlen = lt->bitlen;
 2384|  11.8k|	unsigned char *pt_bitlen = pt->bitlen;
 2385|  11.8k|	int blocks_avail = ds->blocks_avail, c = 0;
 2386|  11.8k|	int copy_len = ds->copy_len, copy_pos = ds->copy_pos;
 2387|  11.8k|	int w_pos = ds->w_pos, w_mask = ds->w_mask, w_size = ds->w_size;
 2388|  11.8k|	int lt_max_bits = lt->max_bits, pt_max_bits = pt->max_bits;
 2389|  11.8k|	int state = ds->state;
 2390|       |
 2391|  8.54M|	for (;;) {
 2392|  8.54M|		switch (state) {
  ------------------
  |  Branch (2392:11): [True: 8.54M, False: 0]
  ------------------
 2393|  8.53M|		case ST_GET_LITERAL:
  ------------------
  |  | 2107|  8.53M|#define ST_GET_LITERAL		9
  ------------------
  |  Branch (2393:3): [True: 8.53M, False: 8.81k]
  ------------------
 2394|  14.3M|			for (;;) {
 2395|  14.3M|				if (blocks_avail == 0) {
  ------------------
  |  Branch (2395:9): [True: 2.09k, False: 14.3M]
  ------------------
 2396|       |					/* We have decoded all blocks.
 2397|       |					 * Let's handle next blocks. */
 2398|  2.09k|					ds->state = ST_RD_BLOCK;
  ------------------
  |  | 2098|  2.09k|#define ST_RD_BLOCK		0
  ------------------
 2399|  2.09k|					ds->br = bre;
 2400|  2.09k|					ds->blocks_avail = 0;
 2401|  2.09k|					ds->w_pos = w_pos;
 2402|  2.09k|					ds->copy_pos = 0;
 2403|  2.09k|					return (100);
 2404|  2.09k|				}
 2405|       |
 2406|       |				/* lzh_br_read_ahead() always tries to fill the
 2407|       |				 * cache buffer up. In specific situation we
 2408|       |				 * are close to the end of the data, the cache
 2409|       |				 * buffer will not be full and thus we have to
 2410|       |				 * determine if the cache buffer has some bits
 2411|       |				 * as much as we need after lzh_br_read_ahead()
 2412|       |				 * failed. */
 2413|  14.3M|				if (!lzh_br_read_ahead(strm, &bre,
  ------------------
  |  | 1984|  14.3M|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1979|  28.7M|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1965|  28.7M|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1965:27): [True: 14.3M, False: 15.8k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1979:26): [True: 14.0k, False: 1.81k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1965|  1.81k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1965:27): [True: 490, False: 1.32k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2414|  14.3M|				    lt_max_bits)) {
 2415|  1.32k|					if (!last)
  ------------------
  |  Branch (2415:10): [True: 1, False: 1.32k]
  ------------------
 2416|      1|						goto next_data;
 2417|       |					/* Remaining bits are less than
 2418|       |					 * maximum bits(lt.max_bits) but maybe
 2419|       |					 * it still remains as much as we need,
 2420|       |					 * so we should try to use it with
 2421|       |					 * dummy bits. */
 2422|  1.32k|					c = lzh_decode_huffman(lt,
 2423|  1.32k|					      lzh_br_bits_forced(&bre,
  ------------------
  |  | 1971|  1.32k|	(((uint16_t)((br)->cache_buffer <<		\
  |  | 1972|  1.32k|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 2424|  1.32k|					        lt_max_bits));
 2425|  1.32k|					lzh_br_consume(&bre, lt_bitlen[c]);
  ------------------
  |  | 1987|  1.32k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2426|  1.32k|					if (!lzh_br_has(&bre, 0))
  ------------------
  |  | 1965|  1.32k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (2426:10): [True: 429, False: 894]
  ------------------
 2427|    429|						goto failed;/* Over read. */
 2428|  14.3M|				} else {
 2429|  14.3M|					c = lzh_decode_huffman(lt,
 2430|  14.3M|					      lzh_br_bits(&bre, lt_max_bits));
  ------------------
  |  | 1968|  14.3M|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1969|  14.3M|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2431|  14.3M|					lzh_br_consume(&bre, lt_bitlen[c]);
  ------------------
  |  | 1987|  14.3M|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2432|  14.3M|				}
 2433|  14.3M|				blocks_avail--;
 2434|  14.3M|				if ((unsigned int)c > UCHAR_MAX)
  ------------------
  |  Branch (2434:9): [True: 8.53M, False: 5.82M]
  ------------------
 2435|       |					/* Current block is a match data. */
 2436|  8.53M|					break;
 2437|       |				/*
 2438|       |				 * 'c' is exactly a literal code.
 2439|       |				 */
 2440|       |				/* Save a decoded code to reference it
 2441|       |				 * afterward. */
 2442|  5.82M|				w_buff[w_pos] = c;
 2443|  5.82M|				if (++w_pos >= w_size) {
  ------------------
  |  Branch (2443:9): [True: 1, False: 5.82M]
  ------------------
 2444|      1|					w_pos = 0;
 2445|      1|					lzh_emit_window(strm, w_size);
 2446|      1|					goto next_data;
 2447|      1|				}
 2448|  5.82M|			}
 2449|       |			/* 'c' is the length of a match pattern we have
 2450|       |			 * already extracted, which has be stored in
 2451|       |			 * window(ds->w_buff). */
 2452|  8.53M|			copy_len = c - (UCHAR_MAX + 1) + MINMATCH;
  ------------------
  |  |   51|  8.53M|#define MINMATCH		3	/* Minimum match length. */
  ------------------
 2453|       |			/* FALL THROUGH */
 2454|  8.53M|		case ST_GET_POS_1:
  ------------------
  |  | 2108|  8.53M|#define ST_GET_POS_1		10
  ------------------
  |  Branch (2454:3): [True: 0, False: 8.54M]
  ------------------
 2455|       |			/*
 2456|       |			 * Get a reference position. 
 2457|       |			 */
 2458|  8.53M|			if (!lzh_br_read_ahead(strm, &bre, pt_max_bits)) {
  ------------------
  |  | 1984|  8.53M|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1979|  17.0M|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1965|  17.0M|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1965:27): [True: 8.52M, False: 8.52k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1979:26): [True: 8.50k, False: 14]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1965|     14|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1965:27): [True: 4, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2459|     10|				if (!last) {
  ------------------
  |  Branch (2459:9): [True: 3, False: 7]
  ------------------
 2460|      3|					state = ST_GET_POS_1;
  ------------------
  |  | 2108|      3|#define ST_GET_POS_1		10
  ------------------
 2461|      3|					ds->copy_len = copy_len;
 2462|      3|					goto next_data;
 2463|      3|				}
 2464|      7|				copy_pos = lzh_decode_huffman(pt,
 2465|      7|				    lzh_br_bits_forced(&bre, pt_max_bits));
  ------------------
  |  | 1971|      7|	(((uint16_t)((br)->cache_buffer <<		\
  |  | 1972|      7|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 2466|      7|				lzh_br_consume(&bre, pt_bitlen[copy_pos]);
  ------------------
  |  | 1987|      7|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2467|      7|				if (!lzh_br_has(&bre, 0))
  ------------------
  |  | 1965|      7|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (2467:9): [True: 1, False: 6]
  ------------------
 2468|      1|					goto failed;/* Over read. */
 2469|  8.53M|			} else {
 2470|  8.53M|				copy_pos = lzh_decode_huffman(pt,
 2471|  8.53M|				    lzh_br_bits(&bre, pt_max_bits));
  ------------------
  |  | 1968|  8.53M|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1969|  8.53M|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2472|  8.53M|				lzh_br_consume(&bre, pt_bitlen[copy_pos]);
  ------------------
  |  | 1987|  8.53M|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2473|  8.53M|			}
 2474|       |			/* FALL THROUGH */
 2475|  8.53M|		case ST_GET_POS_2:
  ------------------
  |  | 2109|  8.53M|#define ST_GET_POS_2		11
  ------------------
  |  Branch (2475:3): [True: 0, False: 8.54M]
  ------------------
 2476|  8.53M|			if (copy_pos > 1) {
  ------------------
  |  Branch (2476:8): [True: 42.2k, False: 8.49M]
  ------------------
 2477|       |				/* We need an additional adjustment number to
 2478|       |				 * the position. */
 2479|  42.2k|				int p = copy_pos - 1;
 2480|  42.2k|				if (!lzh_br_read_ahead(strm, &bre, p)) {
  ------------------
  |  | 1984|  42.2k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1979|  84.5k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1965|  84.5k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1965:27): [True: 41.2k, False: 1.07k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1979:26): [True: 1.06k, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1965|      4|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1965:27): [True: 0, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2481|      4|					if (last)
  ------------------
  |  Branch (2481:10): [True: 4, False: 0]
  ------------------
 2482|      4|						goto failed;/* Truncated data.*/
 2483|      0|					state = ST_GET_POS_2;
  ------------------
  |  | 2109|      0|#define ST_GET_POS_2		11
  ------------------
 2484|      0|					ds->copy_len = copy_len;
 2485|      0|					ds->copy_pos = copy_pos;
 2486|      0|					goto next_data;
 2487|      4|				}
 2488|  42.2k|				copy_pos = (1 << p) + lzh_br_bits(&bre, p);
  ------------------
  |  | 1968|  42.2k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1969|  42.2k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2489|  42.2k|				lzh_br_consume(&bre, p);
  ------------------
  |  | 1987|  42.2k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2490|  42.2k|			}
 2491|       |			/* The position is actually a distance from the last
 2492|       |			 * code we had extracted and thus we have to convert
 2493|       |			 * it to a position of the window. */
 2494|  8.53M|			copy_pos = (w_pos - copy_pos - 1) & w_mask;
 2495|       |			/* FALL THROUGH */
 2496|  8.54M|		case ST_COPY_DATA:
  ------------------
  |  | 2110|  8.54M|#define ST_COPY_DATA		12
  ------------------
  |  Branch (2496:3): [True: 8.81k, False: 8.53M]
  ------------------
 2497|       |			/*
 2498|       |			 * Copy `copy_len' bytes as extracted data from
 2499|       |			 * the window into the output buffer.
 2500|       |			 */
 2501|  8.55M|			for (;;) {
 2502|  8.55M|				int l;
 2503|       |
 2504|  8.55M|				l = copy_len;
 2505|  8.55M|				if (copy_pos > w_pos) {
  ------------------
  |  Branch (2505:9): [True: 10.0k, False: 8.54M]
  ------------------
 2506|  10.0k|					if (l > w_size - copy_pos)
  ------------------
  |  Branch (2506:10): [True: 9.80k, False: 255]
  ------------------
 2507|  9.80k|						l = w_size - copy_pos;
 2508|  8.54M|				} else {
 2509|  8.54M|					if (l > w_size - w_pos)
  ------------------
  |  Branch (2509:10): [True: 8.81k, False: 8.53M]
  ------------------
 2510|  8.81k|						l = w_size - w_pos;
 2511|  8.54M|				}
 2512|  8.55M|				if ((copy_pos + l < w_pos)
  ------------------
  |  Branch (2512:9): [True: 6.37k, False: 8.54M]
  ------------------
 2513|  8.54M|				    || (w_pos + l < copy_pos)) {
  ------------------
  |  Branch (2513:12): [True: 10.0k, False: 8.53M]
  ------------------
 2514|       |					/* No overlap. */
 2515|  16.4k|					memcpy(w_buff + w_pos,
 2516|  16.4k|					    w_buff + copy_pos, l);
 2517|  8.53M|				} else {
 2518|  8.53M|					const unsigned char *s;
 2519|  8.53M|					unsigned char *d;
 2520|  8.53M|					int li;
 2521|       |
 2522|  8.53M|					d = w_buff + w_pos;
 2523|  8.53M|					s = w_buff + copy_pos;
 2524|   621M|					for (li = 0; li < l-1;) {
  ------------------
  |  Branch (2524:19): [True: 612M, False: 8.53M]
  ------------------
 2525|   612M|						d[li] = s[li];li++;
 2526|   612M|						d[li] = s[li];li++;
 2527|   612M|					}
 2528|  8.53M|					if (li < l)
  ------------------
  |  Branch (2528:10): [True: 8.31M, False: 221k]
  ------------------
 2529|  8.31M|						d[li] = s[li];
 2530|  8.53M|				}
 2531|  8.55M|				w_pos += l;
 2532|  8.55M|				if (w_pos == w_size) {
  ------------------
  |  Branch (2532:9): [True: 9.34k, False: 8.54M]
  ------------------
 2533|  9.34k|					w_pos = 0;
 2534|  9.34k|					lzh_emit_window(strm, w_size);
 2535|  9.34k|					if (copy_len <= l)
  ------------------
  |  Branch (2535:10): [True: 537, False: 8.81k]
  ------------------
 2536|    537|						state = ST_GET_LITERAL;
  ------------------
  |  | 2107|    537|#define ST_GET_LITERAL		9
  ------------------
 2537|  8.81k|					else {
 2538|  8.81k|						state = ST_COPY_DATA;
  ------------------
  |  | 2110|  8.81k|#define ST_COPY_DATA		12
  ------------------
 2539|  8.81k|						ds->copy_len = copy_len - l;
 2540|  8.81k|						ds->copy_pos =
 2541|  8.81k|						    (copy_pos + l) & w_mask;
 2542|  8.81k|					}
 2543|  9.34k|					goto next_data;
 2544|  9.34k|				}
 2545|  8.54M|				if (copy_len <= l)
  ------------------
  |  Branch (2545:9): [True: 8.53M, False: 9.80k]
  ------------------
 2546|       |					/* A copy of current pattern ended. */
 2547|  8.53M|					break;
 2548|  9.80k|				copy_len -= l;
 2549|  9.80k|				copy_pos = (copy_pos + l) & w_mask;
 2550|  9.80k|			}
 2551|  8.53M|			state = ST_GET_LITERAL;
  ------------------
  |  | 2107|  8.53M|#define ST_GET_LITERAL		9
  ------------------
 2552|  8.53M|			break;
 2553|  8.54M|		}
 2554|  8.54M|	}
 2555|    434|failed:
 2556|    434|	return (ds->error = ARCHIVE_FAILED);
  ------------------
  |  |  237|    434|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2557|  9.35k|next_data:
 2558|  9.35k|	ds->br = bre;
 2559|  9.35k|	ds->blocks_avail = blocks_avail;
 2560|  9.35k|	ds->state = state;
 2561|  9.35k|	ds->w_pos = w_pos;
 2562|  9.35k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  9.35k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2563|  11.8k|}
archive_read_support_format_lha.c:lha_read_data_none:
 1508|    300|{
 1509|    300|	struct lha *lha = (struct lha *)(a->format->data);
 1510|    300|	ssize_t bytes_avail;
 1511|       |
 1512|    300|	if (lha->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (1512:6): [True: 0, False: 300]
  ------------------
 1513|      0|		*buff = NULL;
 1514|      0|		*size = 0;
 1515|      0|		*offset = lha->entry_offset;
 1516|      0|		lha->end_of_entry = 1;
 1517|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1518|      0|	}
 1519|       |	/*
 1520|       |	 * Note: '1' here is a performance optimization.
 1521|       |	 * Recall that the decompression layer returns a count of
 1522|       |	 * available bytes; asking for more than that forces the
 1523|       |	 * decompressor to combine reads by copying data.
 1524|       |	 */
 1525|    300|	*buff = __archive_read_ahead(a, 1, &bytes_avail);
 1526|    300|	if (bytes_avail <= 0) {
  ------------------
  |  Branch (1526:6): [True: 0, False: 300]
  ------------------
 1527|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1528|      0|		    "Truncated LHa file data");
 1529|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1530|      0|	}
 1531|    300|	if (bytes_avail > lha->entry_bytes_remaining)
  ------------------
  |  Branch (1531:6): [True: 300, False: 0]
  ------------------
 1532|    300|		bytes_avail = (ssize_t)lha->entry_bytes_remaining;
 1533|    300|	lha->entry_crc_calculated =
 1534|    300|	    lha_crc16(lha->entry_crc_calculated, *buff, bytes_avail);
 1535|    300|	*size = bytes_avail;
 1536|    300|	*offset = lha->entry_offset;
 1537|    300|	lha->entry_offset += bytes_avail;
 1538|    300|	lha->entry_bytes_remaining -= bytes_avail;
 1539|    300|	if (lha->entry_bytes_remaining == 0)
  ------------------
  |  Branch (1539:6): [True: 300, False: 0]
  ------------------
 1540|    300|		lha->end_of_entry = 1;
 1541|    300|	lha->entry_unconsumed = bytes_avail;
 1542|    300|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    300|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1543|    300|}
archive_read_support_format_lha.c:archive_read_format_lha_read_data_skip:
 1645|  2.99k|{
 1646|  2.99k|	struct lha *lha;
 1647|  2.99k|	int64_t bytes_skipped;
 1648|       |
 1649|  2.99k|	lha = (struct lha *)(a->format->data);
 1650|       |
 1651|  2.99k|	if (lha->entry_unconsumed) {
  ------------------
  |  Branch (1651:6): [True: 0, False: 2.99k]
  ------------------
 1652|       |		/* Consume as much as the decompressor actually used. */
 1653|      0|		__archive_read_consume(a, lha->entry_unconsumed);
 1654|      0|		lha->entry_unconsumed = 0;
 1655|      0|	}
 1656|       |
 1657|       |	/* if we've already read to end of data, we're done. */
 1658|  2.99k|	if (lha->end_of_entry_cleanup)
  ------------------
  |  Branch (1658:6): [True: 758, False: 2.23k]
  ------------------
 1659|    758|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    758|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1660|       |
 1661|       |	/*
 1662|       |	 * If the length is at the beginning, we can skip the
 1663|       |	 * compressed data much more quickly.
 1664|       |	 */
 1665|  2.23k|	bytes_skipped = __archive_read_consume(a, lha->entry_bytes_remaining);
 1666|  2.23k|	if (bytes_skipped < 0)
  ------------------
  |  Branch (1666:6): [True: 4, False: 2.22k]
  ------------------
 1667|      4|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1668|       |
 1669|       |	/* This entry is finished and done. */
 1670|  2.22k|	lha->end_of_entry_cleanup = lha->end_of_entry = 1;
 1671|  2.22k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.22k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1672|  2.23k|}
archive_read_support_format_lha.c:archive_read_format_lha_cleanup:
 1676|  2.49k|{
 1677|  2.49k|	struct lha *lha = (struct lha *)(a->format->data);
 1678|       |
 1679|  2.49k|	lzh_decode_free(&(lha->strm));
 1680|  2.49k|	archive_string_free(&(lha->dirname));
 1681|  2.49k|	archive_string_free(&(lha->filename));
 1682|  2.49k|	archive_string_free(&(lha->uname));
 1683|  2.49k|	archive_string_free(&(lha->gname));
 1684|  2.49k|	archive_wstring_free(&(lha->ws));
 1685|  2.49k|	free(lha);
 1686|  2.49k|	(a->format->data) = NULL;
 1687|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1688|  2.49k|}
archive_read_support_format_lha.c:lzh_decode_free:
 1950|  2.49k|{
 1951|       |
 1952|  2.49k|	if (strm->ds == NULL)
  ------------------
  |  Branch (1952:6): [True: 2.44k, False: 52]
  ------------------
 1953|  2.44k|		return;
 1954|     52|	free(strm->ds->w_buff);
 1955|     52|	lzh_huffman_free(&(strm->ds->lt));
 1956|     52|	lzh_huffman_free(&(strm->ds->pt));
 1957|     52|	free(strm->ds);
 1958|       |	strm->ds = NULL;
 1959|     52|}
archive_read_support_format_lha.c:lzh_huffman_free:
 2597|    104|{
 2598|    104|	free(hf->bitlen);
 2599|    104|	free(hf->tbl);
 2600|    104|	free(hf->tree);
 2601|    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.45k|{
  676|  2.45k|	const char *signature = "#mtree";
  677|  2.45k|	const char *p;
  678|       |
  679|  2.45k|	(void)best_bid; /* UNUSED */
  680|       |
  681|       |	/* Now let's look at the actual header and see if it matches. */
  682|  2.45k|	p = __archive_read_ahead(a, strlen(signature), NULL);
  683|  2.45k|	if (p == NULL)
  ------------------
  |  Branch (683:6): [True: 19, False: 2.43k]
  ------------------
  684|     19|		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: 0, 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: 588, False: 1.06k]
  ------------------
  747|    588|			int last_is_path, keywords;
  748|       |
  749|    588|			keywords = bid_entry(p, len, nl, &last_is_path);
  750|    588|			if (keywords >= 0) {
  ------------------
  |  Branch (750:8): [True: 422, False: 166]
  ------------------
  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|    166|				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.93k|#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: 9, False: 33.5M]
  ------------------
  380|      9|		*nl = 0;
  381|      9|		len = 0;
  382|      9|	} 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.21k, False: 33.5M]
  |  Branch (387:21): [True: 43, False: 2.17k]
  |  Branch (387:38): [True: 43, False: 0]
  ------------------
  388|     43|		ssize_t diff = *ravail - *avail;
  389|     43|		size_t nbytes_req = (*ravail+1023) & ~1023U;
  390|     43|		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|     43|		if (len >= MAX_LINE_LEN)
  ------------------
  |  |   83|     43|#define	MAX_LINE_LEN		(1024 * 1024)
  ------------------
  |  Branch (397:7): [True: 1, False: 42]
  ------------------
  398|      1|			return (-1);
  399|       |
  400|       |		/* Increase reading bytes if it is not enough for at least
  401|       |		 * two new lines. */
  402|     42|		if (nbytes_req < (size_t)*ravail + 160)
  ------------------
  |  Branch (402:7): [True: 20, False: 22]
  ------------------
  403|     20|			nbytes_req <<= 1;
  404|       |
  405|     42|		*b = __archive_read_ahead(a, nbytes_req, avail);
  406|     42|		if (*b == NULL) {
  ------------------
  |  Branch (406:7): [True: 24, False: 18]
  ------------------
  407|     24|			if (*ravail >= *avail)
  ------------------
  |  Branch (407:8): [True: 24, False: 0]
  ------------------
  408|     24|				return (0);
  409|       |			/* Reading bytes reaches the end of file. */
  410|      0|			*b = __archive_read_ahead(a, *avail, avail);
  411|      0|			quit = 1;
  412|      0|		}
  413|     18|		*ravail = *avail;
  414|     18|		*b += diff;
  415|     18|		*avail -= diff;
  416|     18|		tested = len;/* Skip some bytes we already determined. */
  417|     18|		len = get_line_size(*b + len, *avail - len, nl);
  418|     18|		if (len >= 0)
  ------------------
  |  Branch (418:7): [True: 12, False: 6]
  ------------------
  419|     12|			len += tested;
  420|     18|	}
  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: 34]
  ------------------
  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: 9]
  |  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.35k, 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|     34|	if (nlsize != NULL)
  ------------------
  |  Branch (357:6): [True: 34, False: 0]
  ------------------
  358|     34|		*nlsize = 0;
  359|     34|	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.47k|	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.94k|		while (len >0 && (*p == ' ' || *p == '\t')) {
  ------------------
  |  Branch (539:10): [True: 3.94k, False: 0]
  |  Branch (539:21): [True: 1.51k, 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.24k]
  |  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: 531]
  ------------------
  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|    567|		l = bid_keyword(p, len);
  560|    567|		if (l == 0)
  ------------------
  |  Branch (560:7): [True: 21, False: 546]
  ------------------
  561|     21|			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|    567|{
  463|    567|	static const char * const keys_c[] = {
  464|    567|		"content", "contents", "cksum", NULL
  465|    567|	};
  466|    567|	static const char * const keys_df[] = {
  467|    567|		"device", "flags", NULL
  468|    567|	};
  469|    567|	static const char * const keys_g[] = {
  470|    567|		"gid", "gname", NULL
  471|    567|	};
  472|    567|	static const char * const keys_il[] = {
  473|    567|		"ignore", "inode", "link", NULL
  474|    567|	};
  475|    567|	static const char * const keys_m[] = {
  476|    567|		"md5", "md5digest", "mode", NULL
  477|    567|	};
  478|    567|	static const char * const keys_no[] = {
  479|    567|		"nlink", "nochange", "optional", NULL
  480|    567|	};
  481|    567|	static const char * const keys_r[] = {
  482|    567|		"resdevice", "rmd160", "rmd160digest", NULL
  483|    567|	};
  484|    567|	static const char * const keys_s[] = {
  485|    567|		"sha1", "sha1digest",
  486|    567|		"sha256", "sha256digest",
  487|    567|		"sha384", "sha384digest",
  488|    567|		"sha512", "sha512digest",
  489|    567|		"size", NULL
  490|    567|	};
  491|    567|	static const char * const keys_t[] = {
  492|    567|		"tags", "time", "type", NULL
  493|    567|	};
  494|    567|	static const char * const keys_u[] = {
  495|    567|		"uid", "uname",	NULL
  496|    567|	};
  497|    567|	const char * const *keys;
  498|    567|	int i;
  499|       |
  500|    567|	switch (*p) {
  501|      1|	case 'c': keys = keys_c; break;
  ------------------
  |  Branch (501:2): [True: 1, False: 566]
  ------------------
  502|      4|	case 'd': case 'f': keys = keys_df; break;
  ------------------
  |  Branch (502:2): [True: 4, False: 563]
  |  Branch (502:12): [True: 0, False: 567]
  ------------------
  503|    500|	case 'g': keys = keys_g; break;
  ------------------
  |  Branch (503:2): [True: 500, False: 67]
  ------------------
  504|      0|	case 'i': case 'l': keys = keys_il; break;
  ------------------
  |  Branch (504:2): [True: 0, False: 567]
  |  Branch (504:12): [True: 0, False: 567]
  ------------------
  505|      6|	case 'm': keys = keys_m; break;
  ------------------
  |  Branch (505:2): [True: 6, False: 561]
  ------------------
  506|      2|	case 'n': case 'o': keys = keys_no; break;
  ------------------
  |  Branch (506:2): [True: 2, False: 565]
  |  Branch (506:12): [True: 0, False: 567]
  ------------------
  507|      3|	case 'r': keys = keys_r; break;
  ------------------
  |  Branch (507:2): [True: 3, False: 564]
  ------------------
  508|     16|	case 's': keys = keys_s; break;
  ------------------
  |  Branch (508:2): [True: 16, False: 551]
  ------------------
  509|     19|	case 't': keys = keys_t; break;
  ------------------
  |  Branch (509:2): [True: 19, False: 548]
  ------------------
  510|      0|	case 'u': keys = keys_u; break;
  ------------------
  |  Branch (510:2): [True: 0, False: 567]
  ------------------
  511|     16|	default: return (0);/* Unknown key */
  ------------------
  |  Branch (511:2): [True: 16, False: 551]
  ------------------
  512|    567|	}
  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|    588|{
  588|    588|	int f = 0;
  589|    588|	static const unsigned char safe_char[256] = {
  590|    588|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 00 - 0F */
  591|    588|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 10 - 1F */
  592|       |		/* !"$%&'()*+,-./  EXCLUSION:( )(#) */
  593|    588|		0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 20 - 2F */
  594|       |		/* 0123456789:;<>?  EXCLUSION:(=) */
  595|    588|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, /* 30 - 3F */
  596|       |		/* @ABCDEFGHIJKLMNO */
  597|    588|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 40 - 4F */
  598|       |		/* PQRSTUVWXYZ[\]^_  */
  599|    588|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 50 - 5F */
  600|       |		/* `abcdefghijklmno */
  601|    588|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 60 - 6F */
  602|       |		/* pqrstuvwxyz{|}~ */
  603|    588|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, /* 70 - 7F */
  604|    588|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 80 - 8F */
  605|    588|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 90 - 9F */
  606|    588|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A0 - AF */
  607|    588|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* B0 - BF */
  608|    588|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* C0 - CF */
  609|    588|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* D0 - DF */
  610|    588|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* E0 - EF */
  611|    588|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* F0 - FF */
  612|    588|	};
  613|    588|	ssize_t ll;
  614|    588|	const char *pp = p;
  615|    588|	const char * const pp_end = pp + len;
  616|       |
  617|    588|	*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: 588, False: 37.4k]
  ------------------
  623|    588|			if (*pp != ' ' && *pp != '\t' && *pp != '\r'
  ------------------
  |  Branch (623:8): [True: 562, False: 26]
  |  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|    588|			break;
  627|    588|		}
  628|  37.4k|		f = 1;
  629|  37.4k|	}
  630|    588|	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|    588|	if (f == 0) {
  ------------------
  |  Branch (635:6): [True: 149, False: 439]
  ------------------
  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|    439|	return (bid_keyword_list(pp, ll, 0, *last_is_path));
  669|    588|}
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:
  729|  2.49k|{
  730|  2.49k|  struct archive_read *a = (struct archive_read *)_a;
  731|  2.49k|  struct rar *rar;
  732|  2.49k|  int r;
  733|       |
  734|  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]
  |  |  ------------------
  ------------------
  735|  2.49k|                      "archive_read_support_format_rar");
  736|       |
  737|  2.49k|  rar = calloc(1, sizeof(*rar));
  738|  2.49k|  if (rar == NULL)
  ------------------
  |  Branch (738:7): [True: 0, False: 2.49k]
  ------------------
  739|      0|  {
  740|      0|    archive_set_error(&a->archive, ENOMEM, "Can't allocate rar data");
  741|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  742|      0|  }
  743|       |
  744|       |  /*
  745|       |   * Until enough data has been read, we cannot tell about
  746|       |   * any encrypted entries yet.
  747|       |   */
  748|  2.49k|  rar->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|  2.49k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  749|       |
  750|  2.49k|  r = __archive_read_register_format(a,
  751|  2.49k|                                     rar,
  752|  2.49k|                                     "rar",
  753|  2.49k|                                     archive_read_format_rar_bid,
  754|  2.49k|                                     archive_read_format_rar_options,
  755|  2.49k|                                     archive_read_format_rar_read_header,
  756|  2.49k|                                     archive_read_format_rar_read_data,
  757|  2.49k|                                     archive_read_format_rar_read_data_skip,
  758|  2.49k|                                     archive_read_format_rar_seek_data,
  759|  2.49k|                                     archive_read_format_rar_cleanup,
  760|  2.49k|                                     archive_read_support_format_rar_capabilities,
  761|  2.49k|                                     archive_read_format_rar_has_encrypted_entries);
  762|       |
  763|  2.49k|  if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (763:7): [True: 0, False: 2.49k]
  ------------------
  764|      0|    free(rar);
  765|  2.49k|  return (r);
  766|  2.49k|}
archive_read_support_format_rar.c:archive_read_support_format_rar_capabilities:
  770|    296|{
  771|    296|  (void)a; /* UNUSED */
  772|    296|  return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA
  ------------------
  |  |  398|    296|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
  773|    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.) */
  ------------------
  774|    296|}
archive_read_support_format_rar.c:archive_read_format_rar_has_encrypted_entries:
  778|    148|{
  779|    148|  if (_a && _a->format) {
  ------------------
  |  Branch (779:7): [True: 148, False: 0]
  |  Branch (779:13): [True: 148, False: 0]
  ------------------
  780|    148|    struct rar * rar = (struct rar *)_a->format->data;
  781|    148|    if (rar) {
  ------------------
  |  Branch (781:9): [True: 148, False: 0]
  ------------------
  782|    148|      return rar->has_encrypted_entries;
  783|    148|    }
  784|    148|  }
  785|      0|  return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  786|    148|}
archive_read_support_format_rar.c:archive_read_format_rar_bid:
  791|  2.45k|{
  792|  2.45k|  const char *p;
  793|       |
  794|       |  /* If there's already a bid > 30, we'll never win. */
  795|  2.45k|  if (best_bid > 30)
  ------------------
  |  Branch (795:7): [True: 975, False: 1.48k]
  ------------------
  796|    975|    return (-1);
  797|       |
  798|  1.48k|  if ((p = __archive_read_ahead(a, 7, NULL)) == NULL)
  ------------------
  |  Branch (798:7): [True: 24, False: 1.45k]
  ------------------
  799|     24|    return (-1);
  800|       |
  801|  1.45k|  if (memcmp(p, RAR_SIGNATURE, 7) == 0)
  ------------------
  |  |   50|  1.45k|#define RAR_SIGNATURE "\x52\x61\x72\x21\x1A\x07\x00"
  ------------------
  |  Branch (801:7): [True: 145, False: 1.31k]
  ------------------
  802|    145|    return (30);
  803|       |
  804|  1.31k|  if ((p[0] == 'M' && p[1] == 'Z') || memcmp(p, "\x7F\x45LF", 4) == 0) {
  ------------------
  |  Branch (804:8): [True: 60, False: 1.25k]
  |  Branch (804:23): [True: 60, False: 0]
  |  Branch (804:39): [True: 15, False: 1.23k]
  ------------------
  805|       |    /* This is a PE file */
  806|     75|    ssize_t offset = 0x10000;
  807|     75|    ssize_t window = 4096;
  808|     75|    ssize_t bytes_avail;
  809|    449|    while (offset + window <= (1024 * 128)) {
  ------------------
  |  Branch (809:12): [True: 436, False: 13]
  ------------------
  810|    436|      const char *buff = __archive_read_ahead(a, offset + window, &bytes_avail);
  811|    436|      if (buff == NULL) {
  ------------------
  |  Branch (811:11): [True: 413, False: 23]
  ------------------
  812|       |        /* Remaining bytes are less than window. */
  813|    413|        window >>= 1;
  814|    413|        if (window < 0x40)
  ------------------
  |  Branch (814:13): [True: 58, False: 355]
  ------------------
  815|     58|          return (0);
  816|    355|        continue;
  817|    413|      }
  818|     23|      p = buff + offset;
  819|   405k|      while (p + 7 < buff + bytes_avail) {
  ------------------
  |  Branch (819:14): [True: 405k, False: 19]
  ------------------
  820|   405k|        if (memcmp(p, RAR_SIGNATURE, 7) == 0)
  ------------------
  |  |   50|   405k|#define RAR_SIGNATURE "\x52\x61\x72\x21\x1A\x07\x00"
  ------------------
  |  Branch (820:13): [True: 4, False: 405k]
  ------------------
  821|      4|          return (30);
  822|   405k|        p += 0x10;
  823|   405k|      }
  824|     19|      offset = p - buff;
  825|     19|    }
  826|     75|  }
  827|  1.25k|  return (0);
  828|  1.31k|}
archive_read_support_format_rar.c:archive_read_format_rar_read_header:
  909|  1.54k|{
  910|  1.54k|  const void *h;
  911|  1.54k|  const char *p;
  912|  1.54k|  struct rar *rar;
  913|  1.54k|  int64_t skip;
  914|  1.54k|  char head_type;
  915|  1.54k|  int ret;
  916|  1.54k|  unsigned flags;
  917|  1.54k|  unsigned long crc32_expected;
  918|       |
  919|  1.54k|  a->archive.archive_format = ARCHIVE_FORMAT_RAR;
  ------------------
  |  |  384|  1.54k|#define	ARCHIVE_FORMAT_RAR			0xD0000
  ------------------
  920|  1.54k|  if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (920:7): [True: 148, False: 1.40k]
  ------------------
  921|    148|    a->archive.archive_format_name = "RAR";
  922|       |
  923|  1.54k|  rar = (struct rar *)(a->format->data);
  924|       |
  925|       |  /*
  926|       |   * It should be sufficient to call archive_read_next_header() for
  927|       |   * a reader to determine if an entry is encrypted or not. If the
  928|       |   * encryption of an entry is only detectable when calling
  929|       |   * archive_read_data(), so be it. We'll do the same check there
  930|       |   * as well.
  931|       |   */
  932|  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 (932:7): [True: 148, False: 1.40k]
  ------------------
  933|    148|    rar->has_encrypted_entries = 0;
  934|    148|  }
  935|       |
  936|       |  /* RAR files can be generated without EOF headers, so return ARCHIVE_EOF if
  937|       |  * this fails.
  938|       |  */
  939|  1.54k|  if ((h = __archive_read_ahead(a, 7, NULL)) == NULL)
  ------------------
  |  Branch (939:7): [True: 20, False: 1.52k]
  ------------------
  940|     20|    return (ARCHIVE_EOF);
  ------------------
  |  |  232|     20|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  941|       |
  942|  1.52k|  p = h;
  943|  1.52k|  if (rar->found_first_header == 0 &&
  ------------------
  |  Branch (943:7): [True: 148, False: 1.38k]
  ------------------
  944|    148|     ((p[0] == 'M' && p[1] == 'Z') || memcmp(p, "\x7F\x45LF", 4) == 0)) {
  ------------------
  |  Branch (944:8): [True: 1, False: 147]
  |  Branch (944:23): [True: 1, False: 0]
  |  Branch (944:39): [True: 2, False: 145]
  ------------------
  945|       |    /* This is an executable ? Must be self-extracting... */
  946|      3|    ret = skip_sfx(a);
  947|      3|    if (ret < ARCHIVE_WARN)
  ------------------
  |  |  235|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (947:9): [True: 0, False: 3]
  ------------------
  948|      0|      return (ret);
  949|      3|  }
  950|  1.52k|  rar->found_first_header = 1;
  951|       |
  952|  2.81k|  while (1)
  ------------------
  |  Branch (952:10): [True: 2.81k, Folded]
  ------------------
  953|  2.81k|  {
  954|  2.81k|    unsigned long crc32_val;
  955|       |
  956|  2.81k|    if ((h = __archive_read_ahead(a, 7, NULL)) == NULL) {
  ------------------
  |  Branch (956:9): [True: 0, False: 2.81k]
  ------------------
  957|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  958|      0|                        "Failed to read next header");
  959|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  960|      0|    }
  961|  2.81k|    p = h;
  962|       |
  963|  2.81k|    head_type = p[2];
  964|  2.81k|    switch(head_type)
  965|  2.81k|    {
  966|    170|    case MARK_HEAD:
  ------------------
  |  |   53|    170|#define MARK_HEAD    0x72
  ------------------
  |  Branch (966:5): [True: 170, False: 2.64k]
  ------------------
  967|    170|      if (memcmp(p, RAR_SIGNATURE, 7) != 0) {
  ------------------
  |  |   50|    170|#define RAR_SIGNATURE "\x52\x61\x72\x21\x1A\x07\x00"
  ------------------
  |  Branch (967:11): [True: 0, False: 170]
  ------------------
  968|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  969|      0|          "Invalid marker header");
  970|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  971|      0|      }
  972|    170|      __archive_read_consume(a, 7);
  973|    170|      break;
  974|       |
  975|    963|    case MAIN_HEAD:
  ------------------
  |  |   54|    963|#define MAIN_HEAD    0x73
  ------------------
  |  Branch (975:5): [True: 963, False: 1.85k]
  ------------------
  976|    963|      rar->main_flags = archive_le16dec(p + 3);
  977|    963|      skip = archive_le16dec(p + 5);
  978|    963|      if ((size_t)skip < 7 + sizeof(rar->reserved1) + sizeof(rar->reserved2)) {
  ------------------
  |  Branch (978:11): [True: 0, False: 963]
  ------------------
  979|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  980|      0|          "Invalid header size");
  981|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  982|      0|      }
  983|    963|      if ((h = __archive_read_ahead(a, skip, NULL)) == NULL)
  ------------------
  |  Branch (983:11): [True: 4, False: 959]
  ------------------
  984|      4|        return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  985|    959|      p = h;
  986|    959|      memcpy(rar->reserved1, p + 7, sizeof(rar->reserved1));
  987|    959|      memcpy(rar->reserved2, p + 7 + sizeof(rar->reserved1),
  988|    959|             sizeof(rar->reserved2));
  989|    959|      if (rar->main_flags & MHD_ENCRYPTVER) {
  ------------------
  |  |   74|    959|#define MHD_ENCRYPTVER   0x0200
  ------------------
  |  Branch (989:11): [True: 0, False: 959]
  ------------------
  990|      0|        if ((size_t)skip <
  ------------------
  |  Branch (990:13): [True: 0, False: 0]
  ------------------
  991|      0|            7 + sizeof(rar->reserved1) + sizeof(rar->reserved2) + 1) {
  992|      0|          archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  993|      0|            "Invalid header size");
  994|      0|          return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  995|      0|        }
  996|      0|        rar->encryptver = *(p + 7 + sizeof(rar->reserved1) +
  997|      0|                            sizeof(rar->reserved2));
  998|      0|      }
  999|       |
 1000|       |      /* Main header is password encrypted, so we cannot read any
 1001|       |         file names or any other info about files from the header. */
 1002|    959|      if (rar->main_flags & MHD_PASSWORD)
  ------------------
  |  |   72|    959|#define MHD_PASSWORD     0x0080
  ------------------
  |  Branch (1002:11): [True: 0, False: 959]
  ------------------
 1003|      0|      {
 1004|      0|        archive_entry_set_is_metadata_encrypted(entry, 1);
 1005|      0|        archive_entry_set_is_data_encrypted(entry, 1);
 1006|      0|        rar->has_encrypted_entries = 1;
 1007|      0|         archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1008|      0|                          "RAR encryption support unavailable");
 1009|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1010|      0|      }
 1011|       |
 1012|    959|      crc32_val = crc32(0, (const unsigned char *)p + 2, (unsigned)skip - 2);
 1013|    959|      if ((crc32_val & 0xffff) != archive_le16dec(p)) {
  ------------------
  |  Branch (1013:11): [True: 903, False: 56]
  ------------------
 1014|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 1015|       |        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 1016|       |          "Header CRC error");
 1017|       |        return (ARCHIVE_FATAL);
 1018|       |#endif
 1019|    903|      }
 1020|    959|      __archive_read_consume(a, skip);
 1021|    959|      break;
 1022|       |
 1023|  1.50k|    case FILE_HEAD:
  ------------------
  |  |   55|  1.50k|#define FILE_HEAD    0x74
  ------------------
  |  Branch (1023:5): [True: 1.50k, False: 1.30k]
  ------------------
 1024|  1.50k|      return read_header(a, entry, head_type);
 1025|       |
 1026|      0|    case COMM_HEAD:
  ------------------
  |  |   56|      0|#define COMM_HEAD    0x75
  ------------------
  |  Branch (1026:5): [True: 0, False: 2.81k]
  ------------------
 1027|      0|    case AV_HEAD:
  ------------------
  |  |   57|      0|#define AV_HEAD      0x76
  ------------------
  |  Branch (1027:5): [True: 0, False: 2.81k]
  ------------------
 1028|      0|    case SUB_HEAD:
  ------------------
  |  |   58|      0|#define SUB_HEAD     0x77
  ------------------
  |  Branch (1028:5): [True: 0, False: 2.81k]
  ------------------
 1029|     86|    case PROTECT_HEAD:
  ------------------
  |  |   59|     86|#define PROTECT_HEAD 0x78
  ------------------
  |  Branch (1029:5): [True: 86, False: 2.73k]
  ------------------
 1030|     90|    case SIGN_HEAD:
  ------------------
  |  |   60|     90|#define SIGN_HEAD    0x79
  ------------------
  |  Branch (1030:5): [True: 4, False: 2.81k]
  ------------------
 1031|     90|    case ENDARC_HEAD:
  ------------------
  |  |   62|     90|#define ENDARC_HEAD  0x7b
  ------------------
  |  Branch (1031:5): [True: 0, False: 2.81k]
  ------------------
 1032|     90|      flags = archive_le16dec(p + 3);
 1033|     90|      skip = archive_le16dec(p + 5);
 1034|     90|      if (skip < 7) {
  ------------------
  |  Branch (1034:11): [True: 0, False: 90]
  ------------------
 1035|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1036|      0|          "Invalid header size too small");
 1037|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1038|      0|      }
 1039|     90|      if (flags & HD_ADD_SIZE_PRESENT)
  ------------------
  |  |   78|     90|#define HD_ADD_SIZE_PRESENT 0x8000
  ------------------
  |  Branch (1039:11): [True: 4, False: 86]
  ------------------
 1040|      4|      {
 1041|      4|        if (skip < 7 + 4) {
  ------------------
  |  Branch (1041:13): [True: 0, False: 4]
  ------------------
 1042|      0|          archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1043|      0|            "Invalid header size too small");
 1044|      0|          return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1045|      0|        }
 1046|      4|        if ((h = __archive_read_ahead(a, skip, NULL)) == NULL)
  ------------------
  |  Branch (1046:13): [True: 0, False: 4]
  ------------------
 1047|      0|          return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1048|      4|        p = h;
 1049|      4|        skip += archive_le32dec(p + 7);
 1050|      4|      }
 1051|       |
 1052|       |      /* Skip over the 2-byte CRC at the beginning of the header. */
 1053|     90|      crc32_expected = archive_le16dec(p);
 1054|     90|      __archive_read_consume(a, 2);
 1055|     90|      skip -= 2;
 1056|       |
 1057|       |      /* Skim the entire header and compute the CRC. */
 1058|     90|      crc32_val = 0;
 1059|    197|      while (skip > 0) {
  ------------------
  |  Branch (1059:14): [True: 111, False: 86]
  ------------------
 1060|    111|        unsigned to_read;
 1061|    111|        if (skip > 32 * 1024)
  ------------------
  |  Branch (1061:13): [True: 25, False: 86]
  ------------------
 1062|     25|          to_read = 32 * 1024;
 1063|     86|        else
 1064|     86|          to_read = (unsigned)skip;
 1065|    111|        if ((h = __archive_read_ahead(a, to_read, NULL)) == NULL) {
  ------------------
  |  Branch (1065:13): [True: 4, False: 107]
  ------------------
 1066|      4|          archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1067|      4|            "Bad RAR file");
 1068|      4|          return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1069|      4|        }
 1070|    107|        p = h;
 1071|    107|        crc32_val = crc32(crc32_val, (const unsigned char *)p, to_read);
 1072|    107|        __archive_read_consume(a, to_read);
 1073|    107|        skip -= to_read;
 1074|    107|      }
 1075|     86|      if ((crc32_val & 0xffff) != crc32_expected) {
  ------------------
  |  Branch (1075:11): [True: 86, False: 0]
  ------------------
 1076|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 1077|       |        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 1078|       |          "Header CRC error");
 1079|       |        return (ARCHIVE_FATAL);
 1080|       |#endif
 1081|     86|      }
 1082|     86|      if (head_type == ENDARC_HEAD)
  ------------------
  |  |   62|     86|#define ENDARC_HEAD  0x7b
  ------------------
  |  Branch (1082:11): [True: 0, False: 86]
  ------------------
 1083|      0|        return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1084|     86|      break;
 1085|       |
 1086|     86|    case NEWSUB_HEAD:
  ------------------
  |  |   61|     73|#define NEWSUB_HEAD  0x7a
  ------------------
  |  Branch (1086:5): [True: 73, False: 2.74k]
  ------------------
 1087|     73|      if ((ret = read_header(a, entry, head_type)) < ARCHIVE_WARN)
  ------------------
  |  |  235|     73|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1087:11): [True: 0, False: 73]
  ------------------
 1088|      0|        return ret;
 1089|     73|      break;
 1090|       |
 1091|     73|    default:
  ------------------
  |  Branch (1091:5): [True: 12, False: 2.80k]
  ------------------
 1092|     12|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     12|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1093|     12|                        "Bad RAR file");
 1094|     12|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1095|  2.81k|    }
 1096|  2.81k|  }
 1097|  1.52k|}
archive_read_support_format_rar.c:skip_sfx:
  832|      3|{
  833|      3|  const void *h;
  834|      3|  const char *p, *q;
  835|      3|  size_t skip, total;
  836|      3|  ssize_t bytes, window;
  837|       |
  838|      3|  total = 0;
  839|      3|  window = 4096;
  840|      3|  while (total + window <= (1024 * 128)) {
  ------------------
  |  Branch (840:10): [True: 3, False: 0]
  ------------------
  841|      3|    h = __archive_read_ahead(a, window, &bytes);
  842|      3|    if (h == NULL) {
  ------------------
  |  Branch (842:9): [True: 0, False: 3]
  ------------------
  843|       |      /* Remaining bytes are less than window. */
  844|      0|      window >>= 1;
  845|      0|      if (window < 0x40)
  ------------------
  |  Branch (845:11): [True: 0, False: 0]
  ------------------
  846|      0|      	goto fatal;
  847|      0|      continue;
  848|      0|    }
  849|      3|    if (bytes < 0x40)
  ------------------
  |  Branch (849:9): [True: 0, False: 3]
  ------------------
  850|      0|      goto fatal;
  851|      3|    p = h;
  852|      3|    q = p + bytes;
  853|       |
  854|       |    /*
  855|       |     * Scan ahead until we find something that looks
  856|       |     * like the RAR header.
  857|       |     */
  858|  5.46k|    while (p + 7 < q) {
  ------------------
  |  Branch (858:12): [True: 5.46k, False: 0]
  ------------------
  859|  5.46k|      if (memcmp(p, RAR_SIGNATURE, 7) == 0) {
  ------------------
  |  |   50|  5.46k|#define RAR_SIGNATURE "\x52\x61\x72\x21\x1A\x07\x00"
  ------------------
  |  Branch (859:11): [True: 3, False: 5.45k]
  ------------------
  860|      3|      	skip = p - (const char *)h;
  861|      3|      	__archive_read_consume(a, skip);
  862|      3|      	return (ARCHIVE_OK);
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  863|      3|      }
  864|  5.45k|      p += 0x10;
  865|  5.45k|    }
  866|      0|    skip = p - (const char *)h;
  867|      0|    __archive_read_consume(a, skip);
  868|      0|    total += skip;
  869|      0|  }
  870|      0|fatal:
  871|      0|  archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  872|      0|      "Couldn't find out RAR header");
  873|      0|  return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  874|      3|}
archive_read_support_format_rar.c:read_header:
 1364|  1.58k|{
 1365|  1.58k|  const void *h;
 1366|  1.58k|  const char *p, *endp;
 1367|  1.58k|  struct rar *rar;
 1368|  1.58k|  struct rar_header rar_header;
 1369|  1.58k|  struct rar_file_header file_header;
 1370|  1.58k|  int64_t header_size;
 1371|  1.58k|  unsigned filename_size, end;
 1372|  1.58k|  char *filename;
 1373|  1.58k|  char *strp;
 1374|  1.58k|  char packed_size[8];
 1375|  1.58k|  char unp_size[8];
 1376|  1.58k|  int ttime;
 1377|  1.58k|  struct archive_string_conv *sconv, *fn_sconv;
 1378|  1.58k|  uint32_t crc32_computed, crc32_read;
 1379|  1.58k|  int ret = (ARCHIVE_OK), ret2;
  ------------------
  |  |  233|  1.58k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1380|  1.58k|  char *newptr;
 1381|  1.58k|  size_t newsize;
 1382|       |
 1383|  1.58k|  rar = (struct rar *)(a->format->data);
 1384|       |
 1385|       |  /* Setup a string conversion object for non-rar-unicode filenames. */
 1386|  1.58k|  sconv = rar->opt_sconv;
 1387|  1.58k|  if (sconv == NULL) {
  ------------------
  |  Branch (1387:7): [True: 1.58k, False: 0]
  ------------------
 1388|  1.58k|    if (!rar->init_default_conversion) {
  ------------------
  |  Branch (1388:9): [True: 142, False: 1.44k]
  ------------------
 1389|    142|      rar->sconv_default =
 1390|    142|          archive_string_default_conversion_for_read(
 1391|    142|            &(a->archive));
 1392|    142|      rar->init_default_conversion = 1;
 1393|    142|    }
 1394|  1.58k|    sconv = rar->sconv_default;
 1395|  1.58k|  }
 1396|       |
 1397|       |
 1398|  1.58k|  if ((h = __archive_read_ahead(a, 7, NULL)) == NULL)
  ------------------
  |  Branch (1398:7): [True: 0, False: 1.58k]
  ------------------
 1399|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1400|  1.58k|  p = h;
 1401|  1.58k|  memcpy(&rar_header, p, sizeof(rar_header));
 1402|  1.58k|  rar->file_flags = archive_le16dec(rar_header.flags);
 1403|  1.58k|  header_size = archive_le16dec(rar_header.size);
 1404|  1.58k|  if (header_size < (int64_t)sizeof(file_header) + 7) {
  ------------------
  |  Branch (1404:7): [True: 3, False: 1.57k]
  ------------------
 1405|      3|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1406|      3|      "Invalid header size");
 1407|      3|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1408|      3|  }
 1409|  1.57k|  crc32_computed = crc32(0, (const unsigned char *)p + 2, 7 - 2);
 1410|  1.57k|  __archive_read_consume(a, 7);
 1411|       |
 1412|  1.57k|  if (!(rar->file_flags & FHD_SOLID))
  ------------------
  |  |   85|  1.57k|#define FHD_SOLID        0x0010
  ------------------
  |  Branch (1412:7): [True: 1.57k, False: 0]
  ------------------
 1413|  1.57k|  {
 1414|  1.57k|    rar->compression_method = 0;
 1415|  1.57k|    rar->packed_size = 0;
 1416|  1.57k|    rar->unp_size = 0;
 1417|  1.57k|    rar->mtime = 0;
 1418|  1.57k|    rar->ctime = 0;
 1419|  1.57k|    rar->atime = 0;
 1420|  1.57k|    rar->arctime = 0;
 1421|  1.57k|    rar->mode = 0;
 1422|  1.57k|    memset(&rar->salt, 0, sizeof(rar->salt));
 1423|  1.57k|    rar->atime = 0;
 1424|  1.57k|    rar->ansec = 0;
 1425|  1.57k|    rar->ctime = 0;
 1426|  1.57k|    rar->cnsec = 0;
 1427|  1.57k|    rar->mtime = 0;
 1428|  1.57k|    rar->mnsec = 0;
 1429|  1.57k|    rar->arctime = 0;
 1430|  1.57k|    rar->arcnsec = 0;
 1431|  1.57k|  }
 1432|      0|  else
 1433|      0|  {
 1434|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1435|      0|                      "RAR solid archive support unavailable");
 1436|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1437|      0|  }
 1438|       |
 1439|  1.57k|  if ((h = __archive_read_ahead(a, (size_t)header_size - 7, NULL)) == NULL)
  ------------------
  |  Branch (1439:7): [True: 0, False: 1.57k]
  ------------------
 1440|      0|  {
 1441|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1442|      0|                      "Failed to read full header content");
 1443|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1444|      0|  }
 1445|       |
 1446|       |  /* File Header CRC check. */
 1447|  1.57k|  crc32_computed = crc32(crc32_computed, h, (unsigned)(header_size - 7));
 1448|  1.57k|  crc32_read = archive_le16dec(rar_header.crc);
 1449|  1.57k|  if ((crc32_computed & 0xffff) != crc32_read) {
  ------------------
  |  Branch (1449:7): [True: 1.57k, False: 3]
  ------------------
 1450|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 1451|       |    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 1452|       |      "Header CRC error");
 1453|       |    return (ARCHIVE_FATAL);
 1454|       |#endif
 1455|  1.57k|  }
 1456|       |  /* If no CRC error, go on parsing File Header. */
 1457|  1.57k|  p = h;
 1458|  1.57k|  endp = p + header_size - 7;
 1459|  1.57k|  memcpy(&file_header, p, sizeof(file_header));
 1460|  1.57k|  p += sizeof(file_header);
 1461|       |
 1462|  1.57k|  rar->compression_method = file_header.method;
 1463|       |
 1464|  1.57k|  ttime = archive_le32dec(file_header.file_time);
 1465|  1.57k|  rar->mtime = get_time(ttime);
 1466|       |
 1467|  1.57k|  rar->file_crc = archive_le32dec(file_header.file_crc);
 1468|       |
 1469|  1.57k|  if (rar->file_flags & FHD_PASSWORD)
  ------------------
  |  |   83|  1.57k|#define FHD_PASSWORD     0x0004
  ------------------
  |  Branch (1469:7): [True: 1.14k, False: 431]
  ------------------
 1470|  1.14k|  {
 1471|  1.14k|    archive_entry_set_is_data_encrypted(entry, 1);
 1472|  1.14k|    rar->has_encrypted_entries = 1;
 1473|  1.14k|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.14k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1474|  1.14k|                      "RAR encryption support unavailable");
 1475|       |    /* Since it is only the data part itself that is encrypted we can at least
 1476|       |       extract information about the currently processed entry and don't need
 1477|       |       to return ARCHIVE_FATAL here. */
 1478|       |    /*return (ARCHIVE_FATAL);*/
 1479|  1.14k|  }
 1480|       |
 1481|  1.57k|  if (rar->file_flags & FHD_LARGE)
  ------------------
  |  |   86|  1.57k|#define FHD_LARGE        0x0100
  ------------------
  |  Branch (1481:7): [True: 42, False: 1.53k]
  ------------------
 1482|     42|  {
 1483|     42|    if (p + 8 > endp) {
  ------------------
  |  Branch (1483:9): [True: 0, False: 42]
  ------------------
 1484|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1485|      0|                        "Invalid header size");
 1486|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1487|      0|    }
 1488|     42|    memcpy(packed_size, file_header.pack_size, 4);
 1489|     42|    memcpy(packed_size + 4, p, 4); /* High pack size */
 1490|     42|    p += 4;
 1491|     42|    memcpy(unp_size, file_header.unp_size, 4);
 1492|     42|    memcpy(unp_size + 4, p, 4); /* High unpack size */
 1493|     42|    p += 4;
 1494|     42|    rar->packed_size = archive_le64dec(&packed_size);
 1495|     42|    rar->unp_size = archive_le64dec(&unp_size);
 1496|     42|  }
 1497|  1.53k|  else
 1498|  1.53k|  {
 1499|  1.53k|    rar->packed_size = archive_le32dec(file_header.pack_size);
 1500|  1.53k|    rar->unp_size = archive_le32dec(file_header.unp_size);
 1501|  1.53k|  }
 1502|       |
 1503|  1.57k|  if (rar->packed_size < 0 || rar->unp_size < 0)
  ------------------
  |  Branch (1503:7): [True: 0, False: 1.57k]
  |  Branch (1503:31): [True: 0, False: 1.57k]
  ------------------
 1504|      0|  {
 1505|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1506|      0|                      "Invalid sizes specified");
 1507|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1508|      0|  }
 1509|       |
 1510|  1.57k|  rar->bytes_remaining = rar->packed_size;
 1511|       |
 1512|       |  /* TODO: RARv3 subblocks contain comments. For now the complete block is
 1513|       |   * consumed at the end.
 1514|       |   */
 1515|  1.57k|  if (head_type == NEWSUB_HEAD) {
  ------------------
  |  |   61|  1.57k|#define NEWSUB_HEAD  0x7a
  ------------------
  |  Branch (1515:7): [True: 73, False: 1.50k]
  ------------------
 1516|     73|    if (rar->packed_size > INT64_MAX - header_size) {
  ------------------
  |  Branch (1516:9): [True: 0, False: 73]
  ------------------
 1517|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1518|      0|                        "Invalid RAR file: Overlarge extended header");
 1519|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1520|      0|    }
 1521|     73|    if (__archive_read_consume(a, header_size + rar->packed_size - 7) < 0) {
  ------------------
  |  Branch (1521:9): [True: 0, False: 73]
  ------------------
 1522|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1523|      0|                        "Invalid RAR file: Cannot read extended header data");
 1524|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1525|      0|    }
 1526|       |
 1527|       |    /*
 1528|       |     * NEWSUB records are metadata-only in this reader. The block header
 1529|       |     * has already been validated, so it is safe to skip exactly the
 1530|       |     * remaining header bytes and the associated data payload.
 1531|       |     */
 1532|     73|    return ret;
 1533|     73|  }
 1534|       |
 1535|  1.50k|  filename_size = archive_le16dec(file_header.name_size);
 1536|  1.50k|  if (p + filename_size > endp) {
  ------------------
  |  Branch (1536:7): [True: 21, False: 1.48k]
  ------------------
 1537|     21|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     21|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1538|     21|      "Invalid filename size");
 1539|     21|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     21|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1540|     21|  }
 1541|  1.48k|  if (rar->filename_allocated < filename_size * 2 + 2) {
  ------------------
  |  Branch (1541:7): [True: 142, False: 1.34k]
  ------------------
 1542|    142|    newsize = filename_size * 2 + 2;
 1543|    142|    newptr = realloc(rar->filename, newsize);
 1544|    142|    if (newptr == NULL) {
  ------------------
  |  Branch (1544:9): [True: 0, False: 142]
  ------------------
 1545|      0|      archive_set_error(&a->archive, ENOMEM,
 1546|      0|                        "Couldn't allocate memory");
 1547|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1548|      0|    }
 1549|    142|    rar->filename = newptr;
 1550|    142|    rar->filename_allocated = newsize;
 1551|    142|  }
 1552|  1.48k|  filename = rar->filename;
 1553|  1.48k|  memcpy(filename, p, filename_size);
 1554|  1.48k|  filename[filename_size] = '\0';
 1555|  1.48k|  if (rar->file_flags & FHD_UNICODE)
  ------------------
  |  |   87|  1.48k|#define FHD_UNICODE      0x0200
  ------------------
  |  Branch (1555:7): [True: 1.18k, False: 299]
  ------------------
 1556|  1.18k|  {
 1557|  1.18k|    if (filename_size != strlen(filename))
  ------------------
  |  Branch (1557:9): [True: 1.13k, False: 48]
  ------------------
 1558|  1.13k|    {
 1559|  1.13k|      unsigned char highbyte, flagbits, flagbyte;
 1560|  1.13k|      unsigned fn_end, offset;
 1561|       |
 1562|  1.13k|      end = filename_size;
 1563|  1.13k|      fn_end = filename_size * 2;
 1564|  1.13k|      filename_size = 0;
 1565|  1.13k|      offset = (unsigned)strlen(filename) + 1;
 1566|  1.13k|      highbyte = offset >= end ? 0 : *(p + offset++);
  ------------------
  |  Branch (1566:18): [True: 66, False: 1.07k]
  ------------------
 1567|  1.13k|      flagbits = 0;
 1568|  1.13k|      flagbyte = 0;
 1569|  4.32k|      while (offset < end && filename_size < fn_end)
  ------------------
  |  Branch (1569:14): [True: 3.23k, False: 1.09k]
  |  Branch (1569:30): [True: 3.18k, False: 41]
  ------------------
 1570|  3.18k|      {
 1571|  3.18k|        if (!flagbits)
  ------------------
  |  Branch (1571:13): [True: 1.29k, False: 1.89k]
  ------------------
 1572|  1.29k|        {
 1573|  1.29k|          flagbyte = *(p + offset++);
 1574|  1.29k|          flagbits = 8;
 1575|  1.29k|        }
 1576|       |
 1577|  3.18k|        flagbits -= 2;
 1578|  3.18k|        switch((flagbyte >> flagbits) & 3)
  ------------------
  |  Branch (1578:16): [True: 3.18k, False: 0]
  ------------------
 1579|  3.18k|        {
 1580|  1.17k|          case 0:
  ------------------
  |  Branch (1580:11): [True: 1.17k, False: 2.01k]
  ------------------
 1581|  1.17k|            if (offset >= end)
  ------------------
  |  Branch (1581:17): [True: 0, False: 1.17k]
  ------------------
 1582|      0|              continue;
 1583|  1.17k|            filename[filename_size++] = '\0';
 1584|  1.17k|            filename[filename_size++] = *(p + offset++);
 1585|  1.17k|            break;
 1586|    314|          case 1:
  ------------------
  |  Branch (1586:11): [True: 314, False: 2.87k]
  ------------------
 1587|    314|            if (offset >= end)
  ------------------
  |  Branch (1587:17): [True: 85, False: 229]
  ------------------
 1588|     85|              continue;
 1589|    229|            filename[filename_size++] = highbyte;
 1590|    229|            filename[filename_size++] = *(p + offset++);
 1591|    229|            break;
 1592|    730|          case 2:
  ------------------
  |  Branch (1592:11): [True: 730, False: 2.45k]
  ------------------
 1593|    730|            if (offset >= end - 1) {
  ------------------
  |  Branch (1593:17): [True: 36, False: 694]
  ------------------
 1594|     36|              offset = end;
 1595|     36|              continue;
 1596|     36|            }
 1597|    694|            filename[filename_size++] = *(p + offset + 1);
 1598|    694|            filename[filename_size++] = *(p + offset);
 1599|    694|            offset += 2;
 1600|    694|            break;
 1601|    971|          case 3:
  ------------------
  |  Branch (1601:11): [True: 971, False: 2.21k]
  ------------------
 1602|    971|          {
 1603|    971|            char extra, high;
 1604|    971|            uint8_t length;
 1605|       |
 1606|    971|            if (offset >= end)
  ------------------
  |  Branch (1606:17): [True: 339, False: 632]
  ------------------
 1607|    339|              continue;
 1608|       |
 1609|    632|            length = *(p + offset++);
 1610|    632|            if (length & 0x80) {
  ------------------
  |  Branch (1610:17): [True: 570, False: 62]
  ------------------
 1611|    570|              if (offset >= end)
  ------------------
  |  Branch (1611:19): [True: 541, False: 29]
  ------------------
 1612|    541|                continue;
 1613|     29|              extra = *(p + offset++);
 1614|     29|              high = (char)highbyte;
 1615|     29|            } else
 1616|     62|              extra = high = 0;
 1617|     91|            length = (length & 0x7f) + 2;
 1618|    634|            while (length && filename_size < fn_end) {
  ------------------
  |  Branch (1618:20): [True: 590, False: 44]
  |  Branch (1618:30): [True: 543, False: 47]
  ------------------
 1619|    543|              unsigned cp = filename_size >> 1;
 1620|    543|              filename[filename_size++] = high;
 1621|    543|              filename[filename_size++] = p[cp] + extra;
 1622|    543|              length--;
 1623|    543|            }
 1624|     91|          }
 1625|      0|          break;
 1626|  3.18k|        }
 1627|  3.18k|      }
 1628|  1.13k|      if (filename_size > fn_end) {
  ------------------
  |  Branch (1628:11): [True: 0, False: 1.13k]
  ------------------
 1629|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1630|      0|          "Invalid filename");
 1631|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1632|      0|      }
 1633|  1.13k|      filename[filename_size++] = '\0';
 1634|       |      /*
 1635|       |       * Do not increment filename_size here as the computations below
 1636|       |       * add the space for the terminating NUL explicitly.
 1637|       |       */
 1638|  1.13k|      filename[filename_size] = '\0';
 1639|       |
 1640|       |      /* Decoded unicode form is UTF-16BE, so we have to update a string
 1641|       |       * conversion object for it. */
 1642|  1.13k|      if (rar->sconv_utf16be == NULL) {
  ------------------
  |  Branch (1642:11): [True: 23, False: 1.11k]
  ------------------
 1643|     23|        rar->sconv_utf16be = archive_string_conversion_from_charset(
 1644|     23|           &a->archive, "UTF-16BE", 1);
 1645|     23|        if (rar->sconv_utf16be == NULL)
  ------------------
  |  Branch (1645:13): [True: 0, False: 23]
  ------------------
 1646|      0|          return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1647|     23|      }
 1648|  1.13k|      fn_sconv = rar->sconv_utf16be;
 1649|       |
 1650|  1.13k|      strp = filename;
 1651|  2.79k|      while (memcmp(strp, "\x00\x00", 2))
  ------------------
  |  Branch (1651:14): [True: 1.66k, False: 1.13k]
  ------------------
 1652|  1.66k|      {
 1653|  1.66k|        if (!memcmp(strp, "\x00\\", 2))
  ------------------
  |  Branch (1653:13): [True: 0, False: 1.66k]
  ------------------
 1654|      0|          *(strp + 1) = '/';
 1655|  1.66k|        strp += 2;
 1656|  1.66k|      }
 1657|  1.13k|      p += offset;
 1658|  1.13k|    } else {
 1659|       |      /*
 1660|       |       * If FHD_UNICODE is set but no unicode data, this file name form
 1661|       |       * is UTF-8, so we have to update a string conversion object for
 1662|       |       * it accordingly.
 1663|       |       */
 1664|     48|      if (rar->sconv_utf8 == NULL) {
  ------------------
  |  Branch (1664:11): [True: 4, False: 44]
  ------------------
 1665|      4|        rar->sconv_utf8 = archive_string_conversion_from_charset(
 1666|      4|           &a->archive, "UTF-8", 1);
 1667|      4|        if (rar->sconv_utf8 == NULL)
  ------------------
  |  Branch (1667:13): [True: 0, False: 4]
  ------------------
 1668|      0|          return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1669|      4|      }
 1670|     48|      fn_sconv = rar->sconv_utf8;
 1671|     48|      while ((strp = strchr(filename, '\\')) != NULL)
  ------------------
  |  Branch (1671:14): [True: 0, False: 48]
  ------------------
 1672|      0|        *strp = '/';
 1673|     48|      p += filename_size;
 1674|     48|    }
 1675|  1.18k|  }
 1676|    299|  else
 1677|    299|  {
 1678|    299|    fn_sconv = sconv;
 1679|    299|    while ((strp = strchr(filename, '\\')) != NULL)
  ------------------
  |  Branch (1679:12): [True: 0, False: 299]
  ------------------
 1680|      0|      *strp = '/';
 1681|    299|    p += filename_size;
 1682|    299|  }
 1683|       |
 1684|       |  /* Split file in multivolume RAR. No more need to process header. */
 1685|  1.48k|  if (rar->filename_save &&
  ------------------
  |  Branch (1685:7): [True: 1.34k, False: 140]
  ------------------
 1686|  1.34k|    filename_size == rar->filename_save_size &&
  ------------------
  |  Branch (1686:5): [True: 1.07k, False: 267]
  ------------------
 1687|  1.07k|    !memcmp(rar->filename, rar->filename_save, filename_size + 1))
  ------------------
  |  Branch (1687:5): [True: 941, False: 137]
  ------------------
 1688|    941|  {
 1689|    941|    __archive_read_consume(a, header_size - 7);
 1690|    941|    rar->br.avail_in = 0;
 1691|    941|    rar->br.next_in = NULL;
 1692|    941|    rar->cursor++;
 1693|    941|    if (rar->cursor >= rar->nodes)
  ------------------
  |  Branch (1693:9): [True: 941, False: 0]
  ------------------
 1694|    941|    {
 1695|    941|      struct data_block_offsets *newdbo;
 1696|       |
 1697|    941|      newsize = sizeof(*rar->dbo) * (rar->nodes + 1);
 1698|    941|      if ((newdbo = realloc(rar->dbo, newsize)) == NULL)
  ------------------
  |  Branch (1698:11): [True: 0, False: 941]
  ------------------
 1699|      0|      {
 1700|      0|        archive_set_error(&a->archive, ENOMEM, "Couldn't allocate memory");
 1701|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1702|      0|      }
 1703|    941|      rar->dbo = newdbo;
 1704|    941|      rar->nodes++;
 1705|    941|      rar->dbo[rar->cursor].header_size = header_size;
 1706|    941|      rar->dbo[rar->cursor].start_offset = -1;
 1707|    941|      rar->dbo[rar->cursor].end_offset = -1;
 1708|    941|    }
 1709|    941|    if (rar->dbo[rar->cursor].start_offset < 0)
  ------------------
  |  Branch (1709:9): [True: 941, False: 0]
  ------------------
 1710|    941|    {
 1711|    941|      if (rar->packed_size > INT64_MAX - a->filter->position)
  ------------------
  |  Branch (1711:11): [True: 0, False: 941]
  ------------------
 1712|      0|      {
 1713|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1714|      0|                          "Unable to store offsets");
 1715|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1716|      0|      }
 1717|    941|      rar->dbo[rar->cursor].start_offset = a->filter->position;
 1718|    941|      rar->dbo[rar->cursor].end_offset = rar->dbo[rar->cursor].start_offset +
 1719|    941|        rar->packed_size;
 1720|    941|    }
 1721|    941|    return ret;
 1722|    941|  }
 1723|    544|  else if (rar->filename_must_match)
  ------------------
  |  Branch (1723:12): [True: 7, False: 537]
  ------------------
 1724|      7|  {
 1725|      7|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      7|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1726|      7|      "Mismatch of file parts split across multi-volume archive");
 1727|      7|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1728|      7|  }
 1729|       |
 1730|    537|  newsize = filename_size + 1;
 1731|    537|  if ((newptr = realloc(rar->filename_save, newsize)) == NULL)
  ------------------
  |  Branch (1731:7): [True: 0, False: 537]
  ------------------
 1732|      0|  {
 1733|      0|    archive_set_error(&a->archive, ENOMEM, "Couldn't allocate memory");
 1734|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1735|      0|  }
 1736|    537|  rar->filename_save = newptr;
 1737|    537|  memcpy(rar->filename_save, rar->filename, newsize);
 1738|    537|  rar->filename_save_size = filename_size;
 1739|       |
 1740|       |  /* Set info for seeking */
 1741|    537|  free(rar->dbo);
 1742|    537|  if ((rar->dbo = calloc(1, sizeof(*rar->dbo))) == NULL)
  ------------------
  |  Branch (1742:7): [True: 0, False: 537]
  ------------------
 1743|      0|  {
 1744|      0|    archive_set_error(&a->archive, ENOMEM, "Couldn't allocate memory");
 1745|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1746|      0|  }
 1747|    537|  rar->dbo[0].header_size = header_size;
 1748|    537|  rar->dbo[0].start_offset = -1;
 1749|    537|  rar->dbo[0].end_offset = -1;
 1750|    537|  rar->cursor = 0;
 1751|    537|  rar->nodes = 1;
 1752|       |
 1753|    537|  if (rar->file_flags & FHD_SALT)
  ------------------
  |  |   88|    537|#define FHD_SALT         0x0400
  ------------------
  |  Branch (1753:7): [True: 182, False: 355]
  ------------------
 1754|    182|  {
 1755|    182|    if (p + 8 > endp) {
  ------------------
  |  Branch (1755:9): [True: 0, False: 182]
  ------------------
 1756|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1757|      0|        "Invalid header size");
 1758|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1759|      0|    }
 1760|    182|    memcpy(rar->salt, p, 8);
 1761|    182|    p += 8;
 1762|    182|  }
 1763|       |
 1764|    537|  if (rar->file_flags & FHD_EXTTIME) {
  ------------------
  |  |   90|    537|#define FHD_EXTTIME      0x1000
  ------------------
  |  Branch (1764:7): [True: 179, False: 358]
  ------------------
 1765|    179|    if (read_exttime(p, rar, endp) < 0) {
  ------------------
  |  Branch (1765:9): [True: 0, False: 179]
  ------------------
 1766|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1767|      0|        "Invalid header size");
 1768|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1769|      0|    }
 1770|    179|  }
 1771|       |
 1772|    537|  __archive_read_consume(a, header_size - 7);
 1773|    537|  if (rar->packed_size > INT64_MAX - a->filter->position) {
  ------------------
  |  Branch (1773:7): [True: 0, False: 537]
  ------------------
 1774|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1775|      0|                      "Unable to store offsets");
 1776|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1777|      0|  }
 1778|    537|  rar->dbo[0].start_offset = a->filter->position;
 1779|    537|  rar->dbo[0].end_offset = rar->dbo[0].start_offset + rar->packed_size;
 1780|       |
 1781|    537|  switch(file_header.host_os)
 1782|    537|  {
 1783|    411|  case OS_MSDOS:
  ------------------
  |  |  105|    411|#define OS_MSDOS  0
  ------------------
  |  Branch (1783:3): [True: 411, False: 126]
  ------------------
 1784|    430|  case OS_OS2:
  ------------------
  |  |  106|    430|#define OS_OS2    1
  ------------------
  |  Branch (1784:3): [True: 19, False: 518]
  ------------------
 1785|    460|  case OS_WIN32:
  ------------------
  |  |  107|    460|#define OS_WIN32  2
  ------------------
  |  Branch (1785:3): [True: 30, False: 507]
  ------------------
 1786|    460|    rar->mode = (__LA_MODE_T)archive_le32dec(file_header.file_attr);
 1787|    460|    if (rar->mode & FILE_ATTRIBUTE_DIRECTORY)
  ------------------
  |  |  158|    460|#define FILE_ATTRIBUTE_DIRECTORY 0x10
  ------------------
  |  Branch (1787:9): [True: 17, False: 443]
  ------------------
 1788|     17|      rar->mode = AE_IFDIR | S_IXUSR | S_IXGRP | S_IXOTH;
  ------------------
  |  |  221|     17|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1789|    443|    else
 1790|    443|      rar->mode = AE_IFREG;
  ------------------
  |  |  216|    443|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1791|    460|    rar->mode |= S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
 1792|    460|    break;
 1793|       |
 1794|     68|  case OS_UNIX:
  ------------------
  |  |  108|     68|#define OS_UNIX   3
  ------------------
  |  Branch (1794:3): [True: 68, False: 469]
  ------------------
 1795|     77|  case OS_MAC_OS:
  ------------------
  |  |  109|     77|#define OS_MAC_OS 4
  ------------------
  |  Branch (1795:3): [True: 9, False: 528]
  ------------------
 1796|     77|  case OS_BEOS:
  ------------------
  |  |  110|     77|#define OS_BEOS   5
  ------------------
  |  Branch (1796:3): [True: 0, False: 537]
  ------------------
 1797|     77|    rar->mode = (__LA_MODE_T)archive_le32dec(file_header.file_attr);
 1798|     77|    break;
 1799|       |
 1800|      0|  default:
  ------------------
  |  Branch (1800:3): [True: 0, False: 537]
  ------------------
 1801|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1802|      0|                      "Unknown file attributes from RAR file's host OS");
 1803|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1804|    537|  }
 1805|       |
 1806|    537|  rar->bytes_uncopied = rar->bytes_unconsumed = 0;
 1807|    537|  rar->lzss.position = rar->offset = 0;
 1808|    537|  rar->offset_seek = 0;
 1809|    537|  rar->dictionary_size = 0;
 1810|    537|  rar->offset_outgoing = 0;
 1811|    537|  rar->br.cache_avail = 0;
 1812|    537|  rar->br.avail_in = 0;
 1813|    537|  rar->br.next_in = NULL;
 1814|    537|  rar->crc_calculated = 0;
 1815|    537|  rar->entry_eof = 0;
 1816|    537|  rar->valid = 1;
 1817|    537|  rar->is_ppmd_block = 0;
 1818|    537|  rar->start_new_table = 1;
 1819|    537|  free(rar->unp_buffer);
 1820|    537|  rar->unp_buffer = NULL;
 1821|    537|  rar->unp_offset = 0;
 1822|    537|  rar->unp_buffer_size = UNP_BUFFER_SIZE;
  ------------------
  |  |  154|    537|#define UNP_BUFFER_SIZE   (128 * 1024)
  ------------------
 1823|    537|  memset(rar->lengthtable, 0, sizeof(rar->lengthtable));
 1824|    537|  __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context);
 1825|    537|  rar->ppmd_valid = rar->ppmd_eod = 0;
 1826|    537|  rar->filters.filterstart = INT64_MAX;
 1827|       |
 1828|    537|  archive_entry_set_mtime(entry, rar->mtime, rar->mnsec);
 1829|    537|  archive_entry_set_ctime(entry, rar->ctime, rar->cnsec);
 1830|    537|  archive_entry_set_atime(entry, rar->atime, rar->ansec);
 1831|    537|  archive_entry_set_size(entry, rar->unp_size);
 1832|    537|  archive_entry_set_mode(entry, rar->mode);
 1833|       |
 1834|    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 (1834:7): [True: 150, False: 387]
  ------------------
 1835|    150|  {
 1836|    150|    if (errno == ENOMEM)
  ------------------
  |  Branch (1836:9): [True: 0, False: 150]
  ------------------
 1837|      0|    {
 1838|      0|      archive_set_error(&a->archive, ENOMEM,
 1839|      0|                        "Can't allocate memory for Pathname");
 1840|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1841|      0|    }
 1842|    150|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    150|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1843|    150|                      "Pathname cannot be converted from %s to current locale",
 1844|    150|                      archive_string_conversion_charset_name(fn_sconv));
 1845|    150|    ret = (ARCHIVE_WARN);
  ------------------
  |  |  235|    150|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1846|    150|  }
 1847|       |
 1848|    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 (1848:7): [True: 0, False: 537]
  ------------------
 1849|      0|  {
 1850|       |    /* Make sure a symbolic-link file does not have its body. */
 1851|      0|    rar->bytes_remaining = 0;
 1852|      0|    archive_entry_set_size(entry, 0);
 1853|       |
 1854|       |    /* Read a symbolic-link name. */
 1855|      0|    if ((ret2 = read_symlink_stored(a, entry, sconv)) < (ARCHIVE_WARN))
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1855:9): [True: 0, False: 0]
  ------------------
 1856|      0|      return ret2;
 1857|      0|    if (ret > ret2)
  ------------------
  |  Branch (1857:9): [True: 0, False: 0]
  ------------------
 1858|      0|      ret = ret2;
 1859|      0|  }
 1860|       |
 1861|    537|  if (rar->bytes_remaining == 0)
  ------------------
  |  Branch (1861:7): [True: 358, False: 179]
  ------------------
 1862|    358|    rar->entry_eof = 1;
 1863|       |
 1864|    537|  return ret;
 1865|    537|}
archive_read_support_format_rar.c:get_time:
 1869|  1.93k|{
 1870|  1.93k|  struct tm tm;
 1871|  1.93k|  tm.tm_sec = 2 * (ttime & 0x1f);
 1872|  1.93k|  tm.tm_min = (ttime >> 5) & 0x3f;
 1873|  1.93k|  tm.tm_hour = (ttime >> 11) & 0x1f;
 1874|  1.93k|  tm.tm_mday = (ttime >> 16) & 0x1f;
 1875|  1.93k|  tm.tm_mon = ((ttime >> 21) & 0x0f) - 1;
 1876|  1.93k|  tm.tm_year = ((ttime >> 25) & 0x7f) + 80;
 1877|  1.93k|  tm.tm_isdst = -1;
 1878|  1.93k|  return mktime(&tm);
 1879|  1.93k|}
archive_read_support_format_rar.c:read_exttime:
 1883|    179|{
 1884|    179|  unsigned rmode, flags, rem, j, count;
 1885|    179|  int ttime, i;
 1886|    179|  struct tm *tm;
 1887|    179|  time_t t;
 1888|    179|  long nsec;
 1889|    179|#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S)
 1890|    179|  struct tm tmbuf;
 1891|    179|#endif
 1892|       |
 1893|    179|  if (p + 2 > endp)
  ------------------
  |  Branch (1893:7): [True: 0, False: 179]
  ------------------
 1894|      0|    return (-1);
 1895|    179|  flags = archive_le16dec(p);
 1896|    179|  p += 2;
 1897|       |
 1898|    895|  for (i = 3; i >= 0; i--)
  ------------------
  |  Branch (1898:15): [True: 716, False: 179]
  ------------------
 1899|    716|  {
 1900|    716|    t = 0;
 1901|    716|    if (i == 3)
  ------------------
  |  Branch (1901:9): [True: 179, False: 537]
  ------------------
 1902|    179|      t = rar->mtime;
 1903|    716|    rmode = flags >> i * 4;
 1904|    716|    if (rmode & 8)
  ------------------
  |  Branch (1904:9): [True: 492, False: 224]
  ------------------
 1905|    492|    {
 1906|    492|      if (!t)
  ------------------
  |  Branch (1906:11): [True: 359, False: 133]
  ------------------
 1907|    359|      {
 1908|    359|        if (p + 4 > endp)
  ------------------
  |  Branch (1908:13): [True: 0, False: 359]
  ------------------
 1909|      0|          return (-1);
 1910|    359|        ttime = archive_le32dec(p);
 1911|    359|        t = get_time(ttime);
 1912|    359|        p += 4;
 1913|    359|      }
 1914|    492|      rem = 0;
 1915|    492|      count = rmode & 3;
 1916|    492|      if (p + count > endp)
  ------------------
  |  Branch (1916:11): [True: 0, False: 492]
  ------------------
 1917|      0|        return (-1);
 1918|    868|      for (j = 0; j < count; j++)
  ------------------
  |  Branch (1918:19): [True: 376, False: 492]
  ------------------
 1919|    376|      {
 1920|    376|        rem = (((unsigned)(unsigned char)*p) << 16) | (rem >> 8);
 1921|    376|        p++;
 1922|    376|      }
 1923|       |#if defined(HAVE_LOCALTIME_S)
 1924|       |      tm = localtime_s(&tmbuf, &t) ? NULL : &tmbuf;
 1925|       |#elif defined(HAVE_LOCALTIME_R)
 1926|       |      tm = localtime_r(&t, &tmbuf);
 1927|       |#else
 1928|       |      tm = localtime(&t);
 1929|       |#endif
 1930|    492|      nsec = tm->tm_sec + rem / NS_UNIT;
  ------------------
  |  |  124|    492|#define NS_UNIT 10000000
  ------------------
 1931|    492|      if (rmode & 4)
  ------------------
  |  Branch (1931:11): [True: 15, False: 477]
  ------------------
 1932|     15|      {
 1933|     15|        tm->tm_sec++;
 1934|     15|        t = mktime(tm);
 1935|     15|      }
 1936|    492|      if (i == 3)
  ------------------
  |  Branch (1936:11): [True: 133, False: 359]
  ------------------
 1937|    133|      {
 1938|    133|        rar->mtime = t;
 1939|    133|        rar->mnsec = nsec;
 1940|    133|      }
 1941|    359|      else if (i == 2)
  ------------------
  |  Branch (1941:16): [True: 111, False: 248]
  ------------------
 1942|    111|      {
 1943|    111|        rar->ctime = t;
 1944|    111|        rar->cnsec = nsec;
 1945|    111|      }
 1946|    248|      else if (i == 1)
  ------------------
  |  Branch (1946:16): [True: 142, False: 106]
  ------------------
 1947|    142|      {
 1948|    142|        rar->atime = t;
 1949|    142|        rar->ansec = nsec;
 1950|    142|      }
 1951|    106|      else
 1952|    106|      {
 1953|    106|        rar->arctime = t;
 1954|    106|        rar->arcnsec = nsec;
 1955|    106|      }
 1956|    492|    }
 1957|    716|  }
 1958|    179|  return (0);
 1959|    179|}
archive_read_support_format_rar.c:rar_read_ahead:
 3235|  13.4k|{
 3236|  13.4k|  struct rar *rar = (struct rar *)(a->format->data);
 3237|  13.4k|  const void *h;
 3238|  13.4k|  int ret;
 3239|       |
 3240|  14.1k|again:
 3241|  14.1k|  h = __archive_read_ahead(a, min, avail);
 3242|       |
 3243|  14.1k|  if (avail)
  ------------------
  |  Branch (3243:7): [True: 14.1k, False: 0]
  ------------------
 3244|  14.1k|  {
 3245|  14.1k|    if (a->archive.read_data_is_posix_read && *avail > (ssize_t)a->archive.read_data_requested)
  ------------------
  |  Branch (3245:9): [True: 14.1k, False: 0]
  |  Branch (3245:47): [True: 13.3k, False: 801]
  ------------------
 3246|  13.3k|      *avail = a->archive.read_data_requested;
 3247|  14.1k|    if (*avail > rar->bytes_remaining)
  ------------------
  |  Branch (3247:9): [True: 1.44k, False: 12.6k]
  ------------------
 3248|  1.44k|      *avail = (ssize_t)rar->bytes_remaining;
 3249|  14.1k|    if (*avail < 0)
  ------------------
  |  Branch (3249:9): [True: 0, False: 14.1k]
  ------------------
 3250|      0|      return NULL;
 3251|  14.1k|    else if (*avail == 0 && rar->main_flags & MHD_VOLUME &&
  ------------------
  |  |   65|  14.9k|#define MHD_VOLUME       0x0001
  ------------------
  |  Branch (3251:14): [True: 835, False: 13.2k]
  |  Branch (3251:29): [True: 734, False: 101]
  ------------------
 3252|    734|      rar->file_flags & FHD_SPLIT_AFTER)
  ------------------
  |  |   82|    734|#define FHD_SPLIT_AFTER  0x0002
  ------------------
  |  Branch (3252:7): [True: 716, False: 18]
  ------------------
 3253|    716|    {
 3254|    716|      rar->filename_must_match = 1;
 3255|    716|      ret = archive_read_format_rar_read_header(a, a->entry);
 3256|    716|      if (ret == (ARCHIVE_EOF))
  ------------------
  |  |  232|    716|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (3256:11): [True: 10, False: 706]
  ------------------
 3257|     10|      {
 3258|     10|        rar->has_endarc_header = 1;
 3259|     10|        ret = archive_read_format_rar_read_header(a, a->entry);
 3260|     10|      }
 3261|    716|      rar->filename_must_match = 0;
 3262|    716|      if (ret != (ARCHIVE_OK))
  ------------------
  |  |  233|    716|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3262:11): [True: 39, False: 677]
  ------------------
 3263|     39|        return NULL;
 3264|    677|      goto again;
 3265|    716|    }
 3266|  14.1k|  }
 3267|  13.4k|  return h;
 3268|  14.1k|}
archive_read_support_format_rar.c:archive_read_format_rar_read_data:
 1102|  7.87k|{
 1103|  7.87k|  struct rar *rar = (struct rar *)(a->format->data);
 1104|  7.87k|  int ret;
 1105|       |
 1106|  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 (1106:7): [True: 0, False: 7.87k]
  ------------------
 1107|      0|    rar->has_encrypted_entries = 0;
 1108|      0|  }
 1109|       |
 1110|  7.87k|  if (rar->bytes_unconsumed > 0) {
  ------------------
  |  Branch (1110:7): [True: 3.24k, False: 4.62k]
  ------------------
 1111|       |      /* Consume as much as the decompressor actually used. */
 1112|  3.24k|      __archive_read_consume(a, rar->bytes_unconsumed);
 1113|  3.24k|      rar->bytes_unconsumed = 0;
 1114|  3.24k|  }
 1115|       |
 1116|  7.87k|  *buff = NULL;
 1117|  7.87k|  if (rar->entry_eof || rar->offset_seek >= rar->unp_size) {
  ------------------
  |  Branch (1117:7): [True: 619, False: 7.25k]
  |  Branch (1117:25): [True: 11, False: 7.24k]
  ------------------
 1118|    630|    *size = 0;
 1119|    630|    *offset = rar->offset;
 1120|    630|    return (ARCHIVE_EOF);
  ------------------
  |  |  232|    630|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1121|    630|  }
 1122|       |
 1123|  7.24k|  switch (rar->compression_method)
 1124|  7.24k|  {
 1125|    757|  case COMPRESS_METHOD_STORE:
  ------------------
  |  |  113|    757|#define COMPRESS_METHOD_STORE   0x30
  ------------------
  |  Branch (1125:3): [True: 757, False: 6.48k]
  ------------------
 1126|    757|    ret = read_data_stored(a, buff, size, offset);
 1127|    757|    break;
 1128|       |
 1129|  1.00k|  case COMPRESS_METHOD_FASTEST:
  ------------------
  |  |  115|  1.00k|#define COMPRESS_METHOD_FASTEST 0x31
  ------------------
  |  Branch (1129:3): [True: 1.00k, False: 6.24k]
  ------------------
 1130|  1.13k|  case COMPRESS_METHOD_FAST:
  ------------------
  |  |  116|  1.13k|#define COMPRESS_METHOD_FAST    0x32
  ------------------
  |  Branch (1130:3): [True: 139, False: 7.10k]
  ------------------
 1131|  2.46k|  case COMPRESS_METHOD_NORMAL:
  ------------------
  |  |  117|  2.46k|#define COMPRESS_METHOD_NORMAL  0x33
  ------------------
  |  Branch (1131:3): [True: 1.32k, False: 5.92k]
  ------------------
 1132|  3.40k|  case COMPRESS_METHOD_GOOD:
  ------------------
  |  |  119|  3.40k|#define COMPRESS_METHOD_GOOD    0x34
  ------------------
  |  Branch (1132:3): [True: 937, False: 6.30k]
  ------------------
 1133|  6.48k|  case COMPRESS_METHOD_BEST:
  ------------------
  |  |  120|  6.48k|#define COMPRESS_METHOD_BEST    0x35
  ------------------
  |  Branch (1133:3): [True: 3.08k, False: 4.15k]
  ------------------
 1134|  6.48k|    ret = read_data_compressed(a, buff, size, offset, 0);
 1135|  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 (1135:9): [True: 124, False: 6.36k]
  |  Branch (1135:30): [True: 124, False: 0]
  ------------------
 1136|    124|      __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context);
 1137|    124|      rar->start_new_table = 1;
 1138|    124|      rar->ppmd_valid = 0;
 1139|    124|    }
 1140|  6.48k|    break;
 1141|       |
 1142|      1|  default:
  ------------------
  |  Branch (1142:3): [True: 1, False: 7.24k]
  ------------------
 1143|      1|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1144|      1|                      "Unsupported compression method for RAR file");
 1145|      1|    ret = ARCHIVE_FAILED;
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1146|      1|    break;
 1147|  7.24k|  }
 1148|  7.24k|  return (ret);
 1149|  7.24k|}
archive_read_support_format_rar.c:read_data_stored:
 2006|    757|{
 2007|    757|  struct rar *rar;
 2008|    757|  ssize_t bytes_avail;
 2009|       |
 2010|    757|  rar = (struct rar *)(a->format->data);
 2011|    757|  if (rar->bytes_remaining == 0 &&
  ------------------
  |  Branch (2011:7): [True: 715, False: 42]
  ------------------
 2012|    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 (2012:7): [True: 684, False: 31]
  |  Branch (2012:39): [True: 683, False: 1]
  ------------------
 2013|     32|  {
 2014|     32|    *buff = NULL;
 2015|     32|    *size = 0;
 2016|     32|    *offset = rar->offset;
 2017|     32|    if (rar->file_crc != rar->crc_calculated) {
  ------------------
  |  Branch (2017:9): [True: 32, False: 0]
  ------------------
 2018|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 2019|       |      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 2020|       |                        "File CRC error");
 2021|       |      return (ARCHIVE_FAILED);
 2022|       |#endif
 2023|     32|    }
 2024|     32|    rar->entry_eof = 1;
 2025|     32|    return (ARCHIVE_EOF);
  ------------------
  |  |  232|     32|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2026|     32|  }
 2027|       |
 2028|    725|  *buff = rar_read_ahead(a, 1, &bytes_avail);
 2029|    725|  if (bytes_avail <= 0)
  ------------------
  |  Branch (2029:7): [True: 8, False: 717]
  ------------------
 2030|      8|  {
 2031|      8|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      8|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2032|      8|                      "Truncated RAR file data");
 2033|      8|    return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      8|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2034|      8|  }
 2035|       |
 2036|    717|  *size = bytes_avail;
 2037|    717|  *offset = rar->offset;
 2038|    717|  rar->offset += bytes_avail;
 2039|    717|  rar->offset_seek += bytes_avail;
 2040|    717|  rar->bytes_remaining -= bytes_avail;
 2041|    717|  rar->bytes_unconsumed = bytes_avail;
 2042|       |  /* Calculate File CRC. */
 2043|    717|  rar->crc_calculated = crc32(rar->crc_calculated, *buff,
 2044|    717|    (unsigned)bytes_avail);
 2045|    717|  return (ARCHIVE_OK);
  ------------------
  |  |  233|    717|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2046|    725|}
archive_read_support_format_rar.c:read_data_compressed:
 2051|  9.79k|{
 2052|  9.79k|  if (looper++ > MAX_COMPRESS_DEPTH)
  ------------------
  |  |  165|  9.79k|#define MAX_COMPRESS_DEPTH 1024
  ------------------
  |  Branch (2052:7): [True: 1, False: 9.79k]
  ------------------
 2053|      1|    return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2054|       |
 2055|  9.79k|  struct rar *rar;
 2056|  9.79k|  int64_t start, end;
 2057|  9.79k|  size_t bs;
 2058|  9.79k|  int ret = (ARCHIVE_OK), sym, code, lzss_offset, length, i;
  ------------------
  |  |  233|  9.79k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2059|       |
 2060|  9.79k|  rar = (struct rar *)(a->format->data);
 2061|       |
 2062|  22.9k|  do {
 2063|  22.9k|    if (!rar->valid)
  ------------------
  |  Branch (2063:9): [True: 0, False: 22.9k]
  ------------------
 2064|      0|      return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2065|       |
 2066|  22.9k|    if (rar->filters.bytes_ready > 0)
  ------------------
  |  Branch (2066:9): [True: 4.86k, False: 18.0k]
  ------------------
 2067|  4.86k|    {
 2068|       |      /* Flush unp_buffer first */
 2069|  4.86k|      if (rar->unp_offset > 0)
  ------------------
  |  Branch (2069:11): [True: 2.40k, False: 2.46k]
  ------------------
 2070|  2.40k|      {
 2071|  2.40k|        *buff = rar->unp_buffer;
 2072|  2.40k|        *size = rar->unp_offset;
 2073|  2.40k|        rar->unp_offset = 0;
 2074|  2.40k|        *offset = rar->offset_outgoing;
 2075|  2.40k|        rar->offset_outgoing += *size;
 2076|  2.40k|      }
 2077|  2.46k|      else
 2078|  2.46k|      {
 2079|  2.46k|        *buff = rar->filters.bytes;
 2080|  2.46k|        *size = rar->filters.bytes_ready;
 2081|       |
 2082|  2.46k|        rar->offset += *size;
 2083|  2.46k|        *offset = rar->offset_outgoing;
 2084|  2.46k|        rar->offset_outgoing += *size;
 2085|       |
 2086|  2.46k|        rar->filters.bytes_ready -= *size;
 2087|  2.46k|        rar->filters.bytes += *size;
 2088|  2.46k|      }
 2089|  4.86k|      goto ending_block;
 2090|  4.86k|    }
 2091|       |
 2092|  18.0k|    if (rar->ppmd_eod ||
  ------------------
  |  Branch (2092:9): [True: 0, False: 18.0k]
  ------------------
 2093|  18.0k|       (rar->dictionary_size && rar->offset >= rar->unp_size))
  ------------------
  |  Branch (2093:9): [True: 17.9k, False: 125]
  |  Branch (2093:33): [True: 5, False: 17.9k]
  ------------------
 2094|      5|    {
 2095|      5|      if (rar->unp_offset > 0) {
  ------------------
  |  Branch (2095:11): [True: 2, False: 3]
  ------------------
 2096|       |        /*
 2097|       |         * We have unprocessed extracted data. write it out.
 2098|       |         */
 2099|      2|        *buff = rar->unp_buffer;
 2100|      2|        *size = rar->unp_offset;
 2101|      2|        *offset = rar->offset_outgoing;
 2102|      2|        rar->offset_outgoing += *size;
 2103|       |        /* Calculate File CRC. */
 2104|      2|        rar->crc_calculated = crc32(rar->crc_calculated, *buff,
 2105|      2|          (unsigned)*size);
 2106|      2|        rar->unp_offset = 0;
 2107|      2|        return (ARCHIVE_OK);
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2108|      2|      }
 2109|      3|      *buff = NULL;
 2110|      3|      *size = 0;
 2111|      3|      *offset = rar->offset;
 2112|      3|      if (rar->file_crc != rar->crc_calculated) {
  ------------------
  |  Branch (2112:11): [True: 3, False: 0]
  ------------------
 2113|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 2114|       |        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 2115|       |                          "File CRC error");
 2116|       |        return (ARCHIVE_FAILED);
 2117|       |#endif
 2118|      3|      }
 2119|      3|      rar->entry_eof = 1;
 2120|      3|      return (ARCHIVE_EOF);
  ------------------
  |  |  232|      3|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2121|      5|    }
 2122|       |
 2123|  18.0k|    if (!rar->is_ppmd_block && rar->dictionary_size && rar->bytes_uncopied > 0)
  ------------------
  |  Branch (2123:9): [True: 8.47k, False: 9.60k]
  |  Branch (2123:32): [True: 8.35k, False: 125]
  |  Branch (2123:56): [True: 1.49k, False: 6.86k]
  ------------------
 2124|  1.49k|    {
 2125|  1.49k|      if (rar->bytes_uncopied > (rar->unp_buffer_size - rar->unp_offset))
  ------------------
  |  Branch (2125:11): [True: 1.42k, False: 70]
  ------------------
 2126|  1.42k|        bs = rar->unp_buffer_size - rar->unp_offset;
 2127|     70|      else
 2128|     70|        bs = (size_t)rar->bytes_uncopied;
 2129|  1.49k|      ret = copy_from_lzss_window_to_unp(a, buff, rar->offset, bs);
 2130|  1.49k|      if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|  1.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2130:11): [True: 0, False: 1.49k]
  ------------------
 2131|      0|        return (ret);
 2132|  1.49k|      rar->offset += bs;
 2133|  1.49k|      rar->bytes_uncopied -= bs;
 2134|  1.49k|      if (*buff != NULL) {
  ------------------
  |  Branch (2134:11): [True: 1.42k, False: 70]
  ------------------
 2135|  1.42k|        rar->unp_offset = 0;
 2136|  1.42k|        *size = rar->unp_buffer_size;
 2137|  1.42k|        *offset = rar->offset_outgoing;
 2138|  1.42k|        rar->offset_outgoing += *size;
 2139|       |        /* Calculate File CRC. */
 2140|  1.42k|        rar->crc_calculated = crc32(rar->crc_calculated, *buff,
 2141|  1.42k|          (unsigned)*size);
 2142|  1.42k|        return (ret);
 2143|  1.42k|      }
 2144|     70|      continue;
 2145|  1.49k|    }
 2146|       |
 2147|  16.5k|    if (rar->filters.lastend == rar->filters.filterstart)
  ------------------
  |  Branch (2147:9): [True: 2.48k, False: 14.0k]
  ------------------
 2148|  2.48k|    {
 2149|  2.48k|      if (!run_filters(a))
  ------------------
  |  Branch (2149:11): [True: 28, False: 2.46k]
  ------------------
 2150|     28|        return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     28|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2151|  2.46k|      continue;
 2152|  2.48k|    }
 2153|       |
 2154|  14.0k|    if (!rar->br.next_in &&
  ------------------
  |  Branch (2154:9): [True: 128, False: 13.9k]
  ------------------
 2155|    128|      (ret = rar_br_preparation(a, &(rar->br))) < ARCHIVE_WARN)
  ------------------
  |  |  235|    128|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (2155:7): [True: 3, False: 125]
  ------------------
 2156|      3|      return (ret);
 2157|  14.0k|    if (rar->start_new_table && ((ret = parse_codes(a)) < (ARCHIVE_WARN)))
  ------------------
  |  |  235|  3.43k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (2157:9): [True: 3.43k, False: 10.6k]
  |  Branch (2157:33): [True: 7, False: 3.43k]
  ------------------
 2158|      7|      return (ret);
 2159|       |
 2160|  14.0k|    if (rar->is_ppmd_block)
  ------------------
  |  Branch (2160:9): [True: 9.60k, False: 4.48k]
  ------------------
 2161|  9.60k|    {
 2162|  9.60k|      if ((sym = __archive_ppmd7_functions.Ppmd7_DecodeSymbol(
  ------------------
  |  Branch (2162:11): [True: 0, False: 9.60k]
  ------------------
 2163|  9.60k|        &rar->ppmd7_context, &rar->range_dec.p)) < 0)
 2164|      0|      {
 2165|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2166|      0|                          "Invalid symbol");
 2167|      0|        return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2168|      0|      }
 2169|  9.60k|      if(sym != rar->ppmd_escape)
  ------------------
  |  Branch (2169:10): [True: 6.29k, False: 3.30k]
  ------------------
 2170|  6.29k|      {
 2171|  6.29k|        lzss_emit_literal(rar, sym);
 2172|  6.29k|        rar->bytes_uncopied++;
 2173|  6.29k|      }
 2174|  3.30k|      else
 2175|  3.30k|      {
 2176|  3.30k|        if ((code = __archive_ppmd7_functions.Ppmd7_DecodeSymbol(
  ------------------
  |  Branch (2176:13): [True: 0, False: 3.30k]
  ------------------
 2177|  3.30k|          &rar->ppmd7_context, &rar->range_dec.p)) < 0)
 2178|      0|        {
 2179|      0|          archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2180|      0|                            "Invalid symbol");
 2181|      0|          return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2182|      0|        }
 2183|       |
 2184|  3.30k|        switch(code)
 2185|  3.30k|        {
 2186|  3.30k|          case 0:
  ------------------
  |  Branch (2186:11): [True: 3.30k, False: 0]
  ------------------
 2187|  3.30k|            rar->start_new_table = 1;
 2188|  3.30k|            return read_data_compressed(a, buff, size, offset, looper);
 2189|       |
 2190|      0|          case 2:
  ------------------
  |  Branch (2190:11): [True: 0, False: 3.30k]
  ------------------
 2191|      0|            rar->ppmd_eod = 1;/* End Of ppmd Data. */
 2192|      0|            continue;
 2193|       |
 2194|      0|          case 3:
  ------------------
  |  Branch (2194:11): [True: 0, False: 3.30k]
  ------------------
 2195|      0|            archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2196|      0|                              "Parsing filters is unsupported");
 2197|      0|            return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2198|       |
 2199|      0|          case 4:
  ------------------
  |  Branch (2199:11): [True: 0, False: 3.30k]
  ------------------
 2200|      0|            lzss_offset = 0;
 2201|      0|            for (i = 2; i >= 0; i--)
  ------------------
  |  Branch (2201:25): [True: 0, False: 0]
  ------------------
 2202|      0|            {
 2203|      0|              if ((code = __archive_ppmd7_functions.Ppmd7_DecodeSymbol(
  ------------------
  |  Branch (2203:19): [True: 0, False: 0]
  ------------------
 2204|      0|                &rar->ppmd7_context, &rar->range_dec.p)) < 0)
 2205|      0|              {
 2206|      0|                archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2207|      0|                                  "Invalid symbol");
 2208|      0|                return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2209|      0|              }
 2210|      0|              lzss_offset |= code << (i * 8);
 2211|      0|            }
 2212|      0|            if ((length = __archive_ppmd7_functions.Ppmd7_DecodeSymbol(
  ------------------
  |  Branch (2212:17): [True: 0, False: 0]
  ------------------
 2213|      0|              &rar->ppmd7_context, &rar->range_dec.p)) < 0)
 2214|      0|            {
 2215|      0|              archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2216|      0|                                "Invalid symbol");
 2217|      0|              return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2218|      0|            }
 2219|      0|            lzss_emit_match(rar, lzss_offset + 2, length + 32);
 2220|      0|            rar->bytes_uncopied += length + 32;
 2221|      0|            break;
 2222|       |
 2223|      0|          case 5:
  ------------------
  |  Branch (2223:11): [True: 0, False: 3.30k]
  ------------------
 2224|      0|            if ((length = __archive_ppmd7_functions.Ppmd7_DecodeSymbol(
  ------------------
  |  Branch (2224:17): [True: 0, False: 0]
  ------------------
 2225|      0|              &rar->ppmd7_context, &rar->range_dec.p)) < 0)
 2226|      0|            {
 2227|      0|              archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2228|      0|                                "Invalid symbol");
 2229|      0|              return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2230|      0|            }
 2231|      0|            lzss_emit_match(rar, 1, length + 4);
 2232|      0|            rar->bytes_uncopied += length + 4;
 2233|      0|            break;
 2234|       |
 2235|      0|         default:
  ------------------
  |  Branch (2235:10): [True: 0, False: 3.30k]
  ------------------
 2236|      0|           lzss_emit_literal(rar, sym);
 2237|      0|           rar->bytes_uncopied++;
 2238|  3.30k|        }
 2239|  3.30k|      }
 2240|  9.60k|    }
 2241|  4.48k|    else
 2242|  4.48k|    {
 2243|  4.48k|      start = rar->offset;
 2244|  4.48k|      end = start + rar->dictionary_size;
 2245|       |
 2246|       |      /* We don't want to overflow the window and overwrite data that we write
 2247|       |       * at 'start'. Therefore, reduce the end length by the maximum match size,
 2248|       |       * which is 260 bytes. You can compute this maximum by looking at the
 2249|       |       * definition of 'expand', in particular when 'symbol >= 271'. */
 2250|       |      /* NOTE: It's possible for 'dictionary_size' to be less than this 260
 2251|       |       * value, however that will only be the case when 'unp_size' is small,
 2252|       |       * which should only happen when the entry size is small and there's no
 2253|       |       * risk of overflowing the buffer */
 2254|  4.48k|      if (rar->dictionary_size > 260) {
  ------------------
  |  Branch (2254:11): [True: 4.48k, False: 0]
  ------------------
 2255|  4.48k|        end -= 260;
 2256|  4.48k|      }
 2257|       |
 2258|  4.48k|      if (rar->filters.filterstart < end) {
  ------------------
  |  Branch (2258:11): [True: 1.18k, False: 3.30k]
  ------------------
 2259|  1.18k|        end = rar->filters.filterstart;
 2260|  1.18k|      }
 2261|       |
 2262|  4.48k|      ret = expand(a, &end);
 2263|  4.48k|      if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|  4.48k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2263:11): [True: 76, False: 4.40k]
  ------------------
 2264|     76|        return (ret);
 2265|       |
 2266|  4.40k|      rar->bytes_uncopied = end - start;
 2267|  4.40k|      rar->filters.lastend = end;
 2268|  4.40k|      if (rar->filters.lastend != rar->filters.filterstart && rar->bytes_uncopied == 0) {
  ------------------
  |  Branch (2268:11): [True: 1.91k, False: 2.49k]
  |  Branch (2268:63): [True: 1, False: 1.91k]
  ------------------
 2269|       |          /* Broken RAR files cause this case.
 2270|       |          * NOTE: If this case were possible on a normal RAR file
 2271|       |          * we would find out where it was actually bad and
 2272|       |          * what we would do to solve it. */
 2273|      1|          archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2274|      1|                            "Internal error extracting RAR file");
 2275|      1|          return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2276|      1|      }
 2277|  4.40k|    }
 2278|  10.7k|    if (rar->bytes_uncopied > (rar->unp_buffer_size - rar->unp_offset))
  ------------------
  |  Branch (2278:9): [True: 72, False: 10.6k]
  ------------------
 2279|     72|      bs = rar->unp_buffer_size - rar->unp_offset;
 2280|  10.6k|    else
 2281|  10.6k|      bs = (size_t)rar->bytes_uncopied;
 2282|  10.7k|    ret = copy_from_lzss_window_to_unp(a, buff, rar->offset, bs);
 2283|  10.7k|    if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|  10.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2283:9): [True: 5, False: 10.7k]
  ------------------
 2284|      5|      return (ret);
 2285|  10.7k|    rar->offset += bs;
 2286|  10.7k|    rar->bytes_uncopied -= bs;
 2287|       |    /*
 2288|       |     * If *buff is NULL, it means unp_buffer is not full.
 2289|       |     * So we have to continue extracting a RAR file.
 2290|       |     */
 2291|  13.2k|  } while (*buff == NULL);
  ------------------
  |  Branch (2291:12): [True: 13.1k, False: 72]
  ------------------
 2292|       |
 2293|     72|  rar->unp_offset = 0;
 2294|     72|  *size = rar->unp_buffer_size;
 2295|     72|  *offset = rar->offset_outgoing;
 2296|     72|  rar->offset_outgoing += *size;
 2297|  4.93k|ending_block:
 2298|       |  /* Calculate File CRC. */
 2299|  4.93k|  rar->crc_calculated = crc32(rar->crc_calculated, *buff, (unsigned)*size);
 2300|  4.93k|  return ret;
 2301|     72|}
archive_read_support_format_rar.c:copy_from_lzss_window_to_unp:
 3178|  12.1k|{
 3179|  12.1k|  int windowoffs, firstpart;
 3180|  12.1k|  struct rar *rar = (struct rar *)(a->format->data);
 3181|       |
 3182|  12.1k|  if (length > rar->unp_buffer_size)
  ------------------
  |  Branch (3182:7): [True: 5, False: 12.1k]
  ------------------
 3183|      5|  {
 3184|      5|    goto fatal;
 3185|      5|  }
 3186|       |
 3187|  12.1k|  if (!rar->unp_buffer)
  ------------------
  |  Branch (3187:7): [True: 112, False: 12.0k]
  ------------------
 3188|    112|  {
 3189|    112|    if ((rar->unp_buffer = malloc(rar->unp_buffer_size)) == NULL)
  ------------------
  |  Branch (3189:9): [True: 0, False: 112]
  ------------------
 3190|      0|    {
 3191|      0|      archive_set_error(&a->archive, ENOMEM,
 3192|      0|                        "Unable to allocate memory for uncompressed data");
 3193|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3194|      0|    }
 3195|    112|  }
 3196|       |
 3197|  12.1k|  windowoffs = lzss_offset_for_position(&rar->lzss, startpos);
 3198|  12.1k|  if(windowoffs + length <= (size_t)lzss_size(&rar->lzss)) {
  ------------------
  |  Branch (3198:6): [True: 11.6k, False: 570]
  ------------------
 3199|  11.6k|    memcpy(&rar->unp_buffer[rar->unp_offset], &rar->lzss.window[windowoffs],
 3200|  11.6k|           length);
 3201|  11.6k|  } else if (length <= (size_t)lzss_size(&rar->lzss)) {
  ------------------
  |  Branch (3201:14): [True: 570, False: 0]
  ------------------
 3202|    570|    firstpart = lzss_size(&rar->lzss) - windowoffs;
 3203|    570|    if (firstpart < 0) {
  ------------------
  |  Branch (3203:9): [True: 0, False: 570]
  ------------------
 3204|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3205|      0|                        "Bad RAR file data");
 3206|      0|      return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3207|      0|    }
 3208|    570|    if ((size_t)firstpart < length) {
  ------------------
  |  Branch (3208:9): [True: 570, False: 0]
  ------------------
 3209|    570|      memcpy(&rar->unp_buffer[rar->unp_offset],
 3210|    570|             &rar->lzss.window[windowoffs], firstpart);
 3211|    570|      memcpy(&rar->unp_buffer[rar->unp_offset + firstpart],
 3212|    570|             &rar->lzss.window[0], length - firstpart);
 3213|    570|    } else {
 3214|      0|      memcpy(&rar->unp_buffer[rar->unp_offset],
 3215|      0|             &rar->lzss.window[windowoffs], length);
 3216|      0|    }
 3217|    570|  } else {
 3218|      0|      goto fatal;
 3219|      0|  }
 3220|  12.1k|  rar->unp_offset += (unsigned int) length;
 3221|  12.1k|  if (rar->unp_offset >= rar->unp_buffer_size)
  ------------------
  |  Branch (3221:7): [True: 1.49k, False: 10.6k]
  ------------------
 3222|  1.49k|    *buffer = rar->unp_buffer;
 3223|  10.6k|  else
 3224|  10.6k|    *buffer = NULL;
 3225|  12.1k|  return (ARCHIVE_OK);
  ------------------
  |  |  233|  12.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3226|       |
 3227|      5|fatal:
 3228|      5|  archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      5|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3229|      5|                    "Bad RAR file data");
 3230|      5|  return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      5|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3231|  12.1k|}
archive_read_support_format_rar.c:lzss_offset_for_position:
  646|  18.8M|{
  647|  18.8M|  return (int)(pos & lzss->mask);
  648|  18.8M|}
archive_read_support_format_rar.c:lzss_size:
  640|  1.45M|{
  641|  1.45M|  return lzss->mask + 1;
  642|  1.45M|}
archive_read_support_format_rar.c:run_filters:
 3440|  2.48k|{
 3441|  2.48k|  struct rar *rar = (struct rar *)(a->format->data);
 3442|  2.48k|  struct rar_filters *filters = &rar->filters;
 3443|  2.48k|  struct rar_filter *filter = filters->stack;
 3444|  2.48k|  struct rar_filter *f;
 3445|  2.48k|  size_t start, end;
 3446|  2.48k|  int64_t tend;
 3447|  2.48k|  uint32_t lastfilteraddress;
 3448|  2.48k|  uint32_t lastfilterlength;
 3449|  2.48k|  int ret;
 3450|       |
 3451|  2.48k|  if (filters == NULL || filter == NULL)
  ------------------
  |  Branch (3451:7): [True: 0, False: 2.48k]
  |  Branch (3451:26): [True: 0, False: 2.48k]
  ------------------
 3452|      0|    return (0);
 3453|       |
 3454|  2.48k|  start = (size_t)filters->filterstart;
 3455|  2.48k|  end = start + filter->blocklength;
 3456|       |
 3457|  2.48k|  filters->filterstart = INT64_MAX;
 3458|  2.48k|  tend = (int64_t)end;
 3459|  2.48k|  ret = expand(a, &tend);
 3460|  2.48k|  if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|  2.48k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3460:7): [True: 15, False: 2.47k]
  ------------------
 3461|     15|    return 0;
 3462|       |
 3463|       |  /* Check if filter stack was modified in expand() */
 3464|  2.47k|  ret = ARCHIVE_FATAL;
  ------------------
  |  |  239|  2.47k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3465|  2.47k|  f = filters->stack;
 3466|  2.47k|  while (f)
  ------------------
  |  Branch (3466:10): [True: 2.47k, False: 0]
  ------------------
 3467|  2.47k|  {
 3468|  2.47k|    if (f == filter)
  ------------------
  |  Branch (3468:9): [True: 2.47k, False: 0]
  ------------------
 3469|  2.47k|    {
 3470|  2.47k|      ret = ARCHIVE_OK;
  ------------------
  |  |  233|  2.47k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3471|  2.47k|      break;
 3472|  2.47k|    }
 3473|      0|    f = f->next;
 3474|      0|  }
 3475|  2.47k|  if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|  2.47k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3475:7): [True: 0, False: 2.47k]
  ------------------
 3476|      0|    return 0;
 3477|       |
 3478|  2.47k|  if (tend < 0)
  ------------------
  |  Branch (3478:7): [True: 0, False: 2.47k]
  ------------------
 3479|      0|    return 0;
 3480|  2.47k|  end = (size_t)tend;
 3481|  2.47k|  if (end != start + filter->blocklength)
  ------------------
  |  Branch (3481:7): [True: 1, False: 2.47k]
  ------------------
 3482|      1|    return 0;
 3483|       |
 3484|  2.47k|  if (!filters->vm)
  ------------------
  |  Branch (3484:7): [True: 65, False: 2.40k]
  ------------------
 3485|     65|  {
 3486|     65|    filters->vm = calloc(1, sizeof(*filters->vm));
 3487|     65|    if (!filters->vm)
  ------------------
  |  Branch (3487:9): [True: 0, False: 65]
  ------------------
 3488|      0|      return 0;
 3489|     65|  }
 3490|       |
 3491|  2.47k|  if (filter->blocklength > VM_MEMORY_SIZE)
  ------------------
  |  |  139|  2.47k|#define VM_MEMORY_SIZE 0x40000
  ------------------
  |  Branch (3491:7): [True: 1, False: 2.47k]
  ------------------
 3492|      1|  {
 3493|      1|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "Bad RAR file data");
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3494|      1|    return 0;
 3495|      1|  }
 3496|       |
 3497|  2.47k|  ret = copy_from_lzss_window(a, filters->vm->memory, start, filter->blocklength);
 3498|  2.47k|  if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|  2.47k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3498:7): [True: 0, False: 2.47k]
  ------------------
 3499|      0|    return 0;
 3500|  2.47k|  if (!execute_filter(a, filter, filters->vm, (size_t)rar->offset))
  ------------------
  |  Branch (3500:7): [True: 9, False: 2.46k]
  ------------------
 3501|      9|    return 0;
 3502|       |
 3503|  2.46k|  lastfilteraddress = filter->filteredblockaddress;
 3504|  2.46k|  lastfilterlength = filter->filteredblocklength;
 3505|  2.46k|  filters->stack = filter->next;
 3506|  2.46k|  filter->next = NULL;
 3507|  2.46k|  delete_filter(filter);
 3508|       |
 3509|  2.46k|  while ((filter = filters->stack) != NULL && (int64_t)filter->blockstartpos == filters->filterstart && filter->blocklength == lastfilterlength)
  ------------------
  |  Branch (3509:10): [True: 957, False: 1.50k]
  |  Branch (3509:47): [True: 0, False: 957]
  |  Branch (3509:105): [True: 0, False: 0]
  ------------------
 3510|      0|  {
 3511|      0|    memmove(&filters->vm->memory[0], &filters->vm->memory[lastfilteraddress], lastfilterlength);
 3512|      0|    if (!execute_filter(a, filter, filters->vm, (size_t)rar->offset))
  ------------------
  |  Branch (3512:9): [True: 0, False: 0]
  ------------------
 3513|      0|      return 0;
 3514|       |
 3515|      0|    lastfilteraddress = filter->filteredblockaddress;
 3516|      0|    lastfilterlength = filter->filteredblocklength;
 3517|      0|    filters->stack = filter->next;
 3518|      0|    filter->next = NULL;
 3519|      0|    delete_filter(filter);
 3520|      0|  }
 3521|       |
 3522|  2.46k|  if (filters->stack)
  ------------------
  |  Branch (3522:7): [True: 957, False: 1.50k]
  ------------------
 3523|    957|  {
 3524|    957|    if (filters->stack->blockstartpos < end)
  ------------------
  |  Branch (3524:9): [True: 2, False: 955]
  ------------------
 3525|      2|      return 0;
 3526|    955|    filters->filterstart = filters->stack->blockstartpos;
 3527|    955|  }
 3528|       |
 3529|  2.46k|  filters->lastend = end;
 3530|  2.46k|  filters->bytes = &filters->vm->memory[lastfilteraddress];
 3531|  2.46k|  filters->bytes_ready = lastfilterlength;
 3532|       |
 3533|  2.46k|  return 1;
 3534|  2.46k|}
archive_read_support_format_rar.c:copy_from_lzss_window:
 3150|  2.47k|{
 3151|  2.47k|  int windowoffs, firstpart;
 3152|  2.47k|  struct rar *rar = (struct rar *)(a->format->data);
 3153|       |
 3154|  2.47k|  windowoffs = lzss_offset_for_position(&rar->lzss, startpos);
 3155|  2.47k|  firstpart = lzss_size(&rar->lzss) - windowoffs;
 3156|  2.47k|  if (length > lzss_size(&rar->lzss)) {
  ------------------
  |  Branch (3156:7): [True: 0, False: 2.47k]
  ------------------
 3157|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3158|      0|                      "Bad RAR file data");
 3159|      0|    return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3160|      0|  }
 3161|  2.47k|  if (firstpart < 0) {
  ------------------
  |  Branch (3161:7): [True: 0, False: 2.47k]
  ------------------
 3162|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3163|      0|                      "Bad RAR file data");
 3164|      0|    return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3165|      0|  }
 3166|  2.47k|  if (firstpart < length) {
  ------------------
  |  Branch (3166:7): [True: 1, False: 2.47k]
  ------------------
 3167|      1|    memcpy(buffer, &rar->lzss.window[windowoffs], firstpart);
 3168|      1|    memcpy(buffer + firstpart, &rar->lzss.window[0], length - firstpart);
 3169|  2.47k|  } else {
 3170|  2.47k|    memcpy(buffer, &rar->lzss.window[windowoffs], length);
 3171|  2.47k|  }
 3172|  2.47k|  return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.47k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3173|  2.47k|}
archive_read_support_format_rar.c:execute_filter:
 3896|  2.47k|{
 3897|  2.47k|  if (filter->prog->fingerprint == 0x1D0E06077D)
  ------------------
  |  Branch (3897:7): [True: 962, False: 1.51k]
  ------------------
 3898|    962|    return execute_filter_delta(filter, vm);
 3899|  1.51k|  if (filter->prog->fingerprint == 0x35AD576887)
  ------------------
  |  Branch (3899:7): [True: 878, False: 632]
  ------------------
 3900|    878|    return execute_filter_e8(filter, vm, pos, 0);
 3901|    632|  if (filter->prog->fingerprint == 0x393CD7E57E)
  ------------------
  |  Branch (3901:7): [True: 0, False: 632]
  ------------------
 3902|      0|    return execute_filter_e8(filter, vm, pos, 1);
 3903|    632|  if (filter->prog->fingerprint == 0x951C2C5DC8)
  ------------------
  |  Branch (3903:7): [True: 632, False: 0]
  ------------------
 3904|    632|    return execute_filter_rgb(filter, vm);
 3905|      0|  if (filter->prog->fingerprint == 0xD8BC85E701)
  ------------------
  |  Branch (3905:7): [True: 0, False: 0]
  ------------------
 3906|      0|    return execute_filter_audio(filter, vm);
 3907|       |
 3908|      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
  ------------------
 3909|      0|  return 0;
 3910|      0|}
archive_read_support_format_rar.c:execute_filter_delta:
 3711|    962|{
 3712|    962|  uint32_t length = filter->initialregisters[4];
 3713|    962|  uint32_t numchannels = filter->initialregisters[0];
 3714|    962|  uint8_t *src, *dst;
 3715|    962|  uint32_t i, idx;
 3716|       |
 3717|    962|  if (length > PROGRAM_WORK_SIZE / 2)
  ------------------
  |  |  141|    962|#define PROGRAM_WORK_SIZE 0x3C000
  ------------------
  |  Branch (3717:7): [True: 0, False: 962]
  ------------------
 3718|      0|    return 0;
 3719|       |
 3720|    962|  src = &vm->memory[0];
 3721|    962|  dst = &vm->memory[length];
 3722|   245M|  for (i = 0; i < numchannels; i++)
  ------------------
  |  Branch (3722:15): [True: 245M, False: 961]
  ------------------
 3723|   245M|  {
 3724|   245M|    uint8_t lastbyte = 0;
 3725|   245M|    for (idx = i; idx < length; idx += numchannels)
  ------------------
  |  Branch (3725:19): [True: 69.6k, False: 245M]
  ------------------
 3726|  69.6k|    {
 3727|       |      /*
 3728|       |       * The src block should not overlap with the dst block.
 3729|       |       * If so it would be better to consider this archive is broken.
 3730|       |       */
 3731|  69.6k|      if (src >= dst)
  ------------------
  |  Branch (3731:11): [True: 1, False: 69.6k]
  ------------------
 3732|      1|        return 0;
 3733|  69.6k|      lastbyte = dst[idx] = lastbyte - *src++;
 3734|  69.6k|    }
 3735|   245M|  }
 3736|       |
 3737|    961|  filter->filteredblockaddress = length;
 3738|    961|  filter->filteredblocklength = length;
 3739|       |
 3740|    961|  return 1;
 3741|    962|}
archive_read_support_format_rar.c:execute_filter_e8:
 3745|    878|{
 3746|    878|  uint32_t length = filter->initialregisters[4];
 3747|    878|  uint32_t filesize = 0x1000000;
 3748|    878|  uint32_t i;
 3749|       |
 3750|    878|  if (length > PROGRAM_WORK_SIZE || length <= 4)
  ------------------
  |  |  141|  1.75k|#define PROGRAM_WORK_SIZE 0x3C000
  ------------------
  |  Branch (3750:7): [True: 8, False: 870]
  |  Branch (3750:37): [True: 0, False: 870]
  ------------------
 3751|      8|    return 0;
 3752|       |
 3753|   244k|  for (i = 0; i <= length - 5; i++)
  ------------------
  |  Branch (3753:15): [True: 243k, False: 870]
  ------------------
 3754|   243k|  {
 3755|   243k|    if (vm->memory[i] == 0xE8 || (e9also && vm->memory[i] == 0xE9))
  ------------------
  |  Branch (3755:9): [True: 1.65k, False: 242k]
  |  Branch (3755:35): [True: 0, False: 242k]
  |  Branch (3755:45): [True: 0, False: 0]
  ------------------
 3756|  1.65k|    {
 3757|  1.65k|      uint32_t currpos = (uint32_t)pos + i + 1;
 3758|  1.65k|      int32_t address = (int32_t)vm_read_32(vm, i + 1);
 3759|  1.65k|      if (address < 0 && currpos >= (~(uint32_t)address + 1))
  ------------------
  |  Branch (3759:11): [True: 559, False: 1.09k]
  |  Branch (3759:26): [True: 9, False: 550]
  ------------------
 3760|      9|        vm_write_32(vm, i + 1, address + filesize);
 3761|  1.64k|      else if (address >= 0 && (uint32_t)address < filesize)
  ------------------
  |  Branch (3761:16): [True: 1.09k, False: 550]
  |  Branch (3761:32): [True: 287, False: 807]
  ------------------
 3762|    287|        vm_write_32(vm, i + 1, address - currpos);
 3763|  1.65k|      i += 4;
 3764|  1.65k|    }
 3765|   243k|  }
 3766|       |
 3767|    870|  filter->filteredblockaddress = 0;
 3768|    870|  filter->filteredblocklength = length;
 3769|       |
 3770|    870|  return 1;
 3771|    878|}
archive_read_support_format_rar.c:vm_read_32:
 3932|  1.65k|{
 3933|  1.65k|  return archive_le32dec(vm->memory + offset);
 3934|  1.65k|}
archive_read_support_format_rar.c:vm_write_32:
 3926|    296|{
 3927|    296|  archive_le32enc(vm->memory + offset, u32);
 3928|    296|}
archive_read_support_format_rar.c:execute_filter_rgb:
 3775|    632|{
 3776|    632|  uint32_t stride = filter->initialregisters[0];
 3777|    632|  uint32_t byteoffset = filter->initialregisters[1];
 3778|    632|  uint32_t blocklength = filter->initialregisters[4];
 3779|    632|  uint8_t *src, *dst;
 3780|    632|  uint32_t i, j;
 3781|       |
 3782|    632|  if (blocklength > PROGRAM_WORK_SIZE / 2 || stride > blocklength || blocklength < 3 || byteoffset > 2)
  ------------------
  |  |  141|    632|#define PROGRAM_WORK_SIZE 0x3C000
  ------------------
  |  Branch (3782:7): [True: 0, False: 632]
  |  Branch (3782:46): [True: 0, False: 632]
  |  Branch (3782:70): [True: 0, False: 632]
  |  Branch (3782:89): [True: 0, False: 632]
  ------------------
 3783|      0|    return 0;
 3784|       |
 3785|    632|  src = &vm->memory[0];
 3786|    632|  dst = &vm->memory[blocklength];
 3787|  2.52k|  for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (3787:15): [True: 1.89k, False: 632]
  ------------------
 3788|  1.89k|    uint8_t byte = 0;
 3789|  1.89k|    uint8_t *prev = dst + i - stride;
 3790|  21.2k|    for (j = i; j < blocklength; j += 3)
  ------------------
  |  Branch (3790:17): [True: 19.3k, False: 1.89k]
  ------------------
 3791|  19.3k|    {
 3792|       |      /*
 3793|       |       * The src block should not overlap with the dst block.
 3794|       |       * If so it would be better to consider this archive is broken.
 3795|       |       */
 3796|  19.3k|      if (src >= dst)
  ------------------
  |  Branch (3796:11): [True: 0, False: 19.3k]
  ------------------
 3797|      0|        return 0;
 3798|       |
 3799|  19.3k|      if (prev >= dst)
  ------------------
  |  Branch (3799:11): [True: 19.2k, False: 98]
  ------------------
 3800|  19.2k|      {
 3801|  19.2k|        uint32_t delta1 = abs(prev[3] - prev[0]);
 3802|  19.2k|        uint32_t delta2 = abs(byte - prev[0]);
 3803|  19.2k|        uint32_t delta3 = abs(prev[3] - prev[0] + byte - prev[0]);
 3804|  19.2k|        if (delta1 > delta2 || delta1 > delta3)
  ------------------
  |  Branch (3804:13): [True: 8.58k, False: 10.6k]
  |  Branch (3804:32): [True: 495, False: 10.1k]
  ------------------
 3805|  9.08k|          byte = delta2 <= delta3 ? prev[3] : prev[0];
  ------------------
  |  Branch (3805:18): [True: 8.30k, False: 775]
  ------------------
 3806|  19.2k|      }
 3807|  19.3k|      byte -= *src++;
 3808|  19.3k|      dst[j] = byte;
 3809|  19.3k|      prev += 3;
 3810|  19.3k|    }
 3811|  1.89k|  }
 3812|  6.72k|  for (i = byteoffset; i < blocklength - 2; i += 3)
  ------------------
  |  Branch (3812:24): [True: 6.09k, False: 632]
  ------------------
 3813|  6.09k|  {
 3814|  6.09k|    dst[i] += dst[i + 1];
 3815|  6.09k|    dst[i + 2] += dst[i + 1];
 3816|  6.09k|  }
 3817|       |
 3818|    632|  filter->filteredblockaddress = blocklength;
 3819|    632|  filter->filteredblocklength = blocklength;
 3820|       |
 3821|    632|  return 1;
 3822|    632|}
archive_read_support_format_rar.c:delete_filter:
 3584|  6.01k|{
 3585|  17.4k|  while (filter)
  ------------------
  |  Branch (3585:10): [True: 11.4k, False: 6.01k]
  ------------------
 3586|  11.4k|  {
 3587|  11.4k|    struct rar_filter *next = filter->next;
 3588|  11.4k|    free(filter->globaldata);
 3589|  11.4k|    free(filter);
 3590|  11.4k|    filter = next;
 3591|  11.4k|  }
 3592|  6.01k|}
archive_read_support_format_rar.c:rar_br_preparation:
  596|    128|{
  597|    128|  struct rar *rar = (struct rar *)(a->format->data);
  598|       |
  599|    128|  if (rar->bytes_remaining > 0) {
  ------------------
  |  Branch (599:7): [True: 128, False: 0]
  ------------------
  600|    128|    br->next_in = rar_read_ahead(a, 1, &(br->avail_in));
  601|    128|    if (br->next_in == NULL) {
  ------------------
  |  Branch (601:9): [True: 3, False: 125]
  ------------------
  602|      3|      archive_set_error(&a->archive,
  603|      3|          ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  604|      3|          "Truncated RAR file data");
  605|      3|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  606|      3|    }
  607|    125|    if (br->cache_avail == 0)
  ------------------
  |  Branch (607:9): [True: 125, False: 0]
  ------------------
  608|    125|      (void)rar_br_fillup(a, br);
  609|    125|  }
  610|    125|  return (ARCHIVE_OK);
  ------------------
  |  |  233|    125|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  611|    128|}
archive_read_support_format_rar.c:rar_br_fillup:
  501|   650k|{
  502|   650k|  struct rar *rar = (struct rar *)(a->format->data);
  503|   650k|  int n = CACHE_BITS - br->cache_avail;
  ------------------
  |  |  382|   650k|#define CACHE_BITS	(8 * sizeof(CACHE_TYPE))
  ------------------
  504|       |
  505|   717k|  for (;;) {
  506|   717k|    switch (n >> 3) {
  507|  41.6k|    case 8:
  ------------------
  |  Branch (507:5): [True: 41.6k, False: 676k]
  ------------------
  508|  41.6k|      if (br->avail_in >= 8) {
  ------------------
  |  Branch (508:11): [True: 41.2k, False: 409]
  ------------------
  509|  41.2k|        br->cache_buffer =
  510|  41.2k|            ((uint64_t)br->next_in[0]) << 56 |
  511|  41.2k|            ((uint64_t)br->next_in[1]) << 48 |
  512|  41.2k|            ((uint64_t)br->next_in[2]) << 40 |
  513|  41.2k|            ((uint64_t)br->next_in[3]) << 32 |
  514|  41.2k|            ((uint32_t)br->next_in[4]) << 24 |
  515|  41.2k|            ((uint32_t)br->next_in[5]) << 16 |
  516|  41.2k|            ((uint32_t)br->next_in[6]) << 8 |
  517|  41.2k|             (uint32_t)br->next_in[7];
  518|  41.2k|        br->next_in += 8;
  519|  41.2k|        br->avail_in -= 8;
  520|  41.2k|        br->cache_avail += 8 * 8;
  521|  41.2k|        rar->bytes_unconsumed += 8;
  522|  41.2k|        rar->bytes_remaining -= 8;
  523|  41.2k|        return (1);
  524|  41.2k|      }
  525|    409|      break;
  526|   554k|    case 7:
  ------------------
  |  Branch (526:5): [True: 554k, False: 162k]
  ------------------
  527|   554k|      if (br->avail_in >= 7) {
  ------------------
  |  Branch (527:11): [True: 545k, False: 9.37k]
  ------------------
  528|   545k|        br->cache_buffer =
  529|   545k|           (br->cache_buffer << 56) |
  530|   545k|            ((uint64_t)br->next_in[0]) << 48 |
  531|   545k|            ((uint64_t)br->next_in[1]) << 40 |
  532|   545k|            ((uint64_t)br->next_in[2]) << 32 |
  533|   545k|            ((uint32_t)br->next_in[3]) << 24 |
  534|   545k|            ((uint32_t)br->next_in[4]) << 16 |
  535|   545k|            ((uint32_t)br->next_in[5]) << 8 |
  536|   545k|             (uint32_t)br->next_in[6];
  537|   545k|        br->next_in += 7;
  538|   545k|        br->avail_in -= 7;
  539|   545k|        br->cache_avail += 7 * 8;
  540|   545k|        rar->bytes_unconsumed += 7;
  541|   545k|        rar->bytes_remaining -= 7;
  542|   545k|        return (1);
  543|   545k|      }
  544|  9.37k|      break;
  545|  63.7k|    case 6:
  ------------------
  |  Branch (545:5): [True: 63.7k, False: 653k]
  ------------------
  546|  63.7k|      if (br->avail_in >= 6) {
  ------------------
  |  Branch (546:11): [True: 54.0k, False: 9.64k]
  ------------------
  547|  54.0k|        br->cache_buffer =
  548|  54.0k|           (br->cache_buffer << 48) |
  549|  54.0k|            ((uint64_t)br->next_in[0]) << 40 |
  550|  54.0k|            ((uint64_t)br->next_in[1]) << 32 |
  551|  54.0k|            ((uint32_t)br->next_in[2]) << 24 |
  552|  54.0k|            ((uint32_t)br->next_in[3]) << 16 |
  553|  54.0k|            ((uint32_t)br->next_in[4]) << 8 |
  554|  54.0k|             (uint32_t)br->next_in[5];
  555|  54.0k|        br->next_in += 6;
  556|  54.0k|        br->avail_in -= 6;
  557|  54.0k|        br->cache_avail += 6 * 8;
  558|  54.0k|        rar->bytes_unconsumed += 6;
  559|  54.0k|        rar->bytes_remaining -= 6;
  560|  54.0k|        return (1);
  561|  54.0k|      }
  562|  9.64k|      break;
  563|  9.64k|    case 0:
  ------------------
  |  Branch (563:5): [True: 9.57k, False: 708k]
  ------------------
  564|       |      /* We have enough compressed data in
  565|       |       * the cache buffer.*/
  566|  9.57k|      return (1);
  567|  48.0k|    default:
  ------------------
  |  Branch (567:5): [True: 48.0k, False: 669k]
  ------------------
  568|  48.0k|      break;
  569|   717k|    }
  570|  67.4k|    if (br->avail_in <= 0) {
  ------------------
  |  Branch (570:9): [True: 12.5k, False: 54.8k]
  ------------------
  571|       |
  572|  12.5k|      if (rar->bytes_unconsumed > 0) {
  ------------------
  |  Branch (572:11): [True: 12.5k, False: 82]
  ------------------
  573|       |        /* Consume as much as the decompressor
  574|       |         * actually used. */
  575|  12.5k|        __archive_read_consume(a, rar->bytes_unconsumed);
  576|  12.5k|        rar->bytes_unconsumed = 0;
  577|  12.5k|      }
  578|  12.5k|      br->next_in = rar_read_ahead(a, 1, &(br->avail_in));
  579|  12.5k|      if (br->next_in == NULL)
  ------------------
  |  Branch (579:11): [True: 147, False: 12.4k]
  ------------------
  580|    147|        return (0);
  581|  12.4k|      if (br->avail_in == 0)
  ------------------
  |  Branch (581:11): [True: 0, False: 12.4k]
  ------------------
  582|      0|        return (0);
  583|  12.4k|    }
  584|  67.3k|    br->cache_buffer =
  585|  67.3k|       (br->cache_buffer << 8) | *br->next_in++;
  586|  67.3k|    br->avail_in--;
  587|  67.3k|    br->cache_avail += 8;
  588|  67.3k|    n -= 8;
  589|  67.3k|    rar->bytes_unconsumed++;
  590|  67.3k|    rar->bytes_remaining--;
  591|  67.3k|  }
  592|   650k|}
archive_read_support_format_rar.c:parse_codes:
 2305|  4.10k|{
 2306|  4.10k|  int i, j, val, n, r;
 2307|  4.10k|  unsigned char bitlengths[MAX_SYMBOLS], zerocount, ppmd_flags;
 2308|  4.10k|  unsigned int maxorder;
 2309|  4.10k|  struct huffman_code precode;
 2310|  4.10k|  struct rar *rar = (struct rar *)(a->format->data);
 2311|  4.10k|  struct rar_br *br = &(rar->br);
 2312|       |
 2313|  4.10k|  free_codes(a);
 2314|       |
 2315|       |  /* Skip to the next byte */
 2316|  4.10k|  rar_br_consume_unaligned_bits(br);
  ------------------
  |  |  478|  4.10k|#define rar_br_consume_unaligned_bits(br) ((br)->cache_avail &= ~7)
  ------------------
 2317|       |
 2318|       |  /* PPMd block flag */
 2319|  4.10k|  if (!rar_br_read_ahead(a, br, 1))
  ------------------
  |  |  475|  4.10k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  8.20k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 3.64k, False: 452]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      2|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 1, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 450, False: 2]
  |  |  ------------------
  ------------------
 2320|      1|    goto truncated_data;
 2321|  4.09k|  if ((rar->is_ppmd_block = rar_br_bits(br, 1)) != 0)
  ------------------
  |  |  465|  4.09k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|  4.09k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
  |  Branch (2321:7): [True: 3.31k, False: 786]
  ------------------
 2322|  3.31k|  {
 2323|  3.31k|    rar_br_consume(br, 1);
  ------------------
  |  |  477|  3.31k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2324|  3.31k|    if (!rar_br_read_ahead(a, br, 7))
  ------------------
  |  |  475|  3.31k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  6.62k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 3.31k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2325|      0|      goto truncated_data;
 2326|  3.31k|    ppmd_flags = rar_br_bits(br, 7);
  ------------------
  |  |  465|  3.31k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|  3.31k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2327|  3.31k|    rar_br_consume(br, 7);
  ------------------
  |  |  477|  3.31k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2328|       |
 2329|       |    /* Memory is allocated in MB */
 2330|  3.31k|    if (ppmd_flags & 0x20)
  ------------------
  |  Branch (2330:9): [True: 8, False: 3.30k]
  ------------------
 2331|      8|    {
 2332|      8|      if (!rar_br_read_ahead(a, br, 8))
  ------------------
  |  |  475|      8|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|     16|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 5, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 3, False: 0]
  |  |  ------------------
  ------------------
 2333|      0|        goto truncated_data;
 2334|      8|      rar->dictionary_size = (rar_br_bits(br, 8) + 1) << 20;
  ------------------
  |  |  465|      8|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|      8|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2335|      8|      rar_br_consume(br, 8);
  ------------------
  |  |  477|      8|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2336|      8|    }
 2337|       |
 2338|  3.31k|    if (ppmd_flags & 0x40)
  ------------------
  |  Branch (2338:9): [True: 4, False: 3.30k]
  ------------------
 2339|      4|    {
 2340|      4|      if (!rar_br_read_ahead(a, br, 8))
  ------------------
  |  |  475|      4|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      8|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 4, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2341|      0|        goto truncated_data;
 2342|      4|      rar->ppmd_escape = rar->ppmd7_context.InitEsc = rar_br_bits(br, 8);
  ------------------
  |  |  465|      4|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|      4|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2343|      4|      rar_br_consume(br, 8);
  ------------------
  |  |  477|      4|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2344|      4|    }
 2345|  3.30k|    else
 2346|  3.30k|      rar->ppmd_escape = 2;
 2347|       |
 2348|  3.31k|    if (ppmd_flags & 0x20)
  ------------------
  |  Branch (2348:9): [True: 8, False: 3.30k]
  ------------------
 2349|      8|    {
 2350|      8|      maxorder = (ppmd_flags & 0x1F) + 1;
 2351|      8|      if(maxorder > 16)
  ------------------
  |  Branch (2351:10): [True: 5, False: 3]
  ------------------
 2352|      5|        maxorder = 16 + (maxorder - 16) * 3;
 2353|       |
 2354|      8|      if (maxorder == 1)
  ------------------
  |  Branch (2354:11): [True: 0, False: 8]
  ------------------
 2355|      0|      {
 2356|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2357|      0|                          "Truncated RAR file data");
 2358|      0|        return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2359|      0|      }
 2360|       |
 2361|       |      /* Make sure ppmd7_context is freed before Ppmd7_Construct
 2362|       |       * because reading a broken file causes this abnormal sequence. */
 2363|      8|      __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context);
 2364|       |
 2365|      8|      rar->bytein.a = a;
 2366|      8|      rar->bytein.Read = &ppmd_read;
 2367|      8|      __archive_ppmd7_functions.PpmdRAR_RangeDec_CreateVTable(&rar->range_dec);
 2368|      8|      rar->range_dec.Stream = &rar->bytein;
 2369|      8|      __archive_ppmd7_functions.Ppmd7_Construct(&rar->ppmd7_context);
 2370|       |
 2371|      8|      if (rar->dictionary_size == 0) {
  ------------------
  |  Branch (2371:11): [True: 0, False: 8]
  ------------------
 2372|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2373|      0|                          "Invalid zero dictionary size");
 2374|      0|        return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2375|      0|      }
 2376|       |
 2377|      8|      if (!__archive_ppmd7_functions.Ppmd7_Alloc(&rar->ppmd7_context,
  ------------------
  |  Branch (2377:11): [True: 0, False: 8]
  ------------------
 2378|      8|        rar->dictionary_size))
 2379|      0|      {
 2380|      0|        archive_set_error(&a->archive, ENOMEM,
 2381|      0|                          "Out of memory");
 2382|      0|        return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2383|      0|      }
 2384|      8|      if (!__archive_ppmd7_functions.PpmdRAR_RangeDec_Init(&rar->range_dec))
  ------------------
  |  Branch (2384:11): [True: 4, False: 4]
  ------------------
 2385|      4|      {
 2386|      4|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2387|      4|                          "Unable to initialize PPMd range decoder");
 2388|      4|        return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      4|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2389|      4|      }
 2390|      4|      __archive_ppmd7_functions.Ppmd7_Init(&rar->ppmd7_context, maxorder);
 2391|      4|      rar->ppmd_valid = 1;
 2392|      4|    }
 2393|  3.30k|    else
 2394|  3.30k|    {
 2395|  3.30k|      if (!rar->ppmd_valid) {
  ------------------
  |  Branch (2395:11): [True: 0, False: 3.30k]
  ------------------
 2396|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2397|      0|                          "Invalid PPMd sequence");
 2398|      0|        return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2399|      0|      }
 2400|  3.30k|      if (!__archive_ppmd7_functions.PpmdRAR_RangeDec_Init(&rar->range_dec))
  ------------------
  |  Branch (2400:11): [True: 0, False: 3.30k]
  ------------------
 2401|      0|      {
 2402|      0|        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2403|      0|                          "Unable to initialize PPMd range decoder");
 2404|      0|        return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2405|      0|      }
 2406|  3.30k|    }
 2407|  3.31k|  }
 2408|    786|  else
 2409|    786|  {
 2410|    786|    rar_br_consume(br, 1);
  ------------------
  |  |  477|    786|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2411|       |
 2412|       |    /*
 2413|       |     * Low-distance repeat state belongs to the current LZ table and
 2414|       |     * must not be reused after starting a new table.
 2415|       |     */
 2416|    786|    rar->lastlowoffset = 0;
 2417|    786|    rar->numlowoffsetrepeats = 0;
 2418|       |
 2419|       |    /* Keep existing table flag */
 2420|    786|    if (!rar_br_read_ahead(a, br, 1))
  ------------------
  |  |  475|    786|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  1.57k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 786, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2421|      0|      goto truncated_data;
 2422|    786|    if (!rar_br_bits(br, 1))
  ------------------
  |  |  465|    786|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|    786|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
  |  Branch (2422:9): [True: 767, False: 19]
  ------------------
 2423|    767|      memset(rar->lengthtable, 0, sizeof(rar->lengthtable));
 2424|    786|    rar_br_consume(br, 1);
  ------------------
  |  |  477|    786|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2425|       |
 2426|    786|    memset(&bitlengths, 0, sizeof(bitlengths));
 2427|  15.8k|    for (i = 0; i < MAX_SYMBOLS;)
  ------------------
  |  |  136|  15.8k|#define MAX_SYMBOLS       20
  ------------------
  |  Branch (2427:17): [True: 15.0k, False: 786]
  ------------------
 2428|  15.0k|    {
 2429|  15.0k|      if (!rar_br_read_ahead(a, br, 4))
  ------------------
  |  |  475|  15.0k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  30.1k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 13.8k, False: 1.22k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 1.22k, False: 0]
  |  |  ------------------
  ------------------
 2430|      0|        goto truncated_data;
 2431|  15.0k|      bitlengths[i++] = rar_br_bits(br, 4);
  ------------------
  |  |  465|  15.0k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|  15.0k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2432|  15.0k|      rar_br_consume(br, 4);
  ------------------
  |  |  477|  15.0k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2433|  15.0k|      if (bitlengths[i-1] == 0xF)
  ------------------
  |  Branch (2433:11): [True: 49, False: 15.0k]
  ------------------
 2434|     49|      {
 2435|     49|        if (!rar_br_read_ahead(a, br, 4))
  ------------------
  |  |  475|     49|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|     98|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 49, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2436|      0|          goto truncated_data;
 2437|     49|        zerocount = rar_br_bits(br, 4);
  ------------------
  |  |  465|     49|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|     49|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2438|     49|        rar_br_consume(br, 4);
  ------------------
  |  |  477|     49|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2439|     49|        if (zerocount)
  ------------------
  |  Branch (2439:13): [True: 49, False: 0]
  ------------------
 2440|     49|        {
 2441|     49|          i--;
 2442|    738|          for (j = 0; j < zerocount + 2 && i < MAX_SYMBOLS; j++)
  ------------------
  |  |  136|    690|#define MAX_SYMBOLS       20
  ------------------
  |  Branch (2442:23): [True: 690, False: 48]
  |  Branch (2442:44): [True: 689, False: 1]
  ------------------
 2443|    689|            bitlengths[i++] = 0;
 2444|     49|        }
 2445|     49|      }
 2446|  15.0k|    }
 2447|       |
 2448|    786|    memset(&precode, 0, sizeof(precode));
 2449|    786|    r = create_code(a, &precode, bitlengths, MAX_SYMBOLS, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  136|    786|#define MAX_SYMBOLS       20
  ------------------
                  r = create_code(a, &precode, bitlengths, MAX_SYMBOLS, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  135|    786|#define MAX_SYMBOL_LENGTH 0xF
  ------------------
 2450|    786|    if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|    786|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2450:9): [True: 0, False: 786]
  ------------------
 2451|      0|      free(precode.tree);
 2452|      0|      free(precode.table);
 2453|      0|      return (r);
 2454|      0|    }
 2455|       |
 2456|   194k|    for (i = 0; i < HUFFMAN_TABLE_SIZE;)
  ------------------
  |  |  133|   194k|  MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  128|   194k|#define MAINCODE_SIZE      299
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  129|   194k|#define OFFSETCODE_SIZE    60
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  130|   194k|#define LOWOFFSETCODE_SIZE 17
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  131|   194k|#define LENGTHCODE_SIZE    28
  |  |  ------------------
  ------------------
  |  Branch (2456:17): [True: 193k, False: 780]
  ------------------
 2457|   193k|    {
 2458|   193k|      if ((val = read_next_symbol(a, &precode)) < 0) {
  ------------------
  |  Branch (2458:11): [True: 6, False: 193k]
  ------------------
 2459|      6|        free(precode.tree);
 2460|      6|        free(precode.table);
 2461|      6|        return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      6|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2462|      6|      }
 2463|   193k|      if (val < 16)
  ------------------
  |  Branch (2463:11): [True: 178k, False: 15.4k]
  ------------------
 2464|   178k|      {
 2465|   178k|        rar->lengthtable[i] = (rar->lengthtable[i] + val) & 0xF;
 2466|   178k|        i++;
 2467|   178k|      }
 2468|  15.4k|      else if (val < 18)
  ------------------
  |  Branch (2468:16): [True: 4.80k, False: 10.6k]
  ------------------
 2469|  4.80k|      {
 2470|  4.80k|        if (i == 0)
  ------------------
  |  Branch (2470:13): [True: 0, False: 4.80k]
  ------------------
 2471|      0|        {
 2472|      0|          free(precode.tree);
 2473|      0|          free(precode.table);
 2474|      0|          archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2475|      0|                            "Internal error extracting RAR file");
 2476|      0|          return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2477|      0|        }
 2478|       |
 2479|  4.80k|        if(val == 16) {
  ------------------
  |  Branch (2479:12): [True: 4.34k, False: 462]
  ------------------
 2480|  4.34k|          if (!rar_br_read_ahead(a, br, 3)) {
  ------------------
  |  |  475|  4.34k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  8.68k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 4.34k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2481|      0|            free(precode.tree);
 2482|      0|            free(precode.table);
 2483|      0|            goto truncated_data;
 2484|      0|          }
 2485|  4.34k|          n = rar_br_bits(br, 3) + 3;
  ------------------
  |  |  465|  4.34k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|  4.34k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2486|  4.34k|          rar_br_consume(br, 3);
  ------------------
  |  |  477|  4.34k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2487|  4.34k|        } else {
 2488|    462|          if (!rar_br_read_ahead(a, br, 7)) {
  ------------------
  |  |  475|    462|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|    924|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 425, False: 37]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 37, False: 0]
  |  |  ------------------
  ------------------
 2489|      0|            free(precode.tree);
 2490|      0|            free(precode.table);
 2491|      0|            goto truncated_data;
 2492|      0|          }
 2493|    462|          n = rar_br_bits(br, 7) + 11;
  ------------------
  |  |  465|    462|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|    462|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2494|    462|          rar_br_consume(br, 7);
  ------------------
  |  |  477|    462|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2495|    462|        }
 2496|       |
 2497|  26.0k|        for (j = 0; j < n && i < HUFFMAN_TABLE_SIZE; j++)
  ------------------
  |  |  133|  21.2k|  MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  128|  21.2k|#define MAINCODE_SIZE      299
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  129|  21.2k|#define OFFSETCODE_SIZE    60
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  130|  21.2k|#define LOWOFFSETCODE_SIZE 17
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  131|  21.2k|#define LENGTHCODE_SIZE    28
  |  |  ------------------
  ------------------
  |  Branch (2497:21): [True: 21.2k, False: 4.79k]
  |  Branch (2497:30): [True: 21.2k, False: 10]
  ------------------
 2498|  21.2k|        {
 2499|  21.2k|          rar->lengthtable[i] = rar->lengthtable[i-1];
 2500|  21.2k|          i++;
 2501|  21.2k|        }
 2502|  4.80k|      }
 2503|  10.6k|      else
 2504|  10.6k|      {
 2505|  10.6k|        if(val == 18) {
  ------------------
  |  Branch (2505:12): [True: 9.15k, False: 1.49k]
  ------------------
 2506|  9.15k|          if (!rar_br_read_ahead(a, br, 3)) {
  ------------------
  |  |  475|  9.15k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  18.3k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 9.13k, False: 15]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 15, False: 0]
  |  |  ------------------
  ------------------
 2507|      0|            free(precode.tree);
 2508|      0|            free(precode.table);
 2509|      0|            goto truncated_data;
 2510|      0|          }
 2511|  9.15k|          n = rar_br_bits(br, 3) + 3;
  ------------------
  |  |  465|  9.15k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|  9.15k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2512|  9.15k|          rar_br_consume(br, 3);
  ------------------
  |  |  477|  9.15k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2513|  9.15k|        } else {
 2514|  1.49k|          if (!rar_br_read_ahead(a, br, 7)) {
  ------------------
  |  |  475|  1.49k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  2.99k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 1.42k, False: 76]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 76, False: 0]
  |  |  ------------------
  ------------------
 2515|      0|            free(precode.tree);
 2516|      0|            free(precode.table);
 2517|      0|            goto truncated_data;
 2518|      0|          }
 2519|  1.49k|          n = rar_br_bits(br, 7) + 11;
  ------------------
  |  |  465|  1.49k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|  1.49k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2520|  1.49k|          rar_br_consume(br, 7);
  ------------------
  |  |  477|  1.49k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2521|  1.49k|        }
 2522|       |
 2523|   126k|        for(j = 0; j < n && i < HUFFMAN_TABLE_SIZE; j++)
  ------------------
  |  |  133|   116k|  MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  128|   116k|#define MAINCODE_SIZE      299
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  129|   116k|#define OFFSETCODE_SIZE    60
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  130|   116k|#define LOWOFFSETCODE_SIZE 17
  |  |  ------------------
  |  |                 MAINCODE_SIZE + OFFSETCODE_SIZE + LOWOFFSETCODE_SIZE + LENGTHCODE_SIZE
  |  |  ------------------
  |  |  |  |  131|   116k|#define LENGTHCODE_SIZE    28
  |  |  ------------------
  ------------------
  |  Branch (2523:20): [True: 116k, False: 10.3k]
  |  Branch (2523:29): [True: 115k, False: 317]
  ------------------
 2524|   115k|          rar->lengthtable[i++] = 0;
 2525|  10.6k|      }
 2526|   193k|    }
 2527|    780|    free(precode.tree);
 2528|    780|    free(precode.table);
 2529|       |
 2530|    780|    r = create_code(a, &rar->maincode, &rar->lengthtable[0], MAINCODE_SIZE,
  ------------------
  |  |  128|    780|#define MAINCODE_SIZE      299
  ------------------
 2531|    780|                MAX_SYMBOL_LENGTH);
  ------------------
  |  |  135|    780|#define MAX_SYMBOL_LENGTH 0xF
  ------------------
 2532|    780|    if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    780|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2532:9): [True: 4, False: 776]
  ------------------
 2533|      4|      return (r);
 2534|    776|    r = create_code(a, &rar->offsetcode, &rar->lengthtable[MAINCODE_SIZE],
  ------------------
  |  |  128|    776|#define MAINCODE_SIZE      299
  ------------------
 2535|    776|                OFFSETCODE_SIZE, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  129|    776|#define OFFSETCODE_SIZE    60
  ------------------
                              OFFSETCODE_SIZE, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  135|    776|#define MAX_SYMBOL_LENGTH 0xF
  ------------------
 2536|    776|    if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    776|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2536:9): [True: 0, False: 776]
  ------------------
 2537|      0|      return (r);
 2538|    776|    r = create_code(a, &rar->lowoffsetcode,
 2539|    776|                &rar->lengthtable[MAINCODE_SIZE + OFFSETCODE_SIZE],
  ------------------
  |  |  128|    776|#define MAINCODE_SIZE      299
  ------------------
                              &rar->lengthtable[MAINCODE_SIZE + OFFSETCODE_SIZE],
  ------------------
  |  |  129|    776|#define OFFSETCODE_SIZE    60
  ------------------
 2540|    776|                LOWOFFSETCODE_SIZE, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  130|    776|#define LOWOFFSETCODE_SIZE 17
  ------------------
                              LOWOFFSETCODE_SIZE, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  135|    776|#define MAX_SYMBOL_LENGTH 0xF
  ------------------
 2541|    776|    if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    776|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2541:9): [True: 0, False: 776]
  ------------------
 2542|      0|      return (r);
 2543|    776|    r = create_code(a, &rar->lengthcode,
 2544|    776|                &rar->lengthtable[MAINCODE_SIZE + OFFSETCODE_SIZE +
  ------------------
  |  |  128|    776|#define MAINCODE_SIZE      299
  ------------------
                              &rar->lengthtable[MAINCODE_SIZE + OFFSETCODE_SIZE +
  ------------------
  |  |  129|    776|#define OFFSETCODE_SIZE    60
  ------------------
 2545|    776|                LOWOFFSETCODE_SIZE], LENGTHCODE_SIZE, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  130|    776|#define LOWOFFSETCODE_SIZE 17
  ------------------
                              LOWOFFSETCODE_SIZE], LENGTHCODE_SIZE, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  131|    776|#define LENGTHCODE_SIZE    28
  ------------------
                              LOWOFFSETCODE_SIZE], LENGTHCODE_SIZE, MAX_SYMBOL_LENGTH);
  ------------------
  |  |  135|    776|#define MAX_SYMBOL_LENGTH 0xF
  ------------------
 2546|    776|    if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    776|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2546:9): [True: 0, False: 776]
  ------------------
 2547|      0|      return (r);
 2548|    776|  }
 2549|       |
 2550|  4.08k|  if (!rar->dictionary_size || !rar->lzss.window ||
  ------------------
  |  Branch (2550:7): [True: 121, False: 3.96k]
  |  Branch (2550:32): [True: 4, False: 3.96k]
  ------------------
 2551|  3.96k|      (unsigned int)(rar->lzss.mask + 1) < rar->dictionary_size)
  ------------------
  |  Branch (2551:7): [True: 0, False: 3.96k]
  ------------------
 2552|    125|  {
 2553|       |    /* Seems as though dictionary sizes are not used. Even so, minimize
 2554|       |     * memory usage as much as possible.
 2555|       |     */
 2556|    125|    void *new_window;
 2557|    125|    unsigned int new_size;
 2558|       |
 2559|    125|    if (rar->unp_size >= DICTIONARY_MAX_SIZE)
  ------------------
  |  |  126|    125|#define DICTIONARY_MAX_SIZE 0x400000
  ------------------
  |  Branch (2559:9): [True: 65, False: 60]
  ------------------
 2560|     65|      new_size = DICTIONARY_MAX_SIZE;
  ------------------
  |  |  126|     65|#define DICTIONARY_MAX_SIZE 0x400000
  ------------------
 2561|     60|    else
 2562|     60|      new_size = rar_fls((unsigned int)rar->unp_size) << 1;
 2563|    125|    if (new_size == 0) {
  ------------------
  |  Branch (2563:9): [True: 0, False: 125]
  ------------------
 2564|      0|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2565|      0|                        "Zero window size is invalid");
 2566|      0|      return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2567|      0|    }
 2568|    125|    new_window = realloc(rar->lzss.window, new_size);
 2569|    125|    if (new_window == NULL) {
  ------------------
  |  Branch (2569:9): [True: 0, False: 125]
  ------------------
 2570|      0|      archive_set_error(&a->archive, ENOMEM,
 2571|      0|                        "Unable to allocate memory for uncompressed data");
 2572|      0|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2573|      0|    }
 2574|    125|    rar->lzss.window = (unsigned char *)new_window;
 2575|    125|    rar->dictionary_size = new_size;
 2576|    125|    memset(rar->lzss.window, 0, rar->dictionary_size);
 2577|    125|    rar->lzss.mask = rar->dictionary_size - 1;
 2578|    125|  }
 2579|       |
 2580|  4.08k|  rar->start_new_table = 0;
 2581|  4.08k|  return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.08k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2582|      1|truncated_data:
 2583|      1|  archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2584|      1|                    "Truncated RAR file data");
 2585|      1|  rar->valid = 0;
 2586|      1|  return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2587|  4.08k|}
archive_read_support_format_rar.c:free_codes:
 2591|  6.59k|{
 2592|  6.59k|  struct rar *rar = (struct rar *)(a->format->data);
 2593|  6.59k|  free(rar->maincode.tree);
 2594|  6.59k|  free(rar->offsetcode.tree);
 2595|  6.59k|  free(rar->lowoffsetcode.tree);
 2596|  6.59k|  free(rar->lengthcode.tree);
 2597|  6.59k|  free(rar->maincode.table);
 2598|  6.59k|  free(rar->offsetcode.table);
 2599|  6.59k|  free(rar->lowoffsetcode.table);
 2600|  6.59k|  free(rar->lengthcode.table);
 2601|  6.59k|  memset(&rar->maincode, 0, sizeof(rar->maincode));
 2602|  6.59k|  memset(&rar->offsetcode, 0, sizeof(rar->offsetcode));
 2603|  6.59k|  memset(&rar->lowoffsetcode, 0, sizeof(rar->lowoffsetcode));
 2604|  6.59k|  memset(&rar->lengthcode, 0, sizeof(rar->lengthcode));
 2605|  6.59k|}
archive_read_support_format_rar.c:ppmd_read:
  710|  13.2k|{
  711|  13.2k|  struct archive_read *a = ((IByteIn*)p)->a;
  712|  13.2k|  struct rar *rar = (struct rar *)(a->format->data);
  713|  13.2k|  struct rar_br *br = &(rar->br);
  714|  13.2k|  Byte b;
  715|  13.2k|  if (!rar_br_read_ahead(a, br, 8))
  ------------------
  |  |  475|  13.2k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  26.5k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 11.6k, False: 1.65k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      1|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 1.65k, False: 1]
  |  |  ------------------
  ------------------
  716|      0|  {
  717|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  718|      0|                      "Truncated RAR file data");
  719|      0|    rar->valid = 0;
  720|      0|    return 0;
  721|      0|  }
  722|  13.2k|  b = rar_br_bits(br, 8);
  ------------------
  |  |  465|  13.2k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|  13.2k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
  723|  13.2k|  rar_br_consume(br, 8);
  ------------------
  |  |  477|  13.2k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
  724|  13.2k|  return b;
  725|  13.2k|}
archive_read_support_format_rar.c:create_code:
 2682|  3.89k|{
 2683|  3.89k|  int i, j, codebits = 0, symbolsleft = numsymbols;
 2684|       |
 2685|  3.89k|  code->numentries = 0;
 2686|  3.89k|  code->numallocatedentries = 0;
 2687|  3.89k|  if (new_node(code) < 0) {
  ------------------
  |  Branch (2687:7): [True: 0, False: 3.89k]
  ------------------
 2688|      0|    archive_set_error(&a->archive, ENOMEM,
 2689|      0|                      "Unable to allocate memory for node data");
 2690|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2691|      0|  }
 2692|  3.89k|  code->numentries = 1;
 2693|  3.89k|  code->minlength = INT_MAX;
 2694|  3.89k|  code->maxlength = INT_MIN;
 2695|  3.89k|  codebits = 0;
 2696|  57.4k|  for(i = 1; i <= maxlength; i++)
  ------------------
  |  Branch (2696:14): [True: 53.9k, False: 3.44k]
  ------------------
 2697|  53.9k|  {
 2698|  4.92M|    for(j = 0; j < numsymbols; j++)
  ------------------
  |  Branch (2698:16): [True: 4.86M, False: 53.5k]
  ------------------
 2699|  4.86M|    {
 2700|  4.86M|      if (lengths[j] != i) continue;
  ------------------
  |  Branch (2700:11): [True: 4.65M, False: 209k]
  ------------------
 2701|   209k|      if (add_value(a, code, j, codebits, i) != ARCHIVE_OK)
  ------------------
  |  |  233|   209k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2701:11): [True: 4, False: 209k]
  ------------------
 2702|      4|        return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      4|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2703|   209k|      codebits++;
 2704|   209k|      if (--symbolsleft <= 0)
  ------------------
  |  Branch (2704:11): [True: 442, False: 208k]
  ------------------
 2705|    442|        break;
 2706|   209k|    }
 2707|  53.9k|    if (symbolsleft <= 0)
  ------------------
  |  Branch (2707:9): [True: 442, False: 53.5k]
  ------------------
 2708|    442|      break;
 2709|  53.5k|    codebits <<= 1;
 2710|  53.5k|  }
 2711|  3.89k|  return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.89k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2712|  3.89k|}
archive_read_support_format_rar.c:new_node:
 2825|   421k|{
 2826|   421k|  void *new_tree;
 2827|   421k|  if (code->numallocatedentries == code->numentries) {
  ------------------
  |  Branch (2827:7): [True: 4.77k, False: 416k]
  ------------------
 2828|  4.77k|    int new_num_entries = 256;
 2829|  4.77k|    if (code->numentries > 0) {
  ------------------
  |  Branch (2829:9): [True: 879, False: 3.89k]
  ------------------
 2830|    879|        new_num_entries = code->numentries * 2;
 2831|    879|    }
 2832|  4.77k|    new_tree = realloc(code->tree, new_num_entries * sizeof(*code->tree));
 2833|  4.77k|    if (new_tree == NULL)
  ------------------
  |  Branch (2833:9): [True: 0, False: 4.77k]
  ------------------
 2834|      0|        return (-1);
 2835|  4.77k|    code->tree = (struct huffman_tree_node *)new_tree;
 2836|  4.77k|    code->numallocatedentries = new_num_entries;
 2837|  4.77k|  }
 2838|   421k|  code->tree[code->numentries].branches[0] = -1;
 2839|   421k|  code->tree[code->numentries].branches[1] = -2;
 2840|   421k|  return 1;
 2841|   421k|}
archive_read_support_format_rar.c:add_value:
 2717|   209k|{
 2718|   209k|  int lastnode, bitpos, bit;
 2719|       |  /* int repeatpos, repeatnode, nextnode; */
 2720|       |
 2721|   209k|  free(code->table);
 2722|   209k|  code->table = NULL;
 2723|       |
 2724|   209k|  if(length > code->maxlength)
  ------------------
  |  Branch (2724:6): [True: 21.3k, False: 187k]
  ------------------
 2725|  21.3k|    code->maxlength = length;
 2726|   209k|  if(length < code->minlength)
  ------------------
  |  Branch (2726:6): [True: 3.77k, False: 205k]
  ------------------
 2727|  3.77k|    code->minlength = length;
 2728|       |
 2729|       |  /*
 2730|       |   * Dead code, repeatpos was is -1
 2731|       |   *
 2732|       |  repeatpos = -1;
 2733|       |  if (repeatpos == 0 || (repeatpos >= 0
 2734|       |    && (((codebits >> (repeatpos - 1)) & 3) == 0
 2735|       |    || ((codebits >> (repeatpos - 1)) & 3) == 3)))
 2736|       |  {
 2737|       |    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 2738|       |                      "Invalid repeat position");
 2739|       |    return (ARCHIVE_FATAL);
 2740|       |  }
 2741|       |  */
 2742|       |
 2743|   209k|  lastnode = 0;
 2744|  1.84M|  for (bitpos = length - 1; bitpos >= 0; bitpos--)
  ------------------
  |  Branch (2744:29): [True: 1.63M, False: 209k]
  ------------------
 2745|  1.63M|  {
 2746|  1.63M|    bit = (codebits >> bitpos) & 1;
 2747|       |
 2748|       |    /* Leaf node check */
 2749|  1.63M|    if (code->tree[lastnode].branches[0] ==
  ------------------
  |  Branch (2749:9): [True: 4, False: 1.63M]
  ------------------
 2750|  1.63M|      code->tree[lastnode].branches[1])
 2751|      4|    {
 2752|      4|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2753|      4|                        "Prefix found");
 2754|      4|      return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      4|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2755|      4|    }
 2756|       |
 2757|       |    /*
 2758|       |     * Dead code, repeatpos was -1, bitpos >=0
 2759|       |     *
 2760|       |    if (bitpos == repeatpos)
 2761|       |    {
 2762|       |      * Open branch check *
 2763|       |      if (!(code->tree[lastnode].branches[bit] < 0))
 2764|       |      {
 2765|       |        archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 2766|       |                          "Invalid repeating code");
 2767|       |        return (ARCHIVE_FATAL);
 2768|       |      }
 2769|       |
 2770|       |      if ((repeatnode = new_node(code)) < 0) {
 2771|       |        archive_set_error(&a->archive, ENOMEM,
 2772|       |                          "Unable to allocate memory for node data");
 2773|       |        return (ARCHIVE_FATAL);
 2774|       |      }
 2775|       |      if ((nextnode = new_node(code)) < 0) {
 2776|       |        archive_set_error(&a->archive, ENOMEM,
 2777|       |                          "Unable to allocate memory for node data");
 2778|       |        return (ARCHIVE_FATAL);
 2779|       |      }
 2780|       |
 2781|       |      * Set branches *
 2782|       |      code->tree[lastnode].branches[bit] = repeatnode;
 2783|       |      code->tree[repeatnode].branches[bit] = repeatnode;
 2784|       |      code->tree[repeatnode].branches[bit^1] = nextnode;
 2785|       |      lastnode = nextnode;
 2786|       |
 2787|       |      bitpos++; * terminating bit already handled, skip it *
 2788|       |    }
 2789|       |    else
 2790|       |    {
 2791|       |    */
 2792|       |      /* Open branch check */
 2793|  1.63M|      if (code->tree[lastnode].branches[bit] < 0)
  ------------------
  |  Branch (2793:11): [True: 417k, False: 1.22M]
  ------------------
 2794|   417k|      {
 2795|   417k|        if (new_node(code) < 0) {
  ------------------
  |  Branch (2795:13): [True: 0, False: 417k]
  ------------------
 2796|      0|          archive_set_error(&a->archive, ENOMEM,
 2797|      0|                            "Unable to allocate memory for node data");
 2798|      0|          return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2799|      0|        }
 2800|   417k|        code->tree[lastnode].branches[bit] = code->numentries++;
 2801|   417k|      }
 2802|       |
 2803|       |      /* set to branch */
 2804|  1.63M|      lastnode = code->tree[lastnode].branches[bit];
 2805|       | /* } */
 2806|  1.63M|  }
 2807|       |
 2808|   209k|  if (!(code->tree[lastnode].branches[0] == -1
  ------------------
  |  Branch (2808:9): [True: 209k, False: 0]
  ------------------
 2809|   209k|    && code->tree[lastnode].branches[1] == -2))
  ------------------
  |  Branch (2809:8): [True: 209k, False: 0]
  ------------------
 2810|      0|  {
 2811|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2812|      0|                      "Prefix found");
 2813|      0|    return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2814|      0|  }
 2815|       |
 2816|       |  /* Set leaf value */
 2817|   209k|  code->tree[lastnode].branches[0] = value;
 2818|   209k|  code->tree[lastnode].branches[1] = value;
 2819|       |
 2820|   209k|  return (ARCHIVE_OK);
  ------------------
  |  |  233|   209k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2821|   209k|}
archive_read_support_format_rar.c:read_next_symbol:
 2610|  19.6M|{
 2611|  19.6M|  unsigned char bit;
 2612|  19.6M|  unsigned int bits;
 2613|  19.6M|  int length, value, node;
 2614|  19.6M|  struct rar *rar;
 2615|  19.6M|  struct rar_br *br;
 2616|       |
 2617|  19.6M|  if (!code->table)
  ------------------
  |  Branch (2617:7): [True: 2.87k, False: 19.6M]
  ------------------
 2618|  2.87k|  {
 2619|  2.87k|    if (make_table(a, code) != (ARCHIVE_OK))
  ------------------
  |  |  233|  2.87k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2619:9): [True: 8, False: 2.86k]
  ------------------
 2620|      8|      return -1;
 2621|  2.87k|  }
 2622|       |
 2623|  19.6M|  rar = (struct rar *)(a->format->data);
 2624|  19.6M|  br = &(rar->br);
 2625|       |
 2626|       |  /* Look ahead (peek) at bits */
 2627|  19.6M|  if (!rar_br_read_ahead(a, br, code->tablesize)) {
  ------------------
  |  |  475|  19.6M|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  39.3M|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 19.0M, False: 596k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|     91|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 56, False: 35]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 596k, False: 91]
  |  |  ------------------
  ------------------
 2628|     35|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     35|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2629|     35|                      "Truncated RAR file data");
 2630|     35|    rar->valid = 0;
 2631|     35|    return -1;
 2632|     35|  }
 2633|  19.6M|  bits = rar_br_bits(br, code->tablesize);
  ------------------
  |  |  465|  19.6M|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|  19.6M|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2634|       |
 2635|  19.6M|  length = code->table[bits].length;
 2636|  19.6M|  value = code->table[bits].value;
 2637|       |
 2638|  19.6M|  if (length < 0)
  ------------------
  |  Branch (2638:7): [True: 0, False: 19.6M]
  ------------------
 2639|      0|  {
 2640|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2641|      0|                      "Invalid prefix code in bitstream");
 2642|      0|    return -1;
 2643|      0|  }
 2644|       |
 2645|  19.6M|  if (length <= code->tablesize)
  ------------------
  |  Branch (2645:7): [True: 19.3M, False: 339k]
  ------------------
 2646|  19.3M|  {
 2647|       |    /* Skip length bits */
 2648|  19.3M|    rar_br_consume(br, length);
  ------------------
  |  |  477|  19.3M|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2649|  19.3M|    return value;
 2650|  19.3M|  }
 2651|       |
 2652|       |  /* Skip tablesize bits */
 2653|   339k|  rar_br_consume(br, code->tablesize);
  ------------------
  |  |  477|   339k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2654|       |
 2655|   339k|  node = value;
 2656|  2.02M|  while (code->tree[node].branches[0] != code->tree[node].branches[1])
  ------------------
  |  Branch (2656:10): [True: 1.68M, False: 339k]
  ------------------
 2657|  1.68M|  {
 2658|  1.68M|    if (!rar_br_read_ahead(a, br, 1)) {
  ------------------
  |  |  475|  1.68M|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  3.37M|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 1.68M, False: 3.12k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      5|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 3.11k, False: 5]
  |  |  ------------------
  ------------------
 2659|      5|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      5|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2660|      5|                        "Truncated RAR file data");
 2661|      5|      rar->valid = 0;
 2662|      5|      return -1;
 2663|      5|    }
 2664|  1.68M|    bit = rar_br_bits(br, 1);
  ------------------
  |  |  465|  1.68M|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|  1.68M|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2665|  1.68M|    rar_br_consume(br, 1);
  ------------------
  |  |  477|  1.68M|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2666|       |
 2667|  1.68M|    if (code->tree[node].branches[bit] < 0)
  ------------------
  |  Branch (2667:9): [True: 1, False: 1.68M]
  ------------------
 2668|      1|    {
 2669|      1|      archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2670|      1|                        "Invalid prefix code in bitstream");
 2671|      1|      return -1;
 2672|      1|    }
 2673|  1.68M|    node = code->tree[node].branches[bit];
 2674|  1.68M|  }
 2675|       |
 2676|   339k|  return code->tree[node].branches[0];
 2677|   339k|}
archive_read_support_format_rar.c:make_table:
 2845|  2.87k|{
 2846|  2.87k|  if (code->maxlength < code->minlength || code->maxlength > 10)
  ------------------
  |  Branch (2846:7): [True: 0, False: 2.87k]
  |  Branch (2846:44): [True: 743, False: 2.12k]
  ------------------
 2847|    743|    code->tablesize = 10;
 2848|  2.12k|  else
 2849|  2.12k|    code->tablesize = code->maxlength;
 2850|       |
 2851|  2.87k|  code->table = calloc(((size_t)1U) << code->tablesize, sizeof(*code->table));
 2852|  2.87k|  if (code->table == NULL) {
  ------------------
  |  Branch (2852:7): [True: 0, False: 2.87k]
  ------------------
 2853|      0|    archive_set_error(&a->archive, ENOMEM, "Can't allocate memory");
 2854|      0|    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2855|      0|  }
 2856|       |
 2857|  2.87k|  return make_table_recurse(a, code, 0, code->table, 0, code->tablesize);
 2858|  2.87k|}
archive_read_support_format_rar.c:make_table_recurse:
 2864|   371k|{
 2865|   371k|  int currtablesize, i, ret = (ARCHIVE_OK);
  ------------------
  |  |  233|   371k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2866|       |
 2867|   371k|  if (!code->tree)
  ------------------
  |  Branch (2867:7): [True: 0, False: 371k]
  ------------------
 2868|      0|  {
 2869|      0|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2870|      0|                      "Huffman tree was not created");
 2871|      0|    return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2872|      0|  }
 2873|   371k|  if (node < 0 || node >= code->numentries)
  ------------------
  |  Branch (2873:7): [True: 44, False: 371k]
  |  Branch (2873:19): [True: 0, False: 371k]
  ------------------
 2874|     44|  {
 2875|     44|    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     44|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2876|     44|                      "Invalid location to Huffman tree specified");
 2877|     44|    return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     44|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2878|     44|  }
 2879|       |
 2880|   371k|  currtablesize = 1 << (maxdepth - depth);
 2881|       |
 2882|   371k|  if (code->tree[node].branches[0] ==
  ------------------
  |  Branch (2882:7): [True: 185k, False: 185k]
  ------------------
 2883|   371k|    code->tree[node].branches[1])
 2884|   185k|  {
 2885|  1.87M|    for(i = 0; i < currtablesize; i++)
  ------------------
  |  Branch (2885:16): [True: 1.69M, False: 185k]
  ------------------
 2886|  1.69M|    {
 2887|  1.69M|      table[i].length = depth;
 2888|  1.69M|      table[i].value = code->tree[node].branches[0];
 2889|  1.69M|    }
 2890|   185k|  }
 2891|       |  /*
 2892|       |   * Dead code, node >= 0
 2893|       |   *
 2894|       |  else if (node < 0)
 2895|       |  {
 2896|       |    for(i = 0; i < currtablesize; i++)
 2897|       |      table[i].length = -1;
 2898|       |  }
 2899|       |   */
 2900|   185k|  else
 2901|   185k|  {
 2902|   185k|    if(depth == maxdepth)
  ------------------
  |  Branch (2902:8): [True: 1.78k, False: 184k]
  ------------------
 2903|  1.78k|    {
 2904|  1.78k|      table[0].length = maxdepth + 1;
 2905|  1.78k|      table[0].value = node;
 2906|  1.78k|    }
 2907|   184k|    else
 2908|   184k|    {
 2909|   184k|      ret |= make_table_recurse(a, code, code->tree[node].branches[0], table,
 2910|   184k|                                depth + 1, maxdepth);
 2911|   184k|      ret |= make_table_recurse(a, code, code->tree[node].branches[1],
 2912|   184k|                         table + currtablesize / 2, depth + 1, maxdepth);
 2913|   184k|    }
 2914|   185k|  }
 2915|   371k|  return ret;
 2916|   371k|}
archive_read_support_format_rar.c:rar_fls:
  616|     60|{
  617|     60|  word |= (word >>  1);
  618|     60|  word |= (word >>  2);
  619|     60|  word |= (word >>  4);
  620|     60|  word |= (word >>  8);
  621|     60|  word |= (word >> 16);
  622|     60|  return word - (word >> 1);
  623|     60|}
archive_read_support_format_rar.c:lzss_emit_literal:
  670|  17.4M|{
  671|  17.4M|  *lzss_current_pointer(&rar->lzss) = literal;
  672|  17.4M|  rar->lzss.position++;
  673|  17.4M|}
archive_read_support_format_rar.c:lzss_current_pointer:
  664|  17.4M|{
  665|  17.4M|  return lzss_pointer_for_position(lzss, lzss->position);
  666|  17.4M|}
archive_read_support_format_rar.c:lzss_pointer_for_position:
  652|  17.4M|{
  653|  17.4M|  return &lzss->window[lzss_offset_for_position(lzss, pos)];
  654|  17.4M|}
archive_read_support_format_rar.c:lzss_emit_match:
  677|  1.43M|{
  678|  1.43M|  int dstoffs = lzss_current_offset(&rar->lzss);
  679|  1.43M|  int srcoffs = (dstoffs - offset) & lzss_mask(&rar->lzss);
  680|  1.43M|  int l, li, remaining;
  681|  1.43M|  unsigned char *d, *s;
  682|       |
  683|  1.43M|  remaining = length;
  684|  2.87M|  while (remaining > 0) {
  ------------------
  |  Branch (684:10): [True: 1.43M, False: 1.43M]
  ------------------
  685|  1.43M|    l = remaining;
  686|  1.43M|    if (dstoffs > srcoffs) {
  ------------------
  |  Branch (686:9): [True: 652k, False: 786k]
  ------------------
  687|   652k|      if (l > lzss_size(&rar->lzss) - dstoffs)
  ------------------
  |  Branch (687:11): [True: 191, False: 652k]
  ------------------
  688|    191|        l = lzss_size(&rar->lzss) - dstoffs;
  689|   786k|    } else {
  690|   786k|      if (l > lzss_size(&rar->lzss) - srcoffs)
  ------------------
  |  Branch (690:11): [True: 456, False: 786k]
  ------------------
  691|    456|        l = lzss_size(&rar->lzss) - srcoffs;
  692|   786k|    }
  693|  1.43M|    d = &(rar->lzss.window[dstoffs]);
  694|  1.43M|    s = &(rar->lzss.window[srcoffs]);
  695|  1.43M|    if ((dstoffs + l < srcoffs) || (srcoffs + l < dstoffs))
  ------------------
  |  Branch (695:9): [True: 13.6k, False: 1.42M]
  |  Branch (695:36): [True: 308k, False: 1.11M]
  ------------------
  696|   322k|      memcpy(d, s, l);
  697|  1.11M|    else {
  698|   202M|      for (li = 0; li < l; li++)
  ------------------
  |  Branch (698:20): [True: 201M, False: 1.11M]
  ------------------
  699|   201M|        d[li] = s[li];
  700|  1.11M|    }
  701|  1.43M|    remaining -= l;
  702|  1.43M|    dstoffs = (dstoffs + l) & lzss_mask(&(rar->lzss));
  703|  1.43M|    srcoffs = (srcoffs + l) & lzss_mask(&(rar->lzss));
  704|  1.43M|  }
  705|  1.43M|  rar->lzss.position += length;
  706|  1.43M|}
archive_read_support_format_rar.c:lzss_current_offset:
  658|  1.43M|{
  659|  1.43M|  return lzss_offset_for_position(lzss, lzss->position);
  660|  1.43M|}
archive_read_support_format_rar.c:lzss_mask:
  634|  4.31M|{
  635|  4.31M|  return lzss->mask;
  636|  4.31M|}
archive_read_support_format_rar.c:expand:
 2920|  6.97k|{
 2921|  6.97k|  static const unsigned char lengthbases[] =
 2922|  6.97k|    {   0,   1,   2,   3,   4,   5,   6,
 2923|  6.97k|        7,   8,  10,  12,  14,  16,  20,
 2924|  6.97k|       24,  28,  32,  40,  48,  56,  64,
 2925|  6.97k|       80,  96, 112, 128, 160, 192, 224 };
 2926|  6.97k|  static const unsigned char lengthbits[] =
 2927|  6.97k|    { 0, 0, 0, 0, 0, 0, 0,
 2928|  6.97k|      0, 1, 1, 1, 1, 2, 2,
 2929|  6.97k|      2, 2, 3, 3, 3, 3, 4,
 2930|  6.97k|      4, 4, 4, 5, 5, 5, 5 };
 2931|  6.97k|  static const int lengthb_min = minimum(
  ------------------
  |  |  162|  6.97k|#define minimum(a, b)	((a)<(b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (162:24): [Folded, False: 6.97k]
  |  |  ------------------
  ------------------
 2932|  6.97k|    (int)(sizeof(lengthbases)/sizeof(lengthbases[0])),
 2933|  6.97k|    (int)(sizeof(lengthbits)/sizeof(lengthbits[0]))
 2934|  6.97k|  );
 2935|  6.97k|  static const unsigned int offsetbases[] =
 2936|  6.97k|    {       0,       1,       2,       3,       4,       6,
 2937|  6.97k|            8,      12,      16,      24,      32,      48,
 2938|  6.97k|           64,      96,     128,     192,     256,     384,
 2939|  6.97k|          512,     768,    1024,    1536,    2048,    3072,
 2940|  6.97k|         4096,    6144,    8192,   12288,   16384,   24576,
 2941|  6.97k|        32768,   49152,   65536,   98304,  131072,  196608,
 2942|  6.97k|       262144,  327680,  393216,  458752,  524288,  589824,
 2943|  6.97k|       655360,  720896,  786432,  851968,  917504,  983040,
 2944|  6.97k|      1048576, 1310720, 1572864, 1835008, 2097152, 2359296,
 2945|  6.97k|      2621440, 2883584, 3145728, 3407872, 3670016, 3932160 };
 2946|  6.97k|  static const unsigned char offsetbits[] =
 2947|  6.97k|    {  0,  0,  0,  0,  1,  1,  2,  2,  3,  3,  4,  4,
 2948|  6.97k|       5,  5,  6,  6,  7,  7,  8,  8,  9,  9, 10, 10,
 2949|  6.97k|      11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16,
 2950|  6.97k|      16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16, 16,
 2951|  6.97k|      18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18, 18 };
 2952|  6.97k|  static const int offsetb_min = minimum(
  ------------------
  |  |  162|  6.97k|#define minimum(a, b)	((a)<(b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (162:24): [Folded, False: 6.97k]
  |  |  ------------------
  ------------------
 2953|  6.97k|    (int)(sizeof(offsetbases)/sizeof(offsetbases[0])),
 2954|  6.97k|    (int)(sizeof(offsetbits)/sizeof(offsetbits[0]))
 2955|  6.97k|  );
 2956|  6.97k|  static const unsigned char shortbases[] =
 2957|  6.97k|    { 0, 4, 8, 16, 32, 64, 128, 192 };
 2958|  6.97k|  static const unsigned char shortbits[] =
 2959|  6.97k|    { 2, 2, 3, 4, 5, 6, 6, 6 };
 2960|       |
 2961|  6.97k|  int symbol, offs, len, offsindex, lensymbol, i, offssymbol, lowoffsetsymbol;
 2962|  6.97k|  unsigned char newfile;
 2963|  6.97k|  struct rar *rar = (struct rar *)(a->format->data);
 2964|  6.97k|  struct rar_br *br = &(rar->br);
 2965|       |
 2966|  6.97k|  if (rar->filters.filterstart < *end)
  ------------------
  |  Branch (2966:7): [True: 0, False: 6.97k]
  ------------------
 2967|      0|    *end = rar->filters.filterstart;
 2968|       |
 2969|  18.8M|  while (1)
  ------------------
  |  Branch (2969:10): [True: 18.8M, Folded]
  ------------------
 2970|  18.8M|  {
 2971|  18.8M|    if(lzss_position(&rar->lzss) >= *end) {
  ------------------
  |  Branch (2971:8): [True: 6.28k, False: 18.8M]
  ------------------
 2972|  6.28k|      return (ARCHIVE_OK);
  ------------------
  |  |  233|  6.28k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2973|  6.28k|    }
 2974|       |
 2975|  18.8M|    if(rar->is_ppmd_block) {
  ------------------
  |  Branch (2975:8): [True: 0, False: 18.8M]
  ------------------
 2976|      0|      *end = lzss_position(&rar->lzss);
 2977|      0|      return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2978|      0|    }
 2979|       |
 2980|  18.8M|    if ((symbol = read_next_symbol(a, &rar->maincode)) < 0)
  ------------------
  |  Branch (2980:9): [True: 42, False: 18.8M]
  ------------------
 2981|     42|      goto bad_data;
 2982|       |
 2983|  18.8M|    if (symbol < 256)
  ------------------
  |  Branch (2983:9): [True: 17.4M, False: 1.45M]
  ------------------
 2984|  17.4M|    {
 2985|  17.4M|      lzss_emit_literal(rar, (uint8_t)symbol);
 2986|  17.4M|      continue;
 2987|  17.4M|    }
 2988|  1.45M|    else if (symbol == 256)
  ------------------
  |  Branch (2988:14): [True: 1.25k, False: 1.45M]
  ------------------
 2989|  1.25k|    {
 2990|  1.25k|      if (!rar_br_read_ahead(a, br, 1))
  ------------------
  |  |  475|  1.25k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  2.51k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 1.25k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2991|      0|        goto truncated_data;
 2992|  1.25k|      newfile = !rar_br_bits(br, 1);
  ------------------
  |  |  465|  1.25k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|  1.25k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2993|  1.25k|      rar_br_consume(br, 1);
  ------------------
  |  |  477|  1.25k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 2994|       |
 2995|  1.25k|      if(newfile)
  ------------------
  |  Branch (2995:10): [True: 595, False: 663]
  ------------------
 2996|    595|      {
 2997|    595|        rar->start_new_block = 1;
 2998|    595|        if (!rar_br_read_ahead(a, br, 1))
  ------------------
  |  |  475|    595|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  1.19k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 595, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2999|      0|          goto truncated_data;
 3000|    595|        rar->start_new_table = rar_br_bits(br, 1);
  ------------------
  |  |  465|    595|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|    595|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3001|    595|        rar_br_consume(br, 1);
  ------------------
  |  |  477|    595|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 3002|    595|        *end = lzss_position(&rar->lzss);
 3003|    595|        return (ARCHIVE_OK);
  ------------------
  |  |  233|    595|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3004|    595|      }
 3005|    663|      else
 3006|    663|      {
 3007|    663|        if (parse_codes(a) != ARCHIVE_OK)
  ------------------
  |  |  233|    663|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3007:13): [True: 8, False: 655]
  ------------------
 3008|      8|          goto bad_data;
 3009|    655|        continue;
 3010|    663|      }
 3011|  1.25k|    }
 3012|  1.45M|    else if(symbol==257)
  ------------------
  |  Branch (3012:13): [True: 11.4k, False: 1.44M]
  ------------------
 3013|  11.4k|    {
 3014|  11.4k|      if (!read_filter(a, end))
  ------------------
  |  Branch (3014:11): [True: 35, False: 11.4k]
  ------------------
 3015|     35|          goto bad_data;
 3016|  11.4k|      continue;
 3017|  11.4k|    }
 3018|  1.44M|    else if(symbol==258)
  ------------------
  |  Branch (3018:13): [True: 778k, False: 661k]
  ------------------
 3019|   778k|    {
 3020|   778k|      if(rar->lastlength == 0)
  ------------------
  |  Branch (3020:10): [True: 1.12k, False: 777k]
  ------------------
 3021|  1.12k|        continue;
 3022|       |
 3023|   777k|      offs = rar->lastoffset;
 3024|   777k|      len = rar->lastlength;
 3025|   777k|    }
 3026|   661k|    else if (symbol <= 262)
  ------------------
  |  Branch (3026:14): [True: 22.7k, False: 638k]
  ------------------
 3027|  22.7k|    {
 3028|  22.7k|      offsindex = symbol - 259;
 3029|  22.7k|      offs = rar->oldoffset[offsindex];
 3030|       |
 3031|  22.7k|      if ((lensymbol = read_next_symbol(a, &rar->lengthcode)) < 0)
  ------------------
  |  Branch (3031:11): [True: 0, False: 22.7k]
  ------------------
 3032|      0|        goto bad_data;
 3033|  22.7k|      if (lensymbol >= lengthb_min)
  ------------------
  |  Branch (3033:11): [True: 0, False: 22.7k]
  ------------------
 3034|      0|        goto bad_data;
 3035|  22.7k|      len = lengthbases[lensymbol] + 2;
 3036|  22.7k|      if (lengthbits[lensymbol] > 0) {
  ------------------
  |  Branch (3036:11): [True: 3.62k, False: 19.1k]
  ------------------
 3037|  3.62k|        if (!rar_br_read_ahead(a, br, lengthbits[lensymbol]))
  ------------------
  |  |  475|  3.62k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  7.24k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 3.50k, False: 116]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 116, False: 0]
  |  |  ------------------
  ------------------
 3038|      0|          goto truncated_data;
 3039|  3.62k|        len += rar_br_bits(br, lengthbits[lensymbol]);
  ------------------
  |  |  465|  3.62k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|  3.62k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3040|  3.62k|        rar_br_consume(br, lengthbits[lensymbol]);
  ------------------
  |  |  477|  3.62k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 3041|  3.62k|      }
 3042|       |
 3043|  34.4k|      for (i = offsindex; i > 0; i--)
  ------------------
  |  Branch (3043:27): [True: 11.6k, False: 22.7k]
  ------------------
 3044|  11.6k|        rar->oldoffset[i] = rar->oldoffset[i-1];
 3045|  22.7k|      rar->oldoffset[0] = offs;
 3046|  22.7k|    }
 3047|   638k|    else if(symbol<=270)
  ------------------
  |  Branch (3047:13): [True: 164k, False: 474k]
  ------------------
 3048|   164k|    {
 3049|   164k|      offs = shortbases[symbol-263] + 1;
 3050|   164k|      if(shortbits[symbol-263] > 0) {
  ------------------
  |  Branch (3050:10): [True: 164k, False: 0]
  ------------------
 3051|   164k|        if (!rar_br_read_ahead(a, br, shortbits[symbol-263]))
  ------------------
  |  |  475|   164k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|   328k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 156k, False: 7.32k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|     13|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 10, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 7.30k, False: 13]
  |  |  ------------------
  ------------------
 3052|      3|          goto truncated_data;
 3053|   164k|        offs += rar_br_bits(br, shortbits[symbol-263]);
  ------------------
  |  |  465|   164k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|   164k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3054|   164k|        rar_br_consume(br, shortbits[symbol-263]);
  ------------------
  |  |  477|   164k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 3055|   164k|      }
 3056|       |
 3057|   164k|      len = 2;
 3058|       |
 3059|   657k|      for(i = 3; i > 0; i--)
  ------------------
  |  Branch (3059:18): [True: 492k, False: 164k]
  ------------------
 3060|   492k|        rar->oldoffset[i] = rar->oldoffset[i-1];
 3061|   164k|      rar->oldoffset[0] = offs;
 3062|   164k|    }
 3063|   474k|    else
 3064|   474k|    {
 3065|   474k|      if (symbol-271 >= lengthb_min)
  ------------------
  |  Branch (3065:11): [True: 0, False: 474k]
  ------------------
 3066|      0|        goto bad_data;
 3067|   474k|      len = lengthbases[symbol-271]+3;
 3068|   474k|      if(lengthbits[symbol-271] > 0) {
  ------------------
  |  Branch (3068:10): [True: 350k, False: 124k]
  ------------------
 3069|   350k|        if (!rar_br_read_ahead(a, br, lengthbits[symbol-271]))
  ------------------
  |  |  475|   350k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|   700k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 349k, False: 1.00k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      2|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 1.00k, False: 2]
  |  |  ------------------
  ------------------
 3070|      2|          goto truncated_data;
 3071|   350k|        len += rar_br_bits(br, lengthbits[symbol-271]);
  ------------------
  |  |  465|   350k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|   350k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3072|   350k|        rar_br_consume(br, lengthbits[symbol-271]);
  ------------------
  |  |  477|   350k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 3073|   350k|      }
 3074|       |
 3075|   474k|      if ((offssymbol = read_next_symbol(a, &rar->offsetcode)) < 0)
  ------------------
  |  Branch (3075:11): [True: 0, False: 474k]
  ------------------
 3076|      0|        goto bad_data;
 3077|   474k|      if (offssymbol >= offsetb_min)
  ------------------
  |  Branch (3077:11): [True: 0, False: 474k]
  ------------------
 3078|      0|        goto bad_data;
 3079|   474k|      offs = offsetbases[offssymbol]+1;
 3080|   474k|      if(offsetbits[offssymbol] > 0)
  ------------------
  |  Branch (3080:10): [True: 143k, False: 330k]
  ------------------
 3081|   143k|      {
 3082|   143k|        if(offssymbol > 9)
  ------------------
  |  Branch (3082:12): [True: 127k, False: 15.8k]
  ------------------
 3083|   127k|        {
 3084|   127k|          if(offsetbits[offssymbol] > 4) {
  ------------------
  |  Branch (3084:14): [True: 123k, False: 4.61k]
  ------------------
 3085|   123k|            if (!rar_br_read_ahead(a, br, offsetbits[offssymbol] - 4))
  ------------------
  |  |  475|   123k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|   246k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 121k, False: 1.86k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      0|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 1.86k, False: 0]
  |  |  ------------------
  ------------------
 3086|      0|              goto truncated_data;
 3087|   123k|            offs += rar_br_bits(br, offsetbits[offssymbol] - 4) << 4;
  ------------------
  |  |  465|   123k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|   123k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3088|   123k|            rar_br_consume(br, offsetbits[offssymbol] - 4);
  ------------------
  |  |  477|   123k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 3089|   123k|          }
 3090|       |
 3091|   127k|          if(rar->numlowoffsetrepeats > 0)
  ------------------
  |  Branch (3091:14): [True: 24.4k, False: 103k]
  ------------------
 3092|  24.4k|          {
 3093|  24.4k|            rar->numlowoffsetrepeats--;
 3094|  24.4k|            offs += rar->lastlowoffset;
 3095|  24.4k|          }
 3096|   103k|          else
 3097|   103k|          {
 3098|   103k|            if ((lowoffsetsymbol =
  ------------------
  |  Branch (3098:17): [True: 1, False: 103k]
  ------------------
 3099|   103k|              read_next_symbol(a, &rar->lowoffsetcode)) < 0)
 3100|      1|              goto bad_data;
 3101|   103k|            if(lowoffsetsymbol == 16)
  ------------------
  |  Branch (3101:16): [True: 1.70k, False: 101k]
  ------------------
 3102|  1.70k|            {
 3103|  1.70k|              rar->numlowoffsetrepeats = 15;
 3104|  1.70k|              offs += rar->lastlowoffset;
 3105|  1.70k|            }
 3106|   101k|            else
 3107|   101k|            {
 3108|   101k|              offs += lowoffsetsymbol;
 3109|   101k|              rar->lastlowoffset = lowoffsetsymbol;
 3110|   101k|            }
 3111|   103k|          }
 3112|   127k|        }
 3113|  15.8k|        else {
 3114|  15.8k|          if (!rar_br_read_ahead(a, br, offsetbits[offssymbol]))
  ------------------
  |  |  475|  15.8k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|  31.6k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 14.9k, False: 939]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|      1|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 1, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 938, False: 1]
  |  |  ------------------
  ------------------
 3115|      0|            goto truncated_data;
 3116|  15.8k|          offs += rar_br_bits(br, offsetbits[offssymbol]);
  ------------------
  |  |  465|  15.8k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|  15.8k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3117|  15.8k|          rar_br_consume(br, offsetbits[offssymbol]);
  ------------------
  |  |  477|  15.8k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 3118|  15.8k|        }
 3119|   143k|      }
 3120|       |
 3121|   474k|      if (offs >= 0x40000)
  ------------------
  |  Branch (3121:11): [True: 1.09k, False: 473k]
  ------------------
 3122|  1.09k|        len++;
 3123|   474k|      if (offs >= 0x2000)
  ------------------
  |  Branch (3123:11): [True: 4.98k, False: 469k]
  ------------------
 3124|  4.98k|        len++;
 3125|       |
 3126|  1.89M|      for(i = 3; i > 0; i--)
  ------------------
  |  Branch (3126:18): [True: 1.42M, False: 474k]
  ------------------
 3127|  1.42M|        rar->oldoffset[i] = rar->oldoffset[i-1];
 3128|   474k|      rar->oldoffset[0] = offs;
 3129|   474k|    }
 3130|       |
 3131|  1.43M|    rar->lastoffset = offs;
 3132|  1.43M|    rar->lastlength = len;
 3133|       |
 3134|  1.43M|    lzss_emit_match(rar, rar->lastoffset, rar->lastlength);
 3135|  1.43M|  }
 3136|      5|truncated_data:
 3137|      5|  archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      5|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3138|      5|                    "Truncated RAR file data");
 3139|      5|  rar->valid = 0;
 3140|      5|  return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      5|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3141|     86|bad_data:
 3142|     86|  archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     86|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3143|     86|                    "Bad RAR file data");
 3144|     86|  return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     86|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3145|  6.97k|}
archive_read_support_format_rar.c:lzss_position:
  628|  18.9M|{
  629|  18.9M|  return lzss->position;
  630|  18.9M|}
archive_read_support_format_rar.c:read_filter:
 3661|  11.4k|{
 3662|  11.4k|  struct rar *rar = (struct rar *)(a->format->data);
 3663|  11.4k|  uint8_t flags, val, *code;
 3664|  11.4k|  uint16_t length, i;
 3665|       |
 3666|  11.4k|  if (!rar_decode_byte(a, &flags))
  ------------------
  |  Branch (3666:7): [True: 1, False: 11.4k]
  ------------------
 3667|      1|    return 0;
 3668|  11.4k|  length = (flags & 0x07) + 1;
 3669|  11.4k|  if (length == 7)
  ------------------
  |  Branch (3669:7): [True: 4.19k, False: 7.28k]
  ------------------
 3670|  4.19k|  {
 3671|  4.19k|    if (!rar_decode_byte(a, &val))
  ------------------
  |  Branch (3671:9): [True: 0, False: 4.19k]
  ------------------
 3672|      0|      return 0;
 3673|  4.19k|    length = val + 7;
 3674|  4.19k|  }
 3675|  7.28k|  else if (length == 8)
  ------------------
  |  Branch (3675:12): [True: 1.60k, False: 5.67k]
  ------------------
 3676|  1.60k|  {
 3677|  1.60k|    if (!rar_decode_byte(a, &val))
  ------------------
  |  Branch (3677:9): [True: 0, False: 1.60k]
  ------------------
 3678|      0|      return 0;
 3679|  1.60k|    length = val << 8;
 3680|  1.60k|    if (!rar_decode_byte(a, &val))
  ------------------
  |  Branch (3680:9): [True: 0, False: 1.60k]
  ------------------
 3681|      0|      return 0;
 3682|  1.60k|    length |= val;
 3683|  1.60k|  }
 3684|       |
 3685|  11.4k|  code = malloc(length);
 3686|  11.4k|  if (!code)
  ------------------
  |  Branch (3686:7): [True: 0, False: 11.4k]
  ------------------
 3687|      0|    return 0;
 3688|   261k|  for (i = 0; i < length; i++)
  ------------------
  |  Branch (3688:15): [True: 250k, False: 11.4k]
  ------------------
 3689|   250k|  {
 3690|   250k|    if (!rar_decode_byte(a, &code[i]))
  ------------------
  |  Branch (3690:9): [True: 16, False: 250k]
  ------------------
 3691|     16|    {
 3692|     16|      free(code);
 3693|     16|      return 0;
 3694|     16|    }
 3695|   250k|  }
 3696|  11.4k|  if (!parse_filter(a, code, length, flags))
  ------------------
  |  Branch (3696:7): [True: 18, False: 11.4k]
  ------------------
 3697|     18|  {
 3698|     18|    free(code);
 3699|     18|    return 0;
 3700|     18|  }
 3701|  11.4k|  free(code);
 3702|       |
 3703|  11.4k|  if (rar->filters.filterstart < *end)
  ------------------
  |  Branch (3703:7): [True: 1.74k, False: 9.69k]
  ------------------
 3704|  1.74k|    *end = rar->filters.filterstart;
 3705|       |
 3706|  11.4k|  return 1;
 3707|  11.4k|}
archive_read_support_format_rar.c:rar_decode_byte:
 3914|   269k|{
 3915|   269k|  struct rar *rar = (struct rar *)(a->format->data);
 3916|   269k|  struct rar_br *br = &(rar->br);
 3917|   269k|  if (!rar_br_read_ahead(a, br, 8))
  ------------------
  |  |  475|   269k|  ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|   538k|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 233k, False: 36.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                 ((rar_br_has(br, (n)) || rar_br_fillup(a, br)) || rar_br_has(br, (n)))
  |  |  ------------------
  |  |  |  |  462|     32|#define rar_br_has(br, n) ((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (462:27): [True: 15, False: 17]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (475:28): [True: 36.1k, False: 32]
  |  |  ------------------
  ------------------
 3918|     17|    return 0;
 3919|   269k|  *byte = (uint8_t)rar_br_bits(br, 8);
  ------------------
  |  |  465|   269k|  (((uint32_t)((br)->cache_buffer >>    \
  |  |  466|   269k|    ((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3920|   269k|  rar_br_consume(br, 8);
  ------------------
  |  |  477|   269k|#define rar_br_consume(br, n) ((br)->cache_avail -= (n))
  ------------------
 3921|   269k|  return 1;
 3922|   269k|}
archive_read_support_format_rar.c:parse_filter:
 3272|  11.4k|{
 3273|  11.4k|  struct rar *rar = (struct rar *)(a->format->data);
 3274|  11.4k|  struct rar_filters *filters = &rar->filters;
 3275|       |
 3276|  11.4k|  struct memory_bit_reader br = { 0 };
 3277|  11.4k|  struct rar_program_code *prog;
 3278|  11.4k|  struct rar_filter *filter, **nextfilter;
 3279|       |
 3280|  11.4k|  uint32_t numprogs, num, blocklength, globaldatalen;
 3281|  11.4k|  uint8_t *globaldata;
 3282|  11.4k|  size_t blockstartpos;
 3283|  11.4k|  uint32_t registers[8] = { 0 };
 3284|  11.4k|  uint32_t i;
 3285|       |
 3286|  11.4k|  br.bytes = bytes;
 3287|  11.4k|  br.length = length;
 3288|       |
 3289|  11.4k|  numprogs = 0;
 3290|  26.4k|  for (prog = filters->progs; prog; prog = prog->next)
  ------------------
  |  Branch (3290:31): [True: 14.9k, False: 11.4k]
  ------------------
 3291|  14.9k|    numprogs++;
 3292|       |
 3293|  11.4k|  if ((flags & 0x80))
  ------------------
  |  Branch (3293:7): [True: 2.98k, False: 8.47k]
  ------------------
 3294|  2.98k|  {
 3295|  2.98k|    num = membr_next_rarvm_number(&br);
 3296|  2.98k|    if (num == 0)
  ------------------
  |  Branch (3296:9): [True: 1.04k, False: 1.93k]
  ------------------
 3297|  1.04k|    {
 3298|  1.04k|      delete_filter(filters->stack);
 3299|  1.04k|      filters->stack = NULL;
 3300|  1.04k|      delete_program_code(filters->progs);
 3301|  1.04k|      filters->progs = NULL;
 3302|  1.04k|    }
 3303|  1.93k|    else
 3304|  1.93k|      num--;
 3305|  2.98k|    if (num > numprogs) {
  ------------------
  |  Branch (3305:9): [True: 4, False: 2.98k]
  ------------------
 3306|      4|      return 0;
 3307|      4|    }
 3308|  2.98k|    filters->lastfilternum = num;
 3309|  2.98k|  }
 3310|  8.47k|  else
 3311|  8.47k|    num = filters->lastfilternum;
 3312|       |
 3313|  11.4k|  prog = filters->progs;
 3314|  14.4k|  for (i = 0; i < num; i++)
  ------------------
  |  Branch (3314:15): [True: 3.01k, False: 11.4k]
  ------------------
 3315|  3.01k|    prog = prog->next;
 3316|  11.4k|  if (prog)
  ------------------
  |  Branch (3316:7): [True: 9.85k, False: 1.59k]
  ------------------
 3317|  9.85k|    prog->usagecount++;
 3318|       |
 3319|  11.4k|  blockstartpos = membr_next_rarvm_number(&br) + (size_t)lzss_position(&rar->lzss);
 3320|  11.4k|  if ((flags & 0x40))
  ------------------
  |  Branch (3320:7): [True: 4.14k, False: 7.31k]
  ------------------
 3321|  4.14k|    blockstartpos += 258;
 3322|  11.4k|  if ((flags & 0x20))
  ------------------
  |  Branch (3322:7): [True: 2.42k, False: 9.03k]
  ------------------
 3323|  2.42k|    blocklength = membr_next_rarvm_number(&br);
 3324|  9.03k|  else
 3325|  9.03k|    blocklength = prog ? prog->oldfilterlength : 0;
  ------------------
  |  Branch (3325:19): [True: 8.56k, False: 468]
  ------------------
 3326|       |
 3327|  11.4k|  if (blocklength > rar->dictionary_size ||
  ------------------
  |  Branch (3327:7): [True: 3, False: 11.4k]
  ------------------
 3328|  11.4k|      blocklength > (uint32_t)(rar->lzss.mask + 1))
  ------------------
  |  Branch (3328:7): [True: 0, False: 11.4k]
  ------------------
 3329|      3|    return 0;
 3330|       |
 3331|  11.4k|  registers[3] = PROGRAM_SYSTEM_GLOBAL_ADDRESS;
  ------------------
  |  |  143|  11.4k|#define PROGRAM_SYSTEM_GLOBAL_ADDRESS PROGRAM_WORK_SIZE
  |  |  ------------------
  |  |  |  |  141|  11.4k|#define PROGRAM_WORK_SIZE 0x3C000
  |  |  ------------------
  ------------------
 3332|  11.4k|  registers[4] = blocklength;
 3333|  11.4k|  registers[5] = prog ? prog->usagecount : 0;
  ------------------
  |  Branch (3333:18): [True: 9.85k, False: 1.59k]
  ------------------
 3334|  11.4k|  registers[7] = VM_MEMORY_SIZE;
  ------------------
  |  |  139|  11.4k|#define VM_MEMORY_SIZE 0x40000
  ------------------
 3335|       |
 3336|  11.4k|  if ((flags & 0x10))
  ------------------
  |  Branch (3336:7): [True: 2.32k, False: 9.12k]
  ------------------
 3337|  2.32k|  {
 3338|  2.32k|    uint8_t mask = (uint8_t)membr_bits(&br, 7);
 3339|  18.6k|    for (i = 0; i < 7; i++)
  ------------------
  |  Branch (3339:17): [True: 16.2k, False: 2.32k]
  ------------------
 3340|  16.2k|      if ((mask & (1 << i)))
  ------------------
  |  Branch (3340:11): [True: 6.60k, False: 9.68k]
  ------------------
 3341|  6.60k|        registers[i] = membr_next_rarvm_number(&br);
 3342|  2.32k|  }
 3343|       |
 3344|  11.4k|  if (!prog)
  ------------------
  |  Branch (3344:7): [True: 1.59k, False: 9.85k]
  ------------------
 3345|  1.59k|  {
 3346|  1.59k|    uint32_t len = membr_next_rarvm_number(&br);
 3347|  1.59k|    uint8_t *bytecode;
 3348|  1.59k|    struct rar_program_code **next;
 3349|       |
 3350|  1.59k|    if (len == 0 || len > 0x10000)
  ------------------
  |  Branch (3350:9): [True: 0, False: 1.59k]
  |  Branch (3350:21): [True: 3, False: 1.59k]
  ------------------
 3351|      3|      return 0;
 3352|  1.59k|    bytecode = malloc(len);
 3353|  1.59k|    if (!bytecode)
  ------------------
  |  Branch (3353:9): [True: 0, False: 1.59k]
  ------------------
 3354|      0|      return 0;
 3355|  49.4k|    for (i = 0; i < len; i++)
  ------------------
  |  Branch (3355:17): [True: 47.8k, False: 1.59k]
  ------------------
 3356|  47.8k|      bytecode[i] = (uint8_t)membr_bits(&br, 8);
 3357|  1.59k|    prog = compile_program(bytecode, len);
 3358|  1.59k|    if (!prog) {
  ------------------
  |  Branch (3358:9): [True: 4, False: 1.59k]
  ------------------
 3359|      4|      free(bytecode);
 3360|      4|      return 0;
 3361|      4|    }
 3362|  1.59k|    free(bytecode);
 3363|  1.59k|    next = &filters->progs;
 3364|  2.16k|    while (*next)
  ------------------
  |  Branch (3364:12): [True: 570, False: 1.59k]
  ------------------
 3365|    570|      next = &(*next)->next;
 3366|  1.59k|    *next = prog;
 3367|  1.59k|  }
 3368|  11.4k|  prog->oldfilterlength = blocklength;
 3369|       |
 3370|  11.4k|  globaldata = NULL;
 3371|  11.4k|  globaldatalen = 0;
 3372|  11.4k|  if ((flags & 0x08))
  ------------------
  |  Branch (3372:7): [True: 494, False: 10.9k]
  ------------------
 3373|    494|  {
 3374|    494|    globaldatalen = membr_next_rarvm_number(&br);
 3375|    494|    if (globaldatalen > PROGRAM_USER_GLOBAL_SIZE)
  ------------------
  |  |  146|    494|#define PROGRAM_USER_GLOBAL_SIZE (PROGRAM_GLOBAL_SIZE - PROGRAM_SYSTEM_GLOBAL_SIZE)
  |  |  ------------------
  |  |  |  |  142|    494|#define PROGRAM_GLOBAL_SIZE 0x2000
  |  |  ------------------
  |  |               #define PROGRAM_USER_GLOBAL_SIZE (PROGRAM_GLOBAL_SIZE - PROGRAM_SYSTEM_GLOBAL_SIZE)
  |  |  ------------------
  |  |  |  |  144|    494|#define PROGRAM_SYSTEM_GLOBAL_SIZE 0x40
  |  |  ------------------
  ------------------
  |  Branch (3375:9): [True: 2, False: 492]
  ------------------
 3376|      2|      return 0;
 3377|    492|    globaldata = malloc(globaldatalen + PROGRAM_SYSTEM_GLOBAL_SIZE);
  ------------------
  |  |  144|    492|#define PROGRAM_SYSTEM_GLOBAL_SIZE 0x40
  ------------------
 3378|    492|    if (!globaldata)
  ------------------
  |  Branch (3378:9): [True: 0, False: 492]
  ------------------
 3379|      0|      return 0;
 3380|  1.30k|    for (i = 0; i < globaldatalen; i++)
  ------------------
  |  Branch (3380:17): [True: 808, False: 492]
  ------------------
 3381|    808|      globaldata[i + PROGRAM_SYSTEM_GLOBAL_SIZE] = (uint8_t)membr_bits(&br, 8);
  ------------------
  |  |  144|    808|#define PROGRAM_SYSTEM_GLOBAL_SIZE 0x40
  ------------------
 3382|    492|  }
 3383|       |
 3384|  11.4k|  if (br.at_eof)
  ------------------
  |  Branch (3384:7): [True: 2, False: 11.4k]
  ------------------
 3385|      2|  {
 3386|      2|      free(globaldata);
 3387|      2|      return 0;
 3388|      2|  }
 3389|       |
 3390|  11.4k|  filter = create_filter(prog, globaldata, globaldatalen, registers, blockstartpos, blocklength);
 3391|  11.4k|  free(globaldata);
 3392|  11.4k|  if (!filter)
  ------------------
  |  Branch (3392:7): [True: 0, False: 11.4k]
  ------------------
 3393|      0|    return 0;
 3394|       |
 3395|  91.5k|  for (i = 0; i < 7; i++)
  ------------------
  |  Branch (3395:15): [True: 80.0k, False: 11.4k]
  ------------------
 3396|  80.0k|    archive_le32enc(&filter->globaldata[i * 4], registers[i]);
 3397|  11.4k|  archive_le32enc(&filter->globaldata[0x1C], blocklength);
 3398|  11.4k|  archive_le32enc(&filter->globaldata[0x20], 0);
 3399|  11.4k|  archive_le32enc(&filter->globaldata[0x2C], prog->usagecount);
 3400|       |
 3401|  11.4k|  nextfilter = &filters->stack;
 3402|   814k|  while (*nextfilter)
  ------------------
  |  Branch (3402:10): [True: 803k, False: 11.4k]
  ------------------
 3403|   803k|    nextfilter = &(*nextfilter)->next;
 3404|  11.4k|  *nextfilter = filter;
 3405|       |
 3406|  11.4k|  if (!filters->stack->next)
  ------------------
  |  Branch (3406:7): [True: 2.20k, False: 9.24k]
  ------------------
 3407|  2.20k|    filters->filterstart = blockstartpos;
 3408|       |
 3409|  11.4k|  return 1;
 3410|  11.4k|}
archive_read_support_format_rar.c:membr_next_rarvm_number:
 3617|  26.0k|{
 3618|  26.0k|  uint32_t val;
 3619|  26.0k|  switch (membr_bits(br, 2))
 3620|  26.0k|  {
 3621|  15.4k|    case 0:
  ------------------
  |  Branch (3621:5): [True: 15.4k, False: 10.6k]
  ------------------
 3622|  15.4k|      return membr_bits(br, 4);
 3623|  5.58k|    case 1:
  ------------------
  |  Branch (3623:5): [True: 5.58k, False: 20.4k]
  ------------------
 3624|  5.58k|      val = membr_bits(br, 8);
 3625|  5.58k|      if (val >= 16)
  ------------------
  |  Branch (3625:11): [True: 3.66k, False: 1.91k]
  ------------------
 3626|  3.66k|        return val;
 3627|  1.91k|      return 0xFFFFFF00 | (val << 4) | membr_bits(br, 4);
 3628|  2.36k|    case 2:
  ------------------
  |  Branch (3628:5): [True: 2.36k, False: 23.6k]
  ------------------
 3629|  2.36k|      return membr_bits(br, 16);
 3630|  2.65k|    default:
  ------------------
  |  Branch (3630:5): [True: 2.65k, False: 23.3k]
  ------------------
 3631|  2.65k|      return membr_bits(br, 32);
 3632|  26.0k|  }
 3633|  26.0k|}
archive_read_support_format_rar.c:delete_program_code:
 3604|  3.54k|{
 3605|  5.13k|  while (prog)
  ------------------
  |  Branch (3605:10): [True: 1.59k, False: 3.54k]
  ------------------
 3606|  1.59k|  {
 3607|  1.59k|    struct rar_program_code *next = prog->next;
 3608|  1.59k|    free(prog->staticdata);
 3609|  1.59k|    free(prog->globalbackup);
 3610|  1.59k|    free(prog);
 3611|  1.59k|    prog = next;
 3612|  1.59k|  }
 3613|  3.54k|}
archive_read_support_format_rar.c:membr_bits:
 3637|   218k|{
 3638|   218k|  if (bits > br->available && (br->at_eof || !membr_fill(br, bits)))
  ------------------
  |  Branch (3638:7): [True: 193k, False: 25.3k]
  |  Branch (3638:32): [True: 111k, False: 81.6k]
  |  Branch (3638:46): [True: 479, False: 81.2k]
  ------------------
 3639|   111k|    return 0;
 3640|   106k|  return (uint32_t)((br->bits >> (br->available -= bits)) & (((uint64_t)1 << bits) - 1));
 3641|   218k|}
archive_read_support_format_rar.c:membr_fill:
 3645|  81.6k|{
 3646|   173k|  while (br->available < bits && br->offset < br->length)
  ------------------
  |  Branch (3646:10): [True: 92.0k, False: 81.2k]
  |  Branch (3646:34): [True: 91.5k, False: 479]
  ------------------
 3647|  91.5k|  {
 3648|  91.5k|    br->bits = (br->bits << 8) | br->bytes[br->offset++];
 3649|  91.5k|    br->available += 8;
 3650|  91.5k|  }
 3651|  81.6k|  if (bits > br->available)
  ------------------
  |  Branch (3651:7): [True: 479, False: 81.2k]
  ------------------
 3652|    479|  {
 3653|    479|    br->at_eof = 1;
 3654|    479|    return 0;
 3655|    479|  }
 3656|  81.2k|  return 1;
 3657|  81.6k|}
archive_read_support_format_rar.c:compile_program:
 3538|  1.59k|{
 3539|  1.59k|  struct memory_bit_reader br = { 0 };
 3540|  1.59k|  struct rar_program_code *prog;
 3541|       |  // uint32_t instrcount = 0;
 3542|  1.59k|  uint8_t xor;
 3543|  1.59k|  size_t i;
 3544|       |
 3545|  1.59k|  xor = 0;
 3546|  47.8k|  for (i = 1; i < length; i++)
  ------------------
  |  Branch (3546:15): [True: 46.2k, False: 1.59k]
  ------------------
 3547|  46.2k|    xor ^= bytes[i];
 3548|  1.59k|  if (!length || xor != bytes[0])
  ------------------
  |  Branch (3548:7): [True: 0, False: 1.59k]
  |  Branch (3548:18): [True: 4, False: 1.59k]
  ------------------
 3549|      4|    return NULL;
 3550|       |
 3551|  1.59k|  br.bytes = bytes;
 3552|  1.59k|  br.length = length;
 3553|  1.59k|  br.offset = 1;
 3554|       |
 3555|  1.59k|  prog = calloc(1, sizeof(*prog));
 3556|  1.59k|  if (!prog)
  ------------------
  |  Branch (3556:7): [True: 0, False: 1.59k]
  ------------------
 3557|      0|    return NULL;
 3558|  1.59k|  prog->fingerprint = crc32(0, bytes, (unsigned int)length) | ((uint64_t)length << 32);
 3559|       |
 3560|  1.59k|  if (membr_bits(&br, 1))
  ------------------
  |  Branch (3560:7): [True: 472, False: 1.11k]
  ------------------
 3561|    472|  {
 3562|    472|    uint32_t staticdatalen = membr_next_rarvm_number(&br);
 3563|    472|    if (staticdatalen >= VM_MEMORY_SIZE)
  ------------------
  |  |  139|    472|#define VM_MEMORY_SIZE 0x40000
  ------------------
  |  Branch (3563:9): [True: 0, False: 472]
  ------------------
 3564|      0|    {
 3565|      0|      delete_program_code(prog);
 3566|      0|      return NULL;
 3567|      0|    }
 3568|    472|    prog->staticdatalen = staticdatalen + 1;
 3569|    472|    prog->staticdata = malloc(prog->staticdatalen);
 3570|    472|    if (!prog->staticdata)
  ------------------
  |  Branch (3570:9): [True: 0, False: 472]
  ------------------
 3571|      0|    {
 3572|      0|      delete_program_code(prog);
 3573|      0|      return NULL;
 3574|      0|    }
 3575|   112k|    for (i = 0; i < prog->staticdatalen; i++)
  ------------------
  |  Branch (3575:17): [True: 111k, False: 472]
  ------------------
 3576|   111k|      prog->staticdata[i] = (uint8_t)membr_bits(&br, 8);
 3577|    472|  }
 3578|       |
 3579|  1.59k|  return prog;
 3580|  1.59k|}
archive_read_support_format_rar.c:create_filter:
 3414|  11.4k|{
 3415|  11.4k|  struct rar_filter *filter;
 3416|       |
 3417|  11.4k|  filter = calloc(1, sizeof(*filter));
 3418|  11.4k|  if (!filter)
  ------------------
  |  Branch (3418:7): [True: 0, False: 11.4k]
  ------------------
 3419|      0|    return NULL;
 3420|  11.4k|  filter->prog = prog;
 3421|  11.4k|  filter->globaldatalen = globaldatalen > PROGRAM_SYSTEM_GLOBAL_SIZE ? globaldatalen : PROGRAM_SYSTEM_GLOBAL_SIZE;
  ------------------
  |  |  144|  11.4k|#define PROGRAM_SYSTEM_GLOBAL_SIZE 0x40
  ------------------
                filter->globaldatalen = globaldatalen > PROGRAM_SYSTEM_GLOBAL_SIZE ? globaldatalen : PROGRAM_SYSTEM_GLOBAL_SIZE;
  ------------------
  |  |  144|  22.8k|#define PROGRAM_SYSTEM_GLOBAL_SIZE 0x40
  ------------------
  |  Branch (3421:27): [True: 0, False: 11.4k]
  ------------------
 3422|  11.4k|  filter->globaldata = calloc(1, filter->globaldatalen);
 3423|  11.4k|  if (!filter->globaldata)
  ------------------
  |  Branch (3423:7): [True: 0, False: 11.4k]
  ------------------
 3424|      0|  {
 3425|      0|    free(filter);
 3426|      0|    return NULL;
 3427|      0|  }
 3428|  11.4k|  if (globaldata)
  ------------------
  |  Branch (3428:7): [True: 491, False: 10.9k]
  ------------------
 3429|    491|    memcpy(filter->globaldata, globaldata, globaldatalen);
 3430|  11.4k|  if (registers)
  ------------------
  |  Branch (3430:7): [True: 11.4k, False: 0]
  ------------------
 3431|  11.4k|    memcpy(filter->initialregisters, registers, sizeof(filter->initialregisters));
 3432|  11.4k|  filter->blockstartpos = startpos;
 3433|  11.4k|  filter->blocklength = length;
 3434|       |
 3435|  11.4k|  return filter;
 3436|  11.4k|}
archive_read_support_format_rar.c:archive_read_format_rar_read_data_skip:
 1153|    760|{
 1154|    760|  struct rar *rar;
 1155|    760|  int64_t bytes_skipped;
 1156|    760|  int ret;
 1157|       |
 1158|    760|  rar = (struct rar *)(a->format->data);
 1159|       |
 1160|    760|  if (rar->bytes_unconsumed > 0) {
  ------------------
  |  Branch (1160:7): [True: 54, False: 706]
  ------------------
 1161|       |      /* Consume as much as the decompressor actually used. */
 1162|     54|      __archive_read_consume(a, rar->bytes_unconsumed);
 1163|     54|      rar->bytes_unconsumed = 0;
 1164|     54|  }
 1165|       |
 1166|    760|  if (rar->bytes_remaining > 0) {
  ------------------
  |  Branch (1166:7): [True: 396, False: 364]
  ------------------
 1167|    396|    bytes_skipped = __archive_read_consume(a, rar->bytes_remaining);
 1168|    396|    if (bytes_skipped < 0)
  ------------------
  |  Branch (1168:9): [True: 123, False: 273]
  ------------------
 1169|    123|      return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    123|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1170|    396|  }
 1171|       |
 1172|       |  /* Compressed data to skip must be read from each header in a multivolume
 1173|       |   * archive.
 1174|       |   */
 1175|    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 (1175:7): [True: 464, False: 173]
  |  Branch (1175:39): [True: 310, False: 154]
  ------------------
 1176|    310|  {
 1177|    310|    ret = archive_read_format_rar_read_header(a, a->entry);
 1178|    310|    if (ret == (ARCHIVE_EOF))
  ------------------
  |  |  232|    310|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1178:9): [True: 0, False: 310]
  ------------------
 1179|      0|      ret = archive_read_format_rar_read_header(a, a->entry);
 1180|    310|    if (ret != (ARCHIVE_OK))
  ------------------
  |  |  233|    310|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1180:9): [True: 46, False: 264]
  ------------------
 1181|     46|      return ret;
 1182|    264|    return archive_read_format_rar_read_data_skip(a);
 1183|    310|  }
 1184|       |
 1185|    327|  return (ARCHIVE_OK);
  ------------------
  |  |  233|    327|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1186|    637|}
archive_read_support_format_rar.c:archive_read_format_rar_cleanup:
 1344|  2.49k|{
 1345|  2.49k|  struct rar *rar;
 1346|       |
 1347|  2.49k|  rar = (struct rar *)(a->format->data);
 1348|  2.49k|  free_codes(a);
 1349|  2.49k|  clear_filters(&rar->filters);
 1350|  2.49k|  free(rar->filename);
 1351|  2.49k|  free(rar->filename_save);
 1352|  2.49k|  free(rar->dbo);
 1353|  2.49k|  free(rar->unp_buffer);
 1354|  2.49k|  free(rar->lzss.window);
 1355|  2.49k|  __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context);
 1356|  2.49k|  free(rar);
 1357|  2.49k|  (a->format->data) = NULL;
 1358|  2.49k|  return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1359|  2.49k|}
archive_read_support_format_rar.c:clear_filters:
 3596|  2.49k|{
 3597|  2.49k|  delete_filter(filters->stack);
 3598|  2.49k|  delete_program_code(filters->progs);
 3599|  2.49k|  free(filters->vm);
 3600|  2.49k|}

archive_read_support_format_rar5:
 4447|  2.49k|int archive_read_support_format_rar5(struct archive *_a) {
 4448|  2.49k|	struct archive_read* ar;
 4449|  2.49k|	int ret;
 4450|  2.49k|	struct rar5* rar;
 4451|       |
 4452|  2.49k|	if(ARCHIVE_OK != (ret = get_archive_read(_a, &ar)))
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4452:5): [True: 0, False: 2.49k]
  ------------------
 4453|      0|		return ret;
 4454|       |
 4455|  2.49k|	rar = malloc(sizeof(*rar));
 4456|  2.49k|	if(rar == NULL) {
  ------------------
  |  Branch (4456:5): [True: 0, False: 2.49k]
  ------------------
 4457|      0|		archive_set_error(&ar->archive, ENOMEM,
 4458|      0|		    "Can't allocate rar5 data");
 4459|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4460|      0|	}
 4461|       |
 4462|  2.49k|	if(ARCHIVE_OK != rar5_init(rar)) {
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4462:5): [True: 0, False: 2.49k]
  ------------------
 4463|      0|		archive_set_error(&ar->archive, ENOMEM,
 4464|      0|		    "Can't allocate rar5 filter buffer");
 4465|      0|		free(rar);
 4466|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4467|      0|	}
 4468|       |
 4469|  2.49k|	ret = __archive_read_register_format(ar,
 4470|  2.49k|	    rar,
 4471|  2.49k|	    "rar5",
 4472|  2.49k|	    rar5_bid,
 4473|  2.49k|	    rar5_options,
 4474|  2.49k|	    rar5_read_header,
 4475|  2.49k|	    rar5_read_data,
 4476|  2.49k|	    rar5_read_data_skip,
 4477|  2.49k|	    rar5_seek_data,
 4478|  2.49k|	    rar5_cleanup,
 4479|  2.49k|	    rar5_capabilities,
 4480|  2.49k|	    rar5_has_encrypted_entries);
 4481|       |
 4482|  2.49k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4482:5): [True: 0, False: 2.49k]
  ------------------
 4483|      0|		rar5_deinit(rar);
 4484|      0|		free(rar);
 4485|      0|	}
 4486|       |
 4487|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4488|  2.49k|}
archive_read_support_format_rar5.c:get_archive_read:
  899|  2.49k|{
  900|  2.49k|	*ar = (struct archive_read*) a;
  901|  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]
  |  |  ------------------
  ------------------
  902|  2.49k|	    "archive_read_support_format_rar5");
  903|       |
  904|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  905|  2.49k|}
archive_read_support_format_rar5.c:rar5_init:
 4427|  2.49k|static int rar5_init(struct rar5* rar) {
 4428|  2.49k|	memset(rar, 0, sizeof(struct rar5));
 4429|       |
 4430|  2.49k|	if(CDE_OK != cdeque_init(&rar->cstate.filters, 8192))
  ------------------
  |  Branch (4430:5): [True: 0, False: 2.49k]
  ------------------
 4431|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4432|       |
 4433|       |	/*
 4434|       |	 * Until enough data has been read, we cannot tell about
 4435|       |	 * any encrypted entries yet.
 4436|       |	 */
 4437|  2.49k|	rar->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|  2.49k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4438|       |
 4439|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4440|  2.49k|}
archive_read_support_format_rar5.c:cdeque_init:
  397|  2.49k|static int cdeque_init(struct cdeque* d, int max_capacity_power_of_2) {
  398|  2.49k|	if(d == NULL || max_capacity_power_of_2 == 0)
  ------------------
  |  Branch (398:5): [True: 0, False: 2.49k]
  |  Branch (398:18): [True: 0, False: 2.49k]
  ------------------
  399|      0|		return CDE_PARAM;
  400|       |
  401|  2.49k|	d->cap_mask = max_capacity_power_of_2 - 1;
  402|  2.49k|	d->arr = NULL;
  403|       |
  404|  2.49k|	if((max_capacity_power_of_2 & d->cap_mask) != 0)
  ------------------
  |  Branch (404:5): [True: 0, False: 2.49k]
  ------------------
  405|      0|		return CDE_PARAM;
  406|       |
  407|  2.49k|	cdeque_clear(d);
  408|  2.49k|	d->arr = malloc(sizeof(void*) * max_capacity_power_of_2);
  409|       |
  410|  2.49k|	return d->arr ? CDE_OK : CDE_ALLOC;
  ------------------
  |  Branch (410:9): [True: 2.49k, False: 0]
  ------------------
  411|  2.49k|}
archive_read_support_format_rar5.c:cdeque_clear:
  388|  5.52k|static void cdeque_clear(struct cdeque* d) {
  389|  5.52k|	d->size = 0;
  390|  5.52k|	d->beg_pos = 0;
  391|  5.52k|	d->end_pos = 0;
  392|  5.52k|}
archive_read_support_format_rar5.c:rar5_bid:
 1179|  2.45k|static int rar5_bid(struct archive_read* a, int best_bid) {
 1180|  2.45k|	int my_bid;
 1181|       |
 1182|  2.45k|	if(best_bid > 30)
  ------------------
  |  Branch (1182:5): [True: 975, False: 1.48k]
  ------------------
 1183|    975|		return -1;
 1184|       |
 1185|  1.48k|	my_bid = bid_standard(a);
 1186|  1.48k|	if(my_bid > -1) {
  ------------------
  |  Branch (1186:5): [True: 359, False: 1.12k]
  ------------------
 1187|    359|		return my_bid;
 1188|    359|	}
 1189|  1.12k|	my_bid = bid_sfx(a);
 1190|  1.12k|	if (my_bid > -1) {
  ------------------
  |  Branch (1190:6): [True: 1.10k, False: 24]
  ------------------
 1191|  1.10k|		return my_bid;
 1192|  1.10k|	}
 1193|       |
 1194|     24|	return -1;
 1195|  1.12k|}
archive_read_support_format_rar5.c:bid_standard:
 1126|  1.48k|static int bid_standard(struct archive_read* a) {
 1127|  1.48k|	const uint8_t* p;
 1128|  1.48k|	char signature[sizeof(rar5_signature_xor)];
 1129|       |
 1130|  1.48k|	rar5_signature(signature);
 1131|       |
 1132|  1.48k|	if(!read_ahead(a, sizeof(rar5_signature_xor), &p))
  ------------------
  |  Branch (1132:5): [True: 24, False: 1.45k]
  ------------------
 1133|     24|		return -1;
 1134|       |
 1135|  1.45k|	if(!memcmp(signature, p, sizeof(rar5_signature_xor)))
  ------------------
  |  Branch (1135:5): [True: 359, False: 1.10k]
  ------------------
 1136|    359|		return 30;
 1137|       |
 1138|  1.10k|	return -1;
 1139|  1.45k|}
archive_read_support_format_rar5.c:rar5_signature:
 4251|  4.69k|static void rar5_signature(char *buf) {
 4252|  4.69k|		size_t i;
 4253|       |
 4254|  42.2k|		for(i = 0; i < sizeof(rar5_signature_xor); i++) {
  ------------------
  |  Branch (4254:14): [True: 37.5k, False: 4.69k]
  ------------------
 4255|  37.5k|			buf[i] = rar5_signature_xor[i] ^ 0xA1;
 4256|  37.5k|		}
 4257|  4.69k|}
archive_read_support_format_rar5.c:read_ahead:
  909|   123k|{
  910|   123k|	ssize_t avail = -1;
  911|   123k|	if(!ptr)
  ------------------
  |  Branch (911:5): [True: 0, False: 123k]
  ------------------
  912|      0|		return 0;
  913|       |
  914|   123k|	*ptr = __archive_read_ahead(a, how_many, &avail);
  915|   123k|	if(*ptr == NULL) {
  ------------------
  |  Branch (915:5): [True: 310, False: 123k]
  ------------------
  916|    310|		return 0;
  917|    310|	}
  918|       |
  919|   123k|	return 1;
  920|   123k|}
archive_read_support_format_rar5.c:bid_sfx:
 1142|  1.12k|{
 1143|  1.12k|	const char *p;
 1144|       |
 1145|  1.12k|	if ((p = __archive_read_ahead(a, 7, NULL)) == NULL)
  ------------------
  |  Branch (1145:6): [True: 24, False: 1.10k]
  ------------------
 1146|     24|		return -1;
 1147|       |
 1148|  1.10k|	if ((p[0] == 'M' && p[1] == 'Z') || memcmp(p, "\x7F\x45LF", 4) == 0) {
  ------------------
  |  Branch (1148:7): [True: 60, False: 1.04k]
  |  Branch (1148:22): [True: 60, False: 0]
  |  Branch (1148:38): [True: 15, False: 1.02k]
  ------------------
 1149|       |		/* This is a PE file */
 1150|     75|		char signature[sizeof(rar5_signature_xor)];
 1151|     75|		ssize_t offset = 0x10000;
 1152|     75|		ssize_t window = 4096;
 1153|     75|		ssize_t bytes_avail;
 1154|       |
 1155|     75|		rar5_signature(signature);
 1156|       |
 1157|    564|		while (offset + window <= (1024 * 512)) {
  ------------------
  |  Branch (1157:10): [True: 556, False: 8]
  ------------------
 1158|    556|			const char *buff = __archive_read_ahead(a, offset + window, &bytes_avail);
 1159|    556|			if (buff == NULL) {
  ------------------
  |  Branch (1159:8): [True: 438, False: 118]
  ------------------
 1160|       |				/* Remaining bytes are less than window. */
 1161|    438|				window >>= 1;
 1162|    438|				if (window < 0x40)
  ------------------
  |  Branch (1162:9): [True: 62, False: 376]
  ------------------
 1163|     62|					return 0;
 1164|    376|				continue;
 1165|    438|			}
 1166|    118|			p = buff + offset;
 1167|   427k|			while (p + 8 < buff + bytes_avail) {
  ------------------
  |  Branch (1167:11): [True: 427k, False: 113]
  ------------------
 1168|   427k|				if (memcmp(p, signature, sizeof(signature)) == 0)
  ------------------
  |  Branch (1168:9): [True: 5, False: 427k]
  ------------------
 1169|      5|					return 30;
 1170|   427k|				p += 0x10;
 1171|   427k|			}
 1172|    113|			offset = p - buff;
 1173|    113|		}
 1174|     75|	}
 1175|       |
 1176|  1.03k|	return 0;
 1177|  1.10k|}
archive_read_support_format_rar5.c:rar5_read_header:
 2561|    429|{
 2562|    429|	struct rar5* rar = get_context(a);
 2563|    429|	int ret;
 2564|       |
 2565|       |	/*
 2566|       |	 * It should be sufficient to call archive_read_next_header() for
 2567|       |	 * a reader to determine if an entry is encrypted or not.
 2568|       |	 */
 2569|    429|	if (rar->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|    429|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (2569:6): [True: 262, False: 167]
  ------------------
 2570|    262|		rar->has_encrypted_entries = 0;
 2571|    262|	}
 2572|       |
 2573|    429|	if(rar->header_initialized == 0) {
  ------------------
  |  Branch (2573:5): [True: 262, False: 167]
  ------------------
 2574|    262|		init_header(a);
 2575|    262|		if ((ret = try_skip_sfx(a)) < ARCHIVE_WARN)
  ------------------
  |  |  235|    262|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (2575:7): [True: 0, False: 262]
  ------------------
 2576|      0|			return ret;
 2577|    262|		rar->header_initialized = 1;
 2578|    262|	}
 2579|       |
 2580|    429|	if(rar->skipped_magic == 0) {
  ------------------
  |  Branch (2580:5): [True: 262, False: 167]
  ------------------
 2581|    262|		if(ARCHIVE_OK != consume(a, sizeof(rar5_signature_xor))) {
  ------------------
  |  |  233|    262|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2581:6): [True: 0, False: 262]
  ------------------
 2582|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2583|      0|		}
 2584|       |
 2585|    262|		rar->skipped_magic = 1;
 2586|    262|	}
 2587|       |
 2588|    924|	do {
 2589|    924|		ret = process_base_block(a, entry);
 2590|    924|	} while(ret == ARCHIVE_RETRY ||
  ------------------
  |  |  234|  1.84k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (2590:10): [True: 309, False: 615]
  ------------------
 2591|    615|			(rar->main.endarc > 0 && ret == ARCHIVE_OK));
  ------------------
  |  |  233|    188|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2591:5): [True: 188, False: 427]
  |  Branch (2591:29): [True: 186, False: 2]
  ------------------
 2592|       |
 2593|    429|	return ret;
 2594|    429|}
archive_read_support_format_rar5.c:get_context:
  519|  83.8k|static inline struct rar5* get_context(struct archive_read* a) {
  520|  83.8k|	return (struct rar5*) a->format->data;
  521|  83.8k|}
archive_read_support_format_rar5.c:init_header:
 1210|    262|static void init_header(struct archive_read* a) {
 1211|    262|	a->archive.archive_format = ARCHIVE_FORMAT_RAR_V5;
  ------------------
  |  |  387|    262|#define	ARCHIVE_FORMAT_RAR_V5			0x100000
  ------------------
 1212|    262|	a->archive.archive_format_name = "RAR5";
 1213|    262|}
archive_read_support_format_rar5.c:try_skip_sfx:
 2504|    262|{
 2505|    262|	const char *p;
 2506|       |
 2507|    262|	if ((p = __archive_read_ahead(a, 7, NULL)) == NULL)
  ------------------
  |  Branch (2507:6): [True: 0, False: 262]
  ------------------
 2508|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2509|       |
 2510|    262|	if ((p[0] == 'M' && p[1] == 'Z') || memcmp(p, "\x7F\x45LF", 4) == 0)
  ------------------
  |  Branch (2510:7): [True: 0, False: 262]
  |  Branch (2510:22): [True: 0, False: 0]
  |  Branch (2510:38): [True: 4, False: 258]
  ------------------
 2511|      4|	{
 2512|      4|		char signature[sizeof(rar5_signature_xor)];
 2513|      4|		const void *h;
 2514|      4|		const char *q;
 2515|      4|		size_t skip, total = 0;
 2516|      4|		ssize_t bytes, window = 4096;
 2517|       |
 2518|      4|		rar5_signature(signature);
 2519|       |
 2520|      4|		while (total + window <= (1024 * 512)) {
  ------------------
  |  Branch (2520:10): [True: 4, False: 0]
  ------------------
 2521|      4|			h = __archive_read_ahead(a, window, &bytes);
 2522|      4|			if (h == NULL) {
  ------------------
  |  Branch (2522:8): [True: 0, False: 4]
  ------------------
 2523|       |				/* Remaining bytes are less than window. */
 2524|      0|				window >>= 1;
 2525|      0|				if (window < 0x40)
  ------------------
  |  Branch (2525:9): [True: 0, False: 0]
  ------------------
 2526|      0|					goto fatal;
 2527|      0|				continue;
 2528|      0|			}
 2529|      4|			if (bytes < 0x40)
  ------------------
  |  Branch (2529:8): [True: 0, False: 4]
  ------------------
 2530|      0|				goto fatal;
 2531|      4|			p = h;
 2532|      4|			q = p + bytes;
 2533|       |
 2534|       |			/*
 2535|       |			 * Scan ahead until we find something that looks
 2536|       |			 * like the RAR header.
 2537|       |			 */
 2538|  1.69k|			while (p + 8 < q) {
  ------------------
  |  Branch (2538:11): [True: 1.69k, False: 0]
  ------------------
 2539|  1.69k|				if (memcmp(p, signature, sizeof(signature)) == 0) {
  ------------------
  |  Branch (2539:9): [True: 4, False: 1.68k]
  ------------------
 2540|      4|					skip = p - (const char *)h;
 2541|      4|					__archive_read_consume(a, skip);
 2542|      4|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      4|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2543|      4|				}
 2544|  1.68k|				p += 0x10;
 2545|  1.68k|			}
 2546|      0|			skip = p - (const char *)h;
 2547|      0|			__archive_read_consume(a, skip);
 2548|      0|			total += skip;
 2549|      0|		}
 2550|      4|	}
 2551|       |
 2552|    258|	return ARCHIVE_OK;
  ------------------
  |  |  233|    258|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2553|      0|fatal:
 2554|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2555|      0|			"Couldn't find out RAR header");
 2556|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2557|    262|}
archive_read_support_format_rar5.c:consume:
  922|   117k|static int consume(struct archive_read* a, int64_t how_many) {
  923|   117k|	int ret;
  924|       |
  925|   117k|	ret = how_many == __archive_read_consume(a, how_many)
  ------------------
  |  Branch (925:8): [True: 117k, False: 62]
  ------------------
  926|   117k|		? ARCHIVE_OK
  ------------------
  |  |  233|   117k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  927|   117k|		: ARCHIVE_FATAL;
  ------------------
  |  |  239|   117k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  928|       |
  929|   117k|	return ret;
  930|   117k|}
archive_read_support_format_rar5.c:process_base_block:
 2301|  7.39k|{
 2302|  7.39k|	const size_t SMALLEST_RAR5_BLOCK_SIZE = 3;
 2303|       |
 2304|  7.39k|	struct rar5* rar = get_context(a);
 2305|  7.39k|	uint32_t hdr_crc, computed_crc;
 2306|  7.39k|	size_t raw_hdr_size = 0, hdr_size_len, hdr_size;
 2307|  7.39k|	size_t header_id = 0;
 2308|  7.39k|	size_t header_flags = 0;
 2309|  7.39k|	const uint8_t* p;
 2310|  7.39k|	const uint8_t* body_start;
 2311|  7.39k|	int ret;
 2312|       |
 2313|  7.39k|	enum HEADER_TYPE {
 2314|  7.39k|		HEAD_MARK    = 0x00, HEAD_MAIN  = 0x01, HEAD_FILE   = 0x02,
 2315|  7.39k|		HEAD_SERVICE = 0x03, HEAD_CRYPT = 0x04, HEAD_ENDARC = 0x05,
 2316|  7.39k|		HEAD_UNKNOWN = 0xff,
 2317|  7.39k|	};
 2318|       |
 2319|       |	/* Skip any unprocessed data for this file. */
 2320|  7.39k|	ret = skip_unprocessed_bytes(a);
 2321|  7.39k|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  7.39k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2321:5): [True: 20, False: 7.37k]
  ------------------
 2322|     20|		return ret;
 2323|       |
 2324|       |	/* Read the expected CRC32 checksum. */
 2325|  7.37k|	if(!read_u32(a, &hdr_crc)) {
  ------------------
  |  Branch (2325:5): [True: 0, False: 7.37k]
  ------------------
 2326|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2327|      0|	}
 2328|       |
 2329|       |	/* Read header size. */
 2330|  7.37k|	if(!read_var_sized(a, &raw_hdr_size, &hdr_size_len)) {
  ------------------
  |  Branch (2330:5): [True: 2, False: 7.36k]
  ------------------
 2331|      2|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2332|      2|	}
 2333|       |
 2334|  7.36k|	hdr_size = raw_hdr_size + hdr_size_len;
 2335|       |
 2336|       |	/* Sanity check, maximum header size for RAR5 is 2MB. */
 2337|  7.36k|	if(hdr_size > (2 * 1024 * 1024)) {
  ------------------
  |  Branch (2337:5): [True: 14, False: 7.35k]
  ------------------
 2338|     14|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     14|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2339|     14|		    "Base block header is too large");
 2340|       |
 2341|     14|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     14|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2342|     14|	}
 2343|       |
 2344|       |	/* Additional sanity checks to weed out invalid files. */
 2345|  7.35k|	if(raw_hdr_size == 0 || hdr_size_len == 0 ||
  ------------------
  |  Branch (2345:5): [True: 32, False: 7.32k]
  |  Branch (2345:26): [True: 0, False: 7.32k]
  ------------------
 2346|  7.32k|		hdr_size < SMALLEST_RAR5_BLOCK_SIZE)
  ------------------
  |  Branch (2346:3): [True: 17, False: 7.30k]
  ------------------
 2347|     49|	{
 2348|     49|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     49|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2349|     49|		    "Too small block encountered (%zu bytes)",
 2350|     49|		    raw_hdr_size);
 2351|       |
 2352|     49|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     49|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2353|     49|	}
 2354|       |
 2355|       |	/* Read the whole header data into memory, maximum memory use here is
 2356|       |	 * 2MB. */
 2357|  7.30k|	if(!read_ahead(a, hdr_size, &p)) {
  ------------------
  |  Branch (2357:5): [True: 21, False: 7.28k]
  ------------------
 2358|     21|		return ARCHIVE_EOF;
  ------------------
  |  |  232|     21|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2359|     21|	}
 2360|       |
 2361|       |	/* Verify the CRC32 of the header data. */
 2362|  7.28k|	computed_crc = (uint32_t) crc32(0, p, (int) hdr_size);
 2363|  7.28k|	if(computed_crc != hdr_crc) {
  ------------------
  |  Branch (2363:5): [True: 7.18k, False: 99]
  ------------------
 2364|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 2365|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 2366|       |		    "Header CRC error");
 2367|       |
 2368|       |		return ARCHIVE_FATAL;
 2369|       |#endif
 2370|  7.18k|	}
 2371|       |
 2372|       |	/* Remember the first byte of the block body so we can later skip
 2373|       |	 * any bytes the sub-parser leaves unconsumed. */
 2374|  7.28k|	body_start = p + hdr_size_len;
 2375|       |
 2376|       |	/* If the checksum is OK, we proceed with parsing. */
 2377|  7.28k|	if(ARCHIVE_OK != consume(a, hdr_size_len)) {
  ------------------
  |  |  233|  7.28k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2377:5): [True: 0, False: 7.28k]
  ------------------
 2378|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2379|      0|	}
 2380|       |
 2381|  7.28k|	if(!read_var_sized(a, &header_id, NULL))
  ------------------
  |  Branch (2381:5): [True: 0, False: 7.28k]
  ------------------
 2382|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2383|       |
 2384|  7.28k|	if(!read_var_sized(a, &header_flags, NULL))
  ------------------
  |  Branch (2384:5): [True: 0, False: 7.28k]
  ------------------
 2385|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2386|       |
 2387|  7.28k|	rar->generic.split_after = (header_flags & HFL_SPLIT_AFTER) > 0;
 2388|  7.28k|	rar->generic.split_before = (header_flags & HFL_SPLIT_BEFORE) > 0;
 2389|  7.28k|	rar->generic.size = (int)hdr_size;
 2390|  7.28k|	rar->generic.last_header_id = (int)header_id;
 2391|  7.28k|	rar->main.endarc = 0;
 2392|       |
 2393|       |	/* Those are possible header ids in RARv5. */
 2394|  7.28k|	switch(header_id) {
 2395|    304|		case HEAD_MAIN:
  ------------------
  |  Branch (2395:3): [True: 304, False: 6.98k]
  ------------------
 2396|    304|			ret = process_head_main(a, rar, entry, header_flags);
 2397|       |
 2398|       |			/* Main header doesn't have any files in it, so it's
 2399|       |			 * pointless to return to the caller. Retry to next
 2400|       |			 * header, which should be HEAD_FILE/HEAD_SERVICE. */
 2401|    304|			if(ret == ARCHIVE_OK) {
  ------------------
  |  |  233|    304|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2401:7): [True: 256, False: 48]
  ------------------
 2402|    256|				rar5_skip_remaining_block(a, body_start,
 2403|    256|				    raw_hdr_size);
 2404|    256|				return ARCHIVE_RETRY;
  ------------------
  |  |  234|    256|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2405|    256|			}
 2406|       |
 2407|     48|			return ret;
 2408|    156|		case HEAD_SERVICE:
  ------------------
  |  Branch (2408:3): [True: 156, False: 7.12k]
  ------------------
 2409|    156|			ret = process_head_service(a, rar, entry, header_flags);
 2410|    156|			return ret;
 2411|  3.44k|		case HEAD_FILE:
  ------------------
  |  Branch (2411:3): [True: 3.44k, False: 3.84k]
  ------------------
 2412|  3.44k|			ret = process_head_file(a, rar, entry, header_flags);
 2413|  3.44k|			return ret;
 2414|     20|		case HEAD_CRYPT:
  ------------------
  |  Branch (2414:3): [True: 20, False: 7.26k]
  ------------------
 2415|     20|			archive_entry_set_is_metadata_encrypted(entry, 1);
 2416|     20|			archive_entry_set_is_data_encrypted(entry, 1);
 2417|     20|			rar->has_encrypted_entries = 1;
 2418|     20|			rar->headers_are_encrypted = 1;
 2419|     20|			archive_set_error(&a->archive,
 2420|     20|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     20|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2421|     20|			    "Encryption is not supported");
 2422|     20|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|     20|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2423|  3.16k|		case HEAD_ENDARC:
  ------------------
  |  Branch (2423:3): [True: 3.16k, False: 4.12k]
  ------------------
 2424|  3.16k|			rar->main.endarc = 1;
 2425|       |
 2426|       |			/* After encountering an end of file marker, we need
 2427|       |			 * to take into consideration if this archive is
 2428|       |			 * continued in another file (i.e. is it part01.rar:
 2429|       |			 * is there a part02.rar?) */
 2430|  3.16k|			if(rar->main.volume) {
  ------------------
  |  Branch (2430:7): [True: 3.12k, False: 36]
  ------------------
 2431|       |				/* In case there is part02.rar, position the
 2432|       |				 * read pointer in a proper place, so we can
 2433|       |				 * resume parsing. */
 2434|  3.12k|				ret = scan_for_signature(a);
 2435|  3.12k|				if(ret == ARCHIVE_FATAL) {
  ------------------
  |  |  239|  3.12k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2435:8): [True: 0, False: 3.12k]
  ------------------
 2436|      0|					return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2437|  3.12k|				} else {
 2438|  3.12k|					if(rar->vol.expected_vol_no ==
  ------------------
  |  Branch (2438:9): [True: 0, False: 3.12k]
  ------------------
 2439|  3.12k|					    UINT_MAX) {
 2440|      0|						archive_set_error(&a->archive,
 2441|      0|						    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2442|      0|						    "Header error");
 2443|      0|							return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2444|      0|					}
 2445|       |
 2446|  3.12k|					rar->vol.expected_vol_no =
 2447|  3.12k|					    rar->main.vol_no + 1;
 2448|  3.12k|					return ARCHIVE_OK;
  ------------------
  |  |  233|  3.12k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2449|  3.12k|				}
 2450|  3.12k|			} else {
 2451|     36|				return ARCHIVE_EOF;
  ------------------
  |  |  232|     36|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2452|     36|			}
 2453|     52|		case HEAD_MARK:
  ------------------
  |  Branch (2453:3): [True: 52, False: 7.23k]
  ------------------
 2454|     52|			return ARCHIVE_EOF;
  ------------------
  |  |  232|     52|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2455|    144|		default:
  ------------------
  |  Branch (2455:3): [True: 144, False: 7.14k]
  ------------------
 2456|    144|			if((header_flags & HFL_SKIP_IF_UNKNOWN) == 0) {
  ------------------
  |  Branch (2456:7): [True: 79, False: 65]
  ------------------
 2457|     79|				archive_set_error(&a->archive,
 2458|     79|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     79|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2459|     79|				    "Header type error");
 2460|     79|				return ARCHIVE_FATAL;
  ------------------
  |  |  239|     79|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2461|     79|			} else {
 2462|       |				/* If the block is marked as 'skip if unknown',
 2463|       |				 * do as the flag says: skip the block
 2464|       |				 * instead on failing on it. */
 2465|     65|				rar5_skip_remaining_block(a, body_start,
 2466|     65|				    raw_hdr_size);
 2467|     65|				return ARCHIVE_RETRY;
  ------------------
  |  |  234|     65|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2468|     65|			}
 2469|  7.28k|	}
 2470|       |
 2471|      0|#if !defined WIN32
 2472|       |	// Not reached.
 2473|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 2474|      0|	    "Internal unpacker error");
 2475|      0|	return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2476|  7.28k|#endif
 2477|  7.28k|}
archive_read_support_format_rar5.c:skip_unprocessed_bytes:
 2191|  7.39k|static int skip_unprocessed_bytes(struct archive_read* a) {
 2192|  7.39k|	struct rar5* rar = get_context(a);
 2193|  7.39k|	int ret;
 2194|       |
 2195|  7.39k|	if(rar->file.bytes_remaining) {
  ------------------
  |  Branch (2195:5): [True: 2.95k, False: 4.43k]
  ------------------
 2196|       |		/* Use different skipping method in block merging mode than in
 2197|       |		 * normal mode. If merge mode is active, rar5_read_data_skip
 2198|       |		 * can't be used, because it could allow recursive use of
 2199|       |		 * merge_block() * function, and this function doesn't support
 2200|       |		 * recursive use. */
 2201|  2.95k|		if(rar->merge_mode) {
  ------------------
  |  Branch (2201:6): [True: 2.87k, False: 80]
  ------------------
 2202|       |			/* Discard whole merged block. This is valid in solid
 2203|       |			 * mode as well, because the code will discard blocks
 2204|       |			 * only if those blocks are safe to discard (i.e.
 2205|       |			 * they're not FILE blocks).  */
 2206|  2.87k|			ret = consume(a, rar->file.bytes_remaining);
 2207|  2.87k|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  2.87k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2207:7): [True: 0, False: 2.87k]
  ------------------
 2208|      0|				return ret;
 2209|      0|			}
 2210|  2.87k|			rar->file.bytes_remaining = 0;
 2211|  2.87k|		} else {
 2212|       |			/* If we're not in merge mode, use safe skipping code.
 2213|       |			 * This will ensure we'll handle solid archives
 2214|       |			 * properly. */
 2215|     80|			ret = rar5_read_data_skip(a);
 2216|     80|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|     80|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2216:7): [True: 20, False: 60]
  ------------------
 2217|     20|				return ret;
 2218|     20|			}
 2219|     80|		}
 2220|  2.95k|	}
 2221|       |
 2222|  7.37k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  7.37k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2223|  7.39k|}
archive_read_support_format_rar5.c:read_u32:
 1108|  11.4k|static char read_u32(struct archive_read* a, uint32_t* pvalue) {
 1109|  11.4k|	const uint8_t* p;
 1110|  11.4k|	if(!read_ahead(a, 4, &p))
  ------------------
  |  Branch (1110:5): [True: 1, False: 11.4k]
  ------------------
 1111|      1|		return 0;
 1112|       |
 1113|  11.4k|	*pvalue = archive_le32dec(p);
 1114|  11.4k|	return ARCHIVE_OK == consume(a, 4);
  ------------------
  |  |  233|  11.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1115|  11.4k|}
archive_read_support_format_rar5.c:read_var_sized:
 1022|  60.6k|{
 1023|  60.6k|	uint64_t v;
 1024|  60.6k|	uint64_t v_size = 0;
 1025|       |
 1026|  60.6k|	const int ret = pvalue_len ? read_var(a, &v, &v_size)
  ------------------
  |  Branch (1026:18): [True: 21.3k, False: 39.3k]
  ------------------
 1027|  60.6k|				   : read_var(a, &v, NULL);
 1028|       |
 1029|  60.6k|	if(ret == 1 && pvalue) {
  ------------------
  |  Branch (1029:5): [True: 60.6k, False: 3]
  |  Branch (1029:17): [True: 60.6k, False: 0]
  ------------------
 1030|  60.6k|		*pvalue = (size_t) v;
 1031|  60.6k|	}
 1032|       |
 1033|  60.6k|	if(pvalue_len) {
  ------------------
  |  Branch (1033:5): [True: 21.3k, False: 39.3k]
  ------------------
 1034|       |		/* Possible data truncation should be safe. */
 1035|  21.3k|		*pvalue_len = (size_t) v_size;
 1036|  21.3k|	}
 1037|       |
 1038|  60.6k|	return ret;
 1039|  60.6k|}
archive_read_support_format_rar5.c:read_var:
  951|  90.1k|{
  952|  90.1k|	uint64_t result = 0;
  953|  90.1k|	size_t shift, i;
  954|  90.1k|	const uint8_t* p;
  955|  90.1k|	uint8_t b;
  956|       |
  957|       |	/* We will read maximum of 8 bytes. We don't have to handle the
  958|       |	 * situation to read the RAR5 variable-sized value stored at the end of
  959|       |	 * the file, because such situation will never happen. */
  960|  90.1k|	if(!read_ahead(a, 8, &p))
  ------------------
  |  Branch (960:5): [True: 10, False: 90.1k]
  ------------------
  961|     10|		return 0;
  962|       |
  963|   162k|	for(shift = 0, i = 0; i < 8; i++, shift += 7) {
  ------------------
  |  Branch (963:24): [True: 157k, False: 5.21k]
  ------------------
  964|   157k|		b = p[i];
  965|       |
  966|       |		/* Strip the MSB from the input byte and add the resulting
  967|       |		 * number to the `result`. */
  968|   157k|		result += (b & (uint64_t)0x7F) << shift;
  969|       |
  970|       |		/* MSB set to 1 means we need to continue decoding process.
  971|       |		 * MSB set to 0 means we're done.
  972|       |		 *
  973|       |		 * This conditional checks for the second case. */
  974|   157k|		if((b & 0x80) == 0) {
  ------------------
  |  Branch (974:6): [True: 84.9k, False: 72.3k]
  ------------------
  975|  84.9k|			if(pvalue) {
  ------------------
  |  Branch (975:7): [True: 84.9k, False: 0]
  ------------------
  976|  84.9k|				*pvalue = result;
  977|  84.9k|			}
  978|       |
  979|       |			/* If the caller has passed the `pvalue_len` pointer,
  980|       |			 * store the number of consumed bytes in it and do NOT
  981|       |			 * consume those bytes, since the caller has all the
  982|       |			 * information it needs to perform */
  983|  84.9k|			if(pvalue_len) {
  ------------------
  |  Branch (983:7): [True: 41.1k, False: 43.8k]
  ------------------
  984|  41.1k|				*pvalue_len = 1 + i;
  985|  43.8k|			} else {
  986|       |				/* If the caller did not provide the
  987|       |				 * `pvalue_len` pointer, it will not have the
  988|       |				 * possibility to advance the file pointer,
  989|       |				 * because it will not know how many bytes it
  990|       |				 * needs to consume. This is why we handle
  991|       |				 * such situation here automatically. */
  992|  43.8k|				if(ARCHIVE_OK != consume(a, 1 + i)) {
  ------------------
  |  |  233|  43.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (992:8): [True: 0, False: 43.8k]
  ------------------
  993|      0|					return 0;
  994|      0|				}
  995|  43.8k|			}
  996|       |
  997|       |			/* End of decoding process, return success. */
  998|  84.9k|			return 1;
  999|  84.9k|		}
 1000|   157k|	}
 1001|       |
 1002|       |	/* The decoded value takes the maximum number of 8 bytes.
 1003|       |	 * It's a maximum number of bytes, so end decoding process here
 1004|       |	 * even if the first bit of last byte is 1. */
 1005|  5.21k|	if(pvalue) {
  ------------------
  |  Branch (1005:5): [True: 5.21k, False: 0]
  ------------------
 1006|  5.21k|		*pvalue = result;
 1007|  5.21k|	}
 1008|       |
 1009|  5.21k|	if(pvalue_len) {
  ------------------
  |  Branch (1009:5): [True: 5.18k, False: 33]
  ------------------
 1010|  5.18k|		*pvalue_len = 9;
 1011|  5.18k|	} else {
 1012|     33|		if(ARCHIVE_OK != consume(a, 9)) {
  ------------------
  |  |  233|     33|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1012:6): [True: 0, False: 33]
  ------------------
 1013|      0|			return 0;
 1014|      0|		}
 1015|     33|	}
 1016|       |
 1017|  5.21k|	return 1;
 1018|  5.21k|}
archive_read_support_format_rar5.c:process_head_main:
 2085|    304|{
 2086|    304|	int ret;
 2087|    304|	uint64_t extra_data_size = 0;
 2088|    304|	size_t extra_field_size = 0;
 2089|    304|	size_t extra_field_id = 0;
 2090|    304|	size_t archive_flags = 0;
 2091|       |
 2092|    304|	enum MAIN_FLAGS {
 2093|    304|		VOLUME = 0x0001,         /* multi-volume archive */
 2094|    304|		VOLUME_NUMBER = 0x0002,  /* volume number, first vol doesn't
 2095|       |					  * have it */
 2096|    304|		SOLID = 0x0004,          /* solid archive */
 2097|    304|		PROTECT = 0x0008,        /* contains Recovery info */
 2098|    304|		LOCK = 0x0010,           /* readonly flag, not used */
 2099|    304|	};
 2100|       |
 2101|    304|	enum MAIN_EXTRA {
 2102|       |		// Just one attribute here.
 2103|    304|		LOCATOR = 0x01,
 2104|    304|	};
 2105|       |
 2106|    304|	(void) entry;
 2107|       |
 2108|    304|	if(block_flags & HFL_EXTRA_DATA) {
  ------------------
  |  Branch (2108:5): [True: 129, False: 175]
  ------------------
 2109|    129|		if(!read_var(a, &extra_data_size, NULL))
  ------------------
  |  Branch (2109:6): [True: 0, False: 129]
  ------------------
 2110|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2111|    175|	} else {
 2112|    175|		extra_data_size = 0;
 2113|    175|	}
 2114|       |
 2115|    304|	if(!read_var_sized(a, &archive_flags, NULL)) {
  ------------------
  |  Branch (2115:5): [True: 0, False: 304]
  ------------------
 2116|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2117|      0|	}
 2118|       |
 2119|    304|	rar->main.volume = (archive_flags & VOLUME) > 0;
 2120|    304|	rar->main.solid = (archive_flags & SOLID) > 0;
 2121|       |
 2122|    304|	if(archive_flags & VOLUME_NUMBER) {
  ------------------
  |  Branch (2122:5): [True: 143, False: 161]
  ------------------
 2123|    143|		size_t v = 0;
 2124|    143|		if(!read_var_sized(a, &v, NULL)) {
  ------------------
  |  Branch (2124:6): [True: 0, False: 143]
  ------------------
 2125|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2126|      0|		}
 2127|       |
 2128|    143|		if (v > UINT_MAX) {
  ------------------
  |  Branch (2128:7): [True: 0, False: 143]
  ------------------
 2129|      0|			archive_set_error(&a->archive,
 2130|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2131|      0|			    "Invalid volume number");
 2132|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2133|      0|		}
 2134|       |
 2135|    143|		rar->main.vol_no = (unsigned int) v;
 2136|    161|	} else {
 2137|    161|		rar->main.vol_no = 0;
 2138|    161|	}
 2139|       |
 2140|    304|	if(rar->vol.expected_vol_no > 0 &&
  ------------------
  |  Branch (2140:5): [True: 48, False: 256]
  ------------------
 2141|     48|		rar->main.vol_no != rar->vol.expected_vol_no)
  ------------------
  |  Branch (2141:3): [True: 48, False: 0]
  ------------------
 2142|     48|	{
 2143|       |		/* Returning EOF instead of FATAL because of strange
 2144|       |		 * libarchive behavior. When opening multiple files via
 2145|       |		 * archive_read_open_filenames(), after reading up the whole
 2146|       |		 * last file, the __archive_read_ahead function wraps up to
 2147|       |		 * the first archive instead of returning EOF. */
 2148|     48|		return ARCHIVE_EOF;
  ------------------
  |  |  232|     48|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2149|     48|	}
 2150|       |
 2151|    256|	if(extra_data_size == 0) {
  ------------------
  |  Branch (2151:5): [True: 127, False: 129]
  ------------------
 2152|       |		/* Early return. */
 2153|    127|		return ARCHIVE_OK;
  ------------------
  |  |  233|    127|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2154|    127|	}
 2155|       |
 2156|    129|	if(!read_var_sized(a, &extra_field_size, NULL)) {
  ------------------
  |  Branch (2156:5): [True: 0, False: 129]
  ------------------
 2157|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2158|      0|	}
 2159|       |
 2160|    129|	if(!read_var_sized(a, &extra_field_id, NULL)) {
  ------------------
  |  Branch (2160:5): [True: 0, False: 129]
  ------------------
 2161|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2162|      0|	}
 2163|       |
 2164|    129|	if(extra_field_size == 0) {
  ------------------
  |  Branch (2164:5): [True: 0, False: 129]
  ------------------
 2165|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2166|      0|		    "Invalid extra field size");
 2167|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2168|      0|	}
 2169|       |
 2170|    129|	switch(extra_field_id) {
 2171|    129|		case LOCATOR:
  ------------------
  |  Branch (2171:3): [True: 129, False: 0]
  ------------------
 2172|    129|			ret = process_main_locator_extra_block(a, rar);
 2173|    129|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|    129|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2173:7): [True: 0, False: 129]
  ------------------
 2174|       |				/* Error while parsing main locator extra
 2175|       |				 * block. */
 2176|      0|				return ret;
 2177|      0|			}
 2178|       |
 2179|    129|			break;
 2180|    129|		default:
  ------------------
  |  Branch (2180:3): [True: 0, False: 129]
  ------------------
 2181|      0|			archive_set_error(&a->archive,
 2182|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2183|      0|			    "Unsupported extra type (0x%jx)",
 2184|      0|			    (uintmax_t)extra_field_id);
 2185|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2186|    129|	}
 2187|       |
 2188|    129|	return ARCHIVE_OK;
  ------------------
  |  |  233|    129|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2189|    129|}
archive_read_support_format_rar5.c:process_main_locator_extra_block:
 1234|    129|{
 1235|    129|	uint64_t locator_flags;
 1236|       |
 1237|    129|	enum LOCATOR_FLAGS {
 1238|    129|		QLIST = 0x01, RECOVERY = 0x02,
 1239|    129|	};
 1240|       |
 1241|    129|	if(!read_var(a, &locator_flags, NULL)) {
  ------------------
  |  Branch (1241:5): [True: 0, False: 129]
  ------------------
 1242|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1243|      0|	}
 1244|       |
 1245|    129|	if(locator_flags & QLIST) {
  ------------------
  |  Branch (1245:5): [True: 29, False: 100]
  ------------------
 1246|     29|		if(!read_var(a, &rar->qlist_offset, NULL)) {
  ------------------
  |  Branch (1246:6): [True: 0, False: 29]
  ------------------
 1247|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1248|      0|		}
 1249|       |
 1250|       |		/* qlist is not used */
 1251|     29|	}
 1252|       |
 1253|    129|	if(locator_flags & RECOVERY) {
  ------------------
  |  Branch (1253:5): [True: 3, False: 126]
  ------------------
 1254|      3|		if(!read_var(a, &rar->rr_offset, NULL)) {
  ------------------
  |  Branch (1254:6): [True: 0, False: 3]
  ------------------
 1255|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1256|      0|		}
 1257|       |
 1258|       |		/* rr is not used */
 1259|      3|	}
 1260|       |
 1261|    129|	return ARCHIVE_OK;
  ------------------
  |  |  233|    129|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1262|    129|}
archive_read_support_format_rar5.c:rar5_skip_remaining_block:
 2288|    321|{
 2289|    321|	const uint8_t* cur;
 2290|       |
 2291|    321|	if(read_ahead(a, 1, &cur)) {
  ------------------
  |  Branch (2291:5): [True: 321, False: 0]
  ------------------
 2292|    321|		size_t body_used = (size_t)(cur - body_start);
 2293|       |
 2294|    321|		if(body_used < raw_hdr_size)
  ------------------
  |  Branch (2294:6): [True: 161, False: 160]
  ------------------
 2295|    161|			(void)consume(a, raw_hdr_size - body_used);
 2296|    321|	}
 2297|    321|}
archive_read_support_format_rar5.c:process_head_service:
 2064|    156|{
 2065|       |	/* Process this SERVICE block the same way as FILE blocks. */
 2066|    156|	int ret = process_head_file(a, rar, entry, block_flags);
 2067|    156|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|    156|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2067:5): [True: 21, False: 135]
  ------------------
 2068|     21|		return ret;
 2069|       |
 2070|    135|	rar->file.service = 1;
 2071|       |
 2072|       |	/* But skip the data part automatically. It's no use for the user
 2073|       |	 * anyway.  It contains only service data, not even needed to
 2074|       |	 * properly unpack the file. */
 2075|    135|	ret = rar5_read_data_skip(a);
 2076|    135|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|    135|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2076:5): [True: 0, False: 135]
  ------------------
 2077|      0|		return ret;
 2078|       |
 2079|       |	/* After skipping, try parsing another block automatically. */
 2080|    135|	return ARCHIVE_RETRY;
  ------------------
  |  |  234|    135|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2081|    135|}
archive_read_support_format_rar5.c:process_head_file:
 1736|  3.60k|{
 1737|  3.60k|	int64_t extra_data_size = 0;
 1738|  3.60k|	size_t data_size = 0;
 1739|  3.60k|	size_t file_flags = 0;
 1740|  3.60k|	size_t file_attr = 0;
 1741|  3.60k|	size_t compression_info = 0;
 1742|  3.60k|	size_t host_os = 0;
 1743|  3.60k|	size_t name_size = 0;
 1744|  3.60k|	uint64_t unpacked_size, window_size;
 1745|  3.60k|	uint32_t mtime = 0, crc = 0;
 1746|  3.60k|	int c_method = 0, c_version = 0;
 1747|  3.60k|	char name_utf8_buf[MAX_NAME_IN_BYTES];
 1748|  3.60k|	const uint8_t* p;
 1749|  3.60k|	int sanity_ret;
 1750|       |
 1751|  3.60k|	enum FILE_FLAGS {
 1752|  3.60k|		DIRECTORY = 0x0001, UTIME = 0x0002, CRC32 = 0x0004,
 1753|  3.60k|		UNKNOWN_UNPACKED_SIZE = 0x0008,
 1754|  3.60k|	};
 1755|       |
 1756|  3.60k|	enum FILE_ATTRS {
 1757|  3.60k|		ATTR_READONLY = 0x1, ATTR_HIDDEN = 0x2, ATTR_SYSTEM = 0x4,
 1758|  3.60k|		ATTR_DIRECTORY = 0x10,
 1759|  3.60k|	};
 1760|       |
 1761|  3.60k|	enum COMP_INFO_FLAGS {
 1762|  3.60k|		SOLID = 0x0040,
 1763|  3.60k|	};
 1764|       |
 1765|  3.60k|	enum HOST_OS {
 1766|  3.60k|		HOST_WINDOWS = 0,
 1767|  3.60k|		HOST_UNIX = 1,
 1768|  3.60k|	};
 1769|       |
 1770|  3.60k|	archive_entry_clear(entry);
 1771|       |
 1772|       |	/* Do not reset file context if we're switching archives. */
 1773|  3.60k|	if(!rar->cstate.switch_multivolume) {
  ------------------
  |  Branch (1773:5): [True: 523, False: 3.07k]
  ------------------
 1774|    523|		reset_file_context(rar);
 1775|    523|	}
 1776|       |
 1777|  3.60k|	if(block_flags & HFL_EXTRA_DATA) {
  ------------------
  |  Branch (1777:5): [True: 642, False: 2.95k]
  ------------------
 1778|    642|		uint64_t edata_size = 0;
 1779|    642|		if(!read_var(a, &edata_size, NULL))
  ------------------
  |  Branch (1779:6): [True: 0, False: 642]
  ------------------
 1780|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1781|       |
 1782|       |		/* Intentional type cast from unsigned to signed. */
 1783|    642|		extra_data_size = (int64_t) edata_size;
 1784|    642|	}
 1785|       |
 1786|  3.60k|	if(block_flags & HFL_DATA) {
  ------------------
  |  Branch (1786:5): [True: 3.59k, False: 1]
  ------------------
 1787|  3.59k|		if(!read_var_sized(a, &data_size, NULL))
  ------------------
  |  Branch (1787:6): [True: 0, False: 3.59k]
  ------------------
 1788|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1789|       |
 1790|  3.59k|		if(data_size > SSIZE_MAX) {
  ------------------
  |  Branch (1790:6): [True: 0, False: 3.59k]
  ------------------
 1791|      0|			archive_set_error(&a->archive,
 1792|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1793|      0|			    "File data size is too large");
 1794|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1795|      0|		}
 1796|       |
 1797|  3.59k|		rar->file.bytes_remaining = data_size;
 1798|  3.59k|	} else {
 1799|      1|		rar->file.bytes_remaining = 0;
 1800|      1|	}
 1801|       |
 1802|  3.60k|	if(!read_var_sized(a, &file_flags, NULL))
  ------------------
  |  Branch (1802:5): [True: 0, False: 3.60k]
  ------------------
 1803|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1804|       |
 1805|  3.60k|	if(!read_var(a, &unpacked_size, NULL))
  ------------------
  |  Branch (1805:5): [True: 0, False: 3.60k]
  ------------------
 1806|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1807|       |
 1808|  3.60k|	if(file_flags & UNKNOWN_UNPACKED_SIZE) {
  ------------------
  |  Branch (1808:5): [True: 1, False: 3.59k]
  ------------------
 1809|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      1|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1810|      1|		    "Files with unknown unpacked size are not supported");
 1811|      1|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1812|      1|	}
 1813|       |
 1814|  3.59k|	rar->file.dir = (uint8_t) ((file_flags & DIRECTORY) > 0);
 1815|       |
 1816|  3.59k|	sanity_ret = file_entry_sanity_checks(a, block_flags, rar->file.dir,
 1817|  3.59k|		unpacked_size, data_size);
 1818|       |
 1819|  3.59k|	if (sanity_ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  3.59k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1819:6): [True: 2, False: 3.59k]
  ------------------
 1820|      2|		return sanity_ret;
 1821|      2|	}
 1822|       |
 1823|  3.59k|	if(!read_var_sized(a, &file_attr, NULL))
  ------------------
  |  Branch (1823:5): [True: 0, False: 3.59k]
  ------------------
 1824|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1825|       |
 1826|  3.59k|	if(file_flags & UTIME) {
  ------------------
  |  Branch (1826:5): [True: 2.93k, False: 660]
  ------------------
 1827|  2.93k|		if(!read_u32(a, &mtime))
  ------------------
  |  Branch (1827:6): [True: 0, False: 2.93k]
  ------------------
 1828|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1829|  2.93k|	}
 1830|       |
 1831|  3.59k|	if(file_flags & CRC32) {
  ------------------
  |  Branch (1831:5): [True: 135, False: 3.46k]
  ------------------
 1832|    135|		if(!read_u32(a, &crc))
  ------------------
  |  Branch (1832:6): [True: 0, False: 135]
  ------------------
 1833|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1834|    135|	}
 1835|       |
 1836|  3.59k|	if(!read_var_sized(a, &compression_info, NULL))
  ------------------
  |  Branch (1836:5): [True: 0, False: 3.59k]
  ------------------
 1837|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1838|       |
 1839|  3.59k|	c_method = (int) (compression_info >> 7) & 0x7;
 1840|  3.59k|	c_version = (int) (compression_info & 0x3f);
 1841|       |
 1842|       |	/* RAR5 seems to limit the dictionary size to 64MB. */
 1843|  3.59k|	window_size = (rar->file.dir > 0) ?
  ------------------
  |  Branch (1843:16): [True: 1, False: 3.59k]
  ------------------
 1844|      1|		0 :
 1845|  3.59k|		g_unpack_window_size << ((compression_info >> 10) & 15);
 1846|  3.59k|	rar->cstate.method = c_method;
 1847|  3.59k|	rar->cstate.version = c_version + 50;
 1848|  3.59k|	rar->file.solid = (compression_info & SOLID) > 0;
 1849|       |
 1850|       |	/* Archives which declare solid files without initializing the window
 1851|       |	 * buffer first are invalid, unless previous data was encrypted, in
 1852|       |	 * which case we may never have had the chance */
 1853|       |
 1854|  3.59k|	if(rar->file.solid > 0 && rar->cstate.data_encrypted == 0 &&
  ------------------
  |  Branch (1854:5): [True: 67, False: 3.53k]
  |  Branch (1854:28): [True: 1, False: 66]
  ------------------
 1855|      1|	    rar->cstate.window_buf == NULL) {
  ------------------
  |  Branch (1855:6): [True: 1, False: 0]
  ------------------
 1856|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1857|      1|				  "Declared solid file, but no window buffer "
 1858|      1|				  "initialized yet");
 1859|      1|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1860|      1|	}
 1861|       |
 1862|       |	/* Check if window_size is a sane value. Also, if the file is not
 1863|       |	 * declared as a directory, disallow window_size == 0. */
 1864|  3.59k|	if(window_size > (64 * 1024 * 1024) ||
  ------------------
  |  Branch (1864:5): [True: 0, False: 3.59k]
  ------------------
 1865|  3.59k|	    (rar->file.dir == 0 && window_size == 0))
  ------------------
  |  Branch (1865:7): [True: 3.59k, False: 1]
  |  Branch (1865:29): [True: 0, False: 3.59k]
  ------------------
 1866|      0|	{
 1867|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1868|      0|		    "Declared dictionary size is not supported");
 1869|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1870|      0|	}
 1871|       |
 1872|  3.59k|	if(rar->file.solid > 0) {
  ------------------
  |  Branch (1872:5): [True: 66, False: 3.53k]
  ------------------
 1873|       |		/* Re-check if current window size is the same as previous
 1874|       |		 * window size (for solid files only). */
 1875|     66|		if(rar->file.solid_window_size > 0 &&
  ------------------
  |  Branch (1875:6): [True: 0, False: 66]
  ------------------
 1876|      0|		    rar->file.solid_window_size != (ssize_t) window_size)
  ------------------
  |  Branch (1876:7): [True: 0, False: 0]
  ------------------
 1877|      0|		{
 1878|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1879|      0|			    "Window size for this solid file doesn't match "
 1880|      0|			    "the window size used in previous solid file");
 1881|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1882|      0|		}
 1883|     66|	}
 1884|  3.53k|	else
 1885|  3.53k|		rar->cstate.data_encrypted = 0; /* Reset for new buffer */
 1886|       |
 1887|  3.59k|	if(rar->cstate.window_size < (ssize_t) window_size &&
  ------------------
  |  Branch (1887:5): [True: 239, False: 3.35k]
  ------------------
 1888|    239|	    rar->cstate.window_buf)
  ------------------
  |  Branch (1888:6): [True: 0, False: 239]
  ------------------
 1889|      0|	{
 1890|       |		/* The `data_ready` stack contains pointers to the `window_buf` or
 1891|       |		 * `filtered_buf` buffers.  Since we're about to reallocate the first
 1892|       |		 * buffer, some of those pointers could become invalid. Therefore, we
 1893|       |		 * need to dispose of all entries from the stack before attempting the
 1894|       |		 * realloc. */
 1895|      0|		clear_data_ready_stack(rar);
 1896|       |
 1897|       |		/* If window_buf has been allocated before, reallocate it, so
 1898|       |		 * that its size will match new window_size. */
 1899|       |
 1900|      0|		uint8_t* new_window_buf =
 1901|      0|			realloc(rar->cstate.window_buf, (size_t) window_size);
 1902|       |
 1903|      0|		if(!new_window_buf) {
  ------------------
  |  Branch (1903:6): [True: 0, False: 0]
  ------------------
 1904|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1905|      0|				"Not enough memory when trying to realloc the window "
 1906|      0|				"buffer");
 1907|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1908|      0|		}
 1909|       |
 1910|      0|		rar->cstate.window_buf = new_window_buf;
 1911|      0|	}
 1912|       |
 1913|       |	/* Values up to 64M should fit into ssize_t on every
 1914|       |	 * architecture. */
 1915|  3.59k|	rar->cstate.window_size = (ssize_t) window_size;
 1916|       |
 1917|  3.59k|	if(rar->file.solid > 0 && rar->file.solid_window_size == 0) {
  ------------------
  |  Branch (1917:5): [True: 66, False: 3.53k]
  |  Branch (1917:28): [True: 66, False: 0]
  ------------------
 1918|       |		/* Solid files have to have the same window_size across
 1919|       |		   whole archive. Remember the window_size parameter
 1920|       |		   for first solid file found. */
 1921|     66|		rar->file.solid_window_size = rar->cstate.window_size;
 1922|     66|	}
 1923|       |
 1924|  3.59k|	init_window_mask(rar);
 1925|       |
 1926|  3.59k|	rar->file.service = 0;
 1927|       |
 1928|  3.59k|	if(!read_var_sized(a, &host_os, NULL))
  ------------------
  |  Branch (1928:5): [True: 0, False: 3.59k]
  ------------------
 1929|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1930|       |
 1931|  3.59k|	if(host_os == HOST_WINDOWS) {
  ------------------
  |  Branch (1931:5): [True: 3.43k, False: 162]
  ------------------
 1932|       |		/* Host OS is Windows */
 1933|       |
 1934|  3.43k|		__LA_MODE_T mode;
  ------------------
  |  |  102|  3.43k|# define	__LA_MODE_T	mode_t
  ------------------
 1935|       |
 1936|  3.43k|		if(file_attr & ATTR_DIRECTORY) {
  ------------------
  |  Branch (1936:6): [True: 2.95k, False: 483]
  ------------------
 1937|  2.95k|			if (file_attr & ATTR_READONLY) {
  ------------------
  |  Branch (1937:8): [True: 2.95k, False: 1]
  ------------------
 1938|  2.95k|				mode = 0555 | AE_IFDIR;
  ------------------
  |  |  221|  2.95k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1939|  2.95k|			} else {
 1940|      1|				mode = 0755 | AE_IFDIR;
  ------------------
  |  |  221|      1|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1941|      1|			}
 1942|  2.95k|		} else {
 1943|    483|			if (file_attr & ATTR_READONLY) {
  ------------------
  |  Branch (1943:8): [True: 306, False: 177]
  ------------------
 1944|    306|				mode = 0444 | AE_IFREG;
  ------------------
  |  |  216|    306|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1945|    306|			} else {
 1946|    177|				mode = 0644 | AE_IFREG;
  ------------------
  |  |  216|    177|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1947|    177|			}
 1948|    483|		}
 1949|       |
 1950|  3.43k|		archive_entry_set_mode(entry, mode);
 1951|       |
 1952|  3.43k|		if (file_attr & (ATTR_READONLY | ATTR_HIDDEN | ATTR_SYSTEM)) {
  ------------------
  |  Branch (1952:7): [True: 3.27k, False: 158]
  ------------------
 1953|  3.27k|			char buf[sizeof(",rdonly,hidden,system")];
 1954|  3.27k|			char *fflags[3] = { "", "", "" };
 1955|  3.27k|			char **flag = fflags;
 1956|       |
 1957|  3.27k|			if (file_attr & ATTR_READONLY)
  ------------------
  |  Branch (1957:8): [True: 3.25k, False: 20]
  ------------------
 1958|  3.25k|				*flag++ = ",rdonly";
 1959|  3.27k|			if (file_attr & ATTR_HIDDEN)
  ------------------
  |  Branch (1959:8): [True: 2.97k, False: 304]
  ------------------
 1960|  2.97k|				*flag++ = ",hidden";
 1961|  3.27k|			if (file_attr & ATTR_SYSTEM)
  ------------------
  |  Branch (1961:8): [True: 3.02k, False: 253]
  ------------------
 1962|  3.02k|				*flag++ = ",system";
 1963|       |
 1964|  3.27k|			snprintf(buf, sizeof(buf), "%s%s%s",
 1965|  3.27k|			    fflags[0], fflags[1], fflags[2]);
 1966|  3.27k|			archive_entry_copy_fflags_text(entry, buf + 1);
 1967|  3.27k|		}
 1968|  3.43k|	} else if(host_os == HOST_UNIX) {
  ------------------
  |  Branch (1968:12): [True: 162, False: 0]
  ------------------
 1969|       |		/* Host OS is Unix */
 1970|    162|		archive_entry_set_mode(entry, (__LA_MODE_T) file_attr);
 1971|    162|	} else {
 1972|       |		/* Unknown host OS */
 1973|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1974|      0|				"Unsupported Host OS: 0x%jx",
 1975|      0|				(uintmax_t)host_os);
 1976|       |
 1977|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1978|      0|	}
 1979|       |
 1980|  3.59k|	if(!read_var_sized(a, &name_size, NULL))
  ------------------
  |  Branch (1980:5): [True: 0, False: 3.59k]
  ------------------
 1981|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1982|       |
 1983|  3.59k|	if(name_size > (MAX_NAME_IN_CHARS - 1)) {
  ------------------
  |  |   91|  3.59k|#define MAX_NAME_IN_CHARS 2048
  ------------------
  |  Branch (1983:5): [True: 0, False: 3.59k]
  ------------------
 1984|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1985|      0|				"Filename is too long");
 1986|       |
 1987|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1988|      0|	}
 1989|       |
 1990|  3.59k|	if(name_size == 0) {
  ------------------
  |  Branch (1990:5): [True: 0, False: 3.59k]
  ------------------
 1991|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1992|      0|				"No filename specified");
 1993|       |
 1994|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1995|      0|	}
 1996|       |
 1997|  3.59k|	if(!read_ahead(a, name_size, &p))
  ------------------
  |  Branch (1997:5): [True: 1, False: 3.59k]
  ------------------
 1998|      1|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1999|       |
 2000|  3.59k|	memcpy(name_utf8_buf, p, name_size);
 2001|  3.59k|	name_utf8_buf[name_size] = 0;
 2002|  3.59k|	if(ARCHIVE_OK != consume(a, name_size)) {
  ------------------
  |  |  233|  3.59k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2002:5): [True: 0, False: 3.59k]
  ------------------
 2003|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2004|      0|	}
 2005|       |
 2006|  3.59k|	archive_entry_update_pathname_utf8(entry, name_utf8_buf);
 2007|       |
 2008|  3.59k|	if(extra_data_size > 0) {
  ------------------
  |  Branch (2008:5): [True: 314, False: 3.28k]
  ------------------
 2009|    314|		int ret = process_head_file_extra(a, entry, rar,
 2010|    314|		    extra_data_size);
 2011|       |
 2012|       |		/*
 2013|       |		 * TODO: rewrite or remove useless sanity check
 2014|       |		 *       as extra_data_size is not passed as a pointer
 2015|       |		 *
 2016|       |		if(extra_data_size < 0) {
 2017|       |			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
 2018|       |			    "File extra data size is not zero");
 2019|       |			return ARCHIVE_FATAL;
 2020|       |		}
 2021|       |		 */
 2022|       |
 2023|    314|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|    314|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2023:6): [True: 24, False: 290]
  ------------------
 2024|     24|			return ret;
 2025|    314|	}
 2026|       |
 2027|  3.57k|	if((file_flags & UNKNOWN_UNPACKED_SIZE) == 0) {
  ------------------
  |  Branch (2027:5): [True: 3.57k, False: 0]
  ------------------
 2028|  3.57k|		rar->file.unpacked_size = (ssize_t) unpacked_size;
 2029|  3.57k|		if(rar->file.redir_type == REDIR_TYPE_NONE)
  ------------------
  |  Branch (2029:6): [True: 3.44k, False: 131]
  ------------------
 2030|  3.44k|			archive_entry_set_size(entry, unpacked_size);
 2031|  3.57k|	}
 2032|       |
 2033|  3.57k|	if(file_flags & UTIME) {
  ------------------
  |  Branch (2033:5): [True: 2.93k, False: 636]
  ------------------
 2034|  2.93k|		archive_entry_set_mtime(entry, (time_t) mtime, 0);
 2035|  2.93k|	}
 2036|       |
 2037|  3.57k|	if(file_flags & CRC32) {
  ------------------
  |  Branch (2037:5): [True: 133, False: 3.43k]
  ------------------
 2038|    133|		rar->file.stored_crc32 = crc;
 2039|    133|	}
 2040|       |
 2041|  3.57k|	if(!rar->cstate.switch_multivolume) {
  ------------------
  |  Branch (2041:5): [True: 497, False: 3.07k]
  ------------------
 2042|       |		/* Do not reinitialize unpacking state if we're switching
 2043|       |		 * archives. */
 2044|    497|		rar->cstate.block_parsing_finished = 1;
 2045|    497|		rar->cstate.all_filters_applied = 1;
 2046|    497|		rar->cstate.initialized = 0;
 2047|    497|	}
 2048|       |
 2049|  3.57k|	if(rar->generic.split_before > 0) {
  ------------------
  |  Branch (2049:5): [True: 4, False: 3.56k]
  ------------------
 2050|       |		/* If now we're standing on a header that has a 'split before'
 2051|       |		 * mark, it means we're standing on a 'continuation' file
 2052|       |		 * header. Signal the caller that if it wants to move to
 2053|       |		 * another file, it must call rar5_read_header() function
 2054|       |		 * again. */
 2055|       |
 2056|      4|		return ARCHIVE_RETRY;
  ------------------
  |  |  234|      4|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2057|  3.56k|	} else {
 2058|  3.56k|		return ARCHIVE_OK;
  ------------------
  |  |  233|  3.56k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2059|  3.56k|	}
 2060|  3.57k|}
archive_read_support_format_rar5.c:reset_file_context:
  877|    523|static void reset_file_context(struct rar5* rar) {
  878|    523|	memset(&rar->file, 0, sizeof(rar->file));
  879|    523|	blake2sp_init(&rar->file.b2state, 32);
  880|       |
  881|    523|	if(rar->main.solid) {
  ------------------
  |  Branch (881:5): [True: 361, False: 162]
  ------------------
  882|    361|		rar->cstate.solid_offset += rar->cstate.write_ptr;
  883|    361|	} else {
  884|    162|		rar->cstate.solid_offset = 0;
  885|    162|	}
  886|       |
  887|    523|	rar->cstate.write_ptr = 0;
  888|    523|	rar->cstate.last_write_ptr = 0;
  889|    523|	rar->cstate.last_unstore_ptr = 0;
  890|       |
  891|    523|	rar->file.redir_type = REDIR_TYPE_NONE;
  892|    523|	rar->file.redir_flags = 0;
  893|       |
  894|    523|	free_filters(rar);
  895|    523|}
archive_read_support_format_rar5.c:free_filters:
  852|  3.02k|static void free_filters(struct rar5* rar) {
  853|  3.02k|	struct cdeque* d = &rar->cstate.filters;
  854|       |
  855|       |	/* Free any remaining filters. All filters should be naturally
  856|       |	 * consumed by the unpacking function, so remaining filters after
  857|       |	 * unpacking normally mean that unpacking wasn't successful.
  858|       |	 * But still of course we shouldn't leak memory in such case. */
  859|       |
  860|       |	/* cdeque_size() is a fast operation, so we can use it as a loop
  861|       |	 * expression. */
  862|  3.02k|	while(cdeque_size(d) > 0) {
  ------------------
  |  Branch (862:8): [True: 0, False: 3.02k]
  ------------------
  863|      0|		struct filter_info* f = NULL;
  864|       |
  865|       |		/* Pop_front will also decrease the collection's size. */
  866|      0|		if (CDE_OK == cdeque_pop_front(d, cdeque_filter_p(&f)))
  ------------------
  |  Branch (866:7): [True: 0, False: 0]
  ------------------
  867|      0|			free(f);
  868|      0|	}
  869|       |
  870|  3.02k|	cdeque_clear(d);
  871|       |
  872|       |	/* Also clear out the variables needed for sanity checking. */
  873|  3.02k|	rar->cstate.last_block_start = 0;
  874|  3.02k|	rar->cstate.last_block_length = 0;
  875|  3.02k|}
archive_read_support_format_rar5.c:cdeque_size:
  414|  4.18k|static size_t cdeque_size(struct cdeque* d) {
  415|  4.18k|	return d->size;
  416|  4.18k|}
archive_read_support_format_rar5.c:cdeque_filter_p:
  472|  1.16k|static void** cdeque_filter_p(struct filter_info** f) {
  473|  1.16k|	return (void**) (size_t) f;
  474|  1.16k|}
archive_read_support_format_rar5.c:file_entry_sanity_checks:
 1710|  3.59k|{
 1711|  3.59k|	if (is_dir) {
  ------------------
  |  Branch (1711:6): [True: 3, False: 3.59k]
  ------------------
 1712|      3|		const int declares_data_size =
 1713|      3|			(int) (unpacked_size != 0 || packed_size != 0);
  ------------------
  |  Branch (1713:11): [True: 2, False: 1]
  |  Branch (1713:33): [True: 0, False: 1]
  ------------------
 1714|       |
 1715|       |		/* FILE entries for directories still declare HFL_DATA in block flags,
 1716|       |		   even though attaching data to such blocks doesn't make much sense. */
 1717|      3|		if (declares_data_size) {
  ------------------
  |  Branch (1717:7): [True: 2, False: 1]
  ------------------
 1718|      2|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1719|      2|				"directory entries cannot have any data");
 1720|      2|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1721|      2|		}
 1722|  3.59k|	} else {
 1723|  3.59k|		const int declares_hfl_data = (int) ((block_flags & HFL_DATA) != 0);
 1724|  3.59k|		if (!declares_hfl_data) {
  ------------------
  |  Branch (1724:7): [True: 0, False: 3.59k]
  ------------------
 1725|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1726|      0|					"no data found in file/service block");
 1727|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1728|      0|		}
 1729|  3.59k|	}
 1730|       |
 1731|  3.59k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  3.59k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1732|  3.59k|}
archive_read_support_format_rar5.c:clear_data_ready_stack:
 3822|  2.64k|static void clear_data_ready_stack(struct rar5* rar) {
 3823|  2.64k|	memset(&rar->cstate.dready, 0, sizeof(rar->cstate.dready));
 3824|  2.64k|}
archive_read_support_format_rar5.c:init_window_mask:
 1215|  3.73k|static void init_window_mask(struct rar5* rar) {
 1216|  3.73k|	if (rar->cstate.window_size)
  ------------------
  |  Branch (1216:6): [True: 3.73k, False: 1]
  ------------------
 1217|  3.73k|		rar->cstate.window_mask = rar->cstate.window_size - 1;
 1218|      1|	else
 1219|      1|		rar->cstate.window_mask = 0;
 1220|  3.73k|}
archive_read_support_format_rar5.c:process_head_file_extra:
 1620|    314|{
 1621|    314|	uint64_t extra_field_size;
 1622|    314|	uint64_t extra_field_id = 0;
 1623|    314|	uint64_t var_size;
 1624|       |
 1625|  10.3k|	while(extra_data_size > 0) {
  ------------------
  |  Branch (1625:8): [True: 10.0k, False: 297]
  ------------------
 1626|       |		/* Make sure we won't fail if the file declares only unsupported
 1627|       |		attributes. */
 1628|  10.0k|		int ret = ARCHIVE_OK;
  ------------------
  |  |  233|  10.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1629|       |
 1630|  10.0k|		if(!read_var(a, &extra_field_size, &var_size))
  ------------------
  |  Branch (1630:6): [True: 1, False: 10.0k]
  ------------------
 1631|      1|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1632|       |
 1633|  10.0k|		extra_data_size -= var_size;
 1634|  10.0k|		if(ARCHIVE_OK != consume(a, var_size)) {
  ------------------
  |  |  233|  10.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1634:6): [True: 0, False: 10.0k]
  ------------------
 1635|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1636|      0|		}
 1637|       |
 1638|  10.0k|		if(!read_var(a, &extra_field_id, &var_size))
  ------------------
  |  Branch (1638:6): [True: 5, False: 10.0k]
  ------------------
 1639|      5|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      5|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1640|       |
 1641|  10.0k|		extra_field_size -= var_size;
 1642|  10.0k|		extra_data_size -= var_size;
 1643|  10.0k|		if(ARCHIVE_OK != consume(a, var_size)) {
  ------------------
  |  |  233|  10.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1643:6): [True: 0, False: 10.0k]
  ------------------
 1644|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1645|      0|		}
 1646|       |
 1647|  10.0k|		switch(extra_field_id) {
 1648|     32|			case EX_HASH:
  ------------------
  |  Branch (1648:4): [True: 32, False: 10.0k]
  ------------------
 1649|     32|				ret = parse_file_extra_hash(a, rar,
 1650|     32|				    &extra_data_size);
 1651|     32|				break;
 1652|    603|			case EX_HTIME:
  ------------------
  |  Branch (1652:4): [True: 603, False: 9.43k]
  ------------------
 1653|    603|				ret = parse_file_extra_htime(a, e, rar,
 1654|    603|				    &extra_data_size);
 1655|    603|				break;
 1656|  1.45k|			case EX_REDIR:
  ------------------
  |  Branch (1656:4): [True: 1.45k, False: 8.58k]
  ------------------
 1657|  1.45k|				ret = parse_file_extra_redir(a, e, rar,
 1658|  1.45k|				    &extra_data_size);
 1659|  1.45k|				break;
 1660|    912|			case EX_UOWNER:
  ------------------
  |  Branch (1660:4): [True: 912, False: 9.12k]
  ------------------
 1661|    912|				ret = parse_file_extra_owner(a, e,
 1662|    912|				    &extra_data_size);
 1663|    912|				break;
 1664|  6.66k|			case EX_VERSION:
  ------------------
  |  Branch (1664:4): [True: 6.66k, False: 3.37k]
  ------------------
 1665|  6.66k|				ret = parse_file_extra_version(a, e,
 1666|  6.66k|				    &extra_data_size);
 1667|  6.66k|				break;
 1668|    132|			case EX_CRYPT:
  ------------------
  |  Branch (1668:4): [True: 132, False: 9.90k]
  ------------------
 1669|       |				/* Mark the entry as encrypted */
 1670|    132|				archive_entry_set_is_data_encrypted(e, 1);
 1671|    132|				rar->has_encrypted_entries = 1;
 1672|    132|				rar->cstate.data_encrypted = 1;
 1673|       |				/* fallthrough */
 1674|    132|			case EX_SUBDATA:
  ------------------
  |  Branch (1674:4): [True: 0, False: 10.0k]
  ------------------
 1675|       |				/* fallthrough */
 1676|    378|			default:
  ------------------
  |  Branch (1676:4): [True: 246, False: 9.79k]
  ------------------
 1677|       |				/* Skip unsupported entry. */
 1678|    378|				extra_data_size -= extra_field_size;
 1679|    378|				if (ARCHIVE_OK != consume(a, extra_field_size)) {
  ------------------
  |  |  233|    378|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1679:9): [True: 8, False: 370]
  ------------------
 1680|      8|					return ARCHIVE_EOF;
  ------------------
  |  |  232|      8|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1681|      8|				}
 1682|       |
 1683|       |				/* Don't fail on unsupported attribute -- we've handled it
 1684|       |				   by skipping over it. */
 1685|    370|				ret = ARCHIVE_OK;
  ------------------
  |  |  233|    370|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1686|  10.0k|		}
 1687|       |
 1688|  10.0k|		if (ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  10.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1688:7): [True: 3, False: 10.0k]
  ------------------
 1689|       |			/* Forward any errors signalled by the attribute parsing
 1690|       |			   functions. */
 1691|      3|			return ret;
 1692|      3|		}
 1693|  10.0k|	}
 1694|       |
 1695|    297|	if (extra_data_size != 0) {
  ------------------
  |  Branch (1695:6): [True: 7, False: 290]
  ------------------
 1696|       |		/* We didn't skip everything, or we skipped too much; either way,
 1697|       |		   there's an error in this parsing function. */
 1698|       |
 1699|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      7|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1700|      7|				"unsupported structure of file header extra data");
 1701|      7|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1702|      7|	}
 1703|       |
 1704|    290|	return ARCHIVE_OK;
  ------------------
  |  |  233|    290|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1705|    297|}
archive_read_support_format_rar5.c:parse_file_extra_hash:
 1266|     32|{
 1267|     32|	size_t hash_type = 0;
 1268|     32|	size_t value_len;
 1269|       |
 1270|     32|	enum HASH_TYPE {
 1271|     32|		BLAKE2sp = 0x00
 1272|     32|	};
 1273|       |
 1274|     32|	if(!read_var_sized(a, &hash_type, &value_len))
  ------------------
  |  Branch (1274:5): [True: 0, False: 32]
  ------------------
 1275|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1276|       |
 1277|     32|	*extra_data_size -= value_len;
 1278|     32|	if(ARCHIVE_OK != consume(a, value_len)) {
  ------------------
  |  |  233|     32|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1278:5): [True: 0, False: 32]
  ------------------
 1279|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1280|      0|	}
 1281|       |
 1282|       |	/* The file uses BLAKE2sp checksum algorithm instead of plain old
 1283|       |	 * CRC32. */
 1284|     32|	if(hash_type == BLAKE2sp) {
  ------------------
  |  Branch (1284:5): [True: 32, False: 0]
  ------------------
 1285|     32|		const uint8_t* p;
 1286|     32|		const int hash_size = sizeof(rar->file.blake2sp);
 1287|       |
 1288|     32|		if(!read_ahead(a, hash_size, &p))
  ------------------
  |  Branch (1288:6): [True: 0, False: 32]
  ------------------
 1289|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1290|       |
 1291|     32|		rar->file.has_blake2 = 1;
 1292|     32|		memcpy(&rar->file.blake2sp, p, hash_size);
 1293|       |
 1294|     32|		if(ARCHIVE_OK != consume(a, hash_size)) {
  ------------------
  |  |  233|     32|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1294:6): [True: 0, False: 32]
  ------------------
 1295|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1296|      0|		}
 1297|       |
 1298|     32|		*extra_data_size -= hash_size;
 1299|     32|	} else {
 1300|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1301|      0|		    "Unsupported hash type (0x%jx)", (uintmax_t)hash_type);
 1302|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1303|      0|	}
 1304|       |
 1305|     32|	return ARCHIVE_OK;
  ------------------
  |  |  233|     32|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1306|     32|}
archive_read_support_format_rar5.c:parse_file_extra_htime:
 1386|    603|{
 1387|    603|	char unix_time, has_unix_ns, has_mtime, has_ctime, has_atime;
 1388|    603|	size_t flags = 0;
 1389|    603|	size_t value_len;
 1390|       |
 1391|    603|	enum HTIME_FLAGS {
 1392|    603|		IS_UNIX       = 0x01,
 1393|    603|		HAS_MTIME     = 0x02,
 1394|    603|		HAS_CTIME     = 0x04,
 1395|    603|		HAS_ATIME     = 0x08,
 1396|    603|		HAS_UNIX_NS   = 0x10,
 1397|    603|	};
 1398|       |
 1399|    603|	if(!read_var_sized(a, &flags, &value_len))
  ------------------
  |  Branch (1399:5): [True: 0, False: 603]
  ------------------
 1400|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1401|       |
 1402|    603|	*extra_data_size -= value_len;
 1403|    603|	if(ARCHIVE_OK != consume(a, value_len)) {
  ------------------
  |  |  233|    603|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1403:5): [True: 0, False: 603]
  ------------------
 1404|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1405|      0|	}
 1406|       |
 1407|    603|	unix_time = flags & IS_UNIX;
 1408|    603|	has_unix_ns = unix_time && (flags & HAS_UNIX_NS);
  ------------------
  |  Branch (1408:16): [True: 448, False: 155]
  |  Branch (1408:29): [True: 236, False: 212]
  ------------------
 1409|    603|	has_mtime = flags & HAS_MTIME;
 1410|    603|	has_atime = flags & HAS_ATIME;
 1411|    603|	has_ctime = flags & HAS_CTIME;
 1412|    603|	rar->file.e_atime_ns = rar->file.e_ctime_ns = rar->file.e_mtime_ns = 0;
 1413|       |
 1414|    603|	if(has_mtime) {
  ------------------
  |  Branch (1414:5): [True: 373, False: 230]
  ------------------
 1415|    373|		parse_htime_item(a, unix_time, &rar->file.e_mtime,
 1416|    373|		    &rar->file.e_mtime_ns, extra_data_size);
 1417|    373|	}
 1418|       |
 1419|    603|	if(has_ctime) {
  ------------------
  |  Branch (1419:5): [True: 222, False: 381]
  ------------------
 1420|    222|		parse_htime_item(a, unix_time, &rar->file.e_ctime,
 1421|    222|		    &rar->file.e_ctime_ns, extra_data_size);
 1422|    222|	}
 1423|       |
 1424|    603|	if(has_atime) {
  ------------------
  |  Branch (1424:5): [True: 320, False: 283]
  ------------------
 1425|    320|		parse_htime_item(a, unix_time, &rar->file.e_atime,
 1426|    320|		    &rar->file.e_atime_ns, extra_data_size);
 1427|    320|	}
 1428|       |
 1429|    603|	if(has_mtime && has_unix_ns) {
  ------------------
  |  Branch (1429:5): [True: 373, False: 230]
  |  Branch (1429:18): [True: 105, False: 268]
  ------------------
 1430|    105|		if(!read_u32(a, &rar->file.e_mtime_ns))
  ------------------
  |  Branch (1430:6): [True: 0, False: 105]
  ------------------
 1431|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1432|       |
 1433|    105|		*extra_data_size -= 4;
 1434|    105|	}
 1435|       |
 1436|    603|	if(has_ctime && has_unix_ns) {
  ------------------
  |  Branch (1436:5): [True: 222, False: 381]
  |  Branch (1436:18): [True: 133, False: 89]
  ------------------
 1437|    133|		if(!read_u32(a, &rar->file.e_ctime_ns))
  ------------------
  |  Branch (1437:6): [True: 1, False: 132]
  ------------------
 1438|      1|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1439|       |
 1440|    132|		*extra_data_size -= 4;
 1441|    132|	}
 1442|       |
 1443|    602|	if(has_atime && has_unix_ns) {
  ------------------
  |  Branch (1443:5): [True: 319, False: 283]
  |  Branch (1443:18): [True: 132, False: 187]
  ------------------
 1444|    132|		if(!read_u32(a, &rar->file.e_atime_ns))
  ------------------
  |  Branch (1444:6): [True: 0, False: 132]
  ------------------
 1445|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1446|       |
 1447|    132|		*extra_data_size -= 4;
 1448|    132|	}
 1449|       |
 1450|       |	/* The seconds and nanoseconds are either together, or separated in two
 1451|       |	 * fields so we parse them, then set the archive_entry's times. */
 1452|    602|	if(has_mtime) {
  ------------------
  |  Branch (1452:5): [True: 373, False: 229]
  ------------------
 1453|    373|		archive_entry_set_mtime(e, rar->file.e_mtime, rar->file.e_mtime_ns);
 1454|    373|	}
 1455|       |
 1456|    602|	if(has_ctime) {
  ------------------
  |  Branch (1456:5): [True: 221, False: 381]
  ------------------
 1457|    221|		archive_entry_set_ctime(e, rar->file.e_ctime, rar->file.e_ctime_ns);
 1458|    221|	}
 1459|       |
 1460|    602|	if(has_atime) {
  ------------------
  |  Branch (1460:5): [True: 319, False: 283]
  ------------------
 1461|    319|		archive_entry_set_atime(e, rar->file.e_atime, rar->file.e_atime_ns);
 1462|    319|	}
 1463|       |
 1464|    602|	return ARCHIVE_OK;
  ------------------
  |  |  233|    602|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1465|    602|}
archive_read_support_format_rar5.c:parse_htime_item:
 1310|    915|{
 1311|    915|	if(unix_time) {
  ------------------
  |  Branch (1311:5): [True: 651, False: 264]
  ------------------
 1312|    651|		uint32_t time_val;
 1313|    651|		if(!read_u32(a, &time_val))
  ------------------
  |  Branch (1313:6): [True: 0, False: 651]
  ------------------
 1314|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1315|       |
 1316|    651|		*extra_data_size -= 4;
 1317|    651|		*sec = (int64_t) time_val;
 1318|    651|	} else {
 1319|    264|		uint64_t windows_time;
 1320|    264|		if(!read_u64(a, &windows_time))
  ------------------
  |  Branch (1320:6): [True: 0, False: 264]
  ------------------
 1321|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1322|       |
 1323|    264|		ntfs_to_unix(windows_time, sec, nsec);
 1324|    264|		*extra_data_size -= 8;
 1325|    264|	}
 1326|       |
 1327|    915|	return ARCHIVE_OK;
  ------------------
  |  |  233|    915|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1328|    915|}
archive_read_support_format_rar5.c:read_u64:
 1117|    264|static char read_u64(struct archive_read* a, uint64_t* pvalue) {
 1118|    264|	const uint8_t* p;
 1119|    264|	if(!read_ahead(a, 8, &p))
  ------------------
  |  Branch (1119:5): [True: 0, False: 264]
  ------------------
 1120|      0|		return 0;
 1121|       |
 1122|    264|	*pvalue = archive_le64dec(p);
 1123|    264|	return ARCHIVE_OK == consume(a, 8);
  ------------------
  |  |  233|    264|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1124|    264|}
archive_read_support_format_rar5.c:parse_file_extra_redir:
 1469|  1.45k|{
 1470|  1.45k|	uint64_t value_size = 0;
 1471|  1.45k|	size_t target_size = 0;
 1472|  1.45k|	char target_utf8_buf[MAX_NAME_IN_BYTES];
 1473|  1.45k|	const uint8_t* p;
 1474|       |
 1475|  1.45k|	if(!read_var(a, &rar->file.redir_type, &value_size))
  ------------------
  |  Branch (1475:5): [True: 0, False: 1.45k]
  ------------------
 1476|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1477|  1.45k|	if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|  1.45k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1477:5): [True: 0, False: 1.45k]
  ------------------
 1478|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1479|  1.45k|	*extra_data_size -= value_size;
 1480|       |
 1481|  1.45k|	if(!read_var(a, &rar->file.redir_flags, &value_size))
  ------------------
  |  Branch (1481:5): [True: 0, False: 1.45k]
  ------------------
 1482|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1483|  1.45k|	if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|  1.45k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1483:5): [True: 0, False: 1.45k]
  ------------------
 1484|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1485|  1.45k|	*extra_data_size -= value_size;
 1486|       |
 1487|  1.45k|	if(!read_var_sized(a, &target_size, NULL))
  ------------------
  |  Branch (1487:5): [True: 0, False: 1.45k]
  ------------------
 1488|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1489|  1.45k|	*extra_data_size -= target_size + 1;
 1490|       |
 1491|  1.45k|	if(target_size > (MAX_NAME_IN_CHARS - 1)) {
  ------------------
  |  |   91|  1.45k|#define MAX_NAME_IN_CHARS 2048
  ------------------
  |  Branch (1491:5): [True: 0, False: 1.45k]
  ------------------
 1492|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1493|      0|		    "Link target is too long");
 1494|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1495|      0|	}
 1496|       |
 1497|  1.45k|	if(target_size == 0) {
  ------------------
  |  Branch (1497:5): [True: 0, False: 1.45k]
  ------------------
 1498|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1499|      0|		    "No link target specified");
 1500|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1501|      0|	}
 1502|       |
 1503|  1.45k|	if(!read_ahead(a, target_size, &p))
  ------------------
  |  Branch (1503:5): [True: 0, False: 1.45k]
  ------------------
 1504|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1505|       |
 1506|  1.45k|	memcpy(target_utf8_buf, p, target_size);
 1507|  1.45k|	target_utf8_buf[target_size] = 0;
 1508|       |
 1509|  1.45k|	if(ARCHIVE_OK != consume(a, (int64_t)target_size))
  ------------------
  |  |  233|  1.45k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1509:5): [True: 0, False: 1.45k]
  ------------------
 1510|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1511|       |
 1512|  1.45k|	switch(rar->file.redir_type) {
 1513|      0|		case REDIR_TYPE_UNIXSYMLINK:
  ------------------
  |  Branch (1513:3): [True: 0, False: 1.45k]
  ------------------
 1514|      0|		case REDIR_TYPE_WINSYMLINK:
  ------------------
  |  Branch (1514:3): [True: 0, False: 1.45k]
  ------------------
 1515|      0|			archive_entry_set_filetype(e, AE_IFLNK);
  ------------------
  |  |  217|      0|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
 1516|      0|			archive_entry_update_symlink_utf8(e, target_utf8_buf);
 1517|      0|			if (rar->file.redir_flags & REDIR_SYMLINK_IS_DIR) {
  ------------------
  |  |  137|      0|#define REDIR_SYMLINK_IS_DIR	1
  ------------------
  |  Branch (1517:8): [True: 0, False: 0]
  ------------------
 1518|      0|				archive_entry_set_symlink_type(e,
 1519|      0|					AE_SYMLINK_TYPE_DIRECTORY);
  ------------------
  |  |  229|      0|#define AE_SYMLINK_TYPE_DIRECTORY	2
  ------------------
 1520|      0|			} else {
 1521|      0|				archive_entry_set_symlink_type(e,
 1522|      0|				AE_SYMLINK_TYPE_FILE);
  ------------------
  |  |  228|      0|#define AE_SYMLINK_TYPE_FILE		1
  ------------------
 1523|      0|			}
 1524|      0|			break;
 1525|       |
 1526|    164|		case REDIR_TYPE_HARDLINK:
  ------------------
  |  Branch (1526:3): [True: 164, False: 1.28k]
  ------------------
 1527|    164|			archive_entry_set_filetype(e, AE_IFREG);
  ------------------
  |  |  216|    164|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1528|    164|			archive_entry_update_hardlink_utf8(e, target_utf8_buf);
 1529|    164|			break;
 1530|       |
 1531|  1.28k|		default:
  ------------------
  |  Branch (1531:3): [True: 1.28k, False: 164]
  ------------------
 1532|       |			/* Unknown redir type, skip it. */
 1533|  1.28k|			break;
 1534|  1.45k|	}
 1535|  1.45k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.45k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1536|  1.45k|}
archive_read_support_format_rar5.c:parse_file_extra_owner:
 1540|    912|{
 1541|    912|	uint64_t flags = 0;
 1542|    912|	uint64_t value_size = 0;
 1543|    912|	uint64_t id = 0;
 1544|    912|	size_t name_len = 0;
 1545|    912|	size_t name_size = 0;
 1546|    912|	char namebuf[OWNER_MAXNAMELEN];
 1547|    912|	const uint8_t* p;
 1548|       |
 1549|    912|	if(!read_var(a, &flags, &value_size))
  ------------------
  |  Branch (1549:5): [True: 0, False: 912]
  ------------------
 1550|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1551|    912|	if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|    912|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1551:5): [True: 0, False: 912]
  ------------------
 1552|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1553|    912|	*extra_data_size -= value_size;
 1554|       |
 1555|    912|	if ((flags & OWNER_USER_NAME) != 0) {
  ------------------
  |  |  148|    912|#define	OWNER_USER_NAME		0x01
  ------------------
  |  Branch (1555:6): [True: 220, False: 692]
  ------------------
 1556|    220|		if(!read_var_sized(a, &name_size, NULL))
  ------------------
  |  Branch (1556:6): [True: 0, False: 220]
  ------------------
 1557|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1558|    220|		*extra_data_size -= name_size + 1;
 1559|       |
 1560|    220|		if(!read_ahead(a, name_size, &p))
  ------------------
  |  Branch (1560:6): [True: 0, False: 220]
  ------------------
 1561|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1562|       |
 1563|    220|		if (name_size >= OWNER_MAXNAMELEN) {
  ------------------
  |  |  152|    220|#define	OWNER_MAXNAMELEN	256
  ------------------
  |  Branch (1563:7): [True: 3, False: 217]
  ------------------
 1564|      3|			name_len = OWNER_MAXNAMELEN - 1;
  ------------------
  |  |  152|      3|#define	OWNER_MAXNAMELEN	256
  ------------------
 1565|    217|		} else {
 1566|    217|			name_len = name_size;
 1567|    217|		}
 1568|       |
 1569|    220|		memcpy(namebuf, p, name_len);
 1570|    220|		namebuf[name_len] = 0;
 1571|    220|		if(ARCHIVE_OK != consume(a, (int64_t)name_size))
  ------------------
  |  |  233|    220|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1571:6): [True: 0, False: 220]
  ------------------
 1572|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1573|       |
 1574|    220|		archive_entry_set_uname(e, namebuf);
 1575|    220|	}
 1576|    912|	if ((flags & OWNER_GROUP_NAME) != 0) {
  ------------------
  |  |  149|    912|#define	OWNER_GROUP_NAME	0x02
  ------------------
  |  Branch (1576:6): [True: 784, False: 128]
  ------------------
 1577|    784|		if(!read_var_sized(a, &name_size, NULL))
  ------------------
  |  Branch (1577:6): [True: 0, False: 784]
  ------------------
 1578|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1579|    784|		*extra_data_size -= name_size + 1;
 1580|       |
 1581|    784|		if(!read_ahead(a, name_size, &p))
  ------------------
  |  Branch (1581:6): [True: 0, False: 784]
  ------------------
 1582|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1583|       |
 1584|    784|		if (name_size >= OWNER_MAXNAMELEN) {
  ------------------
  |  |  152|    784|#define	OWNER_MAXNAMELEN	256
  ------------------
  |  Branch (1584:7): [True: 7, False: 777]
  ------------------
 1585|      7|			name_len = OWNER_MAXNAMELEN - 1;
  ------------------
  |  |  152|      7|#define	OWNER_MAXNAMELEN	256
  ------------------
 1586|    777|		} else {
 1587|    777|			name_len = name_size;
 1588|    777|		}
 1589|       |
 1590|    784|		memcpy(namebuf, p, name_len);
 1591|    784|		namebuf[name_len] = 0;
 1592|    784|		if(ARCHIVE_OK != consume(a, (int64_t)name_size))
  ------------------
  |  |  233|    784|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1592:6): [True: 0, False: 784]
  ------------------
 1593|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1594|       |
 1595|    784|		archive_entry_set_gname(e, namebuf);
 1596|    784|	}
 1597|    912|	if ((flags & OWNER_USER_UID) != 0) {
  ------------------
  |  |  150|    912|#define	OWNER_USER_UID		0x04
  ------------------
  |  Branch (1597:6): [True: 899, False: 13]
  ------------------
 1598|    899|		if(!read_var(a, &id, &value_size))
  ------------------
  |  Branch (1598:6): [True: 1, False: 898]
  ------------------
 1599|      1|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1600|    898|		if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|    898|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1600:6): [True: 0, False: 898]
  ------------------
 1601|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1602|    898|		*extra_data_size -= value_size;
 1603|       |
 1604|    898|		archive_entry_set_uid(e, (la_int64_t)id);
 1605|    898|	}
 1606|    911|	if ((flags & OWNER_GROUP_GID) != 0) {
  ------------------
  |  |  151|    911|#define	OWNER_GROUP_GID		0x08
  ------------------
  |  Branch (1606:6): [True: 224, False: 687]
  ------------------
 1607|    224|		if(!read_var(a, &id, &value_size))
  ------------------
  |  Branch (1607:6): [True: 0, False: 224]
  ------------------
 1608|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1609|    224|		if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|    224|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1609:6): [True: 0, False: 224]
  ------------------
 1610|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1611|    224|		*extra_data_size -= value_size;
 1612|       |
 1613|    224|		archive_entry_set_gid(e, (la_int64_t)id);
 1614|    224|	}
 1615|    911|	return ARCHIVE_OK;
  ------------------
  |  |  233|    911|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1616|    911|}
archive_read_support_format_rar5.c:parse_file_extra_version:
 1332|  6.66k|{
 1333|  6.66k|	size_t flags = 0;
 1334|  6.66k|	size_t version = 0;
 1335|  6.66k|	size_t value_len = 0;
 1336|  6.66k|	struct archive_string version_string;
 1337|  6.66k|	struct archive_string name_utf8_string;
 1338|  6.66k|	const char* cur_filename;
 1339|       |
 1340|       |	/* Flags are ignored. */
 1341|  6.66k|	if(!read_var_sized(a, &flags, &value_len))
  ------------------
  |  Branch (1341:5): [True: 1, False: 6.66k]
  ------------------
 1342|      1|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1343|       |
 1344|  6.66k|	*extra_data_size -= value_len;
 1345|  6.66k|	if(ARCHIVE_OK != consume(a, value_len))
  ------------------
  |  |  233|  6.66k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1345:5): [True: 0, False: 6.66k]
  ------------------
 1346|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1347|       |
 1348|  6.66k|	if(!read_var_sized(a, &version, &value_len))
  ------------------
  |  Branch (1348:5): [True: 0, False: 6.66k]
  ------------------
 1349|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1350|       |
 1351|  6.66k|	*extra_data_size -= value_len;
 1352|  6.66k|	if(ARCHIVE_OK != consume(a, value_len))
  ------------------
  |  |  233|  6.66k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1352:5): [True: 0, False: 6.66k]
  ------------------
 1353|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1354|       |
 1355|       |	/* extra_data_size should be zero here. */
 1356|       |
 1357|  6.66k|	cur_filename = archive_entry_pathname_utf8(e);
 1358|  6.66k|	if(cur_filename == NULL) {
  ------------------
  |  Branch (1358:5): [True: 0, False: 6.66k]
  ------------------
 1359|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1360|      0|		    "Version entry without file name");
 1361|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1362|      0|	}
 1363|       |
 1364|  6.66k|	archive_string_init(&version_string);
  ------------------
  |  |   71|  6.66k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 6.66k]
  |  |  ------------------
  ------------------
 1365|  6.66k|	archive_string_init(&name_utf8_string);
  ------------------
  |  |   71|  6.66k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 6.66k]
  |  |  ------------------
  ------------------
 1366|       |
 1367|       |	/* Prepare a ;123 suffix for the filename, where '123' is the version
 1368|       |	 * value of this file. */
 1369|  6.66k|	archive_string_sprintf(&version_string, ";%zu", version);
 1370|       |
 1371|       |	/* Build the new filename. */
 1372|  6.66k|	archive_strcat(&name_utf8_string, cur_filename);
 1373|  6.66k|	archive_strcat(&name_utf8_string, version_string.s);
 1374|       |
 1375|       |	/* Apply the new filename into this file's context. */
 1376|  6.66k|	archive_entry_update_pathname_utf8(e, name_utf8_string.s);
 1377|       |
 1378|       |	/* Free buffers. */
 1379|  6.66k|	archive_string_free(&version_string);
 1380|  6.66k|	archive_string_free(&name_utf8_string);
 1381|  6.66k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  6.66k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1382|  6.66k|}
archive_read_support_format_rar5.c:scan_for_signature:
 3401|  3.12k|static int scan_for_signature(struct archive_read* a) {
 3402|  3.12k|	const uint8_t* p;
 3403|  3.12k|	const int chunk_size = 512;
 3404|  3.12k|	ssize_t i;
 3405|  3.12k|	char signature[sizeof(rar5_signature_xor)];
 3406|       |
 3407|       |	/* If we're here, it means we're on an 'unknown territory' data.
 3408|       |	 * There's no indication what kind of data we're reading here.
 3409|       |	 * It could be some text comment, any kind of binary data,
 3410|       |	 * digital sign, dragons, etc.
 3411|       |	 *
 3412|       |	 * We want to find a valid RARv5 magic header inside this unknown
 3413|       |	 * data. */
 3414|       |
 3415|       |	/* Is it possible in libarchive to just skip everything until the
 3416|       |	 * end of the file? If so, it would be a better approach than the
 3417|       |	 * current implementation of this function. */
 3418|       |
 3419|  3.12k|	rar5_signature(signature);
 3420|       |
 3421|  3.39k|	while(1) {
  ------------------
  |  Branch (3421:8): [True: 3.39k, Folded]
  ------------------
 3422|  3.39k|		if(!read_ahead(a, chunk_size, &p))
  ------------------
  |  Branch (3422:6): [True: 21, False: 3.37k]
  ------------------
 3423|     21|			return ARCHIVE_EOF;
  ------------------
  |  |  232|     21|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3424|       |
 3425|  1.40M|		for(i = 0; i < chunk_size - (int)sizeof(rar5_signature_xor);
  ------------------
  |  Branch (3425:14): [True: 1.40M, False: 267]
  ------------------
 3426|  1.40M|		    i++) {
 3427|  1.40M|			if(memcmp(&p[i], signature,
  ------------------
  |  Branch (3427:7): [True: 3.10k, False: 1.40M]
  ------------------
 3428|  1.40M|			    sizeof(rar5_signature_xor)) == 0) {
 3429|       |				/* Consume the number of bytes we've used to
 3430|       |				 * search for the signature, as well as the
 3431|       |				 * number of bytes used by the signature
 3432|       |				 * itself. After this we should be standing
 3433|       |				 * on a valid base block header. */
 3434|  3.10k|				(void) consume(a,
 3435|  3.10k|				    i + sizeof(rar5_signature_xor));
 3436|  3.10k|				return ARCHIVE_OK;
  ------------------
  |  |  233|  3.10k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3437|  3.10k|			}
 3438|  1.40M|		}
 3439|       |
 3440|    267|		consume(a, chunk_size);
 3441|    267|	}
 3442|       |
 3443|      0|	return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3444|  3.12k|}
archive_read_support_format_rar5.c:rar5_read_data:
 4260|  2.96k|    size_t *size, int64_t *offset) {
 4261|  2.96k|	int ret;
 4262|  2.96k|	struct rar5* rar = get_context(a);
 4263|       |
 4264|  2.96k|	if (size)
  ------------------
  |  Branch (4264:6): [True: 2.86k, False: 106]
  ------------------
 4265|  2.86k|		*size = 0;
 4266|       |
 4267|  2.96k|	if (rar->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|  2.96k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (4267:6): [True: 0, False: 2.96k]
  ------------------
 4268|      0|		rar->has_encrypted_entries = 0;
 4269|      0|	}
 4270|       |
 4271|  2.96k|	if (rar->headers_are_encrypted || rar->cstate.data_encrypted) {
  ------------------
  |  Branch (4271:6): [True: 0, False: 2.96k]
  |  Branch (4271:36): [True: 0, False: 2.96k]
  ------------------
 4272|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4273|      0|		    "Reading encrypted data is not currently supported");
 4274|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 4275|      0|	}
 4276|       |
 4277|  2.96k|	if(rar->file.dir > 0) {
  ------------------
  |  Branch (4277:5): [True: 0, False: 2.96k]
  ------------------
 4278|       |		/* Don't process any data if this file entry was declared
 4279|       |		 * as a directory. This is needed, because entries marked as
 4280|       |		 * directory doesn't have any dictionary buffer allocated, so
 4281|       |		 * it's impossible to perform any decompression. */
 4282|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4283|      0|		    "Can't decompress an entry marked as a directory");
 4284|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4285|      0|	}
 4286|       |
 4287|  2.96k|	if(!rar->skip_mode && (rar->cstate.last_write_ptr > rar->file.unpacked_size)) {
  ------------------
  |  Branch (4287:5): [True: 2.86k, False: 106]
  |  Branch (4287:24): [True: 0, False: 2.86k]
  ------------------
 4288|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 4289|      0|		    "Unpacker has written too many bytes");
 4290|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4291|      0|	}
 4292|       |
 4293|  2.96k|	ret = use_data(rar, buff, size, offset);
 4294|  2.96k|	if(ret == ARCHIVE_OK) {
  ------------------
  |  |  233|  2.96k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4294:5): [True: 1.25k, False: 1.71k]
  ------------------
 4295|  1.25k|		return ret;
 4296|  1.25k|	}
 4297|       |
 4298|  1.71k|	if(rar->file.eof == 1) {
  ------------------
  |  Branch (4298:5): [True: 4, False: 1.71k]
  ------------------
 4299|      4|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      4|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4300|      4|	}
 4301|       |
 4302|  1.71k|	ret = do_unpack(a, rar, buff, size, offset);
 4303|  1.71k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.71k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4303:5): [True: 528, False: 1.18k]
  ------------------
 4304|    528|		return ret;
 4305|    528|	}
 4306|       |
 4307|  1.18k|	if(rar->file.bytes_remaining == 0 &&
  ------------------
  |  Branch (4307:5): [True: 109, False: 1.07k]
  ------------------
 4308|    109|			rar->cstate.last_write_ptr == rar->file.unpacked_size)
  ------------------
  |  Branch (4308:4): [True: 6, False: 103]
  ------------------
 4309|      6|	{
 4310|       |		/* If all bytes of current file were processed, run
 4311|       |		 * finalization.
 4312|       |		 *
 4313|       |		 * Finalization will check checksum against proper values. If
 4314|       |		 * some of the checksums will not match, we'll return an error
 4315|       |		 * value in the last `archive_read_data` call to signal an error
 4316|       |		 * to the user. */
 4317|       |
 4318|      6|		rar->file.eof = 1;
 4319|      6|		return verify_global_checksums(a);
 4320|      6|	}
 4321|       |
 4322|  1.17k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.17k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4323|  1.18k|}
archive_read_support_format_rar5.c:use_data:
 3803|  2.96k|{
 3804|  2.96k|	int i;
 3805|       |
 3806|  6.56k|	for(i = 0; i < rar5_countof(rar->cstate.dready); i++) {
  ------------------
  |  |   63|  6.56k|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (3806:13): [True: 4.85k, False: 1.71k]
  ------------------
 3807|  4.85k|		struct data_ready *d = &rar->cstate.dready[i];
 3808|       |
 3809|  4.85k|		if(d->used) {
  ------------------
  |  Branch (3809:6): [True: 1.25k, False: 3.59k]
  ------------------
 3810|  1.25k|			if(buf)    *buf = d->buf;
  ------------------
  |  Branch (3810:7): [True: 1.25k, False: 0]
  ------------------
 3811|  1.25k|			if(size)   *size = d->size;
  ------------------
  |  Branch (3811:7): [True: 1.25k, False: 0]
  ------------------
 3812|  1.25k|			if(offset) *offset = d->offset;
  ------------------
  |  Branch (3812:7): [True: 1.25k, False: 0]
  ------------------
 3813|       |
 3814|  1.25k|			d->used = 0;
 3815|  1.25k|			return ARCHIVE_OK;
  ------------------
  |  |  233|  1.25k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3816|  1.25k|		}
 3817|  4.85k|	}
 3818|       |
 3819|  1.71k|	return ARCHIVE_RETRY;
  ------------------
  |  |  234|  1.71k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 3820|  2.96k|}
archive_read_support_format_rar5.c:do_unpack:
 4099|  1.71k|{
 4100|  1.71k|	enum COMPRESSION_METHOD {
 4101|  1.71k|		STORE = 0, FASTEST = 1, FAST = 2, NORMAL = 3, GOOD = 4,
 4102|  1.71k|		BEST = 5
 4103|  1.71k|	};
 4104|       |
 4105|  1.71k|	if(rar->file.service > 0) {
  ------------------
  |  Branch (4105:5): [True: 0, False: 1.71k]
  ------------------
 4106|      0|		return do_unstore_file(a, rar, buf, size, offset);
 4107|  1.71k|	} else {
 4108|  1.71k|		switch(rar->cstate.method) {
 4109|    135|			case STORE:
  ------------------
  |  Branch (4109:4): [True: 135, False: 1.57k]
  ------------------
 4110|    135|				return do_unstore_file(a, rar, buf, size,
 4111|    135|				    offset);
 4112|    610|			case FASTEST:
  ------------------
  |  Branch (4112:4): [True: 610, False: 1.10k]
  ------------------
 4113|       |				/* fallthrough */
 4114|  1.37k|			case FAST:
  ------------------
  |  Branch (4114:4): [True: 765, False: 946]
  ------------------
 4115|       |				/* fallthrough */
 4116|  1.55k|			case NORMAL:
  ------------------
  |  Branch (4116:4): [True: 184, False: 1.52k]
  ------------------
 4117|       |				/* fallthrough */
 4118|  1.56k|			case GOOD:
  ------------------
  |  Branch (4118:4): [True: 3, False: 1.70k]
  ------------------
 4119|       |				/* fallthrough */
 4120|  1.57k|			case BEST:
  ------------------
  |  Branch (4120:4): [True: 14, False: 1.69k]
  ------------------
 4121|       |				/* No data is returned here. But because a sparse-file aware
 4122|       |				 * caller (like archive_read_data_into_fd) may treat zero-size
 4123|       |				 * as a sparse file block, we need to update the offset
 4124|       |				 * accordingly. At this point the decoder doesn't have any
 4125|       |				 * pending uncompressed data blocks, so the current position in
 4126|       |				 * the output file should be last_write_ptr. */
 4127|  1.57k|				if (offset) *offset = rar->cstate.last_write_ptr;
  ------------------
  |  Branch (4127:9): [True: 1.47k, False: 101]
  ------------------
 4128|  1.57k|				return uncompress_file(a);
 4129|      0|			default:
  ------------------
  |  Branch (4129:4): [True: 0, False: 1.71k]
  ------------------
 4130|      0|				archive_set_error(&a->archive,
 4131|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4132|      0|				    "Compression method not supported: 0x%x",
 4133|      0|				    (unsigned int)rar->cstate.method);
 4134|       |
 4135|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4136|  1.71k|		}
 4137|  1.71k|	}
 4138|       |
 4139|      0|#if !defined WIN32
 4140|       |	/* Not reached. */
 4141|      0|	return ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4142|  1.71k|#endif
 4143|  1.71k|}
archive_read_support_format_rar5.c:do_unstore_file:
 4051|    135|{
 4052|    135|	size_t to_read;
 4053|    135|	const uint8_t* p;
 4054|       |
 4055|    135|	if(rar->file.bytes_remaining == 0 && rar->main.volume > 0 &&
  ------------------
  |  Branch (4055:5): [True: 109, False: 26]
  |  Branch (4055:39): [True: 109, False: 0]
  ------------------
 4056|    109|	    rar->generic.split_after > 0)
  ------------------
  |  Branch (4056:6): [True: 98, False: 11]
  ------------------
 4057|     98|	{
 4058|     98|		int ret;
 4059|       |
 4060|     98|		rar->cstate.switch_multivolume = 1;
 4061|     98|		ret = advance_multivolume(a);
 4062|     98|		rar->cstate.switch_multivolume = 0;
 4063|       |
 4064|     98|		if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|     98|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4064:6): [True: 98, False: 0]
  ------------------
 4065|       |			/* Failed to advance to next multivolume archive
 4066|       |			 * file. */
 4067|     98|			return ret;
 4068|     98|		}
 4069|     98|	}
 4070|       |
 4071|     37|	to_read = rar5_min(rar->file.bytes_remaining, 64 * 1024);
  ------------------
  |  |   61|     37|#define rar5_min(a, b) (((a) > (b)) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (61:25): [True: 13, False: 24]
  |  |  ------------------
  ------------------
 4072|     37|	if(to_read == 0) {
  ------------------
  |  Branch (4072:5): [True: 11, False: 26]
  ------------------
 4073|     11|		return ARCHIVE_EOF;
  ------------------
  |  |  232|     11|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4074|     11|	}
 4075|       |
 4076|     26|	if(!read_ahead(a, to_read, &p)) {
  ------------------
  |  Branch (4076:5): [True: 3, False: 23]
  ------------------
 4077|      3|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4078|      3|		    "I/O error when unstoring file");
 4079|      3|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4080|      3|	}
 4081|       |
 4082|     23|	if(ARCHIVE_OK != consume(a, to_read)) {
  ------------------
  |  |  233|     23|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4082:5): [True: 0, False: 23]
  ------------------
 4083|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4084|      0|	}
 4085|       |
 4086|     23|	if(buf)    *buf = p;
  ------------------
  |  Branch (4086:5): [True: 18, False: 5]
  ------------------
 4087|     23|	if(size)   *size = to_read;
  ------------------
  |  Branch (4087:5): [True: 18, False: 5]
  ------------------
 4088|     23|	if(offset) *offset = rar->cstate.last_unstore_ptr;
  ------------------
  |  Branch (4088:5): [True: 18, False: 5]
  ------------------
 4089|       |
 4090|     23|	rar->file.bytes_remaining -= to_read;
 4091|     23|	rar->cstate.last_unstore_ptr += to_read;
 4092|       |
 4093|     23|	update_crc(rar, p, to_read);
 4094|     23|	return ARCHIVE_OK;
  ------------------
  |  |  233|     23|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4095|     23|}
archive_read_support_format_rar5.c:advance_multivolume:
 3448|    178|static int advance_multivolume(struct archive_read* a) {
 3449|    178|	int lret;
 3450|    178|	struct rar5* rar = get_context(a);
 3451|       |
 3452|       |	/* A small state machine that will skip unnecessary data, needed to
 3453|       |	 * switch from one multivolume to another. Such skipping is needed if
 3454|       |	 * we want to be an stream-oriented (instead of file-oriented)
 3455|       |	 * unpacker.
 3456|       |	 *
 3457|       |	 * The state machine starts with `rar->main.endarc` == 0. It also
 3458|       |	 * assumes that current stream pointer points to some base block
 3459|       |	 * header.
 3460|       |	 *
 3461|       |	 * The `endarc` field is being set when the base block parsing
 3462|       |	 * function encounters the 'end of archive' marker.
 3463|       |	 */
 3464|       |
 3465|    651|	while(1) {
  ------------------
  |  Branch (3465:8): [True: 651, Folded]
  ------------------
 3466|    651|		if(rar->main.endarc == 1) {
  ------------------
  |  Branch (3466:6): [True: 86, False: 565]
  ------------------
 3467|     86|			int looping = 1;
 3468|       |
 3469|     86|			rar->main.endarc = 0;
 3470|       |
 3471|  5.90k|			while(looping) {
  ------------------
  |  Branch (3471:10): [True: 5.90k, False: 0]
  ------------------
 3472|  5.90k|				lret = skip_base_block(a);
 3473|  5.90k|				switch(lret) {
 3474|  5.81k|					case ARCHIVE_RETRY:
  ------------------
  |  |  234|  5.81k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (3474:6): [True: 5.81k, False: 86]
  ------------------
 3475|       |						/* Continue looping. */
 3476|  5.81k|						break;
 3477|      0|					case ARCHIVE_OK:
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3477:6): [True: 0, False: 5.90k]
  ------------------
 3478|       |						/* Break loop. */
 3479|      0|						looping = 0;
 3480|      0|						break;
 3481|     86|					default:
  ------------------
  |  Branch (3481:6): [True: 86, False: 5.81k]
  ------------------
 3482|       |						/* Forward any errors to the
 3483|       |						 * caller. */
 3484|     86|						return lret;
 3485|  5.90k|				}
 3486|  5.90k|			}
 3487|       |
 3488|      0|			break;
 3489|    565|		} else {
 3490|       |			/* Skip current base block. In order to properly skip
 3491|       |			 * it, we really need to simply parse it and discard
 3492|       |			 * the results. */
 3493|       |
 3494|    565|			lret = skip_base_block(a);
 3495|    565|			if(lret == ARCHIVE_FATAL || lret == ARCHIVE_FAILED)
  ------------------
  |  |  239|  1.13k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              			if(lret == ARCHIVE_FATAL || lret == ARCHIVE_FAILED)
  ------------------
  |  |  237|    554|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3495:7): [True: 11, False: 554]
  |  Branch (3495:32): [True: 16, False: 538]
  ------------------
 3496|     27|				return lret;
 3497|       |
 3498|       |			/* The `skip_base_block` function tells us if we
 3499|       |			 * should continue with skipping, or we should stop
 3500|       |			 * skipping. We're trying to skip everything up to
 3501|       |			 * a base FILE block. */
 3502|       |
 3503|    538|			if(lret != ARCHIVE_RETRY) {
  ------------------
  |  |  234|    538|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (3503:7): [True: 98, False: 440]
  ------------------
 3504|       |				/* If there was an error during skipping, or we
 3505|       |				 * have just skipped a FILE base block... */
 3506|       |
 3507|     98|				if(rar->main.endarc == 0) {
  ------------------
  |  Branch (3507:8): [True: 65, False: 33]
  ------------------
 3508|     65|					return lret;
 3509|     65|				} else {
 3510|     33|					continue;
 3511|     33|				}
 3512|     98|			}
 3513|    538|		}
 3514|    651|	}
 3515|       |
 3516|      0|	return ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3517|    178|}
archive_read_support_format_rar5.c:skip_base_block:
 2479|  6.46k|static int skip_base_block(struct archive_read* a) {
 2480|  6.46k|	int ret;
 2481|  6.46k|	struct rar5* rar = get_context(a);
 2482|       |
 2483|       |	/* Create a new local archive_entry structure that will be operated on
 2484|       |	 * by header reader; operations on this archive_entry will be discarded.
 2485|       |	 */
 2486|  6.46k|	struct archive_entry* entry = archive_entry_new();
 2487|  6.46k|	ret = process_base_block(a, entry);
 2488|       |
 2489|       |	/* Discard operations on this archive_entry structure. */
 2490|  6.46k|	archive_entry_free(entry);
 2491|  6.46k|	if(ret == ARCHIVE_FATAL)
  ------------------
  |  |  239|  6.46k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2491:5): [True: 43, False: 6.42k]
  ------------------
 2492|     43|		return ret;
 2493|       |
 2494|  6.42k|	if(rar->generic.last_header_id == 2 && rar->generic.split_before > 0)
  ------------------
  |  Branch (2494:5): [True: 3.18k, False: 3.24k]
  |  Branch (2494:41): [True: 0, False: 3.18k]
  ------------------
 2495|      0|		return ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2496|       |
 2497|  6.42k|	if(ret == ARCHIVE_OK)
  ------------------
  |  |  233|  6.42k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2497:5): [True: 6.10k, False: 319]
  ------------------
 2498|  6.10k|		return ARCHIVE_RETRY;
  ------------------
  |  |  234|  6.10k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2499|    319|	else
 2500|    319|		return ret;
 2501|  6.42k|}
archive_read_support_format_rar5.c:update_crc:
 2628|  1.27k|static void update_crc(struct rar5* rar, const uint8_t* p, size_t to_read) {
 2629|  1.27k|    int verify_crc;
 2630|       |
 2631|  1.27k|	if(rar->skip_mode) {
  ------------------
  |  Branch (2631:5): [True: 5, False: 1.26k]
  ------------------
 2632|       |#if defined CHECK_CRC_ON_SOLID_SKIP
 2633|       |		verify_crc = 1;
 2634|       |#else
 2635|      5|		verify_crc = 0;
 2636|      5|#endif
 2637|      5|	} else
 2638|  1.26k|		verify_crc = 1;
 2639|       |
 2640|  1.27k|	if(verify_crc) {
  ------------------
  |  Branch (2640:5): [True: 1.26k, False: 5]
  ------------------
 2641|       |		/* Don't update CRC32 if the file doesn't have the
 2642|       |		 * `stored_crc32` info filled in. */
 2643|  1.26k|		if(rar->file.stored_crc32 > 0) {
  ------------------
  |  Branch (2643:6): [True: 26, False: 1.24k]
  ------------------
 2644|     26|			rar->file.calculated_crc32 =
 2645|     26|				crc32(rar->file.calculated_crc32, p, (unsigned int)to_read);
 2646|     26|		}
 2647|       |
 2648|       |		/* Check if the file uses an optional BLAKE2sp checksum
 2649|       |		 * algorithm. */
 2650|  1.26k|		if(rar->file.has_blake2 > 0) {
  ------------------
  |  Branch (2650:6): [True: 2, False: 1.26k]
  ------------------
 2651|       |			/* Return value of the `update` function is always 0,
 2652|       |			 * so we can explicitly ignore it here. */
 2653|      2|			(void) blake2sp_update(&rar->file.b2state, p, to_read);
 2654|      2|		}
 2655|  1.26k|	}
 2656|  1.27k|}
archive_read_support_format_rar5.c:uncompress_file:
 4035|  1.57k|static int uncompress_file(struct archive_read* a) {
 4036|  1.57k|	int ret;
 4037|       |
 4038|  1.57k|	while(1) {
  ------------------
  |  Branch (4038:8): [True: 1.57k, Folded]
  ------------------
 4039|       |		/* Sometimes the uncompression function will return a
 4040|       |		 * 'retry' signal. If this will happen, we have to retry
 4041|       |		 * the function. */
 4042|  1.57k|		ret = do_uncompress_file(a);
 4043|  1.57k|		if(ret != ARCHIVE_RETRY)
  ------------------
  |  |  234|  1.57k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (4043:6): [True: 1.57k, False: 0]
  ------------------
 4044|  1.57k|			return ret;
 4045|  1.57k|	}
 4046|  1.57k|}
archive_read_support_format_rar5.c:do_uncompress_file:
 3922|  1.57k|static int do_uncompress_file(struct archive_read* a) {
 3923|  1.57k|	struct rar5* rar = get_context(a);
 3924|  1.57k|	int ret;
 3925|  1.57k|	int64_t max_end_pos;
 3926|       |
 3927|  1.57k|	if(!rar->cstate.initialized) {
  ------------------
  |  Branch (3927:5): [True: 234, False: 1.34k]
  ------------------
 3928|       |		/* Don't perform full context reinitialization if we're
 3929|       |		 * processing a solid archive. */
 3930|    234|		if(!rar->main.solid || !rar->cstate.window_buf) {
  ------------------
  |  Branch (3930:6): [True: 131, False: 103]
  |  Branch (3930:26): [True: 12, False: 91]
  ------------------
 3931|    143|			if((ret = init_unpack(rar)) != ARCHIVE_OK)
  ------------------
  |  |  233|    143|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3931:7): [True: 0, False: 143]
  ------------------
 3932|      0|				return ret;
 3933|    143|		}
 3934|       |
 3935|    234|		rar->cstate.initialized = 1;
 3936|    234|	}
 3937|       |
 3938|       |	/* Don't allow extraction if window_size is invalid. */
 3939|  1.57k|	if(rar->cstate.window_size == 0) {
  ------------------
  |  Branch (3939:5): [True: 0, False: 1.57k]
  ------------------
 3940|      0|		archive_set_error(&a->archive,
 3941|      0|			ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3942|      0|			"Invalid window size declaration in this file");
 3943|       |
 3944|       |		/* This should never happen in valid files. */
 3945|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3946|      0|	}
 3947|       |
 3948|  1.57k|	if(rar->cstate.all_filters_applied == 1) {
  ------------------
  |  Branch (3948:5): [True: 1.57k, False: 0]
  ------------------
 3949|       |		/* We use while(1) here, but standard case allows for just 1
 3950|       |		 * iteration. The loop will iterate if process_block() didn't
 3951|       |		 * generate any data at all. This can happen if the block
 3952|       |		 * contains only filter definitions (this is common in big
 3953|       |		 * files). */
 3954|  2.08k|		while(1) {
  ------------------
  |  Branch (3954:9): [True: 2.08k, Folded]
  ------------------
 3955|  2.08k|			ret = process_block(a);
 3956|  2.08k|			if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  2.08k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3956:7): [True: 413, False: 1.66k]
  ------------------
 3957|    413|				return ret;
 3958|       |
 3959|  1.66k|			if(rar->cstate.last_write_ptr ==
  ------------------
  |  Branch (3959:7): [True: 509, False: 1.16k]
  ------------------
 3960|  1.66k|			    rar->cstate.write_ptr) {
 3961|       |				/* The block didn't generate any new data,
 3962|       |				 * so just process a new block if this one
 3963|       |				 * wasn't the last block in the file. */
 3964|    509|				if (bf_is_last_block(&rar->last_block_hdr)) {
  ------------------
  |  Branch (3964:9): [True: 3, False: 506]
  ------------------
 3965|      3|					return ARCHIVE_EOF;
  ------------------
  |  |  232|      3|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3966|      3|				}
 3967|       |
 3968|    506|				continue;
 3969|    509|			}
 3970|       |
 3971|       |			/* The block has generated some new data, so break
 3972|       |			 * the loop. */
 3973|  1.16k|			break;
 3974|  1.66k|		}
 3975|  1.57k|	}
 3976|       |
 3977|       |	/* Try to run filters. If filters won't be applied, it means that
 3978|       |	 * insufficient data was generated. */
 3979|  1.16k|	ret = apply_filters(a);
 3980|  1.16k|	if(ret == ARCHIVE_RETRY) {
  ------------------
  |  |  234|  1.16k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (3980:5): [True: 0, False: 1.16k]
  ------------------
 3981|      0|		return ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3982|  1.16k|	} else if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.16k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3982:12): [True: 0, False: 1.16k]
  ------------------
 3983|      0|		return ret;
 3984|      0|	}
 3985|       |
 3986|  1.16k|	if(cdeque_size(&rar->cstate.filters) > 0) {
  ------------------
  |  Branch (3986:5): [True: 0, False: 1.16k]
  ------------------
 3987|       |		/* Check if we can write something before hitting first
 3988|       |		 * filter. */
 3989|      0|		struct filter_info* flt;
 3990|       |
 3991|       |		/* Get the block_start offset from the first filter. */
 3992|      0|		if(CDE_OK != cdeque_front(&rar->cstate.filters,
  ------------------
  |  Branch (3992:6): [True: 0, False: 0]
  ------------------
 3993|      0|		    cdeque_filter_p(&flt)))
 3994|      0|		{
 3995|      0|			archive_set_error(&a->archive,
 3996|      0|			    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3997|      0|			    "Can't read first filter");
 3998|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3999|      0|		}
 4000|       |
 4001|      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]
  |  |  ------------------
  ------------------
 4002|      0|		    rar->cstate.write_ptr);
 4003|  1.16k|	} else {
 4004|       |		/* There are no filters defined, or all filters were applied.
 4005|       |		 * This means we can just store the data without any
 4006|       |		 * postprocessing. */
 4007|  1.16k|		max_end_pos = rar->cstate.write_ptr;
 4008|  1.16k|	}
 4009|       |
 4010|  1.16k|	if(max_end_pos == rar->cstate.last_write_ptr) {
  ------------------
  |  Branch (4010:5): [True: 0, False: 1.16k]
  ------------------
 4011|       |		/* We can't write anything yet. The block uncompression
 4012|       |		 * function did not generate enough data, and no filter can be
 4013|       |		 * applied. At the same time we don't have any data that can be
 4014|       |		 *  stored without filter postprocessing. This means we need to
 4015|       |		 *  wait for more data to be generated, so we can apply the
 4016|       |		 * filters.
 4017|       |		 *
 4018|       |		 * Signal the caller that we need more data to be able to do
 4019|       |		 * anything.
 4020|       |		 */
 4021|      0|		return ARCHIVE_RETRY;
  ------------------
  |  |  234|      0|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 4022|  1.16k|	} else {
 4023|       |		/* We can write the data before hitting the first filter.
 4024|       |		 * So let's do it. The push_window_data() function will
 4025|       |		 * effectively return the selected data block to the user
 4026|       |		 * application. */
 4027|  1.16k|		push_window_data(a, rar, rar->cstate.last_write_ptr,
 4028|  1.16k|		    max_end_pos);
 4029|  1.16k|		rar->cstate.last_write_ptr = max_end_pos;
 4030|  1.16k|	}
 4031|       |
 4032|  1.16k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.16k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4033|  1.16k|}
archive_read_support_format_rar5.c:init_unpack:
 2596|    143|static int init_unpack(struct rar5* rar) {
 2597|    143|	rar->file.calculated_crc32 = 0;
 2598|    143|	init_window_mask(rar);
 2599|       |
 2600|    143|	free(rar->cstate.window_buf);
 2601|    143|	free(rar->cstate.filtered_buf);
 2602|       |
 2603|    143|	rar->cstate.window_buf = NULL;
 2604|    143|	rar->cstate.filtered_buf = NULL;
 2605|       |
 2606|    143|	if(rar->cstate.window_size > 0) {
  ------------------
  |  Branch (2606:5): [True: 143, False: 0]
  ------------------
 2607|    143|		rar->cstate.window_buf = calloc(1, rar->cstate.window_size);
 2608|    143|		if(rar->cstate.window_buf == NULL)
  ------------------
  |  Branch (2608:6): [True: 0, False: 143]
  ------------------
 2609|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2610|    143|		rar->cstate.filtered_buf = calloc(1, rar->cstate.window_size);
 2611|    143|		if(rar->cstate.filtered_buf == NULL)
  ------------------
  |  Branch (2611:6): [True: 0, False: 143]
  ------------------
 2612|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2613|    143|	}
 2614|       |
 2615|    143|	clear_data_ready_stack(rar);
 2616|       |
 2617|    143|	rar->cstate.write_ptr = 0;
 2618|    143|	rar->cstate.last_write_ptr = 0;
 2619|       |
 2620|    143|	memset(&rar->cstate.bd, 0, sizeof(rar->cstate.bd));
 2621|    143|	memset(&rar->cstate.ld, 0, sizeof(rar->cstate.ld));
 2622|    143|	memset(&rar->cstate.dd, 0, sizeof(rar->cstate.dd));
 2623|    143|	memset(&rar->cstate.ldd, 0, sizeof(rar->cstate.ldd));
 2624|    143|	memset(&rar->cstate.rd, 0, sizeof(rar->cstate.rd));
 2625|    143|	return ARCHIVE_OK;
  ------------------
  |  |  233|    143|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2626|    143|}
archive_read_support_format_rar5.c:process_block:
 3643|  2.08k|static int process_block(struct archive_read* a) {
 3644|  2.08k|	const uint8_t* p;
 3645|  2.08k|	struct rar5* rar = get_context(a);
 3646|  2.08k|	int ret;
 3647|       |
 3648|       |	/* If we don't have any data to be processed, this most probably means
 3649|       |	 * we need to switch to the next volume. */
 3650|  2.08k|	if(rar->main.volume && rar->file.bytes_remaining == 0) {
  ------------------
  |  Branch (3650:5): [True: 1.29k, False: 792]
  |  Branch (3650:25): [True: 24, False: 1.26k]
  ------------------
 3651|     24|		ret = advance_multivolume(a);
 3652|     24|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|     24|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3652:6): [True: 24, False: 0]
  ------------------
 3653|     24|			return ret;
 3654|     24|	}
 3655|       |
 3656|  2.05k|	if(rar->cstate.block_parsing_finished) {
  ------------------
  |  Branch (3656:5): [True: 1.70k, False: 354]
  ------------------
 3657|  1.70k|		ssize_t block_size;
 3658|  1.70k|		ssize_t to_skip;
 3659|  1.70k|		ssize_t cur_block_size;
 3660|       |
 3661|       |		/* The header size won't be bigger than 6 bytes. */
 3662|  1.70k|		if(!read_ahead(a, 6, &p)) {
  ------------------
  |  Branch (3662:6): [True: 3, False: 1.70k]
  ------------------
 3663|       |			/* Failed to prefetch data block header. */
 3664|      3|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      3|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3665|      3|		}
 3666|       |
 3667|       |		/*
 3668|       |		 * Read block_size by parsing block header. Validate the header
 3669|       |		 * by calculating CRC byte stored inside the header. Size of
 3670|       |		 * the header is not constant (block size can be stored either
 3671|       |		 * in 1 or 2 bytes), that's why block size is left out from the
 3672|       |		 * `compressed_block_header` structure and returned by
 3673|       |		 * `parse_block_header` as the second argument. */
 3674|       |
 3675|  1.70k|		ret = parse_block_header(a, p, &block_size,
 3676|  1.70k|		    &rar->last_block_hdr);
 3677|  1.70k|		if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.70k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3677:6): [True: 28, False: 1.67k]
  ------------------
 3678|     28|			return ret;
 3679|     28|		}
 3680|       |
 3681|       |		/* Skip block header. Next data is huffman tables,
 3682|       |		 * if present. */
 3683|  1.67k|		to_skip = sizeof(struct compressed_block_header) +
 3684|  1.67k|			bf_byte_count(&rar->last_block_hdr) + 1;
 3685|       |
 3686|       |		/* If the block header's to_skip value exceeds the declared
 3687|       |		 * remaining data, the archive is malformed. */
 3688|  1.67k|		if(to_skip > rar->file.bytes_remaining) {
  ------------------
  |  Branch (3688:6): [True: 3, False: 1.67k]
  ------------------
 3689|      3|			archive_set_error(&a->archive,
 3690|      3|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3691|      3|			    "Block header size exceeds remaining file data");
 3692|      3|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3693|      3|		}
 3694|       |
 3695|  1.67k|		if(ARCHIVE_OK != consume(a, to_skip))
  ------------------
  |  |  233|  1.67k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3695:6): [True: 0, False: 1.67k]
  ------------------
 3696|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3697|       |
 3698|  1.67k|		rar->file.bytes_remaining -= to_skip;
 3699|       |
 3700|       |		/* The block size gives information about the whole block size,
 3701|       |		 * but the block could be stored in split form when using
 3702|       |		 * multi-volume archives. In this case, the block size will be
 3703|       |		 * bigger than the actual data stored in this file. Remaining
 3704|       |		 * part of the data will be in another file. */
 3705|       |
 3706|  1.67k|		cur_block_size =
 3707|  1.67k|			rar5_min(rar->file.bytes_remaining, block_size);
  ------------------
  |  |   61|  1.67k|#define rar5_min(a, b) (((a) > (b)) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (61:25): [True: 1.51k, False: 153]
  |  |  ------------------
  ------------------
 3708|       |
 3709|  1.67k|		if(block_size > rar->file.bytes_remaining) {
  ------------------
  |  Branch (3709:6): [True: 56, False: 1.61k]
  ------------------
 3710|       |			/* If current blocks' size is bigger than our data
 3711|       |			 * size, this means we have a multivolume archive.
 3712|       |			 * In this case, skip all base headers until the end
 3713|       |			 * of the file, proceed to next "partXXX.rar" volume,
 3714|       |			 * find its signature, skip all headers up to the first
 3715|       |			 * FILE base header, and continue from there.
 3716|       |			 *
 3717|       |			 * Note that `merge_block` will update the `rar`
 3718|       |			 * context structure quite extensively. */
 3719|       |
 3720|     56|			ret = merge_block(a, block_size, &p);
 3721|     56|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|     56|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3721:7): [True: 56, False: 0]
  ------------------
 3722|     56|				return ret;
 3723|     56|			}
 3724|       |
 3725|      0|			cur_block_size = block_size;
 3726|       |
 3727|       |			/* Current stream pointer should be now directly
 3728|       |			 * *after* the block that spanned through multiple
 3729|       |			 * archive files. `p` pointer should have the data of
 3730|       |			 * the *whole* block (merged from partial blocks
 3731|       |			 * stored in multiple archives files). */
 3732|  1.61k|		} else {
 3733|  1.61k|			rar->cstate.switch_multivolume = 0;
 3734|       |
 3735|       |			/* Read the whole block size into memory. This can take
 3736|       |			 * up to  8 megabytes of memory in theoretical cases.
 3737|       |			 * Might be worth to optimize this and use a standard
 3738|       |			 * chunk of 4kb's. */
 3739|  1.61k|			if(!read_ahead(a, 4 + cur_block_size, &p)) {
  ------------------
  |  Branch (3739:7): [True: 226, False: 1.38k]
  ------------------
 3740|       |				/* Failed to prefetch block data. */
 3741|    226|				return ARCHIVE_EOF;
  ------------------
  |  |  232|    226|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3742|    226|			}
 3743|  1.61k|		}
 3744|       |
 3745|  1.38k|		rar->cstate.block_buf = p;
 3746|  1.38k|		rar->cstate.cur_block_size = cur_block_size;
 3747|  1.38k|		rar->cstate.block_parsing_finished = 0;
 3748|       |
 3749|  1.38k|		rar->bits.in_addr = 0;
 3750|  1.38k|		rar->bits.bit_addr = 0;
 3751|       |
 3752|  1.38k|		if(bf_is_table_present(&rar->last_block_hdr)) {
  ------------------
  |  Branch (3752:6): [True: 147, False: 1.24k]
  ------------------
 3753|       |			/* Load Huffman tables. */
 3754|    147|			ret = parse_tables(a, rar, p);
 3755|    147|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|    147|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3755:7): [True: 73, False: 74]
  ------------------
 3756|       |				/* Error during decompression of Huffman
 3757|       |				 * tables. */
 3758|     73|				return ret;
 3759|     73|			}
 3760|    147|		}
 3761|  1.38k|	} else {
 3762|       |		/* Block parsing not finished, reuse previous memory buffer. */
 3763|    354|		p = rar->cstate.block_buf;
 3764|    354|	}
 3765|       |
 3766|       |	/* Uncompress the block, or a part of it, depending on how many bytes
 3767|       |	 * will be generated by uncompressing the block.
 3768|       |	 *
 3769|       |	 * In case too many bytes will be generated, calling this function
 3770|       |	 * again will resume the uncompression operation. */
 3771|  1.66k|	ret = do_uncompress_block(a, p);
 3772|  1.66k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.66k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3772:5): [True: 0, False: 1.66k]
  ------------------
 3773|      0|		return ret;
 3774|      0|	}
 3775|       |
 3776|  1.66k|	if(rar->cstate.block_parsing_finished &&
  ------------------
  |  Branch (3776:5): [True: 1.33k, False: 331]
  ------------------
 3777|  1.33k|	    rar->cstate.switch_multivolume == 0 &&
  ------------------
  |  Branch (3777:6): [True: 1.33k, False: 0]
  ------------------
 3778|  1.33k|	    rar->cstate.cur_block_size > 0)
  ------------------
  |  Branch (3778:6): [True: 829, False: 509]
  ------------------
 3779|    829|	{
 3780|       |		/* If we're processing a normal block, consume the whole
 3781|       |		 * block. We can do this because we've already read the whole
 3782|       |		 * block to memory. */
 3783|    829|		if(ARCHIVE_OK != consume(a, rar->cstate.cur_block_size))
  ------------------
  |  |  233|    829|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3783:6): [True: 0, False: 829]
  ------------------
 3784|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3785|       |
 3786|    829|		rar->file.bytes_remaining -= rar->cstate.cur_block_size;
 3787|    840|	} else if(rar->cstate.switch_multivolume) {
  ------------------
  |  Branch (3787:12): [True: 0, False: 840]
  ------------------
 3788|       |		/* Don't consume the block if we're doing multivolume
 3789|       |		 * processing. The volume switching function will consume
 3790|       |		 * the proper count of bytes instead. */
 3791|      0|		rar->cstate.switch_multivolume = 0;
 3792|      0|	}
 3793|       |
 3794|  1.66k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.66k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3795|  1.66k|}
archive_read_support_format_rar5.c:parse_block_header:
 2953|  1.70k|{
 2954|  1.70k|	uint8_t calculated_cksum;
 2955|  1.70k|	memcpy(hdr, p, sizeof(struct compressed_block_header));
 2956|       |
 2957|  1.70k|	if(bf_byte_count(hdr) > 2) {
  ------------------
  |  Branch (2957:5): [True: 28, False: 1.67k]
  ------------------
 2958|     28|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     28|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2959|     28|		    "Unsupported block header size (was %d, max is 2)",
 2960|     28|		    bf_byte_count(hdr));
 2961|     28|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|     28|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2962|     28|	}
 2963|       |
 2964|       |	/* This should probably use bit reader interface in order to be more
 2965|       |	 * future-proof. */
 2966|  1.67k|	*block_size = 0;
 2967|  1.67k|	switch(bf_byte_count(hdr)) {
 2968|       |		/* 1-byte block size */
 2969|  1.42k|		case 0:
  ------------------
  |  Branch (2969:3): [True: 1.42k, False: 249]
  ------------------
 2970|  1.42k|			*block_size = *(const uint8_t*) &p[2];
 2971|  1.42k|			break;
 2972|       |
 2973|       |		/* 2-byte block size */
 2974|    194|		case 1:
  ------------------
  |  Branch (2974:3): [True: 194, False: 1.47k]
  ------------------
 2975|    194|			*block_size = archive_le16dec(&p[2]);
 2976|    194|			break;
 2977|       |
 2978|       |		/* 3-byte block size */
 2979|     55|		case 2:
  ------------------
  |  Branch (2979:3): [True: 55, False: 1.61k]
  ------------------
 2980|     55|			*block_size = archive_le32dec(&p[2]);
 2981|     55|			*block_size &= 0x00FFFFFF;
 2982|     55|			break;
 2983|       |
 2984|       |		/* Other block sizes are not supported. This case is not
 2985|       |		 * reached, because we have an 'if' guard before the switch
 2986|       |		 * that makes sure of it. */
 2987|      0|		default:
  ------------------
  |  Branch (2987:3): [True: 0, False: 1.67k]
  ------------------
 2988|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2989|  1.67k|	}
 2990|       |
 2991|       |	/* Verify the block header checksum. 0x5A is a magic value and is
 2992|       |	 * always * constant. */
 2993|  1.67k|	calculated_cksum = 0x5A
 2994|  1.67k|	    ^ (uint8_t) hdr->block_flags_u8
 2995|  1.67k|	    ^ (uint8_t) *block_size
 2996|  1.67k|	    ^ (uint8_t) (*block_size >> 8)
 2997|  1.67k|	    ^ (uint8_t) (*block_size >> 16);
 2998|       |
 2999|  1.67k|	if(calculated_cksum != hdr->block_cksum) {
  ------------------
  |  Branch (2999:5): [True: 1.54k, False: 126]
  ------------------
 3000|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 3001|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 3002|       |		    "Block checksum error: got 0x%x, expected 0x%x",
 3003|       |		    hdr->block_cksum, calculated_cksum);
 3004|       |
 3005|       |		return ARCHIVE_FAILED;
 3006|       |#endif
 3007|  1.54k|	}
 3008|       |
 3009|  1.67k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.67k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3010|  1.67k|}
archive_read_support_format_rar5.c:bf_byte_count:
  505|  5.07k|uint8_t bf_byte_count(const struct compressed_block_header* hdr) {
  506|  5.07k|	return (hdr->block_flags_u8 >> 3) & 7;
  507|  5.07k|}
archive_read_support_format_rar5.c:merge_block:
 3525|     56|{
 3526|     56|	struct rar5* rar = get_context(a);
 3527|     56|	ssize_t cur_block_size, partial_offset = 0;
 3528|     56|	const uint8_t* lp;
 3529|     56|	int ret;
 3530|       |
 3531|     56|	if(rar->merge_mode) {
  ------------------
  |  Branch (3531:5): [True: 0, False: 56]
  ------------------
 3532|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3533|      0|		    "Recursive merge is not allowed");
 3534|       |
 3535|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3536|      0|	}
 3537|       |
 3538|       |	/* Set a flag that we're in the switching mode. */
 3539|     56|	rar->cstate.switch_multivolume = 1;
 3540|       |
 3541|       |	/* Reallocate the memory which will hold the whole block. */
 3542|     56|	if(rar->vol.push_buf)
  ------------------
  |  Branch (3542:5): [True: 1, False: 55]
  ------------------
 3543|      1|		free((void*) rar->vol.push_buf);
 3544|       |
 3545|       |	/* Increasing the allocation block by 8 is due to bit reading functions,
 3546|       |	 * which are using additional 2 or 4 bytes. Allocating the block size
 3547|       |	 * by exact value would make bit reader perform reads from invalid
 3548|       |	 * memory block when reading the last byte from the buffer. */
 3549|     56|	rar->vol.push_buf = malloc(block_size + 8);
 3550|     56|	if(!rar->vol.push_buf) {
  ------------------
  |  Branch (3550:5): [True: 0, False: 56]
  ------------------
 3551|      0|		archive_set_error(&a->archive, ENOMEM,
 3552|      0|		    "Can't allocate memory for a merge block buffer");
 3553|      0|		rar->cstate.switch_multivolume = 0;
 3554|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3555|      0|	}
 3556|       |
 3557|       |	/* Valgrind complains if the extension block for bit reader is not
 3558|       |	 * initialized, so initialize it. */
 3559|     56|	memset(&rar->vol.push_buf[block_size], 0, 8);
 3560|       |
 3561|       |	/* A single block can span across multiple multivolume archive files,
 3562|       |	 * so we use a loop here. This loop will consume enough multivolume
 3563|       |	 * archive files until the whole block is read. */
 3564|       |
 3565|     56|	while(1) {
  ------------------
  |  Branch (3565:8): [True: 56, Folded]
  ------------------
 3566|       |		/* Get the size of current block chunk in this multivolume
 3567|       |		 * archive file and read it. */
 3568|     56|		cur_block_size = rar5_min(rar->file.bytes_remaining,
  ------------------
  |  |   61|     56|#define rar5_min(a, b) (((a) > (b)) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (61:25): [True: 0, False: 56]
  |  |  ------------------
  ------------------
 3569|     56|		    block_size - partial_offset);
 3570|       |
 3571|     56|		if(cur_block_size < 1) {
  ------------------
  |  Branch (3571:6): [True: 0, False: 56]
  ------------------
 3572|       |			/* bytes_remaining is less than 1 at the wrong point in
 3573|       |			 * the merge loop, indicating corrupt volume
 3574|       |			 * accounting. */
 3575|      0|			archive_set_error(&a->archive,
 3576|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3577|      0|			    "Encountered invalid block size during block merge");
 3578|      0|			rar->cstate.switch_multivolume = 0;
 3579|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3580|      0|		}
 3581|       |
 3582|     56|		if(!read_ahead(a, cur_block_size, &lp)) {
  ------------------
  |  Branch (3582:6): [True: 0, False: 56]
  ------------------
 3583|      0|			rar->cstate.switch_multivolume = 0;
 3584|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3585|      0|		}
 3586|       |
 3587|       |		/* Sanity check; there should never be a situation where this
 3588|       |		 * function reads more data than the block's size. */
 3589|     56|		if(partial_offset + cur_block_size > block_size) {
  ------------------
  |  Branch (3589:6): [True: 0, False: 56]
  ------------------
 3590|      0|			archive_set_error(&a->archive,
 3591|      0|			    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3592|      0|			    "Consumed too much data when merging blocks");
 3593|      0|			rar->cstate.switch_multivolume = 0;
 3594|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3595|      0|		}
 3596|       |
 3597|       |		/* Merge previous block chunk with current block chunk,
 3598|       |		 * or create first block chunk if this is our first
 3599|       |		 * iteration. */
 3600|     56|		memcpy(&rar->vol.push_buf[partial_offset], lp, cur_block_size);
 3601|       |
 3602|       |		/* Advance the stream read pointer by this block chunk size. */
 3603|     56|		if(ARCHIVE_OK != consume(a, cur_block_size)) {
  ------------------
  |  |  233|     56|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3603:6): [True: 0, False: 56]
  ------------------
 3604|       |			/* Data was copied but stream pointer didn't advance;
 3605|       |			 * stream position is unrecoverable. */
 3606|      0|			rar->cstate.switch_multivolume = 0;
 3607|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3608|      0|		}
 3609|       |
 3610|       |		/* Update the pointers. `partial_offset` contains information
 3611|       |		 * about the sum of merged block chunks. */
 3612|     56|		partial_offset += cur_block_size;
 3613|     56|		rar->file.bytes_remaining -= cur_block_size;
 3614|       |
 3615|       |		/* If `partial_offset` is the same as `block_size`, this means
 3616|       |		 * we've merged all block chunks and we have a valid full
 3617|       |		 * block. */
 3618|     56|		if(partial_offset == block_size) {
  ------------------
  |  Branch (3618:6): [True: 0, False: 56]
  ------------------
 3619|      0|			break;
 3620|      0|		}
 3621|       |
 3622|       |		/* If we don't have any bytes to read, this means we should
 3623|       |		 * switch to another multivolume archive file. */
 3624|     56|		if(rar->file.bytes_remaining == 0) {
  ------------------
  |  Branch (3624:6): [True: 56, False: 0]
  ------------------
 3625|     56|			rar->merge_mode++;
 3626|     56|			ret = advance_multivolume(a);
 3627|     56|			rar->merge_mode--;
 3628|     56|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|     56|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3628:7): [True: 56, False: 0]
  ------------------
 3629|     56|				rar->cstate.switch_multivolume = 0;
 3630|     56|				return ret;
 3631|     56|			}
 3632|     56|		}
 3633|     56|	}
 3634|       |
 3635|      0|	*p = rar->vol.push_buf;
 3636|       |
 3637|       |	/* If we're here, we can resume unpacking by processing the block
 3638|       |	 * pointed to by the `*p` memory pointer. */
 3639|       |
 3640|      0|	return ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3641|     56|}
archive_read_support_format_rar5.c:bf_is_table_present:
  510|  1.38k|uint8_t bf_is_table_present(const struct compressed_block_header* hdr) {
  511|  1.38k|	return (hdr->block_flags_u8 >> 7) & 1;
  512|  1.38k|}
archive_read_support_format_rar5.c:parse_tables:
 2780|    147|{
 2781|    147|	int ret, value, i, w, idx = 0;
 2782|    147|	uint8_t bit_length[HUFF_BC],
 2783|    147|		table[HUFF_TABLE_SIZE],
 2784|    147|		nibble_mask = 0xF0,
 2785|    147|		nibble_shift = 4;
 2786|       |
 2787|    147|	enum { ESCAPE = 15 };
 2788|       |
 2789|       |	/* The data for table generation is compressed using a simple RLE-like
 2790|       |	 * algorithm when storing zeroes, so we need to unpack it first. */
 2791|  2.00k|	for(w = 0, i = 0; w < HUFF_BC;) {
  ------------------
  |  |  250|  2.00k|#define HUFF_BC 20
  ------------------
  |  Branch (2791:20): [True: 1.85k, False: 147]
  ------------------
 2792|  1.85k|		if(i >= rar->cstate.cur_block_size) {
  ------------------
  |  Branch (2792:6): [True: 0, False: 1.85k]
  ------------------
 2793|       |			/* Truncated data, can't continue. */
 2794|      0|			archive_set_error(&a->archive,
 2795|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2796|      0|			    "Truncated data in huffman tables");
 2797|      0|			return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2798|      0|		}
 2799|       |
 2800|  1.85k|		value = (p[i] & nibble_mask) >> nibble_shift;
 2801|       |
 2802|  1.85k|		if(nibble_mask == 0x0F)
  ------------------
  |  Branch (2802:6): [True: 912, False: 941]
  ------------------
 2803|    912|			++i;
 2804|       |
 2805|  1.85k|		nibble_mask ^= 0xFF;
 2806|  1.85k|		nibble_shift ^= 4;
 2807|       |
 2808|       |		/* Values smaller than 15 is data, so we write it directly.
 2809|       |		 * Value 15 is a flag telling us that we need to unpack more
 2810|       |		 * bytes. */
 2811|  1.85k|		if(value == ESCAPE) {
  ------------------
  |  Branch (2811:6): [True: 124, False: 1.72k]
  ------------------
 2812|    124|			value = (p[i] & nibble_mask) >> nibble_shift;
 2813|    124|			if(nibble_mask == 0x0F)
  ------------------
  |  Branch (2813:7): [True: 30, False: 94]
  ------------------
 2814|     30|				++i;
 2815|    124|			nibble_mask ^= 0xFF;
 2816|    124|			nibble_shift ^= 4;
 2817|       |
 2818|    124|			if(value == 0) {
  ------------------
  |  Branch (2818:7): [True: 0, False: 124]
  ------------------
 2819|       |				/* We sometimes need to write the actual value
 2820|       |				 * of 15, so this case handles that. */
 2821|      0|				bit_length[w++] = ESCAPE;
 2822|    124|			} else {
 2823|    124|				int k;
 2824|       |
 2825|       |				/* Fill zeroes. */
 2826|  1.33k|				for(k = 0; (k < value + 2) && (w < HUFF_BC);
  ------------------
  |  |  250|  1.24k|#define HUFF_BC 20
  ------------------
  |  Branch (2826:16): [True: 1.24k, False: 95]
  |  Branch (2826:35): [True: 1.21k, False: 29]
  ------------------
 2827|  1.21k|				    k++) {
 2828|  1.21k|					bit_length[w++] = 0;
 2829|  1.21k|				}
 2830|    124|			}
 2831|  1.72k|		} else {
 2832|  1.72k|			bit_length[w++] = value;
 2833|  1.72k|		}
 2834|  1.85k|	}
 2835|       |
 2836|    147|	rar->bits.in_addr = i;
 2837|    147|	rar->bits.bit_addr = nibble_shift ^ 4;
 2838|       |
 2839|    147|	ret = create_decode_tables(bit_length, &rar->cstate.bd, HUFF_BC);
  ------------------
  |  |  250|    147|#define HUFF_BC 20
  ------------------
 2840|    147|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|    147|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2840:5): [True: 50, False: 97]
  ------------------
 2841|     50|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     50|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2842|     50|		    "Decoding huffman tables failed");
 2843|     50|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|     50|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2844|     50|	}
 2845|       |
 2846|  7.40k|	for(i = 0; i < HUFF_TABLE_SIZE;) {
  ------------------
  |  |  260|  7.40k|#define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  252|  7.40k|#define HUFF_NC 306
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  254|  7.40k|#define HUFF_DC 64
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  258|  7.40k|#define HUFF_RC 44
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  256|  7.40k|#define HUFF_LDC 16
  |  |  ------------------
  ------------------
  |  Branch (2846:13): [True: 7.30k, False: 97]
  ------------------
 2847|  7.30k|		uint16_t num;
 2848|       |
 2849|  7.30k|		ret = decode_number(a, &rar->cstate.bd, p, &num);
 2850|  7.30k|		if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  7.30k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2850:6): [True: 0, False: 7.30k]
  ------------------
 2851|      0|			archive_set_error(&a->archive,
 2852|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2853|      0|			    "Decoding huffman tables failed");
 2854|      0|			return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2855|      0|		}
 2856|       |
 2857|  7.30k|		if(num < 16) {
  ------------------
  |  Branch (2857:6): [True: 5.95k, False: 1.35k]
  ------------------
 2858|       |			/* 0..15: store directly */
 2859|  5.95k|			table[i] = (uint8_t) num;
 2860|  5.95k|			i++;
 2861|  5.95k|		} else if(num < 18) {
  ------------------
  |  Branch (2861:13): [True: 10, False: 1.34k]
  ------------------
 2862|       |			/* 16..17: repeat previous code */
 2863|     10|			uint16_t n;
 2864|       |
 2865|     10|			if(ARCHIVE_OK != (ret = read_bits_16(a, rar, p, &n)))
  ------------------
  |  |  233|     10|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2865:7): [True: 0, False: 10]
  ------------------
 2866|      0|				return ret;
 2867|       |
 2868|     10|			if(num == 16) {
  ------------------
  |  Branch (2868:7): [True: 8, False: 2]
  ------------------
 2869|      8|				n >>= 13;
 2870|      8|				n += 3;
 2871|      8|				skip_bits(rar, 3);
 2872|      8|			} else {
 2873|      2|				n >>= 9;
 2874|      2|				n += 11;
 2875|      2|				skip_bits(rar, 7);
 2876|      2|			}
 2877|       |
 2878|     10|			if(i > 0) {
  ------------------
  |  Branch (2878:7): [True: 10, False: 0]
  ------------------
 2879|    180|				while(n-- > 0 && i < HUFF_TABLE_SIZE) {
  ------------------
  |  |  260|    170|#define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  252|    170|#define HUFF_NC 306
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  254|    170|#define HUFF_DC 64
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  258|    170|#define HUFF_RC 44
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  256|    170|#define HUFF_LDC 16
  |  |  ------------------
  ------------------
  |  Branch (2879:11): [True: 170, False: 10]
  |  Branch (2879:22): [True: 170, False: 0]
  ------------------
 2880|    170|					table[i] = table[i - 1];
 2881|    170|					i++;
 2882|    170|				}
 2883|     10|			} else {
 2884|      0|				archive_set_error(&a->archive,
 2885|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2886|      0|				    "Unexpected error when decoding "
 2887|      0|				    "huffman tables");
 2888|      0|				return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2889|      0|			}
 2890|  1.34k|		} else {
 2891|       |			/* other codes: fill with zeroes `n` times */
 2892|  1.34k|			uint16_t n;
 2893|       |
 2894|  1.34k|			if(ARCHIVE_OK != (ret = read_bits_16(a, rar, p, &n)))
  ------------------
  |  |  233|  1.34k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2894:7): [True: 0, False: 1.34k]
  ------------------
 2895|      0|				return ret;
 2896|       |
 2897|  1.34k|			if(num == 18) {
  ------------------
  |  Branch (2897:7): [True: 864, False: 480]
  ------------------
 2898|    864|				n >>= 13;
 2899|    864|				n += 3;
 2900|    864|				skip_bits(rar, 3);
 2901|    864|			} else {
 2902|    480|				n >>= 9;
 2903|    480|				n += 11;
 2904|    480|				skip_bits(rar, 7);
 2905|    480|			}
 2906|       |
 2907|  36.9k|			while(n-- > 0 && i < HUFF_TABLE_SIZE)
  ------------------
  |  |  260|  35.6k|#define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  252|  35.6k|#define HUFF_NC 306
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  254|  35.6k|#define HUFF_DC 64
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  258|  35.6k|#define HUFF_RC 44
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  256|  35.6k|#define HUFF_LDC 16
  |  |  ------------------
  ------------------
  |  Branch (2907:10): [True: 35.6k, False: 1.25k]
  |  Branch (2907:21): [True: 35.5k, False: 91]
  ------------------
 2908|  35.5k|				table[i++] = 0;
 2909|  1.34k|		}
 2910|  7.30k|	}
 2911|       |
 2912|     97|	ret = create_decode_tables(&table[idx], &rar->cstate.ld, HUFF_NC);
  ------------------
  |  |  252|     97|#define HUFF_NC 306
  ------------------
 2913|     97|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|     97|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2913:5): [True: 21, False: 76]
  ------------------
 2914|     21|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     21|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2915|     21|		     "Failed to create literal table");
 2916|     21|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|     21|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2917|     21|	}
 2918|       |
 2919|     76|	idx += HUFF_NC;
  ------------------
  |  |  252|     76|#define HUFF_NC 306
  ------------------
 2920|       |
 2921|     76|	ret = create_decode_tables(&table[idx], &rar->cstate.dd, HUFF_DC);
  ------------------
  |  |  254|     76|#define HUFF_DC 64
  ------------------
 2922|     76|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|     76|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2922:5): [True: 2, False: 74]
  ------------------
 2923|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2924|      2|		    "Failed to create distance table");
 2925|      2|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      2|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2926|      2|	}
 2927|       |
 2928|     74|	idx += HUFF_DC;
  ------------------
  |  |  254|     74|#define HUFF_DC 64
  ------------------
 2929|       |
 2930|     74|	ret = create_decode_tables(&table[idx], &rar->cstate.ldd, HUFF_LDC);
  ------------------
  |  |  256|     74|#define HUFF_LDC 16
  ------------------
 2931|     74|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|     74|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2931:5): [True: 0, False: 74]
  ------------------
 2932|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2933|      0|		    "Failed to create lower bits of distances table");
 2934|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2935|      0|	}
 2936|       |
 2937|     74|	idx += HUFF_LDC;
  ------------------
  |  |  256|     74|#define HUFF_LDC 16
  ------------------
 2938|       |
 2939|     74|	ret = create_decode_tables(&table[idx], &rar->cstate.rd, HUFF_RC);
  ------------------
  |  |  258|     74|#define HUFF_RC 44
  ------------------
 2940|     74|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|     74|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2940:5): [True: 0, False: 74]
  ------------------
 2941|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2942|      0|		    "Failed to create repeating distances table");
 2943|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2944|      0|	}
 2945|       |
 2946|     74|	return ARCHIVE_OK;
  ------------------
  |  |  233|     74|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2947|     74|}
archive_read_support_format_rar5.c:create_decode_tables:
 2660|    468|{
 2661|    468|	int code, upper_limit = 0, i, lc[16];
 2662|    468|	uint32_t decode_pos_clone[rar5_countof(table->decode_pos)];
 2663|    468|	ssize_t cur_len, quick_data_size;
 2664|       |
 2665|    468|	memset(&lc, 0, sizeof(lc));
 2666|    468|	memset(table->decode_num, 0, sizeof(table->decode_num));
 2667|    468|	table->size = size;
 2668|    468|	table->quick_bits = size == HUFF_NC ? 10 : 7;
  ------------------
  |  |  252|    468|#define HUFF_NC 306
  ------------------
  |  Branch (2668:22): [True: 97, False: 371]
  ------------------
 2669|       |
 2670|  42.3k|	for(i = 0; i < size; i++) {
  ------------------
  |  Branch (2670:13): [True: 41.9k, False: 468]
  ------------------
 2671|  41.9k|		lc[bit_length[i] & 15]++;
 2672|  41.9k|	}
 2673|       |
 2674|    468|	lc[0] = 0;
 2675|    468|	table->decode_pos[0] = 0;
 2676|    468|	table->decode_len[0] = 0;
 2677|       |
 2678|  7.48k|	for(i = 1; i < 16; i++) {
  ------------------
  |  Branch (2678:13): [True: 7.02k, False: 468]
  ------------------
 2679|  7.02k|		upper_limit += lc[i];
 2680|       |
 2681|  7.02k|		table->decode_len[i] = upper_limit << (16 - i);
 2682|  7.02k|		table->decode_pos[i] = table->decode_pos[i - 1] + lc[i - 1];
 2683|       |
 2684|  7.02k|		upper_limit <<= 1;
 2685|  7.02k|	}
 2686|       |
 2687|       |	/* Verify the code-length distribution is not over-subscribed.
 2688|       |	 * After the loop above, upper_limit == sum(lc[i] * 2^(16-i)).
 2689|       |	 * For a valid prefix-free code this must be <= 2^16 = 65536.
 2690|       |	 * An over-subscribed table (> 65536) cannot produce a valid
 2691|       |	 * decode table and must be rejected. */
 2692|    468|	if(upper_limit > 65536) {
  ------------------
  |  Branch (2692:5): [True: 73, False: 395]
  ------------------
 2693|     73|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|     73|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2694|     73|	}
 2695|       |
 2696|    395|	memcpy(decode_pos_clone, table->decode_pos, sizeof(decode_pos_clone));
 2697|       |
 2698|  34.7k|	for(i = 0; i < size; i++) {
  ------------------
  |  Branch (2698:13): [True: 34.3k, False: 395]
  ------------------
 2699|  34.3k|		uint8_t clen = bit_length[i] & 15;
 2700|  34.3k|		if(clen > 0) {
  ------------------
  |  Branch (2700:6): [True: 3.93k, False: 30.4k]
  ------------------
 2701|  3.93k|			int last_pos = decode_pos_clone[clen];
 2702|  3.93k|			table->decode_num[last_pos] = i;
 2703|  3.93k|			decode_pos_clone[clen]++;
 2704|  3.93k|		}
 2705|  34.3k|	}
 2706|       |
 2707|    395|	quick_data_size = (int64_t)1 << table->quick_bits;
 2708|    395|	cur_len = 1;
 2709|   119k|	for(code = 0; code < quick_data_size; code++) {
  ------------------
  |  Branch (2709:16): [True: 118k, False: 395]
  ------------------
 2710|   118k|		int bit_field = code << (16 - table->quick_bits);
 2711|   118k|		int dist, pos;
 2712|       |
 2713|   124k|		while(cur_len < rar5_countof(table->decode_len) &&
  ------------------
  |  |   63|   249k|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (2713:9): [True: 61.4k, False: 63.1k]
  ------------------
 2714|  61.4k|				bit_field >= table->decode_len[cur_len]) {
  ------------------
  |  Branch (2714:5): [True: 5.92k, False: 55.4k]
  ------------------
 2715|  5.92k|			cur_len++;
 2716|  5.92k|		}
 2717|       |
 2718|   118k|		table->quick_len[code] = (uint8_t) cur_len;
 2719|       |
 2720|   118k|		dist = bit_field - table->decode_len[cur_len - 1];
 2721|   118k|		dist >>= (16 - cur_len);
 2722|       |
 2723|   118k|		pos = table->decode_pos[cur_len & 15] + dist;
 2724|   118k|		if(cur_len < rar5_countof(table->decode_pos) && pos < size) {
  ------------------
  |  |   63|   237k|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (2724:6): [True: 55.4k, False: 63.1k]
  |  Branch (2724:51): [True: 55.4k, False: 0]
  ------------------
 2725|  55.4k|			table->quick_num[code] = table->decode_num[pos];
 2726|  63.1k|		} else {
 2727|  63.1k|			table->quick_num[code] = 0;
 2728|  63.1k|		}
 2729|   118k|	}
 2730|       |
 2731|    395|	return ARCHIVE_OK;
  ------------------
  |  |  233|    395|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2732|    468|}
archive_read_support_format_rar5.c:decode_number:
 2736|  40.8k|{
 2737|  40.8k|	int i, bits, dist, ret;
 2738|  40.8k|	uint16_t bitfield;
 2739|  40.8k|	uint32_t pos;
 2740|  40.8k|	struct rar5* rar = get_context(a);
 2741|       |
 2742|  40.8k|	if(ARCHIVE_OK != (ret = read_bits_16(a, rar, p, &bitfield))) {
  ------------------
  |  |  233|  40.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2742:5): [True: 0, False: 40.8k]
  ------------------
 2743|      0|		return ret;
 2744|      0|	}
 2745|       |
 2746|  40.8k|	bitfield &= 0xfffe;
 2747|       |
 2748|  40.8k|	if(bitfield < table->decode_len[table->quick_bits]) {
  ------------------
  |  Branch (2748:5): [True: 16.4k, False: 24.4k]
  ------------------
 2749|  16.4k|		int code = bitfield >> (16 - table->quick_bits);
 2750|  16.4k|		skip_bits(rar, table->quick_len[code]);
 2751|  16.4k|		*num = table->quick_num[code];
 2752|  16.4k|		return ARCHIVE_OK;
  ------------------
  |  |  233|  16.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2753|  16.4k|	}
 2754|       |
 2755|  24.4k|	bits = 15;
 2756|       |
 2757|   243k|	for(i = table->quick_bits + 1; i < 15; i++) {
  ------------------
  |  Branch (2757:33): [True: 223k, False: 20.6k]
  ------------------
 2758|   223k|		if(bitfield < table->decode_len[i]) {
  ------------------
  |  Branch (2758:6): [True: 3.84k, False: 219k]
  ------------------
 2759|  3.84k|			bits = i;
 2760|  3.84k|			break;
 2761|  3.84k|		}
 2762|   223k|	}
 2763|       |
 2764|  24.4k|	skip_bits(rar, bits);
 2765|       |
 2766|  24.4k|	dist = bitfield - table->decode_len[bits - 1];
 2767|  24.4k|	dist >>= (16 - bits);
 2768|  24.4k|	pos = table->decode_pos[bits] + dist;
 2769|       |
 2770|  24.4k|	if(pos >= table->size)
  ------------------
  |  Branch (2770:5): [True: 20.6k, False: 3.87k]
  ------------------
 2771|  20.6k|		pos = 0;
 2772|       |
 2773|  24.4k|	*num = table->decode_num[pos];
 2774|  24.4k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  24.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2775|  40.8k|}
archive_read_support_format_rar5.c:read_bits_16:
 1060|  58.6k|{
 1061|  58.6k|	if(rar->bits.in_addr >= rar->cstate.cur_block_size) {
  ------------------
  |  Branch (1061:5): [True: 0, False: 58.6k]
  ------------------
 1062|      0|		archive_set_error(&a->archive,
 1063|      0|			ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1064|      0|			"Premature end of stream during extraction of data (#2)");
 1065|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1066|      0|	}
 1067|       |
 1068|  58.6k|	uint32_t bits = archive_be24dec(p + (unsigned)rar->bits.in_addr);
 1069|  58.6k|	bits >>= (8 - rar->bits.bit_addr);
 1070|  58.6k|	*value = bits & 0xffff;
 1071|  58.6k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  58.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1072|  58.6k|}
archive_read_support_format_rar5.c:skip_bits:
 1074|  58.7k|static void skip_bits(struct rar5* rar, int bits) {
 1075|  58.7k|	const int new_bits = rar->bits.bit_addr + bits;
 1076|  58.7k|	rar->bits.in_addr += new_bits >> 3;
 1077|  58.7k|	rar->bits.bit_addr = new_bits & 7;
 1078|  58.7k|}
archive_read_support_format_rar5.c:do_uncompress_block:
 3182|  1.66k|static int do_uncompress_block(struct archive_read* a, const uint8_t* p) {
 3183|  1.66k|	struct rar5* rar = get_context(a);
 3184|  1.66k|	uint16_t num;
 3185|  1.66k|	int ret;
 3186|       |
 3187|  1.66k|	const uint64_t cmask = rar->cstate.window_mask;
 3188|  1.66k|	const struct compressed_block_header* hdr = &rar->last_block_hdr;
 3189|  1.66k|	const uint8_t bit_size = 1 + bf_bit_size(hdr);
 3190|       |
 3191|  26.5k|	while(1) {
  ------------------
  |  Branch (3191:8): [True: 26.5k, Folded]
  ------------------
 3192|  26.5k|		if(rar->cstate.write_ptr - rar->cstate.last_write_ptr >
  ------------------
  |  Branch (3192:6): [True: 331, False: 26.2k]
  ------------------
 3193|  26.5k|		    (rar->cstate.window_size >> 1)) {
 3194|       |			/* Don't allow growing data by more than half of the
 3195|       |			 * window size at a time. In such case, break the loop;
 3196|       |			 *  next call to this function will continue processing
 3197|       |			 *  from this moment. */
 3198|    331|			break;
 3199|    331|		}
 3200|       |
 3201|  26.2k|		if(rar->bits.in_addr > rar->cstate.cur_block_size - 1 ||
  ------------------
  |  Branch (3201:6): [True: 928, False: 25.2k]
  ------------------
 3202|  25.2k|		    (rar->bits.in_addr == rar->cstate.cur_block_size - 1 &&
  ------------------
  |  Branch (3202:8): [True: 680, False: 24.5k]
  ------------------
 3203|    680|		    rar->bits.bit_addr >= bit_size))
  ------------------
  |  Branch (3203:7): [True: 410, False: 270]
  ------------------
 3204|  1.33k|		{
 3205|       |			/* If the program counter is here, it means the
 3206|       |			 * function has finished processing the block. */
 3207|  1.33k|			rar->cstate.block_parsing_finished = 1;
 3208|  1.33k|			break;
 3209|  1.33k|		}
 3210|       |
 3211|       |		/* Decode the next literal. */
 3212|  24.8k|		if(ARCHIVE_OK != decode_number(a, &rar->cstate.ld, p, &num)) {
  ------------------
  |  |  233|  24.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3212:6): [True: 0, False: 24.8k]
  ------------------
 3213|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3214|      0|		}
 3215|       |
 3216|       |		/* Num holds a decompression literal, or 'command code'.
 3217|       |		 *
 3218|       |		 * - Values lower than 256 are just bytes. Those codes
 3219|       |		 *   can be stored in the output buffer directly.
 3220|       |		 *
 3221|       |		 * - Code 256 defines a new filter, which is later used to
 3222|       |		 *   transform the data block accordingly to the filter type.
 3223|       |		 *   The data block needs to be fully uncompressed first.
 3224|       |		 *
 3225|       |		 * - Code bigger than 257 and smaller than 262 define
 3226|       |		 *   a repetition pattern that should be copied from
 3227|       |		 *   an already uncompressed chunk of data.
 3228|       |		 */
 3229|       |
 3230|  24.8k|		if(num < 256) {
  ------------------
  |  Branch (3230:6): [True: 16.2k, False: 8.62k]
  ------------------
 3231|       |			/* Directly store the byte. */
 3232|  16.2k|			int64_t write_idx = rar->cstate.solid_offset +
 3233|  16.2k|			    rar->cstate.write_ptr++;
 3234|       |
 3235|  16.2k|			rar->cstate.window_buf[write_idx & cmask] =
 3236|  16.2k|			    (uint8_t) num;
 3237|  16.2k|			continue;
 3238|  16.2k|		} else if(num >= 262) {
  ------------------
  |  Branch (3238:13): [True: 8.25k, False: 376]
  ------------------
 3239|  8.25k|			uint16_t dist_slot;
 3240|  8.25k|			int len = decode_code_length(a, rar, p, num - 262),
 3241|  8.25k|				dbits,
 3242|  8.25k|				dist = 1;
 3243|       |
 3244|  8.25k|			if(len == -1) {
  ------------------
  |  Branch (3244:7): [True: 0, False: 8.25k]
  ------------------
 3245|      0|				archive_set_error(&a->archive,
 3246|      0|				    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3247|      0|				    "Failed to decode the code length");
 3248|       |
 3249|      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 (3249:12): [True: 0, False: 0]
  ------------------
 3250|      0|			}
 3251|       |
 3252|  8.25k|			if(ARCHIVE_OK != decode_number(a, &rar->cstate.dd, p,
  ------------------
  |  |  233|  8.25k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3252:7): [True: 0, False: 8.25k]
  ------------------
 3253|  8.25k|			    &dist_slot))
 3254|      0|			{
 3255|      0|				archive_set_error(&a->archive,
 3256|      0|				    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3257|      0|				    "Failed to decode the distance slot");
 3258|       |
 3259|      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 (3259:12): [True: 0, False: 0]
  ------------------
 3260|      0|			}
 3261|       |
 3262|  8.25k|			if(dist_slot < 4) {
  ------------------
  |  Branch (3262:7): [True: 14, False: 8.23k]
  ------------------
 3263|     14|				dbits = 0;
 3264|     14|				dist += dist_slot;
 3265|  8.23k|			} else {
 3266|  8.23k|				dbits = dist_slot / 2 - 1;
 3267|       |
 3268|       |				/* Cast to uint32_t will make sure the shift
 3269|       |				 * left operation won't produce undefined
 3270|       |				 * result. Then, the uint32_t type will
 3271|       |				 * be implicitly casted to int. */
 3272|  8.23k|				dist += (uint32_t) (2 |
 3273|  8.23k|				    (dist_slot & 1)) << dbits;
 3274|  8.23k|			}
 3275|       |
 3276|  8.25k|			if(dbits > 0) {
  ------------------
  |  Branch (3276:7): [True: 8.23k, False: 14]
  ------------------
 3277|  8.23k|				if(dbits >= 4) {
  ------------------
  |  Branch (3277:8): [True: 104, False: 8.13k]
  ------------------
 3278|    104|					uint32_t add = 0;
 3279|    104|					uint16_t low_dist;
 3280|       |
 3281|    104|					if(dbits > 4) {
  ------------------
  |  Branch (3281:9): [True: 100, False: 4]
  ------------------
 3282|    100|						if(ARCHIVE_OK != (ret = read_bits_32(
  ------------------
  |  |  233|    100|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3282:10): [True: 0, False: 100]
  ------------------
 3283|    100|						    a, rar, p, &add))) {
 3284|       |							/* Return EOF if we
 3285|       |							 * can't read more
 3286|       |							 * data. */
 3287|      0|							return ret;
 3288|      0|						}
 3289|       |
 3290|    100|						skip_bits(rar, dbits - 4);
 3291|    100|						add = (add >> (
 3292|    100|						    36 - dbits)) << 4;
 3293|    100|						dist += add;
 3294|    100|					}
 3295|       |
 3296|    104|					if(ARCHIVE_OK != decode_number(a,
  ------------------
  |  |  233|    104|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3296:9): [True: 0, False: 104]
  ------------------
 3297|    104|					    &rar->cstate.ldd, p, &low_dist))
 3298|      0|					{
 3299|      0|						archive_set_error(&a->archive,
 3300|      0|						    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3301|      0|						    "Failed to decode the "
 3302|      0|						    "distance slot");
 3303|       |
 3304|      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 (3304:14): [True: 0, False: 0]
  ------------------
 3305|      0|					}
 3306|       |
 3307|    104|					if(dist >= INT_MAX - low_dist - 1) {
  ------------------
  |  Branch (3307:9): [True: 0, False: 104]
  ------------------
 3308|       |						/* This only happens in
 3309|       |						 * invalid archives. */
 3310|      0|						archive_set_error(&a->archive,
 3311|      0|						    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3312|      0|						    "Distance pointer "
 3313|      0|						    "overflow");
 3314|      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 (3314:14): [True: 0, False: 0]
  ------------------
 3315|      0|					}
 3316|       |
 3317|    104|					dist += low_dist;
 3318|  8.13k|				} else {
 3319|       |					/* dbits is one of [0,1,2,3] */
 3320|  8.13k|					int add;
 3321|       |
 3322|  8.13k|					if(ARCHIVE_OK != (ret = read_consume_bits(a, rar,
  ------------------
  |  |  233|  8.13k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3322:9): [True: 0, False: 8.13k]
  ------------------
 3323|  8.13k|					     p, dbits, &add))) {
 3324|       |						/* Return EOF if we can't read
 3325|       |						 * more data. */
 3326|      0|						return ret;
 3327|      0|					}
 3328|       |
 3329|  8.13k|					dist += add;
 3330|  8.13k|				}
 3331|  8.23k|			}
 3332|       |
 3333|  8.25k|			if(dist > 0x100) {
  ------------------
  |  Branch (3333:7): [True: 76, False: 8.17k]
  ------------------
 3334|     76|				len++;
 3335|       |
 3336|     76|				if(dist > 0x2000) {
  ------------------
  |  Branch (3336:8): [True: 43, False: 33]
  ------------------
 3337|     43|					len++;
 3338|       |
 3339|     43|					if(dist > 0x40000) {
  ------------------
  |  Branch (3339:9): [True: 30, False: 13]
  ------------------
 3340|     30|						len++;
 3341|     30|					}
 3342|     43|				}
 3343|     76|			}
 3344|       |
 3345|  8.25k|			dist_cache_push(rar, dist);
 3346|  8.25k|			rar->cstate.last_len = len;
 3347|       |
 3348|  8.25k|			if(ARCHIVE_OK != copy_string(a, len, dist))
  ------------------
  |  |  233|  8.25k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3348:7): [True: 0, False: 8.25k]
  ------------------
 3349|      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 (3349:12): [True: 0, False: 0]
  ------------------
 3350|       |
 3351|  8.25k|			continue;
 3352|  8.25k|		} else if(num == 256) {
  ------------------
  |  Branch (3352:13): [True: 0, False: 376]
  ------------------
 3353|       |			/* Create a filter. */
 3354|      0|			ret = parse_filter(a, p);
 3355|      0|			if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3355:7): [True: 0, False: 0]
  ------------------
 3356|      0|				return ret;
 3357|       |
 3358|      0|			continue;
 3359|    376|		} else if(num == 257) {
  ------------------
  |  Branch (3359:13): [True: 0, False: 376]
  ------------------
 3360|      0|			if(rar->cstate.last_len != 0) {
  ------------------
  |  Branch (3360:7): [True: 0, False: 0]
  ------------------
 3361|      0|				if(ARCHIVE_OK != copy_string(a,
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3361:8): [True: 0, False: 0]
  ------------------
 3362|      0|				    rar->cstate.last_len,
 3363|      0|				    rar->cstate.dist_cache[0]))
 3364|      0|				{
 3365|      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 (3365:13): [True: 0, False: 0]
  ------------------
 3366|      0|				}
 3367|      0|			}
 3368|       |
 3369|      0|			continue;
 3370|    376|		} else {
 3371|       |			/* num < 262 */
 3372|    376|			const int idx = num - 258;
 3373|    376|			const int dist = dist_cache_touch(rar, idx);
 3374|       |
 3375|    376|			uint16_t len_slot;
 3376|    376|			int len;
 3377|       |
 3378|    376|			if(ARCHIVE_OK != decode_number(a, &rar->cstate.rd, p,
  ------------------
  |  |  233|    376|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3378:7): [True: 0, False: 376]
  ------------------
 3379|    376|			    &len_slot)) {
 3380|      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 (3380:12): [True: 0, False: 0]
  ------------------
 3381|      0|			}
 3382|       |
 3383|    376|			len = decode_code_length(a, rar, p, len_slot);
 3384|    376|			if (len == -1) {
  ------------------
  |  Branch (3384:8): [True: 0, False: 376]
  ------------------
 3385|      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 (3385:12): [True: 0, False: 0]
  ------------------
 3386|      0|			}
 3387|       |
 3388|    376|			rar->cstate.last_len = len;
 3389|       |
 3390|    376|			if(ARCHIVE_OK != copy_string(a, len, dist))
  ------------------
  |  |  233|    376|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3390:7): [True: 0, False: 376]
  ------------------
 3391|      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 (3391:12): [True: 0, False: 0]
  ------------------
 3392|       |
 3393|    376|			continue;
 3394|    376|		}
 3395|  24.8k|	}
 3396|       |
 3397|  1.66k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.66k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3398|  1.66k|}
archive_read_support_format_rar5.c:bf_bit_size:
  500|  1.66k|uint8_t bf_bit_size(const struct compressed_block_header* hdr) {
  501|  1.66k|	return hdr->block_flags_u8 & 7;
  502|  1.66k|}
archive_read_support_format_rar5.c:decode_code_length:
 3131|  8.62k|{
 3132|  8.62k|	int lbits, length = 2;
 3133|       |
 3134|  8.62k|	if(code < 8) {
  ------------------
  |  Branch (3134:5): [True: 371, False: 8.25k]
  ------------------
 3135|    371|		lbits = 0;
 3136|    371|		length += code;
 3137|  8.25k|	} else {
 3138|  8.25k|		lbits = code / 4 - 1;
 3139|  8.25k|		length += (4 | (code & 3)) << lbits;
 3140|  8.25k|	}
 3141|       |
 3142|  8.62k|	if(lbits > 0) {
  ------------------
  |  Branch (3142:5): [True: 8.25k, False: 371]
  ------------------
 3143|  8.25k|		int add;
 3144|       |
 3145|  8.25k|		if(ARCHIVE_OK != read_consume_bits(a, rar, p, lbits, &add))
  ------------------
  |  |  233|  8.25k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3145:6): [True: 0, False: 8.25k]
  ------------------
 3146|      0|			return -1;
 3147|       |
 3148|  8.25k|		length += add;
 3149|  8.25k|	}
 3150|       |
 3151|  8.62k|	return length;
 3152|  8.62k|}
archive_read_support_format_rar5.c:read_bits_32:
 1043|    100|{
 1044|    100|	if(rar->bits.in_addr >= rar->cstate.cur_block_size) {
  ------------------
  |  Branch (1044:5): [True: 0, False: 100]
  ------------------
 1045|      0|		archive_set_error(&a->archive,
 1046|      0|			ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1047|      0|			"Premature end of stream during extraction of data (#1)");
 1048|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1049|      0|	}
 1050|       |
 1051|    100|	uint32_t bits = archive_be32dec(p + rar->bits.in_addr);
 1052|    100|	bits <<= rar->bits.bit_addr;
 1053|    100|	bits |= p[rar->bits.in_addr + 4] >> (8 - rar->bits.bit_addr);
 1054|    100|	*value = bits;
 1055|    100|	return ARCHIVE_OK;
  ------------------
  |  |  233|    100|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1056|    100|}
archive_read_support_format_rar5.c:read_consume_bits:
 1083|  16.3k|{
 1084|  16.3k|	uint16_t v;
 1085|  16.3k|	int ret, num;
 1086|       |
 1087|  16.3k|	if(n == 0 || n > 16) {
  ------------------
  |  Branch (1087:5): [True: 0, False: 16.3k]
  |  Branch (1087:15): [True: 0, False: 16.3k]
  ------------------
 1088|       |		/* This is a programmer error and should never happen
 1089|       |		 * in runtime. */
 1090|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1091|      0|	}
 1092|       |
 1093|  16.3k|	ret = read_bits_16(a, rar, p, &v);
 1094|  16.3k|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  16.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1094:5): [True: 0, False: 16.3k]
  ------------------
 1095|      0|		return ret;
 1096|       |
 1097|  16.3k|	num = (int) v;
 1098|  16.3k|	num >>= 16 - n;
 1099|       |
 1100|  16.3k|	skip_bits(rar, n);
 1101|       |
 1102|  16.3k|	if(value)
  ------------------
  |  Branch (1102:5): [True: 16.3k, False: 0]
  ------------------
 1103|  16.3k|		*value = num;
 1104|       |
 1105|  16.3k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  16.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1106|  16.3k|}
archive_read_support_format_rar5.c:dist_cache_push:
  832|  8.25k|static void dist_cache_push(struct rar5* rar, int value) {
  833|  8.25k|	int* q = rar->cstate.dist_cache;
  834|       |
  835|  8.25k|	q[3] = q[2];
  836|  8.25k|	q[2] = q[1];
  837|  8.25k|	q[1] = q[0];
  838|  8.25k|	q[0] = value;
  839|  8.25k|}
archive_read_support_format_rar5.c:copy_string:
 3154|  8.62k|static int copy_string(struct archive_read* a, int len, int dist) {
 3155|  8.62k|	struct rar5* rar = get_context(a);
 3156|  8.62k|	const ssize_t cmask = rar->cstate.window_mask;
 3157|  8.62k|	const uint64_t write_ptr = rar->cstate.write_ptr +
 3158|  8.62k|	    rar->cstate.solid_offset;
 3159|  8.62k|	int i;
 3160|       |
 3161|  8.62k|	if (rar->cstate.window_buf == NULL)
  ------------------
  |  Branch (3161:6): [True: 0, False: 8.62k]
  ------------------
 3162|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3163|       |
 3164|       |	/* The unpacker spends most of the time in this function. It would be
 3165|       |	 * a good idea to introduce some optimizations here.
 3166|       |	 *
 3167|       |	 * Just remember that this loop treats buffers that overlap differently
 3168|       |	 * than buffers that do not overlap. This is why a simple memcpy(3)
 3169|       |	 * call will not be enough. */
 3170|       |
 3171|  22.1M|	for(i = 0; i < len; i++) {
  ------------------
  |  Branch (3171:13): [True: 22.1M, False: 8.62k]
  ------------------
 3172|  22.1M|		const ssize_t write_idx = (write_ptr + i) & cmask;
 3173|  22.1M|		const ssize_t read_idx = (write_ptr + i - dist) & cmask;
 3174|  22.1M|		rar->cstate.window_buf[write_idx] =
 3175|  22.1M|		    rar->cstate.window_buf[read_idx];
 3176|  22.1M|	}
 3177|       |
 3178|  8.62k|	rar->cstate.write_ptr += len;
 3179|  8.62k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  8.62k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3180|  8.62k|}
archive_read_support_format_rar5.c:dist_cache_touch:
  841|    376|static int dist_cache_touch(struct rar5* rar, int idx) {
  842|    376|	int* q = rar->cstate.dist_cache;
  843|    376|	int i, dist = q[idx];
  844|       |
  845|  1.50k|	for(i = idx; i > 0; i--)
  ------------------
  |  Branch (845:15): [True: 1.12k, False: 376]
  ------------------
  846|  1.12k|		q[i] = q[i - 1];
  847|       |
  848|    376|	q[0] = dist;
  849|    376|	return dist;
  850|    376|}
archive_read_support_format_rar5.c:bf_is_last_block:
  515|    509|uint8_t bf_is_last_block(const struct compressed_block_header* hdr) {
  516|    509|	return (hdr->block_flags_u8 >> 6) & 1;
  517|    509|}
archive_read_support_format_rar5.c:apply_filters:
  780|  1.16k|static int apply_filters(struct archive_read* a) {
  781|  1.16k|	struct filter_info* flt;
  782|  1.16k|	struct rar5* rar = get_context(a);
  783|  1.16k|	int ret;
  784|       |
  785|  1.16k|	rar->cstate.all_filters_applied = 0;
  786|       |
  787|       |	/* Get the first filter that can be applied to our data. The data
  788|       |	 * needs to be fully unpacked before the filter can be run. */
  789|  1.16k|	if(CDE_OK == cdeque_front(&rar->cstate.filters,
  ------------------
  |  Branch (789:5): [True: 0, False: 1.16k]
  ------------------
  790|  1.16k|	    cdeque_filter_p(&flt))) {
  791|       |		/* Check if our unpacked data fully covers this filter's
  792|       |		 * range. */
  793|      0|		if(rar->cstate.write_ptr > flt->block_start &&
  ------------------
  |  Branch (793:6): [True: 0, False: 0]
  ------------------
  794|      0|		    rar->cstate.write_ptr >= flt->block_start +
  ------------------
  |  Branch (794:7): [True: 0, False: 0]
  ------------------
  795|      0|		    flt->block_length) {
  796|       |			/* Check if we have some data pending to be written
  797|       |			 * right before the filter's start offset. */
  798|      0|			if(rar->cstate.last_write_ptr == flt->block_start) {
  ------------------
  |  Branch (798:7): [True: 0, False: 0]
  ------------------
  799|       |				/* Run the filter specified by descriptor
  800|       |				 * `flt`. */
  801|      0|				ret = run_filter(a, flt);
  802|      0|				if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (802:8): [True: 0, False: 0]
  ------------------
  803|       |					/* Filter failure, return error. */
  804|      0|					return ret;
  805|      0|				}
  806|       |
  807|       |				/* Filter descriptor won't be needed anymore
  808|       |				 * after it's used, * so remove it from the
  809|       |				 * filter list and free its memory. */
  810|      0|				(void) cdeque_pop_front(&rar->cstate.filters,
  811|      0|				    cdeque_filter_p(&flt));
  812|       |
  813|      0|				free(flt);
  814|      0|			} else {
  815|       |				/* We can't run filters yet, dump the memory
  816|       |				 * right before the filter. */
  817|      0|				push_window_data(a, rar,
  818|      0|				    rar->cstate.last_write_ptr,
  819|      0|				    flt->block_start);
  820|      0|			}
  821|       |
  822|       |			/* Return 'filter applied or not needed' state to the
  823|       |			 * caller. */
  824|      0|			return ARCHIVE_RETRY;
  ------------------
  |  |  234|      0|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  825|      0|		}
  826|      0|	}
  827|       |
  828|  1.16k|	rar->cstate.all_filters_applied = 1;
  829|  1.16k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.16k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  830|  1.16k|}
archive_read_support_format_rar5.c:push_data_ready:
 3831|  1.32k|{
 3832|  1.32k|	int i;
 3833|       |
 3834|       |	/* Don't push if we're in skip mode. This is needed because solid
 3835|       |	 * streams need full processing even if we're skipping data. After
 3836|       |	 * fully processing the stream, we need to discard the generated bytes,
 3837|       |	 * because we're interested only in the side effect: building up the
 3838|       |	 * internal window circular buffer. This window buffer will be used
 3839|       |	 * later during unpacking of requested data. */
 3840|  1.32k|	if(rar->skip_mode)
  ------------------
  |  Branch (3840:5): [True: 78, False: 1.25k]
  ------------------
 3841|     78|		return ARCHIVE_OK;
  ------------------
  |  |  233|     78|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3842|       |
 3843|       |	/* Sanity check. */
 3844|  1.25k|	if(offset != rar->file.last_offset + rar->file.last_size) {
  ------------------
  |  Branch (3844:5): [True: 0, False: 1.25k]
  ------------------
 3845|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3846|      0|		    "Sanity check error: output stream is not continuous");
 3847|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3848|      0|	}
 3849|       |
 3850|  1.42k|	for(i = 0; i < rar5_countof(rar->cstate.dready); i++) {
  ------------------
  |  |   63|  1.42k|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (3850:13): [True: 1.42k, False: 0]
  ------------------
 3851|  1.42k|		struct data_ready* d = &rar->cstate.dready[i];
 3852|  1.42k|		if(!d->used) {
  ------------------
  |  Branch (3852:6): [True: 1.25k, False: 169]
  ------------------
 3853|  1.25k|			d->used = 1;
 3854|  1.25k|			d->buf = buf;
 3855|  1.25k|			d->size = size;
 3856|  1.25k|			d->offset = offset;
 3857|       |
 3858|       |			/* These fields are used only in sanity checking. */
 3859|  1.25k|			rar->file.last_offset = offset;
 3860|  1.25k|			rar->file.last_size = size;
 3861|       |
 3862|       |			/* Calculate the checksum of this new block before
 3863|       |			 * submitting data to libarchive's engine. */
 3864|  1.25k|			update_crc(rar, d->buf, d->size);
 3865|       |
 3866|  1.25k|			return ARCHIVE_OK;
  ------------------
  |  |  233|  1.25k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3867|  1.25k|		}
 3868|  1.42k|	}
 3869|       |
 3870|       |	/* Program counter will reach this code if the `rar->cstate.data_ready`
 3871|       |	 * stack will be filled up so that no new entries will be allowed. The
 3872|       |	 * code shouldn't allow such situation to occur. So we treat this case
 3873|       |	 * as an internal error. */
 3874|       |
 3875|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3876|      0|	    "Premature end of data_ready stack");
 3877|      0|	return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3878|  1.25k|}
archive_read_support_format_rar5.c:cdeque_front:
  427|  1.16k|static int cdeque_front(struct cdeque* d, void** value) {
  428|  1.16k|	if(d->size > 0) {
  ------------------
  |  Branch (428:5): [True: 0, False: 1.16k]
  ------------------
  429|      0|		cdeque_front_fast(d, value);
  430|      0|		return CDE_OK;
  431|      0|	} else
  432|  1.16k|		return CDE_OUT_OF_BOUNDS;
  433|  1.16k|}
archive_read_support_format_rar5.c:push_window_data:
  776|  1.16k|{
  777|  1.16k|	push_data(a, rar, rar->cstate.window_buf, idx_begin, idx_end);
  778|  1.16k|}
archive_read_support_format_rar5.c:push_data:
  732|  1.16k|{
  733|  1.16k|	const ssize_t wmask = rar->cstate.window_mask;
  734|  1.16k|	const ssize_t solid_write_ptr = (rar->cstate.solid_offset +
  735|  1.16k|	    rar->cstate.last_write_ptr) & wmask;
  736|       |
  737|  1.16k|	idx_begin += rar->cstate.solid_offset;
  738|  1.16k|	idx_end += rar->cstate.solid_offset;
  739|       |
  740|       |	/* Check if our unpacked data is wrapped inside the window circular
  741|       |	 * buffer.  If it's not wrapped, it can be copied out by using
  742|       |	 * a single memcpy, but when it's wrapped, we need to copy the first
  743|       |	 * part with one memcpy, and the second part with another memcpy. */
  744|       |
  745|  1.16k|	if((idx_begin & wmask) > (idx_end & wmask)) {
  ------------------
  |  Branch (745:5): [True: 169, False: 991]
  ------------------
  746|       |		/* The data is wrapped (begin offset sis bigger than end
  747|       |		 * offset). */
  748|    169|		const ssize_t frag1_size = rar->cstate.window_size -
  749|    169|		    (idx_begin & wmask);
  750|    169|		const ssize_t frag2_size = idx_end & wmask;
  751|       |
  752|       |		/* Copy the first part of the buffer first. */
  753|    169|		push_data_ready(a, rar, buf + solid_write_ptr, frag1_size,
  754|    169|		    rar->cstate.last_write_ptr);
  755|       |
  756|       |		/* Copy the second part of the buffer. */
  757|    169|		push_data_ready(a, rar, buf, frag2_size,
  758|    169|		    rar->cstate.last_write_ptr + frag1_size);
  759|       |
  760|    169|		rar->cstate.last_write_ptr += frag1_size + frag2_size;
  761|    991|	} else {
  762|       |		/* Data is not wrapped, so we can just use one call to copy the
  763|       |		 * data. */
  764|    991|		push_data_ready(a, rar,
  765|    991|		    buf + solid_write_ptr, (idx_end - idx_begin) & wmask,
  766|    991|		    rar->cstate.last_write_ptr);
  767|       |
  768|    991|		rar->cstate.last_write_ptr += idx_end - idx_begin;
  769|    991|	}
  770|  1.16k|}
archive_read_support_format_rar5.c:verify_global_checksums:
 4243|      6|static int verify_global_checksums(struct archive_read* a) {
 4244|      6|	return verify_checksums(a);
 4245|      6|}
archive_read_support_format_rar5.c:verify_checksums:
 4145|      6|static int verify_checksums(struct archive_read* a) {
 4146|      6|	int verify_crc;
 4147|      6|	struct rar5* rar = get_context(a);
 4148|       |
 4149|       |	/* Check checksums only when actually unpacking the data. There's no
 4150|       |	 * need to calculate checksum when we're skipping data in solid archives
 4151|       |	 * (skipping in solid archives is the same thing as unpacking compressed
 4152|       |	 * data and discarding the result). */
 4153|       |
 4154|      6|	if(!rar->skip_mode) {
  ------------------
  |  Branch (4154:5): [True: 2, False: 4]
  ------------------
 4155|       |		/* Always check checksums if we're not in skip mode */
 4156|      2|		verify_crc = 1;
 4157|      4|	} else {
 4158|       |		/* We can override the logic above with a compile-time option
 4159|       |		 * NO_CRC_ON_SOLID_SKIP. This option is used during debugging,
 4160|       |		 * and it will check checksums of unpacked data even when
 4161|       |		 * we're skipping it. */
 4162|       |
 4163|       |#if defined CHECK_CRC_ON_SOLID_SKIP
 4164|       |		/* Debug case */
 4165|       |		verify_crc = 1;
 4166|       |#else
 4167|       |		/* Normal case */
 4168|      4|		verify_crc = 0;
 4169|      4|#endif
 4170|      4|	}
 4171|       |
 4172|      6|	if(verify_crc) {
  ------------------
  |  Branch (4172:5): [True: 2, False: 4]
  ------------------
 4173|       |		/* During unpacking, on each unpacked block we're calling the
 4174|       |		 * update_crc() function. Since we are here, the unpacking
 4175|       |		 * process is already over and we can check if calculated
 4176|       |		 * checksum (CRC32 or BLAKE2sp) is the same as what is stored
 4177|       |		 * in the archive. */
 4178|      2|		if(rar->file.stored_crc32 > 0) {
  ------------------
  |  Branch (4178:6): [True: 2, False: 0]
  ------------------
 4179|       |			/* Check CRC32 only when the file contains a CRC32
 4180|       |			 * value for this file. */
 4181|       |
 4182|      2|			if(rar->file.calculated_crc32 !=
  ------------------
  |  Branch (4182:7): [True: 2, False: 0]
  ------------------
 4183|      2|			    rar->file.stored_crc32) {
 4184|       |				/* Checksums do not match; the unpacked file
 4185|       |				 * is corrupted. */
 4186|       |
 4187|      2|				DEBUG_CODE {
  ------------------
  |  |   69|      2|#define DEBUG_CODE if(0)
  |  |  ------------------
  |  |  |  Branch (69:23): [Folded, False: 2]
  |  |  ------------------
  ------------------
 4188|      0|					printf("Checksum error: CRC32 "
 4189|      0|					    "(was: %08" PRIx32 ", expected: %08" PRIx32 ")\n",
 4190|      0|					    rar->file.calculated_crc32,
 4191|      0|					    rar->file.stored_crc32);
 4192|      0|				}
 4193|       |
 4194|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 4195|       |				archive_set_error(&a->archive,
 4196|       |				    ARCHIVE_ERRNO_FILE_FORMAT,
 4197|       |				    "Checksum error: CRC32");
 4198|       |				return ARCHIVE_FAILED;
 4199|       |#endif
 4200|      2|			} else {
 4201|      0|				DEBUG_CODE {
  ------------------
  |  |   69|      0|#define DEBUG_CODE if(0)
  |  |  ------------------
  |  |  |  Branch (69:23): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4202|      0|					printf("Checksum OK: CRC32 "
 4203|      0|					    "(%08" PRIx32 "/%08" PRIx32 ")\n",
 4204|      0|					    rar->file.stored_crc32,
 4205|      0|					    rar->file.calculated_crc32);
 4206|      0|				}
 4207|      0|			}
 4208|      2|		}
 4209|       |
 4210|      2|		if(rar->file.has_blake2 > 0) {
  ------------------
  |  Branch (4210:6): [True: 2, False: 0]
  ------------------
 4211|       |			/* BLAKE2sp is an optional checksum algorithm that is
 4212|       |			 * added to RARv5 archives when using the `-htb` switch
 4213|       |			 *  during creation of archive.
 4214|       |			 *
 4215|       |			 * We now finalize the hash calculation by calling the
 4216|       |			 * `final` function. This will generate the final hash
 4217|       |			 * value we can use to compare it with the BLAKE2sp
 4218|       |			 * checksum that is stored in the archive.
 4219|       |			 *
 4220|       |			 * The return value of this `final` function is not
 4221|       |			 * very helpful, as it guards only against improper use.
 4222|       | 			 * This is why we're explicitly ignoring it. */
 4223|       |
 4224|      2|			uint8_t b2_buf[32];
 4225|      2|			(void) blake2sp_final(&rar->file.b2state, b2_buf, 32);
 4226|       |
 4227|      2|			if(memcmp(&rar->file.blake2sp, b2_buf, 32) != 0) {
  ------------------
  |  Branch (4227:7): [True: 2, False: 0]
  ------------------
 4228|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 4229|       |				archive_set_error(&a->archive,
 4230|       |				    ARCHIVE_ERRNO_FILE_FORMAT,
 4231|       |				    "Checksum error: BLAKE2");
 4232|       |
 4233|       |				return ARCHIVE_FAILED;
 4234|       |#endif
 4235|      2|			}
 4236|      2|		}
 4237|      2|	}
 4238|       |
 4239|       |	/* Finalization for this file has been successfully completed. */
 4240|      6|	return ARCHIVE_OK;
  ------------------
  |  |  233|      6|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4241|      6|}
archive_read_support_format_rar5.c:rar5_read_data_skip:
 4325|    436|static int rar5_read_data_skip(struct archive_read *a) {
 4326|    436|	struct rar5* rar = get_context(a);
 4327|       |
 4328|    436|	if(rar->main.solid && (rar->cstate.data_encrypted == 0)) {
  ------------------
  |  Branch (4328:5): [True: 338, False: 98]
  |  Branch (4328:24): [True: 207, False: 131]
  ------------------
 4329|       |		/* In solid archives, instead of skipping the data, we need to
 4330|       |		 * extract it, and dispose the result. The side effect of this
 4331|       |		 * operation will be setting up the initial window buffer state
 4332|       |		 * needed to be able to extract the selected file. Note that
 4333|       |		 * this is only possible when data withing this solid block is
 4334|       |		 * not encrypted, in which case we'll skip and fail if the user
 4335|       |		 * tries to read data. */
 4336|       |
 4337|    207|		int ret;
 4338|       |
 4339|       |		/* Make sure to process all blocks in the compressed stream. */
 4340|    290|		while(rar->file.bytes_remaining > 0) {
  ------------------
  |  Branch (4340:9): [True: 106, False: 184]
  ------------------
 4341|       |			/* Setting the "skip mode" will allow us to skip
 4342|       |			 * checksum checks during data skipping. Checking the
 4343|       |			 * checksum of skipped data isn't really necessary and
 4344|       |			 * it's only slowing things down.
 4345|       |			 *
 4346|       |			 * This is incremented instead of setting to 1 because
 4347|       |			 * this data skipping function can be called
 4348|       |			 * recursively. */
 4349|    106|			rar->skip_mode++;
 4350|       |
 4351|       |			/* We're disposing 1 block of data, so we use triple
 4352|       |			 * NULLs in arguments. */
 4353|    106|			ret = rar5_read_data(a, NULL, NULL, NULL);
 4354|       |
 4355|       |			/* Turn off "skip mode". */
 4356|    106|			rar->skip_mode--;
 4357|       |
 4358|    106|			if(ret < 0 || ret == ARCHIVE_EOF) {
  ------------------
  |  |  232|     88|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (4358:7): [True: 18, False: 88]
  |  Branch (4358:18): [True: 5, False: 83]
  ------------------
 4359|       |				/* Propagate any potential error conditions
 4360|       |				 * to the caller. */
 4361|     23|				return ret;
 4362|     23|			}
 4363|    106|		}
 4364|    229|	} else {
 4365|       |		/* In standard archives, we can just jump over the compressed
 4366|       |		 * stream. Each file in non-solid archives starts from an empty
 4367|       |		 * window buffer. */
 4368|       |
 4369|    229|		if(ARCHIVE_OK != consume(a, rar->file.bytes_remaining)) {
  ------------------
  |  |  233|    229|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4369:6): [True: 54, False: 175]
  ------------------
 4370|     54|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|     54|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4371|     54|		}
 4372|       |
 4373|    175|		rar->file.bytes_remaining = 0;
 4374|    175|	}
 4375|       |
 4376|    359|	return ARCHIVE_OK;
  ------------------
  |  |  233|    359|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4377|    436|}
archive_read_support_format_rar5.c:rar5_cleanup:
 4391|  2.49k|static int rar5_cleanup(struct archive_read *a) {
 4392|  2.49k|	struct rar5* rar = get_context(a);
 4393|       |
 4394|  2.49k|	free(rar->cstate.window_buf);
 4395|  2.49k|	free(rar->cstate.filtered_buf);
 4396|  2.49k|	clear_data_ready_stack(rar);
 4397|       |
 4398|  2.49k|	free(rar->vol.push_buf);
 4399|       |
 4400|  2.49k|	free_filters(rar);
 4401|  2.49k|	rar5_deinit(rar);
 4402|       |
 4403|  2.49k|	free(rar);
 4404|  2.49k|	a->format->data = NULL;
 4405|       |
 4406|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4407|  2.49k|}
archive_read_support_format_rar5.c:rar5_capabilities:
 4409|    524|static int rar5_capabilities(struct archive_read * a) {
 4410|    524|	(void) a;
 4411|    524|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA
  ------------------
  |  |  398|    524|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
 4412|    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.) */
  ------------------
 4413|    524|}
archive_read_support_format_rar5.c:rar5_has_encrypted_entries:
 4415|    262|static int rar5_has_encrypted_entries(struct archive_read *_a) {
 4416|    262|	if (_a && _a->format) {
  ------------------
  |  Branch (4416:6): [True: 262, False: 0]
  |  Branch (4416:12): [True: 262, False: 0]
  ------------------
 4417|    262|		struct rar5 *rar = (struct rar5 *)_a->format->data;
 4418|    262|		if (rar) {
  ------------------
  |  Branch (4418:7): [True: 262, False: 0]
  ------------------
 4419|    262|			return rar->has_encrypted_entries;
 4420|    262|		}
 4421|    262|	}
 4422|       |
 4423|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4424|    262|}
archive_read_support_format_rar5.c:rar5_deinit:
 4443|  2.49k|static void rar5_deinit(struct rar5* rar) {
 4444|  2.49k|	cdeque_free(&rar->cstate.filters);
 4445|  2.49k|}
archive_read_support_format_rar5.c:cdeque_free:
  484|  2.49k|static void cdeque_free(struct cdeque* d) {
  485|  2.49k|	if(!d)
  ------------------
  |  Branch (485:5): [True: 0, False: 2.49k]
  ------------------
  486|      0|		return;
  487|       |
  488|  2.49k|	if(!d->arr)
  ------------------
  |  Branch (488:5): [True: 0, False: 2.49k]
  ------------------
  489|      0|		return;
  490|       |
  491|  2.49k|	free(d->arr);
  492|       |
  493|       |	d->arr = NULL;
  494|  2.49k|	d->beg_pos = -1;
  495|  2.49k|	d->end_pos = -1;
  496|  2.49k|	d->cap_mask = 0;
  497|  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.45k|{
   98|  2.45k|	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.45k|}
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:
  285|  2.49k|{
  286|  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]
  |  |  ------------------
  ------------------
  287|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_gnutar");
  288|  2.49k|	return (archive_read_support_format_tar(a));
  289|  2.49k|}
archive_read_support_format_tar:
  294|  4.99k|{
  295|  4.99k|	struct archive_read *a = (struct archive_read *)_a;
  296|  4.99k|	struct tar *tar;
  297|  4.99k|	int r;
  298|       |
  299|  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]
  |  |  ------------------
  ------------------
  300|  4.99k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_tar");
  301|       |
  302|  4.99k|	tar = calloc(1, sizeof(*tar));
  303|  4.99k|	if (tar == NULL) {
  ------------------
  |  Branch (303:6): [True: 0, False: 4.99k]
  ------------------
  304|      0|		archive_set_error(&a->archive, ENOMEM,
  305|      0|		    "Can't allocate tar data");
  306|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  307|      0|	}
  308|       |#ifdef HAVE_COPYFILE_H
  309|       |	/* Set this by default on Mac OS. */
  310|       |	tar->process_mac_extensions = 1;
  311|       |#endif
  312|       |
  313|  4.99k|	r = __archive_read_register_format(a, tar, "tar",
  314|  4.99k|	    archive_read_format_tar_bid,
  315|  4.99k|	    archive_read_format_tar_options,
  316|  4.99k|	    archive_read_format_tar_read_header,
  317|  4.99k|	    archive_read_format_tar_read_data,
  318|  4.99k|	    archive_read_format_tar_skip,
  319|  4.99k|	    NULL,
  320|  4.99k|	    archive_read_format_tar_cleanup,
  321|  4.99k|	    NULL,
  322|  4.99k|	    NULL);
  323|       |
  324|  4.99k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  4.99k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (324:6): [True: 2.49k, False: 2.49k]
  ------------------
  325|  2.49k|		free(tar);
  326|  4.99k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.99k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  327|  4.99k|}
archive_read_support_format_tar.c:archive_read_format_tar_cleanup:
  331|  2.49k|{
  332|  2.49k|	struct tar *tar;
  333|       |
  334|  2.49k|	tar = (struct tar *)(a->format->data);
  335|  2.49k|	gnu_clear_sparse_list(tar);
  336|  2.49k|	archive_string_free(&tar->entry_pathname);
  337|  2.49k|	archive_string_free(&tar->entry_pathname_override);
  338|  2.49k|	archive_string_free(&tar->entry_uname);
  339|  2.49k|	archive_string_free(&tar->entry_gname);
  340|  2.49k|	archive_string_free(&tar->entry_linkpath);
  341|  2.49k|	archive_string_free(&tar->line);
  342|  2.49k|	archive_string_free(&tar->localname);
  343|  2.49k|	free(tar);
  344|  2.49k|	(a->format->data) = NULL;
  345|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  346|  2.49k|}
archive_read_support_format_tar.c:gnu_clear_sparse_list:
 3190|   257k|{
 3191|   257k|	struct sparse_block *p;
 3192|       |
 3193|   511k|	while (tar->sparse_list != NULL) {
  ------------------
  |  Branch (3193:9): [True: 253k, False: 257k]
  ------------------
 3194|   253k|		p = tar->sparse_list;
 3195|   253k|		tar->sparse_list = p->next;
 3196|   253k|		free(p);
 3197|   253k|	}
 3198|       |	tar->sparse_last = NULL;
 3199|   257k|}
archive_read_support_format_tar.c:archive_read_format_tar_bid:
  402|  7.62k|{
  403|  7.62k|	int bid;
  404|  7.62k|	const char *h;
  405|  7.62k|	const struct archive_entry_header_ustar *header;
  406|       |
  407|  7.62k|	(void)best_bid; /* UNUSED */
  408|       |
  409|  7.62k|	bid = 0;
  410|       |
  411|       |	/* Now let's look at the actual header and see if it matches. */
  412|  7.62k|	h = __archive_read_ahead(a, 512, NULL);
  413|  7.62k|	if (h == NULL)
  ------------------
  |  Branch (413:6): [True: 25, False: 7.60k]
  ------------------
  414|     25|		return (-1);
  415|       |
  416|       |	/* If it's an end-of-archive mark, we can handle it. */
  417|  7.60k|	if (h[0] == 0 && archive_block_is_null(h)) {
  ------------------
  |  Branch (417:6): [True: 5.09k, False: 2.50k]
  |  Branch (417:19): [True: 129, False: 4.96k]
  ------------------
  418|       |		/*
  419|       |		 * Usually, I bid the number of bits verified, but
  420|       |		 * in this case, 4096 seems excessive so I picked 10 as
  421|       |		 * an arbitrary but reasonable-seeming value.
  422|       |		 */
  423|    129|		return (10);
  424|    129|	}
  425|       |
  426|       |	/* If it's not an end-of-archive mark, it must have a valid checksum.*/
  427|  7.47k|	if (!checksum(a, h))
  ------------------
  |  Branch (427:6): [True: 1.68k, False: 5.78k]
  ------------------
  428|  1.68k|		return (0);
  429|  5.78k|	bid += 48;  /* Checksum is usually 6 octal digits. */
  430|       |
  431|  5.78k|	header = (const struct archive_entry_header_ustar *)h;
  432|       |
  433|       |	/* Recognize POSIX formats. */
  434|  5.78k|	if ((memcmp(header->magic, "ustar\0", 6) == 0)
  ------------------
  |  Branch (434:6): [True: 677, False: 5.11k]
  ------------------
  435|    677|	    && (memcmp(header->version, "00", 2) == 0))
  ------------------
  |  Branch (435:9): [True: 433, False: 244]
  ------------------
  436|    433|		bid += 56;
  437|       |
  438|       |	/* Recognize GNU tar format. */
  439|  5.78k|	if ((memcmp(header->magic, "ustar ", 6) == 0)
  ------------------
  |  Branch (439:6): [True: 4.46k, False: 1.32k]
  ------------------
  440|  4.46k|	    && (memcmp(header->version, " \0", 2) == 0))
  ------------------
  |  Branch (440:9): [True: 143, False: 4.32k]
  ------------------
  441|    143|		bid += 56;
  442|       |
  443|       |	/* Type flag must be null, digit or A-Z, a-z. */
  444|  5.78k|	if (header->typeflag[0] != 0 &&
  ------------------
  |  Branch (444:6): [True: 5.46k, False: 321]
  ------------------
  445|  5.46k|	    !( header->typeflag[0] >= '0' && header->typeflag[0] <= '9') &&
  ------------------
  |  Branch (445:9): [True: 5.45k, False: 10]
  |  Branch (445:39): [True: 5.30k, False: 155]
  ------------------
  446|    165|	    !( header->typeflag[0] >= 'A' && header->typeflag[0] <= 'Z') &&
  ------------------
  |  Branch (446:9): [True: 154, False: 11]
  |  Branch (446:39): [True: 105, False: 49]
  ------------------
  447|     60|	    !( header->typeflag[0] >= 'a' && header->typeflag[0] <= 'z') )
  ------------------
  |  Branch (447:9): [True: 49, False: 11]
  |  Branch (447:39): [True: 49, False: 0]
  ------------------
  448|     11|		return (0);
  449|  5.77k|	bid += 2;  /* 6 bits of variation in an 8-bit field leaves 2 bits. */
  450|       |
  451|       |	/*
  452|       |	 * Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields.
  453|       |	 */
  454|  5.77k|	if (validate_number_field(header->mode, sizeof(header->mode)) == 0
  ------------------
  |  Branch (454:6): [True: 292, False: 5.48k]
  ------------------
  455|  5.48k|	    || validate_number_field(header->uid, sizeof(header->uid)) == 0
  ------------------
  |  Branch (455:9): [True: 183, False: 5.30k]
  ------------------
  456|  5.30k|	    || validate_number_field(header->gid, sizeof(header->gid)) == 0
  ------------------
  |  Branch (456:9): [True: 482, False: 4.82k]
  ------------------
  457|  4.82k|	    || validate_number_field(header->mtime, sizeof(header->mtime)) == 0
  ------------------
  |  Branch (457:9): [True: 286, False: 4.53k]
  ------------------
  458|  4.53k|	    || validate_number_field(header->size, sizeof(header->size)) == 0
  ------------------
  |  Branch (458:9): [True: 181, False: 4.35k]
  ------------------
  459|  4.35k|	    || validate_number_field(header->rdevmajor, sizeof(header->rdevmajor)) == 0
  ------------------
  |  Branch (459:9): [True: 1.13k, False: 3.21k]
  ------------------
  460|  3.64k|	    || validate_number_field(header->rdevminor, sizeof(header->rdevminor)) == 0) {
  ------------------
  |  Branch (460:9): [True: 1.08k, False: 2.13k]
  ------------------
  461|  3.64k|		bid = 0;
  462|  3.64k|	}
  463|       |
  464|  5.77k|	return (bid);
  465|  5.78k|}
archive_read_support_format_tar.c:archive_block_is_null:
 1090|  55.6k|{
 1091|  55.6k|	unsigned i;
 1092|       |
 1093|  17.5M|	for (i = 0; i < 512; i++)
  ------------------
  |  Branch (1093:14): [True: 17.4M, False: 33.1k]
  ------------------
 1094|  17.4M|		if (*p++)
  ------------------
  |  Branch (1094:7): [True: 22.5k, False: 17.4M]
  ------------------
 1095|  22.5k|			return (0);
 1096|  33.1k|	return (1);
 1097|  55.6k|}
archive_read_support_format_tar.c:checksum:
 1030|   243k|{
 1031|   243k|	const unsigned char *bytes;
 1032|   243k|	const struct archive_entry_header_ustar	*header;
 1033|   243k|	int check, sum;
 1034|   243k|	size_t i;
 1035|       |
 1036|   243k|	(void)a; /* UNUSED */
 1037|   243k|	bytes = (const unsigned char *)h;
 1038|   243k|	header = (const struct archive_entry_header_ustar *)h;
 1039|       |
 1040|       |	/* Checksum field must hold an octal number */
 1041|   533k|	for (i = 0; i < sizeof(header->checksum); ++i) {
  ------------------
  |  Branch (1041:14): [True: 504k, False: 29.0k]
  ------------------
 1042|   504k|		char c = header->checksum[i];
 1043|   504k|		if (c != ' ' && c != '\0' && (c < '0' || c > '7'))
  ------------------
  |  Branch (1043:7): [True: 389k, False: 114k]
  |  Branch (1043:19): [True: 301k, False: 87.7k]
  |  Branch (1043:33): [True: 4.86k, False: 296k]
  |  Branch (1043:44): [True: 209k, False: 87.6k]
  ------------------
 1044|   213k|			return 0;
 1045|   504k|	}
 1046|       |
 1047|       |	/*
 1048|       |	 * Test the checksum.  Note that POSIX specifies _unsigned_
 1049|       |	 * bytes for this calculation.
 1050|       |	 */
 1051|  29.0k|	sum = (int)tar_atol(header->checksum, sizeof(header->checksum));
 1052|  29.0k|	check = 0;
 1053|  4.33M|	for (i = 0; i < 148; i++)
  ------------------
  |  Branch (1053:14): [True: 4.30M, False: 29.0k]
  ------------------
 1054|  4.30M|		check += (unsigned char)bytes[i];
 1055|   261k|	for (; i < 156; i++)
  ------------------
  |  Branch (1055:9): [True: 232k, False: 29.0k]
  ------------------
 1056|   232k|		check += 32;
 1057|  10.3M|	for (; i < 512; i++)
  ------------------
  |  Branch (1057:9): [True: 10.3M, False: 29.0k]
  ------------------
 1058|  10.3M|		check += (unsigned char)bytes[i];
 1059|  29.0k|	if (sum == check)
  ------------------
  |  Branch (1059:6): [True: 0, False: 29.0k]
  ------------------
 1060|      0|		return (1);
 1061|       |
 1062|       |	/*
 1063|       |	 * Repeat test with _signed_ bytes, just in case this archive
 1064|       |	 * was created by an old BSD, Solaris, or HP-UX tar with a
 1065|       |	 * broken checksum calculation.
 1066|       |	 */
 1067|  29.0k|	check = 0;
 1068|  4.33M|	for (i = 0; i < 148; i++)
  ------------------
  |  Branch (1068:14): [True: 4.30M, False: 29.0k]
  ------------------
 1069|  4.30M|		check += (signed char)bytes[i];
 1070|   261k|	for (; i < 156; i++)
  ------------------
  |  Branch (1070:9): [True: 232k, False: 29.0k]
  ------------------
 1071|   232k|		check += 32;
 1072|  10.3M|	for (; i < 512; i++)
  ------------------
  |  Branch (1072:9): [True: 10.3M, False: 29.0k]
  ------------------
 1073|  10.3M|		check += (signed char)bytes[i];
 1074|  29.0k|	if (sum == check)
  ------------------
  |  Branch (1074:6): [True: 0, False: 29.0k]
  ------------------
 1075|      0|		return (1);
 1076|       |
 1077|  29.0k|#if DONT_FAIL_ON_CRC_ERROR
 1078|       |	/* Speed up fuzzing by pretending the checksum is always right. */
 1079|  29.0k|	return (1);
 1080|       |#else
 1081|       |	return (0);
 1082|       |#endif
 1083|  29.0k|}
archive_read_support_format_tar.c:tar_atol:
 3512|   265k|{
 3513|       |	/*
 3514|       |	 * Technically, GNU tar considers a field to be in base-256
 3515|       |	 * only if the first byte is 0xff or 0x80.
 3516|       |	 */
 3517|   265k|	if (*p & 0x80)
  ------------------
  |  Branch (3517:6): [True: 2.00k, False: 263k]
  ------------------
 3518|  2.00k|		return (tar_atol256(p, char_cnt));
 3519|   263k|	return (tar_atol8(p, char_cnt));
 3520|   265k|}
archive_read_support_format_tar.c:tar_atol256:
 3595|  2.00k|{
 3596|  2.00k|	uint64_t l;
 3597|  2.00k|	const unsigned char *p = (const unsigned char *)_p;
 3598|  2.00k|	unsigned char c, neg;
 3599|       |
 3600|       |	/* Extend 7-bit 2s-comp to 8-bit 2s-comp, decide sign. */
 3601|  2.00k|	c = *p;
 3602|  2.00k|	if (c & 0x40) {
  ------------------
  |  Branch (3602:6): [True: 1.71k, False: 290]
  ------------------
 3603|  1.71k|		neg = 0xff;
 3604|  1.71k|		c |= 0x80;
 3605|  1.71k|		l = ~ARCHIVE_LITERAL_ULL(0);
  ------------------
  |  |  180|  1.71k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  ------------------
 3606|  1.71k|	} else {
 3607|    290|		neg = 0;
 3608|    290|		c &= 0x7f;
 3609|    290|		l = 0;
 3610|    290|	}
 3611|       |
 3612|       |	/* If more than 8 bytes, check that we can ignore
 3613|       |	 * high-order bits without overflow. */
 3614|  3.16k|	while (char_cnt > sizeof(int64_t)) {
  ------------------
  |  Branch (3614:9): [True: 1.25k, False: 1.91k]
  ------------------
 3615|  1.25k|		--char_cnt;
 3616|  1.25k|		if (c != neg)
  ------------------
  |  Branch (3616:7): [True: 91, False: 1.16k]
  ------------------
 3617|     91|			return neg ? INT64_MIN : INT64_MAX;
  ------------------
  |  Branch (3617:11): [True: 49, False: 42]
  ------------------
 3618|  1.16k|		c = *++p;
 3619|  1.16k|	}
 3620|       |
 3621|       |	/* c is first byte that fits; if sign mismatch, return overflow */
 3622|  1.91k|	if ((c ^ neg) & 0x80) {
  ------------------
  |  Branch (3622:6): [True: 148, False: 1.76k]
  ------------------
 3623|    148|		return neg ? INT64_MIN : INT64_MAX;
  ------------------
  |  Branch (3623:10): [True: 148, False: 0]
  ------------------
 3624|    148|	}
 3625|       |
 3626|       |	/* Accumulate remaining bytes. */
 3627|  14.0k|	while (--char_cnt > 0) {
  ------------------
  |  Branch (3627:9): [True: 12.3k, False: 1.76k]
  ------------------
 3628|  12.3k|		l = (l << 8) | c;
 3629|  12.3k|		c = *++p;
 3630|  12.3k|	}
 3631|  1.76k|	l = (l << 8) | c;
 3632|       |	/* Return signed twos-complement value. */
 3633|  1.76k|	return (int64_t)(l);
 3634|  1.91k|}
archive_read_support_format_tar.c:tar_atol8:
 3573|   263k|{
 3574|   263k|	return tar_atol_base_n(p, char_cnt, 8);
 3575|   263k|}
archive_read_support_format_tar.c:tar_atol_base_n:
 3529|   263k|{
 3530|   263k|	int64_t	l, maxval, limit, last_digit_limit;
 3531|   263k|	int digit, sign;
 3532|       |
 3533|   263k|	maxval = INT64_MAX;
 3534|   263k|	limit = INT64_MAX / base;
 3535|   263k|	last_digit_limit = INT64_MAX % base;
 3536|       |
 3537|       |	/* the pointer will not be dereferenced if char_cnt is zero
 3538|       |	 * due to the way the && operator is evaluated.
 3539|       |	 */
 3540|  1.02M|	while (char_cnt != 0 && (*p == ' ' || *p == '\t')) {
  ------------------
  |  Branch (3540:9): [True: 963k, False: 58.0k]
  |  Branch (3540:27): [True: 755k, False: 207k]
  |  Branch (3540:40): [True: 2.06k, False: 205k]
  ------------------
 3541|   757k|		p++;
 3542|   757k|		char_cnt--;
 3543|   757k|	}
 3544|       |
 3545|   263k|	sign = 1;
 3546|   263k|	if (char_cnt != 0 && *p == '-') {
  ------------------
  |  Branch (3546:6): [True: 205k, False: 58.0k]
  |  Branch (3546:23): [True: 3, False: 205k]
  ------------------
 3547|      3|		sign = -1;
 3548|      3|		p++;
 3549|      3|		char_cnt--;
 3550|       |
 3551|      3|		maxval = INT64_MIN;
 3552|      3|		limit = -(INT64_MIN / base);
 3553|      3|		last_digit_limit = -(INT64_MIN % base);
 3554|      3|	}
 3555|       |
 3556|   263k|	l = 0;
 3557|   263k|	if (char_cnt != 0) {
  ------------------
  |  Branch (3557:6): [True: 205k, False: 58.0k]
  ------------------
 3558|   205k|		digit = *p - '0';
 3559|   585k|		while (digit >= 0 && digit < base  && char_cnt != 0) {
  ------------------
  |  Branch (3559:10): [True: 469k, False: 116k]
  |  Branch (3559:24): [True: 393k, False: 75.1k]
  |  Branch (3559:41): [True: 379k, False: 14.1k]
  ------------------
 3560|   379k|			if (l>limit || (l == limit && digit >= last_digit_limit)) {
  ------------------
  |  Branch (3560:8): [True: 0, False: 379k]
  |  Branch (3560:20): [True: 0, False: 379k]
  |  Branch (3560:34): [True: 0, False: 0]
  ------------------
 3561|      0|				return maxval; /* Truncate on overflow. */
 3562|      0|			}
 3563|   379k|			l = (l * base) + digit;
 3564|   379k|			digit = *++p - '0';
 3565|   379k|			char_cnt--;
 3566|   379k|		}
 3567|   205k|	}
 3568|   263k|	return (sign < 0) ? -l : l;
  ------------------
  |  Branch (3568:9): [True: 3, False: 263k]
  ------------------
 3569|   263k|}
archive_read_support_format_tar.c:validate_number_field:
  373|  33.4k|{
  374|  33.4k|	unsigned char marker = (unsigned char)p_field[0];
  375|  33.4k|	if (marker == 128 || marker == 255 || marker == 0) {
  ------------------
  |  Branch (375:6): [True: 0, False: 33.4k]
  |  Branch (375:23): [True: 37, False: 33.4k]
  |  Branch (375:40): [True: 4.52k, False: 28.9k]
  ------------------
  376|       |		/* Base-256 marker, there's nothing we can check. */
  377|  4.55k|		return 1;
  378|  28.9k|	} else {
  379|       |		/* Must be octal */
  380|  28.9k|		size_t i = 0;
  381|       |		/* Skip any leading spaces */
  382|   160k|		while (i < i_size && p_field[i] == ' ') {
  ------------------
  |  Branch (382:10): [True: 151k, False: 8.98k]
  |  Branch (382:24): [True: 131k, False: 19.9k]
  ------------------
  383|   131k|			++i;
  384|   131k|		}
  385|       |		/* Skip octal digits. */
  386|   105k|		while (i < i_size && p_field[i] >= '0' && p_field[i] <= '7') {
  ------------------
  |  Branch (386:10): [True: 92.9k, False: 12.2k]
  |  Branch (386:24): [True: 78.4k, False: 14.5k]
  |  Branch (386:45): [True: 76.3k, False: 2.13k]
  ------------------
  387|  76.3k|			++i;
  388|  76.3k|		}
  389|       |		/* Any remaining characters must be space or NUL padding. */
  390|  67.9k|		while (i < i_size) {
  ------------------
  |  Branch (390:10): [True: 42.6k, False: 25.2k]
  ------------------
  391|  42.6k|			if (p_field[i] != ' ' && p_field[i] != 0) {
  ------------------
  |  Branch (391:8): [True: 24.4k, False: 18.1k]
  |  Branch (391:29): [True: 3.64k, False: 20.8k]
  ------------------
  392|  3.64k|				return 0;
  393|  3.64k|			}
  394|  39.0k|			++i;
  395|  39.0k|		}
  396|  25.2k|		return 1;
  397|  28.9k|	}
  398|  33.4k|}
archive_read_support_format_tar.c:archive_read_format_tar_options:
  470|  4.99k|{
  471|  4.99k|	struct tar *tar;
  472|  4.99k|	int ret = ARCHIVE_FAILED;
  ------------------
  |  |  237|  4.99k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  473|       |
  474|  4.99k|	tar = (struct tar *)(a->format->data);
  475|  4.99k|	if (strcmp(key, "compat-2x")  == 0) {
  ------------------
  |  Branch (475:6): [True: 0, False: 4.99k]
  ------------------
  476|       |		/* Handle UTF-8 filenames as libarchive 2.x */
  477|      0|		tar->compat_2x = (val != NULL && val[0] != 0);
  ------------------
  |  Branch (477:21): [True: 0, False: 0]
  |  Branch (477:36): [True: 0, False: 0]
  ------------------
  478|      0|		tar->init_default_conversion = tar->compat_2x;
  479|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  480|  4.99k|	} else if (strcmp(key, "hdrcharset")  == 0) {
  ------------------
  |  Branch (480:13): [True: 0, False: 4.99k]
  ------------------
  481|      0|		if (val == NULL || val[0] == 0)
  ------------------
  |  Branch (481:7): [True: 0, False: 0]
  |  Branch (481:22): [True: 0, False: 0]
  ------------------
  482|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  483|      0|			    "tar: hdrcharset option needs a character-set name");
  484|      0|		else {
  485|      0|			tar->opt_sconv =
  486|      0|			    archive_string_conversion_from_charset(
  487|      0|				&a->archive, val, 0);
  488|      0|			if (tar->opt_sconv != NULL)
  ------------------
  |  Branch (488:8): [True: 0, False: 0]
  ------------------
  489|      0|				ret = ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  490|      0|			else
  491|      0|				ret = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  492|      0|		}
  493|      0|		return (ret);
  494|  4.99k|	} else if (strcmp(key, "mac-ext") == 0) {
  ------------------
  |  Branch (494:13): [True: 2.49k, False: 2.49k]
  ------------------
  495|  2.49k|		tar->process_mac_extensions = (val != NULL && val[0] != 0);
  ------------------
  |  Branch (495:34): [True: 2.49k, False: 0]
  |  Branch (495:49): [True: 2.49k, False: 0]
  ------------------
  496|  2.49k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  497|  2.49k|	} else if (strcmp(key, "read_concatenated_archives") == 0) {
  ------------------
  |  Branch (497:13): [True: 2.49k, False: 0]
  ------------------
  498|  2.49k|		tar->read_concatenated_archives = (val != NULL && val[0] != 0);
  ------------------
  |  Branch (498:38): [True: 2.49k, False: 0]
  |  Branch (498:53): [True: 2.49k, False: 0]
  ------------------
  499|  2.49k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  500|  2.49k|	}
  501|       |
  502|       |	/* Note: The "warn" return is just to inform the options
  503|       |	 * supervisor that we didn't handle it.  It will generate
  504|       |	 * a suitable error if no one used this option. */
  505|      0|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  506|  4.99k|}
archive_read_support_format_tar.c:archive_read_format_tar_read_header:
  542|   233k|{
  543|       |	/*
  544|       |	 * When converting tar archives to cpio archives, it is
  545|       |	 * essential that each distinct file have a distinct inode
  546|       |	 * number.  To simplify this, we keep a static count here to
  547|       |	 * assign fake dev/inode numbers to each tar entry.  Note that
  548|       |	 * pax format archives may overwrite this with something more
  549|       |	 * useful.
  550|       |	 *
  551|       |	 * Ideally, we would track every file read from the archive so
  552|       |	 * that we could assign the same dev/ino pair to hardlinks,
  553|       |	 * but the memory required to store a complete lookup table is
  554|       |	 * probably not worthwhile just to support the relatively
  555|       |	 * obscure tar->cpio conversion case.
  556|       |	 */
  557|   233k|	struct tar *tar;
  558|   233k|	const char *p;
  559|   233k|	const wchar_t *wp;
  560|   233k|	int r;
  561|   233k|	size_t l;
  562|   233k|	int64_t unconsumed = 0;
  563|       |
  564|   233k|	tar = (struct tar *)(a->format->data);
  565|       |
  566|       |	/* Assign default device/inode values. */
  567|   233k|	archive_entry_set_dev(entry, 1 + tar->default_dev); /* Don't use zero. */
  568|   233k|	archive_entry_set_ino(entry, ++tar->default_inode); /* Don't use zero. */
  569|       |	/* Limit generated st_ino number to 16 bits. */
  570|   233k|	if (tar->default_inode >= 0xffff) {
  ------------------
  |  Branch (570:6): [True: 2, False: 233k]
  ------------------
  571|      2|		++tar->default_dev;
  572|      2|		tar->default_inode = 0;
  573|      2|	}
  574|       |
  575|   233k|	tar->entry_offset = 0;
  576|   233k|	gnu_clear_sparse_list(tar);
  577|   233k|	tar->size_fields = 0; /* We don't have any size info yet */
  578|       |
  579|       |	/* Setup default string conversion. */
  580|   233k|	tar->sconv = tar->opt_sconv;
  581|   233k|	if (tar->sconv == NULL) {
  ------------------
  |  Branch (581:6): [True: 233k, False: 0]
  ------------------
  582|   233k|		if (!tar->init_default_conversion) {
  ------------------
  |  Branch (582:7): [True: 342, False: 233k]
  ------------------
  583|    342|			tar->sconv_default =
  584|    342|			    archive_string_default_conversion_for_read(&(a->archive));
  585|    342|			tar->init_default_conversion = 1;
  586|    342|		}
  587|   233k|		tar->sconv = tar->sconv_default;
  588|   233k|	}
  589|       |
  590|   233k|	r = tar_read_header(a, tar, entry, &unconsumed);
  591|       |
  592|   233k|	tar_flush_unconsumed(a, &unconsumed);
  593|       |
  594|       |	/*
  595|       |	 * "non-sparse" files are really just sparse files with
  596|       |	 * a single block.
  597|       |	 */
  598|   233k|	if (tar->sparse_list == NULL) {
  ------------------
  |  Branch (598:6): [True: 232k, False: 1.56k]
  ------------------
  599|   232k|		if (gnu_add_sparse_entry(a, tar, 0, tar->entry_bytes_remaining)
  ------------------
  |  Branch (599:7): [True: 0, False: 232k]
  ------------------
  600|   232k|		    != ARCHIVE_OK)
  ------------------
  |  |  233|   232k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  601|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  602|   232k|	} else {
  603|  1.56k|		struct sparse_block *sb;
  604|       |
  605|  40.7k|		for (sb = tar->sparse_list; sb != NULL; sb = sb->next) {
  ------------------
  |  Branch (605:31): [True: 39.1k, False: 1.56k]
  ------------------
  606|  39.1k|			if (!sb->hole)
  ------------------
  |  Branch (606:8): [True: 39.1k, False: 0]
  ------------------
  607|  39.1k|				archive_entry_sparse_add_entry(entry,
  608|  39.1k|				    sb->offset, sb->remaining);
  609|  39.1k|		}
  610|  1.56k|	}
  611|       |
  612|   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 (612:6): [True: 21.0k, False: 212k]
  |  Branch (612:25): [True: 18.8k, False: 2.24k]
  ------------------
  613|       |		/*
  614|       |		 * "Regular" entry with trailing '/' is really
  615|       |		 * directory: This is needed for certain old tar
  616|       |		 * variants and even for some broken newer ones.
  617|       |		 */
  618|  18.8k|		if ((wp = archive_entry_pathname_w(entry)) != NULL) {
  ------------------
  |  Branch (618:7): [True: 18.1k, False: 646]
  ------------------
  619|  18.1k|			l = wcslen(wp);
  620|  18.1k|			if (l > 0 && wp[l - 1] == L'/') {
  ------------------
  |  Branch (620:8): [True: 12.1k, False: 5.98k]
  |  Branch (620:17): [True: 4.98k, False: 7.19k]
  ------------------
  621|  4.98k|				archive_entry_set_filetype(entry, AE_IFDIR);
  ------------------
  |  |  221|  4.98k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  622|  4.98k|				tar->entry_bytes_remaining = 0;
  623|  4.98k|				tar->entry_padding = 0;
  624|  4.98k|			}
  625|  18.1k|		} else if ((p = archive_entry_pathname(entry)) != NULL) {
  ------------------
  |  Branch (625:14): [True: 646, False: 0]
  ------------------
  626|    646|			l = strlen(p);
  627|    646|			if (l > 0 && p[l - 1] == '/') {
  ------------------
  |  Branch (627:8): [True: 646, False: 0]
  |  Branch (627:17): [True: 232, False: 414]
  ------------------
  628|    232|				archive_entry_set_filetype(entry, AE_IFDIR);
  ------------------
  |  |  221|    232|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  629|    232|				tar->entry_bytes_remaining = 0;
  630|    232|				tar->entry_padding = 0;
  631|    232|			}
  632|    646|		}
  633|  18.8k|	}
  634|   233k|	return (r);
  635|   233k|}
archive_read_support_format_tar.c:tar_read_header:
  749|   233k|{
  750|   233k|	ssize_t bytes;
  751|   233k|	int err = ARCHIVE_OK, err2;
  ------------------
  |  |  233|   233k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  752|   233k|	int eof_fatal = 0; /* EOF is okay at some points... */
  753|   233k|	const char *h;
  754|   233k|	const struct archive_entry_header_ustar *header;
  755|   233k|	const struct archive_entry_header_gnutar *gnuheader;
  756|       |
  757|       |	/* Bitmask of what header types we've seen. */
  758|   233k|	int32_t seen_headers = 0;
  759|   233k|	static const int32_t seen_A_header = 1;
  760|   233k|	static const int32_t seen_g_header = 2;
  761|   233k|	static const int32_t seen_K_header = 4;
  762|   233k|	static const int32_t seen_L_header = 8;
  763|   233k|	static const int32_t seen_V_header = 16;
  764|   233k|	static const int32_t seen_x_header = 32; /* Also X */
  765|   233k|	static const int32_t seen_mac_metadata = 512;
  766|       |
  767|   233k|	tar_reset_header_state(tar);
  768|       |
  769|       |	/* Ensure format is set. */
  770|   233k|	if (a->archive.archive_format_name == NULL) {
  ------------------
  |  Branch (770:6): [True: 342, False: 233k]
  ------------------
  771|    342|		a->archive.archive_format = ARCHIVE_FORMAT_TAR;
  ------------------
  |  |  367|    342|#define	ARCHIVE_FORMAT_TAR			0x30000
  ------------------
  772|    342|		a->archive.archive_format_name = "tar";
  773|    342|	}
  774|       |
  775|       |	/*
  776|       |	 * TODO: Write global/default pax options into
  777|       |	 * 'entry' struct here before overwriting with
  778|       |	 * file-specific options.
  779|       |	 */
  780|       |
  781|       |	/* Loop over all the headers needed for the next entry */
  782|   235k|	for (;;) {
  783|       |
  784|       |		/* Find the next valid header record. */
  785|   268k|		while (1) {
  ------------------
  |  Branch (785:10): [True: 268k, Folded]
  ------------------
  786|   268k|			if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|   268k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (786:8): [True: 78, False: 268k]
  ------------------
  787|     78|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     78|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  788|     78|			}
  789|       |
  790|       |			/* Read 512-byte header record */
  791|   268k|			h = __archive_read_ahead(a, 512, &bytes);
  792|   268k|			if (bytes == 0) { /* EOF at a block boundary. */
  ------------------
  |  Branch (792:8): [True: 16, False: 268k]
  ------------------
  793|     16|				if (eof_fatal) {
  ------------------
  |  Branch (793:9): [True: 8, False: 8]
  ------------------
  794|       |					/* We've read a special header already;
  795|       |					 * if there's no regular header, then this is
  796|       |					 * a premature EOF. */
  797|      8|					archive_set_error(&a->archive, EINVAL,
  798|      8|							  "Damaged tar archive (end-of-archive within a sequence of headers)");
  799|      8|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  800|      8|				} else {
  801|      8|					return (ARCHIVE_EOF);
  ------------------
  |  |  232|      8|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  802|      8|				}
  803|     16|			}
  804|   268k|			if (h == NULL) {  /* Short block at EOF; this is bad. */
  ------------------
  |  Branch (804:8): [True: 190, False: 268k]
  ------------------
  805|    190|				archive_set_error(&a->archive,
  806|    190|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    190|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  807|    190|				    "Truncated tar archive"
  808|    190|				    " detected while reading next header");
  809|    190|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    190|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  810|    190|			}
  811|   268k|			*unconsumed += 512;
  812|       |
  813|   268k|			if (h[0] == 0 && archive_block_is_null(h)) {
  ------------------
  |  Branch (813:8): [True: 50.5k, False: 217k]
  |  Branch (813:21): [True: 32.9k, False: 17.5k]
  ------------------
  814|       |				/* We found a NULL block which indicates end-of-archive */
  815|       |
  816|  32.9k|				if (tar->read_concatenated_archives) {
  ------------------
  |  Branch (816:9): [True: 32.9k, False: 0]
  ------------------
  817|       |					/* We're ignoring NULL blocks, so keep going. */
  818|  32.9k|					continue;
  819|  32.9k|				}
  820|       |
  821|       |				/* Try to consume a second all-null record, as well. */
  822|       |				/* If we can't, that's okay. */
  823|      0|				tar_flush_unconsumed(a, unconsumed);
  824|      0|				h = __archive_read_ahead(a, 512, NULL);
  825|      0|				if (h != NULL && h[0] == 0 && archive_block_is_null(h))
  ------------------
  |  Branch (825:9): [True: 0, False: 0]
  |  Branch (825:22): [True: 0, False: 0]
  |  Branch (825:35): [True: 0, False: 0]
  ------------------
  826|      0|						__archive_read_consume(a, 512);
  827|       |
  828|      0|				archive_clear_error(&a->archive);
  829|      0|				return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  830|  32.9k|			}
  831|       |
  832|       |			/* This is NOT a null block, so it must be a valid header. */
  833|   235k|			if (!checksum(a, h)) {
  ------------------
  |  Branch (833:8): [True: 212k, False: 23.2k]
  ------------------
  834|   212k|				if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|   212k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (834:9): [True: 0, False: 212k]
  ------------------
  835|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  836|      0|				}
  837|   212k|				archive_set_error(&a->archive, EINVAL,
  838|   212k|						  "Damaged tar archive (bad header checksum)");
  839|       |				/* If we've read some critical information (pax headers, etc)
  840|       |				 * and _then_ see a bad header, we can't really recover. */
  841|   212k|				if (eof_fatal) {
  ------------------
  |  Branch (841:9): [True: 12, False: 212k]
  ------------------
  842|     12|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  843|   212k|				} else {
  844|   212k|					return (ARCHIVE_RETRY);
  ------------------
  |  |  234|   212k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  845|   212k|				}
  846|   212k|			}
  847|  23.2k|			break;
  848|   235k|		}
  849|       |
  850|       |		/* Determine the format variant. */
  851|  23.2k|		header = (const struct archive_entry_header_ustar *)h;
  852|  23.2k|		switch(header->typeflag[0]) {
  853|    122|		case 'A': /* Solaris tar ACL */
  ------------------
  |  Branch (853:3): [True: 122, False: 23.1k]
  ------------------
  854|    122|			if (seen_headers & seen_A_header) {
  ------------------
  |  Branch (854:8): [True: 0, False: 122]
  ------------------
  855|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  856|      0|						  "Redundant 'A' header");
  857|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  858|      0|			}
  859|    122|			seen_headers |= seen_A_header;
  860|    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
  |  |  ------------------
  ------------------
  861|    122|			a->archive.archive_format_name = "Solaris tar";
  862|    122|			err2 = header_Solaris_ACL(a, tar, entry, h, unconsumed);
  863|    122|			break;
  864|  1.24k|		case 'g': /* POSIX-standard 'g' header. */
  ------------------
  |  Branch (864:3): [True: 1.24k, False: 22.0k]
  ------------------
  865|  1.24k|			if (seen_headers & seen_g_header) {
  ------------------
  |  Branch (865:8): [True: 0, False: 1.24k]
  ------------------
  866|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  867|      0|						  "Redundant 'g' header");
  868|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  869|      0|			}
  870|  1.24k|			seen_headers |= seen_g_header;
  871|  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
  |  |  ------------------
  ------------------
  872|  1.24k|			a->archive.archive_format_name = "POSIX pax interchange format";
  873|  1.24k|			err2 = header_pax_global(a, tar, entry, h, unconsumed);
  874|  1.24k|			break;
  875|    379|		case 'K': /* Long link name (GNU tar, others) */
  ------------------
  |  Branch (875:3): [True: 379, False: 22.9k]
  ------------------
  876|    379|			if (seen_headers & seen_K_header) {
  ------------------
  |  Branch (876:8): [True: 369, False: 10]
  ------------------
  877|    369|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    369|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  878|    369|						  "Damaged archive: Redundant 'K' headers may cause linknames to be incorrect");
  879|    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]
  |  |  ------------------
  ------------------
  880|    369|			}
  881|    379|			seen_headers |= seen_K_header;
  882|    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
  |  |  ------------------
  ------------------
  883|    379|			a->archive.archive_format_name = "GNU tar format";
  884|    379|			err2 = header_gnu_longlink(a, tar, entry, h, unconsumed);
  885|    379|			break;
  886|    146|		case 'L': /* Long filename (GNU tar, others) */
  ------------------
  |  Branch (886:3): [True: 146, False: 23.1k]
  ------------------
  887|    146|			if (seen_headers & seen_L_header) {
  ------------------
  |  Branch (887:8): [True: 143, False: 3]
  ------------------
  888|    143|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    143|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  889|    143|						  "Damaged archive: Redundant 'L' headers may cause filenames to be incorrect");
  890|    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]
  |  |  ------------------
  ------------------
  891|    143|			}
  892|    146|			seen_headers |= seen_L_header;
  893|    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
  |  |  ------------------
  ------------------
  894|    146|			a->archive.archive_format_name = "GNU tar format";
  895|    146|			err2 = header_gnu_longname(a, tar, entry, h, unconsumed);
  896|    146|			break;
  897|      0|		case 'V': /* GNU volume header */
  ------------------
  |  Branch (897:3): [True: 0, False: 23.2k]
  ------------------
  898|      0|			if (seen_headers & seen_V_header) {
  ------------------
  |  Branch (898:8): [True: 0, False: 0]
  ------------------
  899|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  900|      0|						  "Redundant 'V' header");
  901|      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]
  |  |  ------------------
  ------------------
  902|      0|			}
  903|      0|			seen_headers |= seen_V_header;
  904|      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
  |  |  ------------------
  ------------------
  905|      0|			a->archive.archive_format_name = "GNU tar format";
  906|      0|			err2 = header_volume(a, tar, entry, h, unconsumed);
  907|      0|			break;
  908|      0|		case 'X': /* Used by SUN tar; same as 'x'. */
  ------------------
  |  Branch (908:3): [True: 0, False: 23.2k]
  ------------------
  909|      0|			if (seen_headers & seen_x_header) {
  ------------------
  |  Branch (909:8): [True: 0, False: 0]
  ------------------
  910|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  911|      0|						  "Redundant 'X'/'x' header");
  912|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  913|      0|			}
  914|      0|			seen_headers |= seen_x_header;
  915|      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
  |  |  ------------------
  ------------------
  916|      0|			a->archive.archive_format_name =
  917|      0|				"POSIX pax interchange format (Sun variant)";
  918|      0|			err2 = header_pax_extension(a, tar, entry, h, unconsumed);
  919|      0|			break;
  920|    146|		case 'x': /* POSIX-standard 'x' header. */
  ------------------
  |  Branch (920:3): [True: 146, False: 23.1k]
  ------------------
  921|    146|			if (seen_headers & seen_x_header) {
  ------------------
  |  Branch (921:8): [True: 0, False: 146]
  ------------------
  922|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  923|      0|						  "Redundant 'x' header");
  924|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  925|      0|			}
  926|    146|			seen_headers |= seen_x_header;
  927|    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
  |  |  ------------------
  ------------------
  928|    146|			a->archive.archive_format_name = "POSIX pax interchange format";
  929|    146|			err2 = header_pax_extension(a, tar, entry, h, unconsumed);
  930|    146|			break;
  931|  21.2k|		default: /* Regular header: Legacy tar, GNU tar, or ustar */
  ------------------
  |  Branch (931:3): [True: 21.2k, False: 2.04k]
  ------------------
  932|  21.2k|			gnuheader = (const struct archive_entry_header_gnutar *)h;
  933|  21.2k|			if (memcmp(gnuheader->magic, "ustar  \0", 8) == 0) {
  ------------------
  |  Branch (933:8): [True: 1.84k, False: 19.3k]
  ------------------
  934|  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
  |  |  ------------------
  ------------------
  935|  1.84k|				a->archive.archive_format_name = "GNU tar format";
  936|  1.84k|				err2 = header_gnutar(a, tar, entry, h, unconsumed);
  937|  19.3k|			} else if (memcmp(header->magic, "ustar", 5) == 0) {
  ------------------
  |  Branch (937:15): [True: 6.16k, False: 13.2k]
  ------------------
  938|  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 (938:9): [True: 5.92k, False: 241]
  ------------------
  939|  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
  |  |  ------------------
  ------------------
  940|  5.92k|					a->archive.archive_format_name = "POSIX ustar format";
  941|  5.92k|				}
  942|  6.16k|				err2 = header_ustar(a, tar, entry, h);
  943|  13.2k|			} else {
  944|  13.2k|				a->archive.archive_format = ARCHIVE_FORMAT_TAR;
  ------------------
  |  |  367|  13.2k|#define	ARCHIVE_FORMAT_TAR			0x30000
  ------------------
  945|  13.2k|				a->archive.archive_format_name = "tar (non-POSIX)";
  946|  13.2k|				err2 = header_old_tar(a, tar, entry, h);
  947|  13.2k|			}
  948|  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]
  |  |  ------------------
  ------------------
  949|       |			/* We return warnings or success as-is.  Anything else is fatal. */
  950|  21.2k|			if (err < ARCHIVE_WARN) {
  ------------------
  |  |  235|  21.2k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (950:8): [True: 19, False: 21.2k]
  ------------------
  951|     19|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     19|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  952|     19|			}
  953|       |			/* Filename of the form `._filename` is an AppleDouble
  954|       |			 * extension entry.  The body is the macOS metadata blob;
  955|       |			 * this is followed by another entry with the actual
  956|       |			 * regular file data.
  957|       |			 * This design has two drawbacks:
  958|       |			 * = it's brittle; you might just have a file with such a name
  959|       |			 * = it duplicates any long pathname extensions
  960|       |			 *
  961|       |			 * TODO: This probably shouldn't be here at all.  Consider
  962|       |			 * just returning the contents as a regular entry here and
  963|       |			 * then dealing with it when we write data to disk.
  964|       |			 */
  965|  21.2k|			if (tar->process_mac_extensions
  ------------------
  |  Branch (965:8): [True: 21.2k, False: 0]
  ------------------
  966|  21.2k|			    && ((seen_headers & seen_mac_metadata) == 0)
  ------------------
  |  Branch (966:11): [True: 21.2k, False: 0]
  ------------------
  967|  21.2k|			    && is_mac_metadata_entry(entry)) {
  ------------------
  |  Branch (967:11): [True: 0, False: 21.2k]
  ------------------
  968|      0|				err2 = read_mac_metadata_blob(a, entry, unconsumed);
  969|      0|				if (err2 < ARCHIVE_WARN) {
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (969:9): [True: 0, False: 0]
  ------------------
  970|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  971|      0|				}
  972|      0|				err = err_combine(err, err2);
  ------------------
  |  |  173|      0|#define	err_combine(a,b)	((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (173:27): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  973|       |				/* Note: Other headers can appear again. */
  974|      0|				seen_headers = seen_mac_metadata;
  975|      0|				tar_reset_header_state(tar);
  976|      0|				break;
  977|      0|			}
  978|       |
  979|       |			/* Reconcile GNU sparse attributes */
  980|  21.2k|			if (tar->sparse_gnu_attributes_seen) {
  ------------------
  |  Branch (980:8): [True: 25, False: 21.1k]
  ------------------
  981|       |				/* Only 'S' (GNU sparse) and ustar '0' regular files can be sparse */
  982|     25|				if (tar->filetype != 'S' && tar->filetype != '0') {
  ------------------
  |  Branch (982:9): [True: 25, False: 0]
  |  Branch (982:33): [True: 14, False: 11]
  ------------------
  983|     14|					archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     14|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  984|     14|							  "Non-regular file cannot be sparse");
  985|     14|					return (ARCHIVE_WARN);
  ------------------
  |  |  235|     14|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  986|     14|				} else if (tar->sparse_gnu_major == 0 &&
  ------------------
  |  Branch (986:16): [True: 8, False: 3]
  ------------------
  987|      8|				    tar->sparse_gnu_minor == 0) {
  ------------------
  |  Branch (987:9): [True: 5, False: 3]
  ------------------
  988|       |					/* Sparse map already parsed from 'x' header */
  989|      6|				} else if (tar->sparse_gnu_major == 0 &&
  ------------------
  |  Branch (989:16): [True: 3, False: 3]
  ------------------
  990|      3|				    tar->sparse_gnu_minor == 1) {
  ------------------
  |  Branch (990:9): [True: 0, False: 3]
  ------------------
  991|       |					/* Sparse map already parsed from 'x' header */
  992|      6|				} else if (tar->sparse_gnu_major == 1 &&
  ------------------
  |  Branch (992:16): [True: 3, False: 3]
  ------------------
  993|      3|				    tar->sparse_gnu_minor == 0) {
  ------------------
  |  Branch (993:9): [True: 3, False: 0]
  ------------------
  994|       |					/* Sparse map is prepended to file contents */
  995|      3|					ssize_t bytes_read;
  996|      3|					bytes_read = gnu_sparse_10_read(a, tar, unconsumed);
  997|      3|					if (bytes_read < 0)
  ------------------
  |  Branch (997:10): [True: 3, False: 0]
  ------------------
  998|      3|						return ((int)bytes_read);
  999|      0|					tar->entry_bytes_remaining -= bytes_read;
 1000|      3|				} else {
 1001|      3|					archive_set_error(&a->archive,
 1002|      3|							  ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1003|      3|							  "Unrecognized GNU sparse file format");
 1004|      3|					return (ARCHIVE_WARN);
  ------------------
  |  |  235|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1005|      3|				}
 1006|     25|			}
 1007|  21.2k|			return (err);
 1008|  23.2k|		}
 1009|       |
 1010|       |		/* We're between headers ... */
 1011|  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]
  |  |  ------------------
  ------------------
 1012|  2.04k|		if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|  2.04k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1012:7): [True: 9, False: 2.03k]
  ------------------
 1013|      9|			return (err);
 1014|       |
 1015|       |		/* The GNU volume header and the pax `g` global header
 1016|       |		 * are both allowed to be the only header in an
 1017|       |		 * archive.  If we've seen any other header, a
 1018|       |		 * following EOF is fatal. */
 1019|  2.03k|		if ((seen_headers & ~seen_V_header & ~seen_g_header) != 0) {
  ------------------
  |  Branch (1019:7): [True: 784, False: 1.24k]
  ------------------
 1020|    784|			eof_fatal = 1;
 1021|    784|		}
 1022|  2.03k|	}
 1023|   233k|}
archive_read_support_format_tar.c:tar_reset_header_state:
  732|   233k|{
  733|   233k|	tar->pax_hdrcharset_utf8 = 1;
  734|   233k|	tar->sparse_gnu_attributes_seen = 0;
  735|   233k|	archive_string_empty(&(tar->entry_gname));
  ------------------
  |  |  181|   233k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  736|   233k|	archive_string_empty(&(tar->entry_pathname));
  ------------------
  |  |  181|   233k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  737|   233k|	archive_string_empty(&(tar->entry_pathname_override));
  ------------------
  |  |  181|   233k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  738|   233k|	archive_string_empty(&(tar->entry_uname));
  ------------------
  |  |  181|   233k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  739|   233k|	archive_string_empty(&tar->entry_linkpath);
  ------------------
  |  |  181|   233k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  740|   233k|}
archive_read_support_format_tar.c:header_Solaris_ACL:
 1105|    122|{
 1106|    122|	const struct archive_entry_header_ustar *header;
 1107|    122|	struct archive_string	 acl_text;
 1108|    122|	size_t size;
 1109|    122|	int err, acl_type;
 1110|    122|	uint64_t type;
 1111|    122|	char *acl, *p;
 1112|       |
 1113|    122|	header = (const struct archive_entry_header_ustar *)h;
 1114|    122|	size = (size_t)tar_atol(header->size, sizeof(header->size));
 1115|    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]
  |  |  ------------------
  ------------------
 1116|    122|	err = read_body_to_string(a, tar, &acl_text, h, unconsumed);
 1117|    122|	if (err != ARCHIVE_OK) {
  ------------------
  |  |  233|    122|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1117:6): [True: 6, False: 116]
  ------------------
 1118|      6|		archive_string_free(&acl_text);
 1119|      6|		return (err);
 1120|      6|	}
 1121|       |
 1122|       |	/* TODO: Examine the first characters to see if this
 1123|       |	 * is an AIX ACL descriptor.  We'll likely never support
 1124|       |	 * them, but it would be polite to recognize and warn when
 1125|       |	 * we do see them. */
 1126|       |
 1127|       |	/* Leading octal number indicates ACL type and number of entries. */
 1128|    116|	p = acl = acl_text.s;
 1129|    116|	type = 0;
 1130|    928|	while (*p != '\0' && p < acl + size) {
  ------------------
  |  Branch (1130:9): [True: 812, False: 116]
  |  Branch (1130:23): [True: 812, False: 0]
  ------------------
 1131|    812|		if (*p < '0' || *p > '7') {
  ------------------
  |  Branch (1131:7): [True: 0, False: 812]
  |  Branch (1131:19): [True: 0, False: 812]
  ------------------
 1132|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1133|      0|			    "Malformed Solaris ACL attribute (invalid digit)");
 1134|      0|			archive_string_free(&acl_text);
 1135|      0|			return(ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1136|      0|		}
 1137|    812|		type <<= 3;
 1138|    812|		type += *p - '0';
 1139|    812|		if (type > 077777777) {
  ------------------
  |  Branch (1139:7): [True: 0, False: 812]
  ------------------
 1140|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1141|      0|			    "Malformed Solaris ACL attribute (count too large)");
 1142|      0|			archive_string_free(&acl_text);
 1143|      0|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1144|      0|		}
 1145|    812|		p++;
 1146|    812|	}
 1147|    116|	switch (type & ~0777777) {
 1148|     89|	case 01000000:
  ------------------
  |  Branch (1148:2): [True: 89, False: 27]
  ------------------
 1149|       |		/* POSIX.1e ACL */
 1150|     89|		acl_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS;
  ------------------
  |  |  534|     89|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
 1151|     89|		break;
 1152|     27|	case 03000000:
  ------------------
  |  Branch (1152:2): [True: 27, False: 89]
  ------------------
 1153|       |		/* NFSv4 ACL */
 1154|     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 */
  |  |  ------------------
  ------------------
 1155|     27|		break;
 1156|      0|	default:
  ------------------
  |  Branch (1156:2): [True: 0, False: 116]
  ------------------
 1157|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1158|      0|		    "Malformed Solaris ACL attribute (unsupported type %llu)",
 1159|      0|		    (unsigned long long)type);
 1160|      0|		archive_string_free(&acl_text);
 1161|      0|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1162|    116|	}
 1163|    116|	p++;
 1164|       |
 1165|    116|	if (p >= acl + size) {
  ------------------
  |  Branch (1165:6): [True: 0, False: 116]
  ------------------
 1166|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1167|      0|		    "Malformed Solaris ACL attribute (body overflow)");
 1168|      0|		archive_string_free(&acl_text);
 1169|      0|		return(ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1170|      0|	}
 1171|       |
 1172|       |	/* ACL text is null-terminated; find the end. */
 1173|    116|	size -= (p - acl);
 1174|    116|	acl = p;
 1175|       |
 1176|   251k|	while (*p != '\0' && p < acl + size)
  ------------------
  |  Branch (1176:9): [True: 251k, False: 116]
  |  Branch (1176:23): [True: 251k, False: 0]
  ------------------
 1177|   251k|		p++;
 1178|       |
 1179|    116|	if (tar->sconv_acl == NULL) {
  ------------------
  |  Branch (1179:6): [True: 83, False: 33]
  ------------------
 1180|     83|		tar->sconv_acl = archive_string_conversion_from_charset(
 1181|     83|		    &(a->archive), "UTF-8", 1);
 1182|     83|		if (tar->sconv_acl == NULL) {
  ------------------
  |  Branch (1182:7): [True: 0, False: 83]
  ------------------
 1183|      0|			archive_string_free(&acl_text);
 1184|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1185|      0|		}
 1186|     83|	}
 1187|    116|	archive_strncpy(&(tar->localname), acl, p - acl);
  ------------------
  |  |  173|    116|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1188|    116|	err = archive_acl_from_text_l(archive_entry_acl(entry),
 1189|    116|	    tar->localname.s, acl_type, tar->sconv_acl);
 1190|       |	/* Workaround: Force perm_is_set() to be correct */
 1191|       |	/* If this bit were stored in the ACL, this wouldn't be needed */
 1192|    116|	archive_entry_set_perm(entry, archive_entry_perm(entry));
 1193|    116|	if (err != ARCHIVE_OK) {
  ------------------
  |  |  233|    116|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1193:6): [True: 116, False: 0]
  ------------------
 1194|    116|		if (errno == ENOMEM) {
  ------------------
  |  Branch (1194:7): [True: 0, False: 116]
  ------------------
 1195|      0|			archive_set_error(&a->archive, ENOMEM,
 1196|      0|			    "Can't allocate memory for ACL");
 1197|      0|		} else
 1198|    116|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    116|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1199|    116|			    "Malformed Solaris ACL attribute (unparsable)");
 1200|    116|	}
 1201|    116|	archive_string_free(&acl_text);
 1202|    116|	return (err);
 1203|    116|}
archive_read_support_format_tar.c:read_body_to_string:
 1327|    647|{
 1328|    647|	int64_t size;
 1329|    647|	const struct archive_entry_header_ustar *header;
 1330|    647|	int r;
 1331|       |
 1332|    647|	(void)tar; /* UNUSED */
 1333|    647|	header = (const struct archive_entry_header_ustar *)h;
 1334|    647|	size  = tar_atol(header->size, sizeof(header->size));
 1335|    647|	if (size < 0 || size > entry_limit) {
  ------------------
  |  Branch (1335:6): [True: 1, False: 646]
  |  Branch (1335:18): [True: 0, False: 646]
  ------------------
 1336|      1|		archive_set_error(&a->archive, EINVAL,
 1337|      1|		    "Special header has invalid size: %lld",
 1338|      1|		    (long long)size);
 1339|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1340|      1|	}
 1341|    646|	if (size > (int64_t)pathname_limit) {
  ------------------
  |  Branch (1341:6): [True: 4, False: 642]
  ------------------
 1342|      4|		archive_string_empty(as);
  ------------------
  |  |  181|      4|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1343|      4|		int64_t to_consume = ((size + 511) & ~511);
 1344|      4|		if (to_consume != __archive_read_consume(a, to_consume)) {
  ------------------
  |  Branch (1344:7): [True: 1, False: 3]
  ------------------
 1345|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1346|      1|		}
 1347|      3|		archive_set_error(&a->archive, EINVAL,
 1348|      3|		    "Special header too large: %lld > 1MiB",
 1349|      3|		    (long long)size);
 1350|      3|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1351|      4|	}
 1352|    642|	r = read_bytes_to_string(a, as, size, unconsumed);
 1353|    642|	*unconsumed += 0x1ff & (-size);
 1354|    642|	return(r);
 1355|    646|}
archive_read_support_format_tar.c:read_bytes_to_string:
 1291|    808|		     int64_t *unconsumed) {
 1292|    808|	const void *src;
 1293|       |
 1294|       |	/* Fail if we can't make our buffer big enough. */
 1295|    808|	if (archive_string_ensure(as, size + 1) == NULL) {
  ------------------
  |  Branch (1295:6): [True: 0, False: 808]
  ------------------
 1296|      0|		archive_set_error(&a->archive, ENOMEM,
 1297|      0|		    "No memory");
 1298|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1299|      0|	}
 1300|       |
 1301|    808|	if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|    808|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1301:6): [True: 0, False: 808]
  ------------------
 1302|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1303|      0|	}
 1304|       |
 1305|       |	/* Read the body into the string. */
 1306|    808|	src = __archive_read_ahead(a, size, NULL);
 1307|    808|	if (src == NULL) {
  ------------------
  |  Branch (1307:6): [True: 1, False: 807]
  ------------------
 1308|      1|		archive_set_error(&a->archive, EINVAL,
 1309|      1|		    "Truncated archive"
 1310|      1|		    " detected while reading metadata");
 1311|      1|		*unconsumed = 0;
 1312|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1313|      1|	}
 1314|    807|	memcpy(as->s, src, size);
 1315|    807|	as->s[size] = '\0';
 1316|    807|	as->length = size;
 1317|    807|	*unconsumed += size;
 1318|    807|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    807|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1319|    808|}
archive_read_support_format_tar.c:header_pax_global:
 1785|  1.24k|{
 1786|  1.24k|	const struct archive_entry_header_ustar *header;
 1787|  1.24k|	int64_t size, to_consume;
 1788|       |
 1789|  1.24k|	(void)a; /* UNUSED */
 1790|  1.24k|	(void)tar; /* UNUSED */
 1791|  1.24k|	(void)entry; /* UNUSED */
 1792|       |
 1793|  1.24k|	header = (const struct archive_entry_header_ustar *)h;
 1794|  1.24k|	size = tar_atol(header->size, sizeof(header->size));
 1795|  1.24k|	if (size < 0 || size > entry_limit) {
  ------------------
  |  Branch (1795:6): [True: 0, False: 1.24k]
  |  Branch (1795:18): [True: 0, False: 1.24k]
  ------------------
 1796|      0|		archive_set_error(&a->archive, EINVAL,
 1797|      0|		    "Special header has invalid size: %lld",
 1798|      0|		    (long long)size);
 1799|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1800|      0|	}
 1801|  1.24k|	to_consume = ((size + 511) & ~511);
 1802|  1.24k|	*unconsumed += to_consume;
 1803|  1.24k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.24k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1804|  1.24k|}
archive_read_support_format_tar.c:header_gnu_longlink:
 1211|    379|{
 1212|    379|	int err;
 1213|       |
 1214|    379|	struct archive_string linkpath;
 1215|    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]
  |  |  ------------------
  ------------------
 1216|    379|	err = read_body_to_string(a, tar, &linkpath, h, unconsumed);
 1217|    379|	if (err == ARCHIVE_OK) {
  ------------------
  |  |  233|    379|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1217:6): [True: 379, False: 0]
  ------------------
 1218|    379|		archive_entry_set_link(entry, linkpath.s);
 1219|    379|	}
 1220|    379|	archive_string_free(&linkpath);
 1221|    379|	return (err);
 1222|    379|}
archive_read_support_format_tar.c:header_gnu_longname:
 1245|    146|{
 1246|    146|	int err;
 1247|    146|	struct archive_string longname;
 1248|       |
 1249|    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]
  |  |  ------------------
  ------------------
 1250|    146|	err = read_body_to_string(a, tar, &longname, h, unconsumed);
 1251|    146|	if (err == ARCHIVE_OK) {
  ------------------
  |  |  233|    146|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1251:6): [True: 146, False: 0]
  ------------------
 1252|    146|		if (archive_entry_copy_pathname_l(entry, longname.s,
  ------------------
  |  |   80|    146|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (1252:7): [True: 0, False: 146]
  ------------------
 1253|    146|		    archive_strlen(&longname), tar->sconv) != 0)
  ------------------
  |  |  178|    146|#define	archive_strlen(a) ((a)->length)
  ------------------
 1254|      0|			err = set_conversion_failed_error(a, tar->sconv, "Pathname");
 1255|    146|	}
 1256|    146|	archive_string_free(&longname);
 1257|    146|	return (err);
 1258|    146|}
archive_read_support_format_tar.c:header_pax_extension:
 1905|    146|{
 1906|       |	/* Sanity checks: The largest `x` body I've ever heard of was
 1907|       |	 * a little over 4MB.  So I doubt there has ever been a
 1908|       |	 * well-formed archive with an `x` body over 1GiB.  Similarly,
 1909|       |	 * it seems plausible that no single attribute has ever been
 1910|       |	 * larger than 100MB.  So if we see a larger value here, it's
 1911|       |	 * almost certainly a sign of a corrupted/malicious archive. */
 1912|       |
 1913|       |	/* Maximum sane size for extension body: 1 GiB */
 1914|       |	/* This cannot be raised to larger than 8GiB without
 1915|       |	 * exceeding the maximum size for a standard ustar
 1916|       |	 * entry. */
 1917|    146|	const int64_t ext_size_limit = 1024 * 1024 * (int64_t)1024;
 1918|       |	/* Maximum size for a single line/attr: 100 million characters */
 1919|       |	/* This cannot be raised to more than 2GiB without exceeding
 1920|       |	 * a `size_t` on 32-bit platforms. */
 1921|    146|	const size_t max_parsed_line_length = 99999999ULL;
 1922|       |	/* Largest attribute prolog:  size + name. */
 1923|    146|	const size_t max_size_name = 512;
 1924|       |
 1925|       |	/* Size and padding of the full extension body */
 1926|    146|	int64_t ext_size, ext_padding;
 1927|    146|	size_t line_length, value_length, name_length;
 1928|    146|	ssize_t to_read, did_read;
 1929|    146|	const struct archive_entry_header_ustar *header;
 1930|    146|	const char *p, *attr_start, *name_start;
 1931|    146|	struct archive_string_conv *sconv;
 1932|    146|	struct archive_string *pas = NULL;
 1933|    146|	struct archive_string attr_name;
 1934|    146|	int err = ARCHIVE_OK, r;
  ------------------
  |  |  233|    146|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1935|       |
 1936|    146|	header = (const struct archive_entry_header_ustar *)h;
 1937|    146|	ext_size  = tar_atol(header->size, sizeof(header->size));
 1938|    146|	if (ext_size > entry_limit) {
  ------------------
  |  Branch (1938:6): [True: 0, False: 146]
  ------------------
 1939|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1940|      0|	}
 1941|    146|	if (ext_size < 0) {
  ------------------
  |  Branch (1941:6): [True: 0, False: 146]
  ------------------
 1942|      0|	  archive_set_error(&a->archive, EINVAL,
 1943|      0|			    "pax extension header has invalid size: %lld",
 1944|      0|			    (long long)ext_size);
 1945|      0|	  return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1946|      0|	}
 1947|       |
 1948|    146|	ext_padding = 0x1ff & (-ext_size);
 1949|    146|	if (ext_size > ext_size_limit) {
  ------------------
  |  Branch (1949:6): [True: 0, False: 146]
  ------------------
 1950|       |		/* Consume the pax extension body and return an error */
 1951|      0|		if (ext_size + ext_padding != __archive_read_consume(a, ext_size + ext_padding)) {
  ------------------
  |  Branch (1951:7): [True: 0, False: 0]
  ------------------
 1952|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1953|      0|		}
 1954|      0|		archive_set_error(&a->archive, EINVAL,
 1955|      0|		    "Ignoring oversized pax extensions: %lld > %lld",
 1956|      0|		    (long long)ext_size, (long long)ext_size_limit);
 1957|      0|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1958|      0|	}
 1959|    146|	if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|    146|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1959:6): [True: 0, False: 146]
  ------------------
 1960|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1961|      0|	}
 1962|       |
 1963|       |	/* Parse the size/name of each pax attribute in the body */
 1964|    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]
  |  |  ------------------
  ------------------
 1965|  1.12k|	while (ext_size > 0) {
  ------------------
  |  Branch (1965:9): [True: 1.12k, False: 0]
  ------------------
 1966|       |		/* Read enough bytes to parse the size/name of the next attribute */
 1967|  1.12k|		to_read = max_size_name;
 1968|  1.12k|		if (to_read > ext_size) {
  ------------------
  |  Branch (1968:7): [True: 198, False: 929]
  ------------------
 1969|    198|			to_read = ext_size;
 1970|    198|		}
 1971|  1.12k|		p = __archive_read_ahead(a, to_read, &did_read);
 1972|  1.12k|		if (p == NULL) { /* EOF */
  ------------------
  |  Branch (1972:7): [True: 1, False: 1.12k]
  ------------------
 1973|      1|			archive_set_error(&a->archive, EINVAL,
 1974|      1|					  "Truncated tar archive"
 1975|      1|					  " detected while reading pax attribute name");
 1976|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1977|      1|		}
 1978|  1.12k|		if (did_read > ext_size) {
  ------------------
  |  Branch (1978:7): [True: 255, False: 871]
  ------------------
 1979|    255|			did_read = ext_size;
 1980|    255|		}
 1981|       |
 1982|       |		/* Parse size of attribute */
 1983|  1.12k|		line_length = 0;
 1984|  1.12k|		attr_start = p;
 1985|  3.78k|		while (1) {
  ------------------
  |  Branch (1985:10): [True: 3.78k, Folded]
  ------------------
 1986|  3.78k|			if (p >= attr_start + did_read) {
  ------------------
  |  Branch (1986:8): [True: 0, False: 3.78k]
  ------------------
 1987|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1988|      0|						  "Ignoring malformed pax attributes: overlarge attribute size field");
 1989|      0|				*unconsumed += ext_size + ext_padding;
 1990|      0|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1991|      0|			}
 1992|  3.78k|			if (*p == ' ') {
  ------------------
  |  Branch (1992:8): [True: 1.03k, False: 2.75k]
  ------------------
 1993|  1.03k|				p++;
 1994|  1.03k|				break;
 1995|  1.03k|			}
 1996|  2.75k|			if (*p < '0' || *p > '9') {
  ------------------
  |  Branch (1996:8): [True: 95, False: 2.65k]
  |  Branch (1996:20): [True: 0, False: 2.65k]
  ------------------
 1997|     95|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     95|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1998|     95|						  "Ignoring malformed pax attributes: malformed attribute size field");
 1999|     95|				*unconsumed += ext_size + ext_padding;
 2000|     95|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|     95|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2001|     95|			}
 2002|  2.65k|			line_length *= 10;
 2003|  2.65k|			line_length += *p - '0';
 2004|  2.65k|			if (line_length > max_parsed_line_length) {
  ------------------
  |  Branch (2004:8): [True: 0, False: 2.65k]
  ------------------
 2005|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2006|      0|						  "Ignoring malformed pax attribute: size > %lld",
 2007|      0|						  (long long)max_parsed_line_length);
 2008|      0|				*unconsumed += ext_size + ext_padding;
 2009|      0|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2010|      0|			}
 2011|  2.65k|			p++;
 2012|  2.65k|		}
 2013|       |
 2014|  1.03k|		if ((int64_t)line_length > ext_size) {
  ------------------
  |  Branch (2014:7): [True: 0, False: 1.03k]
  ------------------
 2015|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2016|      0|						  "Ignoring malformed pax attribute:  %lld > %lld",
 2017|      0|						  (long long)line_length, (long long)ext_size);
 2018|      0|				*unconsumed += ext_size + ext_padding;
 2019|      0|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2020|      0|		}
 2021|       |
 2022|       |		/* Parse name of attribute */
 2023|  1.03k|		if (p >= attr_start + did_read
  ------------------
  |  Branch (2023:7): [True: 0, False: 1.03k]
  ------------------
 2024|  1.03k|		    || p >= attr_start + line_length
  ------------------
  |  Branch (2024:10): [True: 0, False: 1.03k]
  ------------------
 2025|  1.03k|		    || *p == '=') {
  ------------------
  |  Branch (2025:10): [True: 0, False: 1.03k]
  ------------------
 2026|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2027|      0|					  "Ignoring malformed pax attributes: empty name found");
 2028|      0|			*unconsumed += ext_size + ext_padding;
 2029|      0|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2030|      0|		}
 2031|  1.03k|		name_start = p;
 2032|  36.5k|		while (1) {
  ------------------
  |  Branch (2032:10): [True: 36.5k, Folded]
  ------------------
 2033|  36.5k|			if (p >= attr_start + did_read || p >= attr_start + line_length) {
  ------------------
  |  Branch (2033:8): [True: 0, False: 36.5k]
  |  Branch (2033:38): [True: 4, False: 36.5k]
  ------------------
 2034|      4|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2035|      4|						  "Ignoring malformed pax attributes: overlarge attribute name");
 2036|      4|				*unconsumed += ext_size + ext_padding;
 2037|      4|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|      4|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2038|      4|			}
 2039|  36.5k|			if (*p == '=') {
  ------------------
  |  Branch (2039:8): [True: 1.02k, False: 35.5k]
  ------------------
 2040|  1.02k|				break;
 2041|  1.02k|			}
 2042|  35.5k|			p++;
 2043|  35.5k|		}
 2044|  1.02k|		name_length = p - name_start;
 2045|  1.02k|		p++; // Skip '='
 2046|       |
 2047|       |		// Save the name before we consume it
 2048|  1.02k|		archive_strncpy(&attr_name, name_start, name_length);
  ------------------
  |  |  173|  1.02k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 2049|       |
 2050|  1.02k|		ext_size -= p - attr_start;
 2051|  1.02k|		value_length = line_length - (p - attr_start);
 2052|       |
 2053|       |		/* Consume size, name, and `=` */
 2054|  1.02k|		*unconsumed += p - attr_start;
 2055|  1.02k|		if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.02k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2055:7): [True: 0, False: 1.02k]
  ------------------
 2056|      0|			archive_string_free(&attr_name);
 2057|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2058|      0|		}
 2059|       |
 2060|  1.02k|		if (value_length == 0) {
  ------------------
  |  Branch (2060:7): [True: 1, False: 1.02k]
  ------------------
 2061|      1|			archive_set_error(&a->archive, EINVAL,
 2062|      1|					  "Malformed pax attributes");
 2063|      1|			*unconsumed += ext_size + ext_padding;
 2064|      1|			archive_string_free(&attr_name);
 2065|      1|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      1|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2066|      1|		}
 2067|       |
 2068|       |		/* pax_attribute will consume value_length - 1 */
 2069|  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)
  ------------------
 2070|  1.02k|		ext_size -= value_length - 1;
 2071|       |
 2072|       |		// Release the allocated attr_name (either here or before every return in this function)
 2073|  1.02k|		archive_string_free(&attr_name);
 2074|       |
 2075|  1.02k|		if (r < ARCHIVE_WARN) {
  ------------------
  |  |  235|  1.02k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (2075:7): [True: 2, False: 1.02k]
  ------------------
 2076|      2|			*unconsumed += ext_size + ext_padding;
 2077|      2|			return (r);
 2078|      2|		}
 2079|  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]
  |  |  ------------------
  ------------------
 2080|       |
 2081|       |		/* Consume the `\n` that follows the pax attribute value. */
 2082|  1.02k|		if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.02k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2082:7): [True: 0, False: 1.02k]
  ------------------
 2083|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2084|      0|		}
 2085|  1.02k|		p = __archive_read_ahead(a, 1, &did_read);
 2086|  1.02k|		if (p == NULL) {
  ------------------
  |  Branch (2086:7): [True: 3, False: 1.02k]
  ------------------
 2087|      3|			archive_set_error(&a->archive, EINVAL,
 2088|      3|					  "Truncated tar archive"
 2089|      3|					  " detected while completing pax attribute");
 2090|      3|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2091|      3|		}
 2092|  1.02k|		if (p[0] != '\n') {
  ------------------
  |  Branch (2092:7): [True: 40, False: 981]
  ------------------
 2093|     40|			archive_set_error(&a->archive, EINVAL,
 2094|     40|					  "Malformed pax attributes");
 2095|     40|			*unconsumed += ext_size + ext_padding;
 2096|     40|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|     40|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2097|     40|		}
 2098|    981|		ext_size -= 1;
 2099|    981|		*unconsumed += 1;
 2100|    981|		if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|    981|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2100:7): [True: 0, False: 981]
  ------------------
 2101|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2102|      0|		}
 2103|    981|	}
 2104|      0|	*unconsumed += ext_size + ext_padding;
 2105|       |
 2106|       |	/*
 2107|       |	 * Some PAX values -- pathname, linkpath, uname, gname --
 2108|       |	 * can't be copied into the entry until we know the character
 2109|       |	 * set to use:
 2110|       |	 */
 2111|      0|	if (!tar->pax_hdrcharset_utf8)
  ------------------
  |  Branch (2111:6): [True: 0, False: 0]
  ------------------
 2112|       |		/* PAX specified "BINARY", so use the default charset */
 2113|      0|		sconv = tar->opt_sconv;
 2114|      0|	else {
 2115|       |		/* PAX default UTF-8 */
 2116|      0|		sconv = archive_string_conversion_from_charset(
 2117|      0|		    &(a->archive), "UTF-8", 1);
 2118|      0|		if (sconv == NULL)
  ------------------
  |  Branch (2118:7): [True: 0, False: 0]
  ------------------
 2119|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2120|      0|		if (tar->compat_2x)
  ------------------
  |  Branch (2120:7): [True: 0, False: 0]
  ------------------
 2121|      0|			archive_string_conversion_set_opt(sconv,
 2122|      0|			    SCONV_SET_OPT_UTF8_LIBARCHIVE2X);
  ------------------
  |  |  113|      0|#define SCONV_SET_OPT_UTF8_LIBARCHIVE2X	1
  ------------------
 2123|      0|	}
 2124|       |
 2125|       |	/* Pathname */
 2126|      0|	pas = NULL;
 2127|      0|	if (archive_strlen(&(tar->entry_pathname_override)) > 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (2127:6): [True: 0, False: 0]
  ------------------
 2128|       |		/* Prefer GNU.sparse.name attribute if present */
 2129|       |		/* GNU sparse files store a fake name under the standard
 2130|       |		 * "pathname" key. */
 2131|      0|		pas = &(tar->entry_pathname_override);
 2132|      0|	} else if (archive_strlen(&(tar->entry_pathname)) > 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (2132:13): [True: 0, False: 0]
  ------------------
 2133|       |		/* Use standard "pathname" PAX extension */
 2134|      0|		pas = &(tar->entry_pathname);
 2135|      0|	}
 2136|      0|	if (pas != NULL) {
  ------------------
  |  Branch (2136:6): [True: 0, False: 0]
  ------------------
 2137|      0|		if (archive_entry_copy_pathname_l(entry, pas->s,
  ------------------
  |  |   80|      0|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (2137:7): [True: 0, False: 0]
  ------------------
 2138|      0|		    archive_strlen(pas), sconv) != 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
 2139|      0|			err = set_conversion_failed_error(a, sconv, "Pathname");
 2140|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2140:8): [True: 0, False: 0]
  ------------------
 2141|      0|				return (err);
 2142|       |			/* Use raw name without conversion */
 2143|      0|			archive_entry_copy_pathname(entry, pas->s);
 2144|      0|		}
 2145|      0|	}
 2146|       |	/* Uname */
 2147|      0|	if (archive_strlen(&(tar->entry_uname)) > 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (2147:6): [True: 0, False: 0]
  ------------------
 2148|      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 (2148:7): [True: 0, False: 0]
  ------------------
 2149|      0|		    archive_strlen(&(tar->entry_uname)), sconv) != 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
 2150|      0|			err = set_conversion_failed_error(a, sconv, "Uname");
 2151|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2151:8): [True: 0, False: 0]
  ------------------
 2152|      0|				return (err);
 2153|       |			/* Use raw name without conversion */
 2154|      0|			archive_entry_copy_uname(entry, tar->entry_uname.s);
 2155|      0|		}
 2156|      0|	}
 2157|       |	/* Gname */
 2158|      0|	if (archive_strlen(&(tar->entry_gname)) > 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (2158:6): [True: 0, False: 0]
  ------------------
 2159|      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 (2159:7): [True: 0, False: 0]
  ------------------
 2160|      0|		    archive_strlen(&(tar->entry_gname)), sconv) != 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
 2161|      0|			err = set_conversion_failed_error(a, sconv, "Gname");
 2162|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2162:8): [True: 0, False: 0]
  ------------------
 2163|      0|				return (err);
 2164|       |			/* Use raw name without conversion */
 2165|      0|			archive_entry_copy_gname(entry, tar->entry_gname.s);
 2166|      0|		}
 2167|      0|	}
 2168|       |	/* Linkpath */
 2169|      0|	if (archive_strlen(&(tar->entry_linkpath)) > 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (2169:6): [True: 0, False: 0]
  ------------------
 2170|      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 (2170:7): [True: 0, False: 0]
  ------------------
 2171|      0|		    archive_strlen(&(tar->entry_linkpath)), sconv) != 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
 2172|      0|			err = set_conversion_failed_error(a, sconv, "Linkpath");
 2173|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2173:8): [True: 0, False: 0]
  ------------------
 2174|      0|				return (err);
 2175|       |			/* Use raw name without conversion */
 2176|      0|			archive_entry_copy_link(entry, tar->entry_linkpath.s);
 2177|      0|		}
 2178|      0|	}
 2179|       |
 2180|       |	/* Extension may have given us a corrected `entry_bytes_remaining` for
 2181|       |	 * the main entry; update the padding appropriately. */
 2182|      0|	tar->entry_padding = 0x1ff & (-tar->entry_bytes_remaining);
 2183|      0|	return (err);
 2184|      0|}
archive_read_support_format_tar.c:pax_attribute:
 2397|  1.02k|{
 2398|  1.02k|	int64_t t;
 2399|  1.02k|	long n;
 2400|  1.02k|	const char *p;
 2401|  1.02k|	ssize_t bytes_read;
 2402|  1.02k|	int err = ARCHIVE_OK;
  ------------------
  |  |  233|  1.02k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2403|       |
 2404|  1.02k|	switch (key[0]) {
  ------------------
  |  Branch (2404:10): [True: 1.00k, False: 25]
  ------------------
 2405|     28|	case 'G':
  ------------------
  |  Branch (2405:2): [True: 28, False: 998]
  ------------------
 2406|       |		/* GNU.* extensions */
 2407|     28|		if (key_length > 4 && memcmp(key, "GNU.", 4) == 0) {
  ------------------
  |  Branch (2407:7): [True: 28, False: 0]
  |  Branch (2407:25): [True: 26, False: 2]
  ------------------
 2408|     26|			key += 4;
 2409|     26|			key_length -= 4;
 2410|       |
 2411|       |			/* GNU.sparse marks the existence of GNU sparse information */
 2412|     26|			if (key_length == 6 && memcmp(key, "sparse", 6) == 0) {
  ------------------
  |  Branch (2412:8): [True: 0, False: 26]
  |  Branch (2412:27): [True: 0, False: 0]
  ------------------
 2413|      0|				tar->sparse_gnu_attributes_seen = 1;
 2414|      0|			}
 2415|       |
 2416|       |			/* GNU.sparse.* extensions */
 2417|     26|			else if (key_length > 7 && memcmp(key, "sparse.", 7) == 0) {
  ------------------
  |  Branch (2417:13): [True: 26, False: 0]
  |  Branch (2417:31): [True: 26, False: 0]
  ------------------
 2418|     26|				tar->sparse_gnu_attributes_seen = 1;
 2419|     26|				key += 7;
 2420|     26|				key_length -= 7;
 2421|       |
 2422|       |				/* GNU "0.0" sparse pax format. */
 2423|     26|				if (key_length == 9 && memcmp(key, "numblocks", 9) == 0) {
  ------------------
  |  Branch (2423:9): [True: 0, False: 26]
  |  Branch (2423:28): [True: 0, False: 0]
  ------------------
 2424|       |					/* GNU.sparse.numblocks */
 2425|      0|					tar->sparse_offset = -1;
 2426|      0|					tar->sparse_numbytes = -1;
 2427|      0|					tar->sparse_gnu_major = 0;
 2428|      0|					tar->sparse_gnu_minor = 0;
 2429|      0|				}
 2430|     26|				else if (key_length == 6 && memcmp(key, "offset", 6) == 0) {
  ------------------
  |  Branch (2430:14): [True: 0, False: 26]
  |  Branch (2430:33): [True: 0, False: 0]
  ------------------
 2431|       |					/* GNU.sparse.offset */
 2432|      0|					if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2432:10): [True: 0, False: 0]
  ------------------
 2433|      0|						tar->sparse_offset = t;
 2434|      0|						if (tar->sparse_numbytes != -1) {
  ------------------
  |  Branch (2434:11): [True: 0, False: 0]
  ------------------
 2435|      0|							if (gnu_add_sparse_entry(a, tar,
  ------------------
  |  Branch (2435:12): [True: 0, False: 0]
  ------------------
 2436|      0|									 tar->sparse_offset, tar->sparse_numbytes)
 2437|      0|							    != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2438|      0|								return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2439|      0|							tar->sparse_offset = -1;
 2440|      0|							tar->sparse_numbytes = -1;
 2441|      0|						}
 2442|      0|					}
 2443|      0|					return (err);
 2444|      0|				}
 2445|     26|				else if (key_length == 8 && memcmp(key, "numbytes", 8) == 0) {
  ------------------
  |  Branch (2445:14): [True: 0, False: 26]
  |  Branch (2445:33): [True: 0, False: 0]
  ------------------
 2446|       |					/* GNU.sparse.numbytes */
 2447|      0|					if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2447:10): [True: 0, False: 0]
  ------------------
 2448|      0|						tar->sparse_numbytes = t;
 2449|      0|						if (tar->sparse_offset != -1) {
  ------------------
  |  Branch (2449:11): [True: 0, False: 0]
  ------------------
 2450|      0|							if (gnu_add_sparse_entry(a, tar,
  ------------------
  |  Branch (2450:12): [True: 0, False: 0]
  ------------------
 2451|      0|									 tar->sparse_offset, tar->sparse_numbytes)
 2452|      0|							    != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2453|      0|								return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2454|      0|							tar->sparse_offset = -1;
 2455|      0|							tar->sparse_numbytes = -1;
 2456|      0|						}
 2457|      0|					}
 2458|      0|					return (err);
 2459|      0|				}
 2460|     26|				else if (key_length == 4 && memcmp(key, "size", 4) == 0) {
  ------------------
  |  Branch (2460:14): [True: 0, False: 26]
  |  Branch (2460:33): [True: 0, False: 0]
  ------------------
 2461|       |					/* GNU.sparse.size */
 2462|       |					/* This is either the size of stored entry OR the size of data on disk,
 2463|       |					 * depending on which GNU sparse format version is in use.
 2464|       |					 * Since pax attributes can be in any order, we may not actually
 2465|       |					 * know at this point how to interpret this. */
 2466|      0|					if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2466:10): [True: 0, False: 0]
  ------------------
 2467|      0|						tar->GNU_sparse_size = t;
 2468|      0|						tar->size_fields |= TAR_SIZE_GNU_SPARSE_SIZE;
  ------------------
  |  |  163|      0|#define TAR_SIZE_GNU_SPARSE_SIZE 4
  ------------------
 2469|      0|					}
 2470|      0|					return (err);
 2471|      0|				}
 2472|       |
 2473|       |				/* GNU "0.1" sparse pax format. */
 2474|     26|				else if (key_length == 3 && memcmp(key, "map", 3) == 0) {
  ------------------
  |  Branch (2474:14): [True: 0, False: 26]
  |  Branch (2474:33): [True: 0, False: 0]
  ------------------
 2475|       |					/* GNU.sparse.map */
 2476|      0|					tar->sparse_gnu_major = 0;
 2477|      0|					tar->sparse_gnu_minor = 1;
 2478|      0|					if (value_length > sparse_map_limit) {
  ------------------
  |  Branch (2478:10): [True: 0, False: 0]
  ------------------
 2479|      0|						archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2480|      0|								  "Unreasonably large sparse map: %llu > %llu",
 2481|      0|								  (unsigned long long)value_length,
 2482|      0|								  (unsigned long long)sparse_map_limit);
 2483|      0|						err = ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2484|      0|					} else {
 2485|      0|						p = __archive_read_ahead(a, value_length, &bytes_read);
 2486|      0|						if (p == NULL) {
  ------------------
  |  Branch (2486:11): [True: 0, False: 0]
  ------------------
 2487|      0|							archive_set_error(&a->archive, EINVAL,
 2488|      0|									  "Truncated archive"
 2489|      0|									  " detected while reading GNU sparse data");
 2490|      0|							return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2491|      0|						}
 2492|      0|						if (gnu_sparse_01_parse(a, tar, p, value_length) != ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2492:11): [True: 0, False: 0]
  ------------------
 2493|      0|							err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2494|      0|						}
 2495|      0|					}
 2496|      0|					__archive_read_consume(a, value_length);
 2497|      0|					return (err);
 2498|      0|				}
 2499|       |
 2500|       |				/* GNU "1.0" sparse pax format */
 2501|     26|				else if (key_length == 5 && memcmp(key, "major", 5) == 0) {
  ------------------
  |  Branch (2501:14): [True: 26, False: 0]
  |  Branch (2501:33): [True: 11, False: 15]
  ------------------
 2502|       |					/* GNU.sparse.major */
 2503|     11|					if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK
  ------------------
  |  |  233|     22|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2503:10): [True: 11, False: 0]
  ------------------
 2504|     11|					    && t >= 0
  ------------------
  |  Branch (2504:13): [True: 11, False: 0]
  ------------------
 2505|     11|					    && t <= 10) {
  ------------------
  |  Branch (2505:13): [True: 11, False: 0]
  ------------------
 2506|     11|						tar->sparse_gnu_major = (int)t;
 2507|     11|					}
 2508|     11|					return (err);
 2509|     11|				}
 2510|     15|				else if (key_length == 5 && memcmp(key, "minor", 5) == 0) {
  ------------------
  |  Branch (2510:14): [True: 15, False: 0]
  |  Branch (2510:33): [True: 10, False: 5]
  ------------------
 2511|       |					/* GNU.sparse.minor */
 2512|     10|					if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK
  ------------------
  |  |  233|     20|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2512:10): [True: 10, False: 0]
  ------------------
 2513|     10|					    && t >= 0
  ------------------
  |  Branch (2513:13): [True: 10, False: 0]
  ------------------
 2514|     10|					    && t <= 10) {
  ------------------
  |  Branch (2514:13): [True: 10, False: 0]
  ------------------
 2515|     10|						tar->sparse_gnu_minor = (int)t;
 2516|     10|					}
 2517|     10|					return (err);
 2518|     10|				}
 2519|      5|				else if (key_length == 4 && memcmp(key, "name", 4) == 0) {
  ------------------
  |  Branch (2519:14): [True: 0, False: 5]
  |  Branch (2519:33): [True: 0, False: 0]
  ------------------
 2520|       |					/* GNU.sparse.name */
 2521|       |					/*
 2522|       |					 * The real filename; when storing sparse
 2523|       |					 * files, GNU tar puts a synthesized name into
 2524|       |					 * the regular 'path' attribute in an attempt
 2525|       |					 * to limit confusion. ;-)
 2526|       |					 */
 2527|      0|					if (value_length > pathname_limit) {
  ------------------
  |  Branch (2527:10): [True: 0, False: 0]
  ------------------
 2528|      0|						*unconsumed += value_length;
 2529|      0|						err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2530|      0|					} else {
 2531|      0|						err = read_bytes_to_string(a, &(tar->entry_pathname_override),
 2532|      0|									   value_length, unconsumed);
 2533|      0|					}
 2534|      0|					return (err);
 2535|      0|				}
 2536|      5|				else if (key_length == 8 && memcmp(key, "realsize", 8) == 0) {
  ------------------
  |  Branch (2536:14): [True: 0, False: 5]
  |  Branch (2536:33): [True: 0, False: 0]
  ------------------
 2537|       |					/* GNU.sparse.realsize = size of file on disk */
 2538|      0|					if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2538:10): [True: 0, False: 0]
  ------------------
 2539|      0|						tar->GNU_sparse_realsize = t;
 2540|      0|						tar->size_fields |= TAR_SIZE_GNU_SPARSE_REALSIZE;
  ------------------
  |  |  162|      0|#define TAR_SIZE_GNU_SPARSE_REALSIZE 2
  ------------------
 2541|      0|					}
 2542|      0|					return (err);
 2543|      0|				}
 2544|     26|			}
 2545|     26|		}
 2546|      7|		break;
 2547|     50|	case 'L':
  ------------------
  |  Branch (2547:2): [True: 50, False: 976]
  ------------------
 2548|       |		/* LIBARCHIVE extensions */
 2549|     50|		if (key_length > 11 && memcmp(key, "LIBARCHIVE.", 11) == 0) {
  ------------------
  |  Branch (2549:7): [True: 50, False: 0]
  |  Branch (2549:26): [True: 48, False: 2]
  ------------------
 2550|     48|			key_length -= 11;
 2551|     48|			key += 11;
 2552|       |
 2553|       |			/* TODO: Handle arbitrary extended attributes... */
 2554|       |			/*
 2555|       |			  if (strcmp(key, "LIBARCHIVE.xxxxxxx") == 0)
 2556|       |				  archive_entry_set_xxxxxx(entry, value);
 2557|       |			*/
 2558|     48|			if (key_length == 12 && memcmp(key, "creationtime", 12) == 0) {
  ------------------
  |  Branch (2558:8): [True: 1, False: 47]
  |  Branch (2558:28): [True: 1, False: 0]
  ------------------
 2559|       |				/* LIBARCHIVE.creationtime */
 2560|      1|				__LA_TIME_T sec = 0;
  ------------------
  |  |  107|      1|#define __LA_TIME_T time_t
  ------------------
 2561|      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 (2561:9): [True: 0, False: 1]
  ------------------
 2562|      0|					archive_entry_set_birthtime(entry, sec, n);
 2563|      1|				} else {
 2564|      1|					archive_set_error(&a->archive,
 2565|      1|							  ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2566|      1|							  "Ignoring malformed pax creationtime");
 2567|      1|				}
 2568|      1|				return (err);
 2569|      1|			}
 2570|     47|			else if (key_length == 11 && memcmp(key, "symlinktype", 11) == 0) {
  ------------------
  |  Branch (2570:13): [True: 14, False: 33]
  |  Branch (2570:33): [True: 0, False: 14]
  ------------------
 2571|       |				/* LIBARCHIVE.symlinktype */
 2572|      0|				if (value_length < 16) {
  ------------------
  |  Branch (2572:9): [True: 0, False: 0]
  ------------------
 2573|      0|					p = __archive_read_ahead(a, value_length, &bytes_read);
 2574|      0|					if (p == NULL) {
  ------------------
  |  Branch (2574:10): [True: 0, False: 0]
  ------------------
 2575|      0|						archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2576|      0|								  "Truncated tar archive "
 2577|      0|								  "detected while reading `symlinktype` attribute");
 2578|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2579|      0|					}
 2580|      0|					if (value_length == 4 && memcmp(p, "file", 4) == 0) {
  ------------------
  |  Branch (2580:10): [True: 0, False: 0]
  |  Branch (2580:31): [True: 0, False: 0]
  ------------------
 2581|      0|						archive_entry_set_symlink_type(entry,
 2582|      0|									       AE_SYMLINK_TYPE_FILE);
  ------------------
  |  |  228|      0|#define AE_SYMLINK_TYPE_FILE		1
  ------------------
 2583|      0|					} else if (value_length == 3 && memcmp(p, "dir", 3) == 0) {
  ------------------
  |  Branch (2583:17): [True: 0, False: 0]
  |  Branch (2583:38): [True: 0, False: 0]
  ------------------
 2584|      0|							archive_entry_set_symlink_type(entry,
 2585|      0|										       AE_SYMLINK_TYPE_DIRECTORY);
  ------------------
  |  |  229|      0|#define AE_SYMLINK_TYPE_DIRECTORY	2
  ------------------
 2586|      0|					} else {
 2587|      0|						archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2588|      0|								  "Unrecognized symlink type");
 2589|      0|						err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2590|      0|					}
 2591|      0|				} else {
 2592|      0|					archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2593|      0|							  "symlink type is very long"
 2594|      0|							  "(longest recognized value is 4 bytes, this is %llu)",
 2595|      0|							  (unsigned long long)value_length);
 2596|      0|					err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2597|      0|				}
 2598|      0|				__archive_read_consume(a, value_length);
 2599|      0|				return (err);
 2600|      0|			}
 2601|     47|			else if (key_length > 6 && memcmp(key, "xattr.", 6) == 0) {
  ------------------
  |  Branch (2601:13): [True: 41, False: 6]
  |  Branch (2601:31): [True: 37, False: 4]
  ------------------
 2602|     37|				key_length -= 6;
 2603|     37|				key += 6;
 2604|     37|				if (value_length > xattr_limit) {
  ------------------
  |  Branch (2604:9): [True: 0, False: 37]
  ------------------
 2605|      0|					err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2606|     37|				} else {
 2607|     37|					p = __archive_read_ahead(a, value_length, &bytes_read);
 2608|     37|					if (p == NULL) {
  ------------------
  |  Branch (2608:10): [True: 1, False: 36]
  ------------------
 2609|      1|						archive_set_error(&a->archive, EINVAL,
 2610|      1|								  "Truncated archive"
 2611|      1|								  " detected while reading xattr information");
 2612|      1|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2613|      1|					}
 2614|     36|					if (pax_attribute_LIBARCHIVE_xattr(entry, key, key_length, p, value_length)) {
  ------------------
  |  Branch (2614:10): [True: 0, False: 36]
  ------------------
 2615|       |						/* TODO: Unable to parse xattr */
 2616|      0|						err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2617|      0|					}
 2618|     36|				}
 2619|     36|				__archive_read_consume(a, value_length);
 2620|     36|				return (err);
 2621|     37|			}
 2622|     48|		}
 2623|     12|		break;
 2624|     12|	case 'R':
  ------------------
  |  Branch (2624:2): [True: 0, False: 1.02k]
  ------------------
 2625|       |		/* GNU tar uses RHT.security header to store SELinux xattrs
 2626|       |		 * SCHILY.xattr.security.selinux == RHT.security.selinux */
 2627|      0|		if (key_length == 20 && memcmp(key, "RHT.security.selinux", 20) == 0) {
  ------------------
  |  Branch (2627:7): [True: 0, False: 0]
  |  Branch (2627:27): [True: 0, False: 0]
  ------------------
 2628|      0|			if (value_length > xattr_limit) {
  ------------------
  |  Branch (2628:8): [True: 0, False: 0]
  ------------------
 2629|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2630|      0|						  "Ignoring unreasonably large security.selinux attribute:"
 2631|      0|						  " %llu > %llu",
 2632|      0|						  (unsigned long long)value_length,
 2633|      0|						  (unsigned long long)xattr_limit);
 2634|       |				/* TODO: Should this be FAILED instead? */
 2635|      0|				err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2636|      0|			} else {
 2637|      0|				p = __archive_read_ahead(a, value_length, &bytes_read);
 2638|      0|				if (p == NULL) {
  ------------------
  |  Branch (2638:9): [True: 0, False: 0]
  ------------------
 2639|      0|					archive_set_error(&a->archive, EINVAL,
 2640|      0|							  "Truncated archive"
 2641|      0|							  " detected while reading selinux data");
 2642|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2643|      0|				}
 2644|      0|				if (pax_attribute_RHT_security_selinux(entry, p, value_length)) {
  ------------------
  |  Branch (2644:9): [True: 0, False: 0]
  ------------------
 2645|       |					/* TODO: Unable to parse xattr */
 2646|      0|					err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2647|      0|				}
 2648|      0|			}
 2649|      0|			__archive_read_consume(a, value_length);
 2650|      0|			return (err);
 2651|      0|		}
 2652|      0|		break;
 2653|    109|	case 'S':
  ------------------
  |  Branch (2653:2): [True: 109, False: 917]
  ------------------
 2654|       |		/* SCHILY.* extensions used by "star" archiver */
 2655|    109|		if (key_length > 7 && memcmp(key, "SCHILY.", 7) == 0) {
  ------------------
  |  Branch (2655:7): [True: 108, False: 1]
  |  Branch (2655:25): [True: 76, False: 32]
  ------------------
 2656|     76|			key_length -= 7;
 2657|     76|			key += 7;
 2658|       |
 2659|     76|			if (key_length == 10 && memcmp(key, "acl.access", 10) == 0) {
  ------------------
  |  Branch (2659:8): [True: 0, False: 76]
  |  Branch (2659:28): [True: 0, False: 0]
  ------------------
 2660|      0|				err = pax_attribute_SCHILY_acl(a, tar, entry, value_length,
 2661|      0|						      ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
  ------------------
  |  |  534|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
 2662|       |				// TODO: Mark mode as set
 2663|      0|				return (err);
 2664|      0|			}
 2665|     76|			else if (key_length == 11 && memcmp(key, "acl.default", 11) == 0) {
  ------------------
  |  Branch (2665:13): [True: 0, False: 76]
  |  Branch (2665:33): [True: 0, False: 0]
  ------------------
 2666|      0|				err = pax_attribute_SCHILY_acl(a, tar, entry, value_length,
 2667|      0|						      ARCHIVE_ENTRY_ACL_TYPE_DEFAULT);
  ------------------
  |  |  535|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
 2668|      0|				return (err);
 2669|      0|			}
 2670|     76|			else if (key_length == 7 && memcmp(key, "acl.ace", 7) == 0) {
  ------------------
  |  Branch (2670:13): [True: 0, False: 76]
  |  Branch (2670:32): [True: 0, False: 0]
  ------------------
 2671|      0|				err = pax_attribute_SCHILY_acl(a, tar, entry, value_length,
 2672|      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 */
  |  |  ------------------
  ------------------
 2673|       |				// TODO: Mark mode as set
 2674|      0|				return (err);
 2675|      0|			}
 2676|     76|			else if (key_length == 8 && memcmp(key, "devmajor", 8) == 0) {
  ------------------
  |  Branch (2676:13): [True: 20, False: 56]
  |  Branch (2676:32): [True: 0, False: 20]
  ------------------
 2677|      0|				if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2677:9): [True: 0, False: 0]
  ------------------
 2678|      0|					archive_entry_set_rdevmajor(entry, (dev_t)t);
 2679|      0|				}
 2680|      0|				return (err);
 2681|      0|			}
 2682|     76|			else if (key_length == 8 && memcmp(key, "devminor", 8) == 0) {
  ------------------
  |  Branch (2682:13): [True: 20, False: 56]
  |  Branch (2682:32): [True: 0, False: 20]
  ------------------
 2683|      0|				if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2683:9): [True: 0, False: 0]
  ------------------
 2684|      0|					archive_entry_set_rdevminor(entry, (dev_t)t);
 2685|      0|				}
 2686|      0|				return (err);
 2687|      0|			}
 2688|     76|			else if (key_length == 6 && memcmp(key, "fflags", 6) == 0) {
  ------------------
  |  Branch (2688:13): [True: 0, False: 76]
  |  Branch (2688:32): [True: 0, False: 0]
  ------------------
 2689|      0|				if (value_length < fflags_limit) {
  ------------------
  |  Branch (2689:9): [True: 0, False: 0]
  ------------------
 2690|      0|					p = __archive_read_ahead(a, value_length, &bytes_read);
 2691|      0|					if (p == NULL) {
  ------------------
  |  Branch (2691:10): [True: 0, False: 0]
  ------------------
 2692|       |						/* Truncated archive */
 2693|      0|						archive_set_error(&a->archive, EINVAL,
 2694|      0|								  "Truncated archive"
 2695|      0|								  " detected while reading SCHILY.fflags");
 2696|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2697|      0|					}
 2698|      0|					archive_entry_copy_fflags_text_len(entry, p, value_length);
 2699|      0|					err = ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2700|      0|				} else {
 2701|       |					/* Overlong fflags field */
 2702|      0|					err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2703|      0|				}
 2704|      0|				__archive_read_consume(a, value_length);
 2705|      0|				return (err);
 2706|      0|			}
 2707|     76|			else if (key_length == 3 && memcmp(key, "dev", 3) == 0) {
  ------------------
  |  Branch (2707:13): [True: 56, False: 20]
  |  Branch (2707:32): [True: 48, False: 8]
  ------------------
 2708|     48|				if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|     48|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2708:9): [True: 48, False: 0]
  ------------------
 2709|     48|					archive_entry_set_dev(entry, (dev_t)t);
 2710|     48|				}
 2711|     48|				return (err);
 2712|     48|			}
 2713|     28|			else if (key_length == 3 && memcmp(key, "ino", 3) == 0) {
  ------------------
  |  Branch (2713:13): [True: 8, False: 20]
  |  Branch (2713:32): [True: 0, False: 8]
  ------------------
 2714|      0|				if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2714:9): [True: 0, False: 0]
  ------------------
 2715|      0|					archive_entry_set_ino(entry, t);
 2716|      0|				}
 2717|      0|				return (err);
 2718|      0|			}
 2719|     28|			else if (key_length == 5 && memcmp(key, "nlink", 5) == 0) {
  ------------------
  |  Branch (2719:13): [True: 0, False: 28]
  |  Branch (2719:32): [True: 0, False: 0]
  ------------------
 2720|      0|				if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2720:9): [True: 0, False: 0]
  ------------------
 2721|      0|					archive_entry_set_nlink(entry, (unsigned int)t);
 2722|      0|				}
 2723|      0|				return (err);
 2724|      0|			}
 2725|     28|			else if (key_length == 8 && memcmp(key, "realsize", 8) == 0) {
  ------------------
  |  Branch (2725:13): [True: 20, False: 8]
  |  Branch (2725:32): [True: 14, False: 6]
  ------------------
 2726|     14|				if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|     14|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2726:9): [True: 14, False: 0]
  ------------------
 2727|     14|					tar->SCHILY_sparse_realsize = t;
 2728|     14|					tar->size_fields |= TAR_SIZE_SCHILY_SPARSE_REALSIZE;
  ------------------
  |  |  164|     14|#define TAR_SIZE_SCHILY_SPARSE_REALSIZE 8
  ------------------
 2729|     14|				}
 2730|     14|				return (err);
 2731|     14|			}
 2732|       |			/* TODO: Is there a SCHILY.sparse.size similar to GNU.sparse.size ? */
 2733|     14|			else if (key_length > 6 && memcmp(key, "xattr.", 6) == 0) {
  ------------------
  |  Branch (2733:13): [True: 6, False: 8]
  |  Branch (2733:31): [True: 0, False: 6]
  ------------------
 2734|      0|				key_length -= 6;
 2735|      0|				key += 6;
 2736|      0|				if (value_length < xattr_limit) {
  ------------------
  |  Branch (2736:9): [True: 0, False: 0]
  ------------------
 2737|      0|					p = __archive_read_ahead(a, value_length, &bytes_read);
 2738|      0|					if (p == NULL) {
  ------------------
  |  Branch (2738:10): [True: 0, False: 0]
  ------------------
 2739|      0|						archive_set_error(&a->archive, EINVAL,
 2740|      0|								  "Truncated archive"
 2741|      0|								  " detected while reading SCHILY.xattr");
 2742|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2743|      0|					}
 2744|      0|					if (pax_attribute_SCHILY_xattr(entry, key, key_length, p, value_length)) {
  ------------------
  |  Branch (2744:10): [True: 0, False: 0]
  ------------------
 2745|       |						/* TODO: Unable to parse xattr */
 2746|      0|						err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2747|      0|					}
 2748|      0|				} else {
 2749|      0|					archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2750|      0|							  "Unreasonably large xattr: %llu > %llu",
 2751|      0|							  (unsigned long long)value_length,
 2752|      0|							  (unsigned long long)xattr_limit);
 2753|      0|					err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2754|      0|				}
 2755|      0|				__archive_read_consume(a, value_length);
 2756|      0|				return (err);
 2757|      0|			}
 2758|     76|		}
 2759|       |		/* SUN.* extensions from Solaris tar */
 2760|     47|		if (key_length > 4 && memcmp(key, "SUN.", 4) == 0) {
  ------------------
  |  Branch (2760:7): [True: 39, False: 8]
  |  Branch (2760:25): [True: 0, False: 39]
  ------------------
 2761|      0|			key_length -= 4;
 2762|      0|			key += 4;
 2763|       |
 2764|      0|			if (key_length == 9 && memcmp(key, "holesdata", 9) == 0) {
  ------------------
  |  Branch (2764:8): [True: 0, False: 0]
  |  Branch (2764:27): [True: 0, False: 0]
  ------------------
 2765|       |				/* SUN.holesdata */
 2766|      0|				if (value_length < sparse_map_limit) {
  ------------------
  |  Branch (2766:9): [True: 0, False: 0]
  ------------------
 2767|      0|					p = __archive_read_ahead(a, value_length, &bytes_read);
 2768|      0|					if (p == NULL) {
  ------------------
  |  Branch (2768:10): [True: 0, False: 0]
  ------------------
 2769|      0|						archive_set_error(&a->archive, EINVAL,
 2770|      0|								  "Truncated archive"
 2771|      0|								  " detected while reading SUN.holesdata");
 2772|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2773|      0|					}
 2774|      0|					err = pax_attribute_SUN_holesdata(a, tar, entry, p, value_length);
 2775|      0|					if (err < ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2775:10): [True: 0, False: 0]
  ------------------
 2776|      0|						archive_set_error(&a->archive,
 2777|      0|								  ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2778|      0|								  "Parse error: SUN.holesdata");
 2779|      0|					}
 2780|      0|				} else {
 2781|      0|					archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2782|      0|							  "Unreasonably large sparse map: %llu > %llu",
 2783|      0|							  (unsigned long long)value_length,
 2784|      0|							  (unsigned long long)sparse_map_limit);
 2785|      0|					err = ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2786|      0|				}
 2787|      0|				__archive_read_consume(a, value_length);
 2788|      0|				return (err);
 2789|      0|			}
 2790|      0|		}
 2791|     47|		break;
 2792|    516|	case 'a':
  ------------------
  |  Branch (2792:2): [True: 516, False: 510]
  ------------------
 2793|    516|		if (key_length == 5 && memcmp(key, "atime", 5) == 0) {
  ------------------
  |  Branch (2793:7): [True: 491, False: 25]
  |  Branch (2793:26): [True: 0, False: 491]
  ------------------
 2794|      0|			__LA_TIME_T sec = 0;
  ------------------
  |  |  107|      0|#define __LA_TIME_T time_t
  ------------------
 2795|      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 (2795:8): [True: 0, False: 0]
  ------------------
 2796|      0|				archive_entry_set_atime(entry, sec, n);
 2797|      0|			} else {
 2798|      0|				archive_set_error(&a->archive,
 2799|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2800|      0|				    "Ignoring malformed pax atime");
 2801|      0|			}
 2802|      0|			return (err);
 2803|      0|		}
 2804|    516|		break;
 2805|    516|	case 'c':
  ------------------
  |  Branch (2805:2): [True: 34, False: 992]
  ------------------
 2806|     34|		if (key_length == 5 && memcmp(key, "ctime", 5) == 0) {
  ------------------
  |  Branch (2806:7): [True: 0, False: 34]
  |  Branch (2806:26): [True: 0, False: 0]
  ------------------
 2807|      0|			__LA_TIME_T sec = 0;
  ------------------
  |  |  107|      0|#define __LA_TIME_T time_t
  ------------------
 2808|      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 (2808:8): [True: 0, False: 0]
  ------------------
 2809|      0|				archive_entry_set_ctime(entry, sec, n);
 2810|      0|			} else {
 2811|      0|				archive_set_error(&a->archive,
 2812|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2813|      0|				    "Ignoring malformed pax ctime");
 2814|      0|			}
 2815|      0|			return (err);
 2816|     34|		} else if (key_length == 7 && memcmp(key, "charset", 7) == 0) {
  ------------------
  |  Branch (2816:14): [True: 0, False: 34]
  |  Branch (2816:33): [True: 0, False: 0]
  ------------------
 2817|       |			/* TODO: Publish charset information in entry. */
 2818|     34|		} else if (key_length == 7 && memcmp(key, "comment", 7) == 0) {
  ------------------
  |  Branch (2818:14): [True: 0, False: 34]
  |  Branch (2818:33): [True: 0, False: 0]
  ------------------
 2819|       |			/* TODO: Publish comment in entry. */
 2820|      0|		}
 2821|     34|		break;
 2822|     34|	case 'g':
  ------------------
  |  Branch (2822:2): [True: 0, False: 1.02k]
  ------------------
 2823|      0|		if (key_length == 3 && memcmp(key, "gid", 3) == 0) {
  ------------------
  |  Branch (2823:7): [True: 0, False: 0]
  |  Branch (2823:26): [True: 0, False: 0]
  ------------------
 2824|      0|			if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2824:8): [True: 0, False: 0]
  ------------------
 2825|      0|				archive_entry_set_gid(entry, t);
 2826|      0|			}
 2827|      0|			return (err);
 2828|      0|		} else if (key_length == 5 && memcmp(key, "gname", 5) == 0) {
  ------------------
  |  Branch (2828:14): [True: 0, False: 0]
  |  Branch (2828:33): [True: 0, False: 0]
  ------------------
 2829|      0|			if (value_length > guname_limit) {
  ------------------
  |  Branch (2829:8): [True: 0, False: 0]
  ------------------
 2830|      0|				*unconsumed += value_length;
 2831|      0|				err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2832|      0|			} else {
 2833|      0|				err = read_bytes_to_string(a, &(tar->entry_gname), value_length, unconsumed);
 2834|      0|			}
 2835|      0|			return (err);
 2836|      0|		}
 2837|      0|		break;
 2838|      0|	case 'h':
  ------------------
  |  Branch (2838:2): [True: 0, False: 1.02k]
  ------------------
 2839|      0|		if (key_length == 10 && memcmp(key, "hdrcharset", 10) == 0) {
  ------------------
  |  Branch (2839:7): [True: 0, False: 0]
  |  Branch (2839:27): [True: 0, False: 0]
  ------------------
 2840|      0|			if (value_length < 64) {
  ------------------
  |  Branch (2840:8): [True: 0, False: 0]
  ------------------
 2841|      0|				p = __archive_read_ahead(a, value_length, &bytes_read);
 2842|      0|				if (p == NULL) {
  ------------------
  |  Branch (2842:9): [True: 0, False: 0]
  ------------------
 2843|      0|					archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2844|      0|							  "Truncated tar archive "
 2845|      0|							  "detected while reading hdrcharset attribute");
 2846|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2847|      0|				}
 2848|      0|				if (value_length == 6
  ------------------
  |  Branch (2848:9): [True: 0, False: 0]
  ------------------
 2849|      0|				    && memcmp(p, "BINARY", 6) == 0) {
  ------------------
  |  Branch (2849:12): [True: 0, False: 0]
  ------------------
 2850|       |					/* Binary  mode. */
 2851|      0|					tar->pax_hdrcharset_utf8 = 0;
 2852|      0|					err = ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2853|      0|				} else if (value_length == 23
  ------------------
  |  Branch (2853:16): [True: 0, False: 0]
  ------------------
 2854|      0|					   && memcmp(p, "ISO-IR 10646 2000 UTF-8", 23) == 0) {
  ------------------
  |  Branch (2854:12): [True: 0, False: 0]
  ------------------
 2855|      0|					tar->pax_hdrcharset_utf8 = 1;
 2856|      0|					err = ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2857|      0|				} else {
 2858|       |					/* TODO: Unrecognized character set */
 2859|      0|					err  = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2860|      0|				}
 2861|      0|			} else {
 2862|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2863|      0|						  "hdrcharset attribute is unreasonably large (%llu bytes)",
 2864|      0|						  (unsigned long long)value_length);
 2865|      0|				err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2866|      0|			}
 2867|      0|			__archive_read_consume(a, value_length);
 2868|      0|			return (err);
 2869|      0|		}
 2870|      0|		break;
 2871|      9|	case 'l':
  ------------------
  |  Branch (2871:2): [True: 9, False: 1.01k]
  ------------------
 2872|       |		/* pax interchange doesn't distinguish hardlink vs. symlink. */
 2873|      9|		if (key_length == 8 && memcmp(key, "linkpath", 8) == 0) {
  ------------------
  |  Branch (2873:7): [True: 0, False: 9]
  |  Branch (2873:26): [True: 0, False: 0]
  ------------------
 2874|      0|			if (value_length > pathname_limit) {
  ------------------
  |  Branch (2874:8): [True: 0, False: 0]
  ------------------
 2875|      0|				*unconsumed += value_length;
 2876|      0|				err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2877|      0|			} else {
 2878|      0|				err = read_bytes_to_string(a, &tar->entry_linkpath, value_length, unconsumed);
 2879|      0|			}
 2880|      0|			return (err);
 2881|      0|		}
 2882|      9|		break;
 2883|    204|	case 'm':
  ------------------
  |  Branch (2883:2): [True: 204, False: 822]
  ------------------
 2884|    204|		if (key_length == 5 && memcmp(key, "mtime", 5) == 0) {
  ------------------
  |  Branch (2884:7): [True: 85, False: 119]
  |  Branch (2884:26): [True: 83, False: 2]
  ------------------
 2885|     83|			__LA_TIME_T sec;
  ------------------
  |  |  107|     83|#define __LA_TIME_T time_t
  ------------------
 2886|     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 (2886:8): [True: 38, False: 45]
  ------------------
 2887|     38|				archive_entry_set_mtime(entry, sec, n);
 2888|     45|			} else {
 2889|     45|				archive_set_error(&a->archive,
 2890|     45|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     45|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2891|     45|				    "Ignoring malformed pax mtime");
 2892|     45|			}
 2893|     83|			return (err);
 2894|     83|		}
 2895|    121|		break;
 2896|    121|	case 'p':
  ------------------
  |  Branch (2896:2): [True: 2, False: 1.02k]
  ------------------
 2897|      2|		if (key_length == 4 && memcmp(key, "path", 4) == 0) {
  ------------------
  |  Branch (2897:7): [True: 0, False: 2]
  |  Branch (2897:26): [True: 0, False: 0]
  ------------------
 2898|      0|			if (value_length > pathname_limit) {
  ------------------
  |  Branch (2898:8): [True: 0, False: 0]
  ------------------
 2899|      0|				*unconsumed += value_length;
 2900|      0|				err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2901|      0|			} else {
 2902|      0|				err = read_bytes_to_string(a, &(tar->entry_pathname), value_length, unconsumed);
 2903|      0|			}
 2904|      0|			return (err);
 2905|      0|		}
 2906|      2|		break;
 2907|      2|	case 'r':
  ------------------
  |  Branch (2907:2): [True: 0, False: 1.02k]
  ------------------
 2908|       |		/* POSIX has reserved 'realtime.*' */
 2909|      0|		break;
 2910|     11|	case 's':
  ------------------
  |  Branch (2910:2): [True: 11, False: 1.01k]
  ------------------
 2911|       |		/* POSIX has reserved 'security.*' */
 2912|       |		/* Someday: if (strcmp(key, "security.acl") == 0) { ... } */
 2913|     11|		if (key_length == 4 && memcmp(key, "size", 4) == 0) {
  ------------------
  |  Branch (2913:7): [True: 0, False: 11]
  |  Branch (2913:26): [True: 0, False: 0]
  ------------------
 2914|       |			/* "size" is the size of the data in the entry. */
 2915|      0|			if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2915:8): [True: 0, False: 0]
  ------------------
 2916|      0|				tar->pax_size = t;
 2917|      0|				tar->size_fields |= TAR_SIZE_PAX_SIZE;
  ------------------
  |  |  161|      0|#define TAR_SIZE_PAX_SIZE 1
  ------------------
 2918|      0|			}
 2919|      0|			else if (t == INT64_MAX) {
  ------------------
  |  Branch (2919:13): [True: 0, False: 0]
  ------------------
 2920|       |				/* Note: pax_attr_read_number returns INT64_MAX on overflow or < 0 */
 2921|      0|				tar->entry_bytes_remaining = 0;
 2922|      0|				archive_set_error(&a->archive,
 2923|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2924|      0|				    "Tar size attribute overflow");
 2925|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2926|      0|			}
 2927|      0|			return (err);
 2928|      0|		}
 2929|     11|		break;
 2930|     38|	case 'u':
  ------------------
  |  Branch (2930:2): [True: 38, False: 988]
  ------------------
 2931|     38|		if (key_length == 3 && memcmp(key, "uid", 3) == 0) {
  ------------------
  |  Branch (2931:7): [True: 38, False: 0]
  |  Branch (2931:26): [True: 0, False: 38]
  ------------------
 2932|      0|			if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2932:8): [True: 0, False: 0]
  ------------------
 2933|      0|				archive_entry_set_uid(entry, t);
 2934|      0|			}
 2935|      0|			return (err);
 2936|     38|		} else if (key_length == 5 && memcmp(key, "uname", 5) == 0) {
  ------------------
  |  Branch (2936:14): [True: 0, False: 38]
  |  Branch (2936:33): [True: 0, False: 0]
  ------------------
 2937|      0|			if (value_length > guname_limit) {
  ------------------
  |  Branch (2937:8): [True: 0, False: 0]
  ------------------
 2938|      0|				*unconsumed += value_length;
 2939|      0|				err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2940|      0|			} else {
 2941|      0|				err = read_bytes_to_string(a, &(tar->entry_uname), value_length, unconsumed);
 2942|      0|			}
 2943|      0|			return (err);
 2944|      0|		}
 2945|     38|		break;
 2946|  1.02k|	}
 2947|       |
 2948|       |	/* Unrecognized key, just skip the entire value. */
 2949|    822|	__archive_read_consume(a, value_length);
 2950|    822|	return (err);
 2951|  1.02k|}
archive_read_support_format_tar.c:pax_attribute_read_number:
 2350|     83|pax_attribute_read_number(struct archive_read *a, size_t value_length, int64_t *result) {
 2351|     83|	struct archive_string as;
 2352|     83|	int64_t unconsumed = 0;
 2353|     83|	int r;
 2354|       |
 2355|     83|	if (value_length > 64) {
  ------------------
  |  Branch (2355:6): [True: 0, False: 83]
  ------------------
 2356|      0|		__archive_read_consume(a, value_length);
 2357|      0|		*result = 0;
 2358|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2359|      0|	}
 2360|       |
 2361|     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]
  |  |  ------------------
  ------------------
 2362|     83|	r = read_bytes_to_string(a, &as, value_length, &unconsumed);
 2363|     83|	if (tar_flush_unconsumed(a, &unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|     83|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2363:6): [True: 0, False: 83]
  ------------------
 2364|      0|		*result = 0;
 2365|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2366|      0|	}
 2367|     83|	if (r < ARCHIVE_OK) {
  ------------------
  |  |  233|     83|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2367:6): [True: 0, False: 83]
  ------------------
 2368|      0|		archive_string_free(&as);
 2369|      0|		*result = 0;
 2370|      0|		return (r);
 2371|      0|	}
 2372|       |
 2373|     83|	*result = tar_atol10(as.s, archive_strlen(&as));
  ------------------
  |  |  178|     83|#define	archive_strlen(a) ((a)->length)
  ------------------
 2374|     83|	archive_string_free(&as);
 2375|     83|	if (*result < 0 || *result == INT64_MAX) {
  ------------------
  |  Branch (2375:6): [True: 0, False: 83]
  |  Branch (2375:21): [True: 0, False: 83]
  ------------------
 2376|      0|		*result = INT64_MAX;
 2377|      0|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2378|      0|	}
 2379|     83|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     83|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2380|     83|}
archive_read_support_format_tar.c:tar_atol10:
 3579|     83|{
 3580|     83|	return tar_atol_base_n(p, char_cnt, 10);
 3581|     83|}
archive_read_support_format_tar.c:pax_attribute_read_time:
 2315|     84|pax_attribute_read_time(struct archive_read *a, size_t value_length, __LA_TIME_T *ps, long *pn, int64_t *unconsumed) {
 2316|     84|	struct archive_string as;
 2317|     84|	int r;
 2318|       |
 2319|     84|	if (value_length > 128) {
  ------------------
  |  Branch (2319:6): [True: 1, False: 83]
  ------------------
 2320|      1|		__archive_read_consume(a, value_length);
 2321|      1|		*ps = 0;
 2322|      1|		*pn = 0;
 2323|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2324|      1|	}
 2325|       |
 2326|     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]
  |  |  ------------------
  ------------------
 2327|     83|	r = read_bytes_to_string(a, &as, value_length, unconsumed);
 2328|     83|	if (r < ARCHIVE_OK) {
  ------------------
  |  |  233|     83|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2328:6): [True: 0, False: 83]
  ------------------
 2329|      0|		archive_string_free(&as);
 2330|      0|		*ps = 0;
 2331|      0|		*pn = 0;
 2332|      0|		return (r);
 2333|      0|	}
 2334|       |
 2335|     83|	int64_t sec = 0;
 2336|     83|	pax_time(as.s, archive_strlen(&as), &sec, pn);
  ------------------
  |  |  178|     83|#define	archive_strlen(a) ((a)->length)
  ------------------
 2337|     83|	archive_string_free(&as);
 2338|       |
 2339|     83|	if (sec == INT64_MIN) {
  ------------------
  |  Branch (2339:6): [True: 45, False: 38]
  ------------------
 2340|     45|		*ps = 0;
 2341|     45|		*pn = 0;
 2342|     45|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|     45|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2343|     45|	} else {
 2344|     38|		*ps = (__LA_TIME_T)sec;
 2345|     38|	}
 2346|     38|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     38|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2347|     83|}
archive_read_support_format_tar.c:pax_time:
 2963|     83|{
 2964|     83|	char digit;
 2965|     83|	int64_t	s;
 2966|     83|	unsigned long l;
 2967|     83|	int sign;
 2968|     83|	int64_t limit, last_digit_limit;
 2969|       |
 2970|     83|	limit = INT64_MAX / 10;
 2971|     83|	last_digit_limit = INT64_MAX % 10;
 2972|       |
 2973|     83|	if (length <= 0) {
  ------------------
  |  Branch (2973:6): [True: 0, False: 83]
  ------------------
 2974|      0|		*ps = 0;
 2975|      0|		*pn = 0;
 2976|      0|		return;
 2977|      0|	}
 2978|     83|	s = 0;
 2979|     83|	sign = 1;
 2980|     83|	if (*p == '-') {
  ------------------
  |  Branch (2980:6): [True: 83, False: 0]
  ------------------
 2981|     83|		sign = -1;
 2982|     83|		p++;
 2983|     83|		length--;
 2984|     83|	}
 2985|    845|	while (length > 0 && *p >= '0' && *p <= '9') {
  ------------------
  |  Branch (2985:9): [True: 845, False: 0]
  |  Branch (2985:23): [True: 763, False: 82]
  |  Branch (2985:36): [True: 762, False: 1]
  ------------------
 2986|    762|		digit = *p - '0';
 2987|    762|		if (s > limit ||
  ------------------
  |  Branch (2987:7): [True: 0, False: 762]
  ------------------
 2988|    762|		    (s == limit && digit > last_digit_limit)) {
  ------------------
  |  Branch (2988:8): [True: 0, False: 762]
  |  Branch (2988:22): [True: 0, False: 0]
  ------------------
 2989|      0|			*ps = INT64_MIN;
 2990|      0|			*pn = 0;
 2991|      0|			return;
 2992|      0|		}
 2993|    762|		s = (s * 10) + digit;
 2994|    762|		++p;
 2995|    762|		--length;
 2996|    762|	}
 2997|       |
 2998|     83|	*ps = s * sign;
 2999|       |
 3000|     83|#if ARCHIVE_VERSION_NUMBER < 4000000
 3001|       |	/* Libarchive 4.0 will have __LA_TIME_T == int64_t, so
 3002|       |	   this will be unnecessary. */
 3003|       |	/* Test whether it overflows __LA_TIME_T */
 3004|     83|	__LA_TIME_T sec = (__LA_TIME_T)*ps;
  ------------------
  |  |  107|     83|#define __LA_TIME_T time_t
  ------------------
 3005|     83|	if ((int64_t)sec != *ps) {
  ------------------
  |  Branch (3005:6): [True: 0, False: 83]
  ------------------
 3006|      0|		*ps = INT64_MIN;
 3007|      0|		*pn = 0;
 3008|      0|		return;
 3009|      0|	}
 3010|     83|#endif
 3011|       |
 3012|       |	/* Calculate nanoseconds. */
 3013|     83|	*pn = 0;
 3014|       |
 3015|     83|	if (length <= 0) {
  ------------------
  |  Branch (3015:6): [True: 0, False: 83]
  ------------------
 3016|      0|		return;
 3017|      0|	}
 3018|       |
 3019|       |	/* Skip `.` */
 3020|     83|	if (*p != '.') {
  ------------------
  |  Branch (3020:6): [True: 28, False: 55]
  ------------------
 3021|     28|		*ps = INT64_MIN;
 3022|     28|		*pn = 0;
 3023|     28|		return;
 3024|     28|	}
 3025|     55|	++p;
 3026|     55|	--length;
 3027|       |
 3028|     55|	l = 100000000UL;
 3029|    277|	do {
 3030|    277|		if (length <= 0) {
  ------------------
  |  Branch (3030:7): [True: 38, False: 239]
  ------------------
 3031|     38|			return;
 3032|     38|		}
 3033|    239|		if (*p >= '0' && *p <= '9') {
  ------------------
  |  Branch (3033:7): [True: 231, False: 8]
  |  Branch (3033:20): [True: 222, False: 9]
  ------------------
 3034|    222|			*pn += (*p - '0') * l;
 3035|    222|		} else {
 3036|     17|			*ps = INT64_MIN;
 3037|     17|			*pn = 0;
 3038|     17|			return;
 3039|     17|		}
 3040|    222|		++p;
 3041|    222|		--length;
 3042|    222|	} while (l /= 10);
  ------------------
  |  Branch (3042:11): [True: 222, False: 0]
  ------------------
 3043|       |
 3044|       |	/* Ignore resolution beyond nanoseconds,
 3045|       |	   but verify it's all decimal digits. */
 3046|      0|	while (length > 0) {
  ------------------
  |  Branch (3046:9): [True: 0, False: 0]
  ------------------
 3047|      0|		if (*p < '0' || *p > '9') {
  ------------------
  |  Branch (3047:7): [True: 0, False: 0]
  |  Branch (3047:19): [True: 0, False: 0]
  ------------------
 3048|      0|			*ps = INT64_MIN;
 3049|      0|			*pn = 0;
 3050|      0|			return;
 3051|      0|		}
 3052|      0|		++p;
 3053|      0|		--length;
 3054|      0|	}
 3055|      0|}
archive_read_support_format_tar.c:pax_attribute_LIBARCHIVE_xattr:
 2189|     36|{
 2190|     36|	char *name_decoded;
 2191|     36|	void *value_decoded;
 2192|     36|	size_t value_len;
 2193|       |
 2194|     36|	if (name_length < 1)
  ------------------
  |  Branch (2194:6): [True: 0, False: 36]
  ------------------
 2195|      0|		return 3;
 2196|       |
 2197|       |	/* URL-decode name */
 2198|     36|	name_decoded = url_decode(name, name_length);
 2199|     36|	if (name_decoded == NULL)
  ------------------
  |  Branch (2199:6): [True: 0, False: 36]
  ------------------
 2200|      0|		return 2;
 2201|       |
 2202|       |	/* Base-64 decode value */
 2203|     36|	value_decoded = base64_decode(value, value_length, &value_len);
 2204|     36|	if (value_decoded == NULL) {
  ------------------
  |  Branch (2204:6): [True: 0, False: 36]
  ------------------
 2205|      0|		free(name_decoded);
 2206|      0|		return 1;
 2207|      0|	}
 2208|       |
 2209|     36|	archive_entry_xattr_add_entry(entry, name_decoded,
 2210|     36|		value_decoded, value_len);
 2211|       |
 2212|     36|	free(name_decoded);
 2213|     36|	free(value_decoded);
 2214|     36|	return 0;
 2215|     36|}
archive_read_support_format_tar.c:url_decode:
 3788|     36|{
 3789|     36|	char *out, *d;
 3790|     36|	const char *s;
 3791|       |
 3792|     36|	out = malloc(length + 1);
 3793|     36|	if (out == NULL)
  ------------------
  |  Branch (3793:6): [True: 0, False: 36]
  ------------------
 3794|      0|		return (NULL);
 3795|    155|	for (s = in, d = out; length > 0 && *s != '\0'; ) {
  ------------------
  |  Branch (3795:24): [True: 119, False: 36]
  |  Branch (3795:38): [True: 119, False: 0]
  ------------------
 3796|    119|		if (s[0] == '%' && length > 2) {
  ------------------
  |  Branch (3796:7): [True: 9, False: 110]
  |  Branch (3796:22): [True: 9, False: 0]
  ------------------
 3797|       |			/* Try to convert % escape */
 3798|      9|			int digit1 = tohex(s[1]);
 3799|      9|			int digit2 = tohex(s[2]);
 3800|      9|			if (digit1 >= 0 && digit2 >= 0) {
  ------------------
  |  Branch (3800:8): [True: 0, False: 9]
  |  Branch (3800:23): [True: 0, False: 0]
  ------------------
 3801|       |				/* Looks good, consume three chars */
 3802|      0|				s += 3;
 3803|      0|				length -= 3;
 3804|       |				/* Convert output */
 3805|      0|				*d++ = ((digit1 << 4) | digit2);
 3806|      0|				continue;
 3807|      0|			}
 3808|       |			/* Else fall through and treat '%' as normal char */
 3809|      9|		}
 3810|    119|		*d++ = *s++;
 3811|    119|		--length;
 3812|    119|	}
 3813|     36|	*d = '\0';
 3814|     36|	return (out);
 3815|     36|}
archive_read_support_format_tar.c:tohex:
 3819|     18|{
 3820|     18|	if (c >= '0' && c <= '9')
  ------------------
  |  Branch (3820:6): [True: 17, False: 1]
  |  Branch (3820:18): [True: 0, False: 17]
  ------------------
 3821|      0|		return (c - '0');
 3822|     18|	else if (c >= 'A' && c <= 'F')
  ------------------
  |  Branch (3822:11): [True: 17, False: 1]
  |  Branch (3822:23): [True: 0, False: 17]
  ------------------
 3823|      0|		return (c - 'A' + 10);
 3824|     18|	else if (c >= 'a' && c <= 'f')
  ------------------
  |  Branch (3824:11): [True: 17, False: 1]
  |  Branch (3824:23): [True: 8, False: 9]
  ------------------
 3825|      8|		return (c - 'a' + 10);
 3826|     10|	else
 3827|     10|		return (-1);
 3828|     18|}
archive_read_support_format_tar.c:base64_decode:
 3720|     36|{
 3721|     36|	static const unsigned char decode_table[128] = {
 3722|     36|		255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
 3723|     36|		255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
 3724|     36|		255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
 3725|     36|		255, 255, 255, 255, 255, 255, 255, 62, 255, 255, 255, 63,
 3726|     36|		52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, 255, 255, 255,
 3727|     36|		255, 255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
 3728|     36|		14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 255, 255,
 3729|     36|		255, 255, 255, 255, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
 3730|     36|		36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
 3731|     36|		51, 255, 255, 255, 255, 255 };
 3732|     36|	char *out, *d;
 3733|     36|	const unsigned char *src = (const unsigned char *)s;
 3734|       |
 3735|       |	/* Allocate enough space to hold the entire output. */
 3736|       |	/* Note that we may not use all of this... */
 3737|     36|	out = malloc(len - len / 4 + 1);
 3738|     36|	if (out == NULL) {
  ------------------
  |  Branch (3738:6): [True: 0, False: 36]
  ------------------
 3739|      0|		*out_len = 0;
 3740|      0|		return (NULL);
 3741|      0|	}
 3742|     36|	d = out;
 3743|       |
 3744|    975|	while (len > 0) {
  ------------------
  |  Branch (3744:9): [True: 939, False: 36]
  ------------------
 3745|       |		/* Collect the next group of (up to) four characters. */
 3746|    939|		int v = 0;
 3747|    939|		int group_size = 0;
 3748|  13.1k|		while (group_size < 4 && len > 0) {
  ------------------
  |  Branch (3748:10): [True: 12.2k, False: 903]
  |  Branch (3748:28): [True: 12.1k, False: 6]
  ------------------
 3749|       |			/* '=' or '_' padding indicates final group. */
 3750|  12.1k|			if (*src == '=' || *src == '_') {
  ------------------
  |  Branch (3750:8): [True: 30, False: 12.1k]
  |  Branch (3750:23): [True: 0, False: 12.1k]
  ------------------
 3751|     30|				len = 0;
 3752|     30|				break;
 3753|     30|			}
 3754|       |			/* Skip illegal characters (including line breaks) */
 3755|  12.1k|			if (*src > 127 || *src < 32
  ------------------
  |  Branch (3755:8): [True: 3.49k, False: 8.67k]
  |  Branch (3755:22): [True: 4.40k, False: 4.26k]
  ------------------
 3756|  8.49k|			    || decode_table[*src] == 0xff) {
  ------------------
  |  Branch (3756:11): [True: 599, False: 3.66k]
  ------------------
 3757|  8.49k|				len--;
 3758|  8.49k|				src++;
 3759|  8.49k|				continue;
 3760|  8.49k|			}
 3761|  3.66k|			v <<= 6;
 3762|  3.66k|			v |= decode_table[*src++];
 3763|  3.66k|			len --;
 3764|  3.66k|			group_size++;
 3765|  3.66k|		}
 3766|       |		/* Align a short group properly. */
 3767|    939|		v <<= 6 * (4 - group_size);
 3768|       |		/* Unpack the group we just collected. */
 3769|    939|		switch (group_size) {
  ------------------
  |  Branch (3769:11): [True: 930, False: 9]
  ------------------
 3770|    903|		case 4: d[2] = v & 0xff;
  ------------------
  |  Branch (3770:3): [True: 903, False: 36]
  ------------------
 3771|       |			/* FALLTHROUGH */
 3772|    913|		case 3: d[1] = (v >> 8) & 0xff;
  ------------------
  |  Branch (3772:3): [True: 10, False: 929]
  ------------------
 3773|       |			/* FALLTHROUGH */
 3774|    921|		case 2: d[0] = (v >> 16) & 0xff;
  ------------------
  |  Branch (3774:3): [True: 8, False: 931]
  ------------------
 3775|    921|			break;
 3776|      9|		case 1: /* this is invalid! */
  ------------------
  |  Branch (3776:3): [True: 9, False: 930]
  ------------------
 3777|      9|			break;
 3778|    939|		}
 3779|    939|		d += group_size * 3 / 4;
 3780|    939|	}
 3781|       |
 3782|     36|	*out_len = d - out;
 3783|     36|	return (out);
 3784|     36|}
archive_read_support_format_tar.c:header_gnutar:
 3063|  1.84k|{
 3064|  1.84k|	const struct archive_entry_header_gnutar *header;
 3065|  1.84k|	int64_t t;
 3066|  1.84k|	int err = ARCHIVE_OK;
  ------------------
  |  |  233|  1.84k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3067|       |
 3068|       |	/*
 3069|       |	 * GNU header is like POSIX ustar, except 'prefix' is
 3070|       |	 * replaced with some other fields. This also means the
 3071|       |	 * filename is stored as in old-style archives.
 3072|       |	 */
 3073|       |
 3074|       |	/* Copy filename over (to ensure null termination). */
 3075|  1.84k|	header = (const struct archive_entry_header_gnutar *)h;
 3076|  1.84k|	const char *existing_pathname = archive_entry_pathname(entry);
 3077|  1.84k|	const wchar_t *existing_wcs_pathname = archive_entry_pathname_w(entry);
 3078|  1.84k|	if ((existing_pathname == NULL || existing_pathname[0] == '\0')
  ------------------
  |  Branch (3078:7): [True: 1.84k, False: 0]
  |  Branch (3078:36): [True: 0, False: 0]
  ------------------
 3079|  1.84k|	    && (existing_wcs_pathname == NULL || existing_wcs_pathname[0] == L'\0')) {
  ------------------
  |  Branch (3079:10): [True: 1.84k, False: 0]
  |  Branch (3079:43): [True: 0, False: 0]
  ------------------
 3080|  1.84k|		if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|  1.84k|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (3080:7): [True: 0, False: 1.84k]
  ------------------
 3081|  1.84k|		    header->name, sizeof(header->name), tar->sconv) != 0) {
 3082|      0|			err = set_conversion_failed_error(a, tar->sconv, "Pathname");
 3083|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (3083:8): [True: 0, False: 0]
  ------------------
 3084|      0|				return (err);
 3085|      0|		}
 3086|  1.84k|	}
 3087|       |
 3088|       |	/* Fields common to ustar and GNU */
 3089|       |	/* XXX Can the following be factored out since it's common
 3090|       |	 * to ustar and gnu tar?  Is it okay to move it down into
 3091|       |	 * header_common, perhaps?  */
 3092|  1.84k|	const char *existing_uname = archive_entry_uname(entry);
 3093|  1.84k|	if (existing_uname == NULL || existing_uname[0] == '\0') {
  ------------------
  |  Branch (3093:6): [True: 1.84k, False: 0]
  |  Branch (3093:32): [True: 0, False: 0]
  ------------------
 3094|  1.84k|		if (archive_entry_copy_uname_l(entry,
  ------------------
  |  |   86|  1.84k|#define archive_entry_copy_uname_l	_archive_entry_copy_uname_l
  ------------------
  |  Branch (3094:7): [True: 0, False: 1.84k]
  ------------------
 3095|  1.84k|		    header->uname, sizeof(header->uname), tar->sconv) != 0) {
 3096|      0|			err = set_conversion_failed_error(a, tar->sconv, "Uname");
 3097|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (3097:8): [True: 0, False: 0]
  ------------------
 3098|      0|				return (err);
 3099|      0|		}
 3100|  1.84k|	}
 3101|       |
 3102|  1.84k|	const char *existing_gname = archive_entry_gname(entry);
 3103|  1.84k|	if (existing_gname == NULL || existing_gname[0] == '\0') {
  ------------------
  |  Branch (3103:6): [True: 1.84k, False: 0]
  |  Branch (3103:32): [True: 0, False: 0]
  ------------------
 3104|  1.84k|		if (archive_entry_copy_gname_l(entry,
  ------------------
  |  |   71|  1.84k|#define archive_entry_copy_gname_l	_archive_entry_copy_gname_l
  ------------------
  |  Branch (3104:7): [True: 0, False: 1.84k]
  ------------------
 3105|  1.84k|		    header->gname, sizeof(header->gname), tar->sconv) != 0) {
 3106|      0|			err = set_conversion_failed_error(a, tar->sconv, "Gname");
 3107|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (3107:8): [True: 0, False: 0]
  ------------------
 3108|      0|				return (err);
 3109|      0|		}
 3110|  1.84k|	}
 3111|       |
 3112|       |	/* Parse out device numbers only for char and block specials */
 3113|  1.84k|	if (header->typeflag[0] == '3' || header->typeflag[0] == '4') {
  ------------------
  |  Branch (3113:6): [True: 189, False: 1.65k]
  |  Branch (3113:36): [True: 247, False: 1.40k]
  ------------------
 3114|    436|		if (!archive_entry_rdev_is_set(entry)) {
  ------------------
  |  Branch (3114:7): [True: 436, False: 0]
  ------------------
 3115|    436|			archive_entry_set_rdevmajor(entry, (dev_t)
 3116|    436|			    tar_atol(header->rdevmajor, sizeof(header->rdevmajor)));
 3117|    436|			archive_entry_set_rdevminor(entry, (dev_t)
 3118|    436|			    tar_atol(header->rdevminor, sizeof(header->rdevminor)));
 3119|    436|		}
 3120|  1.40k|	} else {
 3121|  1.40k|		archive_entry_set_rdev(entry, 0);
 3122|  1.40k|	}
 3123|       |
 3124|       |	/* Grab GNU-specific fields. */
 3125|  1.84k|	if (!archive_entry_atime_is_set(entry)) {
  ------------------
  |  Branch (3125:6): [True: 1.84k, False: 0]
  ------------------
 3126|  1.84k|		t = tar_atol(header->atime, sizeof(header->atime));
 3127|  1.84k|		if (t > 0)
  ------------------
  |  Branch (3127:7): [True: 707, False: 1.13k]
  ------------------
 3128|    707|			archive_entry_set_atime(entry, t, 0);
 3129|  1.84k|	}
 3130|  1.84k|	if (!archive_entry_ctime_is_set(entry)) {
  ------------------
  |  Branch (3130:6): [True: 1.84k, False: 0]
  ------------------
 3131|  1.84k|		t = tar_atol(header->ctime, sizeof(header->ctime));
 3132|  1.84k|		if (t > 0)
  ------------------
  |  Branch (3132:7): [True: 1.16k, False: 678]
  ------------------
 3133|  1.16k|			archive_entry_set_ctime(entry, t, 0);
 3134|  1.84k|	}
 3135|       |
 3136|  1.84k|	if (header->realsize[0] != 0) {
  ------------------
  |  Branch (3136:6): [True: 690, False: 1.15k]
  ------------------
 3137|       |		/* Treat as a synonym for the pax GNU.sparse.realsize attr */
 3138|    690|		tar->GNU_sparse_realsize
 3139|    690|		    = tar_atol(header->realsize, sizeof(header->realsize));
 3140|    690|		tar->size_fields |= TAR_SIZE_GNU_SPARSE_REALSIZE;
  ------------------
  |  |  162|    690|#define TAR_SIZE_GNU_SPARSE_REALSIZE 2
  ------------------
 3141|    690|	}
 3142|       |
 3143|  1.84k|	if (header->sparse[0].offset[0] != 0) {
  ------------------
  |  Branch (3143:6): [True: 1.56k, False: 276]
  ------------------
 3144|  1.56k|		if (gnu_sparse_old_read(a, tar, header, unconsumed)
  ------------------
  |  Branch (3144:7): [True: 8, False: 1.56k]
  ------------------
 3145|  1.56k|		    != ARCHIVE_OK)
  ------------------
  |  |  233|  1.56k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3146|      8|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3147|  1.56k|	} else {
 3148|    276|		if (header->isextended[0] != 0) {
  ------------------
  |  Branch (3148:7): [True: 37, False: 239]
  ------------------
 3149|       |			/* XXX WTF? XXX */
 3150|     37|		}
 3151|    276|	}
 3152|       |
 3153|       |	/* Grab fields common to all tar variants. */
 3154|  1.83k|	err = header_common(a, tar, entry, h);
 3155|  1.83k|	if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|  1.83k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (3155:6): [True: 0, False: 1.83k]
  ------------------
 3156|      0|		return (err);
 3157|       |
 3158|  1.83k|	tar->entry_padding = 0x1ff & (-tar->entry_bytes_remaining);
 3159|       |
 3160|  1.83k|	return (err);
 3161|  1.83k|}
archive_read_support_format_tar.c:gnu_sparse_old_read:
 3216|  1.56k|{
 3217|  1.56k|	ssize_t bytes_read;
 3218|  1.56k|	const void *data;
 3219|  1.56k|	struct extended {
 3220|  1.56k|		struct gnu_sparse sparse[21];
 3221|  1.56k|		char	isextended[1];
 3222|  1.56k|		char	padding[7];
 3223|  1.56k|	};
 3224|  1.56k|	const struct extended *ext;
 3225|       |
 3226|  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 (3226:6): [True: 0, False: 1.56k]
  ------------------
 3227|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3228|  1.56k|	if (header->isextended[0] == 0)
  ------------------
  |  Branch (3228:6): [True: 1.05k, False: 518]
  ------------------
 3229|  1.05k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.05k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3230|       |
 3231|  2.23k|	do {
 3232|  2.23k|		if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|  2.23k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3232:7): [True: 0, False: 2.23k]
  ------------------
 3233|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3234|      0|		}
 3235|  2.23k|		data = __archive_read_ahead(a, 512, &bytes_read);
 3236|  2.23k|		if (data == NULL) {
  ------------------
  |  Branch (3236:7): [True: 7, False: 2.23k]
  ------------------
 3237|      7|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      7|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3238|      7|			    "Truncated tar archive "
 3239|      7|			    "detected while reading sparse file data");
 3240|      7|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3241|      7|		}
 3242|  2.23k|		*unconsumed = 512;
 3243|  2.23k|		ext = (const struct extended *)data;
 3244|  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 (3244:7): [True: 1, False: 2.23k]
  ------------------
 3245|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3246|  2.23k|	} while (ext->isextended[0] != 0);
  ------------------
  |  Branch (3246:11): [True: 1.72k, False: 510]
  ------------------
 3247|    510|	if (tar->sparse_list != NULL)
  ------------------
  |  Branch (3247:6): [True: 510, False: 0]
  ------------------
 3248|    510|		tar->entry_offset = tar->sparse_list->offset;
 3249|    510|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    510|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3250|    518|}
archive_read_support_format_tar.c:gnu_sparse_old_parse:
 3255|  3.79k|{
 3256|  43.9k|	while (length > 0 && sparse->offset[0] != 0) {
  ------------------
  |  Branch (3256:9): [True: 41.5k, False: 2.35k]
  |  Branch (3256:23): [True: 40.1k, False: 1.44k]
  ------------------
 3257|  40.1k|		if (gnu_add_sparse_entry(a, tar,
  ------------------
  |  Branch (3257:7): [True: 1, False: 40.1k]
  ------------------
 3258|  40.1k|		    tar_atol(sparse->offset, sizeof(sparse->offset)),
 3259|  40.1k|		    tar_atol(sparse->numbytes, sizeof(sparse->numbytes)))
 3260|  40.1k|		    != ARCHIVE_OK)
  ------------------
  |  |  233|  40.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3261|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3262|  40.1k|		sparse++;
 3263|  40.1k|		length--;
 3264|  40.1k|	}
 3265|  3.79k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.79k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3266|  3.79k|}
archive_read_support_format_tar.c:header_common:
 1375|  21.2k|{
 1376|  21.2k|	const struct archive_entry_header_ustar	*header;
 1377|  21.2k|	const char *existing_linkpath;
 1378|  21.2k|	const wchar_t *existing_wcs_linkpath;
 1379|  21.2k|	int     err = ARCHIVE_OK;
  ------------------
  |  |  233|  21.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1380|       |
 1381|  21.2k|	header = (const struct archive_entry_header_ustar *)h;
 1382|       |
 1383|       |	/* Parse out the numeric fields (all are octal) */
 1384|       |
 1385|       |	/* Split mode handling: Set filetype always, perm only if not already set */
 1386|  21.2k|	archive_entry_set_filetype(entry,
 1387|  21.2k|	    (mode_t)tar_atol(header->mode, sizeof(header->mode)));
 1388|  21.2k|	if (!archive_entry_perm_is_set(entry)) {
  ------------------
  |  Branch (1388:6): [True: 21.1k, False: 39]
  ------------------
 1389|  21.1k|		archive_entry_set_perm(entry,
 1390|  21.1k|			(mode_t)tar_atol(header->mode, sizeof(header->mode)));
 1391|  21.1k|	}
 1392|       |
 1393|       |	/* Set uid, gid, mtime if not already set */
 1394|  21.2k|	if (!archive_entry_uid_is_set(entry)) {
  ------------------
  |  Branch (1394:6): [True: 21.2k, False: 0]
  ------------------
 1395|  21.2k|		archive_entry_set_uid(entry, tar_atol(header->uid, sizeof(header->uid)));
 1396|  21.2k|	}
 1397|  21.2k|	if (!archive_entry_gid_is_set(entry)) {
  ------------------
  |  Branch (1397:6): [True: 21.2k, False: 0]
  ------------------
 1398|  21.2k|		archive_entry_set_gid(entry, tar_atol(header->gid, sizeof(header->gid)));
 1399|  21.2k|	}
 1400|  21.2k|	if (!archive_entry_mtime_is_set(entry)) {
  ------------------
  |  Branch (1400:6): [True: 21.2k, False: 0]
  ------------------
 1401|  21.2k|		int64_t t64 = tar_atol(header->mtime, sizeof(header->mtime));
 1402|  21.2k|		time_t t = (time_t)t64;
 1403|  21.2k|		if ((int64_t)t != t64) { /* time_t overflowed */
  ------------------
  |  Branch (1403:7): [True: 0, False: 21.2k]
  ------------------
 1404|      0|			t = get_time_t_max();
 1405|      0|		}
 1406|  21.2k|		archive_entry_set_mtime(entry, t, 0);
 1407|  21.2k|	}
 1408|       |
 1409|       |	/* Reconcile the size info. */
 1410|       |	/* First, how big is the file on disk? */
 1411|  21.2k|	if ((tar->size_fields & TAR_SIZE_GNU_SPARSE_REALSIZE) != 0) {
  ------------------
  |  |  162|  21.2k|#define TAR_SIZE_GNU_SPARSE_REALSIZE 2
  ------------------
  |  Branch (1411:6): [True: 682, False: 20.5k]
  ------------------
 1412|       |		/* GNU sparse format 1.0 uses `GNU.sparse.realsize`
 1413|       |		 * to hold the size of the file on disk. */
 1414|    682|		tar->disk_size = tar->GNU_sparse_realsize;
 1415|  20.5k|	} else if ((tar->size_fields & TAR_SIZE_GNU_SPARSE_SIZE) != 0
  ------------------
  |  |  163|  20.5k|#define TAR_SIZE_GNU_SPARSE_SIZE 4
  ------------------
  |  Branch (1415:13): [True: 0, False: 20.5k]
  ------------------
 1416|      0|		   && (tar->sparse_gnu_major == 0)) {
  ------------------
  |  Branch (1416:9): [True: 0, False: 0]
  ------------------
 1417|       |		/* GNU sparse format 0.0 and 0.1 use `GNU.sparse.size`
 1418|       |		 * to hold the size of the file on disk. */
 1419|      0|		tar->disk_size = tar->GNU_sparse_size;
 1420|  20.5k|	} else if ((tar->size_fields & TAR_SIZE_SCHILY_SPARSE_REALSIZE) != 0) {
  ------------------
  |  |  164|  20.5k|#define TAR_SIZE_SCHILY_SPARSE_REALSIZE 8
  ------------------
  |  Branch (1420:13): [True: 4, False: 20.5k]
  ------------------
 1421|      4|		tar->disk_size = tar->SCHILY_sparse_realsize;
 1422|  20.5k|	} else if ((tar->size_fields & TAR_SIZE_PAX_SIZE) != 0) {
  ------------------
  |  |  161|  20.5k|#define TAR_SIZE_PAX_SIZE 1
  ------------------
  |  Branch (1422:13): [True: 0, False: 20.5k]
  ------------------
 1423|      0|		tar->disk_size = tar->pax_size;
 1424|  20.5k|	} else {
 1425|       |		/* There wasn't a suitable pax header, so use the ustar info */
 1426|  20.5k|		tar->disk_size = tar_atol(header->size, sizeof(header->size));
 1427|  20.5k|	}
 1428|       |
 1429|  21.2k|	if (tar->disk_size < 0) {
  ------------------
  |  Branch (1429:6): [True: 11, False: 21.2k]
  ------------------
 1430|     11|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     11|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1431|     11|				  "Tar entry has negative file size");
 1432|     11|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     11|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1433|  21.2k|	} else if (tar->disk_size > entry_limit) {
  ------------------
  |  Branch (1433:13): [True: 0, False: 21.2k]
  ------------------
 1434|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1435|      0|				  "Tar entry size overflow");
 1436|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1437|  21.2k|	} else {
 1438|  21.2k|		archive_entry_set_size(entry, tar->disk_size);
 1439|  21.2k|	}
 1440|       |
 1441|       |	/* Second, how big is the data in the archive? */
 1442|  21.2k|	if ((tar->size_fields & TAR_SIZE_GNU_SPARSE_SIZE) != 0
  ------------------
  |  |  163|  21.2k|#define TAR_SIZE_GNU_SPARSE_SIZE 4
  ------------------
  |  Branch (1442:6): [True: 0, False: 21.2k]
  ------------------
 1443|      0|	    && (tar->sparse_gnu_major == 1)) {
  ------------------
  |  Branch (1443:9): [True: 0, False: 0]
  ------------------
 1444|       |		/* GNU sparse format 1.0 uses `GNU.sparse.size`
 1445|       |		 * to hold the size of the data in the archive. */
 1446|      0|		tar->entry_bytes_remaining = tar->GNU_sparse_size;
 1447|  21.2k|	} else if ((tar->size_fields & TAR_SIZE_PAX_SIZE) != 0) {
  ------------------
  |  |  161|  21.2k|#define TAR_SIZE_PAX_SIZE 1
  ------------------
  |  Branch (1447:13): [True: 0, False: 21.2k]
  ------------------
 1448|      0|		tar->entry_bytes_remaining = tar->pax_size;
 1449|  21.2k|	} else {
 1450|  21.2k|		tar->entry_bytes_remaining
 1451|  21.2k|			= tar_atol(header->size, sizeof(header->size));
 1452|  21.2k|	}
 1453|  21.2k|	if (tar->entry_bytes_remaining < 0) {
  ------------------
  |  Branch (1453:6): [True: 0, False: 21.2k]
  ------------------
 1454|      0|		tar->entry_bytes_remaining = 0;
 1455|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1456|      0|				  "Tar entry has negative size");
 1457|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1458|  21.2k|	} else if (tar->entry_bytes_remaining > entry_limit) {
  ------------------
  |  Branch (1458:13): [True: 0, False: 21.2k]
  ------------------
 1459|      0|		tar->entry_bytes_remaining = 0;
 1460|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1461|      0|				  "Tar entry size overflow");
 1462|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1463|      0|	}
 1464|       |
 1465|       |	/* Handle the tar type flag appropriately. */
 1466|  21.2k|	tar->filetype = header->typeflag[0];
 1467|       |
 1468|       |	/*
 1469|       |	 * TODO: If the linkpath came from Pax extension header, then
 1470|       |	 * we should obey the hdrcharset_utf8 flag when converting these.
 1471|       |	 */
 1472|  21.2k|	switch (tar->filetype) {
 1473|  6.19k|	case '1': /* Hard link */
  ------------------
  |  Branch (1473:2): [True: 6.19k, False: 15.0k]
  ------------------
 1474|  6.19k|		archive_entry_set_link_to_hardlink(entry);
 1475|  6.19k|		existing_wcs_linkpath = archive_entry_hardlink_w(entry);
 1476|  6.19k|		existing_linkpath = archive_entry_hardlink(entry);
 1477|  6.19k|		if ((existing_linkpath == NULL || existing_linkpath[0] == '\0')
  ------------------
  |  Branch (1477:8): [True: 6.19k, False: 0]
  |  Branch (1477:37): [True: 0, False: 0]
  ------------------
 1478|  6.19k|		    && (existing_wcs_linkpath == NULL || existing_wcs_linkpath[0] == '\0')) {
  ------------------
  |  Branch (1478:11): [True: 6.19k, False: 0]
  |  Branch (1478:44): [True: 0, False: 0]
  ------------------
 1479|  6.19k|			struct archive_string linkpath;
 1480|  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]
  |  |  ------------------
  ------------------
 1481|  6.19k|			archive_strncpy(&linkpath,
  ------------------
  |  |  173|  6.19k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1482|  6.19k|					header->linkname, sizeof(header->linkname));
 1483|  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 (1483:8): [True: 0, False: 6.19k]
  ------------------
 1484|  6.19k|							  archive_strlen(&linkpath), tar->sconv) != 0) {
  ------------------
  |  |  178|  6.19k|#define	archive_strlen(a) ((a)->length)
  ------------------
 1485|      0|				err = set_conversion_failed_error(a, tar->sconv,
 1486|      0|								  "Linkname");
 1487|      0|				if (err == ARCHIVE_FATAL) {
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1487:9): [True: 0, False: 0]
  ------------------
 1488|      0|					archive_string_free(&linkpath);
 1489|      0|					return (err);
 1490|      0|				}
 1491|      0|			}
 1492|  6.19k|			archive_string_free(&linkpath);
 1493|  6.19k|		}
 1494|       |		/*
 1495|       |		 * The following may seem odd, but: Technically, tar
 1496|       |		 * does not store the file type for a "hard link"
 1497|       |		 * entry, only the fact that it is a hard link.  So, I
 1498|       |		 * leave the type zero normally.  But, pax interchange
 1499|       |		 * format allows hard links to have data, which
 1500|       |		 * implies that the underlying entry is a regular
 1501|       |		 * file.
 1502|       |		 */
 1503|  6.19k|		if (archive_entry_size(entry) > 0)
  ------------------
  |  Branch (1503:7): [True: 5.84k, False: 353]
  ------------------
 1504|  5.84k|			archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  5.84k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1505|       |
 1506|       |		/*
 1507|       |		 * A tricky point: Traditionally, tar readers have
 1508|       |		 * ignored the size field when reading hardlink
 1509|       |		 * entries, and some writers put non-zero sizes even
 1510|       |		 * though the body is empty.  POSIX blessed this
 1511|       |		 * convention in the 1988 standard, but broke with
 1512|       |		 * this tradition in 2001 by permitting hardlink
 1513|       |		 * entries to store valid bodies in pax interchange
 1514|       |		 * format, but not in ustar format.  Since there is no
 1515|       |		 * hard and fast way to distinguish pax interchange
 1516|       |		 * from earlier archives (the 'x' and 'g' entries are
 1517|       |		 * optional, after all), we need a heuristic.
 1518|       |		 */
 1519|  6.19k|		if (archive_entry_size(entry) == 0) {
  ------------------
  |  Branch (1519:7): [True: 353, False: 5.84k]
  ------------------
 1520|       |			/* If the size is already zero, we're done. */
 1521|  5.84k|		}  else if (a->archive.archive_format
  ------------------
  |  Branch (1521:15): [True: 0, False: 5.84k]
  ------------------
 1522|  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
  |  |  ------------------
  ------------------
 1523|       |			/* Definitely pax extended; must obey hardlink size. */
 1524|  5.84k|		} else if (a->archive.archive_format == ARCHIVE_FORMAT_TAR
  ------------------
  |  |  367|  11.6k|#define	ARCHIVE_FORMAT_TAR			0x30000
  ------------------
  |  Branch (1524:14): [True: 318, False: 5.52k]
  ------------------
 1525|  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 (1525:10): [True: 357, False: 5.16k]
  ------------------
 1526|    675|		{
 1527|       |			/* Old-style or GNU tar: we must ignore the size. */
 1528|    675|			archive_entry_set_size(entry, 0);
 1529|    675|			tar->entry_bytes_remaining = 0;
 1530|  5.16k|		} else if (archive_read_format_tar_bid(a, 50) > 50) {
  ------------------
  |  Branch (1530:14): [True: 247, False: 4.92k]
  ------------------
 1531|       |			/*
 1532|       |			 * We don't know if it's pax: If the bid
 1533|       |			 * function sees a valid ustar header
 1534|       |			 * immediately following, then let's ignore
 1535|       |			 * the hardlink size.
 1536|       |			 */
 1537|    247|			archive_entry_set_size(entry, 0);
 1538|    247|			tar->entry_bytes_remaining = 0;
 1539|    247|		}
 1540|       |		/*
 1541|       |		 * TODO: There are still two cases I'd like to handle:
 1542|       |		 *   = a ustar non-pax archive with a hardlink entry at
 1543|       |		 *     end-of-archive.  (Look for block of nulls following?)
 1544|       |		 *   = a pax archive that has not seen any pax headers
 1545|       |		 *     and has an entry which is a hardlink entry storing
 1546|       |		 *     a body containing an uncompressed tar archive.
 1547|       |		 * The first is worth addressing; I don't see any reliable
 1548|       |		 * way to deal with the second possibility.
 1549|       |		 */
 1550|  6.19k|		break;
 1551|    178|	case '2': /* Symlink */
  ------------------
  |  Branch (1551:2): [True: 178, False: 21.0k]
  ------------------
 1552|    178|		archive_entry_set_link_to_symlink(entry);
 1553|    178|		existing_wcs_linkpath = archive_entry_symlink_w(entry);
 1554|    178|		existing_linkpath = archive_entry_symlink(entry);
 1555|    178|		if ((existing_linkpath == NULL || existing_linkpath[0] == '\0')
  ------------------
  |  Branch (1555:8): [True: 178, False: 0]
  |  Branch (1555:37): [True: 0, False: 0]
  ------------------
 1556|    178|		    && (existing_wcs_linkpath == NULL || existing_wcs_linkpath[0] == '\0')) {
  ------------------
  |  Branch (1556:11): [True: 178, False: 0]
  |  Branch (1556:44): [True: 0, False: 0]
  ------------------
 1557|    178|			struct archive_string linkpath;
 1558|    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]
  |  |  ------------------
  ------------------
 1559|    178|			archive_strncpy(&linkpath,
  ------------------
  |  |  173|    178|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1560|    178|					header->linkname, sizeof(header->linkname));
 1561|    178|			if (archive_entry_copy_symlink_l(entry, linkpath.s,
  ------------------
  |  |   83|    178|#define archive_entry_copy_symlink_l	_archive_entry_copy_symlink_l
  ------------------
  |  Branch (1561:8): [True: 0, False: 178]
  ------------------
 1562|    178|			    archive_strlen(&linkpath), tar->sconv) != 0) {
  ------------------
  |  |  178|    178|#define	archive_strlen(a) ((a)->length)
  ------------------
 1563|      0|				err = set_conversion_failed_error(a, tar->sconv,
 1564|      0|				    "Linkname");
 1565|      0|				if (err == ARCHIVE_FATAL) {
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1565:9): [True: 0, False: 0]
  ------------------
 1566|      0|					archive_string_free(&linkpath);
 1567|      0|					return (err);
 1568|      0|				}
 1569|      0|			}
 1570|    178|			archive_string_free(&linkpath);
 1571|    178|		}
 1572|    178|		archive_entry_set_filetype(entry, AE_IFLNK);
  ------------------
  |  |  217|    178|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
 1573|    178|		archive_entry_set_size(entry, 0);
 1574|    178|		tar->entry_bytes_remaining = 0;
 1575|    178|		break;
 1576|    270|	case '3': /* Character device */
  ------------------
  |  Branch (1576:2): [True: 270, False: 20.9k]
  ------------------
 1577|    270|		archive_entry_set_filetype(entry, AE_IFCHR);
  ------------------
  |  |  219|    270|#define AE_IFCHR	((__LA_MODE_T)0020000)
  ------------------
 1578|    270|		archive_entry_set_size(entry, 0);
 1579|    270|		tar->entry_bytes_remaining = 0;
 1580|    270|		break;
 1581|    494|	case '4': /* Block device */
  ------------------
  |  Branch (1581:2): [True: 494, False: 20.7k]
  ------------------
 1582|    494|		archive_entry_set_filetype(entry, AE_IFBLK);
  ------------------
  |  |  220|    494|#define AE_IFBLK	((__LA_MODE_T)0060000)
  ------------------
 1583|    494|		archive_entry_set_size(entry, 0);
 1584|    494|		tar->entry_bytes_remaining = 0;
 1585|    494|		break;
 1586|    239|	case '5': /* Dir */
  ------------------
  |  Branch (1586:2): [True: 239, False: 20.9k]
  ------------------
 1587|    239|		archive_entry_set_filetype(entry, AE_IFDIR);
  ------------------
  |  |  221|    239|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1588|    239|		archive_entry_set_size(entry, 0);
 1589|    239|		tar->entry_bytes_remaining = 0;
 1590|    239|		break;
 1591|    289|	case '6': /* FIFO device */
  ------------------
  |  Branch (1591:2): [True: 289, False: 20.9k]
  ------------------
 1592|    289|		archive_entry_set_filetype(entry, AE_IFIFO);
  ------------------
  |  |  222|    289|#define AE_IFIFO	((__LA_MODE_T)0010000)
  ------------------
 1593|    289|		archive_entry_set_size(entry, 0);
 1594|    289|		tar->entry_bytes_remaining = 0;
 1595|    289|		break;
 1596|      6|	case 'D': /* GNU incremental directory type */
  ------------------
  |  Branch (1596:2): [True: 6, False: 21.2k]
  ------------------
 1597|       |		/*
 1598|       |		 * No special handling is actually required here.
 1599|       |		 * It might be nice someday to preprocess the file list and
 1600|       |		 * provide it to the client, though.
 1601|       |		 */
 1602|      6|		archive_entry_set_filetype(entry, AE_IFDIR);
  ------------------
  |  |  221|      6|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1603|      6|		break;
 1604|    445|	case 'M': /* GNU "Multi-volume" (remainder of file from last archive)*/
  ------------------
  |  Branch (1604:2): [True: 445, False: 20.7k]
  ------------------
 1605|       |		/*
 1606|       |		 * As far as I can tell, this is just like a regular file
 1607|       |		 * entry, except that the contents should be _appended_ to
 1608|       |		 * the indicated file at the indicated offset.  This may
 1609|       |		 * require some API work to fully support.
 1610|       |		 */
 1611|    445|		break;
 1612|      0|	case 'N': /* Old GNU "long filename" entry. */
  ------------------
  |  Branch (1612:2): [True: 0, False: 21.2k]
  ------------------
 1613|       |		/* The body of this entry is a script for renaming
 1614|       |		 * previously-extracted entries.  Ugh.  It will never
 1615|       |		 * be supported by libarchive. */
 1616|      0|		archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1617|      0|		break;
 1618|      0|	case 'S': /* GNU sparse files */
  ------------------
  |  Branch (1618:2): [True: 0, False: 21.2k]
  ------------------
 1619|       |		/*
 1620|       |		 * Sparse files are really just regular files with
 1621|       |		 * sparse information in the extended area.
 1622|       |		 */
 1623|       |		/* FALLTHROUGH */
 1624|  1.10k|	case '0': /* ustar "regular" file */
  ------------------
  |  Branch (1624:2): [True: 1.10k, False: 20.1k]
  ------------------
 1625|       |		/* FALLTHROUGH */
 1626|  13.1k|	default: /* Non-standard file types */
  ------------------
  |  Branch (1626:2): [True: 12.0k, False: 9.21k]
  ------------------
 1627|       |		/*
 1628|       |		 * Per POSIX: non-recognized types should always be
 1629|       |		 * treated as regular files.
 1630|       |		 */
 1631|  13.1k|		archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  13.1k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1632|  13.1k|		break;
 1633|  21.2k|	}
 1634|  21.2k|	return (err);
 1635|  21.2k|}
archive_read_support_format_tar.c:header_ustar:
 1817|  6.16k|{
 1818|  6.16k|	const struct archive_entry_header_ustar	*header;
 1819|  6.16k|	int err = ARCHIVE_OK, r;
  ------------------
  |  |  233|  6.16k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1820|       |
 1821|  6.16k|	header = (const struct archive_entry_header_ustar *)h;
 1822|       |
 1823|       |	/*
 1824|       |	 * The name field is fixed-width and may not be NUL-terminated.
 1825|       |	 * Use a temporary string only when prefix/name joining is required.
 1826|       |	 */
 1827|  6.16k|	const char *existing_pathname = archive_entry_pathname(entry);
 1828|  6.16k|	const wchar_t *existing_wcs_pathname = archive_entry_pathname_w(entry);
 1829|  6.16k|	if ((existing_pathname == NULL || existing_pathname[0] == '\0')
  ------------------
  |  Branch (1829:7): [True: 6.16k, False: 0]
  |  Branch (1829:36): [True: 0, False: 0]
  ------------------
 1830|  6.16k|	    && (existing_wcs_pathname == NULL || existing_wcs_pathname[0] == '\0')) {
  ------------------
  |  Branch (1830:10): [True: 6.16k, False: 0]
  |  Branch (1830:43): [True: 0, False: 0]
  ------------------
 1831|  6.16k|		struct archive_string as;
 1832|  6.16k|		const char *pathname;
 1833|  6.16k|		size_t pathname_length;
 1834|       |
 1835|  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]
  |  |  ------------------
  ------------------
 1836|  6.16k|		if (header->prefix[0]) {
  ------------------
  |  Branch (1836:7): [True: 5.71k, False: 451]
  ------------------
 1837|  5.71k|			archive_strncpy(&as, header->prefix, sizeof(header->prefix));
  ------------------
  |  |  173|  5.71k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1838|  5.71k|			if (as.s[archive_strlen(&as) - 1] != '/')
  ------------------
  |  |  178|  5.71k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1838:8): [True: 5.71k, False: 0]
  ------------------
 1839|  5.71k|				archive_strappend_char(&as, '/');
 1840|  5.71k|			archive_strncat(&as, header->name, sizeof(header->name));
 1841|  5.71k|			pathname = as.s;
 1842|  5.71k|			pathname_length = archive_strlen(&as);
  ------------------
  |  |  178|  5.71k|#define	archive_strlen(a) ((a)->length)
  ------------------
 1843|  5.71k|		} else {
 1844|    451|			pathname = header->name;
 1845|    451|			pathname_length = sizeof(header->name);
 1846|    451|		}
 1847|  6.16k|		r = archive_entry_copy_pathname_l(entry, pathname,
  ------------------
  |  |   80|  6.16k|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
 1848|  6.16k|		    pathname_length, tar->sconv);
 1849|  6.16k|		archive_string_free(&as);
 1850|  6.16k|		if (r != 0) {
  ------------------
  |  Branch (1850:7): [True: 0, False: 6.16k]
  ------------------
 1851|      0|			err = set_conversion_failed_error(a, tar->sconv, "Pathname");
 1852|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1852:8): [True: 0, False: 0]
  ------------------
 1853|      0|				return (err);
 1854|      0|		}
 1855|  6.16k|	}
 1856|       |
 1857|       |	/* Handle rest of common fields. */
 1858|  6.16k|	r = header_common(a, tar, entry, h);
 1859|  6.16k|	if (r == ARCHIVE_FATAL)
  ------------------
  |  |  239|  6.16k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1859:6): [True: 0, False: 6.16k]
  ------------------
 1860|      0|		return (r);
 1861|  6.16k|	if (r < err)
  ------------------
  |  Branch (1861:6): [True: 0, False: 6.16k]
  ------------------
 1862|      0|		err = r;
 1863|       |
 1864|       |	/* Handle POSIX ustar fields. */
 1865|  6.16k|	const char *existing_uname = archive_entry_uname(entry);
 1866|  6.16k|	if (existing_uname == NULL || existing_uname[0] == '\0') {
  ------------------
  |  Branch (1866:6): [True: 6.16k, False: 0]
  |  Branch (1866:32): [True: 0, False: 0]
  ------------------
 1867|  6.16k|		if (archive_entry_copy_uname_l(entry,
  ------------------
  |  |   86|  6.16k|#define archive_entry_copy_uname_l	_archive_entry_copy_uname_l
  ------------------
  |  Branch (1867:7): [True: 0, False: 6.16k]
  ------------------
 1868|  6.16k|		    header->uname, sizeof(header->uname), tar->sconv) != 0) {
 1869|      0|			err = set_conversion_failed_error(a, tar->sconv, "Uname");
 1870|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1870:8): [True: 0, False: 0]
  ------------------
 1871|      0|				return (err);
 1872|      0|		}
 1873|  6.16k|	}
 1874|       |
 1875|  6.16k|	const char *existing_gname = archive_entry_gname(entry);
 1876|  6.16k|	if (existing_gname == NULL || existing_gname[0] == '\0') {
  ------------------
  |  Branch (1876:6): [True: 6.16k, False: 0]
  |  Branch (1876:32): [True: 0, False: 0]
  ------------------
 1877|  6.16k|		if (archive_entry_copy_gname_l(entry,
  ------------------
  |  |   71|  6.16k|#define archive_entry_copy_gname_l	_archive_entry_copy_gname_l
  ------------------
  |  Branch (1877:7): [True: 0, False: 6.16k]
  ------------------
 1878|  6.16k|		    header->gname, sizeof(header->gname), tar->sconv) != 0) {
 1879|      0|			err = set_conversion_failed_error(a, tar->sconv, "Gname");
 1880|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1880:8): [True: 0, False: 0]
  ------------------
 1881|      0|				return (err);
 1882|      0|		}
 1883|  6.16k|	}
 1884|       |
 1885|       |	/* Parse out device numbers only for char and block specials. */
 1886|  6.16k|	if (header->typeflag[0] == '3' || header->typeflag[0] == '4') {
  ------------------
  |  Branch (1886:6): [True: 66, False: 6.09k]
  |  Branch (1886:36): [True: 232, False: 5.86k]
  ------------------
 1887|    298|		if (!archive_entry_rdev_is_set(entry)) {
  ------------------
  |  Branch (1887:7): [True: 298, False: 0]
  ------------------
 1888|    298|			archive_entry_set_rdevmajor(entry, (dev_t)
 1889|    298|			    tar_atol(header->rdevmajor, sizeof(header->rdevmajor)));
 1890|    298|			archive_entry_set_rdevminor(entry, (dev_t)
 1891|    298|			    tar_atol(header->rdevminor, sizeof(header->rdevminor)));
 1892|    298|		}
 1893|  5.86k|	} else {
 1894|  5.86k|		archive_entry_set_rdev(entry, 0);
 1895|  5.86k|	}
 1896|       |
 1897|  6.16k|	tar->entry_padding = 0x1ff & (-tar->entry_bytes_remaining);
 1898|       |
 1899|  6.16k|	return (err);
 1900|  6.16k|}
archive_read_support_format_tar.c:header_old_tar:
 1643|  13.2k|{
 1644|  13.2k|	const struct archive_entry_header_ustar	*header;
 1645|  13.2k|	int err = ARCHIVE_OK, err2;
  ------------------
  |  |  233|  13.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1646|       |
 1647|       |	/*
 1648|       |	 * Copy filename over (to ensure null termination).
 1649|       |	 * Skip if pathname was already set e.g. by header_gnu_longname()
 1650|       |	 */
 1651|  13.2k|	header = (const struct archive_entry_header_ustar *)h;
 1652|       |
 1653|  13.2k|	const char *existing_pathname = archive_entry_pathname(entry);
 1654|  13.2k|	const wchar_t *existing_wcs_pathname = archive_entry_pathname_w(entry);
 1655|  13.2k|	if ((existing_pathname == NULL || existing_pathname[0] == '\0')
  ------------------
  |  Branch (1655:7): [True: 13.2k, False: 2]
  |  Branch (1655:36): [True: 0, False: 2]
  ------------------
 1656|  13.2k|	    && (existing_wcs_pathname == NULL || existing_wcs_pathname[0] == '\0') &&
  ------------------
  |  Branch (1656:10): [True: 13.2k, False: 0]
  |  Branch (1656:43): [True: 0, False: 0]
  ------------------
 1657|  13.2k|	    archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|  13.2k|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (1657:6): [True: 0, False: 13.2k]
  ------------------
 1658|  13.2k|	    header->name, sizeof(header->name), tar->sconv) != 0) {
 1659|      0|		err = set_conversion_failed_error(a, tar->sconv, "Pathname");
 1660|      0|		if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1660:7): [True: 0, False: 0]
  ------------------
 1661|      0|			return (err);
 1662|      0|	}
 1663|       |
 1664|       |	/* Grab rest of common fields */
 1665|  13.2k|	err2 = header_common(a, tar, entry, h);
 1666|  13.2k|	if (err > err2)
  ------------------
  |  Branch (1666:6): [True: 11, False: 13.2k]
  ------------------
 1667|     11|		err = err2;
 1668|       |
 1669|  13.2k|	tar->entry_padding = 0x1ff & (-tar->entry_bytes_remaining);
 1670|  13.2k|	return (err);
 1671|  13.2k|}
archive_read_support_format_tar.c:is_mac_metadata_entry:
 1677|  21.2k|is_mac_metadata_entry(struct archive_entry *entry) {
 1678|  21.2k|	const char *p, *name;
 1679|  21.2k|	const wchar_t *wp, *wname;
 1680|       |
 1681|  21.2k|	wname = wp = archive_entry_pathname_w(entry);
 1682|  21.2k|	if (wp != NULL) {
  ------------------
  |  Branch (1682:6): [True: 20.5k, False: 660]
  ------------------
 1683|       |		/* Find the last path element. */
 1684|   918k|		for (; *wp != L'\0'; ++wp) {
  ------------------
  |  Branch (1684:10): [True: 897k, False: 20.5k]
  ------------------
 1685|   897k|			if (wp[0] == '/' && wp[1] != L'\0')
  ------------------
  |  Branch (1685:8): [True: 5.86k, False: 891k]
  |  Branch (1685:24): [True: 365, False: 5.49k]
  ------------------
 1686|    365|				wname = wp + 1;
 1687|   897k|		}
 1688|       |		/*
 1689|       |		 * If last path element starts with "._", then
 1690|       |		 * this is a Mac extension.
 1691|       |		 */
 1692|  20.5k|		if (wname[0] == L'.' && wname[1] == L'_' && wname[2] != L'\0')
  ------------------
  |  Branch (1692:7): [True: 38, False: 20.5k]
  |  Branch (1692:27): [True: 0, False: 38]
  |  Branch (1692:47): [True: 0, False: 0]
  ------------------
 1693|      0|			return 1;
 1694|  20.5k|	} else {
 1695|       |		/* Find the last path element. */
 1696|    660|		name = p = archive_entry_pathname(entry);
 1697|    660|		if (p == NULL)
  ------------------
  |  Branch (1697:7): [True: 0, False: 660]
  ------------------
 1698|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1699|  52.8k|		for (; *p != '\0'; ++p) {
  ------------------
  |  Branch (1699:10): [True: 52.1k, False: 660]
  ------------------
 1700|  52.1k|			if (p[0] == '/' && p[1] != '\0')
  ------------------
  |  Branch (1700:8): [True: 277, False: 51.8k]
  |  Branch (1700:23): [True: 45, False: 232]
  ------------------
 1701|     45|				name = p + 1;
 1702|  52.1k|		}
 1703|       |		/*
 1704|       |		 * If last path element starts with "._", then
 1705|       |		 * this is a Mac extension.
 1706|       |		 */
 1707|    660|		if (name[0] == '.' && name[1] == '_' && name[2] != '\0')
  ------------------
  |  Branch (1707:7): [True: 0, False: 660]
  |  Branch (1707:25): [True: 0, False: 0]
  |  Branch (1707:43): [True: 0, False: 0]
  ------------------
 1708|      0|			return 1;
 1709|    660|	}
 1710|       |	/* Not a mac extension */
 1711|  21.2k|	return 0;
 1712|  21.2k|}
archive_read_support_format_tar.c:gnu_sparse_10_read:
 3398|      3|{
 3399|      3|	int64_t bytes_read, entries, offset, size, to_skip, remaining;
 3400|       |
 3401|       |	/* Clear out the existing sparse list. */
 3402|      3|	gnu_clear_sparse_list(tar);
 3403|       |
 3404|      3|	remaining = tar->entry_bytes_remaining;
 3405|       |
 3406|       |	/* Parse entries. */
 3407|      3|	entries = gnu_sparse_10_atol(a, tar, &remaining, unconsumed);
 3408|      3|	if (entries < 0)
  ------------------
  |  Branch (3408:6): [True: 3, False: 0]
  ------------------
 3409|      3|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3410|       |	/* Parse the individual entries. */
 3411|      0|	while (entries-- > 0) {
  ------------------
  |  Branch (3411:9): [True: 0, False: 0]
  ------------------
 3412|       |		/* Parse offset/size */
 3413|      0|		offset = gnu_sparse_10_atol(a, tar, &remaining, unconsumed);
 3414|      0|		if (offset < 0)
  ------------------
  |  Branch (3414:7): [True: 0, False: 0]
  ------------------
 3415|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3416|      0|		size = gnu_sparse_10_atol(a, tar, &remaining, unconsumed);
 3417|      0|		if (size < 0)
  ------------------
  |  Branch (3417:7): [True: 0, False: 0]
  ------------------
 3418|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3419|       |		/* Add a new sparse entry. */
 3420|      0|		if (gnu_add_sparse_entry(a, tar, offset, size) != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3420:7): [True: 0, False: 0]
  ------------------
 3421|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3422|      0|	}
 3423|       |	/* Skip rest of block... */
 3424|      0|	if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3424:6): [True: 0, False: 0]
  ------------------
 3425|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3426|      0|	}
 3427|      0|	bytes_read = tar->entry_bytes_remaining - remaining;
 3428|      0|	to_skip = 0x1ff & -bytes_read;
 3429|       |	/* Fail if tar->entry_bytes_remaing would get negative */
 3430|      0|	if (to_skip > remaining)
  ------------------
  |  Branch (3430:6): [True: 0, False: 0]
  ------------------
 3431|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3432|      0|	if (to_skip != __archive_read_consume(a, to_skip))
  ------------------
  |  Branch (3432:6): [True: 0, False: 0]
  ------------------
 3433|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3434|      0|	return (bytes_read + to_skip);
 3435|      0|}
archive_read_support_format_tar.c:gnu_sparse_10_atol:
 3352|      3|{
 3353|      3|	int64_t l, limit, last_digit_limit;
 3354|      3|	const char *p;
 3355|      3|	ssize_t bytes_read;
 3356|      3|	int base, digit;
 3357|       |
 3358|      3|	base = 10;
 3359|      3|	limit = INT64_MAX / base;
 3360|      3|	last_digit_limit = INT64_MAX % base;
 3361|       |
 3362|       |	/*
 3363|       |	 * Skip any lines starting with '#'; GNU tar specs
 3364|       |	 * don't require this, but they should.
 3365|       |	 */
 3366|      3|	do {
 3367|      3|		bytes_read = readline(a, tar, &p,
 3368|      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]
  |  |  ------------------
  ------------------
 3369|      3|		if (bytes_read <= 0)
  ------------------
  |  Branch (3369:7): [True: 2, False: 1]
  ------------------
 3370|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3371|      1|		*remaining -= bytes_read;
 3372|      1|	} while (p[0] == '#');
  ------------------
  |  Branch (3372:11): [True: 0, False: 1]
  ------------------
 3373|       |
 3374|      1|	l = 0;
 3375|      1|	while (bytes_read > 0) {
  ------------------
  |  Branch (3375:9): [True: 1, False: 0]
  ------------------
 3376|      1|		if (*p == '\n')
  ------------------
  |  Branch (3376:7): [True: 0, False: 1]
  ------------------
 3377|      0|			return (l);
 3378|      1|		if (*p < '0' || *p >= '0' + base)
  ------------------
  |  Branch (3378:7): [True: 1, False: 0]
  |  Branch (3378:19): [True: 0, False: 0]
  ------------------
 3379|      1|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      1|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 3380|      0|		digit = *p - '0';
 3381|      0|		if (l > limit || (l == limit && digit > last_digit_limit))
  ------------------
  |  Branch (3381:7): [True: 0, False: 0]
  |  Branch (3381:21): [True: 0, False: 0]
  |  Branch (3381:35): [True: 0, False: 0]
  ------------------
 3382|      0|			l = INT64_MAX; /* Truncate on overflow. */
 3383|      0|		else
 3384|      0|			l = (l * base) + digit;
 3385|      0|		p++;
 3386|      0|		bytes_read--;
 3387|      0|	}
 3388|       |	/* TODO: Error message. */
 3389|      0|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 3390|      1|}
archive_read_support_format_tar.c:readline:
 3645|      3|{
 3646|      3|	ssize_t bytes_read;
 3647|      3|	ssize_t total_size = 0;
 3648|      3|	const void *p, *t;
 3649|      3|	const char *s;
 3650|       |
 3651|      3|	if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3651:6): [True: 0, False: 3]
  ------------------
 3652|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3653|      0|	}
 3654|       |
 3655|      3|	t = __archive_read_ahead(a, 1, &bytes_read);
 3656|      3|	if (bytes_read <= 0 || t == NULL)
  ------------------
  |  Branch (3656:6): [True: 0, False: 3]
  |  Branch (3656:25): [True: 0, False: 3]
  ------------------
 3657|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3658|      3|	s = t;  /* Start of line? */
 3659|      3|	p = memchr(t, '\n', bytes_read);
 3660|       |	/* If we found '\n' in the read buffer, return pointer to that. */
 3661|      3|	if (p != NULL) {
  ------------------
  |  Branch (3661:6): [True: 3, False: 0]
  ------------------
 3662|      3|		bytes_read = 1 + ((const char *)p) - s;
 3663|      3|		if (bytes_read > limit) {
  ------------------
  |  Branch (3663:7): [True: 2, False: 1]
  ------------------
 3664|      2|			archive_set_error(&a->archive,
 3665|      2|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3666|      2|			    "Line too long");
 3667|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3668|      2|		}
 3669|      1|		*unconsumed = bytes_read;
 3670|      1|		*start = s;
 3671|      1|		return (bytes_read);
 3672|      3|	}
 3673|      0|	*unconsumed = bytes_read;
 3674|       |	/* Otherwise, we need to accumulate in a line buffer. */
 3675|      0|	for (;;) {
 3676|      0|		if (total_size + bytes_read > limit) {
  ------------------
  |  Branch (3676:7): [True: 0, False: 0]
  ------------------
 3677|      0|			archive_set_error(&a->archive,
 3678|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3679|      0|			    "Line too long");
 3680|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3681|      0|		}
 3682|      0|		if (archive_string_ensure(&tar->line, total_size + bytes_read) == NULL) {
  ------------------
  |  Branch (3682:7): [True: 0, False: 0]
  ------------------
 3683|      0|			archive_set_error(&a->archive, ENOMEM,
 3684|      0|			    "Can't allocate working buffer");
 3685|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3686|      0|		}
 3687|      0|		memcpy(tar->line.s + total_size, t, bytes_read);
 3688|      0|		tar_flush_unconsumed(a, unconsumed);
 3689|      0|		total_size += bytes_read;
 3690|       |		/* If we found '\n', clean up and return. */
 3691|      0|		if (p != NULL) {
  ------------------
  |  Branch (3691:7): [True: 0, False: 0]
  ------------------
 3692|      0|			*start = tar->line.s;
 3693|      0|			return (total_size);
 3694|      0|		}
 3695|       |		/* Read some more. */
 3696|      0|		t = __archive_read_ahead(a, 1, &bytes_read);
 3697|      0|		if (bytes_read <= 0 || t == NULL)
  ------------------
  |  Branch (3697:7): [True: 0, False: 0]
  |  Branch (3697:26): [True: 0, False: 0]
  ------------------
 3698|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3699|      0|		s = t;  /* Start of line? */
 3700|      0|		p = memchr(t, '\n', bytes_read);
 3701|       |		/* If we found '\n', trim the read. */
 3702|      0|		if (p != NULL) {
  ------------------
  |  Branch (3702:7): [True: 0, False: 0]
  ------------------
 3703|      0|			bytes_read = 1 + ((const char *)p) - s;
 3704|      0|		}
 3705|      0|		*unconsumed = bytes_read;
 3706|      0|	}
 3707|      0|}
archive_read_support_format_tar.c:tar_flush_unconsumed:
  514|   721k|{
  515|   721k|	if (*unconsumed) {
  ------------------
  |  Branch (515:6): [True: 273k, False: 447k]
  ------------------
  516|       |/*
  517|       |		void *data = (void *)__archive_read_ahead(a, *unconsumed, NULL);
  518|       |		 * this block of code is to poison claimed unconsumed space, ensuring
  519|       |		 * things break if it is in use still.
  520|       |		 * currently it WILL break things, so enable it only for debugging this issue
  521|       |		if (data) {
  522|       |			memset(data, 0xff, *unconsumed);
  523|       |		}
  524|       |*/
  525|   273k|		int64_t consumed = __archive_read_consume(a, *unconsumed);
  526|   273k|		if (consumed != *unconsumed) {
  ------------------
  |  Branch (526:7): [True: 159, False: 273k]
  ------------------
  527|    159|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    159|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  528|    159|		}
  529|   273k|		*unconsumed = 0;
  530|   273k|	}
  531|   721k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|   721k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  532|   721k|}
archive_read_support_format_tar.c:gnu_add_sparse_entry:
 3166|   272k|{
 3167|   272k|	struct sparse_block *p;
 3168|       |
 3169|   272k|	p = calloc(1, sizeof(*p));
 3170|   272k|	if (p == NULL) {
  ------------------
  |  Branch (3170:6): [True: 0, False: 272k]
  ------------------
 3171|      0|		archive_set_error(&a->archive, ENOMEM, "Out of memory");
 3172|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3173|      0|	}
 3174|   272k|	if (tar->sparse_last != NULL)
  ------------------
  |  Branch (3174:6): [True: 38.5k, False: 233k]
  ------------------
 3175|  38.5k|		tar->sparse_last->next = p;
 3176|   233k|	else
 3177|   233k|		tar->sparse_list = p;
 3178|   272k|	tar->sparse_last = p;
 3179|   272k|	if (remaining < 0 || offset < 0 || offset > INT64_MAX - remaining) {
  ------------------
  |  Branch (3179:6): [True: 1, False: 272k]
  |  Branch (3179:23): [True: 0, False: 272k]
  |  Branch (3179:37): [True: 0, False: 272k]
  ------------------
 3180|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Malformed sparse map data");
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3181|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3182|      1|	}
 3183|   272k|	p->offset = offset;
 3184|   272k|	p->remaining = remaining;
 3185|   272k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|   272k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3186|   272k|}
archive_read_support_format_tar.c:archive_read_format_tar_read_data:
  640|  37.4k|{
  641|  37.4k|	ssize_t bytes_read;
  642|  37.4k|	struct tar *tar;
  643|  37.4k|	struct sparse_block *p;
  644|       |
  645|  37.4k|	tar = (struct tar *)(a->format->data);
  646|       |
  647|  37.4k|	for (;;) {
  648|       |		/* Remove exhausted entries from sparse list. */
  649|  55.9k|		while (tar->sparse_list != NULL &&
  ------------------
  |  Branch (649:10): [True: 37.1k, False: 18.8k]
  ------------------
  650|  37.1k|		    tar->sparse_list->remaining == 0) {
  ------------------
  |  Branch (650:7): [True: 18.4k, False: 18.6k]
  ------------------
  651|  18.4k|			p = tar->sparse_list;
  652|  18.4k|			tar->sparse_list = p->next;
  653|  18.4k|			free(p);
  654|  18.4k|		}
  655|       |
  656|  37.4k|		if (tar->entry_bytes_unconsumed) {
  ------------------
  |  Branch (656:7): [True: 1.10k, False: 36.3k]
  ------------------
  657|  1.10k|			__archive_read_consume(a, tar->entry_bytes_unconsumed);
  658|  1.10k|			tar->entry_bytes_unconsumed = 0;
  659|  1.10k|		}
  660|       |
  661|       |		/* If we're at end of file, return EOF. */
  662|  37.4k|		if (tar->sparse_list == NULL ||
  ------------------
  |  Branch (662:7): [True: 18.8k, False: 18.6k]
  ------------------
  663|  36.2k|		    tar->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (663:7): [True: 17.4k, False: 1.24k]
  ------------------
  664|  36.2k|			int64_t request = tar->entry_bytes_remaining +
  665|  36.2k|			    tar->entry_padding;
  666|       |
  667|  36.2k|			if (__archive_read_consume(a, request) != request)
  ------------------
  |  Branch (667:8): [True: 4, False: 36.2k]
  ------------------
  668|      4|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  669|  36.2k|			tar->entry_padding = 0;
  670|  36.2k|			*buff = NULL;
  671|  36.2k|			*size = 0;
  672|  36.2k|			*offset = tar->disk_size;
  673|  36.2k|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|  36.2k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  674|  36.2k|		}
  675|       |
  676|  1.24k|		*buff = __archive_read_ahead(a, 1, &bytes_read);
  677|  1.24k|		if (*buff == NULL) {
  ------------------
  |  Branch (677:7): [True: 11, False: 1.23k]
  ------------------
  678|     11|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     11|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  679|     11|			    "Truncated tar archive"
  680|     11|			    " detected while reading data");
  681|     11|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     11|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  682|     11|		}
  683|  1.23k|		if (bytes_read > tar->entry_bytes_remaining)
  ------------------
  |  Branch (683:7): [True: 1.20k, False: 25]
  ------------------
  684|  1.20k|			bytes_read = (ssize_t)tar->entry_bytes_remaining;
  685|       |		/* Don't read more than is available in the
  686|       |		 * current sparse block. */
  687|  1.23k|		if (tar->sparse_list->remaining < bytes_read)
  ------------------
  |  Branch (687:7): [True: 260, False: 974]
  ------------------
  688|    260|			bytes_read = (ssize_t)tar->sparse_list->remaining;
  689|  1.23k|		*size = bytes_read;
  690|  1.23k|		*offset = tar->sparse_list->offset;
  691|  1.23k|		tar->sparse_list->remaining -= bytes_read;
  692|  1.23k|		tar->sparse_list->offset += bytes_read;
  693|  1.23k|		tar->entry_bytes_remaining -= bytes_read;
  694|  1.23k|		tar->entry_bytes_unconsumed = bytes_read;
  695|       |
  696|  1.23k|		if (!tar->sparse_list->hole)
  ------------------
  |  Branch (696:7): [True: 1.23k, False: 0]
  ------------------
  697|  1.23k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.23k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  698|       |		/* Current is hole data and skip this. */
  699|  1.23k|	}
  700|  37.4k|}
archive_read_support_format_tar.c:archive_read_format_tar_skip:
  704|  21.2k|{
  705|  21.2k|	int64_t request;
  706|  21.2k|	struct tar* tar;
  707|       |
  708|  21.2k|	tar = (struct tar *)(a->format->data);
  709|       |
  710|  21.2k|	request = tar->entry_bytes_remaining + tar->entry_padding +
  711|  21.2k|	    tar->entry_bytes_unconsumed;
  712|       |
  713|  21.2k|	if (__archive_read_consume(a, request) != request)
  ------------------
  |  Branch (713:6): [True: 0, False: 21.2k]
  ------------------
  714|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  715|       |
  716|  21.2k|	tar->entry_bytes_remaining = 0;
  717|  21.2k|	tar->entry_bytes_unconsumed = 0;
  718|  21.2k|	tar->entry_padding = 0;
  719|       |
  720|       |	/* Free the sparse list. */
  721|  21.2k|	gnu_clear_sparse_list(tar);
  722|       |
  723|  21.2k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  21.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  724|  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.45k|{
  183|  2.45k|	const char *hdr;
  184|  2.45k|	ssize_t nrd;
  185|  2.45k|	unsigned int ver;
  186|       |
  187|  2.45k|	(void)best_bid; /* UNUSED */
  188|       |
  189|       |	/* check first line of file, it should be a record already */
  190|  2.45k|	if ((hdr = __archive_read_ahead(a, 12U, &nrd)) == NULL) {
  ------------------
  |  Branch (190:6): [True: 24, False: 2.43k]
  ------------------
  191|       |		/* no idea what to do */
  192|     24|		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.45k|{
  491|  2.45k|	const unsigned char *b;
  492|  2.45k|	int bid;
  493|       |
  494|  2.45k|	(void)best_bid; /* UNUSED */
  495|       |
  496|  2.45k|	b = __archive_read_ahead(a, HEADER_SIZE, NULL);
  ------------------
  |  |  105|  2.45k|#define HEADER_SIZE	28
  ------------------
  497|  2.45k|	if (b == NULL)
  ------------------
  |  Branch (497:6): [True: 24, False: 2.43k]
  ------------------
  498|     24|		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:
 3546|  2.49k|{
 3547|  2.49k|	int r;
 3548|  2.49k|	r = archive_read_support_format_zip_streamable(a);
 3549|  2.49k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3549:6): [True: 0, False: 2.49k]
  ------------------
 3550|      0|		return r;
 3551|  2.49k|	return (archive_read_support_format_zip_seekable(a));
 3552|  2.49k|}
archive_read_support_format_zip_streamable:
 3793|  2.49k|{
 3794|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
 3795|  2.49k|	struct zip *zip;
 3796|  2.49k|	int r;
 3797|       |
 3798|  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]
  |  |  ------------------
  ------------------
 3799|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_zip");
 3800|       |
 3801|  2.49k|	zip = calloc(1, sizeof(*zip));
 3802|  2.49k|	if (zip == NULL) {
  ------------------
  |  Branch (3802:6): [True: 0, False: 2.49k]
  ------------------
 3803|      0|		archive_set_error(&a->archive, ENOMEM,
 3804|      0|		    "Can't allocate zip data");
 3805|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3806|      0|	}
 3807|       |
 3808|       |	/* Streamable reader doesn't support mac extensions. */
 3809|  2.49k|	zip->process_mac_extensions = 0;
 3810|       |
 3811|       |	/*
 3812|       |	 * Until enough data has been read, we cannot tell about
 3813|       |	 * any encrypted entries yet.
 3814|       |	 */
 3815|  2.49k|	zip->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|  2.49k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 3816|  2.49k|	zip->crc32func = real_crc32;
 3817|       |
 3818|  2.49k|	r = __archive_read_register_format(a,
 3819|  2.49k|	    zip,
 3820|  2.49k|	    "zip",
 3821|  2.49k|	    archive_read_format_zip_streamable_bid,
 3822|  2.49k|	    archive_read_format_zip_options,
 3823|  2.49k|	    archive_read_format_zip_streamable_read_header,
 3824|  2.49k|	    archive_read_format_zip_read_data,
 3825|  2.49k|	    archive_read_format_zip_read_data_skip_streamable,
 3826|  2.49k|	    NULL,
 3827|  2.49k|	    archive_read_format_zip_cleanup,
 3828|  2.49k|	    archive_read_support_format_zip_capabilities_streamable,
 3829|  2.49k|	    archive_read_format_zip_has_encrypted_entries);
 3830|       |
 3831|  2.49k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3831:6): [True: 0, False: 2.49k]
  ------------------
 3832|      0|		free(zip);
 3833|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3834|  2.49k|}
archive_read_support_format_zip_seekable:
 4585|  2.49k|{
 4586|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
 4587|  2.49k|	struct zip *zip;
 4588|  2.49k|	int r;
 4589|       |
 4590|  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]
  |  |  ------------------
  ------------------
 4591|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_zip_seekable");
 4592|       |
 4593|  2.49k|	zip = calloc(1, sizeof(*zip));
 4594|  2.49k|	if (zip == NULL) {
  ------------------
  |  Branch (4594:6): [True: 0, False: 2.49k]
  ------------------
 4595|      0|		archive_set_error(&a->archive, ENOMEM,
 4596|      0|		    "Can't allocate zip data");
 4597|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4598|      0|	}
 4599|       |
 4600|       |#ifdef HAVE_COPYFILE_H
 4601|       |	/* Set this by default on Mac OS. */
 4602|       |	zip->process_mac_extensions = 1;
 4603|       |#endif
 4604|       |
 4605|       |	/*
 4606|       |	 * Until enough data has been read, we cannot tell about
 4607|       |	 * any encrypted entries yet.
 4608|       |	 */
 4609|  2.49k|	zip->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|  2.49k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4610|  2.49k|	zip->crc32func = real_crc32;
 4611|       |
 4612|  2.49k|	r = __archive_read_register_format(a,
 4613|  2.49k|	    zip,
 4614|  2.49k|	    "zip",
 4615|  2.49k|	    archive_read_format_zip_seekable_bid,
 4616|  2.49k|	    archive_read_format_zip_options,
 4617|  2.49k|	    archive_read_format_zip_seekable_read_header,
 4618|  2.49k|	    archive_read_format_zip_read_data,
 4619|  2.49k|	    archive_read_format_zip_read_data_skip_seekable,
 4620|  2.49k|	    NULL,
 4621|  2.49k|	    archive_read_format_zip_cleanup,
 4622|  2.49k|	    archive_read_support_format_zip_capabilities_seekable,
 4623|  2.49k|	    archive_read_format_zip_has_encrypted_entries);
 4624|       |
 4625|  2.49k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4625:6): [True: 0, False: 2.49k]
  ------------------
 4626|      0|		free(zip);
 4627|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4628|  2.49k|}
archive_read_support_format_zip.c:archive_read_format_zip_streamable_bid:
 3571|  2.45k|{
 3572|  2.45k|	const char *p;
 3573|       |
 3574|  2.45k|	(void)best_bid; /* UNUSED */
 3575|       |
 3576|  2.45k|	if ((p = __archive_read_ahead(a, 4, NULL)) == NULL)
  ------------------
  |  Branch (3576:6): [True: 35, False: 2.42k]
  ------------------
 3577|     35|		return (-1);
 3578|       |
 3579|       |	/*
 3580|       |	 * Bid of 29 here comes from:
 3581|       |	 *  + 16 bits for "PK",
 3582|       |	 *  + next 16-bit field has 6 options so contributes
 3583|       |	 *    about 16 - log_2(6) ~= 16 - 2.6 ~= 13 bits
 3584|       |	 *
 3585|       |	 * So we've effectively verified ~29 total bits of check data.
 3586|       |	 */
 3587|  2.42k|	if (p[0] == 'P' && p[1] == 'K') {
  ------------------
  |  Branch (3587:6): [True: 694, False: 1.72k]
  |  Branch (3587:21): [True: 692, False: 2]
  ------------------
 3588|    692|		if ((p[2] == '\001' && p[3] == '\002')
  ------------------
  |  Branch (3588:8): [True: 0, False: 692]
  |  Branch (3588:26): [True: 0, False: 0]
  ------------------
 3589|    692|		    || (p[2] == '\003' && p[3] == '\004')
  ------------------
  |  Branch (3589:11): [True: 638, False: 54]
  |  Branch (3589:29): [True: 638, False: 0]
  ------------------
 3590|     54|		    || (p[2] == '\005' && p[3] == '\006')
  ------------------
  |  Branch (3590:11): [True: 0, False: 54]
  |  Branch (3590:29): [True: 0, False: 0]
  ------------------
 3591|     54|		    || (p[2] == '\006' && p[3] == '\006')
  ------------------
  |  Branch (3591:11): [True: 0, False: 54]
  |  Branch (3591:29): [True: 0, False: 0]
  ------------------
 3592|     54|		    || (p[2] == '\007' && p[3] == '\010')
  ------------------
  |  Branch (3592:11): [True: 51, False: 3]
  |  Branch (3592:29): [True: 51, False: 0]
  ------------------
 3593|      3|		    || (p[2] == '0' && p[3] == '0'))
  ------------------
  |  Branch (3593:11): [True: 2, False: 1]
  |  Branch (3593:26): [True: 2, False: 0]
  ------------------
 3594|    691|			return (29);
 3595|    692|	}
 3596|       |
 3597|       |	/* TODO: It's worth looking ahead a little bit for a valid
 3598|       |	 * PK signature.  In particular, that would make it possible
 3599|       |	 * to read some UUEncoded SFX files or SFX files coming from
 3600|       |	 * a network socket. */
 3601|       |
 3602|  1.73k|	return (0);
 3603|  2.42k|}
archive_read_support_format_zip.c:archive_read_format_zip_options:
 3498|  4.99k|{
 3499|  4.99k|	struct zip *zip;
 3500|  4.99k|	int ret = ARCHIVE_FAILED;
  ------------------
  |  |  237|  4.99k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3501|       |
 3502|  4.99k|	zip = (struct zip *)(a->format->data);
 3503|  4.99k|	if (strcmp(key, "compat-2x")  == 0) {
  ------------------
  |  Branch (3503:6): [True: 0, False: 4.99k]
  ------------------
 3504|       |		/* Handle filenames as libarchive 2.x */
 3505|      0|		zip->init_default_conversion = (val != NULL) ? 1 : 0;
  ------------------
  |  Branch (3505:34): [True: 0, False: 0]
  ------------------
 3506|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3507|  4.99k|	} else if (strcmp(key, "hdrcharset")  == 0) {
  ------------------
  |  Branch (3507:13): [True: 0, False: 4.99k]
  ------------------
 3508|      0|		if (val == NULL || val[0] == 0)
  ------------------
  |  Branch (3508:7): [True: 0, False: 0]
  |  Branch (3508:22): [True: 0, False: 0]
  ------------------
 3509|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3510|      0|			    "zip: hdrcharset option needs a character-set name"
 3511|      0|			);
 3512|      0|		else {
 3513|      0|			zip->sconv = archive_string_conversion_from_charset(
 3514|      0|			    &a->archive, val, 0);
 3515|      0|			if (zip->sconv != NULL) {
  ------------------
  |  Branch (3515:8): [True: 0, False: 0]
  ------------------
 3516|      0|				if (strcmp(val, "UTF-8") == 0)
  ------------------
  |  Branch (3516:9): [True: 0, False: 0]
  ------------------
 3517|      0|					zip->sconv_utf8 = zip->sconv;
 3518|      0|				ret = ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3519|      0|			} else
 3520|      0|				ret = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3521|      0|		}
 3522|      0|		return (ret);
 3523|  4.99k|	} else if (strcmp(key, "ignorecrc32") == 0) {
  ------------------
  |  Branch (3523:13): [True: 4.99k, False: 0]
  ------------------
 3524|       |		/* Mostly useful for testing. */
 3525|  4.99k|		if (val == NULL || val[0] == 0) {
  ------------------
  |  Branch (3525:7): [True: 0, False: 4.99k]
  |  Branch (3525:22): [True: 0, False: 4.99k]
  ------------------
 3526|      0|			zip->crc32func = real_crc32;
 3527|      0|			zip->ignore_crc32 = 0;
 3528|  4.99k|		} else {
 3529|  4.99k|			zip->crc32func = fake_crc32;
 3530|  4.99k|			zip->ignore_crc32 = 1;
 3531|  4.99k|		}
 3532|  4.99k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.99k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3533|  4.99k|	} else if (strcmp(key, "mac-ext") == 0) {
  ------------------
  |  Branch (3533:13): [True: 0, False: 0]
  ------------------
 3534|      0|		zip->process_mac_extensions = (val != NULL && val[0] != 0);
  ------------------
  |  Branch (3534:34): [True: 0, False: 0]
  |  Branch (3534:49): [True: 0, False: 0]
  ------------------
 3535|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3536|      0|	}
 3537|       |
 3538|       |	/* Note: The "warn" return is just to inform the options
 3539|       |	 * supervisor that we didn't handle it.  It will generate
 3540|       |	 * a suitable error if no one used this option. */
 3541|      0|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 3542|  4.99k|}
archive_read_support_format_zip.c:fake_crc32:
  582|  51.3k|{
  583|  51.3k|	(void)crc; /* UNUSED */
  584|  51.3k|	(void)buff; /* UNUSED */
  585|  51.3k|	(void)len; /* UNUSED */
  586|  51.3k|	return 0;
  587|  51.3k|}
archive_read_support_format_zip.c:archive_read_format_zip_streamable_read_header:
 3608|  35.5k|{
 3609|  35.5k|	struct zip *zip;
 3610|       |
 3611|  35.5k|	a->archive.archive_format = ARCHIVE_FORMAT_ZIP;
  ------------------
  |  |  374|  35.5k|#define	ARCHIVE_FORMAT_ZIP			0x50000
  ------------------
 3612|  35.5k|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (3612:6): [True: 662, False: 34.8k]
  ------------------
 3613|    662|		a->archive.archive_format_name = "ZIP";
 3614|       |
 3615|  35.5k|	zip = (struct zip *)(a->format->data);
 3616|       |
 3617|       |	/*
 3618|       |	 * It should be sufficient to call archive_read_next_header() for
 3619|       |	 * a reader to determine if an entry is encrypted or not. If the
 3620|       |	 * encryption of an entry is only detectable when calling
 3621|       |	 * archive_read_data(), so be it. We'll do the same check there
 3622|       |	 * as well.
 3623|       |	 */
 3624|  35.5k|	if (zip->has_encrypted_entries ==
  ------------------
  |  Branch (3624:6): [True: 662, False: 34.8k]
  ------------------
 3625|  35.5k|			ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW)
  ------------------
  |  |  411|  35.5k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 3626|    662|		zip->has_encrypted_entries = 0;
 3627|       |
 3628|       |	/* Make sure we have a zip_entry structure to use. */
 3629|  35.5k|	if (zip->zip_entries == NULL) {
  ------------------
  |  Branch (3629:6): [True: 662, False: 34.8k]
  ------------------
 3630|    662|		zip->zip_entries = malloc(sizeof(struct zip_entry));
 3631|    662|		if (zip->zip_entries == NULL) {
  ------------------
  |  Branch (3631:7): [True: 0, False: 662]
  ------------------
 3632|      0|			archive_set_error(&a->archive, ENOMEM,
 3633|      0|			    "Out  of memory");
 3634|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3635|      0|		}
 3636|    662|	}
 3637|  35.5k|	zip->entry = zip->zip_entries;
 3638|  35.5k|	memset(zip->entry, 0, sizeof(struct zip_entry));
 3639|       |
 3640|  35.5k|	if (zip->cctx_valid)
  ------------------
  |  Branch (3640:6): [True: 2.96k, False: 32.5k]
  ------------------
 3641|  2.96k|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  166|  2.96k|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 3642|  35.5k|	if (zip->hctx_valid)
  ------------------
  |  Branch (3642:6): [True: 2.96k, False: 32.5k]
  ------------------
 3643|  2.96k|		archive_hmac_sha1_cleanup(&zip->hctx);
  ------------------
  |  |  105|  2.96k|	__archive_hmac.__hmac_sha1_cleanup(ctx)
  ------------------
 3644|  35.5k|	zip->tctx_valid = zip->cctx_valid = zip->hctx_valid = 0;
 3645|  35.5k|	__archive_read_reset_passphrase(a);
 3646|       |
 3647|       |	/* Search ahead for the next local file header. */
 3648|  35.5k|	__archive_read_consume(a, zip->unconsumed);
 3649|  35.5k|	zip->unconsumed = 0;
 3650|  36.1k|	for (;;) {
 3651|  36.1k|		int64_t skipped = 0;
 3652|  36.1k|		const char *p, *end;
 3653|  36.1k|		ssize_t bytes;
 3654|       |
 3655|  36.1k|		p = __archive_read_ahead(a, 4, &bytes);
 3656|  36.1k|		if (p == NULL)
  ------------------
  |  Branch (3656:7): [True: 243, False: 35.8k]
  ------------------
 3657|    243|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    243|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3658|  35.8k|		end = p + bytes;
 3659|       |
 3660|  19.3M|		while (p + 4 <= end) {
  ------------------
  |  Branch (3660:10): [True: 19.3M, False: 589]
  ------------------
 3661|  19.3M|			if (p[0] == 'P' && p[1] == 'K') {
  ------------------
  |  Branch (3661:8): [True: 86.0k, False: 19.2M]
  |  Branch (3661:23): [True: 47.0k, False: 38.9k]
  ------------------
 3662|  47.0k|				if (p[2] == '\003' && p[3] == '\004') {
  ------------------
  |  Branch (3662:9): [True: 35.5k, False: 11.4k]
  |  Branch (3662:27): [True: 35.2k, False: 287]
  ------------------
 3663|       |					/* Regular file entry. */
 3664|  35.2k|					__archive_read_consume(a, skipped);
 3665|  35.2k|					return zip_read_local_file_header(a,
 3666|  35.2k|					    entry, zip);
 3667|  35.2k|				}
 3668|       |
 3669|       |                              /*
 3670|       |                               * TODO: We cannot restore permissions
 3671|       |                               * based only on the local file headers.
 3672|       |                               * Consider scanning the central
 3673|       |                               * directory and returning additional
 3674|       |                               * entries for at least directories.
 3675|       |                               * This would allow us to properly set
 3676|       |                               * directory permissions.
 3677|       |			       *
 3678|       |			       * This won't help us fix symlinks
 3679|       |			       * and may not help with regular file
 3680|       |			       * permissions, either.  <sigh>
 3681|       |                               */
 3682|  11.7k|                              if (p[2] == '\001' && p[3] == '\002') {
  ------------------
  |  Branch (3682:35): [True: 532, False: 11.2k]
  |  Branch (3682:53): [True: 0, False: 532]
  ------------------
 3683|      0|                                      return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3684|      0|                              }
 3685|       |
 3686|       |                              /* End of central directory?  Must be an
 3687|       |                               * empty archive. */
 3688|  11.7k|                              if ((p[2] == '\005' && p[3] == '\006')
  ------------------
  |  Branch (3688:36): [True: 10, False: 11.7k]
  |  Branch (3688:54): [True: 7, False: 3]
  ------------------
 3689|  11.7k|                                  || (p[2] == '\006' && p[3] == '\006'))
  ------------------
  |  Branch (3689:39): [True: 498, False: 11.2k]
  |  Branch (3689:57): [True: 0, False: 498]
  ------------------
 3690|      7|                                      return (ARCHIVE_EOF);
  ------------------
  |  |  232|      7|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3691|  11.7k|			}
 3692|  19.3M|			++p;
 3693|  19.3M|			++skipped;
 3694|  19.3M|		}
 3695|    589|		__archive_read_consume(a, skipped);
 3696|    589|	}
 3697|  35.5k|}
archive_read_support_format_zip.c:zip_read_local_file_header:
 1076|  35.5k|{
 1077|  35.5k|	const char *p;
 1078|  35.5k|	const void *h;
 1079|  35.5k|	const wchar_t *wp;
 1080|  35.5k|	const char *cp;
 1081|  35.5k|	size_t len, filename_length, extra_length;
 1082|  35.5k|	struct archive_string_conv *sconv;
 1083|  35.5k|	struct zip_entry *zip_entry = zip->entry;
 1084|  35.5k|	struct zip_entry zip_entry_central_dir;
 1085|  35.5k|	int ret = ARCHIVE_OK;
  ------------------
  |  |  233|  35.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1086|  35.5k|	char version;
 1087|       |
 1088|       |	/* Save a copy of the original for consistency checks. */
 1089|  35.5k|	zip_entry_central_dir = *zip_entry;
 1090|       |
 1091|  35.5k|	zip->decompress_init = 0;
 1092|  35.5k|	zip->end_of_entry = 0;
 1093|  35.5k|	zip->entry_uncompressed_bytes_read = 0;
 1094|  35.5k|	zip->entry_compressed_bytes_read = 0;
 1095|  35.5k|	zip->computed_crc32 = zip->crc32func(0, NULL, 0);
 1096|       |
 1097|       |	/* Setup default conversion. */
 1098|  35.5k|	if (zip->sconv == NULL && !zip->init_default_conversion) {
  ------------------
  |  Branch (1098:6): [True: 35.5k, False: 0]
  |  Branch (1098:28): [True: 682, False: 34.8k]
  ------------------
 1099|    682|		zip->sconv_default =
 1100|    682|		    archive_string_default_conversion_for_read(&(a->archive));
 1101|    682|		zip->init_default_conversion = 1;
 1102|    682|	}
 1103|       |
 1104|  35.5k|	if ((p = __archive_read_ahead(a, ZIP_LOCHDR_LEN, NULL)) == NULL) {
  ------------------
  |  |   82|  35.5k|#define ZIP_LOCHDR_LEN		30U
  ------------------
  |  Branch (1104:6): [True: 26, False: 35.4k]
  ------------------
 1105|     26|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     26|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1106|     26|		    "Truncated ZIP file header");
 1107|     26|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     26|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1108|     26|	}
 1109|       |
 1110|  35.4k|	if (memcmp(p, "PK\003\004", 4) != 0) {
  ------------------
  |  Branch (1110:6): [True: 10, False: 35.4k]
  ------------------
 1111|     10|		archive_set_error(&a->archive, -1, "Damaged Zip archive");
 1112|     10|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     10|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1113|     10|	}
 1114|  35.4k|	version = p[4];
 1115|  35.4k|	zip_entry->system = p[5];
 1116|  35.4k|	zip_entry->zip_flags = archive_le16dec(p + 6);
 1117|  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 (1117:6): [True: 11.6k, False: 23.8k]
  ------------------
 1118|  11.6k|		zip->has_encrypted_entries = 1;
 1119|  11.6k|		archive_entry_set_is_data_encrypted(entry, 1);
 1120|  11.6k|		if (zip_entry->zip_flags & ZIP_CENTRAL_DIRECTORY_ENCRYPTED &&
  ------------------
  |  |  133|  23.3k|#define ZIP_CENTRAL_DIRECTORY_ENCRYPTED	(1 << 13)
  ------------------
  |  Branch (1120:7): [True: 5.01k, False: 6.65k]
  ------------------
 1121|  5.01k|			zip_entry->zip_flags & ZIP_ENCRYPTED &&
  ------------------
  |  |  127|  16.6k|#define ZIP_ENCRYPTED	(1 << 0)
  ------------------
  |  Branch (1121:4): [True: 1.56k, False: 3.44k]
  ------------------
 1122|  1.56k|			zip_entry->zip_flags & ZIP_STRONG_ENCRYPTED) {
  ------------------
  |  |  129|  1.56k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
  |  Branch (1122:4): [True: 4, False: 1.56k]
  ------------------
 1123|      4|			archive_entry_set_is_metadata_encrypted(entry, 1);
 1124|      4|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1125|      4|		}
 1126|  11.6k|	}
 1127|  35.4k|	zip->init_decryption = (zip_entry->zip_flags & ZIP_ENCRYPTED);
  ------------------
  |  |  127|  35.4k|#define ZIP_ENCRYPTED	(1 << 0)
  ------------------
 1128|  35.4k|	zip_entry->compression = (char)archive_le16dec(p + 8);
 1129|  35.4k|	zip_entry->mtime = dos_to_unix(archive_le32dec(p + 10));
 1130|  35.4k|	zip_entry->crc32 = archive_le32dec(p + 14);
 1131|  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 (1131:6): [True: 20.6k, False: 14.8k]
  ------------------
 1132|  20.6k|		zip_entry->decdat = p[11];
 1133|  14.8k|	else
 1134|  14.8k|		zip_entry->decdat = p[17];
 1135|  35.4k|	zip_entry->compressed_size = archive_le32dec(p + 18);
 1136|  35.4k|	zip_entry->uncompressed_size = archive_le32dec(p + 22);
 1137|  35.4k|	filename_length = archive_le16dec(p + 26);
 1138|  35.4k|	extra_length = archive_le16dec(p + 28);
 1139|       |
 1140|  35.4k|	__archive_read_consume(a, ZIP_LOCHDR_LEN);
  ------------------
  |  |   82|  35.4k|#define ZIP_LOCHDR_LEN		30U
  ------------------
 1141|       |
 1142|       |	/* Read the filename. */
 1143|  35.4k|	if ((h = __archive_read_ahead(a, filename_length, NULL)) == NULL) {
  ------------------
  |  Branch (1143:6): [True: 39, False: 35.4k]
  ------------------
 1144|     39|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     39|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1145|     39|		    "Truncated ZIP file header");
 1146|     39|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     39|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1147|     39|	}
 1148|  35.4k|	if (zip_entry->zip_flags & ZIP_UTF8_NAME) {
  ------------------
  |  |  130|  35.4k|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (1148:6): [True: 10.3k, False: 25.0k]
  ------------------
 1149|       |		/* The filename is stored to be UTF-8. */
 1150|  10.3k|		if (zip->sconv_utf8 == NULL) {
  ------------------
  |  Branch (1150:7): [True: 213, False: 10.1k]
  ------------------
 1151|    213|			zip->sconv_utf8 =
 1152|    213|			    archive_string_conversion_from_charset(
 1153|    213|				&a->archive, "UTF-8", 1);
 1154|    213|			if (zip->sconv_utf8 == NULL)
  ------------------
  |  Branch (1154:8): [True: 0, False: 213]
  ------------------
 1155|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1156|    213|		}
 1157|  10.3k|		sconv = zip->sconv_utf8;
 1158|  25.0k|	} else if (zip->sconv != NULL)
  ------------------
  |  Branch (1158:13): [True: 0, False: 25.0k]
  ------------------
 1159|      0|		sconv = zip->sconv;
 1160|  25.0k|	else
 1161|  25.0k|		sconv = zip->sconv_default;
 1162|       |
 1163|  35.4k|	if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|  35.4k|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (1163:6): [True: 1.20k, False: 34.2k]
  ------------------
 1164|  35.4k|	    h, filename_length, sconv) != 0) {
 1165|  1.20k|		if (errno == ENOMEM) {
  ------------------
  |  Branch (1165:7): [True: 0, False: 1.20k]
  ------------------
 1166|      0|			archive_set_error(&a->archive, ENOMEM,
 1167|      0|			    "Can't allocate memory for Pathname");
 1168|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1169|      0|		}
 1170|  1.20k|		archive_set_error(&a->archive,
 1171|  1.20k|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.20k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1172|  1.20k|		    "Pathname cannot be converted "
 1173|  1.20k|		    "from %s to current locale",
 1174|  1.20k|		    archive_string_conversion_charset_name(sconv));
 1175|  1.20k|		ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  1.20k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1176|  1.20k|	}
 1177|  35.4k|	__archive_read_consume(a, filename_length);
 1178|       |
 1179|       |	/* Read the extra data. */
 1180|  35.4k|	if ((h = __archive_read_ahead(a, extra_length, NULL)) == NULL) {
  ------------------
  |  Branch (1180:6): [True: 23, False: 35.4k]
  ------------------
 1181|     23|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     23|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1182|     23|		    "Truncated ZIP file header");
 1183|     23|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     23|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1184|     23|	}
 1185|       |
 1186|  35.4k|	if (ARCHIVE_OK != process_extra(a, entry, h, extra_length,
  ------------------
  |  |  233|  35.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1186:6): [True: 45, False: 35.3k]
  ------------------
 1187|  35.4k|	    zip_entry)) {
 1188|     45|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     45|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1189|     45|	}
 1190|  35.3k|	__archive_read_consume(a, extra_length);
 1191|       |
 1192|       |	/* Work around a bug in Info-Zip: When reading from a pipe, it
 1193|       |	 * stats the pipe instead of synthesizing a file entry. */
 1194|  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 (1194:6): [True: 843, False: 34.5k]
  ------------------
 1195|    843|		zip_entry->mode &= ~ AE_IFMT;
  ------------------
  |  |  215|    843|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1196|    843|		zip_entry->mode |= AE_IFREG;
  ------------------
  |  |  216|    843|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1197|    843|	}
 1198|       |
 1199|       |	/* If the mode is totally empty, set some sane default. */
 1200|  35.3k|	if (zip_entry->mode == 0) {
  ------------------
  |  Branch (1200:6): [True: 31.2k, False: 4.15k]
  ------------------
 1201|  31.2k|		zip_entry->mode |= 0664;
 1202|  31.2k|	}
 1203|       |
 1204|       |	/* Windows archivers sometimes use backslash as the directory
 1205|       |	 * separator. Normalize to slash. */
 1206|  35.3k|	if (zip_entry->system == 0 &&
  ------------------
  |  Branch (1206:6): [True: 16.8k, False: 18.4k]
  ------------------
 1207|  16.8k|	    (wp = archive_entry_pathname_w(entry)) != NULL) {
  ------------------
  |  Branch (1207:6): [True: 10.8k, False: 6.05k]
  ------------------
 1208|  10.8k|		if (wcschr(wp, L'/') == NULL && wcschr(wp, L'\\') != NULL) {
  ------------------
  |  Branch (1208:7): [True: 10.2k, False: 548]
  |  Branch (1208:35): [True: 497, False: 9.77k]
  ------------------
 1209|    497|			size_t i;
 1210|    497|			struct archive_wstring s;
 1211|    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]
  |  |  ------------------
  ------------------
 1212|    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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1213|  13.6k|			for (i = 0; i < archive_strlen(&s); i++) {
  ------------------
  |  |  178|  13.6k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1213:16): [True: 13.1k, False: 497]
  ------------------
 1214|  13.1k|				if (s.s[i] == '\\')
  ------------------
  |  Branch (1214:9): [True: 3.03k, False: 10.1k]
  ------------------
 1215|  3.03k|					s.s[i] = '/';
 1216|  13.1k|			}
 1217|    497|			archive_entry_copy_pathname_w(entry, s.s);
 1218|    497|			archive_wstring_free(&s);
 1219|    497|		}
 1220|  10.8k|	}
 1221|       |
 1222|       |	/* Make sure that entries with a trailing '/' are marked as directories
 1223|       |	 * even if the External File Attributes contains bogus values.  If this
 1224|       |	 * is not a directory and there is no type, assume a regular file. */
 1225|  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 (1225:6): [True: 34.1k, False: 1.22k]
  ------------------
 1226|  34.1k|		int has_slash;
 1227|       |
 1228|  34.1k|		wp = archive_entry_pathname_w(entry);
 1229|  34.1k|		if (wp != NULL) {
  ------------------
  |  Branch (1229:7): [True: 25.1k, False: 8.94k]
  ------------------
 1230|  25.1k|			len = wcslen(wp);
 1231|  25.1k|			has_slash = len > 0 && wp[len - 1] == L'/';
  ------------------
  |  Branch (1231:16): [True: 3.74k, False: 21.4k]
  |  Branch (1231:27): [True: 270, False: 3.47k]
  ------------------
 1232|  25.1k|		} else {
 1233|  8.94k|			cp = archive_entry_pathname(entry);
 1234|  8.94k|			len = (cp != NULL)?strlen(cp):0;
  ------------------
  |  Branch (1234:10): [True: 8.04k, False: 900]
  ------------------
 1235|  8.94k|			has_slash = len > 0 && cp[len - 1] == '/';
  ------------------
  |  Branch (1235:16): [True: 8.04k, False: 900]
  |  Branch (1235:27): [True: 261, False: 7.78k]
  ------------------
 1236|  8.94k|		}
 1237|       |		/* Correct file type as needed. */
 1238|  34.1k|		if (has_slash) {
  ------------------
  |  Branch (1238:7): [True: 531, False: 33.6k]
  ------------------
 1239|    531|			zip_entry->mode &= ~AE_IFMT;
  ------------------
  |  |  215|    531|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1240|    531|			zip_entry->mode |= AE_IFDIR;
  ------------------
  |  |  221|    531|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1241|    531|			zip_entry->mode |= 0111;
 1242|  33.6k|		} else if ((zip_entry->mode & AE_IFMT) == 0) {
  ------------------
  |  |  215|  33.6k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  |  Branch (1242:14): [True: 31.0k, False: 2.56k]
  ------------------
 1243|  31.0k|			zip_entry->mode |= AE_IFREG;
  ------------------
  |  |  216|  31.0k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1244|  31.0k|		}
 1245|  34.1k|	}
 1246|       |
 1247|       |	/* Make sure directories end in '/' */
 1248|  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 (1248:6): [True: 1.75k, False: 33.6k]
  ------------------
 1249|  1.75k|		wp = archive_entry_pathname_w(entry);
 1250|  1.75k|		if (wp != NULL) {
  ------------------
  |  Branch (1250:7): [True: 1.14k, False: 610]
  ------------------
 1251|  1.14k|			len = wcslen(wp);
 1252|  1.14k|			if (len > 0 && wp[len - 1] != L'/') {
  ------------------
  |  Branch (1252:8): [True: 478, False: 669]
  |  Branch (1252:19): [True: 104, False: 374]
  ------------------
 1253|    104|				struct archive_wstring s;
 1254|    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]
  |  |  ------------------
  ------------------
 1255|    104|				archive_wstrcat(&s, wp);
 1256|    104|				archive_wstrappend_wchar(&s, L'/');
 1257|    104|				archive_entry_copy_pathname_w(entry, s.s);
 1258|    104|				archive_wstring_free(&s);
 1259|    104|			}
 1260|  1.14k|		} else {
 1261|    610|			cp = archive_entry_pathname(entry);
 1262|    610|			len = (cp != NULL)?strlen(cp):0;
  ------------------
  |  Branch (1262:10): [True: 305, False: 305]
  ------------------
 1263|    610|			if (len > 0 && cp[len - 1] != '/') {
  ------------------
  |  Branch (1263:8): [True: 305, False: 305]
  |  Branch (1263:19): [True: 44, False: 261]
  ------------------
 1264|     44|				struct archive_string s;
 1265|     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]
  |  |  ------------------
  ------------------
 1266|     44|				archive_strcat(&s, cp);
 1267|     44|				archive_strappend_char(&s, '/');
 1268|     44|				archive_entry_set_pathname(entry, s.s);
 1269|     44|				archive_string_free(&s);
 1270|     44|			}
 1271|    610|		}
 1272|  1.75k|	}
 1273|       |
 1274|  35.3k|	if (zip_entry->flags & LA_FROM_CENTRAL_DIRECTORY) {
  ------------------
  |  |  137|  35.3k|#define LA_FROM_CENTRAL_DIRECTORY (1 << 1)
  ------------------
  |  Branch (1274:6): [True: 212, False: 35.1k]
  ------------------
 1275|       |		/* If this came from the central dir, its size info
 1276|       |		 * is definitive, so ignore the length-at-end flag. */
 1277|    212|		zip_entry->zip_flags &= ~ZIP_LENGTH_AT_END;
  ------------------
  |  |  128|    212|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
 1278|       |		/* If local header is missing a value, use the one from
 1279|       |		   the central directory.  If both have it, warn about
 1280|       |		   mismatches. */
 1281|    212|		if (zip_entry->crc32 == 0) {
  ------------------
  |  Branch (1281:7): [True: 57, False: 155]
  ------------------
 1282|     57|			zip_entry->crc32 = zip_entry_central_dir.crc32;
 1283|    155|		} else if (!zip->ignore_crc32
  ------------------
  |  Branch (1283:14): [True: 0, False: 155]
  ------------------
 1284|      0|		    && zip_entry->crc32 != zip_entry_central_dir.crc32) {
  ------------------
  |  Branch (1284:10): [True: 0, False: 0]
  ------------------
 1285|      0|			archive_set_error(&a->archive,
 1286|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1287|      0|			    "Inconsistent CRC32 values");
 1288|      0|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1289|      0|		}
 1290|    212|		if (zip_entry->compressed_size == 0
  ------------------
  |  Branch (1290:7): [True: 51, False: 161]
  ------------------
 1291|    161|		    || zip_entry->compressed_size == 0xffffffff) {
  ------------------
  |  Branch (1291:10): [True: 11, False: 150]
  ------------------
 1292|     62|			zip_entry->compressed_size
 1293|     62|			    = zip_entry_central_dir.compressed_size;
 1294|    150|		} else if (zip_entry->compressed_size
  ------------------
  |  Branch (1294:14): [True: 26, False: 124]
  ------------------
 1295|    150|		    != zip_entry_central_dir.compressed_size) {
 1296|     26|			archive_set_error(&a->archive,
 1297|     26|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     26|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1298|     26|			    "Inconsistent compressed size: "
 1299|     26|			    "%jd in central directory, %jd in local header",
 1300|     26|			    (intmax_t)zip_entry_central_dir.compressed_size,
 1301|     26|			    (intmax_t)zip_entry->compressed_size);
 1302|     26|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     26|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1303|     26|		}
 1304|    212|		if (zip_entry->uncompressed_size == 0 ||
  ------------------
  |  Branch (1304:7): [True: 50, False: 162]
  ------------------
 1305|    162|			zip_entry->uncompressed_size == 0xffffffff) {
  ------------------
  |  Branch (1305:4): [True: 0, False: 162]
  ------------------
 1306|     50|			zip_entry->uncompressed_size
 1307|     50|			    = zip_entry_central_dir.uncompressed_size;
 1308|    162|		} else if (zip_entry->uncompressed_size
  ------------------
  |  Branch (1308:14): [True: 16, False: 146]
  ------------------
 1309|    162|		    != zip_entry_central_dir.uncompressed_size) {
 1310|     16|			archive_set_error(&a->archive,
 1311|     16|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     16|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1312|     16|			    "Inconsistent uncompressed size: "
 1313|     16|			    "%jd in central directory, %jd in local header",
 1314|     16|			    (intmax_t)zip_entry_central_dir.uncompressed_size,
 1315|     16|			    (intmax_t)zip_entry->uncompressed_size);
 1316|     16|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     16|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1317|     16|		}
 1318|    212|	}
 1319|       |
 1320|       |	/* Populate some additional entry fields: */
 1321|  35.3k|	archive_entry_set_mode(entry, zip_entry->mode);
 1322|  35.3k|	archive_entry_set_uid(entry, zip_entry->uid);
 1323|  35.3k|	archive_entry_set_gid(entry, zip_entry->gid);
 1324|  35.3k|	archive_entry_set_mtime(entry, zip_entry->mtime, 0);
 1325|  35.3k|	archive_entry_set_ctime(entry, zip_entry->ctime, 0);
 1326|  35.3k|	archive_entry_set_atime(entry, zip_entry->atime, 0);
 1327|       |
 1328|  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 (1328:6): [True: 1.44k, False: 33.9k]
  ------------------
 1329|  1.44k|		size_t linkname_length;
 1330|       |
 1331|  1.44k|		if (zip_entry->compressed_size > 64 * 1024) {
  ------------------
  |  Branch (1331:7): [True: 0, False: 1.44k]
  ------------------
 1332|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1333|      0|			    "Zip file with oversized link entry");
 1334|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1335|      0|		}
 1336|       |
 1337|  1.44k|		linkname_length = (size_t)zip_entry->compressed_size;
 1338|       |
 1339|  1.44k|		archive_entry_set_size(entry, 0);
 1340|       |
 1341|       |		// take into account link compression if any
 1342|  1.44k|		size_t linkname_full_length = linkname_length;
 1343|  1.44k|		if (zip->entry->compression != 0)
  ------------------
  |  Branch (1343:7): [True: 0, False: 1.44k]
  ------------------
 1344|      0|		{
 1345|       |			// symlink target string appeared to be compressed
 1346|      0|			int status = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1347|      0|			const void *uncompressed_buffer = NULL;
 1348|       |
 1349|      0|			switch (zip->entry->compression)
 1350|      0|			{
 1351|      0|#if HAVE_ZLIB_H
 1352|      0|				case 8: /* Deflate compression. */
  ------------------
  |  Branch (1352:5): [True: 0, False: 0]
  ------------------
 1353|      0|					zip->entry_bytes_remaining = zip_entry->compressed_size;
 1354|      0|					status = zip_read_data_deflate(a, &uncompressed_buffer,
 1355|      0|						&linkname_full_length, NULL);
 1356|      0|					break;
 1357|      0|#endif
 1358|      0|#if HAVE_LZMA_H && HAVE_LIBLZMA
 1359|      0|				case 14: /* ZIPx LZMA compression. */
  ------------------
  |  Branch (1359:5): [True: 0, False: 0]
  ------------------
 1360|       |					/*(see zip file format specification, section 4.4.5)*/
 1361|      0|					zip->entry_bytes_remaining = zip_entry->compressed_size;
 1362|      0|					status = zip_read_data_zipx_lzma_alone(a, &uncompressed_buffer,
 1363|      0|						&linkname_full_length, NULL);
 1364|      0|					break;
 1365|      0|#endif
 1366|      0|				default: /* Unsupported compression. */
  ------------------
  |  Branch (1366:5): [True: 0, False: 0]
  ------------------
 1367|      0|					break;
 1368|      0|			}
 1369|      0|			if (status == ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1369:8): [True: 0, False: 0]
  ------------------
 1370|      0|			{
 1371|      0|				p = uncompressed_buffer;
 1372|      0|			}
 1373|      0|			else
 1374|      0|			{
 1375|      0|				archive_set_error(&a->archive,
 1376|      0|					ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1377|      0|					"Unsupported ZIP compression method "
 1378|      0|					"during decompression of link entry (%d: %s)",
 1379|      0|					zip->entry->compression,
 1380|      0|					compression_name(zip->entry->compression));
 1381|      0|				return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1382|      0|			}
 1383|      0|		}
 1384|  1.44k|		else
 1385|  1.44k|		{
 1386|  1.44k|			p = __archive_read_ahead(a, linkname_length, NULL);
 1387|  1.44k|		}
 1388|       |
 1389|  1.44k|		if (p == NULL) {
  ------------------
  |  Branch (1389:7): [True: 0, False: 1.44k]
  ------------------
 1390|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1391|      0|			    "Truncated Zip file");
 1392|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1393|      0|		}
 1394|       |
 1395|  1.44k|		sconv = zip->sconv;
 1396|  1.44k|		if (sconv == NULL && (zip->entry->zip_flags & ZIP_UTF8_NAME))
  ------------------
  |  |  130|  1.44k|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (1396:7): [True: 1.44k, False: 0]
  |  Branch (1396:24): [True: 599, False: 841]
  ------------------
 1397|    599|			sconv = zip->sconv_utf8;
 1398|  1.44k|		if (sconv == NULL)
  ------------------
  |  Branch (1398:7): [True: 841, False: 599]
  ------------------
 1399|    841|			sconv = zip->sconv_default;
 1400|  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 (1400:7): [True: 461, False: 979]
  ------------------
 1401|  1.44k|		    sconv) != 0) {
 1402|    461|			if (errno != ENOMEM && sconv == zip->sconv_utf8 &&
  ------------------
  |  Branch (1402:8): [True: 461, False: 0]
  |  Branch (1402:27): [True: 461, False: 0]
  ------------------
 1403|    461|			    (zip->entry->zip_flags & ZIP_UTF8_NAME))
  ------------------
  |  |  130|    461|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (1403:8): [True: 461, False: 0]
  ------------------
 1404|    461|			    archive_entry_copy_symlink_l(entry, p,
  ------------------
  |  |   83|    461|#define archive_entry_copy_symlink_l	_archive_entry_copy_symlink_l
  ------------------
 1405|    461|				linkname_full_length, NULL);
 1406|    461|			if (errno == ENOMEM) {
  ------------------
  |  Branch (1406:8): [True: 0, False: 461]
  ------------------
 1407|      0|				archive_set_error(&a->archive, ENOMEM,
 1408|      0|				    "Can't allocate memory for Symlink");
 1409|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1410|      0|			}
 1411|       |			/*
 1412|       |			 * Since there is no character-set regulation for
 1413|       |			 * symlink name, do not report the conversion error
 1414|       |			 * in an automatic conversion.
 1415|       |			 */
 1416|    461|			if (sconv != zip->sconv_utf8 ||
  ------------------
  |  Branch (1416:8): [True: 0, False: 461]
  ------------------
 1417|    461|			    (zip->entry->zip_flags & ZIP_UTF8_NAME) == 0) {
  ------------------
  |  |  130|    461|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (1417:8): [True: 0, False: 461]
  ------------------
 1418|      0|				archive_set_error(&a->archive,
 1419|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1420|      0|				    "Symlink cannot be converted "
 1421|      0|				    "from %s to current locale",
 1422|      0|				    archive_string_conversion_charset_name(
 1423|      0|					sconv));
 1424|      0|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1425|      0|			}
 1426|    461|		}
 1427|  1.44k|		zip_entry->uncompressed_size = zip_entry->compressed_size = 0;
 1428|       |
 1429|  1.44k|		if (__archive_read_consume(a, linkname_length) < 0) {
  ------------------
  |  Branch (1429:7): [True: 0, False: 1.44k]
  ------------------
 1430|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1431|      0|			    "Read error skipping symlink target name");
 1432|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1433|      0|		}
 1434|  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 (1434:13): [True: 14.1k, False: 19.7k]
  ------------------
 1435|  19.7k|	   || (zip_entry->uncompressed_size > 0
  ------------------
  |  Branch (1435:9): [True: 12.7k, False: 7.01k]
  ------------------
 1436|  26.8k|	       && zip_entry->uncompressed_size != 0xffffffff)) {
  ------------------
  |  Branch (1436:12): [True: 12.7k, False: 7]
  ------------------
 1437|       |		/* Set the size only if it's meaningful. */
 1438|  26.8k|		archive_entry_set_size(entry, zip_entry->uncompressed_size);
 1439|  26.8k|	}
 1440|  35.3k|	zip->entry_bytes_remaining = zip_entry->compressed_size;
 1441|       |
 1442|       |	/* If there's no body, force read_data() to return EOF immediately. */
 1443|  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 (1443:6): [True: 14.7k, False: 20.5k]
  ------------------
 1444|  14.7k|	    && zip->entry_bytes_remaining < 1)
  ------------------
  |  Branch (1444:9): [True: 2.50k, False: 12.2k]
  ------------------
 1445|  2.50k|		zip->end_of_entry = 1;
 1446|       |
 1447|       |	/* Set up a more descriptive format name. */
 1448|  35.3k|        archive_string_empty(&zip->format_name);
  ------------------
  |  |  181|  35.3k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1449|  35.3k|	archive_string_sprintf(&zip->format_name, "ZIP %d.%d (%s)",
 1450|  35.3k|	    version / 10, version % 10,
 1451|  35.3k|	    compression_name(zip->entry->compression));
 1452|  35.3k|	a->archive.archive_format_name = zip->format_name.s;
 1453|       |
 1454|  35.3k|	return (ret);
 1455|  35.3k|}
archive_read_support_format_zip.c:process_extra:
  645|  36.4k|{
  646|  36.4k|	unsigned offset = 0;
  647|  36.4k|	struct zip *zip = (struct zip *)(a->format->data);
  648|       |
  649|  36.4k|	if (extra_length == 0) {
  ------------------
  |  Branch (649:6): [True: 22.2k, False: 14.2k]
  ------------------
  650|  22.2k|		return ARCHIVE_OK;
  ------------------
  |  |  233|  22.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  651|  22.2k|	}
  652|       |
  653|  14.2k|	if (extra_length < 4) {
  ------------------
  |  Branch (653:6): [True: 676, False: 13.6k]
  ------------------
  654|    676|		size_t i = 0;
  655|       |		/* Some ZIP files may have trailing 0 bytes. Let's check they
  656|       |		 * are all 0 and ignore them instead of returning an error.
  657|       |		 *
  658|       |		 * This is not technically correct, but some ZIP files look
  659|       |		 * like this and other tools support those files - so let's
  660|       |		 * also  support them.
  661|       |		 */
  662|  1.78k|		for (; i < extra_length; i++) {
  ------------------
  |  Branch (662:10): [True: 1.10k, False: 675]
  ------------------
  663|  1.10k|			if (p[i] != 0) {
  ------------------
  |  Branch (663:8): [True: 1, False: 1.10k]
  ------------------
  664|      1|				archive_set_error(&a->archive,
  665|      1|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  666|      1|				    "Too-small extra data: "
  667|      1|				    "Need at least 4 bytes, "
  668|      1|				    "but only found %d bytes",
  669|      1|				    (int)extra_length);
  670|      1|				return ARCHIVE_FAILED;
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  671|      1|			}
  672|  1.10k|		}
  673|       |
  674|    675|		return ARCHIVE_OK;
  ------------------
  |  |  233|    675|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  675|    676|	}
  676|       |
  677|  32.1k|	while (offset <= extra_length - 4) {
  ------------------
  |  Branch (677:9): [True: 18.5k, False: 13.5k]
  ------------------
  678|  18.5k|		unsigned short headerid = archive_le16dec(p + offset);
  679|  18.5k|		unsigned short datasize = archive_le16dec(p + offset + 2);
  680|       |
  681|  18.5k|		offset += 4;
  682|  18.5k|		if (offset + datasize > extra_length) {
  ------------------
  |  Branch (682:7): [True: 48, False: 18.4k]
  ------------------
  683|     48|			archive_set_error(&a->archive,
  684|     48|			    ARCHIVE_ERRNO_FILE_FORMAT, "Extra data overflow: "
  ------------------
  |  |  192|     48|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  685|     48|			    "Need %d bytes but only found %d bytes",
  686|     48|			    (int)datasize, (int)(extra_length - offset));
  687|     48|			return ARCHIVE_FAILED;
  ------------------
  |  |  237|     48|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  688|     48|		}
  689|       |#ifdef DEBUG
  690|       |		fprintf(stderr, "Header id 0x%04x, length %d\n",
  691|       |		    headerid, datasize);
  692|       |#endif
  693|  18.4k|		switch (headerid) {
  694|    622|		case 0x0001:
  ------------------
  |  Branch (694:3): [True: 622, False: 17.8k]
  ------------------
  695|       |			/* Zip64 extended information extra field. */
  696|    622|			zip_entry->flags |= LA_USED_ZIP64;
  ------------------
  |  |  136|    622|#define LA_USED_ZIP64	(1 << 0)
  ------------------
  697|    622|			if (zip_entry->uncompressed_size == 0xffffffff) {
  ------------------
  |  Branch (697:8): [True: 151, False: 471]
  ------------------
  698|    151|				uint64_t t = 0;
  699|    151|				if (datasize < 8
  ------------------
  |  Branch (699:9): [True: 0, False: 151]
  ------------------
  700|    151|				    || (t = archive_le64dec(p + offset)) >
  ------------------
  |  Branch (700:12): [True: 0, False: 151]
  ------------------
  701|    151|				    INT64_MAX) {
  702|      0|					archive_set_error(&a->archive,
  703|      0|					    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  704|      0|					    "Malformed 64-bit "
  705|      0|					    "uncompressed size");
  706|      0|					return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  707|      0|				}
  708|    151|				zip_entry->uncompressed_size = t;
  709|    151|				offset += 8;
  710|    151|				datasize -= 8;
  711|    151|			}
  712|    622|			if (zip_entry->compressed_size == 0xffffffff) {
  ------------------
  |  Branch (712:8): [True: 224, False: 398]
  ------------------
  713|    224|				uint64_t t = 0;
  714|    224|				if (datasize < 8
  ------------------
  |  Branch (714:9): [True: 0, False: 224]
  ------------------
  715|    224|				    || (t = archive_le64dec(p + offset)) >
  ------------------
  |  Branch (715:12): [True: 0, False: 224]
  ------------------
  716|    224|				    INT64_MAX) {
  717|      0|					archive_set_error(&a->archive,
  718|      0|					    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  719|      0|					    "Malformed 64-bit "
  720|      0|					    "compressed size");
  721|      0|					return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  722|      0|				}
  723|    224|				zip_entry->compressed_size = t;
  724|    224|				offset += 8;
  725|    224|				datasize -= 8;
  726|    224|			}
  727|    622|			if (zip_entry->local_header_offset == 0xffffffff) {
  ------------------
  |  Branch (727:8): [True: 0, False: 622]
  ------------------
  728|      0|				uint64_t t = 0;
  729|      0|				if (datasize < 8
  ------------------
  |  Branch (729:9): [True: 0, False: 0]
  ------------------
  730|      0|				    || (t = archive_le64dec(p + offset)) >
  ------------------
  |  Branch (730:12): [True: 0, False: 0]
  ------------------
  731|      0|				    INT64_MAX) {
  732|      0|					archive_set_error(&a->archive,
  733|      0|					    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  734|      0|					    "Malformed 64-bit "
  735|      0|					    "local header offset");
  736|      0|					return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  737|      0|				}
  738|      0|				zip_entry->local_header_offset = t;
  739|      0|				offset += 8;
  740|      0|				datasize -= 8;
  741|      0|			}
  742|       |			/* archive_le32dec(p + offset) gives disk
  743|       |			 * on which file starts, but we don't handle
  744|       |			 * multi-volume Zip files. */
  745|    622|			break;
  746|       |#ifdef DEBUG
  747|       |		case 0x0017:
  748|       |		{
  749|       |			/* Strong encryption field. */
  750|       |			if (archive_le16dec(p + offset) == 2) {
  751|       |				unsigned algId =
  752|       |					archive_le16dec(p + offset + 2);
  753|       |				unsigned bitLen =
  754|       |					archive_le16dec(p + offset + 4);
  755|       |				int	 flags =
  756|       |					archive_le16dec(p + offset + 6);
  757|       |				fprintf(stderr, "algId=0x%04x, bitLen=%u, "
  758|       |				    "flgas=%d\n", algId, bitLen,flags);
  759|       |			}
  760|       |			break;
  761|       |		}
  762|       |#endif
  763|  1.90k|		case 0x5455:
  ------------------
  |  Branch (763:3): [True: 1.90k, False: 16.5k]
  ------------------
  764|  1.90k|		{
  765|       |			/* Extended time field "UT". */
  766|  1.90k|			int flags;
  767|  1.90k|			if (datasize == 0) {
  ------------------
  |  Branch (767:8): [True: 0, False: 1.90k]
  ------------------
  768|      0|				archive_set_error(&a->archive,
  769|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  770|      0|				    "Incomplete extended time field");
  771|      0|				return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  772|      0|			}
  773|  1.90k|			flags = p[offset];
  774|  1.90k|			offset++;
  775|  1.90k|			datasize--;
  776|       |			/* Flag bits indicate which dates are present. */
  777|  1.90k|			if (flags & 0x01)
  ------------------
  |  Branch (777:8): [True: 1.26k, False: 646]
  ------------------
  778|  1.26k|			{
  779|       |#ifdef DEBUG
  780|       |				fprintf(stderr, "mtime: %lld -> %d\n",
  781|       |				    (long long)zip_entry->mtime,
  782|       |				    archive_le32dec(p + offset));
  783|       |#endif
  784|  1.26k|				if (datasize < 4)
  ------------------
  |  Branch (784:9): [True: 0, False: 1.26k]
  ------------------
  785|      0|					break;
  786|  1.26k|				zip_entry->mtime = archive_le32dec(p + offset);
  787|  1.26k|				offset += 4;
  788|  1.26k|				datasize -= 4;
  789|  1.26k|			}
  790|  1.90k|			if (flags & 0x02)
  ------------------
  |  Branch (790:8): [True: 1.14k, False: 760]
  ------------------
  791|  1.14k|			{
  792|  1.14k|				if (datasize < 4)
  ------------------
  |  Branch (792:9): [True: 423, False: 724]
  ------------------
  793|    423|					break;
  794|    724|				zip_entry->atime = archive_le32dec(p + offset);
  795|    724|				offset += 4;
  796|    724|				datasize -= 4;
  797|    724|			}
  798|  1.48k|			if (flags & 0x04)
  ------------------
  |  Branch (798:8): [True: 1.28k, False: 200]
  ------------------
  799|  1.28k|			{
  800|  1.28k|				if (datasize < 4)
  ------------------
  |  Branch (800:9): [True: 244, False: 1.04k]
  ------------------
  801|    244|					break;
  802|  1.04k|				zip_entry->ctime = archive_le32dec(p + offset);
  803|  1.04k|				offset += 4;
  804|  1.04k|				datasize -= 4;
  805|  1.04k|			}
  806|  1.24k|			break;
  807|  1.48k|		}
  808|  1.24k|		case 0x5855:
  ------------------
  |  Branch (808:3): [True: 101, False: 18.3k]
  ------------------
  809|    101|		{
  810|       |			/* Info-ZIP Unix Extra Field (old version) "UX". */
  811|    101|			if (datasize >= 8) {
  ------------------
  |  Branch (811:8): [True: 53, False: 48]
  ------------------
  812|     53|				zip_entry->atime = archive_le32dec(p + offset);
  813|     53|				zip_entry->mtime =
  814|     53|				    archive_le32dec(p + offset + 4);
  815|     53|			}
  816|    101|			if (datasize >= 12) {
  ------------------
  |  Branch (816:8): [True: 49, False: 52]
  ------------------
  817|     49|				zip_entry->uid =
  818|     49|				    archive_le16dec(p + offset + 8);
  819|     49|				zip_entry->gid =
  820|     49|				    archive_le16dec(p + offset + 10);
  821|     49|			}
  822|    101|			break;
  823|  1.48k|		}
  824|  6.83k|		case 0x6c78:
  ------------------
  |  Branch (824:3): [True: 6.83k, False: 11.6k]
  ------------------
  825|  6.83k|		{
  826|       |			/* Experimental 'xl' field */
  827|       |			/*
  828|       |			 * Introduced Dec 2013 to provide a way to
  829|       |			 * include external file attributes (and other
  830|       |			 * fields that ordinarily appear only in
  831|       |			 * central directory) in local file header.
  832|       |			 * This provides file type and permission
  833|       |			 * information necessary to support full
  834|       |			 * streaming extraction.  Currently being
  835|       |			 * discussed with other Zip developers
  836|       |			 * ... subject to change.
  837|       |			 *
  838|       |			 * Format:
  839|       |			 *  The field starts with a bitmap that specifies
  840|       |			 *  which additional fields are included.  The
  841|       |			 *  bitmap is variable length and can be extended in
  842|       |			 *  the future.
  843|       |			 *
  844|       |			 *  n bytes - feature bitmap: first byte has low-order
  845|       |			 *    7 bits.  If high-order bit is set, a subsequent
  846|       |			 *    byte holds the next 7 bits, etc.
  847|       |			 *
  848|       |			 *  if bitmap & 1, 2 byte "version made by"
  849|       |			 *  if bitmap & 2, 2 byte "internal file attributes"
  850|       |			 *  if bitmap & 4, 4 byte "external file attributes"
  851|       |			 *  if bitmap & 8, 2 byte comment length + n byte
  852|       |			 *  comment
  853|       |			 */
  854|  6.83k|			int bitmap, bitmap_last;
  855|       |
  856|  6.83k|			if (datasize < 1)
  ------------------
  |  Branch (856:8): [True: 167, False: 6.66k]
  ------------------
  857|    167|				break;
  858|  6.66k|			bitmap_last = bitmap = 0xff & p[offset];
  859|  6.66k|			offset += 1;
  860|  6.66k|			datasize -= 1;
  861|       |
  862|       |			/* We only support first 7 bits of bitmap; skip rest. */
  863|  29.8k|			while ((bitmap_last & 0x80) != 0
  ------------------
  |  Branch (863:11): [True: 23.9k, False: 5.91k]
  ------------------
  864|  23.9k|			    && datasize >= 1) {
  ------------------
  |  Branch (864:11): [True: 23.2k, False: 748]
  ------------------
  865|  23.2k|				bitmap_last = p[offset];
  866|  23.2k|				offset += 1;
  867|  23.2k|				datasize -= 1;
  868|  23.2k|			}
  869|       |
  870|  6.66k|			if (bitmap & 1) {
  ------------------
  |  Branch (870:8): [True: 5.78k, False: 881]
  ------------------
  871|       |				/* 2 byte "version made by" */
  872|  5.78k|				if (datasize < 2)
  ------------------
  |  Branch (872:9): [True: 752, False: 5.03k]
  ------------------
  873|    752|					break;
  874|  5.03k|				zip_entry->system
  875|  5.03k|				    = archive_le16dec(p + offset) >> 8;
  876|  5.03k|				offset += 2;
  877|  5.03k|				datasize -= 2;
  878|  5.03k|			}
  879|  5.91k|			if (bitmap & 2) {
  ------------------
  |  Branch (879:8): [True: 5.30k, False: 603]
  ------------------
  880|       |				/* 2 byte "internal file attributes" */
  881|  5.30k|				uint32_t internal_attributes;
  882|  5.30k|				if (datasize < 2)
  ------------------
  |  Branch (882:9): [True: 602, False: 4.70k]
  ------------------
  883|    602|					break;
  884|  4.70k|				internal_attributes
  885|  4.70k|				    = archive_le16dec(p + offset);
  886|       |				/* Not used by libarchive at present. */
  887|  4.70k|				(void)internal_attributes; /* UNUSED */
  888|  4.70k|				offset += 2;
  889|  4.70k|				datasize -= 2;
  890|  4.70k|			}
  891|  5.30k|			if (bitmap & 4) {
  ------------------
  |  Branch (891:8): [True: 4.99k, False: 310]
  ------------------
  892|       |				/* 4 byte "external file attributes" */
  893|  4.99k|				uint32_t external_attributes;
  894|  4.99k|				if (datasize < 4)
  ------------------
  |  Branch (894:9): [True: 208, False: 4.79k]
  ------------------
  895|    208|					break;
  896|  4.79k|				external_attributes
  897|  4.79k|				    = archive_le32dec(p + offset);
  898|  4.79k|				if (zip_entry->system == 3) {
  ------------------
  |  Branch (898:9): [True: 2.48k, False: 2.31k]
  ------------------
  899|  2.48k|					zip_entry->mode
  900|  2.48k|					    = external_attributes >> 16;
  901|  2.48k|				} else if (zip_entry->system == 0) {
  ------------------
  |  Branch (901:16): [True: 1.48k, False: 830]
  ------------------
  902|       |					// Interpret MSDOS directory bit
  903|  1.48k|					if (0x10 == (external_attributes &
  ------------------
  |  Branch (903:10): [True: 1.17k, False: 310]
  ------------------
  904|  1.48k|					    0x10)) {
  905|  1.17k|						zip_entry->mode =
  906|  1.17k|						    AE_IFDIR | 0775;
  ------------------
  |  |  221|  1.17k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  907|  1.17k|					} else {
  908|    310|						zip_entry->mode =
  909|    310|						    AE_IFREG | 0664;
  ------------------
  |  |  216|    310|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  910|    310|					}
  911|  1.48k|					if (0x01 == (external_attributes &
  ------------------
  |  Branch (911:10): [True: 257, False: 1.22k]
  ------------------
  912|  1.48k|					    0x01)) {
  913|       |						/* Read-only bit;
  914|       |						 * strip write permissions */
  915|    257|						zip_entry->mode &= 0555;
  916|    257|					}
  917|  1.48k|				} else {
  918|    830|					zip_entry->mode = 0;
  919|    830|				}
  920|  4.79k|				offset += 4;
  921|  4.79k|				datasize -= 4;
  922|  4.79k|			}
  923|  5.10k|			if (bitmap & 8) {
  ------------------
  |  Branch (923:8): [True: 4.09k, False: 1.00k]
  ------------------
  924|       |				/* 2 byte comment length + comment */
  925|  4.09k|				uint32_t comment_length;
  926|  4.09k|				if (datasize < 2)
  ------------------
  |  Branch (926:9): [True: 3.27k, False: 824]
  ------------------
  927|  3.27k|					break;
  928|    824|				comment_length
  929|    824|				    = archive_le16dec(p + offset);
  930|    824|				offset += 2;
  931|    824|				datasize -= 2;
  932|       |
  933|    824|				if (datasize < comment_length)
  ------------------
  |  Branch (933:9): [True: 783, False: 41]
  ------------------
  934|    783|					break;
  935|       |				/* Comment is not supported by libarchive */
  936|     41|				offset += comment_length;
  937|     41|				datasize -= comment_length;
  938|     41|			}
  939|  1.04k|			break;
  940|  5.10k|		}
  941|  1.04k|		case 0x7075:
  ------------------
  |  Branch (941:3): [True: 118, False: 18.3k]
  ------------------
  942|    118|		{
  943|       |			/* Info-ZIP Unicode Path Extra Field. */
  944|    118|			if (datasize < 5 || entry == NULL)
  ------------------
  |  Branch (944:8): [True: 82, False: 36]
  |  Branch (944:24): [True: 0, False: 36]
  ------------------
  945|     82|				break;
  946|     36|			offset += 5;
  947|     36|			datasize -= 5;
  948|       |
  949|       |			/* The path name in this field is always encoded
  950|       |			 * in UTF-8. */
  951|     36|			if (zip->sconv_utf8 == NULL) {
  ------------------
  |  Branch (951:8): [True: 0, False: 36]
  ------------------
  952|      0|				zip->sconv_utf8 =
  953|      0|					archive_string_conversion_from_charset(
  954|      0|					&a->archive, "UTF-8", 1);
  955|       |				/* If the converter from UTF-8 is not
  956|       |				 * available, then the path name from the main
  957|       |				 * field will more likely be correct. */
  958|      0|				if (zip->sconv_utf8 == NULL)
  ------------------
  |  Branch (958:9): [True: 0, False: 0]
  ------------------
  959|      0|					break;
  960|      0|			}
  961|       |
  962|       |			/* Make sure the CRC32 of the filename matches. */
  963|     36|			if (!zip->ignore_crc32) {
  ------------------
  |  Branch (963:8): [True: 0, False: 36]
  ------------------
  964|      0|				const char *cp = archive_entry_pathname(entry);
  965|      0|				if (cp) {
  ------------------
  |  Branch (965:9): [True: 0, False: 0]
  ------------------
  966|      0|					unsigned long file_crc =
  967|      0|					    zip->crc32func(0, cp, strlen(cp));
  968|      0|					unsigned long utf_crc =
  969|      0|					    archive_le32dec(p + offset - 4);
  970|      0|					if (file_crc != utf_crc) {
  ------------------
  |  Branch (970:10): [True: 0, False: 0]
  ------------------
  971|       |#ifdef DEBUG
  972|       |						fprintf(stderr,
  973|       |						    "CRC filename mismatch; "
  974|       |						    "CDE is %lx, but UTF8 "
  975|       |						    "is outdated with %lx\n",
  976|       |						    file_crc, utf_crc);
  977|       |#endif
  978|      0|						break;
  979|      0|					}
  980|      0|				}
  981|      0|			}
  982|       |
  983|     36|			if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|     36|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (983:8): [True: 1, False: 35]
  ------------------
  984|     36|			    p + offset, datasize, zip->sconv_utf8) != 0) {
  985|       |				/* Ignore the error, and fallback to the path
  986|       |				 * name from the main field. */
  987|       |#ifdef DEBUG
  988|       |				fprintf(stderr, "Failed to read the ZIP "
  989|       |				    "0x7075 extra field path.\n");
  990|       |#endif
  991|      1|			}
  992|     36|			break;
  993|     36|		}
  994|    340|		case 0x7855:
  ------------------
  |  Branch (994:3): [True: 340, False: 18.1k]
  ------------------
  995|       |			/* Info-ZIP Unix Extra Field (type 2) "Ux". */
  996|       |#ifdef DEBUG
  997|       |			fprintf(stderr, "uid %d gid %d\n",
  998|       |			    archive_le16dec(p + offset),
  999|       |			    archive_le16dec(p + offset + 2));
 1000|       |#endif
 1001|    340|			if (datasize >= 2)
  ------------------
  |  Branch (1001:8): [True: 114, False: 226]
  ------------------
 1002|    114|				zip_entry->uid = archive_le16dec(p + offset);
 1003|    340|			if (datasize >= 4)
  ------------------
  |  Branch (1003:8): [True: 76, False: 264]
  ------------------
 1004|     76|				zip_entry->gid =
 1005|     76|				    archive_le16dec(p + offset + 2);
 1006|    340|			break;
 1007|  2.34k|		case 0x7875:
  ------------------
  |  Branch (1007:3): [True: 2.34k, False: 16.1k]
  ------------------
 1008|  2.34k|		{
 1009|       |			/* Info-Zip Unix Extra Field (type 3) "ux". */
 1010|  2.34k|			int uidsize = 0, gidsize = 0;
 1011|       |
 1012|       |			/* TODO: support arbitrary uidsize/gidsize. */
 1013|  2.34k|			if (datasize >= 1 && p[offset] == 1) {/* version=1 */
  ------------------
  |  Branch (1013:8): [True: 2.29k, False: 57]
  |  Branch (1013:25): [True: 2.07k, False: 215]
  ------------------
 1014|  2.07k|				if (datasize >= 4) {
  ------------------
  |  Branch (1014:9): [True: 1.77k, False: 306]
  ------------------
 1015|       |					/* get a uid size. */
 1016|  1.77k|					uidsize = 0xff & (int)p[offset+1];
 1017|  1.77k|					if (uidsize == 2)
  ------------------
  |  Branch (1017:10): [True: 1, False: 1.77k]
  ------------------
 1018|      1|						zip_entry->uid =
 1019|      1|						    archive_le16dec(
 1020|      1|						        p + offset + 2);
 1021|  1.77k|					else if (uidsize == 4 && datasize >= 6)
  ------------------
  |  Branch (1021:15): [True: 1.35k, False: 412]
  |  Branch (1021:31): [True: 1.35k, False: 0]
  ------------------
 1022|  1.35k|						zip_entry->uid =
 1023|  1.35k|						    archive_le32dec(
 1024|  1.35k|						        p + offset + 2);
 1025|  1.77k|				}
 1026|  2.07k|				if (datasize >= (2 + uidsize + 3)) {
  ------------------
  |  Branch (1026:9): [True: 1.59k, False: 487]
  ------------------
 1027|       |					/* get a gid size. */
 1028|  1.59k|					gidsize = 0xff &
 1029|  1.59k|					    (int)p[offset+2+uidsize];
 1030|  1.59k|					if (gidsize == 2)
  ------------------
  |  Branch (1030:10): [True: 57, False: 1.53k]
  ------------------
 1031|     57|						zip_entry->gid =
 1032|     57|						    archive_le16dec(
 1033|     57|						        p+offset+2+uidsize+1);
 1034|  1.53k|					else if (gidsize == 4 &&
  ------------------
  |  Branch (1034:15): [True: 1.07k, False: 463]
  ------------------
 1035|  1.07k|					    datasize >= (2 + uidsize + 5))
  ------------------
  |  Branch (1035:10): [True: 493, False: 577]
  ------------------
 1036|    493|						zip_entry->gid =
 1037|    493|						    archive_le32dec(
 1038|    493|						        p+offset+2+uidsize+1);
 1039|  1.59k|				}
 1040|  2.07k|			}
 1041|  2.34k|			break;
 1042|     36|		}
 1043|  3.59k|		case 0x9901:
  ------------------
  |  Branch (1043:3): [True: 3.59k, False: 14.8k]
  ------------------
 1044|       |			/* WinZip AES extra data field. */
 1045|  3.59k|			if (datasize < 6) {
  ------------------
  |  Branch (1045:8): [True: 0, False: 3.59k]
  ------------------
 1046|      0|				archive_set_error(&a->archive,
 1047|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1048|      0|				    "Incomplete AES field");
 1049|      0|				return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1050|      0|			}
 1051|  3.59k|			if (p[offset + 2] == 'A' && p[offset + 3] == 'E') {
  ------------------
  |  Branch (1051:8): [True: 3.55k, False: 47]
  |  Branch (1051:32): [True: 3.37k, False: 173]
  ------------------
 1052|       |				/* Vendor version. */
 1053|  3.37k|				zip_entry->aes_extra.vendor =
 1054|  3.37k|				    archive_le16dec(p + offset);
 1055|       |				/* AES encryption strength. */
 1056|  3.37k|				zip_entry->aes_extra.strength = p[offset + 4];
 1057|       |				/* Actual compression method. */
 1058|  3.37k|				zip_entry->aes_extra.compression =
 1059|  3.37k|				    p[offset + 5];
 1060|  3.37k|			}
 1061|  3.59k|			break;
 1062|  2.63k|		default:
  ------------------
  |  Branch (1062:3): [True: 2.63k, False: 15.8k]
  ------------------
 1063|  2.63k|			break;
 1064|  18.4k|		}
 1065|  18.4k|		offset += datasize;
 1066|  18.4k|	}
 1067|  13.5k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  13.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1068|  13.6k|}
archive_read_support_format_zip.c:zip_read_data_deflate:
 2817|  4.12k|{
 2818|  4.12k|	struct zip *zip;
 2819|  4.12k|	ssize_t bytes_avail, to_consume = 0;
 2820|  4.12k|	const void *compressed_buff;
 2821|  4.12k|	const void *sp;
 2822|  4.12k|	int r;
 2823|       |
 2824|  4.12k|	(void)offset; /* UNUSED */
 2825|       |
 2826|  4.12k|	zip = (struct zip *)(a->format->data);
 2827|       |
 2828|       |	/* If the buffer hasn't been allocated, allocate it now. */
 2829|  4.12k|	if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (2829:6): [True: 75, False: 4.05k]
  ------------------
 2830|     75|		zip->uncompressed_buffer_size = 256 * 1024;
 2831|     75|		zip->uncompressed_buffer
 2832|     75|		    = malloc(zip->uncompressed_buffer_size);
 2833|     75|		if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (2833:7): [True: 0, False: 75]
  ------------------
 2834|      0|			archive_set_error(&a->archive, ENOMEM,
 2835|      0|			    "No memory for ZIP decompression");
 2836|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2837|      0|		}
 2838|     75|	}
 2839|       |
 2840|  4.12k|	r = zip_deflate_init(a, zip);
 2841|  4.12k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  4.12k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2841:6): [True: 0, False: 4.12k]
  ------------------
 2842|      0|		return (r);
 2843|       |
 2844|       |	/*
 2845|       |	 * Note: '1' here is a performance optimization.
 2846|       |	 * Recall that the decompression layer returns a count of
 2847|       |	 * available bytes; asking for more than that forces the
 2848|       |	 * decompressor to combine reads by copying data.
 2849|       |	 */
 2850|  4.12k|	compressed_buff = sp = __archive_read_ahead(a, 1, &bytes_avail);
 2851|  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 (2851:6): [True: 1.05k, False: 3.07k]
  ------------------
 2852|  1.05k|	    && bytes_avail > zip->entry_bytes_remaining) {
  ------------------
  |  Branch (2852:9): [True: 302, False: 757]
  ------------------
 2853|    302|		bytes_avail = (ssize_t)zip->entry_bytes_remaining;
 2854|    302|	}
 2855|  4.12k|	if (bytes_avail < 0) {
  ------------------
  |  Branch (2855:6): [True: 0, False: 4.12k]
  ------------------
 2856|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2857|      0|		    "Truncated ZIP file body");
 2858|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2859|      0|	}
 2860|       |
 2861|  4.12k|	zip_read_decrypt(zip, compressed_buff, bytes_avail,
 2862|  4.12k|					 &compressed_buff, &bytes_avail, &sp);
 2863|       |
 2864|       |	/*
 2865|       |	 * A bug in zlib.h: stream.next_in should be marked 'const'
 2866|       |	 * but isn't (the library never alters data through the
 2867|       |	 * next_in pointer, only reads it).  The result: this ugly
 2868|       |	 * cast to remove 'const'.
 2869|       |	 */
 2870|  4.12k|	zip->stream.next_in = (Bytef *)(uintptr_t)(const void *)compressed_buff;
 2871|  4.12k|	zip->stream.avail_in = (uInt)bytes_avail;
 2872|  4.12k|	zip->stream.total_in = 0;
 2873|  4.12k|	zip->stream.next_out = zip->uncompressed_buffer;
 2874|  4.12k|	zip->stream.avail_out = (uInt)zip->uncompressed_buffer_size;
 2875|  4.12k|	zip->stream.total_out = 0;
 2876|       |
 2877|  4.12k|	r = inflate(&zip->stream, 0);
 2878|  4.12k|	switch (r) {
 2879|    125|	case Z_OK:
  ------------------
  |  Branch (2879:2): [True: 125, False: 4.00k]
  ------------------
 2880|    125|		break;
 2881|  3.99k|	case Z_STREAM_END:
  ------------------
  |  Branch (2881:2): [True: 3.99k, False: 132]
  ------------------
 2882|  3.99k|		zip->end_of_entry = 1;
 2883|  3.99k|		break;
 2884|      0|	case Z_MEM_ERROR:
  ------------------
  |  Branch (2884:2): [True: 0, False: 4.12k]
  ------------------
 2885|      0|		archive_set_error(&a->archive, ENOMEM,
 2886|      0|		    "Out of memory for ZIP decompression");
 2887|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2888|      7|	default:
  ------------------
  |  Branch (2888:2): [True: 7, False: 4.12k]
  ------------------
 2889|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      7|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2890|      7|		    "ZIP decompression failed (%d)", r);
 2891|      7|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2892|  4.12k|	}
 2893|       |
 2894|       |	/* Consume as much as the compressor actually used. */
 2895|  4.12k|	to_consume = zip->stream.total_in;
 2896|  4.12k|	__archive_read_consume(a, to_consume);
 2897|  4.12k|	zip->entry_bytes_remaining -= to_consume;
 2898|  4.12k|	zip->entry_compressed_bytes_read += to_consume;
 2899|  4.12k|	zip->entry_uncompressed_bytes_read += zip->stream.total_out;
 2900|       |
 2901|  4.12k|	zip_read_decrypt_update(zip, to_consume, sp);
 2902|       |
 2903|  4.12k|	if (zip->end_of_entry && zip->hctx_valid) {
  ------------------
  |  Branch (2903:6): [True: 3.99k, False: 125]
  |  Branch (2903:27): [True: 2.16k, False: 1.82k]
  ------------------
 2904|  2.16k|		r = check_authentication_code(a, NULL);
 2905|  2.16k|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|  2.16k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2905:7): [True: 875, False: 1.29k]
  ------------------
 2906|    875|			return r;
 2907|    875|		}
 2908|  2.16k|	}
 2909|       |
 2910|  3.24k|	*size = zip->stream.total_out;
 2911|  3.24k|	*buff = zip->uncompressed_buffer;
 2912|       |
 2913|  3.24k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.24k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2914|  4.12k|}
archive_read_support_format_zip.c:zip_deflate_init:
 2791|  4.12k|{
 2792|  4.12k|	int r;
 2793|       |
 2794|       |	/* If we haven't yet read any data, initialize the decompressor. */
 2795|  4.12k|	if (!zip->decompress_init) {
  ------------------
  |  Branch (2795:6): [True: 4.00k, False: 125]
  ------------------
 2796|  4.00k|		if (zip->stream_valid)
  ------------------
  |  Branch (2796:7): [True: 3.89k, False: 105]
  ------------------
 2797|  3.89k|			r = inflateReset(&zip->stream);
 2798|    105|		else
 2799|    105|			r = inflateInit2(&zip->stream,
 2800|  4.00k|			    -15 /* Don't check for zlib header */);
 2801|  4.00k|		if (r != Z_OK) {
  ------------------
  |  Branch (2801:7): [True: 0, False: 4.00k]
  ------------------
 2802|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2803|      0|			    "Can't initialize ZIP decompression");
 2804|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2805|      0|		}
 2806|       |		/* Stream structure has been set up. */
 2807|  4.00k|		zip->stream_valid = 1;
 2808|       |		/* We've initialized decompression for this stream. */
 2809|  4.00k|		zip->decompress_init = 1;
 2810|  4.00k|	}
 2811|  4.12k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.12k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2812|  4.12k|}
archive_read_support_format_zip.c:zip_read_decrypt:
  483|  4.61k|{
  484|  4.61k|	*sp = compressed_buff;
  485|       |
  486|  4.61k|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (486:6): [True: 386, False: 4.22k]
  |  Branch (486:25): [True: 2.16k, False: 2.05k]
  ------------------
  487|  2.55k|		if (zip->decrypted_bytes_remaining < (size_t)bytes_avail) {
  ------------------
  |  Branch (487:7): [True: 2.55k, False: 0]
  ------------------
  488|  2.55k|			size_t buff_remaining =
  489|  2.55k|			    (zip->decrypted_buffer +
  490|  2.55k|			    zip->decrypted_buffer_size)
  491|  2.55k|			    - (zip->decrypted_ptr +
  492|  2.55k|			    zip->decrypted_bytes_remaining);
  493|       |			/* The new bytes to decrypt start after decrypted_bytes_remaining
  494|       |			 * in the raw stream: those leading bytes were already
  495|       |			 * decrypted on a previous call but have not yet been consumed. */
  496|  2.55k|			size_t new_bytes =
  497|  2.55k|			    (size_t)bytes_avail
  498|  2.55k|			    - zip->decrypted_bytes_remaining;
  499|       |
  500|  2.55k|			if (buff_remaining > new_bytes)
  ------------------
  |  Branch (500:8): [True: 2.44k, False: 109]
  ------------------
  501|  2.44k|				buff_remaining = new_bytes;
  502|       |
  503|  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 (503:8): [True: 502, False: 2.05k]
  ------------------
  504|    502|			      zip->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (504:10): [True: 502, False: 0]
  ------------------
  505|    502|				if ((int64_t)(zip->decrypted_bytes_remaining
  ------------------
  |  Branch (505:9): [True: 0, False: 502]
  ------------------
  506|    502|				    + buff_remaining)
  507|    502|				      > zip->entry_bytes_remaining) {
  508|      0|					if (zip->entry_bytes_remaining <
  ------------------
  |  Branch (508:10): [True: 0, False: 0]
  ------------------
  509|      0|					    (int64_t)zip->decrypted_bytes_remaining)
  510|      0|						buff_remaining = 0;
  511|      0|					else
  512|      0|						buff_remaining =
  513|      0|						    (size_t)zip->entry_bytes_remaining
  514|      0|						    - zip->decrypted_bytes_remaining;
  515|      0|				}
  516|    502|			}
  517|  2.55k|			if (buff_remaining > 0) {
  ------------------
  |  Branch (517:8): [True: 2.55k, False: 0]
  ------------------
  518|  2.55k|				if (zip->tctx_valid) {
  ------------------
  |  Branch (518:9): [True: 386, False: 2.16k]
  ------------------
  519|    386|					trad_enc_decrypt_update(&zip->tctx,
  520|    386|					    (const uint8_t *)compressed_buff
  521|    386|					      + zip->decrypted_bytes_remaining,
  522|    386|					    buff_remaining,
  523|    386|					    zip->decrypted_ptr
  524|    386|					      + zip->decrypted_bytes_remaining,
  525|    386|					    buff_remaining);
  526|  2.16k|				} else {
  527|  2.16k|					size_t dsize = buff_remaining;
  528|  2.16k|					archive_decrypto_aes_ctr_update(
  ------------------
  |  |  164|  2.16k|  __archive_cryptor.decrypto_aes_ctr_update(ctx, in, in_len, out, out_len)
  ------------------
  529|  2.16k|					    &zip->cctx,
  530|  2.16k|					    (const uint8_t *)compressed_buff
  531|  2.16k|					      + zip->decrypted_bytes_remaining,
  532|  2.16k|					    buff_remaining,
  533|  2.16k|					    zip->decrypted_ptr
  534|  2.16k|					      + zip->decrypted_bytes_remaining,
  535|  2.16k|					    &dsize);
  536|  2.16k|				}
  537|  2.55k|				zip->decrypted_bytes_remaining +=
  538|  2.55k|				    buff_remaining;
  539|  2.55k|			}
  540|  2.55k|		}
  541|  2.55k|		*result_avail = zip->decrypted_bytes_remaining;
  542|  2.55k|		*result_buff = (const char *)zip->decrypted_ptr;
  543|  2.55k|	} else {
  544|  2.05k|		*result_buff = compressed_buff;
  545|  2.05k|		*result_avail = bytes_avail;
  546|  2.05k|	}
  547|  4.61k|}
archive_read_support_format_zip.c:trad_enc_decrypt_update:
  353|  3.32k|{
  354|  3.32k|	unsigned i, max;
  355|       |
  356|  3.32k|	max = (unsigned)((in_len < out_len)? in_len: out_len);
  ------------------
  |  Branch (356:19): [True: 0, False: 3.32k]
  ------------------
  357|       |
  358|  4.41M|	for (i = 0; i < max; i++) {
  ------------------
  |  Branch (358:14): [True: 4.41M, False: 3.32k]
  ------------------
  359|  4.41M|		uint8_t t = in[i] ^ trad_enc_decrypt_byte(ctx);
  360|  4.41M|		out[i] = t;
  361|  4.41M|		trad_enc_update_keys(ctx, t);
  362|  4.41M|	}
  363|  3.32k|}
archive_read_support_format_zip.c:trad_enc_decrypt_byte:
  345|  4.41M|{
  346|  4.41M|	unsigned temp = ctx->keys[2] | 2;
  347|  4.41M|	return (uint8_t)((temp * (temp ^ 1)) >> 8) & 0xff;
  348|  4.41M|}
archive_read_support_format_zip.c:trad_enc_update_keys:
  332|  4.42M|{
  333|  4.42M|	uint8_t t;
  334|  4.42M|#define CRC32(c, b) (crc32(c ^ 0xffffffffUL, &b, 1) ^ 0xffffffffUL)
  335|       |
  336|  4.42M|	ctx->keys[0] = CRC32(ctx->keys[0], c);
  ------------------
  |  |  334|  4.42M|#define CRC32(c, b) (crc32(c ^ 0xffffffffUL, &b, 1) ^ 0xffffffffUL)
  ------------------
  337|  4.42M|	ctx->keys[1] = (ctx->keys[1] + (ctx->keys[0] & 0xff)) * 134775813L + 1;
  338|  4.42M|	t = (ctx->keys[1] >> 24) & 0xff;
  339|  4.42M|	ctx->keys[2] = CRC32(ctx->keys[2], t);
  ------------------
  |  |  334|  4.42M|#define CRC32(c, b) (crc32(c ^ 0xffffffffUL, &b, 1) ^ 0xffffffffUL)
  ------------------
  340|  4.42M|#undef CRC32
  341|  4.42M|}
archive_read_support_format_zip.c:zip_read_decrypt_update:
  554|  4.59k|{
  555|  4.59k|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (555:6): [True: 386, False: 4.21k]
  |  Branch (555:25): [True: 2.16k, False: 2.04k]
  ------------------
  556|  2.55k|		zip->decrypted_bytes_remaining -= to_consume;
  557|  2.55k|		if (zip->decrypted_bytes_remaining == 0)
  ------------------
  |  Branch (557:7): [True: 109, False: 2.44k]
  ------------------
  558|    109|			zip->decrypted_ptr = zip->decrypted_buffer;
  559|  2.44k|		else
  560|  2.44k|			zip->decrypted_ptr += to_consume;
  561|  2.55k|	}
  562|  4.59k|	if (zip->hctx_valid)
  ------------------
  |  Branch (562:6): [True: 2.16k, False: 2.43k]
  ------------------
  563|  2.16k|		archive_hmac_sha1_update(&zip->hctx, sp, to_consume);
  ------------------
  |  |  101|  2.16k|	__archive_hmac.__hmac_sha1_update(ctx, data, data_len)
  ------------------
  564|  4.59k|}
archive_read_support_format_zip.c:check_authentication_code:
 1459|  2.89k|{
 1460|  2.89k|	struct zip *zip = (struct zip *)(a->format->data);
 1461|       |
 1462|       |	/* Check authentication code. */
 1463|  2.89k|	if (zip->hctx_valid) {
  ------------------
  |  Branch (1463:6): [True: 2.89k, False: 0]
  ------------------
 1464|  2.89k|		const void *p;
 1465|  2.89k|		uint8_t hmac[20];
 1466|  2.89k|		size_t hmac_len = 20;
 1467|  2.89k|		int cmp;
 1468|       |
 1469|  2.89k|		archive_hmac_sha1_final(&zip->hctx, hmac, &hmac_len);
  ------------------
  |  |  103|  2.89k|  	__archive_hmac.__hmac_sha1_final(ctx, out, out_len)
  ------------------
 1470|  2.89k|		if (_p == NULL) {
  ------------------
  |  Branch (1470:7): [True: 2.36k, False: 531]
  ------------------
 1471|       |			/* Read authentication code. */
 1472|  2.36k|			p = __archive_read_ahead(a, AUTH_CODE_SIZE, NULL);
  ------------------
  |  |  146|  2.36k|#define AUTH_CODE_SIZE	10
  ------------------
 1473|  2.36k|			if (p == NULL) {
  ------------------
  |  Branch (1473:8): [True: 0, False: 2.36k]
  ------------------
 1474|      0|				archive_set_error(&a->archive,
 1475|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1476|      0|				    "Truncated ZIP file data");
 1477|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1478|      0|			}
 1479|  2.36k|		} else {
 1480|    531|			p = _p;
 1481|    531|		}
 1482|  2.89k|		cmp = memcmp(hmac, p, AUTH_CODE_SIZE);
  ------------------
  |  |  146|  2.89k|#define AUTH_CODE_SIZE	10
  ------------------
 1483|  2.89k|		__archive_read_consume(a, AUTH_CODE_SIZE);
  ------------------
  |  |  146|  2.89k|#define AUTH_CODE_SIZE	10
  ------------------
 1484|  2.89k|		if (cmp != 0) {
  ------------------
  |  Branch (1484:7): [True: 1.53k, False: 1.35k]
  ------------------
 1485|  1.53k|			archive_set_error(&a->archive,
 1486|  1.53k|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  1.53k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1487|  1.53k|			    "ZIP bad Authentication code");
 1488|  1.53k|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|  1.53k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1489|  1.53k|		}
 1490|  2.89k|	}
 1491|  1.35k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.35k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1492|  2.89k|}
archive_read_support_format_zip.c:zip_read_data_zipx_lzma_alone:
 2170|    486|{
 2171|    486|	struct zip* zip = (struct zip *)(a->format->data);
 2172|    486|	int ret;
 2173|    486|	lzma_ret lz_ret;
 2174|    486|	const void* compressed_buf;
 2175|    486|	const void* sp;
 2176|    486|	ssize_t bytes_avail, in_bytes, to_consume;
 2177|       |
 2178|    486|	(void) offset; /* UNUSED */
 2179|       |
 2180|       |	/* Initialize decompressor if not yet initialized. */
 2181|    486|	if (!zip->decompress_init) {
  ------------------
  |  Branch (2181:6): [True: 423, False: 63]
  ------------------
 2182|    423|		ret = zipx_lzma_alone_init(a, zip);
 2183|    423|		if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|    423|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2183:7): [True: 2, False: 421]
  ------------------
 2184|      2|			return (ret);
 2185|    423|	}
 2186|       |
 2187|       |	/* Fetch more compressed data. The same note as in deflate handler
 2188|       |	 * applies here as well:
 2189|       |	 *
 2190|       |	 * Note: '1' here is a performance optimization. Recall that the
 2191|       |	 * decompression layer returns a count of available bytes; asking for
 2192|       |	 * more than that forces the decompressor to combine reads by copying
 2193|       |	 * data.
 2194|       |	 */
 2195|    484|	compressed_buf = __archive_read_ahead(a, 1, &bytes_avail);
 2196|    484|	if (bytes_avail < 0) {
  ------------------
  |  Branch (2196:6): [True: 0, False: 484]
  ------------------
 2197|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2198|      0|		    "Truncated lzma file body");
 2199|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2200|      0|	}
 2201|       |
 2202|       |	/* Set decompressor parameters. */
 2203|    484|	in_bytes = (ssize_t)zipmin(zip->entry_bytes_remaining, bytes_avail);
  ------------------
  |  |  262|    484|#define	zipmin(a,b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (262:22): [True: 413, False: 71]
  |  |  ------------------
  ------------------
 2204|       |
 2205|    484|	zip_read_decrypt(zip, compressed_buf, in_bytes,
 2206|    484|	    &compressed_buf, &in_bytes, &sp);
 2207|       |
 2208|    484|	zip->zipx_lzma_stream.next_in = compressed_buf;
 2209|    484|	zip->zipx_lzma_stream.avail_in = in_bytes;
 2210|    484|	zip->zipx_lzma_stream.total_in = 0;
 2211|    484|	zip->zipx_lzma_stream.next_out = zip->uncompressed_buffer;
 2212|    484|	zip->zipx_lzma_stream.avail_out =
 2213|       |		/* These lzma_alone streams lack end of stream marker, so let's
 2214|       |		 * make sure the unpacker won't try to unpack more than it's
 2215|       |		 * supposed to. */
 2216|    484|		(size_t)zipmin((int64_t) zip->uncompressed_buffer_size,
  ------------------
  |  |  262|    484|#define	zipmin(a,b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (262:22): [True: 210, False: 274]
  |  |  ------------------
  ------------------
 2217|    484|		    zip->entry->uncompressed_size -
 2218|    484|		    zip->entry_uncompressed_bytes_read);
 2219|    484|	zip->zipx_lzma_stream.total_out = 0;
 2220|       |
 2221|       |	/* Perform the decompression. */
 2222|    484|	lz_ret = lzma_code(&zip->zipx_lzma_stream, LZMA_RUN);
 2223|    484|	switch(lz_ret) {
 2224|      0|		case LZMA_DATA_ERROR:
  ------------------
  |  Branch (2224:3): [True: 0, False: 484]
  ------------------
 2225|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2226|      0|			    "lzma data error (%d)", (int) lz_ret);
 2227|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2228|       |
 2229|       |		/* This case is optional in lzma alone format. It can happen,
 2230|       |		 * but most of the files don't have it. (GitHub #1257) */
 2231|    191|		case LZMA_STREAM_END:
  ------------------
  |  Branch (2231:3): [True: 191, False: 293]
  ------------------
 2232|    191|			if((int64_t) zip->zipx_lzma_stream.total_in !=
  ------------------
  |  Branch (2232:7): [True: 0, False: 191]
  ------------------
 2233|    191|			    zip->entry_bytes_remaining)
 2234|      0|			{
 2235|      0|				archive_set_error(&a->archive,
 2236|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2237|      0|				    "lzma alone premature end of stream");
 2238|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2239|      0|			}
 2240|       |
 2241|    191|			zip->end_of_entry = 1;
 2242|    191|			break;
 2243|       |
 2244|    285|		case LZMA_OK:
  ------------------
  |  Branch (2244:3): [True: 285, False: 199]
  ------------------
 2245|    285|			break;
 2246|       |
 2247|      8|		case LZMA_BUF_ERROR:
  ------------------
  |  Branch (2247:3): [True: 8, False: 476]
  ------------------
 2248|      8|			if (zip->zipx_lzma_stream.avail_out == 0) {
  ------------------
  |  Branch (2248:8): [True: 1, False: 7]
  ------------------
 2249|      1|				zip->end_of_entry = 1;
 2250|      1|				break;
 2251|      1|			}
 2252|       |			/* FALL THROUGH */
 2253|      7|		default:
  ------------------
  |  Branch (2253:3): [True: 0, False: 484]
  ------------------
 2254|      7|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      7|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2255|      7|			    "lzma unknown error (%d)", (int) lz_ret);
 2256|      7|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2257|    484|	}
 2258|       |
 2259|    477|	to_consume = (ssize_t)zip->zipx_lzma_stream.total_in;
 2260|       |
 2261|       |	/* Update pointers. */
 2262|    477|	__archive_read_consume(a, to_consume);
 2263|    477|	zip->entry_bytes_remaining -= to_consume;
 2264|    477|	zip->entry_compressed_bytes_read += to_consume;
 2265|    477|	zip->entry_uncompressed_bytes_read += zip->zipx_lzma_stream.total_out;
 2266|       |
 2267|    477|	zip_read_decrypt_update(zip, to_consume, sp);
 2268|       |
 2269|    477|	if(zip->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (2269:5): [True: 413, False: 64]
  ------------------
 2270|    413|		zip->end_of_entry = 1;
 2271|    413|	}
 2272|       |
 2273|    477|	if(zip->end_of_entry && zip->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (2273:5): [True: 414, False: 63]
  |  Branch (2273:26): [True: 1, False: 413]
  ------------------
 2274|      1|		ssize_t remaining = (ssize_t)zip->entry_bytes_remaining;
 2275|      1|		const void *p = __archive_read_ahead(a, remaining, NULL);
 2276|      1|		if (p != NULL) {
  ------------------
  |  Branch (2276:7): [True: 0, False: 1]
  ------------------
 2277|      0|			if (zip->hctx_valid)
  ------------------
  |  Branch (2277:8): [True: 0, False: 0]
  ------------------
 2278|      0|				archive_hmac_sha1_update(&zip->hctx,
  ------------------
  |  |  101|      0|	__archive_hmac.__hmac_sha1_update(ctx, data, data_len)
  ------------------
 2279|      0|				    p, remaining);
 2280|      0|			__archive_read_consume(a, remaining);
 2281|      0|			zip->entry_compressed_bytes_read += remaining;
 2282|      0|			zip->entry_bytes_remaining = 0;
 2283|      0|		}
 2284|      1|	}
 2285|       |
 2286|       |	/* Free lzma decoder handle because we'll no longer need it. */
 2287|       |	/* This cannot be folded into LZMA_STREAM_END handling above
 2288|       |	 * because the stream end marker is not required in this format. */
 2289|    477|	if(zip->end_of_entry) {
  ------------------
  |  Branch (2289:5): [True: 414, False: 63]
  ------------------
 2290|    414|		lzma_end(&zip->zipx_lzma_stream);
 2291|    414|		zip->zipx_lzma_valid = 0;
 2292|       |
 2293|    414|		if (zip->hctx_valid) {
  ------------------
  |  Branch (2293:7): [True: 0, False: 414]
  ------------------
 2294|      0|			ret = check_authentication_code(a, NULL);
 2295|      0|			if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2295:8): [True: 0, False: 0]
  ------------------
 2296|      0|				return ret;
 2297|      0|		}
 2298|    414|	}
 2299|       |
 2300|       |	/* Return values. */
 2301|    477|	*size = (size_t)zip->zipx_lzma_stream.total_out;
 2302|    477|	*buff = zip->uncompressed_buffer;
 2303|       |
 2304|       |	/* If we're here, then we're good! */
 2305|    477|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    477|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2306|    477|}
archive_read_support_format_zip.c:zipx_lzma_alone_init:
 1915|    423|{
 1916|    423|	lzma_ret r;
 1917|    423|	const uint8_t* p;
 1918|       |
 1919|    423|#pragma pack(push)
 1920|    423|#pragma pack(1)
 1921|    423|	struct _alone_header {
 1922|    423|	    uint8_t bytes[5];
 1923|    423|	    uint64_t uncompressed_size;
 1924|    423|	} alone_header;
 1925|    423|#pragma pack(pop)
 1926|       |
 1927|    423|	if(zip->zipx_lzma_valid) {
  ------------------
  |  Branch (1927:5): [True: 0, False: 423]
  ------------------
 1928|      0|		lzma_end(&zip->zipx_lzma_stream);
 1929|      0|		zip->zipx_lzma_valid = 0;
 1930|      0|	}
 1931|       |
 1932|       |	/* To unpack ZIPX's "LZMA" (id 14) stream we can use standard liblzma
 1933|       |	 * that is a part of XZ Utils. The stream format stored inside ZIPX
 1934|       |	 * file is a modified "lzma alone" file format, that was used by the
 1935|       |	 * `lzma` utility which was later deprecated in favour of `xz` utility.
 1936|       | 	 * Since those formats are nearly the same, we can use a standard
 1937|       |	 * "lzma alone" decoder from XZ Utils. */
 1938|       |
 1939|    423|	memset(&zip->zipx_lzma_stream, 0, sizeof(zip->zipx_lzma_stream));
 1940|    423|	r = lzma_alone_decoder(&zip->zipx_lzma_stream, 576 * ((uint64_t)1 << 20));
 1941|    423|	if (r != LZMA_OK) {
  ------------------
  |  Branch (1941:6): [True: 0, False: 423]
  ------------------
 1942|      0|		archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1943|      0|		    "lzma initialization failed (%d)", r);
 1944|       |
 1945|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1946|      0|	}
 1947|       |
 1948|       |	/* Flag the cleanup function that we want our lzma-related structures
 1949|       |	 * to be freed later. */
 1950|    423|	zip->zipx_lzma_valid = 1;
 1951|       |
 1952|       |	/* The "lzma alone" file format and the stream format inside ZIPx are
 1953|       |	 * almost the same. Here's an example of a structure of "lzma alone"
 1954|       |	 * format:
 1955|       |	 *
 1956|       |	 * $ cat /bin/ls | lzma | xxd | head -n 1
 1957|       |	 * 00000000: 5d00 0080 00ff ffff ffff ffff ff00 2814
 1958|       |	 *
 1959|       |	 *    5 bytes        8 bytes        n bytes
 1960|       |	 * <lzma_params><uncompressed_size><data...>
 1961|       |	 *
 1962|       |	 * lzma_params is a 5-byte blob that has to be decoded to extract
 1963|       |	 * parameters of this LZMA stream. The uncompressed_size field is an
 1964|       |	 * uint64_t value that contains information about the size of the
 1965|       |	 * uncompressed file, or UINT64_MAX if this value is unknown.
 1966|       |	 * The <data...> part is the actual lzma-compressed data stream.
 1967|       |	 *
 1968|       |	 * Now here's the structure of the stream inside the ZIPX file:
 1969|       |	 *
 1970|       |	 * $ cat stream_inside_zipx | xxd | head -n 1
 1971|       |	 * 00000000: 0914 0500 5d00 8000 0000 2814 .... ....
 1972|       |	 *
 1973|       |	 *  2byte   2byte    5 bytes     n bytes
 1974|       |	 * <magic1><magic2><lzma_params><data...>
 1975|       |	 *
 1976|       |	 * This means that the ZIPX file contains an additional magic1 and
 1977|       |	 * magic2 headers, the lzma_params field contains the same parameter
 1978|       |	 * set as in the "lzma alone" format, and the <data...> field is the
 1979|       |	 * same as in the "lzma alone" format as well. Note that also the zipx
 1980|       |	 * format is missing the uncompressed_size field.
 1981|       |	 *
 1982|       |	 * So, in order to use the "lzma alone" decoder for the zipx lzma
 1983|       |	 * stream, we simply need to shuffle around some fields, prepare a new
 1984|       |	 * lzma alone header, feed it into lzma alone decoder so it will
 1985|       |	 * initialize itself properly, and then we can start feeding normal
 1986|       |	 * zipx lzma stream into the decoder.
 1987|       |	 */
 1988|       |
 1989|       |	/* Read magic1,magic2,lzma_params from the ZIPX stream. */
 1990|    423|	if(zip->entry_bytes_remaining < 9) {
  ------------------
  |  Branch (1990:5): [True: 1, False: 422]
  ------------------
 1991|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1992|      1|		    "Truncated lzma data");
 1993|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1994|      1|	}
 1995|       |
 1996|    422|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (1996:6): [True: 0, False: 422]
  |  Branch (1996:25): [True: 0, False: 422]
  ------------------
 1997|      0|		const void *decrypted;
 1998|      0|		size_t out_len;
 1999|      0|		size_t consumed;
 2000|      0|		int ret;
 2001|       |
 2002|      0|		ret = zipx_read_header_and_decrypt(a, &decrypted, 9, &out_len, &consumed);
 2003|      0|		if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2003:7): [True: 0, False: 0]
  ------------------
 2004|      0|			return ret;
 2005|      0|		p = decrypted;
 2006|    422|	} else {
 2007|    422|		p = __archive_read_ahead(a, 9, NULL);
 2008|    422|		if (p == NULL) {
  ------------------
  |  Branch (2008:7): [True: 0, False: 422]
  ------------------
 2009|      0|			archive_set_error(&a->archive,
 2010|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2011|      0|			    "Truncated lzma data");
 2012|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2013|      0|		}
 2014|    422|	}
 2015|       |
 2016|    422|	if(p[2] != 0x05 || p[3] != 0x00) {
  ------------------
  |  Branch (2016:5): [True: 1, False: 421]
  |  Branch (2016:21): [True: 0, False: 421]
  ------------------
 2017|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2018|      1|		    "Invalid lzma data");
 2019|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2020|      1|	}
 2021|       |
 2022|       |	/* Prepare an lzma alone header: copy the lzma_params blob into
 2023|       |	 * a proper place into the lzma alone header. */
 2024|    421|	memcpy(&alone_header.bytes[0], p + 4, 5);
 2025|       |
 2026|       |	/* Initialize the 'uncompressed size' field to unknown; we'll manually
 2027|       |	 * monitor how many bytes there are still to be uncompressed. */
 2028|    421|	alone_header.uncompressed_size = UINT64_MAX;
 2029|       |
 2030|    421|	if(!zip->uncompressed_buffer) {
  ------------------
  |  Branch (2030:5): [True: 15, False: 406]
  ------------------
 2031|     15|		zip->uncompressed_buffer_size = 256 * 1024;
 2032|     15|		zip->uncompressed_buffer = malloc(zip->uncompressed_buffer_size);
 2033|       |
 2034|     15|		if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (2034:7): [True: 0, False: 15]
  ------------------
 2035|      0|			archive_set_error(&a->archive, ENOMEM,
 2036|      0|			    "No memory for lzma decompression");
 2037|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2038|      0|		}
 2039|     15|	}
 2040|       |
 2041|    421|	zip->zipx_lzma_stream.next_in = (void*) &alone_header;
 2042|    421|	zip->zipx_lzma_stream.avail_in = sizeof(alone_header);
 2043|    421|	zip->zipx_lzma_stream.total_in = 0;
 2044|    421|	zip->zipx_lzma_stream.next_out = zip->uncompressed_buffer;
 2045|    421|	zip->zipx_lzma_stream.avail_out = zip->uncompressed_buffer_size;
 2046|    421|	zip->zipx_lzma_stream.total_out = 0;
 2047|       |
 2048|       |	/* Feed only the header into the lzma alone decoder. This will
 2049|       |	 * effectively initialize the decoder, and will not produce any
 2050|       |	 * output bytes yet. */
 2051|    421|	r = lzma_code(&zip->zipx_lzma_stream, LZMA_RUN);
 2052|    421|	if (r != LZMA_OK) {
  ------------------
  |  Branch (2052:6): [True: 0, False: 421]
  ------------------
 2053|      0|		if (r == LZMA_MEMLIMIT_ERROR)
  ------------------
  |  Branch (2053:7): [True: 0, False: 0]
  ------------------
 2054|      0|			archive_set_error(&a->archive, ENOMEM,
 2055|      0|			    "lzma stream requires too much memory");
 2056|      0|		else
 2057|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 2058|      0|			    "lzma stream initialization error");
 2059|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2060|      0|	}
 2061|       |
 2062|       |	/* We've already consumed some bytes, so take this into account. */
 2063|    421|	__archive_read_consume(a, 9);
 2064|    421|	zip->entry_bytes_remaining -= 9;
 2065|    421|	zip->entry_compressed_bytes_read += 9;
 2066|       |
 2067|    421|	zip->decompress_init = 1;
 2068|    421|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    421|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2069|    421|}
archive_read_support_format_zip.c:compression_name:
  624|  40.1k|{
  625|  40.1k|	static const int num_compression_methods =
  626|  40.1k|		sizeof(compression_methods)/sizeof(compression_methods[0]);
  627|  40.1k|	int i=0;
  628|       |
  629|   727k|	while(compression >= 0 && i < num_compression_methods) {
  ------------------
  |  Branch (629:8): [True: 727k, False: 0]
  |  Branch (629:28): [True: 724k, False: 2.40k]
  ------------------
  630|   724k|		if (compression_methods[i].id == compression)
  ------------------
  |  Branch (630:7): [True: 37.6k, False: 687k]
  ------------------
  631|  37.6k|			return compression_methods[i].name;
  632|   687k|		i++;
  633|   687k|	}
  634|  2.40k|	return "??";
  635|  40.1k|}
archive_read_support_format_zip.c:archive_read_format_zip_read_data:
 3298|  40.5k|{
 3299|  40.5k|	int r;
 3300|  40.5k|	struct zip *zip = (struct zip *)(a->format->data);
 3301|       |
 3302|  40.5k|	if (zip->has_encrypted_entries ==
  ------------------
  |  Branch (3302:6): [True: 0, False: 40.5k]
  ------------------
 3303|  40.5k|			ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|  40.5k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 3304|      0|		zip->has_encrypted_entries = 0;
 3305|      0|	}
 3306|       |
 3307|  40.5k|	*offset = zip->entry_uncompressed_bytes_read;
 3308|  40.5k|	*size = 0;
 3309|  40.5k|	*buff = NULL;
 3310|       |
 3311|       |	/* If we hit end-of-entry last time, return ARCHIVE_EOF. */
 3312|  40.5k|	if (zip->end_of_entry)
  ------------------
  |  Branch (3312:6): [True: 4.24k, False: 36.2k]
  ------------------
 3313|  4.24k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  4.24k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3314|       |
 3315|       |	/* Return EOF immediately if this is a non-regular file. */
 3316|  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 (3316:6): [True: 2.11k, False: 34.1k]
  ------------------
 3317|  2.11k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  2.11k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3318|       |
 3319|  34.1k|	__archive_read_consume(a, zip->unconsumed);
 3320|  34.1k|	zip->unconsumed = 0;
 3321|       |
 3322|  34.1k|	if (zip->init_decryption) {
  ------------------
  |  Branch (3322:6): [True: 6.82k, False: 27.3k]
  ------------------
 3323|  6.82k|		zip->has_encrypted_entries = 1;
 3324|  6.82k|		if (zip->entry->zip_flags & ZIP_STRONG_ENCRYPTED)
  ------------------
  |  |  129|  6.82k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
  |  Branch (3324:7): [True: 1.34k, False: 5.48k]
  ------------------
 3325|  1.34k|			r = read_decryption_header(a);
 3326|  5.48k|		else if (zip->entry->compression == WINZIP_AES_ENCRYPTION)
  ------------------
  |  |  144|  5.48k|#define WINZIP_AES_ENCRYPTION	99
  ------------------
  |  Branch (3326:12): [True: 3.38k, False: 2.09k]
  ------------------
 3327|  3.38k|			r = init_WinZip_AES_decryption(a);
 3328|  2.09k|		else
 3329|  2.09k|			r = init_traditional_PKWARE_decryption(a);
 3330|  6.82k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  6.82k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3330:7): [True: 3.47k, False: 3.35k]
  ------------------
 3331|  3.47k|			return (r);
 3332|  3.35k|		zip->init_decryption = 0;
 3333|  3.35k|	}
 3334|       |
 3335|  30.6k|	switch(zip->entry->compression) {
 3336|  6.81k|	case 0:  /* No compression. */
  ------------------
  |  Branch (3336:2): [True: 6.81k, False: 23.8k]
  ------------------
 3337|  6.81k|		r =  zip_read_data_none(a, buff, size, offset);
 3338|  6.81k|		break;
 3339|      0|#ifdef HAVE_BZLIB_H
 3340|      0|	case 12: /* ZIPx bzip2 compression. */
  ------------------
  |  Branch (3340:2): [True: 0, False: 30.6k]
  ------------------
 3341|      0|		r = zip_read_data_zipx_bzip2(a, buff, size, offset);
 3342|      0|		break;
 3343|      0|#endif
 3344|      0|#if HAVE_LZMA_H && HAVE_LIBLZMA
 3345|    486|	case 14: /* ZIPx LZMA compression. */
  ------------------
  |  Branch (3345:2): [True: 486, False: 30.2k]
  ------------------
 3346|    486|		r = zip_read_data_zipx_lzma_alone(a, buff, size, offset);
 3347|    486|		break;
 3348|      0|	case 95: /* ZIPx XZ compression. */
  ------------------
  |  Branch (3348:2): [True: 0, False: 30.6k]
  ------------------
 3349|      0|		r = zip_read_data_zipx_xz(a, buff, size, offset);
 3350|      0|		break;
 3351|      0|#endif
 3352|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 3353|       |	case 93: /* ZIPx Zstd compression. */
 3354|       |		r = zip_read_data_zipx_zstd(a, buff, size, offset);
 3355|       |		break;
 3356|       |#endif
 3357|       |	/* PPMd support is built-in, so we don't need any #if guards. */
 3358|  14.5k|	case 98: /* ZIPx PPMd compression. */
  ------------------
  |  Branch (3358:2): [True: 14.5k, False: 16.1k]
  ------------------
 3359|  14.5k|		r = zip_read_data_zipx_ppmd(a, buff, size, offset);
 3360|  14.5k|		break;
 3361|       |
 3362|      0|#ifdef HAVE_ZLIB_H
 3363|  4.12k|	case 8: /* Deflate compression. */
  ------------------
  |  Branch (3363:2): [True: 4.12k, False: 26.5k]
  ------------------
 3364|  4.12k|		r =  zip_read_data_deflate(a, buff, size, offset);
 3365|  4.12k|		break;
 3366|      0|#endif
 3367|  4.74k|	default: /* Unsupported compression. */
  ------------------
  |  Branch (3367:2): [True: 4.74k, False: 25.9k]
  ------------------
 3368|       |		/* Return a warning. */
 3369|  4.74k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  4.74k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3370|  4.74k|		    "Unsupported ZIP compression method (%d: %s)",
 3371|  4.74k|		    zip->entry->compression, compression_name(zip->entry->compression));
 3372|       |		/* We can't decompress this entry, but we will
 3373|       |		 * be able to skip() it and try the next entry. */
 3374|  4.74k|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  4.74k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3375|  30.6k|	}
 3376|  25.9k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  25.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3376:6): [True: 4.86k, False: 21.0k]
  ------------------
 3377|  4.86k|		return (r);
 3378|  21.0k|	if (*size > 0) {
  ------------------
  |  Branch (3378:6): [True: 15.8k, False: 5.28k]
  ------------------
 3379|  15.8k|		zip->computed_crc32 = zip->crc32func(zip->computed_crc32, *buff,
 3380|  15.8k|						     (unsigned)*size);
 3381|  15.8k|	}
 3382|       |	/* If we hit the end, swallow any end-of-data marker and
 3383|       |	 * verify the final check values. */
 3384|  21.0k|	if (zip->end_of_entry) {
  ------------------
  |  Branch (3384:6): [True: 17.6k, False: 3.43k]
  ------------------
 3385|  17.6k|		consume_end_of_file_marker(a, zip);
 3386|       |
 3387|       |		/* Check computed CRC against header */
 3388|  17.6k|		if ((!zip->hctx_valid ||
  ------------------
  |  Branch (3388:8): [True: 16.2k, False: 1.35k]
  ------------------
 3389|  1.35k|		      zip->entry->aes_extra.vendor != AES_VENDOR_AE_2) &&
  ------------------
  |  |  113|  1.35k|#define AES_VENDOR_AE_2	0x0002
  ------------------
  |  Branch (3389:9): [True: 1.29k, False: 64]
  ------------------
 3390|  17.5k|		   zip->entry->crc32 != zip->computed_crc32
  ------------------
  |  Branch (3390:6): [True: 16.4k, False: 1.17k]
  ------------------
 3391|  16.4k|		    && !zip->ignore_crc32) {
  ------------------
  |  Branch (3391:10): [True: 0, False: 16.4k]
  ------------------
 3392|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3393|      0|			    "ZIP bad CRC: 0x%lx should be 0x%lx",
 3394|      0|			    (unsigned long)zip->computed_crc32,
 3395|      0|			    (unsigned long)zip->entry->crc32);
 3396|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3397|      0|		}
 3398|       |		/* Check file size against header. */
 3399|  17.6k|		if (zip->entry->compressed_size !=
  ------------------
  |  Branch (3399:7): [True: 13.7k, False: 3.94k]
  ------------------
 3400|  17.6k|		    zip->entry_compressed_bytes_read) {
 3401|  13.7k|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  13.7k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3402|  13.7k|			    "ZIP compressed data is wrong size "
 3403|  13.7k|			    "(read %jd, expected %jd)",
 3404|  13.7k|			    (intmax_t)zip->entry_compressed_bytes_read,
 3405|  13.7k|			    (intmax_t)zip->entry->compressed_size);
 3406|  13.7k|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  13.7k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3407|  13.7k|		}
 3408|       |		/* Size field only stores the lower 32 bits of the actual
 3409|       |		 * size. */
 3410|  3.94k|		if ((zip->entry->uncompressed_size & UINT32_MAX)
  ------------------
  |  Branch (3410:7): [True: 2.59k, False: 1.35k]
  ------------------
 3411|  3.94k|		    != (zip->entry_uncompressed_bytes_read & UINT32_MAX)) {
 3412|  2.59k|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  2.59k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3413|  2.59k|			    "ZIP uncompressed data is wrong size "
 3414|  2.59k|			    "(read %jd, expected %jd)",
 3415|  2.59k|			    (intmax_t)zip->entry_uncompressed_bytes_read,
 3416|  2.59k|			    (intmax_t)zip->entry->uncompressed_size);
 3417|  2.59k|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  2.59k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3418|  2.59k|		}
 3419|  3.94k|	}
 3420|       |
 3421|  4.78k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.78k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3422|  21.0k|}
archive_read_support_format_zip.c:read_decryption_header:
 2919|  1.45k|{
 2920|  1.45k|	struct zip *zip = (struct zip *)(a->format->data);
 2921|  1.45k|	const char *p;
 2922|  1.45k|	unsigned int remaining_size;
 2923|  1.45k|	unsigned int ts;
 2924|       |
 2925|       |	/*
 2926|       |	 * Read an initialization vector data field.
 2927|       |	 */
 2928|  1.45k|	p = __archive_read_ahead(a, 2, NULL);
 2929|  1.45k|	if (p == NULL)
  ------------------
  |  Branch (2929:6): [True: 0, False: 1.45k]
  ------------------
 2930|      0|		goto truncated;
 2931|  1.45k|	ts = zip->iv_size;
 2932|  1.45k|	zip->iv_size = archive_le16dec(p);
 2933|  1.45k|	__archive_read_consume(a, 2);
 2934|  1.45k|	if (ts < zip->iv_size) {
  ------------------
  |  Branch (2934:6): [True: 152, False: 1.29k]
  ------------------
 2935|    152|		free(zip->iv);
 2936|    152|		zip->iv = NULL;
 2937|    152|	}
 2938|  1.45k|	p = __archive_read_ahead(a, zip->iv_size, NULL);
 2939|  1.45k|	if (p == NULL)
  ------------------
  |  Branch (2939:6): [True: 0, False: 1.45k]
  ------------------
 2940|      0|		goto truncated;
 2941|  1.45k|	if (zip->iv == NULL) {
  ------------------
  |  Branch (2941:6): [True: 155, False: 1.29k]
  ------------------
 2942|    155|		zip->iv = malloc(zip->iv_size);
 2943|    155|		if (zip->iv == NULL)
  ------------------
  |  Branch (2943:7): [True: 0, False: 155]
  ------------------
 2944|      0|			goto nomem;
 2945|    155|	}
 2946|  1.45k|	memcpy(zip->iv, p, zip->iv_size);
 2947|  1.45k|	__archive_read_consume(a, zip->iv_size);
 2948|       |
 2949|       |	/*
 2950|       |	 * Read a size of remaining decryption header field.
 2951|       |	 */
 2952|  1.45k|	p = __archive_read_ahead(a, 14, NULL);
 2953|  1.45k|	if (p == NULL)
  ------------------
  |  Branch (2953:6): [True: 0, False: 1.45k]
  ------------------
 2954|      0|		goto truncated;
 2955|  1.45k|	remaining_size = archive_le32dec(p);
 2956|  1.45k|	if (remaining_size < 16 || remaining_size > (1 << 18))
  ------------------
  |  Branch (2956:6): [True: 3, False: 1.44k]
  |  Branch (2956:29): [True: 5, False: 1.44k]
  ------------------
 2957|      8|		goto corrupted;
 2958|       |
 2959|       |	/* Check if format version is supported. */
 2960|  1.44k|	if (archive_le16dec(p+4) != 3) {
  ------------------
  |  Branch (2960:6): [True: 207, False: 1.23k]
  ------------------
 2961|    207|		archive_set_error(&a->archive,
 2962|    207|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    207|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2963|    207|		    "Unsupported encryption format version: %u",
 2964|    207|		    archive_le16dec(p+4));
 2965|    207|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|    207|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2966|    207|	}
 2967|       |
 2968|       |	/*
 2969|       |	 * Read an encryption algorithm field.
 2970|       |	 */
 2971|  1.23k|	zip->alg_id = archive_le16dec(p+6);
 2972|  1.23k|	switch (zip->alg_id) {
 2973|     52|	case 0x6601:/* DES */
  ------------------
  |  Branch (2973:2): [True: 52, False: 1.18k]
  ------------------
 2974|    239|	case 0x6602:/* RC2 */
  ------------------
  |  Branch (2974:2): [True: 187, False: 1.04k]
  ------------------
 2975|    423|	case 0x6603:/* 3DES 168 */
  ------------------
  |  Branch (2975:2): [True: 184, False: 1.05k]
  ------------------
 2976|    498|	case 0x6609:/* 3DES 112 */
  ------------------
  |  Branch (2976:2): [True: 75, False: 1.16k]
  ------------------
 2977|    514|	case 0x660E:/* AES 128 */
  ------------------
  |  Branch (2977:2): [True: 16, False: 1.22k]
  ------------------
 2978|    580|	case 0x660F:/* AES 192 */
  ------------------
  |  Branch (2978:2): [True: 66, False: 1.17k]
  ------------------
 2979|    639|	case 0x6610:/* AES 256 */
  ------------------
  |  Branch (2979:2): [True: 59, False: 1.17k]
  ------------------
 2980|    657|	case 0x6702:/* RC2 (version >= 5.2) */
  ------------------
  |  Branch (2980:2): [True: 18, False: 1.21k]
  ------------------
 2981|    862|	case 0x6720:/* Blowfish */
  ------------------
  |  Branch (2981:2): [True: 205, False: 1.03k]
  ------------------
 2982|    920|	case 0x6721:/* Twofish */
  ------------------
  |  Branch (2982:2): [True: 58, False: 1.17k]
  ------------------
 2983|  1.18k|	case 0x6801:/* RC4 */
  ------------------
  |  Branch (2983:2): [True: 260, False: 976]
  ------------------
 2984|       |		/* Supported encryption algorithm. */
 2985|  1.18k|		break;
 2986|     56|	default:
  ------------------
  |  Branch (2986:2): [True: 56, False: 1.18k]
  ------------------
 2987|     56|		archive_set_error(&a->archive,
 2988|     56|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     56|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2989|     56|		    "Unknown encryption algorithm: %u", zip->alg_id);
 2990|     56|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     56|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2991|  1.23k|	}
 2992|       |
 2993|       |	/*
 2994|       |	 * Read a bit length field.
 2995|       |	 */
 2996|  1.18k|	zip->bit_len = archive_le16dec(p+8);
 2997|       |
 2998|       |	/*
 2999|       |	 * Read a flags field.
 3000|       |	 */
 3001|  1.18k|	zip->flags = archive_le16dec(p+10);
 3002|  1.18k|	switch (zip->flags & 0xf000) {
 3003|      0|	case 0x0001: /* Password is required to decrypt. */
  ------------------
  |  Branch (3003:2): [True: 0, False: 1.18k]
  ------------------
 3004|      0|	case 0x0002: /* Certificates only. */
  ------------------
  |  Branch (3004:2): [True: 0, False: 1.18k]
  ------------------
 3005|      0|	case 0x0003: /* Password or certificate required to decrypt. */
  ------------------
  |  Branch (3005:2): [True: 0, False: 1.18k]
  ------------------
 3006|      0|		break;
 3007|  1.18k|	default:
  ------------------
  |  Branch (3007:2): [True: 1.18k, False: 0]
  ------------------
 3008|  1.18k|		archive_set_error(&a->archive,
 3009|  1.18k|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.18k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3010|  1.18k|		    "Unknown encryption flag: %u", zip->flags);
 3011|  1.18k|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  1.18k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3012|  1.18k|	}
 3013|      0|	if ((zip->flags & 0xf000) == 0 ||
  ------------------
  |  Branch (3013:6): [True: 0, False: 0]
  ------------------
 3014|      0|	    (zip->flags & 0xf000) == 0x4000) {
  ------------------
  |  Branch (3014:6): [True: 0, False: 0]
  ------------------
 3015|      0|		archive_set_error(&a->archive,
 3016|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3017|      0|		    "Unknown encryption flag: %u", zip->flags);
 3018|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3019|      0|	}
 3020|       |
 3021|       |	/*
 3022|       |	 * Read an encrypted random data field.
 3023|       |	 */
 3024|      0|	ts = zip->erd_size;
 3025|      0|	zip->erd_size = archive_le16dec(p+12);
 3026|      0|	__archive_read_consume(a, 14);
 3027|      0|	if ((zip->erd_size & 0xf) != 0 ||
  ------------------
  |  Branch (3027:6): [True: 0, False: 0]
  ------------------
 3028|      0|	    (zip->erd_size + 16) > remaining_size ||
  ------------------
  |  Branch (3028:6): [True: 0, False: 0]
  ------------------
 3029|      0|	    (zip->erd_size + 16) < zip->erd_size)
  ------------------
  |  Branch (3029:6): [True: 0, False: 0]
  ------------------
 3030|      0|		goto corrupted;
 3031|       |
 3032|      0|	if (ts < zip->erd_size) {
  ------------------
  |  Branch (3032:6): [True: 0, False: 0]
  ------------------
 3033|      0|		free(zip->erd);
 3034|      0|		zip->erd = NULL;
 3035|      0|	}
 3036|      0|	p = __archive_read_ahead(a, zip->erd_size, NULL);
 3037|      0|	if (p == NULL)
  ------------------
  |  Branch (3037:6): [True: 0, False: 0]
  ------------------
 3038|      0|		goto truncated;
 3039|      0|	if (zip->erd == NULL) {
  ------------------
  |  Branch (3039:6): [True: 0, False: 0]
  ------------------
 3040|      0|		zip->erd = malloc(zip->erd_size);
 3041|      0|		if (zip->erd == NULL)
  ------------------
  |  Branch (3041:7): [True: 0, False: 0]
  ------------------
 3042|      0|			goto nomem;
 3043|      0|	}
 3044|      0|	memcpy(zip->erd, p, zip->erd_size);
 3045|      0|	__archive_read_consume(a, zip->erd_size);
 3046|       |
 3047|       |	/*
 3048|       |	 * Read a reserved data field.
 3049|       |	 */
 3050|      0|	p = __archive_read_ahead(a, 4, NULL);
 3051|      0|	if (p == NULL)
  ------------------
  |  Branch (3051:6): [True: 0, False: 0]
  ------------------
 3052|      0|		goto truncated;
 3053|       |	/* Reserved data size should be zero. */
 3054|      0|	if (archive_le32dec(p) != 0)
  ------------------
  |  Branch (3054:6): [True: 0, False: 0]
  ------------------
 3055|      0|		goto corrupted;
 3056|      0|	__archive_read_consume(a, 4);
 3057|       |
 3058|       |	/*
 3059|       |	 * Read a password validation data field.
 3060|       |	 */
 3061|      0|	p = __archive_read_ahead(a, 2, NULL);
 3062|      0|	if (p == NULL)
  ------------------
  |  Branch (3062:6): [True: 0, False: 0]
  ------------------
 3063|      0|		goto truncated;
 3064|      0|	ts = zip->v_size;
 3065|      0|	zip->v_size = archive_le16dec(p);
 3066|      0|	__archive_read_consume(a, 2);
 3067|      0|	if ((zip->v_size & 0x0f) != 0 ||
  ------------------
  |  Branch (3067:6): [True: 0, False: 0]
  ------------------
 3068|      0|	    (zip->erd_size + zip->v_size + 16) > remaining_size ||
  ------------------
  |  Branch (3068:6): [True: 0, False: 0]
  ------------------
 3069|      0|	    (zip->erd_size + zip->v_size + 16) < (zip->erd_size + zip->v_size))
  ------------------
  |  Branch (3069:6): [True: 0, False: 0]
  ------------------
 3070|      0|		goto corrupted;
 3071|      0|	if (ts < zip->v_size) {
  ------------------
  |  Branch (3071:6): [True: 0, False: 0]
  ------------------
 3072|      0|		free(zip->v_data);
 3073|      0|		zip->v_data = NULL;
 3074|      0|	}
 3075|      0|	p = __archive_read_ahead(a, zip->v_size, NULL);
 3076|      0|	if (p == NULL)
  ------------------
  |  Branch (3076:6): [True: 0, False: 0]
  ------------------
 3077|      0|		goto truncated;
 3078|      0|	if (zip->v_data == NULL) {
  ------------------
  |  Branch (3078:6): [True: 0, False: 0]
  ------------------
 3079|      0|		zip->v_data = malloc(zip->v_size);
 3080|      0|		if (zip->v_data == NULL)
  ------------------
  |  Branch (3080:7): [True: 0, False: 0]
  ------------------
 3081|      0|			goto nomem;
 3082|      0|	}
 3083|      0|	memcpy(zip->v_data, p, zip->v_size);
 3084|      0|	__archive_read_consume(a, zip->v_size);
 3085|       |
 3086|      0|	p = __archive_read_ahead(a, 4, NULL);
 3087|      0|	if (p == NULL)
  ------------------
  |  Branch (3087:6): [True: 0, False: 0]
  ------------------
 3088|      0|		goto truncated;
 3089|      0|	zip->v_crc32 = archive_le32dec(p);
 3090|      0|	__archive_read_consume(a, 4);
 3091|       |
 3092|       |	/*return (ARCHIVE_OK);
 3093|       |	 * This is not fully implemented yet.*/
 3094|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3095|      0|	    "Encrypted file is unsupported");
 3096|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3097|      0|truncated:
 3098|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3099|      0|	    "Truncated ZIP file data");
 3100|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3101|      8|corrupted:
 3102|      8|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      8|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3103|      8|	    "Corrupted ZIP file data");
 3104|      8|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3105|      0|nomem:
 3106|      0|	archive_set_error(&a->archive, ENOMEM,
 3107|      0|	    "No memory for ZIP decryption");
 3108|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3109|      0|}
archive_read_support_format_zip.c:init_WinZip_AES_decryption:
 3204|  3.48k|{
 3205|  3.48k|	struct zip *zip = (struct zip *)(a->format->data);
 3206|  3.48k|	const void *p;
 3207|  3.48k|	const uint8_t *pv;
 3208|  3.48k|	size_t key_len, salt_len;
 3209|  3.48k|	uint8_t derived_key[MAX_DERIVED_KEY_BUF_SIZE];
 3210|  3.48k|	int retry;
 3211|  3.48k|	int r;
 3212|       |
 3213|  3.48k|	if (zip->cctx_valid || zip->hctx_valid)
  ------------------
  |  Branch (3213:6): [True: 0, False: 3.48k]
  |  Branch (3213:25): [True: 0, False: 3.48k]
  ------------------
 3214|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3215|       |
 3216|  3.48k|	switch (zip->entry->aes_extra.strength) {
 3217|    267|	case 1: salt_len = 8;  key_len = 16; break;
  ------------------
  |  Branch (3217:2): [True: 267, False: 3.21k]
  ------------------
 3218|  2.90k|	case 2: salt_len = 12; key_len = 24; break;
  ------------------
  |  Branch (3218:2): [True: 2.90k, False: 578]
  ------------------
 3219|    303|	case 3: salt_len = 16; key_len = 32; break;
  ------------------
  |  Branch (3219:2): [True: 303, False: 3.18k]
  ------------------
 3220|      8|	default: goto corrupted;
  ------------------
  |  Branch (3220:2): [True: 8, False: 3.47k]
  ------------------
 3221|  3.48k|	}
 3222|  3.47k|	p = __archive_read_ahead(a, salt_len + 2, NULL);
 3223|  3.47k|	if (p == NULL)
  ------------------
  |  Branch (3223:6): [True: 0, False: 3.47k]
  ------------------
 3224|      0|		goto truncated;
 3225|       |
 3226|  3.88k|	for (retry = 0;; retry++) {
 3227|  3.88k|		const char *passphrase;
 3228|       |
 3229|  3.88k|		passphrase = __archive_read_next_passphrase(a);
 3230|  3.88k|		if (passphrase == NULL) {
  ------------------
  |  Branch (3230:7): [True: 511, False: 3.37k]
  ------------------
 3231|    511|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    511|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3232|    511|			    (retry > 0)?
  ------------------
  |  Branch (3232:8): [True: 413, False: 98]
  ------------------
 3233|    413|				"Incorrect passphrase":
 3234|    511|				"Passphrase required for this entry");
 3235|    511|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|    511|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3236|    511|		}
 3237|  3.37k|		memset(derived_key, 0, sizeof(derived_key));
 3238|  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)
  ------------------
 3239|  3.37k|		    p, salt_len, 1000, derived_key, key_len * 2 + 2);
 3240|  3.37k|		if (r != 0) {
  ------------------
  |  Branch (3240:7): [True: 0, False: 3.37k]
  ------------------
 3241|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3242|      0|			    r == CRYPTOR_STUB_FUNCTION ? "Decryption is unsupported due "
  ------------------
  |  |  176|      0|#define CRYPTOR_STUB_FUNCTION	-2
  ------------------
  |  Branch (3242:8): [True: 0, False: 0]
  ------------------
 3243|      0|				"to lack of crypto library" : "Failed to process passphrase");
 3244|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3245|      0|		}
 3246|       |
 3247|       |		/* Check password verification value. */
 3248|  3.37k|		pv = ((const uint8_t *)p) + salt_len;
 3249|  3.37k|		if (derived_key[key_len * 2] == pv[0] &&
  ------------------
  |  Branch (3249:7): [True: 3.22k, False: 156]
  ------------------
 3250|  3.22k|		    derived_key[key_len * 2 + 1] == pv[1])
  ------------------
  |  Branch (3250:7): [True: 2.96k, False: 257]
  ------------------
 3251|  2.96k|			break;/* The passphrase is OK. */
 3252|    413|		if (retry > 10000) {
  ------------------
  |  Branch (3252:7): [True: 0, False: 413]
  ------------------
 3253|       |			/* Avoid infinity loop. */
 3254|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3255|      0|			    "Too many incorrect passphrases");
 3256|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3257|      0|		}
 3258|    413|	}
 3259|       |
 3260|  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)
  ------------------
 3261|  2.96k|	if (r != 0) {
  ------------------
  |  Branch (3261:6): [True: 0, False: 2.96k]
  ------------------
 3262|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3263|      0|		    "Decryption is unsupported due to lack of crypto library");
 3264|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3265|      0|	}
 3266|  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)
  ------------------
 3267|  2.96k|	if (r != 0) {
  ------------------
  |  Branch (3267:6): [True: 0, False: 2.96k]
  ------------------
 3268|      0|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  166|      0|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 3269|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3270|      0|		    "Failed to initialize HMAC-SHA1");
 3271|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3272|      0|	}
 3273|  2.96k|	zip->cctx_valid = zip->hctx_valid = 1;
 3274|  2.96k|	__archive_read_consume(a, salt_len + 2);
 3275|  2.96k|	zip->entry_bytes_remaining -= salt_len + 2 + AUTH_CODE_SIZE;
  ------------------
  |  |  146|  2.96k|#define AUTH_CODE_SIZE	10
  ------------------
 3276|  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 (3276:6): [True: 310, False: 2.65k]
  ------------------
 3277|    310|	    && zip->entry_bytes_remaining < 0)
  ------------------
  |  Branch (3277:9): [True: 0, False: 310]
  ------------------
 3278|      0|		goto corrupted;
 3279|  2.96k|	zip->entry_compressed_bytes_read += salt_len + 2 + AUTH_CODE_SIZE;
  ------------------
  |  |  146|  2.96k|#define AUTH_CODE_SIZE	10
  ------------------
 3280|  2.96k|	zip->decrypted_bytes_remaining = 0;
 3281|       |
 3282|  2.96k|	zip->entry->compression = zip->entry->aes_extra.compression;
 3283|  2.96k|	return (zip_alloc_decryption_buffer(a));
 3284|       |
 3285|      0|truncated:
 3286|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3287|      0|	    "Truncated ZIP file data");
 3288|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3289|      8|corrupted:
 3290|      8|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      8|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3291|      8|	    "Corrupted ZIP file data");
 3292|      8|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3293|  2.96k|}
archive_read_support_format_zip.c:zip_alloc_decryption_buffer:
 3113|  4.12k|{
 3114|  4.12k|	struct zip *zip = (struct zip *)(a->format->data);
 3115|  4.12k|	size_t bs = 256 * 1024;
 3116|       |
 3117|  4.12k|	if (zip->decrypted_buffer == NULL) {
  ------------------
  |  Branch (3117:6): [True: 97, False: 4.03k]
  ------------------
 3118|     97|		zip->decrypted_buffer_size = bs;
 3119|     97|		zip->decrypted_buffer = malloc(bs);
 3120|     97|		if (zip->decrypted_buffer == NULL) {
  ------------------
  |  Branch (3120:7): [True: 0, False: 97]
  ------------------
 3121|      0|			archive_set_error(&a->archive, ENOMEM,
 3122|      0|			    "No memory for ZIP decryption");
 3123|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3124|      0|		}
 3125|     97|	}
 3126|  4.12k|	zip->decrypted_ptr = zip->decrypted_buffer;
 3127|  4.12k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.12k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3128|  4.12k|}
archive_read_support_format_zip.c:init_traditional_PKWARE_decryption:
 3132|  4.23k|{
 3133|  4.23k|	struct zip *zip = (struct zip *)(a->format->data);
 3134|  4.23k|	const void *p;
 3135|  4.23k|	int retry;
 3136|  4.23k|	int r;
 3137|       |
 3138|  4.23k|	if (zip->tctx_valid)
  ------------------
  |  Branch (3138:6): [True: 0, False: 4.23k]
  ------------------
 3139|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3140|       |
 3141|       |	/*
 3142|       |	   Read the 12 bytes encryption header stored at
 3143|       |	   the start of the data area.
 3144|       |	 */
 3145|  4.23k|#define ENC_HEADER_SIZE	12
 3146|  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 (3146:6): [True: 617, False: 3.61k]
  ------------------
 3147|    617|	    && zip->entry_bytes_remaining < ENC_HEADER_SIZE) {
  ------------------
  |  | 3145|    617|#define ENC_HEADER_SIZE	12
  ------------------
  |  Branch (3147:9): [True: 0, False: 617]
  ------------------
 3148|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3149|      0|		    "Truncated Zip encrypted body: only %jd bytes available",
 3150|      0|		    (intmax_t)zip->entry_bytes_remaining);
 3151|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3152|      0|	}
 3153|       |
 3154|  4.23k|	p = __archive_read_ahead(a, ENC_HEADER_SIZE, NULL);
  ------------------
  |  | 3145|  4.23k|#define ENC_HEADER_SIZE	12
  ------------------
 3155|  4.23k|	if (p == NULL) {
  ------------------
  |  Branch (3155:6): [True: 1, False: 4.23k]
  ------------------
 3156|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3157|      1|		    "Truncated ZIP file data");
 3158|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3159|      1|	}
 3160|       |
 3161|  6.00k|	for (retry = 0;; retry++) {
 3162|  6.00k|		const char *passphrase;
 3163|  6.00k|		uint8_t crcchk;
 3164|       |
 3165|  6.00k|		passphrase = __archive_read_next_passphrase(a);
 3166|  6.00k|		if (passphrase == NULL) {
  ------------------
  |  Branch (3166:7): [True: 3.06k, False: 2.93k]
  ------------------
 3167|  3.06k|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  3.06k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3168|  3.06k|			    (retry > 0)?
  ------------------
  |  Branch (3168:8): [True: 1.77k, False: 1.29k]
  ------------------
 3169|  1.77k|				"Incorrect passphrase":
 3170|  3.06k|				"Passphrase required for this entry");
 3171|  3.06k|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  3.06k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3172|  3.06k|		}
 3173|       |
 3174|       |		/*
 3175|       |		 * Initialize ctx for Traditional PKWARE Decryption.
 3176|       |		 */
 3177|  2.93k|		r = trad_enc_init(&zip->tctx, passphrase, strlen(passphrase),
 3178|  2.93k|			p, ENC_HEADER_SIZE, &crcchk);
  ------------------
  |  | 3145|  2.93k|#define ENC_HEADER_SIZE	12
  ------------------
 3179|  2.93k|		if (r == 0 && crcchk == zip->entry->decdat)
  ------------------
  |  Branch (3179:7): [True: 2.93k, False: 0]
  |  Branch (3179:17): [True: 1.16k, False: 1.77k]
  ------------------
 3180|  1.16k|			break;/* The passphrase is OK. */
 3181|  1.77k|		if (retry > 10000) {
  ------------------
  |  Branch (3181:7): [True: 0, False: 1.77k]
  ------------------
 3182|       |			/* Avoid infinity loop. */
 3183|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3184|      0|			    "Too many incorrect passphrases");
 3185|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3186|      0|		}
 3187|  1.77k|	}
 3188|       |
 3189|  1.16k|	__archive_read_consume(a, ENC_HEADER_SIZE);
  ------------------
  |  | 3145|  1.16k|#define ENC_HEADER_SIZE	12
  ------------------
 3190|  1.16k|	zip->tctx_valid = 1;
 3191|  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 (3191:6): [True: 386, False: 777]
  ------------------
 3192|    386|	    zip->entry_bytes_remaining -= ENC_HEADER_SIZE;
  ------------------
  |  | 3145|    386|#define ENC_HEADER_SIZE	12
  ------------------
 3193|    386|	}
 3194|       |	/*zip->entry_uncompressed_bytes_read += ENC_HEADER_SIZE;*/
 3195|  1.16k|	zip->entry_compressed_bytes_read += ENC_HEADER_SIZE;
  ------------------
  |  | 3145|  1.16k|#define ENC_HEADER_SIZE	12
  ------------------
 3196|  1.16k|	zip->decrypted_bytes_remaining = 0;
 3197|       |
 3198|  1.16k|	return (zip_alloc_decryption_buffer(a));
 3199|  4.23k|#undef ENC_HEADER_SIZE
 3200|  4.23k|}
archive_read_support_format_zip.c:trad_enc_init:
  368|  2.93k|{
  369|  2.93k|	uint8_t header[12];
  370|       |
  371|  2.93k|	if (key_len < 12) {
  ------------------
  |  Branch (371:6): [True: 0, False: 2.93k]
  ------------------
  372|      0|		*crcchk = 0xff;
  373|      0|		return -1;
  374|      0|	}
  375|       |
  376|  2.93k|	ctx->keys[0] = 305419896L;
  377|  2.93k|	ctx->keys[1] = 591751049L;
  378|  2.93k|	ctx->keys[2] = 878082192L;
  379|       |
  380|  20.5k|	for (;pw_len; --pw_len)
  ------------------
  |  Branch (380:8): [True: 17.6k, False: 2.93k]
  ------------------
  381|  17.6k|		trad_enc_update_keys(ctx, *pw++);
  382|       |
  383|  2.93k|	trad_enc_decrypt_update(ctx, key, 12, header, 12);
  384|       |	/* Return the last byte for CRC check. */
  385|  2.93k|	*crcchk = header[11];
  386|  2.93k|	return 0;
  387|  2.93k|}
archive_read_support_format_zip.c:zip_read_data_none:
 1763|  6.81k|{
 1764|  6.81k|	struct zip *zip;
 1765|  6.81k|	const char *buff;
 1766|  6.81k|	ssize_t bytes_avail;
 1767|  6.81k|	ssize_t trailing_extra;
 1768|  6.81k|	int r;
 1769|       |
 1770|  6.81k|	(void)offset; /* UNUSED */
 1771|       |
 1772|  6.81k|	zip = (struct zip *)(a->format->data);
 1773|  6.81k|	trailing_extra = zip->hctx_valid ? AUTH_CODE_SIZE : 0;
  ------------------
  |  |  146|  1.45k|#define AUTH_CODE_SIZE	10
  ------------------
  |  Branch (1773:19): [True: 1.45k, False: 5.36k]
  ------------------
 1774|       |
 1775|  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 (1775:6): [True: 3.63k, False: 3.18k]
  ------------------
 1776|  3.63k|		const char *p;
 1777|  3.63k|		ssize_t grabbing_bytes = 24 + trailing_extra;
 1778|       |
 1779|       |		/* Grab at least 24 bytes. */
 1780|  3.63k|		buff = __archive_read_ahead(a, grabbing_bytes, &bytes_avail);
 1781|  3.63k|		if (bytes_avail < grabbing_bytes) {
  ------------------
  |  Branch (1781:7): [True: 17, False: 3.61k]
  ------------------
 1782|       |			/* Zip archives have end-of-archive markers
 1783|       |			   that are longer than this, so a failure to get at
 1784|       |			   least 24 bytes really does indicate a truncated
 1785|       |			   file. */
 1786|     17|			archive_set_error(&a->archive,
 1787|     17|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     17|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1788|     17|			    "Truncated ZIP file data");
 1789|     17|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     17|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1790|     17|		}
 1791|       |		/* Check for a complete PK\007\010 signature, followed
 1792|       |		 * by the correct 4-byte CRC. */
 1793|  3.61k|		p = buff + trailing_extra;
 1794|  3.61k|		if (p[0] == 'P' && p[1] == 'K'
  ------------------
  |  Branch (1794:7): [True: 2.56k, False: 1.05k]
  |  Branch (1794:22): [True: 2.36k, False: 200]
  ------------------
 1795|  2.36k|		    && p[2] == '\007' && p[3] == '\010'
  ------------------
  |  Branch (1795:10): [True: 2.08k, False: 275]
  |  Branch (1795:28): [True: 2.05k, False: 35]
  ------------------
 1796|  2.05k|		    && (archive_le32dec(p + 4) == zip->computed_crc32
  ------------------
  |  Branch (1796:11): [True: 153, False: 1.89k]
  ------------------
 1797|  1.89k|			|| zip->ignore_crc32
  ------------------
  |  Branch (1797:7): [True: 1.89k, False: 0]
  ------------------
 1798|      0|			|| (zip->hctx_valid
  ------------------
  |  Branch (1798:8): [True: 0, False: 0]
  ------------------
 1799|  2.05k|			 && zip->entry->aes_extra.vendor == AES_VENDOR_AE_2))) {
  ------------------
  |  |  113|      0|#define AES_VENDOR_AE_2	0x0002
  ------------------
  |  Branch (1799:8): [True: 0, False: 0]
  ------------------
 1800|  2.05k|			zip->end_of_entry = 1;
 1801|  2.05k|			if (zip->hctx_valid) {
  ------------------
  |  Branch (1801:8): [True: 531, False: 1.52k]
  ------------------
 1802|    531|				r = check_authentication_code(a, buff);
 1803|    531|				if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    531|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1803:9): [True: 531, False: 0]
  ------------------
 1804|    531|					return (r);
 1805|    531|			}
 1806|  1.52k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.52k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1807|  2.05k|		}
 1808|       |		/* If not at EOF, ensure we consume at least one byte. */
 1809|  1.56k|		++p;
 1810|       |
 1811|       |		/* Scan forward until we see where a PK\007\010 signature
 1812|       |		 * might be. */
 1813|       |		/* Return bytes up until that point.  On the next call,
 1814|       |		 * the code above will verify the data descriptor. */
 1815|  2.87M|		while (p < buff + bytes_avail - 4) {
  ------------------
  |  Branch (1815:10): [True: 2.87M, False: 215]
  ------------------
 1816|  2.87M|			if (p[3] == 'P') { p += 3; }
  ------------------
  |  Branch (1816:8): [True: 5.02k, False: 2.87M]
  ------------------
 1817|  2.87M|			else if (p[3] == 'K') { p += 2; }
  ------------------
  |  Branch (1817:13): [True: 3.44k, False: 2.87M]
  ------------------
 1818|  2.87M|			else if (p[3] == '\007') { p += 1; }
  ------------------
  |  Branch (1818:13): [True: 17.5k, False: 2.85M]
  ------------------
 1819|  2.85M|			else if (p[3] == '\010' && p[2] == '\007'
  ------------------
  |  Branch (1819:13): [True: 22.7k, False: 2.83M]
  |  Branch (1819:31): [True: 1.38k, False: 21.4k]
  ------------------
 1820|  1.38k|			    && p[1] == 'K' && p[0] == 'P') {
  ------------------
  |  Branch (1820:11): [True: 1.35k, False: 30]
  |  Branch (1820:26): [True: 1.35k, False: 3]
  ------------------
 1821|  1.35k|				break;
 1822|  2.85M|			} else { p += 4; }
 1823|  2.87M|		}
 1824|  1.56k|		p -= trailing_extra;
 1825|  1.56k|		bytes_avail = p - buff;
 1826|  3.18k|	} else {
 1827|  3.18k|		if (zip->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (1827:7): [True: 1.55k, False: 1.62k]
  ------------------
 1828|  1.55k|			zip->end_of_entry = 1;
 1829|  1.55k|			if (zip->hctx_valid) {
  ------------------
  |  Branch (1829:8): [True: 193, False: 1.36k]
  ------------------
 1830|    193|				r = check_authentication_code(a, NULL);
 1831|    193|				if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    193|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1831:9): [True: 129, False: 64]
  ------------------
 1832|    129|					return (r);
 1833|    193|			}
 1834|  1.42k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.42k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1835|  1.55k|		}
 1836|       |		/* Grab a bunch of bytes. */
 1837|  1.62k|		buff = __archive_read_ahead(a, 1, &bytes_avail);
 1838|  1.62k|		if (bytes_avail <= 0) {
  ------------------
  |  Branch (1838:7): [True: 5, False: 1.62k]
  ------------------
 1839|      5|			archive_set_error(&a->archive,
 1840|      5|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      5|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1841|      5|			    "Truncated ZIP file data");
 1842|      5|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1843|      5|		}
 1844|  1.62k|		if (bytes_avail > zip->entry_bytes_remaining)
  ------------------
  |  Branch (1844:7): [True: 1.55k, False: 69]
  ------------------
 1845|  1.55k|			bytes_avail = (ssize_t)zip->entry_bytes_remaining;
 1846|  1.62k|	}
 1847|  3.18k|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (1847:6): [True: 7, False: 3.18k]
  |  Branch (1847:25): [True: 729, False: 2.45k]
  ------------------
 1848|    736|		size_t dec_size = bytes_avail;
 1849|       |
 1850|    736|		if (dec_size > zip->decrypted_buffer_size)
  ------------------
  |  Branch (1850:7): [True: 6, False: 730]
  ------------------
 1851|      6|			dec_size = zip->decrypted_buffer_size;
 1852|    736|		if (zip->tctx_valid) {
  ------------------
  |  Branch (1852:7): [True: 7, False: 729]
  ------------------
 1853|      7|			trad_enc_decrypt_update(&zip->tctx,
 1854|      7|			    (const uint8_t *)buff, dec_size,
 1855|      7|			    zip->decrypted_buffer, dec_size);
 1856|    729|		} else {
 1857|    729|			size_t dsize = dec_size;
 1858|    729|			archive_hmac_sha1_update(&zip->hctx,
  ------------------
  |  |  101|    729|	__archive_hmac.__hmac_sha1_update(ctx, data, data_len)
  ------------------
 1859|    729|			    (const uint8_t *)buff, dec_size);
 1860|    729|			archive_decrypto_aes_ctr_update(&zip->cctx,
  ------------------
  |  |  164|    729|  __archive_cryptor.decrypto_aes_ctr_update(ctx, in, in_len, out, out_len)
  ------------------
 1861|    729|			    (const uint8_t *)buff, dec_size,
 1862|    729|			    zip->decrypted_buffer, &dsize);
 1863|    729|		}
 1864|    736|		bytes_avail = dec_size;
 1865|    736|		buff = (const char *)zip->decrypted_buffer;
 1866|    736|	}
 1867|  3.18k|	zip->entry_bytes_remaining -= bytes_avail;
 1868|  3.18k|	zip->entry_uncompressed_bytes_read += bytes_avail;
 1869|  3.18k|	zip->entry_compressed_bytes_read += bytes_avail;
 1870|  3.18k|	zip->unconsumed += bytes_avail;
 1871|  3.18k|	*size = bytes_avail;
 1872|  3.18k|	*_buff = buff;
 1873|  3.18k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.18k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1874|  6.81k|}
archive_read_support_format_zip.c:zip_read_data_zipx_ppmd:
 2420|  14.5k|{
 2421|  14.5k|	struct zip* zip = (struct zip *)(a->format->data);
 2422|  14.5k|	int ret;
 2423|  14.5k|	size_t consumed_bytes = 0;
 2424|  14.5k|	ssize_t bytes_avail = 0;
 2425|       |
 2426|  14.5k|	(void) offset; /* UNUSED */
 2427|       |
 2428|       |	/* If we're here for the first time, initialize Ppmd8 decompression
 2429|       |	 * context first. */
 2430|  14.5k|	if(!zip->decompress_init) {
  ------------------
  |  Branch (2430:5): [True: 14.4k, False: 57]
  ------------------
 2431|  14.4k|		ret = zipx_ppmd8_init(a, zip);
 2432|  14.4k|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  14.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2432:6): [True: 3.11k, False: 11.3k]
  ------------------
 2433|  3.11k|			return ret;
 2434|  14.4k|	}
 2435|       |
 2436|       |	/* Fetch for more data. We're reading 1 byte here, but libarchive
 2437|       |	 * should prefetch more bytes. */
 2438|  11.4k|	(void) __archive_read_ahead(a, 1, &bytes_avail);
 2439|  11.4k|	if(bytes_avail < 0) {
  ------------------
  |  Branch (2439:5): [True: 0, False: 11.4k]
  ------------------
 2440|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2441|      0|		    "Truncated PPMd8 file body");
 2442|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2443|      0|	}
 2444|       |
 2445|       |	/* This counter will be updated inside ppmd_read(), which at one
 2446|       |	 * point will be called by Ppmd8_DecodeSymbol. */
 2447|  11.4k|	zip->zipx_ppmd_read_compressed = 0;
 2448|       |
 2449|       |	/* Decompression loop. */
 2450|  79.7M|	do {
 2451|  79.7M|		int sym = __archive_ppmd8_functions.Ppmd8_DecodeSymbol(
 2452|  79.7M|		    &zip->ppmd8);
 2453|  79.7M|		if(sym < 0) {
  ------------------
  |  Branch (2453:6): [True: 11.1k, False: 79.7M]
  ------------------
 2454|  11.1k|			zip->end_of_entry = 1;
 2455|  11.1k|			break;
 2456|  11.1k|		}
 2457|       |
 2458|       |		/* This field is set by ppmd_read() when there was no more data
 2459|       |		 * to be read. */
 2460|  79.7M|		if(zip->ppmd8_stream_failed) {
  ------------------
  |  Branch (2460:6): [True: 176, False: 79.7M]
  ------------------
 2461|    176|			archive_set_error(&a->archive,
 2462|    176|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    176|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2463|    176|			    "Truncated PPMd8 file body");
 2464|    176|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    176|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2465|    176|		}
 2466|       |
 2467|  79.7M|		zip->uncompressed_buffer[consumed_bytes] = (uint8_t) sym;
 2468|  79.7M|		++consumed_bytes;
 2469|  79.7M|	} while(consumed_bytes < zip->uncompressed_buffer_size);
  ------------------
  |  Branch (2469:10): [True: 79.7M, False: 57]
  ------------------
 2470|       |
 2471|       |	/* Update pointers so we can continue decompression in another call. */
 2472|  11.2k|	zip->entry_bytes_remaining -= zip->zipx_ppmd_read_compressed;
 2473|  11.2k|	zip->entry_compressed_bytes_read += zip->zipx_ppmd_read_compressed;
 2474|  11.2k|	zip->entry_uncompressed_bytes_read += consumed_bytes;
 2475|       |
 2476|       |	/* If we're at the end of stream, deinitialize Ppmd8 context. */
 2477|  11.2k|	if(zip->end_of_entry) {
  ------------------
  |  Branch (2477:5): [True: 11.1k, False: 57]
  ------------------
 2478|  11.1k|		__archive_ppmd8_functions.Ppmd8_Free(&zip->ppmd8);
 2479|  11.1k|		zip->ppmd8_valid = 0;
 2480|       |
 2481|  11.1k|		if (zip->hctx_valid) {
  ------------------
  |  Branch (2481:7): [True: 0, False: 11.1k]
  ------------------
 2482|      0|			int r = check_authentication_code(a, NULL);
 2483|      0|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2483:8): [True: 0, False: 0]
  ------------------
 2484|      0|				return (r);
 2485|      0|		}
 2486|  11.1k|	}
 2487|       |
 2488|       |	/* Update pointers for libarchive. */
 2489|  11.2k|	*buff = zip->uncompressed_buffer;
 2490|  11.2k|	*size = consumed_bytes;
 2491|       |
 2492|  11.2k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  11.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2493|  11.2k|}
archive_read_support_format_zip.c:zipx_ppmd8_init:
 2311|  14.4k|{
 2312|  14.4k|	const void* p;
 2313|  14.4k|	uint32_t val;
 2314|  14.4k|	uint32_t order;
 2315|  14.4k|	uint32_t mem;
 2316|  14.4k|	uint32_t restore_method;
 2317|       |
 2318|       |	/* Remove previous decompression context if it exists. */
 2319|  14.4k|	if(zip->ppmd8_valid) {
  ------------------
  |  Branch (2319:5): [True: 0, False: 14.4k]
  ------------------
 2320|      0|		__archive_ppmd8_functions.Ppmd8_Free(&zip->ppmd8);
 2321|      0|		zip->ppmd8_valid = 0;
 2322|      0|	}
 2323|       |
 2324|       |	/* Create a new decompression context. */
 2325|  14.4k|	__archive_ppmd8_functions.Ppmd8_Construct(&zip->ppmd8);
 2326|  14.4k|	zip->ppmd8_stream_failed = 0;
 2327|       |
 2328|       |	/* Setup function pointers required by Ppmd8 decompressor. The
 2329|       |	 * 'ppmd_read' function will feed new bytes to the decompressor,
 2330|       |	 * and will increment the 'zip->zipx_ppmd_read_compressed' counter. */
 2331|  14.4k|	zip->ppmd8.Stream.In = &zip->zipx_ppmd_stream;
 2332|  14.4k|	zip->zipx_ppmd_stream.a = a;
 2333|  14.4k|	zip->zipx_ppmd_stream.Read = &ppmd_read;
 2334|       |
 2335|       |	/* Reset number of read bytes to 0. */
 2336|  14.4k|	zip->zipx_ppmd_read_compressed = 0;
 2337|       |
 2338|       |	/* Read Ppmd8 header (2 bytes). */
 2339|  14.4k|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (2339:6): [True: 0, False: 14.4k]
  |  Branch (2339:25): [True: 0, False: 14.4k]
  ------------------
 2340|      0|		size_t out_len;
 2341|      0|		size_t consumed;
 2342|      0|		int ret;
 2343|       |
 2344|      0|		ret = zipx_read_header_and_decrypt(a, &p, 2, &out_len, &consumed);
 2345|      0|		if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2345:7): [True: 0, False: 0]
  ------------------
 2346|      0|			return ret;
 2347|  14.4k|	} else {
 2348|  14.4k|		p = __archive_read_ahead(a, 2, NULL);
 2349|  14.4k|		if(!p) {
  ------------------
  |  Branch (2349:6): [True: 1, False: 14.4k]
  ------------------
 2350|      1|			archive_set_error(&a->archive,
 2351|      1|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2352|      1|			    "Truncated file data in PPMd8 stream");
 2353|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2354|      1|		}
 2355|  14.4k|	}
 2356|  14.4k|	__archive_read_consume(a, 2);
 2357|       |
 2358|       |	/* Decode the stream's compression parameters. */
 2359|  14.4k|	val = archive_le16dec(p);
 2360|  14.4k|	order = (val & 15) + 1;
 2361|  14.4k|	mem = ((val >> 4) & 0xff) + 1;
 2362|  14.4k|	restore_method = (val >> 12);
 2363|       |
 2364|  14.4k|	if(order < 2 || restore_method > 2) {
  ------------------
  |  Branch (2364:5): [True: 779, False: 13.6k]
  |  Branch (2364:18): [True: 2.33k, False: 11.3k]
  ------------------
 2365|  3.11k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  3.11k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2366|  3.11k|		    "Invalid parameter set in PPMd8 stream (order=%" PRIu32 ", "
 2367|  3.11k|		    "restore=%" PRIu32 ")", order, restore_method);
 2368|  3.11k|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  3.11k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2369|  3.11k|	}
 2370|       |
 2371|       |	/* Allocate the memory needed to properly decompress the file. */
 2372|  11.3k|	if(!__archive_ppmd8_functions.Ppmd8_Alloc(&zip->ppmd8, mem << 20)) {
  ------------------
  |  Branch (2372:5): [True: 0, False: 11.3k]
  ------------------
 2373|      0|		archive_set_error(&a->archive, ENOMEM,
 2374|      0|		    "Unable to allocate memory for PPMd8 stream: %" PRIu32 " bytes",
 2375|      0|		    mem << 20);
 2376|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2377|      0|	}
 2378|       |
 2379|       |	/* Signal the cleanup function to release Ppmd8 context in the
 2380|       |	 * cleanup phase. */
 2381|  11.3k|	zip->ppmd8_valid = 1;
 2382|       |
 2383|       |	/* Perform further Ppmd8 initialization. */
 2384|  11.3k|	if(!__archive_ppmd8_functions.Ppmd8_RangeDec_Init(&zip->ppmd8)) {
  ------------------
  |  Branch (2384:5): [True: 0, False: 11.3k]
  ------------------
 2385|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 2386|      0|		    "PPMd8 stream range decoder initialization error");
 2387|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2388|      0|	}
 2389|       |
 2390|  11.3k|	__archive_ppmd8_functions.Ppmd8_Init(&zip->ppmd8, order,
 2391|  11.3k|	    restore_method);
 2392|       |
 2393|       |	/* Allocate the buffer that will hold uncompressed data. */
 2394|  11.3k|	free(zip->uncompressed_buffer);
 2395|       |
 2396|  11.3k|	zip->uncompressed_buffer_size = 256 * 1024;
 2397|  11.3k|	zip->uncompressed_buffer = malloc(zip->uncompressed_buffer_size);
 2398|       |
 2399|  11.3k|	if(zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (2399:5): [True: 0, False: 11.3k]
  ------------------
 2400|      0|		archive_set_error(&a->archive, ENOMEM,
 2401|      0|		    "No memory for PPMd8 decompression");
 2402|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2403|      0|	}
 2404|       |
 2405|       |	/* Ppmd8 initialization is done. */
 2406|  11.3k|	zip->decompress_init = 1;
 2407|       |
 2408|       |	/* We've already read 2 bytes in the output stream. Additionally,
 2409|       |	 * Ppmd8 initialization code could read some data as well. So we
 2410|       |	 * are advancing the stream by 2 bytes plus whatever number of
 2411|       |	 * bytes Ppmd8 init function used. */
 2412|  11.3k|	zip->entry_compressed_bytes_read += 2 + zip->zipx_ppmd_read_compressed;
 2413|       |
 2414|  11.3k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  11.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2415|  11.3k|}
archive_read_support_format_zip.c:ppmd_read:
  284|  11.4M|ppmd_read(void* p) {
  285|       |	/* Get the handle to current decompression context. */
  286|  11.4M|	struct archive_read *a = ((IByteIn*)p)->a;
  287|  11.4M|	struct zip *zip = (struct zip*) a->format->data;
  288|  11.4M|	ssize_t bytes_avail = 0;
  289|       |
  290|       |	/* Fetch next byte. */
  291|  11.4M|	const uint8_t* data = __archive_read_ahead(a, 1, &bytes_avail);
  292|  11.4M|	if(bytes_avail < 1) {
  ------------------
  |  Branch (292:5): [True: 183, False: 11.4M]
  ------------------
  293|    183|		zip->ppmd8_stream_failed = 1;
  294|    183|		return 0;
  295|    183|	}
  296|       |
  297|  11.4M|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (297:6): [True: 0, False: 11.4M]
  |  Branch (297:25): [True: 0, False: 11.4M]
  ------------------
  298|      0|		uint8_t val;
  299|      0|		if (zip->tctx_valid) {
  ------------------
  |  Branch (299:7): [True: 0, False: 0]
  ------------------
  300|      0|			trad_enc_decrypt_update(&zip->tctx,
  301|      0|			    data, 1, &val, 1);
  302|      0|		} else {
  303|      0|			size_t dsize = 1;
  304|      0|			archive_decrypto_aes_ctr_update(&zip->cctx,
  ------------------
  |  |  164|      0|  __archive_cryptor.decrypto_aes_ctr_update(ctx, in, in_len, out, out_len)
  ------------------
  305|      0|			    data, 1, &val, &dsize);
  306|      0|		}
  307|      0|		if (zip->hctx_valid)
  ------------------
  |  Branch (307:7): [True: 0, False: 0]
  ------------------
  308|      0|			archive_hmac_sha1_update(&zip->hctx, data, 1);
  ------------------
  |  |  101|      0|	__archive_hmac.__hmac_sha1_update(ctx, data, data_len)
  ------------------
  309|       |
  310|      0|		__archive_read_consume(a, 1);
  311|      0|		++zip->zipx_ppmd_read_compressed;
  312|      0|		return val;
  313|      0|	}
  314|       |
  315|  11.4M|	__archive_read_consume(a, 1);
  316|       |
  317|       |	/* Increment the counter. */
  318|  11.4M|	++zip->zipx_ppmd_read_compressed;
  319|       |
  320|       |	/* Return the next compressed byte. */
  321|  11.4M|	return data[0];
  322|  11.4M|}
archive_read_support_format_zip.c:consume_end_of_file_marker:
 1564|  17.6k|{
 1565|  17.6k|	const char *marker;
 1566|  17.6k|	const char *p;
 1567|  17.6k|	uint64_t compressed32, uncompressed32;
 1568|  17.6k|	uint64_t compressed64, uncompressed64;
 1569|  17.6k|	uint64_t compressed_actual, uncompressed_actual;
 1570|  17.6k|	uint32_t crc32_actual;
 1571|  17.6k|	const uint32_t PK78 = 0x08074B50ULL;
 1572|  17.6k|	uint8_t crc32_ignored, crc32_may_be_zero;
 1573|       |
 1574|       |	/* If there shouldn't be a marker, don't consume it. */
 1575|  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 (1575:6): [True: 6.54k, False: 11.1k]
  ------------------
 1576|  6.54k|		return;
 1577|  6.54k|	}
 1578|       |
 1579|       |	/* The longest Zip end-of-file record is 24 bytes.  Since an
 1580|       |	 * end-of-file record can never appear at the end of the
 1581|       |	 * archive, we know 24 bytes will be available unless
 1582|       |	 * the archive is severely truncated. */
 1583|  11.1k|	if (NULL == (marker = __archive_read_ahead(a, 24, NULL))) {
  ------------------
  |  Branch (1583:6): [True: 11, False: 11.1k]
  ------------------
 1584|     11|		return;
 1585|     11|	}
 1586|  11.1k|	p = marker;
 1587|       |
 1588|       |	/* The end-of-file record comprises:
 1589|       |	 * = Optional PK\007\010 marker
 1590|       |	 * = 4-byte CRC32
 1591|       |	 * = Compressed size
 1592|       |	 * = Uncompressed size
 1593|       |	 *
 1594|       |	 * The last two fields are either both 32 bits or both 64
 1595|       |	 * bits.  We check all possible layouts and accept any one
 1596|       |	 * that gives us a complete match, else we make a best-effort
 1597|       |	 * attempt to parse out the pieces.
 1598|       |	 */
 1599|       |
 1600|       |	/* CRC32 checking can be tricky:
 1601|       |	 * * Test suites sometimes ignore the CRC32
 1602|       |	 * * AES AE-2 always writes zero for the CRC32
 1603|       |	 * * AES AE-1 sometimes writes zero for the CRC32
 1604|       |	 */
 1605|  11.1k|	crc32_ignored = zip->ignore_crc32;
 1606|  11.1k|	crc32_may_be_zero = 0;
 1607|  11.1k|	crc32_actual = zip->computed_crc32;
 1608|  11.1k|	if (zip->hctx_valid) {
  ------------------
  |  Branch (1608:6): [True: 1.29k, False: 9.80k]
  ------------------
 1609|  1.29k|	  switch (zip->entry->aes_extra.vendor) {
 1610|      0|	  case AES_VENDOR_AE_2:
  ------------------
  |  |  113|      0|#define AES_VENDOR_AE_2	0x0002
  ------------------
  |  Branch (1610:4): [True: 0, False: 1.29k]
  ------------------
 1611|      0|	    crc32_actual = 0;
 1612|      0|	    break;
 1613|      0|	  case AES_VENDOR_AE_1:
  ------------------
  |  |  112|      0|#define AES_VENDOR_AE_1	0x0001
  ------------------
  |  Branch (1613:4): [True: 0, False: 1.29k]
  ------------------
 1614|  1.29k|	  default:
  ------------------
  |  Branch (1614:4): [True: 1.29k, False: 0]
  ------------------
 1615|  1.29k|	    crc32_may_be_zero = 1;
 1616|  1.29k|	    break;
 1617|  1.29k|	  }
 1618|  1.29k|	}
 1619|       |
 1620|       |	/* Values computed from the actual data in the archive. */
 1621|  11.1k|	compressed_actual = (uint64_t)zip->entry_compressed_bytes_read;
 1622|  11.1k|	uncompressed_actual = (uint64_t)zip->entry_uncompressed_bytes_read;
 1623|       |
 1624|       |
 1625|       |	/* Longest: PK78 marker, all 64-bit fields (24 bytes total) */
 1626|  11.1k|	if (archive_le32dec(p) == PK78
  ------------------
  |  Branch (1626:6): [True: 1.99k, False: 9.10k]
  ------------------
 1627|  1.99k|	    && ((archive_le32dec(p + 4) == crc32_actual)
  ------------------
  |  Branch (1627:10): [True: 153, False: 1.84k]
  ------------------
 1628|  1.84k|		|| (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1628:7): [True: 418, False: 1.42k]
  |  Branch (1628:28): [True: 0, False: 418]
  ------------------
 1629|  1.84k|		|| crc32_ignored)
  ------------------
  |  Branch (1629:6): [True: 1.84k, False: 0]
  ------------------
 1630|  1.99k|	    && (archive_le64dec(p + 8) == compressed_actual)
  ------------------
  |  Branch (1630:9): [True: 654, False: 1.34k]
  ------------------
 1631|    654|	    && (archive_le64dec(p + 16) == uncompressed_actual)) {
  ------------------
  |  Branch (1631:9): [True: 165, False: 489]
  ------------------
 1632|    165|		if (!crc32_ignored) {
  ------------------
  |  Branch (1632:7): [True: 0, False: 165]
  ------------------
 1633|      0|			zip->entry->crc32 = crc32_actual;
 1634|      0|		}
 1635|    165|		zip->entry->compressed_size = compressed_actual;
 1636|    165|		zip->entry->uncompressed_size = uncompressed_actual;
 1637|    165|		zip->unconsumed += 24;
 1638|    165|		return;
 1639|    165|	}
 1640|       |
 1641|       |	/* No PK78 marker, 64-bit fields (20 bytes total) */
 1642|  10.9k|	if (((archive_le32dec(p) == crc32_actual)
  ------------------
  |  Branch (1642:7): [True: 843, False: 10.0k]
  ------------------
 1643|  10.0k|	     || (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1643:11): [True: 1.29k, False: 8.80k]
  |  Branch (1643:32): [True: 868, False: 425]
  ------------------
 1644|  9.22k|	     || crc32_ignored)
  ------------------
  |  Branch (1644:10): [True: 9.22k, False: 0]
  ------------------
 1645|  10.9k|	    && (archive_le64dec(p + 4) == compressed_actual)
  ------------------
  |  Branch (1645:9): [True: 1.15k, False: 9.78k]
  ------------------
 1646|  1.15k|	    && (archive_le64dec(p + 12) == uncompressed_actual)) {
  ------------------
  |  Branch (1646:9): [True: 223, False: 930]
  ------------------
 1647|    223|	        if (!crc32_ignored) {
  ------------------
  |  Branch (1647:14): [True: 0, False: 223]
  ------------------
 1648|      0|			zip->entry->crc32 = crc32_actual;
 1649|      0|		}
 1650|    223|		zip->entry->compressed_size = compressed_actual;
 1651|    223|		zip->entry->uncompressed_size = uncompressed_actual;
 1652|    223|		zip->unconsumed += 20;
 1653|    223|		return;
 1654|    223|	}
 1655|       |
 1656|       |	/* PK78 marker and 32-bit fields (16 bytes total) */
 1657|  10.7k|	if (archive_le32dec(p) == PK78
  ------------------
  |  Branch (1657:6): [True: 1.83k, False: 8.88k]
  ------------------
 1658|  1.83k|	    && ((archive_le32dec(p + 4) == crc32_actual)
  ------------------
  |  Branch (1658:10): [True: 153, False: 1.67k]
  ------------------
 1659|  1.67k|		|| (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1659:7): [True: 418, False: 1.26k]
  |  Branch (1659:28): [True: 0, False: 418]
  ------------------
 1660|  1.67k|		|| crc32_ignored)
  ------------------
  |  Branch (1660:6): [True: 1.67k, False: 0]
  ------------------
 1661|  1.83k|	    && (archive_le32dec(p + 8) == compressed_actual)
  ------------------
  |  Branch (1661:9): [True: 595, False: 1.23k]
  ------------------
 1662|    595|	    && (archive_le32dec(p + 12) == uncompressed_actual)) {
  ------------------
  |  Branch (1662:9): [True: 430, False: 165]
  ------------------
 1663|    430|		if (!crc32_ignored) {
  ------------------
  |  Branch (1663:7): [True: 0, False: 430]
  ------------------
 1664|      0|			zip->entry->crc32 = crc32_actual;
 1665|      0|		}
 1666|    430|		zip->entry->compressed_size = compressed_actual;
 1667|    430|		zip->entry->uncompressed_size = uncompressed_actual;
 1668|    430|		zip->unconsumed += 16;
 1669|    430|		return;
 1670|    430|	}
 1671|       |
 1672|       |	/* Shortest: No PK78 marker, all 32-bit fields (12 bytes total) */
 1673|  10.2k|	if (((archive_le32dec(p) == crc32_actual)
  ------------------
  |  Branch (1673:7): [True: 843, False: 9.44k]
  ------------------
 1674|  9.44k|	     || (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1674:11): [True: 1.29k, False: 8.14k]
  |  Branch (1674:32): [True: 868, False: 425]
  ------------------
 1675|  8.57k|	     || crc32_ignored)
  ------------------
  |  Branch (1675:10): [True: 8.57k, False: 0]
  ------------------
 1676|  10.2k|	    && (archive_le32dec(p + 4) == compressed_actual)
  ------------------
  |  Branch (1676:9): [True: 1.23k, False: 9.04k]
  ------------------
 1677|  1.23k|	    && (archive_le32dec(p + 8) == uncompressed_actual)) {
  ------------------
  |  Branch (1677:9): [True: 145, False: 1.09k]
  ------------------
 1678|    145|		if (!crc32_ignored) {
  ------------------
  |  Branch (1678:7): [True: 0, False: 145]
  ------------------
 1679|      0|			zip->entry->crc32 = crc32_actual;
 1680|      0|		}
 1681|    145|		zip->entry->compressed_size = compressed_actual;
 1682|    145|		zip->entry->uncompressed_size = uncompressed_actual;
 1683|    145|		zip->unconsumed += 12;
 1684|    145|		return;
 1685|    145|	}
 1686|       |
 1687|       |	/* If none of the above patterns gives us a full exact match,
 1688|       |	 * then there's something definitely amiss.  The fallback code
 1689|       |	 * below will parse out some plausible values for error
 1690|       |	 * reporting purposes.  Note that this won't actually
 1691|       |	 * consume anything:
 1692|       |	 *
 1693|       |	 * = If there really is a marker here, the logic to resync to
 1694|       |	 *   the next entry will suffice to skip it.
 1695|       |	 *
 1696|       |	 * = There might not really be a marker: Corruption or bugs
 1697|       |	 *   may have set the length-at-end bit without a marker ever
 1698|       |	 *   having actually been written. In this case, we
 1699|       |	 *   explicitly should not consume any bytes, since that would
 1700|       |	 *   prevent us from correctly reading the next entry.
 1701|       |	 */
 1702|  10.1k|	if (archive_le32dec(p) == PK78) {
  ------------------
  |  Branch (1702:6): [True: 1.32k, False: 8.81k]
  ------------------
 1703|  1.32k|		p += 4; /* Ignore PK78 if it appears to be present */
 1704|  1.32k|	}
 1705|  10.1k|	zip->entry->crc32 = archive_le32dec(p);  /* Parse CRC32 */
 1706|  10.1k|	p += 4;
 1707|       |
 1708|       |	/* Consider both 32- and 64-bit interpretations */
 1709|  10.1k|	compressed32 = archive_le32dec(p);
 1710|  10.1k|	uncompressed32 = archive_le32dec(p + 4);
 1711|  10.1k|	compressed64 = archive_le64dec(p);
 1712|  10.1k|	uncompressed64 = archive_le64dec(p + 8);
 1713|       |
 1714|       |	/* The earlier patterns may have failed because of CRC32
 1715|       |	 * mismatch, so it's still possible that both sizes match.
 1716|       |	 * Try to match as many as we can...
 1717|       |	 */
 1718|  10.1k|	if (compressed32 == compressed_actual
  ------------------
  |  Branch (1718:6): [True: 1.17k, False: 8.96k]
  ------------------
 1719|  1.17k|	    && uncompressed32 == uncompressed_actual) {
  ------------------
  |  Branch (1719:9): [True: 0, False: 1.17k]
  ------------------
 1720|       |		/* Both 32-bit fields match */
 1721|      0|		zip->entry->compressed_size = compressed32;
 1722|      0|		zip->entry->uncompressed_size = uncompressed32;
 1723|  10.1k|	} else if (compressed64 == compressed_actual
  ------------------
  |  Branch (1723:13): [True: 775, False: 9.36k]
  ------------------
 1724|  9.36k|		   || uncompressed64 == uncompressed_actual) {
  ------------------
  |  Branch (1724:9): [True: 189, False: 9.17k]
  ------------------
 1725|       |		/* One or both 64-bit fields match */
 1726|    964|		zip->entry->compressed_size = compressed64;
 1727|    964|		zip->entry->uncompressed_size = uncompressed64;
 1728|  9.17k|	} else {
 1729|       |		/* Zero or one 32-bit fields match */
 1730|  9.17k|		zip->entry->compressed_size = compressed32;
 1731|  9.17k|		zip->entry->uncompressed_size = uncompressed32;
 1732|  9.17k|	}
 1733|  10.1k|}
archive_read_support_format_zip.c:archive_read_format_zip_read_data_skip_streamable:
 3701|  34.9k|{
 3702|  34.9k|	struct zip *zip;
 3703|  34.9k|	int64_t bytes_skipped;
 3704|       |
 3705|  34.9k|	zip = (struct zip *)(a->format->data);
 3706|  34.9k|	bytes_skipped = __archive_read_consume(a, zip->unconsumed);
 3707|  34.9k|	zip->unconsumed = 0;
 3708|  34.9k|	if (bytes_skipped < 0)
  ------------------
  |  Branch (3708:6): [True: 0, False: 34.9k]
  ------------------
 3709|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3710|       |
 3711|       |	/* If we've already read to end of data, we're done. */
 3712|  34.9k|	if (zip->end_of_entry)
  ------------------
  |  Branch (3712:6): [True: 21.4k, False: 13.4k]
  ------------------
 3713|  21.4k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  21.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3714|       |
 3715|       |	/* So we know we're streaming... */
 3716|  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 (3716:6): [True: 5.28k, False: 8.14k]
  ------------------
 3717|  10.3k|	    || zip->entry->compressed_size > 0) {
  ------------------
  |  Branch (3717:9): [True: 5.07k, False: 3.06k]
  ------------------
 3718|       |		/* We know the compressed length, so we can just skip. */
 3719|  10.3k|		bytes_skipped = __archive_read_consume(a,
 3720|  10.3k|					zip->entry_bytes_remaining);
 3721|  10.3k|		if (bytes_skipped < 0)
  ------------------
  |  Branch (3721:7): [True: 42, False: 10.3k]
  ------------------
 3722|     42|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     42|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3723|  10.3k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  10.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3724|  10.3k|	}
 3725|       |
 3726|  3.06k|	if (zip->init_decryption) {
  ------------------
  |  Branch (3726:6): [True: 2.33k, False: 730]
  ------------------
 3727|  2.33k|		int r;
 3728|       |
 3729|  2.33k|		zip->has_encrypted_entries = 1;
 3730|  2.33k|		if (zip->entry->zip_flags & ZIP_STRONG_ENCRYPTED)
  ------------------
  |  |  129|  2.33k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
  |  Branch (3730:7): [True: 103, False: 2.23k]
  ------------------
 3731|    103|			r = read_decryption_header(a);
 3732|  2.23k|		else if (zip->entry->compression == WINZIP_AES_ENCRYPTION)
  ------------------
  |  |  144|  2.23k|#define WINZIP_AES_ENCRYPTION	99
  ------------------
  |  Branch (3732:12): [True: 98, False: 2.13k]
  ------------------
 3733|     98|			r = init_WinZip_AES_decryption(a);
 3734|  2.13k|		else
 3735|  2.13k|			r = init_traditional_PKWARE_decryption(a);
 3736|  2.33k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.33k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3736:7): [True: 1.56k, False: 773]
  ------------------
 3737|  1.56k|			return (r);
 3738|    773|		zip->init_decryption = 0;
 3739|    773|	}
 3740|       |
 3741|       |	/* We're streaming and we don't know the length. */
 3742|       |	/* If the body is compressed and we know the format, we can
 3743|       |	 * find an exact end-of-entry by decompressing it. */
 3744|  1.50k|	switch (zip->entry->compression) {
 3745|      0|#ifdef HAVE_ZLIB_H
 3746|      0|	case 8: /* Deflate compression. */
  ------------------
  |  Branch (3746:2): [True: 0, False: 1.50k]
  ------------------
 3747|      0|		while (!zip->end_of_entry) {
  ------------------
  |  Branch (3747:10): [True: 0, False: 0]
  ------------------
 3748|      0|			int64_t offset = 0;
 3749|      0|			const void *buff = NULL;
 3750|      0|			size_t size = 0;
 3751|      0|			int r;
 3752|      0|			r =  zip_read_data_deflate(a, &buff, &size, &offset);
 3753|      0|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3753:8): [True: 0, False: 0]
  ------------------
 3754|      0|				return (r);
 3755|      0|		}
 3756|      0|		return ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3757|      0|#endif
 3758|  1.50k|	default: /* Uncompressed or unknown. */
  ------------------
  |  Branch (3758:2): [True: 1.50k, False: 0]
  ------------------
 3759|       |		/* Scan for a PK\007\010 signature. */
 3760|  1.71k|		for (;;) {
 3761|  1.71k|			const char *p, *buff;
 3762|  1.71k|			ssize_t bytes_avail;
 3763|  1.71k|			buff = __archive_read_ahead(a, 16, &bytes_avail);
 3764|  1.71k|			if (bytes_avail < 16) {
  ------------------
  |  Branch (3764:8): [True: 7, False: 1.71k]
  ------------------
 3765|      7|				archive_set_error(&a->archive,
 3766|      7|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      7|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3767|      7|				    "Truncated ZIP file data");
 3768|      7|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3769|      7|			}
 3770|  1.71k|			p = buff;
 3771|   805k|			while (p <= buff + bytes_avail - 16) {
  ------------------
  |  Branch (3771:11): [True: 805k, False: 214]
  ------------------
 3772|   805k|				if (p[3] == 'P') { p += 3; }
  ------------------
  |  Branch (3772:9): [True: 1.91k, False: 803k]
  ------------------
 3773|   803k|				else if (p[3] == 'K') { p += 2; }
  ------------------
  |  Branch (3773:14): [True: 17.1k, False: 786k]
  ------------------
 3774|   786k|				else if (p[3] == '\007') { p += 1; }
  ------------------
  |  Branch (3774:14): [True: 5.37k, False: 780k]
  ------------------
 3775|   780k|				else if (p[3] == '\010' && p[2] == '\007'
  ------------------
  |  Branch (3775:14): [True: 8.74k, False: 772k]
  |  Branch (3775:32): [True: 1.54k, False: 7.19k]
  ------------------
 3776|  1.54k|				    && p[1] == 'K' && p[0] == 'P') {
  ------------------
  |  Branch (3776:12): [True: 1.52k, False: 18]
  |  Branch (3776:27): [True: 1.49k, False: 33]
  ------------------
 3777|  1.49k|					if (zip->entry->flags & LA_USED_ZIP64)
  ------------------
  |  |  136|  1.49k|#define LA_USED_ZIP64	(1 << 0)
  ------------------
  |  Branch (3777:10): [True: 232, False: 1.26k]
  ------------------
 3778|    232|						__archive_read_consume(a,
 3779|    232|						    p - buff + 24);
 3780|  1.26k|					else
 3781|  1.26k|						__archive_read_consume(a,
 3782|  1.26k|						    p - buff + 16);
 3783|  1.49k|					return ARCHIVE_OK;
  ------------------
  |  |  233|  1.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3784|   779k|				} else { p += 4; }
 3785|   805k|			}
 3786|    214|			__archive_read_consume(a, p - buff);
 3787|    214|		}
 3788|  1.50k|	}
 3789|  1.50k|}
archive_read_support_format_zip.c:archive_read_format_zip_cleanup:
 3426|  4.99k|{
 3427|  4.99k|	struct zip *zip;
 3428|  4.99k|	struct zip_entry *zip_entry, *next_zip_entry;
 3429|       |
 3430|  4.99k|	zip = (struct zip *)(a->format->data);
 3431|       |
 3432|  4.99k|#ifdef HAVE_ZLIB_H
 3433|  4.99k|	if (zip->stream_valid)
  ------------------
  |  Branch (3433:6): [True: 105, False: 4.89k]
  ------------------
 3434|    105|		inflateEnd(&zip->stream);
 3435|  4.99k|#endif
 3436|       |
 3437|  4.99k|#if HAVE_LZMA_H && HAVE_LIBLZMA
 3438|  4.99k|    if (zip->zipx_lzma_valid) {
  ------------------
  |  Branch (3438:9): [True: 9, False: 4.98k]
  ------------------
 3439|      9|		lzma_end(&zip->zipx_lzma_stream);
 3440|      9|	}
 3441|  4.99k|#endif
 3442|       |
 3443|  4.99k|#ifdef HAVE_BZLIB_H
 3444|  4.99k|	if (zip->bzstream_valid) {
  ------------------
  |  Branch (3444:6): [True: 0, False: 4.99k]
  ------------------
 3445|      0|		BZ2_bzDecompressEnd(&zip->bzstream);
 3446|      0|	}
 3447|  4.99k|#endif
 3448|       |
 3449|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 3450|       |	if (zip->zstdstream_valid) {
 3451|       |		ZSTD_freeDStream(zip->zstdstream);
 3452|       |	}
 3453|       |#endif
 3454|       |
 3455|  4.99k|	free(zip->uncompressed_buffer);
 3456|       |
 3457|  4.99k|	if (zip->ppmd8_valid)
  ------------------
  |  Branch (3457:6): [True: 176, False: 4.82k]
  ------------------
 3458|    176|		__archive_ppmd8_functions.Ppmd8_Free(&zip->ppmd8);
 3459|       |
 3460|  4.99k|	if (zip->zip_entries) {
  ------------------
  |  Branch (3460:6): [True: 698, False: 4.30k]
  ------------------
 3461|    698|		zip_entry = zip->zip_entries;
 3462|  2.44k|		while (zip_entry != NULL) {
  ------------------
  |  Branch (3462:10): [True: 1.74k, False: 698]
  ------------------
 3463|  1.74k|			next_zip_entry = zip_entry->next;
 3464|  1.74k|			archive_string_free(&zip_entry->rsrcname);
 3465|  1.74k|			free(zip_entry);
 3466|  1.74k|			zip_entry = next_zip_entry;
 3467|  1.74k|		}
 3468|    698|	}
 3469|  4.99k|	free(zip->decrypted_buffer);
 3470|  4.99k|	if (zip->cctx_valid)
  ------------------
  |  Branch (3470:6): [True: 2, False: 4.99k]
  ------------------
 3471|      2|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  166|      2|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 3472|  4.99k|	if (zip->hctx_valid)
  ------------------
  |  Branch (3472:6): [True: 2, False: 4.99k]
  ------------------
 3473|      2|		archive_hmac_sha1_cleanup(&zip->hctx);
  ------------------
  |  |  105|      2|	__archive_hmac.__hmac_sha1_cleanup(ctx)
  ------------------
 3474|  4.99k|	free(zip->iv);
 3475|  4.99k|	free(zip->erd);
 3476|  4.99k|	free(zip->v_data);
 3477|  4.99k|	archive_string_free(&zip->format_name);
 3478|  4.99k|	free(zip);
 3479|  4.99k|	(a->format->data) = NULL;
 3480|  4.99k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.99k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3481|  4.99k|}
archive_read_support_format_zip.c:archive_read_support_format_zip_capabilities_streamable:
 3563|  1.32k|{
 3564|  1.32k|	(void)a; /* UNUSED */
 3565|  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 */
  ------------------
 3566|  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.) */
  ------------------
 3567|  1.32k|}
archive_read_support_format_zip.c:archive_read_format_zip_has_encrypted_entries:
 3485|    701|{
 3486|    701|	if (_a && _a->format) {
  ------------------
  |  Branch (3486:6): [True: 701, False: 0]
  |  Branch (3486:12): [True: 701, False: 0]
  ------------------
 3487|    701|		struct zip * zip = (struct zip *)_a->format->data;
 3488|    701|		if (zip) {
  ------------------
  |  Branch (3488:7): [True: 701, False: 0]
  ------------------
 3489|    701|			return zip->has_encrypted_entries;
 3490|    701|		}
 3491|    701|	}
 3492|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 3493|    701|}
archive_read_support_format_zip.c:archive_read_format_zip_seekable_bid:
 3946|  2.45k|{
 3947|  2.45k|	struct zip *zip = (struct zip *)a->format->data;
 3948|  2.45k|	int64_t file_size, current_offset;
 3949|  2.45k|	const char *p;
 3950|  2.45k|	int i, tail;
 3951|       |
 3952|       |	/* If someone has already bid more than 32, then avoid
 3953|       |	   trashing the look-ahead buffers with a seek. */
 3954|  2.45k|	if (best_bid > 32)
  ------------------
  |  Branch (3954:6): [True: 1.13k, False: 1.31k]
  ------------------
 3955|  1.13k|		return (-1);
 3956|       |
 3957|  1.31k|	file_size = __archive_read_seek(a, 0, SEEK_END);
 3958|  1.31k|	if (file_size <= 0)
  ------------------
  |  Branch (3958:6): [True: 75, False: 1.24k]
  ------------------
 3959|     75|		return 0;
 3960|       |
 3961|       |	/* Search last 16k of file for end-of-central-directory
 3962|       |	 * record (which starts with PK\005\006) */
 3963|  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]
  |  |  ------------------
  ------------------
 3964|  1.24k|	current_offset = __archive_read_seek(a, -tail, SEEK_END);
 3965|  1.24k|	if (current_offset < 0)
  ------------------
  |  Branch (3965:6): [True: 0, False: 1.24k]
  ------------------
 3966|      0|		return 0;
 3967|  1.24k|	if ((p = __archive_read_ahead(a, (size_t)tail, NULL)) == NULL)
  ------------------
  |  Branch (3967:6): [True: 0, False: 1.24k]
  ------------------
 3968|      0|		return 0;
 3969|       |	/* Boyer-Moore search backwards from the end, since we want
 3970|       |	 * to match the last EOCD in the file (there can be more than
 3971|       |	 * one if there is an uncompressed Zip archive as a member
 3972|       |	 * within this Zip archive). */
 3973|  3.37M|	for (i = tail - 22; i > 0;) {
  ------------------
  |  Branch (3973:22): [True: 3.37M, False: 1.17k]
  ------------------
 3974|  3.37M|		switch (p[i]) {
 3975|  34.6k|		case 'P':
  ------------------
  |  Branch (3975:3): [True: 34.6k, False: 3.33M]
  ------------------
 3976|  34.6k|			if (memcmp(p + i, "PK\005\006", 4) == 0) {
  ------------------
  |  Branch (3976:8): [True: 71, False: 34.5k]
  ------------------
 3977|     71|				int ret = read_eocd(zip, p + i,
 3978|     71|				    current_offset + i);
 3979|       |				/* Zip64 EOCD locator precedes
 3980|       |				 * regular EOCD if present. */
 3981|     71|				if (i >= 20 && memcmp(p + i - 20, "PK\006\007", 4) == 0) {
  ------------------
  |  Branch (3981:9): [True: 71, False: 0]
  |  Branch (3981:20): [True: 4, False: 67]
  ------------------
 3982|      4|					int ret_zip64 = read_zip64_eocd(a, zip, p + i - 20);
 3983|      4|					if (ret_zip64 > ret)
  ------------------
  |  Branch (3983:10): [True: 2, False: 2]
  ------------------
 3984|      2|						ret = ret_zip64;
 3985|      4|				}
 3986|     71|				return (ret);
 3987|     71|			}
 3988|  34.5k|			i -= 4;
 3989|  34.5k|			break;
 3990|  11.2k|		case 'K': i -= 1; break;
  ------------------
  |  Branch (3990:3): [True: 11.2k, False: 3.35M]
  ------------------
 3991|   217k|		case 005: i -= 2; break;
  ------------------
  |  Branch (3991:3): [True: 217k, False: 3.15M]
  ------------------
 3992|  12.0k|		case 006: i -= 3; break;
  ------------------
  |  Branch (3992:3): [True: 12.0k, False: 3.35M]
  ------------------
 3993|  3.09M|		default: i -= 4; break;
  ------------------
  |  Branch (3993:3): [True: 3.09M, False: 275k]
  ------------------
 3994|  3.37M|		}
 3995|  3.37M|	}
 3996|  1.17k|	return 0;
 3997|  1.24k|}
archive_read_support_format_zip.c:read_eocd:
 3861|     71|{
 3862|     71|	uint16_t disk_num;
 3863|     71|	uint32_t cd_size, cd_offset;
 3864|       |
 3865|     71|	disk_num = archive_le16dec(p + 4);
 3866|     71|	cd_size = archive_le32dec(p + 12);
 3867|     71|	cd_offset = archive_le32dec(p + 16);
 3868|       |
 3869|       |	/* Sanity-check the EOCD we've found. */
 3870|       |
 3871|       |	/* This must be the first volume. */
 3872|     71|	if (disk_num != 0)
  ------------------
  |  Branch (3872:6): [True: 23, False: 48]
  ------------------
 3873|     23|		return 0;
 3874|       |	/* Central directory must be on this volume. */
 3875|     48|	if (disk_num != archive_le16dec(p + 6))
  ------------------
  |  Branch (3875:6): [True: 9, False: 39]
  ------------------
 3876|      9|		return 0;
 3877|       |	/* All central directory entries must be on this volume. */
 3878|     39|	if (archive_le16dec(p + 10) != archive_le16dec(p + 8))
  ------------------
  |  Branch (3878:6): [True: 0, False: 39]
  ------------------
 3879|      0|		return 0;
 3880|       |	/* Central directory can't extend beyond start of EOCD record. */
 3881|     39|	if ((int64_t)cd_offset + cd_size > current_offset)
  ------------------
  |  Branch (3881:6): [True: 2, False: 37]
  ------------------
 3882|      2|		return 0;
 3883|       |
 3884|       |	/* Save the central directory location for later use. */
 3885|     37|	zip->central_directory_offset = cd_offset;
 3886|     37|	zip->central_directory_offset_adjusted = current_offset - cd_size;
 3887|       |
 3888|       |	/* This is just a tiny bit higher than the maximum
 3889|       |	   returned by the streaming Zip bidder.  This ensures
 3890|       |	   that the more accurate seeking Zip parser wins
 3891|       |	   whenever seek is available. */
 3892|     37|	return 32;
 3893|     39|}
archive_read_support_format_zip.c:read_zip64_eocd:
 3901|      4|{
 3902|      4|	int64_t eocd64_offset;
 3903|      4|	int64_t eocd64_size;
 3904|       |
 3905|       |	/* Sanity-check the locator record. */
 3906|       |
 3907|       |	/* Central dir must be on first volume. */
 3908|      4|	if (archive_le32dec(p + 4) != 0)
  ------------------
  |  Branch (3908:6): [True: 1, False: 3]
  ------------------
 3909|      1|		return 0;
 3910|       |	/* Must be only a single volume. */
 3911|      3|	if (archive_le32dec(p + 16) != 1)
  ------------------
  |  Branch (3911:6): [True: 0, False: 3]
  ------------------
 3912|      0|		return 0;
 3913|       |
 3914|       |	/* Find the Zip64 EOCD record. */
 3915|      3|	eocd64_offset = archive_le64dec(p + 8);
 3916|      3|	if (__archive_read_seek(a, eocd64_offset, SEEK_SET) < 0)
  ------------------
  |  Branch (3916:6): [True: 0, False: 3]
  ------------------
 3917|      0|		return 0;
 3918|      3|	if ((p = __archive_read_ahead(a, 56, NULL)) == NULL)
  ------------------
  |  Branch (3918:6): [True: 0, False: 3]
  ------------------
 3919|      0|		return 0;
 3920|       |	/* Make sure we can read all of it. */
 3921|      3|	eocd64_size = archive_le64dec(p + 4) + 12;
 3922|      3|	if (eocd64_size < 56 || eocd64_size > 16384)
  ------------------
  |  Branch (3922:6): [True: 0, False: 3]
  |  Branch (3922:26): [True: 1, False: 2]
  ------------------
 3923|      1|		return 0;
 3924|      2|	if ((p = __archive_read_ahead(a, (size_t)eocd64_size, NULL)) == NULL)
  ------------------
  |  Branch (3924:6): [True: 0, False: 2]
  ------------------
 3925|      0|		return 0;
 3926|       |
 3927|       |	/* Sanity-check the EOCD64 */
 3928|      2|	if (archive_le32dec(p + 16) != 0) /* Must be disk #0 */
  ------------------
  |  Branch (3928:6): [True: 0, False: 2]
  ------------------
 3929|      0|		return 0;
 3930|      2|	if (archive_le32dec(p + 20) != 0) /* CD must be on disk #0 */
  ------------------
  |  Branch (3930:6): [True: 0, False: 2]
  ------------------
 3931|      0|		return 0;
 3932|       |	/* CD can't be split. */
 3933|      2|	if (archive_le64dec(p + 24) != archive_le64dec(p + 32))
  ------------------
  |  Branch (3933:6): [True: 0, False: 2]
  ------------------
 3934|      0|		return 0;
 3935|       |
 3936|       |	/* Save the central directory offset for later use. */
 3937|      2|	zip->central_directory_offset = archive_le64dec(p + 48);
 3938|       |	/* TODO: Needs scanning backwards to find the eocd64 instead of assuming */
 3939|      2|	zip->central_directory_offset_adjusted = zip->central_directory_offset;
 3940|       |
 3941|      2|	return 32;
 3942|      2|}
archive_read_support_format_zip.c:archive_read_format_zip_seekable_read_header:
 4495|    247|{
 4496|    247|	struct zip *zip = (struct zip *)a->format->data;
 4497|    247|	struct zip_entry *rsrc;
 4498|    247|	int64_t offset;
 4499|    247|	int r, ret = ARCHIVE_OK;
  ------------------
  |  |  233|    247|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4500|       |
 4501|       |	/*
 4502|       |	 * It should be sufficient to call archive_read_next_header() for
 4503|       |	 * a reader to determine if an entry is encrypted or not. If the
 4504|       |	 * encryption of an entry is only detectable when calling
 4505|       |	 * archive_read_data(), so be it. We'll do the same check there
 4506|       |	 * as well.
 4507|       |	 */
 4508|    247|	if (zip->has_encrypted_entries ==
  ------------------
  |  Branch (4508:6): [True: 39, False: 208]
  ------------------
 4509|    247|			ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW)
  ------------------
  |  |  411|    247|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4510|     39|		zip->has_encrypted_entries = 0;
 4511|       |
 4512|    247|	a->archive.archive_format = ARCHIVE_FORMAT_ZIP;
  ------------------
  |  |  374|    247|#define	ARCHIVE_FORMAT_ZIP			0x50000
  ------------------
 4513|    247|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (4513:6): [True: 39, False: 208]
  ------------------
 4514|     39|		a->archive.archive_format_name = "ZIP";
 4515|       |
 4516|    247|	if (zip->zip_entries == NULL) {
  ------------------
  |  Branch (4516:6): [True: 39, False: 208]
  ------------------
 4517|     39|		r = slurp_central_directory(a, entry, zip);
 4518|     39|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|     39|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4518:7): [True: 16, False: 23]
  ------------------
 4519|     16|			return r;
 4520|       |		/* Get first entry whose local header offset is lower than
 4521|       |		 * other entries in the archive file. */
 4522|     23|		zip->entry =
 4523|     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
  |  |  ------------------
  ------------------
 4524|    208|	} else if (zip->entry != NULL) {
  ------------------
  |  Branch (4524:13): [True: 208, False: 0]
  ------------------
 4525|       |		/* Get next entry in local header offset order. */
 4526|    208|		zip->entry = (struct zip_entry *)__archive_rb_tree_iterate(
 4527|    208|		    &zip->tree, &zip->entry->node, ARCHIVE_RB_DIR_RIGHT);
  ------------------
  |  |   46|    208|#define	ARCHIVE_RB_DIR_RIGHT		1
  ------------------
 4528|    208|	}
 4529|       |
 4530|    231|	if (zip->entry == NULL)
  ------------------
  |  Branch (4530:6): [True: 7, False: 224]
  ------------------
 4531|      7|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      7|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4532|       |
 4533|    224|	if (zip->entry->rsrcname.s)
  ------------------
  |  Branch (4533:6): [True: 0, False: 224]
  ------------------
 4534|      0|		rsrc = (struct zip_entry *)__archive_rb_tree_find_node(
 4535|      0|		    &zip->tree_rsrc, zip->entry->rsrcname.s);
 4536|    224|	else
 4537|    224|		rsrc = NULL;
 4538|       |
 4539|    224|	if (zip->cctx_valid)
  ------------------
  |  Branch (4539:6): [True: 0, False: 224]
  ------------------
 4540|      0|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  166|      0|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 4541|    224|	if (zip->hctx_valid)
  ------------------
  |  Branch (4541:6): [True: 0, False: 224]
  ------------------
 4542|      0|		archive_hmac_sha1_cleanup(&zip->hctx);
  ------------------
  |  |  105|      0|	__archive_hmac.__hmac_sha1_cleanup(ctx)
  ------------------
 4543|    224|	zip->tctx_valid = zip->cctx_valid = zip->hctx_valid = 0;
 4544|    224|	__archive_read_reset_passphrase(a);
 4545|       |
 4546|       |	/* File entries are sorted by the header offset, we should mostly
 4547|       |	 * use __archive_read_consume to advance a read point to avoid
 4548|       |	 * redundant data reading.  */
 4549|    224|	offset = archive_filter_bytes(&a->archive, 0);
 4550|    224|	if (offset < zip->entry->local_header_offset)
  ------------------
  |  Branch (4550:6): [True: 21, False: 203]
  ------------------
 4551|     21|		__archive_read_consume(a,
 4552|     21|		    zip->entry->local_header_offset - offset);
 4553|    203|	else if (offset != zip->entry->local_header_offset) {
  ------------------
  |  Branch (4553:11): [True: 25, False: 178]
  ------------------
 4554|     25|		__archive_read_seek(a, zip->entry->local_header_offset,
 4555|     25|		    SEEK_SET);
 4556|     25|	}
 4557|    224|	zip->unconsumed = 0;
 4558|    224|	r = zip_read_local_file_header(a, entry, zip);
 4559|    224|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    224|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4559:6): [True: 54, False: 170]
  ------------------
 4560|     54|		return r;
 4561|    170|	if (rsrc) {
  ------------------
  |  Branch (4561:6): [True: 0, False: 170]
  ------------------
 4562|      0|		int ret2 = zip_read_mac_metadata(a, entry, rsrc);
 4563|      0|		if (ret2 < ret)
  ------------------
  |  Branch (4563:7): [True: 0, False: 0]
  ------------------
 4564|      0|			ret = ret2;
 4565|      0|	}
 4566|    170|	return (ret);
 4567|    224|}
archive_read_support_format_zip.c:slurp_central_directory:
 4094|     39|{
 4095|     39|	ssize_t i;
 4096|     39|	unsigned found;
 4097|     39|	int64_t correction;
 4098|     39|	ssize_t bytes_avail;
 4099|     39|	const char *p;
 4100|       |
 4101|       |	/*
 4102|       |	 * Find the start of the central directory.  The end-of-CD
 4103|       |	 * record has our starting point, but there are lots of
 4104|       |	 * Zip archives which have had other data prepended to the
 4105|       |	 * file, which makes the recorded offsets all too small.
 4106|       |	 * So we search forward from the specified offset until we
 4107|       |	 * find the real start of the central directory.  Then we
 4108|       |	 * know the correction we need to apply to account for leading
 4109|       |	 * padding.
 4110|       |	 */
 4111|     39|	if (__archive_read_seek(a, zip->central_directory_offset_adjusted, SEEK_SET)
  ------------------
  |  Branch (4111:6): [True: 0, False: 39]
  ------------------
 4112|     39|		< 0)
 4113|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4114|       |
 4115|     39|	found = 0;
 4116|     78|	while (!found) {
  ------------------
  |  Branch (4116:9): [True: 39, False: 39]
  ------------------
 4117|     39|		if ((p = __archive_read_ahead(a, 20, &bytes_avail)) == NULL)
  ------------------
  |  Branch (4117:7): [True: 0, False: 39]
  ------------------
 4118|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4119|  38.0k|		for (found = 0, i = 0; !found && i < bytes_avail - 4;) {
  ------------------
  |  Branch (4119:26): [True: 38.0k, False: 39]
  |  Branch (4119:36): [True: 38.0k, False: 0]
  ------------------
 4120|  38.0k|			switch (p[i + 3]) {
 4121|    294|			case 'P': i += 3; break;
  ------------------
  |  Branch (4121:4): [True: 294, False: 37.7k]
  ------------------
 4122|    202|			case 'K': i += 2; break;
  ------------------
  |  Branch (4122:4): [True: 202, False: 37.8k]
  ------------------
 4123|    457|			case 001: i += 1; break;
  ------------------
  |  Branch (4123:4): [True: 457, False: 37.5k]
  ------------------
 4124|    708|			case 002:
  ------------------
  |  Branch (4124:4): [True: 708, False: 37.3k]
  ------------------
 4125|    708|				if (memcmp(p + i, "PK\001\002", 4) == 0) {
  ------------------
  |  Branch (4125:9): [True: 36, False: 672]
  ------------------
 4126|     36|					p += i;
 4127|     36|					found = 1;
 4128|     36|				} else
 4129|    672|					i += 4;
 4130|    708|				break;
 4131|    227|			case 005: i += 1; break;
  ------------------
  |  Branch (4131:4): [True: 227, False: 37.8k]
  ------------------
 4132|    221|			case 006:
  ------------------
  |  Branch (4132:4): [True: 221, False: 37.8k]
  ------------------
 4133|    221|				if (memcmp(p + i, "PK\005\006", 4) == 0) {
  ------------------
  |  Branch (4133:9): [True: 3, False: 218]
  ------------------
 4134|      3|					p += i;
 4135|      3|					found = 1;
 4136|    218|				} else if (memcmp(p + i, "PK\006\006", 4) == 0) {
  ------------------
  |  Branch (4136:16): [True: 0, False: 218]
  ------------------
 4137|      0|					p += i;
 4138|      0|					found = 1;
 4139|      0|				} else
 4140|    218|					i += 1;
 4141|    221|				break;
 4142|  35.9k|			default: i += 4; break;
  ------------------
  |  Branch (4142:4): [True: 35.9k, False: 2.10k]
  ------------------
 4143|  38.0k|			}
 4144|  38.0k|		}
 4145|     39|		__archive_read_consume(a, i);
 4146|     39|	}
 4147|     39|	correction = archive_filter_bytes(&a->archive, 0)
 4148|     39|			- zip->central_directory_offset;
 4149|       |
 4150|     39|	__archive_rb_tree_init(&zip->tree, &rb_ops);
 4151|     39|	__archive_rb_tree_init(&zip->tree_rsrc, &rb_rsrc_ops);
 4152|       |
 4153|     39|	zip->central_directory_entries_total = 0;
 4154|  1.12k|	while (1) {
  ------------------
  |  Branch (4154:9): [True: 1.12k, Folded]
  ------------------
 4155|  1.12k|		struct zip_entry *zip_entry;
 4156|  1.12k|		size_t filename_length, extra_length, comment_length;
 4157|  1.12k|		uint32_t external_attributes;
 4158|  1.12k|		const char *name, *r;
 4159|       |
 4160|  1.12k|		if ((p = __archive_read_ahead(a, 4, NULL)) == NULL)
  ------------------
  |  Branch (4160:7): [True: 0, False: 1.12k]
  ------------------
 4161|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4162|  1.12k|		if (memcmp(p, "PK\006\006", 4) == 0
  ------------------
  |  Branch (4162:7): [True: 0, False: 1.12k]
  ------------------
 4163|  1.12k|		    || memcmp(p, "PK\005\006", 4) == 0) {
  ------------------
  |  Branch (4163:10): [True: 23, False: 1.09k]
  ------------------
 4164|     23|			break;
 4165|  1.09k|		} else if (memcmp(p, "PK\001\002", 4) != 0) {
  ------------------
  |  Branch (4165:14): [True: 11, False: 1.08k]
  ------------------
 4166|     11|			archive_set_error(&a->archive,
 4167|     11|			    -1, "Invalid central directory signature");
 4168|     11|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|     11|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4169|     11|		}
 4170|  1.08k|		if ((p = __archive_read_ahead(a, 46, NULL)) == NULL)
  ------------------
  |  Branch (4170:7): [True: 0, False: 1.08k]
  ------------------
 4171|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4172|       |
 4173|  1.08k|		zip_entry = calloc(1, sizeof(struct zip_entry));
 4174|  1.08k|		if (zip_entry == NULL) {
  ------------------
  |  Branch (4174:7): [True: 0, False: 1.08k]
  ------------------
 4175|      0|			archive_set_error(&a->archive, ENOMEM,
 4176|      0|				"Can't allocate zip entry");
 4177|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4178|      0|		}
 4179|  1.08k|		zip_entry->next = zip->zip_entries;
 4180|  1.08k|		zip_entry->flags |= LA_FROM_CENTRAL_DIRECTORY;
  ------------------
  |  |  137|  1.08k|#define LA_FROM_CENTRAL_DIRECTORY (1 << 1)
  ------------------
 4181|  1.08k|		zip->zip_entries = zip_entry;
 4182|  1.08k|		zip->central_directory_entries_total++;
 4183|       |
 4184|       |		/* version = p[4]; */
 4185|  1.08k|		zip_entry->system = p[5];
 4186|       |		/* version_required = archive_le16dec(p + 6); */
 4187|  1.08k|		zip_entry->zip_flags = archive_le16dec(p + 8);
 4188|  1.08k|		if (zip_entry->zip_flags
  ------------------
  |  Branch (4188:7): [True: 2, False: 1.08k]
  ------------------
 4189|  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)
  ------------------
 4190|      2|			zip->has_encrypted_entries = 1;
 4191|      2|		}
 4192|  1.08k|		zip_entry->compression = (char)archive_le16dec(p + 10);
 4193|  1.08k|		zip_entry->mtime = dos_to_unix(archive_le32dec(p + 12));
 4194|  1.08k|		zip_entry->crc32 = archive_le32dec(p + 16);
 4195|  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 (4195:7): [True: 34, False: 1.05k]
  ------------------
 4196|     34|			zip_entry->decdat = p[13];
 4197|  1.05k|		else
 4198|  1.05k|			zip_entry->decdat = p[19];
 4199|  1.08k|		zip_entry->compressed_size = archive_le32dec(p + 20);
 4200|  1.08k|		zip_entry->uncompressed_size = archive_le32dec(p + 24);
 4201|  1.08k|		filename_length = archive_le16dec(p + 28);
 4202|  1.08k|		extra_length = archive_le16dec(p + 30);
 4203|  1.08k|		comment_length = archive_le16dec(p + 32);
 4204|       |		/* disk_start = archive_le16dec(p + 34);
 4205|       |		 *   Better be zero.
 4206|       |		 * internal_attributes = archive_le16dec(p + 36);
 4207|       |		 *   text bit */
 4208|  1.08k|		external_attributes = archive_le32dec(p + 38);
 4209|  1.08k|		zip_entry->local_header_offset =
 4210|  1.08k|		    archive_le32dec(p + 42) + correction;
 4211|       |
 4212|       |		/* If we can't guess the mode, leave it zero here;
 4213|       |		   when we read the local file header we might get
 4214|       |		   more information. */
 4215|  1.08k|		if (zip_entry->system == 3) {
  ------------------
  |  Branch (4215:7): [True: 429, False: 657]
  ------------------
 4216|    429|			zip_entry->mode = external_attributes >> 16;
 4217|    657|		} else if (zip_entry->system == 0) {
  ------------------
  |  Branch (4217:14): [True: 657, False: 0]
  ------------------
 4218|       |			// Interpret MSDOS directory bit
 4219|    657|			if (0x10 == (external_attributes & 0x10)) {
  ------------------
  |  Branch (4219:8): [True: 104, False: 553]
  ------------------
 4220|    104|				zip_entry->mode = AE_IFDIR | 0775;
  ------------------
  |  |  221|    104|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 4221|    553|			} else {
 4222|    553|				zip_entry->mode = AE_IFREG | 0664;
  ------------------
  |  |  216|    553|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 4223|    553|			}
 4224|    657|			if (0x01 == (external_attributes & 0x01)) {
  ------------------
  |  Branch (4224:8): [True: 0, False: 657]
  ------------------
 4225|       |				// Read-only bit; strip write permissions
 4226|      0|				zip_entry->mode &= 0555;
 4227|      0|			}
 4228|    657|		} else {
 4229|      0|			zip_entry->mode = 0;
 4230|      0|		}
 4231|       |
 4232|       |		/* We're done with the regular data; get the filename and
 4233|       |		 * extra data. */
 4234|  1.08k|		__archive_read_consume(a, 46);
 4235|  1.08k|		p = __archive_read_ahead(a, filename_length + extra_length,
 4236|  1.08k|			NULL);
 4237|  1.08k|		if (p == NULL) {
  ------------------
  |  Branch (4237:7): [True: 1, False: 1.08k]
  ------------------
 4238|      1|			archive_set_error(&a->archive,
 4239|      1|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4240|      1|			    "Truncated ZIP file header");
 4241|      1|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4242|      1|		}
 4243|  1.08k|		if (ARCHIVE_OK != process_extra(a, entry, p + filename_length,
  ------------------
  |  |  233|  1.08k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4243:7): [True: 4, False: 1.08k]
  ------------------
 4244|  1.08k|		    extra_length, zip_entry)) {
 4245|      4|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4246|      4|		}
 4247|       |
 4248|       |		/*
 4249|       |		 * Mac resource fork files are stored under the
 4250|       |		 * "__MACOSX/" directory, so we should check if
 4251|       |		 * it is.
 4252|       |		 */
 4253|  1.08k|		if (!zip->process_mac_extensions) {
  ------------------
  |  Branch (4253:7): [True: 1.08k, False: 0]
  ------------------
 4254|       |			/* Treat every entry as a regular entry. */
 4255|  1.08k|			__archive_rb_tree_insert_node(&zip->tree,
 4256|  1.08k|			    &zip_entry->node);
 4257|  1.08k|		} else {
 4258|      0|			name = p;
 4259|      0|			r = rsrc_basename(name, filename_length);
 4260|      0|			if (filename_length >= 9 &&
  ------------------
  |  Branch (4260:8): [True: 0, False: 0]
  ------------------
 4261|      0|			    strncmp("__MACOSX/", name, 9) == 0) {
  ------------------
  |  Branch (4261:8): [True: 0, False: 0]
  ------------------
 4262|       |				/* If this file is not a resource fork nor
 4263|       |				 * a directory. We should treat it as a non
 4264|       |				 * resource fork file to expose it. */
 4265|      0|				if (name[filename_length-1] != '/' &&
  ------------------
  |  Branch (4265:9): [True: 0, False: 0]
  ------------------
 4266|      0|				    (r - name < 3 || r[0] != '.' ||
  ------------------
  |  Branch (4266:10): [True: 0, False: 0]
  |  Branch (4266:26): [True: 0, False: 0]
  ------------------
 4267|      0|				     r[1] != '_')) {
  ------------------
  |  Branch (4267:10): [True: 0, False: 0]
  ------------------
 4268|      0|					__archive_rb_tree_insert_node(
 4269|      0|					    &zip->tree, &zip_entry->node);
 4270|       |					/* Expose its parent directories. */
 4271|      0|					expose_parent_dirs(zip, name,
 4272|      0|					    filename_length);
 4273|      0|				} else {
 4274|       |					/* This file is a resource fork file or
 4275|       |					 * a directory. */
 4276|      0|					archive_strncpy(&(zip_entry->rsrcname),
  ------------------
  |  |  173|      0|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 4277|      0|					     name, filename_length);
 4278|      0|					__archive_rb_tree_insert_node(
 4279|      0|					    &zip->tree_rsrc, &zip_entry->node);
 4280|      0|				}
 4281|      0|			} else {
 4282|       |				/* Generate resource fork name to find its
 4283|       |				 * resource file at zip->tree_rsrc. */
 4284|       |
 4285|       |				/* If this is an entry ending with slash,
 4286|       |				 * make the resource for name slash-less
 4287|       |				 * as the actual resource fork doesn't end with '/'.
 4288|       |				 */
 4289|      0|				size_t tmp_length = filename_length;
 4290|      0|				if (tmp_length > 0 && name[tmp_length - 1] == '/') {
  ------------------
  |  Branch (4290:9): [True: 0, False: 0]
  |  Branch (4290:27): [True: 0, False: 0]
  ------------------
 4291|      0|					tmp_length--;
 4292|      0|					r = rsrc_basename(name, tmp_length);
 4293|      0|				}
 4294|       |
 4295|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4296|      0|				    "__MACOSX/");
 4297|      0|				archive_strncat(&(zip_entry->rsrcname),
 4298|      0|				    name, r - name);
 4299|      0|				archive_strcat(&(zip_entry->rsrcname), "._");
 4300|      0|				archive_strncat(&(zip_entry->rsrcname),
 4301|      0|				    name + (r - name),
 4302|      0|				    tmp_length - (r - name));
 4303|       |				/* Register an entry to RB tree to sort it by
 4304|       |				 * file offset. */
 4305|      0|				__archive_rb_tree_insert_node(&zip->tree,
 4306|      0|				    &zip_entry->node);
 4307|      0|			}
 4308|      0|		}
 4309|       |
 4310|       |		/* Skip the comment too ... */
 4311|  1.08k|		__archive_read_consume(a,
 4312|  1.08k|		    filename_length + extra_length + comment_length);
 4313|  1.08k|	}
 4314|       |
 4315|     23|	return ARCHIVE_OK;
  ------------------
  |  |  233|     23|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4316|     39|}
archive_read_support_format_zip.c:cmp_node:
 4004|  6.83k|{
 4005|  6.83k|	const struct zip_entry *e1 = (const struct zip_entry *)n1;
 4006|  6.83k|	const struct zip_entry *e2 = (const struct zip_entry *)n2;
 4007|       |
 4008|  6.83k|	if (e1->local_header_offset > e2->local_header_offset)
  ------------------
  |  Branch (4008:6): [True: 701, False: 6.13k]
  ------------------
 4009|    701|		return -1;
 4010|  6.13k|	if (e1->local_header_offset < e2->local_header_offset)
  ------------------
  |  Branch (4010:6): [True: 6.13k, False: 0]
  ------------------
 4011|  6.13k|		return 1;
 4012|      0|	return 0;
 4013|  6.13k|}
archive_read_support_format_zip.c:archive_read_format_zip_read_data_skip_seekable:
 4575|    208|{
 4576|    208|	struct zip *zip;
 4577|    208|	zip = (struct zip *)(a->format->data);
 4578|       |
 4579|    208|	zip->unconsumed = 0;
 4580|    208|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    208|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4581|    208|}
archive_read_support_format_zip.c:archive_read_support_format_zip_capabilities_seekable:
 3844|     78|{
 3845|     78|	(void)a; /* UNUSED */
 3846|     78|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA |
  ------------------
  |  |  398|     78|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
 3847|     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.) */
  ------------------
 3848|     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|  5.95M|{
  272|  5.95M|	as->length = 0;
  273|  5.95M|	as->buffer_length = 0;
  274|  5.95M|	free(as->s);
  275|       |	as->s = NULL;
  276|  5.95M|}
archive_wstring_free:
  280|  1.88M|{
  281|  1.88M|	as->length = 0;
  282|  1.88M|	as->buffer_length = 0;
  283|  1.88M|	free(as->s);
  284|       |	as->s = NULL;
  285|  1.88M|}
archive_wstring_ensure:
  289|   116k|{
  290|   116k|	return (struct archive_wstring *)
  291|   116k|		archive_string_ensure((struct archive_string *)as,
  292|   116k|					s * sizeof(wchar_t));
  293|   116k|}
archive_string_ensure:
  298|  13.0M|{
  299|  13.0M|	char *p;
  300|  13.0M|	size_t new_length;
  301|       |
  302|       |	/* If buffer is already big enough, don't reallocate. */
  303|  13.0M|	if (as->s && (s <= as->buffer_length))
  ------------------
  |  Branch (303:6): [True: 12.6M, False: 387k]
  |  Branch (303:15): [True: 12.6M, False: 15.0k]
  ------------------
  304|  12.6M|		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|   402k|	if (as->buffer_length < 32)
  ------------------
  |  Branch (313:6): [True: 387k, False: 15.0k]
  ------------------
  314|       |		/* Start with a minimum 32-character buffer. */
  315|   387k|		new_length = 32;
  316|  15.0k|	else if (as->buffer_length < 8192)
  ------------------
  |  Branch (316:11): [True: 13.8k, False: 1.22k]
  ------------------
  317|       |		/* Buffers under 8k are doubled for speed. */
  318|  13.8k|		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|   402k|	if (new_length < s)
  ------------------
  |  Branch (335:6): [True: 87.1k, False: 315k]
  ------------------
  336|  87.1k|		new_length = s;
  337|       |	/* Now we can reallocate the buffer. */
  338|   402k|	p = realloc(as->s, new_length);
  339|   402k|	if (p == NULL) {
  ------------------
  |  Branch (339:6): [True: 0, False: 402k]
  ------------------
  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|   402k|	as->s = p;
  347|   402k|	as->buffer_length = new_length;
  348|   402k|	return (as);
  349|   402k|}
archive_strncat:
  360|   180k|{
  361|   180k|	size_t s;
  362|   180k|	const char *p, *pp;
  363|       |
  364|   180k|	p = (const char *)_p;
  365|       |
  366|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
  367|   180k|	s = 0;
  368|   180k|	pp = p;
  369|  62.1M|	while (s < n && *pp) {
  ------------------
  |  Branch (369:9): [True: 62.0M, False: 87.2k]
  |  Branch (369:18): [True: 61.9M, False: 93.1k]
  ------------------
  370|  61.9M|		pp++;
  371|  61.9M|		s++;
  372|  61.9M|	}
  373|   180k|	if ((as = archive_string_append(as, p, s)) == NULL)
  ------------------
  |  Branch (373:6): [True: 0, False: 180k]
  ------------------
  374|      0|		__archive_errx(1, "Out of memory");
  375|   180k|	return (as);
  376|   180k|}
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.0k|{
  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.0k|	return archive_strncat(as, p, 0x1000000);
  406|  75.0k|}
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|   104k|{
  622|   104k|	size_t r;
  623|   104k|	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|   104k|	size_t mbs_length = len;
  630|   104k|	const char *mbs = p;
  631|   104k|	wchar_t *wcs;
  632|   104k|#if HAVE_MBRTOWC
  633|   104k|	mbstate_t shift_state;
  634|       |
  635|   104k|	memset(&shift_state, 0, sizeof(shift_state));
  636|   104k|#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|   104k|	if (NULL == archive_wstring_ensure(dest, dest->length + len + 1))
  ------------------
  |  Branch (641:6): [True: 0, False: 104k]
  ------------------
  642|      0|		return (-1);
  643|   104k|	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: 72.4k]
  |  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|   104k|	dest->length = wcs - dest->s;
  683|   104k|	dest->s[dest->length] = L'\0';
  684|   104k|	return (ret_val);
  685|   104k|}
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|  10.8k|{
 1788|  10.8k|	int flag = SCONV_FROM_CHARSET;
  ------------------
  |  |   91|  10.8k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
 1789|       |
 1790|  10.8k|	if (best_effort)
  ------------------
  |  Branch (1790:6): [True: 10.8k, False: 0]
  ------------------
 1791|  10.8k|		flag |= SCONV_BEST_EFFORT;
  ------------------
  |  |   93|  10.8k|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
 1792|  10.8k|	return (get_sconv_object(a, charset, get_current_charset(a), flag));
 1793|  10.8k|}
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.95k|	for (sc = a->sconv; sc != NULL; sc = sc_next) {
  ------------------
  |  Branch (1871:22): [True: 460, False: 2.49k]
  ------------------
 1872|    460|		sc_next = sc->next;
 1873|    460|		free_sconv_object(sc);
 1874|    460|	}
 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|   186k|{
 2009|   186k|	as->length = 0;
 2010|   186k|	return (archive_strncat_l(as, _p, n, sc));
 2011|   186k|}
archive_strncat_l:
 2016|   186k|{
 2017|   186k|	const void *s;
 2018|   186k|	size_t length = 0;
 2019|   186k|	int i, r = 0, r2;
 2020|       |
 2021|   186k|	if (_p != NULL && n > 0) {
  ------------------
  |  Branch (2021:6): [True: 186k, False: 0]
  |  Branch (2021:20): [True: 121k, False: 64.2k]
  ------------------
 2022|   121k|		if (sc != NULL && (sc->flag & SCONV_FROM_UTF16))
  ------------------
  |  |  112|  60.0k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  60.0k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  60.0k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2022:7): [True: 60.0k, False: 61.8k]
  |  Branch (2022:21): [True: 670, False: 59.3k]
  ------------------
 2023|    670|			length = utf16nbytes(_p, n);
 2024|   121k|		else
 2025|   121k|			length = mbsnbytes(_p, n);
 2026|   121k|	}
 2027|       |
 2028|       |	/* We must allocate memory even if there is no data for conversion
 2029|       |	 * or copy. This simulates archive_string_append behavior. */
 2030|   186k|	if (length == 0) {
  ------------------
  |  Branch (2030:6): [True: 78.0k, False: 108k]
  ------------------
 2031|  78.0k|		size_t tn = 1;
 2032|  78.0k|		if (sc != NULL && (sc->flag & SCONV_TO_UTF16))
  ------------------
  |  |  111|  46.5k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|  46.5k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|  46.5k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2032:7): [True: 46.5k, False: 31.4k]
  |  Branch (2032:21): [True: 0, False: 46.5k]
  ------------------
 2033|      0|			tn = 2;
 2034|  78.0k|		if (archive_string_ensure(as, as->length + tn) == NULL)
  ------------------
  |  Branch (2034:7): [True: 0, False: 78.0k]
  ------------------
 2035|      0|			return (-1);
 2036|  78.0k|		as->s[as->length] = 0;
 2037|  78.0k|		if (tn == 2)
  ------------------
  |  Branch (2037:7): [True: 0, False: 78.0k]
  ------------------
 2038|      0|			as->s[as->length+1] = 0;
 2039|  78.0k|		return (0);
 2040|  78.0k|	}
 2041|       |
 2042|       |	/*
 2043|       |	 * If sc is NULL, we just make a copy.
 2044|       |	 */
 2045|   108k|	if (sc == NULL) {
  ------------------
  |  Branch (2045:6): [True: 48.2k, False: 59.8k]
  ------------------
 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|  59.8k|	s = _p;
 2052|  59.8k|	i = 0;
 2053|  59.8k|	if (sc->nconverter > 1) {
  ------------------
  |  Branch (2053:6): [True: 12.8k, False: 47.0k]
  ------------------
 2054|  12.8k|		sc->utftmp.length = 0;
 2055|  12.8k|		r2 = sc->converter[0](&(sc->utftmp), s, length, sc);
 2056|  12.8k|		if (r2 != 0 && errno == ENOMEM)
  ------------------
  |  Branch (2056:7): [True: 5.90k, False: 6.90k]
  |  Branch (2056:18): [True: 0, False: 5.90k]
  ------------------
 2057|      0|			return (r2);
 2058|  12.8k|		if (r > r2)
  ------------------
  |  Branch (2058:7): [True: 5.90k, False: 6.90k]
  ------------------
 2059|  5.90k|			r = r2;
 2060|  12.8k|		s = sc->utftmp.s;
 2061|  12.8k|		length = sc->utftmp.length;
 2062|  12.8k|		++i;
 2063|  12.8k|	}
 2064|  59.8k|	r2 = sc->converter[i](as, s, length, sc);
 2065|  59.8k|	if (r > r2)
  ------------------
  |  Branch (2065:6): [True: 17.8k, False: 41.9k]
  ------------------
 2066|  17.8k|		r = r2;
 2067|  59.8k|	return (r);
 2068|  59.8k|}
archive_mstring_clean:
 3921|  1.87M|{
 3922|  1.87M|	archive_wstring_free(&(aes->aes_wcs));
 3923|  1.87M|	archive_string_free(&(aes->aes_mbs));
 3924|  1.87M|	archive_string_free(&(aes->aes_utf8));
 3925|  1.87M|	archive_string_free(&(aes->aes_mbs_in_locale));
 3926|  1.87M|	aes->aes_set = 0;
 3927|  1.87M|}
archive_mstring_get_utf8:
 3941|  91.2k|{
 3942|  91.2k|	struct archive_string_conv *sc;
 3943|  91.2k|	int r;
 3944|       |
 3945|       |	/* If we already have a UTF8 form, return that immediately. */
 3946|  91.2k|	if (aes->aes_set & AES_SET_UTF8) {
  ------------------
  |  |  221|  91.2k|#define	AES_SET_UTF8 2
  ------------------
  |  Branch (3946:6): [True: 6.93k, False: 84.2k]
  ------------------
 3947|  6.93k|		*p = aes->aes_utf8.s;
 3948|  6.93k|		return (0);
 3949|  6.93k|	}
 3950|       |
 3951|  84.2k|	*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.2k|	if ((aes->aes_set & AES_SET_MBS) == 0) {
  ------------------
  |  |  220|  84.2k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (3977:6): [True: 1.96k, False: 82.3k]
  ------------------
 3978|  1.96k|		const char *pm; /* unused */
 3979|  1.96k|		archive_mstring_get_mbs(a, aes, &pm); /* ignore errors, we'll handle it later */
 3980|  1.96k|	}
 3981|  84.2k|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|  84.2k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (3981:6): [True: 82.3k, False: 1.96k]
  ------------------
 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.2k, False: 17.1k]
  ------------------
 3990|  65.2k|			aes->aes_set |= AES_SET_UTF8;
  ------------------
  |  |  221|  65.2k|#define	AES_SET_UTF8 2
  ------------------
 3991|  65.2k|			*p = aes->aes_utf8.s;
 3992|  65.2k|			return (0);/* success. */
 3993|  65.2k|		} else
 3994|  17.1k|			return (-1);/* failure. */
 3995|  82.3k|	}
 3996|  1.96k|	return (0);/* success. */
 3997|  84.2k|}
archive_mstring_get_mbs:
 4002|   176k|{
 4003|   176k|	struct archive_string_conv *sc;
 4004|   176k|	int r, ret = 0;
 4005|       |
 4006|       |	/* If we already have an MBS form, return that immediately. */
 4007|   176k|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|   176k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4007:6): [True: 89.9k, False: 86.6k]
  ------------------
 4008|  89.9k|		*p = aes->aes_mbs.s;
 4009|  89.9k|		return (ret);
 4010|  89.9k|	}
 4011|       |
 4012|  86.6k|	*p = NULL;
 4013|       |	/* If there's a WCS form, try converting with the native locale. */
 4014|  86.6k|	if (aes->aes_set & AES_SET_WCS) {
  ------------------
  |  |  222|  86.6k|#define	AES_SET_WCS 4
  ------------------
  |  Branch (4014:6): [True: 3.35k, False: 83.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|  83.2k|	if (aes->aes_set & AES_SET_UTF8) {
  ------------------
  |  |  221|  83.2k|#define	AES_SET_UTF8 2
  ------------------
  |  Branch (4027:6): [True: 12, False: 83.2k]
  ------------------
 4028|     12|		archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|     12|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4029|     12|		sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 4030|     12|		if (sc == NULL)
  ------------------
  |  Branch (4030:7): [True: 0, False: 12]
  ------------------
 4031|      0|			return (-1);/* Couldn't allocate memory for sc. */
 4032|     12|		r = archive_strncpy_l(&(aes->aes_mbs),
 4033|     12|			aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4034|     12|		if (a == NULL)
  ------------------
  |  Branch (4034:7): [True: 12, False: 0]
  ------------------
 4035|     12|			free_sconv_object(sc);
 4036|     12|		*p = aes->aes_mbs.s;
 4037|     12|		if (r == 0) {
  ------------------
  |  Branch (4037:7): [True: 0, False: 12]
  ------------------
 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|     12|			ret = -1;/* failure. */
 4042|     12|	}
 4043|  83.2k|	return (ret);
 4044|  83.2k|}
archive_mstring_get_wcs:
 4049|   210k|{
 4050|   210k|	int r, ret = 0;
 4051|       |
 4052|   210k|	(void)a;/* UNUSED */
 4053|       |	/* Return WCS form if we already have it. */
 4054|   210k|	if (aes->aes_set & AES_SET_WCS) {
  ------------------
  |  |  222|   210k|#define	AES_SET_WCS 4
  ------------------
  |  Branch (4054:6): [True: 78.9k, False: 131k]
  ------------------
 4055|  78.9k|		*wp = aes->aes_wcs.s;
 4056|  78.9k|		return (ret);
 4057|  78.9k|	}
 4058|       |
 4059|   131k|	*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|   131k|	if ((aes->aes_set & AES_SET_MBS) == 0) {
  ------------------
  |  |  220|   131k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4087:6): [True: 34.4k, False: 97.2k]
  ------------------
 4088|  34.4k|		const char *p; /* unused */
 4089|  34.4k|		archive_mstring_get_mbs(a, aes, &p); /* ignore errors, we'll handle it later */
 4090|  34.4k|	}
 4091|       |	/* Try converting MBS to WCS using native locale. */
 4092|   131k|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|   131k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4092:6): [True: 97.2k, False: 34.4k]
  ------------------
 4093|  97.2k|		archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  97.2k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4094|  97.2k|		r = archive_wstring_append_from_mbs(&(aes->aes_wcs),
 4095|  97.2k|		    aes->aes_mbs.s, aes->aes_mbs.length);
 4096|  97.2k|		if (r == 0) {
  ------------------
  |  Branch (4096:7): [True: 65.2k, False: 31.9k]
  ------------------
 4097|  65.2k|			aes->aes_set |= AES_SET_WCS;
  ------------------
  |  |  222|  65.2k|#define	AES_SET_WCS 4
  ------------------
 4098|  65.2k|			*wp = aes->aes_wcs.s;
 4099|  65.2k|		} else
 4100|  31.9k|			ret = -1;/* failure. */
 4101|  97.2k|	}
 4102|   131k|	return (ret);
 4103|   210k|}
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|  25.9k|{
 4185|  25.9k|	if (mbs == NULL) {
  ------------------
  |  Branch (4185:6): [True: 0, False: 25.9k]
  ------------------
 4186|      0|		aes->aes_set = 0;
 4187|      0|		return (0);
 4188|      0|	}
 4189|  25.9k|	aes->aes_set = AES_SET_MBS; /* Only MBS form is set now. */
  ------------------
  |  |  220|  25.9k|#define	AES_SET_MBS 1
  ------------------
 4190|  25.9k|	archive_strncpy(&(aes->aes_mbs), mbs, len);
  ------------------
  |  |  173|  25.9k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 4191|  25.9k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|  25.9k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4192|  25.9k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  25.9k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4193|  25.9k|	return (0);
 4194|  25.9k|}
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.86k, False: 93.3k]
  ------------------
 4239|  2.86k|		aes->aes_set = 0;
 4240|  2.86k|		return (0);
 4241|  2.86k|	}
 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|  10.4k|{
 4329|  10.4k|	struct archive_string_conv *sc;
 4330|  10.4k|	int r;
 4331|       |
 4332|  10.4k|	if (utf8 == NULL) {
  ------------------
  |  Branch (4332:6): [True: 0, False: 10.4k]
  ------------------
 4333|      0|		aes->aes_set = 0;
 4334|      0|		return (0); /* Succeeded in clearing everything. */
 4335|      0|	}
 4336|       |
 4337|       |	/* Save the UTF8 string. */
 4338|  10.4k|	archive_strcpy(&(aes->aes_utf8), utf8);
  ------------------
  |  |  165|  10.4k|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|  20.8k|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 10.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4339|       |
 4340|       |	/* Empty the mbs and wcs strings. */
 4341|  10.4k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  10.4k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4342|  10.4k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  10.4k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4343|       |
 4344|  10.4k|	aes->aes_set = AES_SET_UTF8;	/* Only UTF8 is set now. */
  ------------------
  |  |  221|  10.4k|#define	AES_SET_UTF8 2
  ------------------
 4345|       |
 4346|  10.4k|	sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 4347|  10.4k|	if (sc == NULL)
  ------------------
  |  Branch (4347:6): [True: 0, False: 10.4k]
  ------------------
 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|  10.4k|	r = archive_strcpy_l(&(aes->aes_mbs), utf8, sc);
  ------------------
  |  |  169|  10.4k|	archive_strncpy_l((as), (p), ((p) == NULL ? 0 : strlen(p)), (lo))
  |  |  ------------------
  |  |  |  Branch (169:32): [True: 0, False: 10.4k]
  |  |  ------------------
  ------------------
 4371|       |
 4372|  10.4k|	if (a == NULL)
  ------------------
  |  Branch (4372:6): [True: 10.4k, False: 0]
  ------------------
 4373|  10.4k|		free_sconv_object(sc);
 4374|  10.4k|	if (r != 0)
  ------------------
  |  Branch (4374:6): [True: 3.18k, False: 7.23k]
  ------------------
 4375|  3.18k|		return (-1);
 4376|  7.23k|	aes->aes_set = AES_SET_UTF8 | AES_SET_MBS; /* Both UTF8 and MBS set. */
  ------------------
  |  |  221|  7.23k|#define	AES_SET_UTF8 2
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_MBS; /* Both UTF8 and MBS set. */
  ------------------
  |  |  220|  7.23k|#define	AES_SET_MBS 1
  ------------------
 4377|       |
 4378|       |	/* Try converting MBS to WCS, return false on failure. */
 4379|  7.23k|	if (archive_wstring_append_from_mbs(&(aes->aes_wcs), aes->aes_mbs.s,
  ------------------
  |  Branch (4379:6): [True: 0, False: 7.23k]
  ------------------
 4380|  7.23k|	    aes->aes_mbs.length))
 4381|      0|		return (-1);
 4382|  7.23k|#endif
 4383|       |
 4384|       |	/* All conversions succeeded. */
 4385|  7.23k|	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  221|  7.23k|#define	AES_SET_UTF8 2
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  222|  7.23k|#define	AES_SET_WCS 4
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  220|  7.23k|#define	AES_SET_MBS 1
  ------------------
 4386|       |
 4387|  7.23k|	return (0);
 4388|  7.23k|}
archive_string.c:archive_string_append:
  226|  12.4M|{
  227|  12.4M|	if (archive_string_ensure(as, as->length + s + 1) == NULL)
  ------------------
  |  Branch (227:6): [True: 0, False: 12.4M]
  ------------------
  228|      0|		return (NULL);
  229|  12.4M|	if (s)
  ------------------
  |  Branch (229:6): [True: 12.4M, False: 13.4k]
  ------------------
  230|  12.4M|		memmove(as->s + as->length, p, s);
  231|  12.4M|	as->length += s;
  232|  12.4M|	as->s[as->length] = 0;
  233|  12.4M|	return (as);
  234|  12.4M|}
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|  93.2k|{
 1695|  93.2k|	struct archive_string_conv *sc;
 1696|  93.2k|	unsigned current_codepage;
 1697|       |
 1698|       |	/* Check if we have made the sconv object. */
 1699|  93.2k|	sc = find_sconv_object(a, fc, tc);
 1700|  93.2k|	if (sc != NULL)
  ------------------
  |  Branch (1700:6): [True: 0, False: 93.2k]
  ------------------
 1701|      0|		return (sc);
 1702|       |
 1703|  93.2k|	if (a == NULL)
  ------------------
  |  Branch (1703:6): [True: 92.7k, False: 460]
  ------------------
 1704|  92.7k|		current_codepage = get_current_codepage();
 1705|    460|	else
 1706|    460|		current_codepage = a->current_codepage;
 1707|       |
 1708|  93.2k|	sc = create_sconv_object(canonical_charset_name(fc),
 1709|  93.2k|	    canonical_charset_name(tc), current_codepage, flag);
 1710|  93.2k|	if (sc == NULL) {
  ------------------
  |  Branch (1710:6): [True: 0, False: 93.2k]
  ------------------
 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|  93.2k|	if (sc->nconverter == 0) {
  ------------------
  |  Branch (1722:6): [True: 0, False: 93.2k]
  ------------------
 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|  93.2k|	if (a != NULL)
  ------------------
  |  Branch (1742:6): [True: 460, False: 92.7k]
  ------------------
 1743|    460|		add_sconv_object(a, sc);
 1744|  93.2k|	return (sc);
 1745|  93.2k|}
archive_string.c:find_sconv_object:
  906|  93.2k|{
  907|  93.2k|	struct archive_string_conv *sc; 
  908|       |
  909|  93.2k|	if (a == NULL)
  ------------------
  |  Branch (909:6): [True: 92.7k, False: 460]
  ------------------
  910|  92.7k|		return (NULL);
  911|       |
  912|    460|	for (sc = a->sconv; sc != NULL; sc = sc->next) {
  ------------------
  |  Branch (912:22): [True: 0, False: 460]
  ------------------
  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|    460|	return (sc);
  918|  93.2k|}
archive_string.c:get_current_codepage:
 1672|  93.2k|{
 1673|  93.2k|	return (-1);/* Unknown */
 1674|  93.2k|}
archive_string.c:create_sconv_object:
 1167|  93.2k|{
 1168|  93.2k|	struct archive_string_conv *sc; 
 1169|       |
 1170|  93.2k|	sc = calloc(1, sizeof(*sc));
 1171|  93.2k|	if (sc == NULL)
  ------------------
  |  Branch (1171:6): [True: 0, False: 93.2k]
  ------------------
 1172|      0|		return (NULL);
 1173|  93.2k|	sc->next = NULL;
 1174|  93.2k|	sc->from_charset = strdup(fc);
 1175|  93.2k|	if (sc->from_charset == NULL) {
  ------------------
  |  Branch (1175:6): [True: 0, False: 93.2k]
  ------------------
 1176|      0|		free(sc);
 1177|      0|		return (NULL);
 1178|      0|	}
 1179|  93.2k|	sc->to_charset = strdup(tc);
 1180|  93.2k|	if (sc->to_charset == NULL) {
  ------------------
  |  Branch (1180:6): [True: 0, False: 93.2k]
  ------------------
 1181|      0|		free(sc->from_charset);
 1182|      0|		free(sc);
 1183|      0|		return (NULL);
 1184|      0|	}
 1185|  93.2k|	archive_string_init(&sc->utftmp);
  ------------------
  |  |   71|  93.2k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 93.2k]
  |  |  ------------------
  ------------------
 1186|       |
 1187|  93.2k|	if (flag & SCONV_TO_CHARSET) {
  ------------------
  |  |   89|  93.2k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
  |  Branch (1187:6): [True: 82.3k, False: 10.8k]
  ------------------
 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|  10.8k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1198:13): [True: 10.8k, False: 0]
  ------------------
 1199|       |		/*
 1200|       |		 * Convert characters from a specified charset to
 1201|       |		 * the current locale charset.
 1202|       |		 */
 1203|  10.8k|		sc->to_cp = current_codepage;
 1204|  10.8k|		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|  10.8k|	}
 1210|       |
 1211|       |	/*
 1212|       |	 * Check if "from charset" and "to charset" are the same.
 1213|       |	 */
 1214|  93.2k|	if (strcmp(fc, tc) == 0 ||
  ------------------
  |  Branch (1214:6): [True: 0, False: 93.2k]
  ------------------
 1215|  93.2k|	    (sc->from_cp != (unsigned)-1 && sc->from_cp == sc->to_cp))
  ------------------
  |  Branch (1215:7): [True: 0, False: 93.2k]
  |  Branch (1215:38): [True: 0, False: 0]
  ------------------
 1216|      0|		sc->same = 1;
 1217|  93.2k|	else
 1218|  93.2k|		sc->same = 0;
 1219|       |
 1220|       |	/*
 1221|       |	 * Mark if "from charset" or "to charset" are UTF-8 or UTF-16BE/LE.
 1222|       |	 */
 1223|  93.2k|	if (strcmp(tc, "UTF-8") == 0)
  ------------------
  |  Branch (1223:6): [True: 82.3k, False: 10.8k]
  ------------------
 1224|  82.3k|		flag |= SCONV_TO_UTF8;
  ------------------
  |  |  105|  82.3k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
 1225|  10.8k|	else if (strcmp(tc, "UTF-16BE") == 0)
  ------------------
  |  Branch (1225:11): [True: 0, False: 10.8k]
  ------------------
 1226|      0|		flag |= SCONV_TO_UTF16BE;
  ------------------
  |  |  107|      0|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
 1227|  10.8k|	else if (strcmp(tc, "UTF-16LE") == 0)
  ------------------
  |  Branch (1227:11): [True: 0, False: 10.8k]
  ------------------
 1228|      0|		flag |= SCONV_TO_UTF16LE;
  ------------------
  |  |  109|      0|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  ------------------
 1229|  93.2k|	if (strcmp(fc, "UTF-8") == 0)
  ------------------
  |  Branch (1229:6): [True: 10.8k, False: 82.3k]
  ------------------
 1230|  10.8k|		flag |= SCONV_FROM_UTF8;
  ------------------
  |  |  106|  10.8k|#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: 18, False: 82.3k]
  ------------------
 1234|     18|		flag |= SCONV_FROM_UTF16LE;
  ------------------
  |  |  110|     18|#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|  93.2k|	if ((flag & SCONV_FROM_CHARSET) &&
  ------------------
  |  |   91|  93.2k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1261:6): [True: 10.8k, False: 82.3k]
  ------------------
 1262|  10.8k|	    (flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8))) {
  ------------------
  |  |  112|  10.8k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  10.8k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  10.8k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
              	    (flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8))) {
  ------------------
  |  |  106|  10.8k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (1262:6): [True: 10.8k, False: 0]
  ------------------
 1263|       |#if defined(__APPLE__)
 1264|       |		if (flag & SCONV_TO_UTF8)
 1265|       |			flag |= SCONV_NORMALIZATION_D;
 1266|       |		else
 1267|       |#endif
 1268|  10.8k|			flag |= SCONV_NORMALIZATION_C;
  ------------------
  |  |   98|  10.8k|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
 1269|  10.8k|	}
 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|  93.2k|#if defined(HAVE_ICONV)
 1295|  93.2k|	sc->cd_w = (iconv_t)-1;
 1296|       |	/*
 1297|       |	 * Create an iconv object.
 1298|       |	 */
 1299|  93.2k|	if (((flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) &&
  ------------------
  |  |  105|  93.2k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
              	if (((flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) &&
  ------------------
  |  |  111|  93.2k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|  93.2k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|  93.2k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1299:7): [True: 82.3k, False: 10.8k]
  ------------------
 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|  93.2k|	    (flag & SCONV_WIN_CP)) {
  ------------------
  |  |   94|  93.2k|#define SCONV_WIN_CP	 	(1<<3)	/* Use Windows API for converting
  ------------------
  |  Branch (1301:6): [True: 0, False: 93.2k]
  ------------------
 1302|       |		/* This case we won't use iconv. */
 1303|      0|		sc->cd = (iconv_t)-1;
 1304|  93.2k|	} else {
 1305|  93.2k|		sc->cd = iconv_open(tc, fc);
 1306|  93.2k|		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: 93.2k]
  |  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|  93.2k|	}
 1344|  93.2k|#endif	/* HAVE_ICONV */
 1345|       |
 1346|  93.2k|	sc->flag = flag;
 1347|       |
 1348|       |	/*
 1349|       |	 * Set up converters.
 1350|       |	 */
 1351|  93.2k|	setup_converter(sc);
 1352|       |
 1353|  93.2k|	return (sc);
 1354|  93.2k|}
archive_string.c:make_codepage_from_charset:
 1677|  93.2k|{
 1678|  93.2k|	(void)charset; /* UNUSED */
 1679|  93.2k|	return (-1);/* Unknown */
 1680|  93.2k|}
archive_string.c:canonical_charset_name:
 1127|   186k|{
 1128|   186k|	char cs[16];
 1129|   186k|	char *p;
 1130|   186k|	const char *s;
 1131|       |
 1132|   186k|	if (charset == NULL || charset[0] == '\0'
  ------------------
  |  Branch (1132:6): [True: 0, False: 186k]
  |  Branch (1132:25): [True: 0, False: 186k]
  ------------------
 1133|   186k|	    || strlen(charset) > 15)
  ------------------
  |  Branch (1133:9): [True: 0, False: 186k]
  ------------------
 1134|      0|		return (charset);
 1135|       |
 1136|       |	/* Copy name to uppercase. */
 1137|   186k|	p = cs;
 1138|   186k|	s = charset;
 1139|  1.95M|	while (*s) {
  ------------------
  |  Branch (1139:9): [True: 1.77M, False: 186k]
  ------------------
 1140|  1.77M|		char c = *s++;
 1141|  1.77M|		if (c >= 'a' && c <= 'z')
  ------------------
  |  Branch (1141:7): [True: 0, False: 1.77M]
  |  Branch (1141:19): [True: 0, False: 0]
  ------------------
 1142|      0|			c -= 'a' - 'A';
 1143|  1.77M|		*p++ = c;
 1144|  1.77M|	}
 1145|   186k|	*p++ = '\0';
 1146|       |
 1147|   186k|	if (strcmp(cs, "UTF-8") == 0 ||
  ------------------
  |  Branch (1147:6): [True: 93.1k, False: 93.2k]
  ------------------
 1148|  93.2k|	    strcmp(cs, "UTF8") == 0)
  ------------------
  |  Branch (1148:6): [True: 0, False: 93.2k]
  ------------------
 1149|  93.1k|		return ("UTF-8");
 1150|  93.2k|	if (strcmp(cs, "UTF-16BE") == 0 ||
  ------------------
  |  Branch (1150:6): [True: 29, False: 93.2k]
  ------------------
 1151|  93.2k|	    strcmp(cs, "UTF16BE") == 0)
  ------------------
  |  Branch (1151:6): [True: 0, False: 93.2k]
  ------------------
 1152|     29|		return ("UTF-16BE");
 1153|  93.2k|	if (strcmp(cs, "UTF-16LE") == 0 ||
  ------------------
  |  Branch (1153:6): [True: 18, False: 93.2k]
  ------------------
 1154|  93.2k|	    strcmp(cs, "UTF16LE") == 0)
  ------------------
  |  Branch (1154:6): [True: 0, False: 93.2k]
  ------------------
 1155|     18|		return ("UTF-16LE");
 1156|  93.2k|	if (strcmp(cs, "CP932") == 0)
  ------------------
  |  Branch (1156:6): [True: 0, False: 93.2k]
  ------------------
 1157|      0|		return ("CP932");
 1158|  93.2k|	return (charset);
 1159|  93.2k|}
archive_string.c:add_sconv_object:
  925|    460|{
  926|    460|	struct archive_string_conv **psc; 
  927|       |
  928|       |	/* Add a new sconv to sconv list. */
  929|    460|	psc = &(a->sconv);
  930|    460|	while (*psc != NULL)
  ------------------
  |  Branch (930:9): [True: 0, False: 460]
  ------------------
  931|      0|		psc = &((*psc)->next);
  932|    460|	*psc = sc;
  933|    460|}
archive_string.c:get_current_charset:
 1749|  93.2k|{
 1750|  93.2k|	const char *cur_charset;
 1751|       |
 1752|  93.2k|	if (a == NULL)
  ------------------
  |  Branch (1752:6): [True: 92.7k, False: 460]
  ------------------
 1753|  92.7k|		cur_charset = default_iconv_charset("");
 1754|    460|	else {
 1755|    460|		cur_charset = default_iconv_charset(a->current_code);
 1756|    460|		if (a->current_code == NULL) {
  ------------------
  |  Branch (1756:7): [True: 460, False: 0]
  ------------------
 1757|    460|			a->current_code = strdup(cur_charset);
 1758|    460|			a->current_codepage = get_current_codepage();
 1759|    460|			a->current_oemcp = get_current_oemcp();
 1760|    460|		}
 1761|    460|	}
 1762|  93.2k|	return (cur_charset);
 1763|  93.2k|}
archive_string.c:default_iconv_charset:
  445|  93.2k|default_iconv_charset(const char *charset) {
  446|  93.2k|	if (charset != NULL && charset[0] != '\0')
  ------------------
  |  Branch (446:6): [True: 92.7k, False: 460]
  |  Branch (446:25): [True: 0, False: 92.7k]
  ------------------
  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|  93.2k|	return nl_langinfo(CODESET);
  453|       |#else
  454|       |	return "";
  455|       |#endif
  456|  93.2k|}
archive_string.c:get_current_oemcp:
 1683|    460|{
 1684|    460|	return (-1);/* Unknown */
 1685|    460|}
archive_string.c:free_sconv_object:
 1361|  93.2k|{
 1362|  93.2k|	free(sc->from_charset);
 1363|  93.2k|	free(sc->to_charset);
 1364|  93.2k|	archive_string_free(&sc->utftmp);
 1365|  93.2k|#if HAVE_ICONV
 1366|  93.2k|	if (sc->cd != (iconv_t)-1)
  ------------------
  |  Branch (1366:6): [True: 93.2k, False: 0]
  ------------------
 1367|  93.2k|		iconv_close(sc->cd);
 1368|  93.2k|	if (sc->cd_w != (iconv_t)-1)
  ------------------
  |  Branch (1368:6): [True: 0, False: 93.2k]
  ------------------
 1369|      0|		iconv_close(sc->cd_w);
 1370|  93.2k|#endif
 1371|  93.2k|	free(sc);
 1372|  93.2k|}
archive_string.c:setup_converter:
  947|  93.2k|{
  948|       |
  949|       |	/* Reset. */
  950|  93.2k|	sc->nconverter = 0;
  951|       |
  952|       |	/*
  953|       |	 * Perform special sequence for the incorrect UTF-8 filenames
  954|       |	 * made by libarchive2.x.
  955|       |	 */
  956|  93.2k|	if (sc->flag & SCONV_UTF8_LIBARCHIVE_2) {
  ------------------
  |  |   96|  93.2k|#define SCONV_UTF8_LIBARCHIVE_2 (1<<4)	/* Incorrect UTF-8 made by libarchive
  ------------------
  |  Branch (956:6): [True: 0, False: 93.2k]
  ------------------
  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|  93.2k|	if (sc->flag & SCONV_TO_UTF16) {
  ------------------
  |  |  111|  93.2k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|  93.2k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|  93.2k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (964:6): [True: 0, False: 93.2k]
  ------------------
  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|  93.2k|	if (sc->flag & SCONV_FROM_UTF16) {
  ------------------
  |  |  112|  93.2k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  93.2k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  93.2k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1007:6): [True: 47, False: 93.1k]
  ------------------
 1008|       |		/*
 1009|       |		 * At least we should normalize a UTF-16BE string.
 1010|       |		 */
 1011|     47|		if (sc->flag & SCONV_NORMALIZATION_D)
  ------------------
  |  |  101|     47|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
  |  Branch (1011:7): [True: 0, False: 47]
  ------------------
 1012|      0|			add_converter(sc,archive_string_normalize_D);
 1013|     47|		else if (sc->flag & SCONV_NORMALIZATION_C)
  ------------------
  |  |   98|     47|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
  |  Branch (1013:12): [True: 47, False: 0]
  ------------------
 1014|     47|			add_converter(sc, archive_string_normalize_C);
 1015|       |
 1016|     47|		if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|     47|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (1016:7): [True: 0, False: 47]
  ------------------
 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|     47|#if defined(HAVE_ICONV)
 1039|     47|		if (sc->cd != (iconv_t)-1) {
  ------------------
  |  Branch (1039:7): [True: 47, False: 0]
  ------------------
 1040|     47|			add_converter(sc, iconv_strncat_in_locale);
 1041|     47|			return;
 1042|     47|		}
 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|     47|	}
 1056|       |
 1057|  93.1k|	if (sc->flag & SCONV_FROM_UTF8) {
  ------------------
  |  |  106|  93.1k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (1057:6): [True: 10.8k, False: 82.3k]
  ------------------
 1058|       |		/*
 1059|       |		 * At least we should normalize a UTF-8 string.
 1060|       |		 */
 1061|  10.8k|		if (sc->flag & SCONV_NORMALIZATION_D)
  ------------------
  |  |  101|  10.8k|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
  |  Branch (1061:7): [True: 0, False: 10.8k]
  ------------------
 1062|      0|			add_converter(sc,archive_string_normalize_D);
 1063|  10.8k|		else if (sc->flag & SCONV_NORMALIZATION_C)
  ------------------
  |  |   98|  10.8k|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
  |  Branch (1063:12): [True: 10.8k, False: 0]
  ------------------
 1064|  10.8k|			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|  10.8k|		if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|  10.8k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (1072:7): [True: 0, False: 10.8k]
  ------------------
 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|  10.8k|	}
 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|  93.1k|#if HAVE_ICONV
 1095|  93.1k|	if (sc->cd != (iconv_t)-1) {
  ------------------
  |  Branch (1095:6): [True: 93.1k, False: 0]
  ------------------
 1096|  93.1k|		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|  93.1k|		if ((sc->flag & SCONV_FROM_CHARSET) &&
  ------------------
  |  |   91|  93.1k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1102:7): [True: 10.8k, False: 82.3k]
  ------------------
 1103|  10.8k|		    (sc->flag & SCONV_TO_UTF8)) {
  ------------------
  |  |  105|  10.8k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (1103:7): [True: 0, False: 10.8k]
  ------------------
 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|  93.1k|		return;
 1108|  93.1k|	}
 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|   104k|{
  940|   104k|	if (sc == NULL || sc->nconverter >= 2)
  ------------------
  |  Branch (940:6): [True: 0, False: 104k]
  |  Branch (940:20): [True: 0, False: 104k]
  ------------------
  941|      0|		__archive_errx(1, "Programming error");
  942|   104k|	sc->converter[sc->nconverter++] = converter;
  943|   104k|}
archive_string.c:_utf8_to_unicode:
 2367|  30.1M|{
 2368|  30.1M|	static const char utf8_count[256] = {
 2369|  30.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 00 - 0F */
 2370|  30.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 10 - 1F */
 2371|  30.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 20 - 2F */
 2372|  30.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 30 - 3F */
 2373|  30.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 40 - 4F */
 2374|  30.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 50 - 5F */
 2375|  30.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 60 - 6F */
 2376|  30.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 70 - 7F */
 2377|  30.1M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 80 - 8F */
 2378|  30.1M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 90 - 9F */
 2379|  30.1M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* A0 - AF */
 2380|  30.1M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* B0 - BF */
 2381|  30.1M|		 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* C0 - CF */
 2382|  30.1M|		 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* D0 - DF */
 2383|  30.1M|		 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,/* E0 - EF */
 2384|  30.1M|		 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* F0 - FF */
 2385|  30.1M|	};
 2386|  30.1M|	int ch, i;
 2387|  30.1M|	int cnt;
 2388|  30.1M|	uint32_t wc;
 2389|       |
 2390|       |	/* Sanity check. */
 2391|  30.1M|	if (n == 0)
  ------------------
  |  Branch (2391:6): [True: 12.2k, False: 30.1M]
  ------------------
 2392|  12.2k|		return (0);
 2393|       |	/*
 2394|       |	 * Decode 1-4 bytes depending on the value of the first byte.
 2395|       |	 */
 2396|  30.1M|	ch = (unsigned char)*s;
 2397|  30.1M|	if (ch == 0)
  ------------------
  |  Branch (2397:6): [True: 0, False: 30.1M]
  ------------------
 2398|      0|		return (0); /* Standard:  return 0 for end-of-string. */
 2399|  30.1M|	cnt = utf8_count[ch];
 2400|       |
 2401|       |	/* Invalid sequence or there are not plenty bytes. */
 2402|  30.1M|	if (n < (size_t)cnt) {
  ------------------
  |  Branch (2402:6): [True: 514, False: 30.1M]
  ------------------
 2403|    514|		cnt = (int)n;
 2404|    514|		for (i = 1; i < cnt; i++) {
  ------------------
  |  Branch (2404:15): [True: 1, False: 513]
  ------------------
 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|    514|		goto invalid_sequence;
 2411|    514|	}
 2412|       |
 2413|       |	/* Make a Unicode code point from a single UTF-8 sequence. */
 2414|  30.1M|	switch (cnt) {
 2415|  30.1M|	case 1:	/* 1 byte sequence. */
  ------------------
  |  Branch (2415:2): [True: 30.1M, False: 66.9k]
  ------------------
 2416|  30.1M|		*pwc = ch & 0x7f;
 2417|  30.1M|		return (cnt);
 2418|  21.0k|	case 2:	/* 2 bytes sequence. */
  ------------------
  |  Branch (2418:2): [True: 21.0k, False: 30.1M]
  ------------------
 2419|  21.0k|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2419:7): [True: 8.31k, False: 12.7k]
  ------------------
 2420|  8.31k|			cnt = 1;
 2421|  8.31k|			goto invalid_sequence;
 2422|  8.31k|		}
 2423|  12.7k|		*pwc = ((ch & 0x1f) << 6) | (s[1] & 0x3f);
 2424|  12.7k|		return (cnt);
 2425|  11.0k|	case 3:	/* 3 bytes sequence. */
  ------------------
  |  Branch (2425:2): [True: 11.0k, False: 30.1M]
  ------------------
 2426|  11.0k|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2426:7): [True: 1.38k, False: 9.61k]
  ------------------
 2427|  1.38k|			cnt = 1;
 2428|  1.38k|			goto invalid_sequence;
 2429|  1.38k|		}
 2430|  9.61k|		if ((s[2] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2430:7): [True: 2.85k, False: 6.76k]
  ------------------
 2431|  2.85k|			cnt = 2;
 2432|  2.85k|			goto invalid_sequence;
 2433|  2.85k|		}
 2434|  6.76k|		wc = ((ch & 0x0f) << 12)
 2435|  6.76k|		    | ((s[1] & 0x3f) << 6)
 2436|  6.76k|		    | (s[2] & 0x3f);
 2437|  6.76k|		if (wc < 0x800)
  ------------------
  |  Branch (2437:7): [True: 4, False: 6.76k]
  ------------------
 2438|      4|			goto invalid_sequence;/* Overlong sequence. */
 2439|  6.76k|		break;
 2440|  6.76k|	case 4:	/* 4 bytes sequence. */
  ------------------
  |  Branch (2440:2): [True: 893, False: 30.1M]
  ------------------
 2441|    893|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2441:7): [True: 83, False: 810]
  ------------------
 2442|     83|			cnt = 1;
 2443|     83|			goto invalid_sequence;
 2444|     83|		}
 2445|    810|		if ((s[2] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2445:7): [True: 171, False: 639]
  ------------------
 2446|    171|			cnt = 2;
 2447|    171|			goto invalid_sequence;
 2448|    171|		}
 2449|    639|		if ((s[3] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2449:7): [True: 0, False: 639]
  ------------------
 2450|      0|			cnt = 3;
 2451|      0|			goto invalid_sequence;
 2452|      0|		}
 2453|    639|		wc = ((ch & 0x07) << 18)
 2454|    639|		    | ((s[1] & 0x3f) << 12)
 2455|    639|		    | ((s[2] & 0x3f) << 6)
 2456|    639|		    | (s[3] & 0x3f);
 2457|    639|		if (wc < 0x10000)
  ------------------
  |  Branch (2457:7): [True: 0, False: 639]
  ------------------
 2458|      0|			goto invalid_sequence;/* Overlong sequence. */
 2459|    639|		break;
 2460|  34.0k|	default: /* Others are all invalid sequence. */
  ------------------
  |  Branch (2460:2): [True: 34.0k, False: 30.1M]
  ------------------
 2461|  34.0k|		if (ch == 0xc0 || ch == 0xc1)
  ------------------
  |  Branch (2461:7): [True: 8, False: 34.0k]
  |  Branch (2461:21): [True: 1, False: 34.0k]
  ------------------
 2462|      9|			cnt = 2;
 2463|  34.0k|		else if (ch >= 0xf5 && ch <= 0xf7)
  ------------------
  |  Branch (2463:12): [True: 24.6k, False: 9.39k]
  |  Branch (2463:26): [True: 1.75k, False: 22.8k]
  ------------------
 2464|  1.75k|			cnt = 4;
 2465|  32.2k|		else if (ch >= 0xf8 && ch <= 0xfb)
  ------------------
  |  Branch (2465:12): [True: 22.8k, False: 9.39k]
  |  Branch (2465:26): [True: 815, False: 22.0k]
  ------------------
 2466|    815|			cnt = 5;
 2467|  31.4k|		else if (ch == 0xfc || ch == 0xfd)
  ------------------
  |  Branch (2467:12): [True: 303, False: 31.1k]
  |  Branch (2467:26): [True: 5.06k, False: 26.0k]
  ------------------
 2468|  5.36k|			cnt = 6;
 2469|  26.0k|		else
 2470|  26.0k|			cnt = 1;
 2471|  34.0k|		if (n < (size_t)cnt)
  ------------------
  |  Branch (2471:7): [True: 2.38k, False: 31.6k]
  ------------------
 2472|  2.38k|			cnt = (int)n;
 2473|  45.2k|		for (i = 1; i < cnt; i++) {
  ------------------
  |  Branch (2473:15): [True: 18.1k, False: 27.0k]
  ------------------
 2474|  18.1k|			if ((s[i] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2474:8): [True: 6.91k, False: 11.2k]
  ------------------
 2475|  6.91k|				cnt = i;
 2476|  6.91k|				break;
 2477|  6.91k|			}
 2478|  18.1k|		}
 2479|  34.0k|		goto invalid_sequence;
 2480|  30.1M|	}
 2481|       |
 2482|       |	/* The code point larger than 0x10FFFF is not legal
 2483|       |	 * Unicode values. */
 2484|  7.39k|	if (wc > UNICODE_MAX)
  ------------------
  |  |  133|  7.39k|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2484:6): [True: 0, False: 7.39k]
  ------------------
 2485|      0|		goto invalid_sequence;
 2486|       |	/* Correctly gets a Unicode, returns used bytes. */
 2487|  7.39k|	*pwc = wc;
 2488|  7.39k|	return (cnt);
 2489|  47.3k|invalid_sequence:
 2490|  47.3k|	*pwc = UNICODE_R_CHAR;/* set the Replacement Character instead. */
  ------------------
  |  |  134|  47.3k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2491|  47.3k|	return (cnt * -1);
 2492|  7.39k|}
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|  53.9k|{
 2567|  53.9k|	char *_p = p;
 2568|       |
 2569|       |	/* Invalid Unicode char maps to Replacement character */
 2570|  53.9k|	if (uc > UNICODE_MAX)
  ------------------
  |  |  133|  53.9k|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2570:6): [True: 0, False: 53.9k]
  ------------------
 2571|      0|		uc = UNICODE_R_CHAR;
  ------------------
  |  |  134|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2572|       |	/* Translate code point to UTF8 */
 2573|  53.9k|	if (uc <= 0x7f) {
  ------------------
  |  Branch (2573:6): [True: 0, False: 53.9k]
  ------------------
 2574|      0|		if (remaining == 0)
  ------------------
  |  Branch (2574:7): [True: 0, False: 0]
  ------------------
 2575|      0|			return (0);
 2576|      0|		*p++ = (char)uc;
 2577|  53.9k|	} else if (uc <= 0x7ff) {
  ------------------
  |  Branch (2577:13): [True: 6.15k, False: 47.8k]
  ------------------
 2578|  6.15k|		if (remaining < 2)
  ------------------
  |  Branch (2578:7): [True: 0, False: 6.15k]
  ------------------
 2579|      0|			return (0);
 2580|  6.15k|		*p++ = 0xc0 | ((uc >> 6) & 0x1f);
 2581|  6.15k|		*p++ = 0x80 | (uc & 0x3f);
 2582|  47.8k|	} else if (uc <= 0xffff) {
  ------------------
  |  Branch (2582:13): [True: 47.6k, False: 166]
  ------------------
 2583|  47.6k|		if (remaining < 3)
  ------------------
  |  Branch (2583:7): [True: 159, False: 47.5k]
  ------------------
 2584|    159|			return (0);
 2585|  47.5k|		*p++ = 0xe0 | ((uc >> 12) & 0x0f);
 2586|  47.5k|		*p++ = 0x80 | ((uc >> 6) & 0x3f);
 2587|  47.5k|		*p++ = 0x80 | (uc & 0x3f);
 2588|  47.5k|	} 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|  53.8k|	return (p - _p);
 2597|  53.9k|}
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.1M|{
 2528|  30.1M|	uint32_t wc = 0;
 2529|  30.1M|	int cnt;
 2530|       |
 2531|  30.1M|	cnt = _utf8_to_unicode(&wc, s, n);
 2532|  30.1M|	if (cnt == 3 && IS_HIGH_SURROGATE_LA(wc)) {
  ------------------
  |  |  130|  6.30k|#define IS_HIGH_SURROGATE_LA(uc) ((uc) >= 0xD800 && (uc) <= 0xDBFF)
  |  |  ------------------
  |  |  |  Branch (130:35): [True: 6.29k, False: 1]
  |  |  |  Branch (130:53): [True: 3.17k, False: 3.12k]
  |  |  ------------------
  ------------------
  |  Branch (2532:6): [True: 6.30k, False: 30.1M]
  ------------------
 2533|  3.17k|		uint32_t wc2 = 0;
 2534|  3.17k|		if (n - 3 < 3) {
  ------------------
  |  Branch (2534:7): [True: 185, False: 2.99k]
  ------------------
 2535|       |			/* Invalid byte sequence. */
 2536|    185|			goto invalid_sequence;
 2537|    185|		}
 2538|  2.99k|		cnt = _utf8_to_unicode(&wc2, s+3, n-3);
 2539|  2.99k|		if (cnt != 3 || !IS_LOW_SURROGATE_LA(wc2)) {
  ------------------
  |  |  131|    460|#define IS_LOW_SURROGATE_LA(uc)	 ((uc) >= 0xDC00 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (131:35): [True: 460, False: 0]
  |  |  |  Branch (131:53): [True: 328, False: 132]
  |  |  ------------------
  ------------------
  |  Branch (2539:7): [True: 2.53k, False: 460]
  ------------------
 2540|       |			/* Invalid byte sequence. */
 2541|  2.66k|			goto invalid_sequence;
 2542|  2.66k|		}
 2543|    328|		wc = combine_surrogate_pair(wc, wc2);
 2544|    328|		cnt = 6;
 2545|  30.1M|	} else if (cnt == 3 && IS_LOW_SURROGATE_LA(wc)) {
  ------------------
  |  |  131|  3.12k|#define IS_LOW_SURROGATE_LA(uc)	 ((uc) >= 0xDC00 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (131:35): [True: 3.12k, False: 1]
  |  |  |  Branch (131:53): [True: 2.69k, False: 428]
  |  |  ------------------
  ------------------
  |  Branch (2545:13): [True: 3.12k, False: 30.1M]
  ------------------
 2546|       |		/* Invalid byte sequence. */
 2547|  2.69k|		goto invalid_sequence;
 2548|  2.69k|	}
 2549|  30.1M|	*pwc = wc;
 2550|  30.1M|	return (cnt);
 2551|  5.54k|invalid_sequence:
 2552|  5.54k|	*pwc = UNICODE_R_CHAR;/* set the Replacement Character instead. */
  ------------------
  |  |  134|  5.54k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2553|  5.54k|	if (cnt > 0)
  ------------------
  |  Branch (2553:6): [True: 3.01k, False: 2.53k]
  ------------------
 2554|  3.01k|		cnt *= -1;
 2555|  5.54k|	return (cnt);
 2556|  30.1M|}
archive_string.c:iconv_strncat_in_locale:
 2098|  59.8k|{
 2099|  59.8k|	ICONV_CONST char *itp;
 2100|  59.8k|	size_t remaining;
 2101|  59.8k|	iconv_t cd;
 2102|  59.8k|	char *outp;
 2103|  59.8k|	size_t avail, bs;
 2104|  59.8k|	int return_value = 0; /* success */
 2105|  59.8k|	size_t to_size, from_size;
 2106|       |
 2107|  59.8k|	if (sc->flag & SCONV_TO_UTF16)
  ------------------
  |  |  111|  59.8k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|  59.8k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|  59.8k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2107:6): [True: 0, False: 59.8k]
  ------------------
 2108|      0|		to_size = 2;
 2109|  59.8k|	else
 2110|  59.8k|		to_size = 1;
 2111|  59.8k|	if (sc->flag & SCONV_FROM_UTF16)
  ------------------
  |  |  112|  59.8k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  59.8k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  59.8k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2111:6): [True: 597, False: 59.2k]
  ------------------
 2112|    597|		from_size = 2;
 2113|  59.2k|	else
 2114|  59.2k|		from_size = 1;
 2115|       |
 2116|  59.8k|	if (archive_string_ensure(as, as->length + length*2+to_size) == NULL)
  ------------------
  |  Branch (2116:6): [True: 0, False: 59.8k]
  ------------------
 2117|      0|		return (-1);
 2118|       |
 2119|  59.8k|	cd = sc->cd;
 2120|  59.8k|	itp = (char *)(uintptr_t)_p;
 2121|  59.8k|	remaining = length;
 2122|  59.8k|	outp = as->s + as->length;
 2123|  59.8k|	avail = as->buffer_length - as->length - to_size;
 2124|   341k|	while (remaining >= from_size) {
  ------------------
  |  Branch (2124:9): [True: 336k, False: 5.33k]
  ------------------
 2125|   336k|		size_t result = iconv(cd, &itp, &remaining, &outp, &avail);
 2126|       |
 2127|   336k|		if (result != (size_t)-1)
  ------------------
  |  Branch (2127:7): [True: 54.4k, False: 282k]
  ------------------
 2128|  54.4k|			break; /* Conversion completed. */
 2129|       |
 2130|   282k|		if (errno == EILSEQ || errno == EINVAL) {
  ------------------
  |  Branch (2130:7): [True: 281k, 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|   281k|			if (sc->flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) {
  ------------------
  |  |  105|   281k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
              			if (sc->flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) {
  ------------------
  |  |  111|   281k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|   281k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|   281k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2136:8): [True: 72.5k, False: 209k]
  ------------------
 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|   209k|			} else {
 2163|       |				/* Skip the illegal input bytes. */
 2164|   209k|				*outp++ = '?';
 2165|   209k|				avail--;
 2166|   209k|			}
 2167|   281k|			itp += from_size;
 2168|   281k|			remaining -= from_size;
 2169|   281k|			return_value = -1; /* failure */
 2170|   281k|		} 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|   282k|	}
 2181|  59.8k|	as->length = outp - as->s;
 2182|  59.8k|	as->s[as->length] = 0;
 2183|  59.8k|	if (to_size == 2)
  ------------------
  |  Branch (2183:6): [True: 0, False: 59.8k]
  ------------------
 2184|      0|		as->s[as->length+1] = 0;
 2185|  59.8k|	return (return_value);
 2186|  59.8k|}
archive_string.c:archive_string_normalize_C:
 2999|  12.8k|{
 3000|  12.8k|	const char *s = (const char *)_p;
 3001|  12.8k|	char *p, *endp;
 3002|  12.8k|	uint32_t uc, uc2;
 3003|  12.8k|	size_t w;
 3004|  12.8k|	int always_replace, n, n2, ret = 0, spair, ts, tm;
 3005|  12.8k|	int (*parse)(uint32_t *, const char *, size_t);
 3006|  12.8k|	size_t (*unparse)(char *, size_t, uint32_t);
 3007|       |
 3008|  12.8k|	always_replace = 1;
 3009|  12.8k|	ts = 1;/* text size. */
 3010|  12.8k|	if (sc->flag & SCONV_TO_UTF16BE) {
  ------------------
  |  |  107|  12.8k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
  |  Branch (3010:6): [True: 0, False: 12.8k]
  ------------------
 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|  12.8k|	} else if (sc->flag & SCONV_TO_UTF16LE) {
  ------------------
  |  |  109|  12.8k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  ------------------
  |  Branch (3015:13): [True: 0, False: 12.8k]
  ------------------
 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|  12.8k|	} else if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|  12.8k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (3020:13): [True: 0, False: 12.8k]
  ------------------
 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|  12.8k|	} else {
 3025|       |		/*
 3026|       |		 * This case is going to be converted to another
 3027|       |		 * character-set through iconv.
 3028|       |		 */
 3029|  12.8k|		always_replace = 0;
 3030|  12.8k|		if (sc->flag & SCONV_FROM_UTF16BE) {
  ------------------
  |  |  108|  12.8k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (3030:7): [True: 140, False: 12.6k]
  ------------------
 3031|    140|			unparse = unicode_to_utf16be;
 3032|    140|			ts = 2;
 3033|  12.6k|		} else if (sc->flag & SCONV_FROM_UTF16LE) {
  ------------------
  |  |  110|  12.6k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (3033:14): [True: 457, False: 12.2k]
  ------------------
 3034|    457|			unparse = unicode_to_utf16le;
 3035|    457|			ts = 2;
 3036|  12.2k|		} else {
 3037|  12.2k|			unparse = unicode_to_utf8;
 3038|  12.2k|		}
 3039|  12.8k|	}
 3040|       |
 3041|  12.8k|	if (sc->flag & SCONV_FROM_UTF16BE) {
  ------------------
  |  |  108|  12.8k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (3041:6): [True: 140, False: 12.6k]
  ------------------
 3042|    140|		parse = utf16be_to_unicode;
 3043|    140|		tm = 1;
 3044|    140|		spair = 4;/* surrogate pair size in UTF-16. */
 3045|  12.6k|	} else if (sc->flag & SCONV_FROM_UTF16LE) {
  ------------------
  |  |  110|  12.6k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (3045:13): [True: 457, False: 12.2k]
  ------------------
 3046|    457|		parse = utf16le_to_unicode;
 3047|    457|		tm = 1;
 3048|    457|		spair = 4;/* surrogate pair size in UTF-16. */
 3049|  12.2k|	} else {
 3050|  12.2k|		parse = cesu8_to_unicode;
 3051|  12.2k|		tm = ts;
 3052|  12.2k|		spair = 6;/* surrogate pair size in UTF-8. */
 3053|  12.2k|	}
 3054|       |
 3055|  12.8k|	if (archive_string_ensure(as, as->length + len * tm + ts) == NULL)
  ------------------
  |  Branch (3055:6): [True: 0, False: 12.8k]
  ------------------
 3056|      0|		return (-1);
 3057|       |
 3058|  12.8k|	p = as->s + as->length;
 3059|  12.8k|	endp = as->s + as->buffer_length - ts;
 3060|  69.5k|	while ((n = parse(&uc, s, len)) != 0) {
  ------------------
  |  Branch (3060:9): [True: 67.4k, False: 2.15k]
  ------------------
 3061|  67.4k|		const char *ucptr, *uc2ptr;
 3062|       |
 3063|  67.4k|		if (n < 0) {
  ------------------
  |  Branch (3063:7): [True: 39.6k, False: 27.8k]
  ------------------
 3064|       |			/* Use a replaced unicode character. */
 3065|  39.6k|			UNPARSE(p, endp, uc);
  ------------------
  |  | 2929|  39.6k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2930|  39.6k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2930:9): [True: 18, False: 39.6k]
  |  |  ------------------
  |  | 2931|     18|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2920|     18|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2921|     18|	as->length = p - as->s;			\
  |  |  |  | 2922|     18|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2922:6): [True: 0, False: 18]
  |  |  |  |  ------------------
  |  |  |  | 2923|     18|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2924|     18|		return (-1);			\
  |  |  |  | 2925|     18|	p = as->s + as->length;			\
  |  |  |  | 2926|     18|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2927|     18|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2927:10): [Folded, False: 18]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2932|     18|	}					\
  |  | 2933|  39.6k|	p += w;					\
  |  | 2934|  39.6k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2934:10): [Folded, False: 39.6k]
  |  |  ------------------
  ------------------
 3066|  39.6k|			s += n*-1;
 3067|  39.6k|			len -= n*-1;
 3068|  39.6k|			ret = -1;
 3069|  39.6k|			continue;
 3070|  39.6k|		} else if (n == spair || always_replace)
  ------------------
  |  Branch (3070:14): [True: 206, False: 27.6k]
  |  Branch (3070:28): [True: 0, False: 27.6k]
  ------------------
 3071|       |			/* uc is converted from a surrogate pair.
 3072|       |			 * this should be treated as a changed code. */
 3073|    206|			ucptr = NULL;
 3074|  27.6k|		else
 3075|  27.6k|			ucptr = s;
 3076|  27.8k|		s += n;
 3077|  27.8k|		len -= n;
 3078|       |
 3079|       |		/* Read second code point. */
 3080|  30.1M|		while ((n2 = parse(&uc2, s, len)) > 0) {
  ------------------
  |  Branch (3080:10): [True: 30.1M, False: 23.9k]
  ------------------
 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: 38]
  |  |  |  Branch (986:25): [True: 11.0k, 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.76k, False: 30.1M]
  |  |  ------------------
  |  | 2945|  30.1M|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2920|  2.76k|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2921|  2.76k|	as->length = p - as->s;			\
  |  |  |  | 2922|  2.76k|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2922:6): [True: 0, False: 2.76k]
  |  |  |  |  ------------------
  |  |  |  | 2923|  2.76k|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2924|  2.76k|		return (-1);			\
  |  |  |  | 2925|  2.76k|	p = as->s + as->length;			\
  |  |  |  | 2926|  2.76k|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2927|  2.76k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2927:10): [Folded, False: 2.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 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|    321|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2950:3): [True: 132, False: 30.1M]
  |  |  ------------------
  |  | 2951|    321|			*p++ = *ucptr++;	\
  |  | 2952|    321|			/* FALL THROUGH */	\
  |  | 2953|  30.1k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2953:3): [True: 29.7k, False: 30.0M]
  |  |  ------------------
  |  | 2954|  30.1k|			*p++ = *ucptr++;	\
  |  | 2955|  30.1k|			/* FALL THROUGH */	\
  |  | 2956|  30.1M|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2956:3): [True: 30.0M, False: 30.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|  11.0k|			if (0 <= (LIndex = uc - HC_LBASE) &&
  ------------------
  |  | 2868|  11.0k|#define HC_LBASE	0x1100
  ------------------
  |  Branch (3113:8): [True: 7.04k, False: 4.05k]
  ------------------
 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|  11.0k|			} else if (0 <= (SIndex = uc - HC_SBASE) &&
  ------------------
  |  | 2867|  11.0k|#define HC_SBASE	0xAC00
  ------------------
  |  Branch (3130:15): [True: 2.63k, False: 8.45k]
  ------------------
 3131|  2.63k|			    SIndex < HC_SCOUNT && (SIndex % HC_TCOUNT) == 0) {
  ------------------
  |  | 2875|  13.7k|#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|  11.0k|			} else if ((nfc = get_nfc(uc, uc2)) != 0) {
  ------------------
  |  Branch (3145:15): [True: 132, False: 10.9k]
  ------------------
 3146|       |				/* A composition to current code points
 3147|       |				 * is found. */
 3148|    132|				UPDATE_UC(nfc);
  ------------------
  |  | 2906|    132|#define UPDATE_UC(new_uc)	do {		\
  |  | 2907|    132|	uc = new_uc;				\
  |  | 2908|    132|	ucptr = NULL;				\
  |  | 2909|    132|} while (0)
  |  |  ------------------
  |  |  |  Branch (2909:10): [Folded, False: 132]
  |  |  ------------------
  ------------------
 3149|    132|				continue;
 3150|  10.9k|			} else if ((cl = CCC(uc2)) == 0) {
  ------------------
  |  | 1007|  10.9k|	(((uc) > 0x1D244)?0:\
  |  |  ------------------
  |  |  |  Branch (1007:3): [True: 0, False: 10.9k]
  |  |  ------------------
  |  | 1008|  10.9k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  ------------------
  |  Branch (3150:15): [True: 7.08k, False: 3.82k]
  ------------------
 3151|       |				/* Clearly 'uc2' the second code point is not
 3152|       |				 * a decomposable code. */
 3153|  7.08k|				WRITE_UC();
  ------------------
  |  | 2942|  7.08k|#define WRITE_UC()	do {			\
  |  | 2943|  7.08k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2943:6): [True: 7.08k, False: 2]
  |  |  ------------------
  |  | 2944|  7.08k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2944:7): [True: 0, False: 7.08k]
  |  |  ------------------
  |  | 2945|  7.08k|			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.08k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2946:11): [True: 7.08k, False: 0]
  |  |  ------------------
  |  | 2947|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2947:3): [True: 0, False: 7.08k]
  |  |  ------------------
  |  | 2948|      0|			*p++ = *ucptr++;	\
  |  | 2949|      0|			/* FALL THROUGH */	\
  |  | 2950|      0|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2950:3): [True: 0, False: 7.08k]
  |  |  ------------------
  |  | 2951|      0|			*p++ = *ucptr++;	\
  |  | 2952|      0|			/* FALL THROUGH */	\
  |  | 2953|  7.07k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2953:3): [True: 7.07k, False: 15]
  |  |  ------------------
  |  | 2954|  7.07k|			*p++ = *ucptr++;	\
  |  | 2955|  7.07k|			/* FALL THROUGH */	\
  |  | 2956|  7.08k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2956:3): [True: 15, False: 7.07k]
  |  |  ------------------
  |  | 2957|  7.08k|			*p++ = *ucptr;		\
  |  | 2958|  7.08k|			break;			\
  |  | 2959|  7.08k|		}				\
  |  | 2960|  7.08k|		ucptr = NULL;			\
  |  | 2961|  7.08k|	} 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.08k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2964:10): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
 3154|  7.08k|				REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2914|  7.08k|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2915|  7.08k|	uc = uc2;				\
  |  | 2916|  7.08k|	ucptr = uc2ptr;				\
  |  | 2917|  7.08k|	n = n2;					\
  |  | 2918|  7.08k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2918:10): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
 3155|  7.08k|				continue;
 3156|  7.08k|			}
 3157|       |
 3158|       |			/*
 3159|       |			 * Collect following decomposable code points.
 3160|       |			 */
 3161|  3.82k|			cx = 0;
 3162|  3.82k|			ucx[0] = uc2;
 3163|  3.82k|			ccx[0] = cl;
 3164|  3.82k|			COLLECT_CPS(1);
  ------------------
  |  | 2969|  3.82k|#define COLLECT_CPS(start)	do {		\
  |  | 2970|  3.82k|	int _i;					\
  |  | 2971|  6.35k|	for (_i = start; _i < FDC_MAX ; _i++) {	\
  |  |  ------------------
  |  |  |  | 2900|  6.35k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2971:19): [True: 6.35k, False: 0]
  |  |  ------------------
  |  | 2972|  6.35k|		nx = parse(&ucx[_i], s, len);	\
  |  | 2973|  6.35k|		if (nx <= 0)			\
  |  |  ------------------
  |  |  |  Branch (2973:7): [True: 2.86k, False: 3.49k]
  |  |  ------------------
  |  | 2974|  6.35k|			break;			\
  |  | 2975|  6.35k|		cx = CCC(ucx[_i]);		\
  |  |  ------------------
  |  |  |  | 1007|  3.49k|	(((uc) > 0x1D244)?0:\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1007:3): [True: 349, False: 3.14k]
  |  |  |  |  ------------------
  |  |  |  | 1008|  3.49k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  |  |  ------------------
  |  | 2976|  3.49k|		if (cl >= cx && cl != 228 && cx != 228)\
  |  |  ------------------
  |  |  |  Branch (2976:7): [True: 960, False: 2.53k]
  |  |  |  Branch (2976:19): [True: 960, False: 0]
  |  |  |  Branch (2976:32): [True: 960, False: 0]
  |  |  ------------------
  |  | 2977|  3.49k|			break;			\
  |  | 2978|  3.49k|		s += nx;			\
  |  | 2979|  2.53k|		len -= nx;			\
  |  | 2980|  2.53k|		cl = cx;			\
  |  | 2981|  2.53k|		ccx[_i] = cx;			\
  |  | 2982|  2.53k|	}					\
  |  | 2983|  3.82k|	if (_i >= FDC_MAX) {			\
  |  |  ------------------
  |  |  |  | 2900|  3.82k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2983:6): [True: 0, False: 3.82k]
  |  |  ------------------
  |  | 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|  3.82k|		ucx_size = _i;			\
  |  | 2988|  3.82k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2988:10): [Folded, False: 3.82k]
  |  |  ------------------
  ------------------
 3165|       |
 3166|       |			/*
 3167|       |			 * Find a composed code in the collected code points.
 3168|       |			 */
 3169|  3.82k|			i = 1;
 3170|  8.88k|			while (i < ucx_size) {
  ------------------
  |  Branch (3170:11): [True: 5.06k, False: 3.82k]
  ------------------
 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|  3.82k|			WRITE_UC();
  ------------------
  |  | 2942|  3.82k|#define WRITE_UC()	do {			\
  |  | 2943|  3.82k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2943:6): [True: 1.29k, False: 2.53k]
  |  |  ------------------
  |  | 2944|  1.29k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2944:7): [True: 0, False: 1.29k]
  |  |  ------------------
  |  | 2945|  1.29k|			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.29k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2946:11): [True: 1.29k, False: 0]
  |  |  ------------------
  |  | 2947|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2947:3): [True: 0, False: 1.29k]
  |  |  ------------------
  |  | 2948|      0|			*p++ = *ucptr++;	\
  |  | 2949|      0|			/* FALL THROUGH */	\
  |  | 2950|    164|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2950:3): [True: 164, False: 1.12k]
  |  |  ------------------
  |  | 2951|    164|			*p++ = *ucptr++;	\
  |  | 2952|    164|			/* FALL THROUGH */	\
  |  | 2953|    862|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2953:3): [True: 698, False: 592]
  |  |  ------------------
  |  | 2954|    862|			*p++ = *ucptr++;	\
  |  | 2955|    862|			/* FALL THROUGH */	\
  |  | 2956|  1.29k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2956:3): [True: 428, False: 862]
  |  |  ------------------
  |  | 2957|  1.29k|			*p++ = *ucptr;		\
  |  | 2958|  1.29k|			break;			\
  |  | 2959|  1.29k|		}				\
  |  | 2960|  1.29k|		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|  3.82k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2964:10): [Folded, False: 3.82k]
  |  |  ------------------
  ------------------
 3215|  7.64k|			for (i = 0; i < ucx_size; i++)
  ------------------
  |  Branch (3215:16): [True: 3.82k, False: 3.82k]
  ------------------
 3216|  3.82k|				UNPARSE(p, endp, ucx[i]);
  ------------------
  |  | 2929|  7.64k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2930|  3.82k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2930:9): [True: 0, False: 3.82k]
  |  |  ------------------
  |  | 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|  3.82k|	p += w;					\
  |  | 2934|  3.82k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2934:10): [Folded, False: 3.82k]
  |  |  ------------------
  ------------------
 3217|       |
 3218|       |			/*
 3219|       |			 * Flush out remaining canonical combining characters.
 3220|       |			 */
 3221|  3.82k|			if (nx > 0 && cx == cl && len > 0) {
  ------------------
  |  Branch (3221:8): [True: 960, False: 2.86k]
  |  Branch (3221:18): [True: 26, False: 934]
  |  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|  3.82k|			break;
 3234|  3.82k|		}
 3235|  27.8k|		if (n2 < 0) {
  ------------------
  |  Branch (3235:7): [True: 13.3k, False: 14.4k]
  ------------------
 3236|  13.3k|			WRITE_UC();
  ------------------
  |  | 2942|  13.3k|#define WRITE_UC()	do {			\
  |  | 2943|  13.3k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2943:6): [True: 12.9k, False: 349]
  |  |  ------------------
  |  | 2944|  12.9k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2944:7): [True: 0, False: 12.9k]
  |  |  ------------------
  |  | 2945|  12.9k|			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|  12.9k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2946:11): [True: 12.9k, False: 0]
  |  |  ------------------
  |  | 2947|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2947:3): [True: 0, False: 12.9k]
  |  |  ------------------
  |  | 2948|      0|			*p++ = *ucptr++;	\
  |  | 2949|      0|			/* FALL THROUGH */	\
  |  | 2950|    133|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2950:3): [True: 133, False: 12.8k]
  |  |  ------------------
  |  | 2951|    133|			*p++ = *ucptr++;	\
  |  | 2952|    133|			/* FALL THROUGH */	\
  |  | 2953|  1.34k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2953:3): [True: 1.20k, False: 11.7k]
  |  |  ------------------
  |  | 2954|  1.34k|			*p++ = *ucptr++;	\
  |  | 2955|  1.34k|			/* FALL THROUGH */	\
  |  | 2956|  12.9k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2956:3): [True: 11.6k, False: 1.34k]
  |  |  ------------------
  |  | 2957|  12.9k|			*p++ = *ucptr;		\
  |  | 2958|  12.9k|			break;			\
  |  | 2959|  12.9k|		}				\
  |  | 2960|  12.9k|		ucptr = NULL;			\
  |  | 2961|  12.9k|	} else {				\
  |  | 2962|    349|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2929|    349|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2930|    351|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2930:9): [True: 2, False: 349]
  |  |  |  |  ------------------
  |  |  |  | 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|    349|	p += w;					\
  |  |  |  | 2934|    349|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 349]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2963|    349|	}					\
  |  | 2964|  13.3k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2964:10): [Folded, False: 13.3k]
  |  |  ------------------
  ------------------
 3237|       |			/* Use a replaced unicode character. */
 3238|  13.3k|			UNPARSE(p, endp, uc2);
  ------------------
  |  | 2929|  13.3k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2930|  13.4k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2930:9): [True: 141, False: 13.3k]
  |  |  ------------------
  |  | 2931|    141|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2920|    141|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2921|    141|	as->length = p - as->s;			\
  |  |  |  | 2922|    141|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2922:6): [True: 0, False: 141]
  |  |  |  |  ------------------
  |  |  |  | 2923|    141|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2924|    141|		return (-1);			\
  |  |  |  | 2925|    141|	p = as->s + as->length;			\
  |  |  |  | 2926|    141|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2927|    141|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2927:10): [Folded, False: 141]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2932|    141|	}					\
  |  | 2933|  13.3k|	p += w;					\
  |  | 2934|  13.3k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2934:10): [Folded, False: 13.3k]
  |  |  ------------------
  ------------------
 3239|  13.3k|			s += n2*-1;
 3240|  13.3k|			len -= n2*-1;
 3241|  13.3k|			ret = -1;
 3242|  13.3k|			continue;
 3243|  14.4k|		} else if (n2 == 0) {
  ------------------
  |  Branch (3243:14): [True: 10.6k, False: 3.82k]
  ------------------
 3244|  10.6k|			WRITE_UC();
  ------------------
  |  | 2942|  10.6k|#define WRITE_UC()	do {			\
  |  | 2943|  10.6k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2943:6): [True: 10.6k, False: 0]
  |  |  ------------------
  |  | 2944|  10.6k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2944:7): [True: 0, False: 10.6k]
  |  |  ------------------
  |  | 2945|  10.6k|			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|  10.6k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2946:11): [True: 10.6k, False: 0]
  |  |  ------------------
  |  | 2947|    265|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2947:3): [True: 265, False: 10.3k]
  |  |  ------------------
  |  | 2948|    265|			*p++ = *ucptr++;	\
  |  | 2949|    265|			/* FALL THROUGH */	\
  |  | 2950|    265|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2950:3): [True: 0, False: 10.6k]
  |  |  ------------------
  |  | 2951|    265|			*p++ = *ucptr++;	\
  |  | 2952|    265|			/* FALL THROUGH */	\
  |  | 2953|    863|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2953:3): [True: 598, False: 10.0k]
  |  |  ------------------
  |  | 2954|    863|			*p++ = *ucptr++;	\
  |  | 2955|    863|			/* FALL THROUGH */	\
  |  | 2956|  10.6k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2956:3): [True: 9.78k, False: 863]
  |  |  ------------------
  |  | 2957|  10.6k|			*p++ = *ucptr;		\
  |  | 2958|  10.6k|			break;			\
  |  | 2959|  10.6k|		}				\
  |  | 2960|  10.6k|		ucptr = NULL;			\
  |  | 2961|  10.6k|	} 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|  10.6k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2964:10): [Folded, False: 10.6k]
  |  |  ------------------
  ------------------
 3245|  10.6k|			break;
 3246|  10.6k|		}
 3247|  27.8k|	}
 3248|  12.8k|	as->length = p - as->s;
 3249|  12.8k|	as->s[as->length] = '\0';
 3250|  12.8k|	if (ts == 2)
  ------------------
  |  Branch (3250:6): [True: 597, False: 12.2k]
  ------------------
 3251|    597|		as->s[as->length+1] = '\0';
 3252|  12.8k|	return (ret);
 3253|  12.8k|}
archive_string.c:get_nfc:
 2879|  16.1k|{
 2880|  16.1k|	int t, b;
 2881|       |
 2882|  16.1k|	t = 0;
 2883|  16.1k|	b = sizeof(u_composition_table)/sizeof(u_composition_table[0]) -1;
 2884|   166k|	while (b >= t) {
  ------------------
  |  Branch (2884:9): [True: 152k, False: 13.4k]
  ------------------
 2885|   152k|		int m = (t + b) / 2;
 2886|   152k|		if (u_composition_table[m].cp1 < uc)
  ------------------
  |  Branch (2886:7): [True: 95.5k, False: 57.1k]
  ------------------
 2887|  95.5k|			t = m + 1;
 2888|  57.1k|		else if (u_composition_table[m].cp1 > uc)
  ------------------
  |  Branch (2888:12): [True: 48.7k, False: 8.46k]
  ------------------
 2889|  48.7k|			b = m - 1;
 2890|  8.46k|		else if (u_composition_table[m].cp2 < uc2)
  ------------------
  |  Branch (2890:12): [True: 3.13k, False: 5.33k]
  ------------------
 2891|  3.13k|			t = m + 1;
 2892|  5.33k|		else if (u_composition_table[m].cp2 > uc2)
  ------------------
  |  Branch (2892:12): [True: 2.67k, False: 2.66k]
  ------------------
 2893|  2.67k|			b = m - 1;
 2894|  2.66k|		else
 2895|  2.66k|			return (u_composition_table[m].nfc);
 2896|   152k|	}
 2897|  13.4k|	return (0);
 2898|  16.1k|}
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|   121k|{
 1967|   121k|	size_t s;
 1968|   121k|	const char *p, *pp;
 1969|       |
 1970|   121k|	if (_p == NULL)
  ------------------
  |  Branch (1970:6): [True: 0, False: 121k]
  ------------------
 1971|      0|		return (0);
 1972|   121k|	p = (const char *)_p;
 1973|       |
 1974|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
 1975|   121k|	s = 0;
 1976|   121k|	pp = p;
 1977|  33.3M|	while (s < n && *pp) {
  ------------------
  |  Branch (1977:9): [True: 33.3M, False: 90.5k]
  |  Branch (1977:18): [True: 33.2M, False: 30.6k]
  ------------------
 1978|  33.2M|		pp++;
 1979|  33.2M|		s++;
 1980|  33.2M|	}
 1981|   121k|	return (s);
 1982|   121k|}

archive_string_sprintf:
   77|  43.1k|{
   78|  43.1k|	va_list ap;
   79|       |
   80|  43.1k|	va_start(ap, fmt);
   81|  43.1k|	archive_string_vsprintf(as, fmt, ap);
   82|       |	va_end(ap);
   83|  43.1k|}
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.0M, False: 326k]
  ------------------
  108|  12.0M|		const char *saved_p = p;
  109|       |
  110|  12.0M|		if (*p != '%') {
  ------------------
  |  Branch (110:7): [True: 11.8M, False: 190k]
  ------------------
  111|  11.8M|			archive_strappend_char(as, *p);
  112|  11.8M|			continue;
  113|  11.8M|		}
  114|       |
  115|   190k|		p++;
  116|       |
  117|   190k|		long_flag = '\0';
  118|   190k|		switch(*p) {
  ------------------
  |  Branch (118:10): [True: 40.8k, False: 149k]
  ------------------
  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|  34.1k|		case 'j':
  ------------------
  |  Branch (126:3): [True: 34.1k, False: 156k]
  ------------------
  127|  40.8k|		case 'z':
  ------------------
  |  Branch (127:3): [True: 6.70k, False: 183k]
  ------------------
  128|  40.8k|			long_flag = *p;
  129|  40.8k|			p++;
  130|  40.8k|			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: 189k]
  ------------------
  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: 71.0k]
  ------------------
  142|   119k|			switch(long_flag) {
  143|  33.6k|			case 'j': s = va_arg(ap, intmax_t); break;
  ------------------
  |  Branch (143:4): [True: 33.6k, False: 85.6k]
  ------------------
  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|  85.6k|			default:  s = va_arg(ap, int); break;
  ------------------
  |  Branch (147:4): [True: 85.6k, False: 33.6k]
  ------------------
  148|   119k|			}
  149|   119k|			append_int(as, s, 10);
  150|   119k|			break;
  151|  53.4k|		case 's':
  ------------------
  |  Branch (151:3): [True: 53.4k, False: 136k]
  ------------------
  152|  53.4k|			switch(long_flag) {
  153|      0|			case 'l':
  ------------------
  |  Branch (153:4): [True: 0, False: 53.4k]
  ------------------
  154|      0|			case 'L':
  ------------------
  |  Branch (154:4): [True: 0, False: 53.4k]
  ------------------
  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.4k|			default:
  ------------------
  |  Branch (162:4): [True: 53.4k, False: 0]
  ------------------
  163|  53.4k|				p2 = va_arg(ap, char *);
  164|  53.4k|				if (p2 == NULL)
  ------------------
  |  Branch (164:9): [True: 1, False: 53.4k]
  ------------------
  165|      1|					p2 = "(null)";
  166|  53.4k|				archive_strcat(as, p2);
  167|  53.4k|				break;
  168|  53.4k|			}
  169|  53.4k|			break;
  170|  53.4k|		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|  17.1k|		case 'o': case 'u': case 'x': case 'X':
  ------------------
  |  Branch (178:3): [True: 0, False: 190k]
  |  Branch (178:13): [True: 17.1k, False: 173k]
  |  Branch (178:23): [True: 8, False: 190k]
  |  Branch (178:33): [True: 4, False: 190k]
  ------------------
  179|       |			/* Common handling for unsigned integer formats. */
  180|  17.1k|			switch(long_flag) {
  181|    521|			case 'j': u = va_arg(ap, uintmax_t); break;
  ------------------
  |  Branch (181:4): [True: 521, False: 16.6k]
  ------------------
  182|      8|			case 'l': u = va_arg(ap, unsigned long); break;
  ------------------
  |  Branch (182:4): [True: 8, False: 17.1k]
  ------------------
  183|      0|			case 'L': u = va_arg(ap, unsigned long long); break;
  ------------------
  |  Branch (183:4): [True: 0, False: 17.1k]
  ------------------
  184|  6.70k|			case 'z': u = va_arg(ap, size_t); break;
  ------------------
  |  Branch (184:4): [True: 6.70k, False: 10.4k]
  ------------------
  185|  9.93k|			default:  u = va_arg(ap, unsigned int); break;
  ------------------
  |  Branch (185:4): [True: 9.93k, False: 7.23k]
  ------------------
  186|  17.1k|			}
  187|       |			/* Format it in the correct base. */
  188|  17.1k|			switch (*p) {
  189|      0|			case 'o': append_uint(as, u, 8); break;
  ------------------
  |  Branch (189:4): [True: 0, False: 17.1k]
  ------------------
  190|  17.1k|			case 'u': append_uint(as, u, 10); break;
  ------------------
  |  Branch (190:4): [True: 17.1k, False: 12]
  ------------------
  191|     12|			default: append_uint(as, u, 16); break;
  ------------------
  |  Branch (191:4): [True: 12, False: 17.1k]
  ------------------
  192|  17.1k|			}
  193|  17.1k|			break;
  194|  17.1k|		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:
  115|  2.44k|{
  116|  2.44k|	return (a->file_count);
  117|  2.44k|}
archive_clear_error:
  165|   306k|{
  166|   306k|	archive_string_empty(&a->error_string);
  ------------------
  |  |  181|   306k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  167|       |	a->error = NULL;
  168|   306k|	a->archive_error_number = 0;
  169|   306k|}
archive_set_error:
  173|   282k|{
  174|   282k|	va_list ap;
  175|       |
  176|   282k|	a->archive_error_number = error_number;
  177|   282k|	if (fmt == NULL) {
  ------------------
  |  Branch (177:6): [True: 0, False: 282k]
  ------------------
  178|      0|		a->error = NULL;
  179|      0|		return;
  180|      0|	}
  181|       |
  182|   282k|	archive_string_empty(&(a->error_string));
  ------------------
  |  |  181|   282k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  183|   282k|	va_start(ap, fmt);
  184|   282k|	archive_string_vsprintf(&(a->error_string), fmt, ap);
  185|       |	va_end(ap);
  186|   282k|	a->error = a->error_string.s;
  187|   282k|}

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|   298k|{
  148|   298k|	return ((a->vtable->archive_read_next_header)(a, entry));
  149|   298k|}
archive_read_data_block:
  160|   150k|{
  161|   150k|	return ((a->vtable->archive_read_data_block)(a, buff, s, o));
  162|   150k|}

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: 58, False: 2.44k]
  ------------------
   39|     58|    archive_read_free(a);
   40|     58|    return 0;
   41|     58|  }
   42|       |
   43|   298k|  while(1) {
  ------------------
  |  Branch (43:9): [True: 298k, Folded]
  ------------------
   44|   298k|    std::vector<uint8_t> data_buffer(getpagesize(), 0);
   45|   298k|    struct archive_entry *entry;
   46|   298k|    int ret = archive_read_next_header(a, &entry);
   47|   298k|    if (ret == ARCHIVE_EOF || ret == ARCHIVE_FATAL)
  ------------------
  |  |  232|   597k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
                  if (ret == ARCHIVE_EOF || ret == ARCHIVE_FATAL)
  ------------------
  |  |  239|   298k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (47:9): [True: 311, False: 298k]
  |  Branch (47:31): [True: 1.73k, False: 296k]
  ------------------
   48|  2.04k|      break;
   49|   296k|    if (ret == ARCHIVE_RETRY)
  ------------------
  |  |  234|   296k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (49:9): [True: 212k, False: 84.5k]
  ------------------
   50|   212k|      continue;
   51|       |
   52|  84.5k|    (void)archive_entry_pathname(entry);
   53|  84.5k|    (void)archive_entry_pathname_utf8(entry);
   54|  84.5k|    (void)archive_entry_pathname_w(entry);
   55|       |
   56|  84.5k|    (void)archive_entry_atime(entry);
   57|  84.5k|    (void)archive_entry_birthtime(entry);
   58|  84.5k|    (void)archive_entry_ctime(entry);
   59|  84.5k|    (void)archive_entry_dev(entry);
   60|  84.5k|    (void)archive_entry_digest(entry, ARCHIVE_ENTRY_DIGEST_SHA1);
  ------------------
  |  |  446|  84.5k|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
   61|  84.5k|    (void)archive_entry_filetype(entry);
   62|  84.5k|    (void)archive_entry_gid(entry);
   63|  84.5k|    (void)archive_entry_is_data_encrypted(entry);
   64|  84.5k|    (void)archive_entry_is_encrypted(entry);
   65|  84.5k|    (void)archive_entry_is_metadata_encrypted(entry);
   66|  84.5k|    (void)archive_entry_mode(entry);
   67|  84.5k|    (void)archive_entry_mtime(entry);
   68|  84.5k|    (void)archive_entry_size(entry);
   69|  84.5k|    (void)archive_entry_uid(entry);
   70|       |
   71|  84.5k|    ssize_t r;
   72|   106M|    while ((r = archive_read_data(a, data_buffer.data(),
  ------------------
  |  Branch (72:12): [True: 106M, False: 84.5k]
  ------------------
   73|   106M|            data_buffer.size())) > 0)
   74|   106M|      ;
   75|  84.5k|    if (r == ARCHIVE_FATAL)
  ------------------
  |  |  239|  84.5k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (75:9): [True: 393, False: 84.1k]
  ------------------
   76|    393|      break;
   77|  84.5k|  }
   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|}

