archive_acl_clear:
  129|   310k|{
  130|   310k|	struct archive_acl_entry *ap;
  131|       |
  132|   311k|	while (acl->acl_head != NULL) {
  ------------------
  |  Branch (132:9): [True: 917, False: 310k]
  ------------------
  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|   310k|	free(acl->acl_text_w);
  139|   310k|	acl->acl_text_w = NULL;
  140|   310k|	free(acl->acl_text);
  141|   310k|	acl->acl_text = NULL;
  142|       |	acl->acl_p = NULL;
  143|   310k|	acl->acl_types = 0;
  144|   310k|	acl->acl_state = 0; /* Not counting. */
  145|   310k|}
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, *text_end;
 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|    116|	text_end = (text == NULL) ? text : text + length;
  ------------------
  |  Branch (1542:13): [True: 0, False: 116]
  ------------------
 1543|       |
 1544|  20.1k|	while (text != NULL && length > 0 && *text != '\0') {
  ------------------
  |  Branch (1544:9): [True: 20.1k, False: 0]
  |  Branch (1544:25): [True: 20.0k, False: 116]
  |  Branch (1544:39): [True: 20.0k, False: 0]
  ------------------
 1545|       |		/*
 1546|       |		 * Parse the fields out of the next entry,
 1547|       |		 * advance 'text' to start of next entry.
 1548|       |		 */
 1549|  20.0k|		fields = 0;
 1550|  36.8k|		do {
 1551|  36.8k|			const char *start, *end;
 1552|  36.8k|			next_field(&text, &length, &start, &end, &sep);
 1553|  36.8k|			if (fields < numfields) {
  ------------------
  |  Branch (1553:8): [True: 35.6k, False: 1.19k]
  ------------------
 1554|  35.6k|				field[fields].start = start;
 1555|  35.6k|				field[fields].end = end;
 1556|  35.6k|			}
 1557|  36.8k|			++fields;
 1558|  36.8k|		} while (sep == ':');
  ------------------
  |  Branch (1558:12): [True: 16.8k, False: 20.0k]
  ------------------
 1559|       |
 1560|       |		/* Set remaining fields to blank. */
 1561|  88.6k|		for (n = fields; n < numfields; ++n)
  ------------------
  |  Branch (1561:20): [True: 68.5k, False: 20.0k]
  ------------------
 1562|  68.5k|			field[n].start = field[n].end = NULL;
 1563|       |
 1564|  20.0k|		if (field[0].start == NULL || field[0].end == NULL) {
  ------------------
  |  Branch (1564:7): [True: 0, False: 20.0k]
  |  Branch (1564:33): [True: 0, False: 20.0k]
  ------------------
 1565|       |			/* This should never happen */
 1566|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1567|      0|		}
 1568|       |
 1569|  20.0k|		if (field[0].start == text_end) {
  ------------------
  |  Branch (1569:7): [True: 6, False: 20.0k]
  ------------------
 1570|       |			/*
 1571|       |			 * Empty entry: next_field() consumed the rest of the
 1572|       |			 * buffer as separators or whitespace, leaving
 1573|       |			 * field[0].start one past the end.  'text' is not
 1574|       |			 * guaranteed to be NUL terminated, so the byte after it
 1575|       |			 * must not be dereferenced.
 1576|       |			 */
 1577|      6|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|      6|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1578|      6|			continue;
 1579|      6|		}
 1580|       |
 1581|  20.0k|		if (*(field[0].start) == '#') {
  ------------------
  |  Branch (1581:7): [True: 321, False: 19.6k]
  ------------------
 1582|       |			/* Comment, skip entry */
 1583|    321|			continue;
 1584|    321|		}
 1585|       |
 1586|  19.6k|		n = 0;
 1587|  19.6k|		sol = 0;
 1588|  19.6k|		id = -1;
 1589|  19.6k|		permset = 0;
 1590|  19.6k|		name.start = name.end = NULL;
 1591|       |
 1592|  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 (1592:7): [True: 15.7k, False: 3.93k]
  ------------------
 1593|       |			/* POSIX.1e ACLs */
 1594|       |			/*
 1595|       |			 * Default keyword "default:user::rwx"
 1596|       |			 * if found, we have one more field
 1597|       |			 *
 1598|       |			 * We also support old Solaris extension:
 1599|       |			 * "defaultuser::rwx" is the default ACL corresponding
 1600|       |			 * to "user::rwx", etc. valid only for first field
 1601|       |			 */
 1602|  15.7k|			s = field[0].start;
 1603|  15.7k|			len = field[0].end - field[0].start;
 1604|  15.7k|			if (*s == 'd' && (len == 1 || (len >= 7
  ------------------
  |  Branch (1604:8): [True: 1.85k, False: 13.9k]
  |  Branch (1604:22): [True: 1.26k, False: 589]
  |  Branch (1604:35): [True: 103, False: 486]
  ------------------
 1605|  1.36k|			    && memcmp((s + 1), "efault", 6) == 0))) {
  ------------------
  |  Branch (1605:11): [True: 94, False: 9]
  ------------------
 1606|  1.36k|				type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT;
  ------------------
  |  |  535|  1.36k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
 1607|  1.36k|				if (len > 7)
  ------------------
  |  Branch (1607:9): [True: 92, False: 1.26k]
  ------------------
 1608|     92|					field[0].start += 7;
 1609|  1.26k|				else
 1610|  1.26k|					n = 1;
 1611|  1.36k|			} else
 1612|  14.3k|				type = want_type;
 1613|       |
 1614|       |			/* Check for a numeric ID in field n+1 or n+3. */
 1615|  15.7k|			if (isint(field[n + 1].start, field[n + 1].end,
  ------------------
  |  Branch (1615:8): [True: 3, False: 15.7k]
  ------------------
 1616|  15.7k|			    &id) < 0) {
 1617|      3|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1618|      3|				continue;
 1619|      3|			}
 1620|       |			/* Field n+3 is optional. */
 1621|  15.7k|			if (id == -1 && fields > (n + 3) &&
  ------------------
  |  Branch (1621:8): [True: 15.6k, False: 142]
  |  Branch (1621:20): [True: 1.87k, False: 13.7k]
  ------------------
 1622|  1.87k|			    isint(field[n + 3].start, field[n + 3].end,
  ------------------
  |  Branch (1622:8): [True: 11, False: 1.86k]
  ------------------
 1623|  1.87k|			    &id) < 0) {
 1624|     11|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     11|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1625|     11|				continue;
 1626|     11|			}
 1627|       |
 1628|  15.7k|			tag = 0;
 1629|  15.7k|			s = field[n].start;
 1630|  15.7k|			len = field[n].end - field[n].start;
 1631|       |
 1632|  15.7k|			if (len == 0) {
  ------------------
  |  Branch (1632:8): [True: 1.85k, False: 13.8k]
  ------------------
 1633|  1.85k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  1.85k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1634|  1.85k|				continue;
 1635|  1.85k|			}
 1636|       |
 1637|  13.8k|			st = s + 1; 
 1638|       |
 1639|  13.8k|			switch (*s) {
 1640|  1.20k|			case 'u':
  ------------------
  |  Branch (1640:4): [True: 1.20k, False: 12.6k]
  ------------------
 1641|  1.20k|				if (len == 1 || (len == 4
  ------------------
  |  Branch (1641:9): [True: 767, False: 442]
  |  Branch (1641:22): [True: 14, False: 428]
  ------------------
 1642|     14|				    && memcmp(st, "ser", 3) == 0))
  ------------------
  |  Branch (1642:12): [True: 1, False: 13]
  ------------------
 1643|    768|					tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
  ------------------
  |  |  549|    768|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
 1644|  1.20k|				break;
 1645|  2.17k|			case 'g':
  ------------------
  |  Branch (1645:4): [True: 2.17k, False: 11.7k]
  ------------------
 1646|  2.17k|				if (len == 1 || (len == 5
  ------------------
  |  Branch (1646:9): [True: 1.44k, False: 737]
  |  Branch (1646:22): [True: 383, False: 354]
  ------------------
 1647|    383|				    && memcmp(st, "roup", 4) == 0))
  ------------------
  |  Branch (1647:12): [True: 268, False: 115]
  ------------------
 1648|  1.71k|					tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
  ------------------
  |  |  551|  1.71k|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
 1649|  2.17k|				break;
 1650|  1.04k|			case 'o':
  ------------------
  |  Branch (1650:4): [True: 1.04k, False: 12.8k]
  ------------------
 1651|  1.04k|				if (len == 1 || (len == 5
  ------------------
  |  Branch (1651:9): [True: 622, False: 422]
  |  Branch (1651:22): [True: 376, False: 46]
  ------------------
 1652|    376|				    && memcmp(st, "ther", 4) == 0))
  ------------------
  |  Branch (1652:12): [True: 350, False: 26]
  ------------------
 1653|    972|					tag = ARCHIVE_ENTRY_ACL_OTHER;
  ------------------
  |  |  553|    972|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
 1654|  1.04k|				break;
 1655|    711|			case 'm':
  ------------------
  |  Branch (1655:4): [True: 711, False: 13.1k]
  ------------------
 1656|    711|				if (len == 1 || (len == 4
  ------------------
  |  Branch (1656:9): [True: 463, False: 248]
  |  Branch (1656:22): [True: 219, False: 29]
  ------------------
 1657|    219|				    && memcmp(st, "ask", 3) == 0))
  ------------------
  |  Branch (1657:12): [True: 0, False: 219]
  ------------------
 1658|    463|					tag = ARCHIVE_ENTRY_ACL_MASK;
  ------------------
  |  |  552|    463|#define	ARCHIVE_ENTRY_ACL_MASK		10005	/* Modify group access (POSIX.1e only) */
  ------------------
 1659|    711|				break;
 1660|  8.74k|			default:
  ------------------
  |  Branch (1660:4): [True: 8.74k, False: 5.14k]
  ------------------
 1661|  8.74k|					break;
 1662|  13.8k|			}
 1663|       |
 1664|  13.8k|			switch (tag) {
 1665|    972|			case ARCHIVE_ENTRY_ACL_OTHER:
  ------------------
  |  |  553|    972|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
  |  Branch (1665:4): [True: 972, False: 12.9k]
  ------------------
 1666|  1.43k|			case ARCHIVE_ENTRY_ACL_MASK:
  ------------------
  |  |  552|  1.43k|#define	ARCHIVE_ENTRY_ACL_MASK		10005	/* Modify group access (POSIX.1e only) */
  ------------------
  |  Branch (1666:4): [True: 463, False: 13.4k]
  ------------------
 1667|  1.43k|				if (fields == (n + 2)
  ------------------
  |  Branch (1667:9): [True: 722, False: 713]
  ------------------
 1668|    722|				    && field[n + 1].start < field[n + 1].end
  ------------------
  |  Branch (1668:12): [True: 722, False: 0]
  ------------------
 1669|    722|				    && ismode(field[n + 1].start,
  ------------------
  |  Branch (1669:12): [True: 288, False: 434]
  ------------------
 1670|    722|				    field[n + 1].end, &permset)) {
 1671|       |					/* This is Solaris-style "other:rwx" */
 1672|    288|					sol = 1;
 1673|  1.14k|				} else if (fields == (n + 3) &&
  ------------------
  |  Branch (1673:16): [True: 40, False: 1.10k]
  ------------------
 1674|     40|				    field[n + 1].start < field[n + 1].end) {
  ------------------
  |  Branch (1674:9): [True: 36, False: 4]
  ------------------
 1675|       |					/* Invalid mask or other field */
 1676|     36|					ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     36|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1677|     36|					continue;
 1678|     36|				}
 1679|  1.39k|				break;
 1680|  1.39k|			case ARCHIVE_ENTRY_ACL_USER_OBJ:
  ------------------
  |  |  549|    768|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (1680:4): [True: 768, False: 13.1k]
  ------------------
 1681|  2.47k|			case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
  ------------------
  |  |  551|  2.47k|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
  |  Branch (1681:4): [True: 1.71k, False: 12.1k]
  ------------------
 1682|  2.47k|				if (id != -1 ||
  ------------------
  |  Branch (1682:9): [True: 704, False: 1.77k]
  ------------------
 1683|  2.20k|				    field[n + 1].start < field[n + 1].end) {
  ------------------
  |  Branch (1683:9): [True: 1.50k, False: 271]
  ------------------
 1684|  2.20k|					name = field[n + 1];
 1685|  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 (1685:10): [True: 767, False: 1.44k]
  ------------------
 1686|    767|						tag = ARCHIVE_ENTRY_ACL_USER;
  ------------------
  |  |  548|    767|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
 1687|  1.44k|					else
 1688|  1.44k|						tag = ARCHIVE_ENTRY_ACL_GROUP;
  ------------------
  |  |  550|  1.44k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
 1689|  2.20k|				}
 1690|  2.47k|				break;
 1691|  9.97k|			default:
  ------------------
  |  Branch (1691:4): [True: 9.97k, False: 3.91k]
  ------------------
 1692|       |				/* Invalid tag, skip entry */
 1693|  9.97k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  9.97k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1694|  9.97k|				continue;
 1695|  13.8k|			}
 1696|       |
 1697|       |			/*
 1698|       |			 * Without "default:" we expect mode in field 3
 1699|       |			 * Exception: Solaris other and mask fields
 1700|       |			 */
 1701|  3.87k|			if (permset == 0 && !ismode(field[n + 2 - sol].start,
  ------------------
  |  Branch (1701:8): [True: 3.61k, False: 261]
  |  Branch (1701:24): [True: 1.90k, False: 1.70k]
  ------------------
 1702|  3.61k|			    field[n + 2 - sol].end, &permset)) {
 1703|       |				/* Invalid mode, skip entry */
 1704|  1.90k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  1.90k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1705|  1.90k|				continue;
 1706|  1.90k|			}
 1707|  3.93k|		} else {
 1708|       |			/* NFS4 ACLs */
 1709|  3.93k|			s = field[0].start;
 1710|  3.93k|			len = field[0].end - field[0].start;
 1711|  3.93k|			tag = 0;
 1712|       |
 1713|  3.93k|			switch (len) {
 1714|    256|			case 4:
  ------------------
  |  Branch (1714:4): [True: 256, False: 3.67k]
  ------------------
 1715|    256|				if (memcmp(s, "user", 4) == 0)
  ------------------
  |  Branch (1715:9): [True: 0, False: 256]
  ------------------
 1716|      0|					tag = ARCHIVE_ENTRY_ACL_USER;
  ------------------
  |  |  548|      0|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
 1717|    256|				break;
 1718|    490|			case 5:
  ------------------
  |  Branch (1718:4): [True: 490, False: 3.44k]
  ------------------
 1719|    490|				if (memcmp(s, "group", 5) == 0)
  ------------------
  |  Branch (1719:9): [True: 175, False: 315]
  ------------------
 1720|    175|					tag = ARCHIVE_ENTRY_ACL_GROUP;
  ------------------
  |  |  550|    175|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
 1721|    490|				break;
 1722|    612|			case 6:
  ------------------
  |  Branch (1722:4): [True: 612, False: 3.32k]
  ------------------
 1723|    612|				if (memcmp(s, "owner@", 6) == 0)
  ------------------
  |  Branch (1723:9): [True: 55, False: 557]
  ------------------
 1724|     55|					tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
  ------------------
  |  |  549|     55|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
 1725|    557|				else if (memcmp(s, "group@", 6) == 0)
  ------------------
  |  Branch (1725:14): [True: 300, False: 257]
  ------------------
 1726|    300|					tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
  ------------------
  |  |  551|    300|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
 1727|    612|				break;
 1728|    419|			case 9:
  ------------------
  |  Branch (1728:4): [True: 419, False: 3.51k]
  ------------------
 1729|    419|				if (memcmp(s, "everyone@", 9) == 0)
  ------------------
  |  Branch (1729:9): [True: 44, False: 375]
  ------------------
 1730|     44|					tag = ARCHIVE_ENTRY_ACL_EVERYONE;
  ------------------
  |  |  554|     44|#define	ARCHIVE_ENTRY_ACL_EVERYONE	10107   /* Everyone (NFS4 only) */
  ------------------
 1731|    419|				break;
 1732|  2.15k|			default:
  ------------------
  |  Branch (1732:4): [True: 2.15k, False: 1.77k]
  ------------------
 1733|  2.15k|				break;
 1734|  3.93k|			}
 1735|       |
 1736|  3.93k|			if (tag == 0) {
  ------------------
  |  Branch (1736:8): [True: 3.36k, False: 574]
  ------------------
 1737|       |				/* Invalid tag, skip entry */
 1738|  3.36k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  3.36k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1739|  3.36k|				continue;
 1740|  3.36k|			} else if (tag == ARCHIVE_ENTRY_ACL_USER ||
  ------------------
  |  |  548|  1.14k|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
  |  Branch (1740:15): [True: 0, False: 574]
  ------------------
 1741|    574|			    tag == ARCHIVE_ENTRY_ACL_GROUP) {
  ------------------
  |  |  550|    574|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
  |  Branch (1741:8): [True: 175, False: 399]
  ------------------
 1742|    175|				n = 1;
 1743|    175|				name = field[1];
 1744|    175|				if (isint(name.start, name.end, &id) < 0) {
  ------------------
  |  Branch (1744:9): [True: 0, False: 175]
  ------------------
 1745|      0|					ret = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1746|      0|					continue;
 1747|      0|				}
 1748|    175|			} else
 1749|    399|				n = 0;
 1750|       |
 1751|    574|			if (!is_nfs4_perms(field[1 + n].start,
  ------------------
  |  Branch (1751:8): [True: 46, False: 528]
  ------------------
 1752|    574|			    field[1 + n].end, &permset)) {
 1753|       |				/* Invalid NFSv4 perms, skip entry */
 1754|     46|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     46|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1755|     46|				continue;
 1756|     46|			}
 1757|    528|			if (!is_nfs4_flags(field[2 + n].start,
  ------------------
  |  Branch (1757:8): [True: 209, False: 319]
  ------------------
 1758|    528|			    field[2 + n].end, &permset)) {
 1759|       |				/* Invalid NFSv4 flags, skip entry */
 1760|    209|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    209|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1761|    209|				continue;
 1762|    209|			}
 1763|    319|			s = field[3 + n].start;
 1764|    319|			len = field[3 + n].end - field[3 + n].start;
 1765|    319|			type = 0;
 1766|    319|			if (len == 4) {
  ------------------
  |  Branch (1766:8): [True: 134, False: 185]
  ------------------
 1767|    134|				if (memcmp(s, "deny", 4) == 0)
  ------------------
  |  Branch (1767:9): [True: 60, False: 74]
  ------------------
 1768|     60|					type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
  ------------------
  |  |  537|     60|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  ------------------
 1769|    185|			} else if (len == 5) {
  ------------------
  |  Branch (1769:15): [True: 105, False: 80]
  ------------------
 1770|    105|				if (memcmp(s, "allow", 5) == 0)
  ------------------
  |  Branch (1770:9): [True: 76, False: 29]
  ------------------
 1771|     76|					type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
  ------------------
  |  |  536|     76|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  ------------------
 1772|     29|				else if (memcmp(s, "audit", 5) == 0)
  ------------------
  |  Branch (1772:14): [True: 21, False: 8]
  ------------------
 1773|     21|					type = ARCHIVE_ENTRY_ACL_TYPE_AUDIT;
  ------------------
  |  |  538|     21|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  ------------------
 1774|      8|				else if (memcmp(s, "alarm", 5) == 0)
  ------------------
  |  Branch (1774:14): [True: 0, False: 8]
  ------------------
 1775|      0|					type = ARCHIVE_ENTRY_ACL_TYPE_ALARM;
  ------------------
  |  |  539|      0|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  ------------------
 1776|    105|			}
 1777|    319|			if (type == 0) {
  ------------------
  |  Branch (1777:8): [True: 162, False: 157]
  ------------------
 1778|       |				/* Invalid entry type, skip entry */
 1779|    162|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    162|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1780|    162|				continue;
 1781|    162|			}
 1782|    157|			if (isint(field[4 + n].start, field[4 + n].end,
  ------------------
  |  Branch (1782:8): [True: 0, False: 157]
  ------------------
 1783|    157|			    &id) < 0) {
 1784|      0|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1785|      0|				continue;
 1786|      0|			}
 1787|    157|		}
 1788|       |
 1789|       |		/* Add entry to the internal list. */
 1790|  2.12k|		r = archive_acl_add_entry_len_l(acl, type, permset,
 1791|  2.12k|		    tag, id, name.start, name.end - name.start, sc);
 1792|  2.12k|		if (r < ARCHIVE_WARN)
  ------------------
  |  |  235|  2.12k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1792:7): [True: 0, False: 2.12k]
  ------------------
 1793|      0|			return (r);
 1794|  2.12k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.12k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1794:7): [True: 1.16k, False: 958]
  ------------------
 1795|  1.16k|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  1.16k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1796|  2.12k|		types |= type;
 1797|  2.12k|	}
 1798|       |
 1799|       |	/* Reset ACL */
 1800|    116|	archive_acl_reset(acl, types);
 1801|       |
 1802|    116|	return (ret);
 1803|    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:
 1812|  17.9k|{
 1813|  17.9k|	int n = 0;
 1814|  17.9k|	if (start >= end)
  ------------------
  |  Branch (1814:6): [True: 11.7k, False: 6.18k]
  ------------------
 1815|  11.7k|		return (0);
 1816|  8.12k|	while (start < end) {
  ------------------
  |  Branch (1816:9): [True: 7.16k, False: 958]
  ------------------
 1817|  7.16k|		if (*start < '0' || *start > '9')
  ------------------
  |  Branch (1817:7): [True: 3.99k, False: 3.16k]
  |  Branch (1817:23): [True: 1.21k, False: 1.95k]
  ------------------
 1818|  5.21k|			return (0);
 1819|  1.95k|		if (n > (INT_MAX / 10) ||
  ------------------
  |  Branch (1819:7): [True: 6, False: 1.94k]
  ------------------
 1820|  1.94k|		    (n == INT_MAX / 10 && (*start - '0') >= INT_MAX % 10)) {
  ------------------
  |  Branch (1820:8): [True: 8, False: 1.94k]
  |  Branch (1820:29): [True: 8, False: 0]
  ------------------
 1821|     14|			return (-1);
 1822|  1.94k|		} else {
 1823|  1.94k|			n *= 10;
 1824|  1.94k|			n += *start - '0';
 1825|  1.94k|		}
 1826|  1.94k|		start++;
 1827|  1.94k|	}
 1828|    958|	*result = n;
 1829|    958|	return (1);
 1830|  6.18k|}
archive_acl.c:ismode:
 1839|  4.33k|{
 1840|  4.33k|	const char *p;
 1841|       |
 1842|  4.33k|	if (start >= end)
  ------------------
  |  Branch (1842:6): [True: 1.56k, False: 2.77k]
  ------------------
 1843|  1.56k|		return (0);
 1844|  2.77k|	p = start;
 1845|  2.77k|	*permset = 0;
 1846|  7.90k|	while (p < end) {
  ------------------
  |  Branch (1846:9): [True: 5.91k, False: 1.99k]
  ------------------
 1847|  5.91k|		switch (*p++) {
 1848|  1.45k|		case 'r': case 'R':
  ------------------
  |  Branch (1848:3): [True: 1.24k, False: 4.67k]
  |  Branch (1848:13): [True: 214, False: 5.69k]
  ------------------
 1849|  1.45k|			*permset |= ARCHIVE_ENTRY_ACL_READ;
  ------------------
  |  |  471|  1.45k|#define	ARCHIVE_ENTRY_ACL_READ                0x00000004
  ------------------
 1850|  1.45k|			break;
 1851|      0|		case 'w': case 'W':
  ------------------
  |  Branch (1851:3): [True: 0, False: 5.91k]
  |  Branch (1851:13): [True: 0, False: 5.91k]
  ------------------
 1852|      0|			*permset |= ARCHIVE_ENTRY_ACL_WRITE;
  ------------------
  |  |  470|      0|#define	ARCHIVE_ENTRY_ACL_WRITE               0x00000002
  ------------------
 1853|      0|			break;
 1854|      0|		case 'x': case 'X':
  ------------------
  |  Branch (1854:3): [True: 0, False: 5.91k]
  |  Branch (1854:13): [True: 0, False: 5.91k]
  ------------------
 1855|      0|			*permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
  ------------------
  |  |  469|      0|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  ------------------
 1856|      0|			break;
 1857|  3.67k|		case '-':
  ------------------
  |  Branch (1857:3): [True: 3.67k, False: 2.23k]
  ------------------
 1858|  3.67k|			break;
 1859|    780|		default:
  ------------------
  |  Branch (1859:3): [True: 780, False: 5.13k]
  ------------------
 1860|    780|			return (0);
 1861|  5.91k|		}
 1862|  5.91k|	}
 1863|  1.99k|	return (1);
 1864|  2.77k|}
archive_acl.c:is_nfs4_perms:
 1873|    574|{
 1874|    574|	const char *p = start;
 1875|       |
 1876|    785|	while (p < end) {
  ------------------
  |  Branch (1876:9): [True: 257, False: 528]
  ------------------
 1877|    257|		switch (*p++) {
 1878|      0|		case 'r':
  ------------------
  |  Branch (1878:3): [True: 0, False: 257]
  ------------------
 1879|      0|			*permset |= ARCHIVE_ENTRY_ACL_READ_DATA;
  ------------------
  |  |  472|      0|#define	ARCHIVE_ENTRY_ACL_READ_DATA           0x00000008
  ------------------
 1880|      0|			break;
 1881|      0|		case 'w':
  ------------------
  |  Branch (1881:3): [True: 0, False: 257]
  ------------------
 1882|      0|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_DATA;
  ------------------
  |  |  474|      0|#define	ARCHIVE_ENTRY_ACL_WRITE_DATA          0x00000010
  ------------------
 1883|      0|			break;
 1884|      0|		case 'x':
  ------------------
  |  Branch (1884:3): [True: 0, False: 257]
  ------------------
 1885|      0|			*permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
  ------------------
  |  |  469|      0|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  ------------------
 1886|      0|			break;
 1887|      6|		case 'p':
  ------------------
  |  Branch (1887:3): [True: 6, False: 251]
  ------------------
 1888|      6|			*permset |= ARCHIVE_ENTRY_ACL_APPEND_DATA;
  ------------------
  |  |  476|      6|#define	ARCHIVE_ENTRY_ACL_APPEND_DATA         0x00000020
  ------------------
 1889|      6|			break;
 1890|      0|		case 'D':
  ------------------
  |  Branch (1890:3): [True: 0, False: 257]
  ------------------
 1891|      0|			*permset |= ARCHIVE_ENTRY_ACL_DELETE_CHILD;
  ------------------
  |  |  480|      0|#define	ARCHIVE_ENTRY_ACL_DELETE_CHILD        0x00000100
  ------------------
 1892|      0|			break;
 1893|      0|		case 'd':
  ------------------
  |  Branch (1893:3): [True: 0, False: 257]
  ------------------
 1894|      0|			*permset |= ARCHIVE_ENTRY_ACL_DELETE;
  ------------------
  |  |  483|      0|#define	ARCHIVE_ENTRY_ACL_DELETE              0x00000800
  ------------------
 1895|      0|			break;
 1896|    173|		case 'a':
  ------------------
  |  Branch (1896:3): [True: 173, False: 84]
  ------------------
 1897|    173|			*permset |= ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES;
  ------------------
  |  |  481|    173|#define	ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES     0x00000200
  ------------------
 1898|    173|			break;
 1899|      0|		case 'A':
  ------------------
  |  Branch (1899:3): [True: 0, False: 257]
  ------------------
 1900|      0|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES;
  ------------------
  |  |  482|      0|#define	ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES    0x00000400
  ------------------
 1901|      0|			break;
 1902|      0|		case 'R':
  ------------------
  |  Branch (1902:3): [True: 0, False: 257]
  ------------------
 1903|      0|			*permset |= ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS;
  ------------------
  |  |  478|      0|#define	ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS    0x00000040
  ------------------
 1904|      0|			break;
 1905|      0|		case 'W':
  ------------------
  |  Branch (1905:3): [True: 0, False: 257]
  ------------------
 1906|      0|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS;
  ------------------
  |  |  479|      0|#define	ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS   0x00000080
  ------------------
 1907|      0|			break;
 1908|      0|		case 'c':
  ------------------
  |  Branch (1908:3): [True: 0, False: 257]
  ------------------
 1909|      0|			*permset |= ARCHIVE_ENTRY_ACL_READ_ACL;
  ------------------
  |  |  484|      0|#define	ARCHIVE_ENTRY_ACL_READ_ACL            0x00001000
  ------------------
 1910|      0|			break;
 1911|     12|		case 'C':
  ------------------
  |  Branch (1911:3): [True: 12, False: 245]
  ------------------
 1912|     12|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_ACL;
  ------------------
  |  |  485|     12|#define	ARCHIVE_ENTRY_ACL_WRITE_ACL           0x00002000
  ------------------
 1913|     12|			break;
 1914|      6|		case 'o':
  ------------------
  |  Branch (1914:3): [True: 6, False: 251]
  ------------------
 1915|      6|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_OWNER;
  ------------------
  |  |  486|      6|#define	ARCHIVE_ENTRY_ACL_WRITE_OWNER         0x00004000
  ------------------
 1916|      6|			break;
 1917|      0|		case 's':
  ------------------
  |  Branch (1917:3): [True: 0, False: 257]
  ------------------
 1918|      0|			*permset |= ARCHIVE_ENTRY_ACL_SYNCHRONIZE;
  ------------------
  |  |  487|      0|#define	ARCHIVE_ENTRY_ACL_SYNCHRONIZE         0x00008000
  ------------------
 1919|      0|			break;
 1920|     14|		case '-':
  ------------------
  |  Branch (1920:3): [True: 14, False: 243]
  ------------------
 1921|     14|			break;
 1922|     46|		default:
  ------------------
  |  Branch (1922:3): [True: 46, False: 211]
  ------------------
 1923|     46|			return(0);
 1924|    257|		}
 1925|    257|	}
 1926|    528|	return (1);
 1927|    574|}
archive_acl.c:is_nfs4_flags:
 1936|    528|{
 1937|    528|	const char *p = start;
 1938|       |
 1939|    888|	while (p < end) {
  ------------------
  |  Branch (1939:9): [True: 569, False: 319]
  ------------------
 1940|    569|		switch(*p++) {
 1941|     42|		case 'f':
  ------------------
  |  Branch (1941:3): [True: 42, False: 527]
  ------------------
 1942|     42|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT;
  ------------------
  |  |  517|     42|#define	ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT                0x02000000
  ------------------
 1943|     42|			break;
 1944|     12|		case 'd':
  ------------------
  |  Branch (1944:3): [True: 12, False: 557]
  ------------------
 1945|     12|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT;
  ------------------
  |  |  518|     12|#define	ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT           0x04000000
  ------------------
 1946|     12|			break;
 1947|    189|		case 'i':
  ------------------
  |  Branch (1947:3): [True: 189, False: 380]
  ------------------
 1948|    189|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY;
  ------------------
  |  |  520|    189|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY                0x10000000
  ------------------
 1949|    189|			break;
 1950|      7|		case 'n':
  ------------------
  |  Branch (1950:3): [True: 7, False: 562]
  ------------------
 1951|      7|			*permset |=
 1952|      7|			    ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT;
  ------------------
  |  |  519|      7|#define	ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT        0x08000000
  ------------------
 1953|      7|			break;
 1954|     51|		case 'S':
  ------------------
  |  Branch (1954:3): [True: 51, False: 518]
  ------------------
 1955|     51|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS;
  ------------------
  |  |  521|     51|#define	ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS           0x20000000
  ------------------
 1956|     51|			break;
 1957|      8|		case 'F':
  ------------------
  |  Branch (1957:3): [True: 8, False: 561]
  ------------------
 1958|      8|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS;
  ------------------
  |  |  522|      8|#define	ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS               0x40000000
  ------------------
 1959|      8|			break;
 1960|     38|		case 'I':
  ------------------
  |  Branch (1960:3): [True: 38, False: 531]
  ------------------
 1961|     38|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERITED;
  ------------------
  |  |  516|     38|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERITED                   0x01000000
  ------------------
 1962|     38|			break;
 1963|     13|		case '-':
  ------------------
  |  Branch (1963:3): [True: 13, False: 556]
  ------------------
 1964|     13|			break;
 1965|    209|		default:
  ------------------
  |  Branch (1965:3): [True: 209, False: 360]
  ------------------
 1966|    209|			return (0);
 1967|    569|		}
 1968|    569|	}
 1969|    319|	return (1);
 1970|    528|}
archive_acl.c:next_field:
 1983|  36.8k|{
 1984|       |	/* Skip leading whitespace to find start of field. */
 1985|  81.7k|	while (*l > 0 && (**p == ' ' || **p == '\t' || **p == '\n')) {
  ------------------
  |  Branch (1985:9): [True: 81.6k, False: 18]
  |  Branch (1985:20): [True: 351, False: 81.3k]
  |  Branch (1985:34): [True: 631, False: 80.7k]
  |  Branch (1985:49): [True: 43.8k, False: 36.8k]
  ------------------
 1986|  44.8k|		(*p)++;
 1987|  44.8k|		(*l)--;
 1988|  44.8k|	}
 1989|  36.8k|	*start = *p;
 1990|       |
 1991|       |	/* Locate end of field, trim trailing whitespace if necessary */
 1992|   170k|	while (*l > 0 && **p != ' ' && **p != '\t' && **p != '\n' && **p != ',' && **p != ':' && **p != '#') {
  ------------------
  |  Branch (1992:9): [True: 170k, False: 95]
  |  Branch (1992:19): [True: 168k, False: 1.80k]
  |  Branch (1992:33): [True: 168k, False: 356]
  |  Branch (1992:48): [True: 150k, False: 17.6k]
  |  Branch (1992:63): [True: 149k, False: 443]
  |  Branch (1992:77): [True: 134k, False: 15.9k]
  |  Branch (1992:91): [True: 133k, False: 505]
  ------------------
 1993|   133k|		(*p)++;
 1994|   133k|		(*l)--;
 1995|   133k|	}
 1996|  36.8k|	*end = *p;
 1997|       |
 1998|       |	/* Scan for the separator. */
 1999|  62.4k|	while (*l > 0 && **p != ',' && **p != ':' && **p != '\n' && **p != '#') {
  ------------------
  |  Branch (1999:9): [True: 62.3k, False: 102]
  |  Branch (1999:19): [True: 61.6k, False: 678]
  |  Branch (1999:33): [True: 44.8k, False: 16.8k]
  |  Branch (1999:47): [True: 26.0k, False: 18.7k]
  |  Branch (1999:62): [True: 25.5k, False: 505]
  ------------------
 2000|  25.5k|		(*p)++;
 2001|  25.5k|		(*l)--;
 2002|  25.5k|	}
 2003|  36.8k|	if (*l > 0)
  ------------------
  |  Branch (2003:6): [True: 36.7k, False: 102]
  ------------------
 2004|  36.7k|		*sep = **p;
 2005|    102|	else
 2006|    102|		*sep = '\0';
 2007|       |
 2008|       |	/* Handle in-field comments */
 2009|  36.8k|	if (*sep == '#') {
  ------------------
  |  Branch (2009:6): [True: 505, False: 36.3k]
  ------------------
 2010|  11.0k|		while (*l > 0 && **p != ',' && **p != '\n') {
  ------------------
  |  Branch (2010:10): [True: 11.0k, False: 10]
  |  Branch (2010:20): [True: 10.9k, False: 79]
  |  Branch (2010:34): [True: 10.5k, False: 416]
  ------------------
 2011|  10.5k|			(*p)++;
 2012|  10.5k|			(*l)--;
 2013|  10.5k|		}
 2014|    505|		if (*l > 0)
  ------------------
  |  Branch (2014:7): [True: 495, False: 10]
  ------------------
 2015|    495|			*sep = **p;
 2016|     10|		else
 2017|     10|			*sep = '\0';
 2018|    505|	}
 2019|       |
 2020|       |	/* Skip separator. */
 2021|  36.8k|	if (*l > 0) {
  ------------------
  |  Branch (2021:6): [True: 36.7k, False: 112]
  ------------------
 2022|  36.7k|		(*p)++;
 2023|  36.7k|		(*l)--;
 2024|  36.7k|	}
 2025|  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:
  137|   692k|{
  138|   692k|	char states1[64];
  139|   692k|	char states2[64];
  140|   692k|	const char *handle_type;
  141|       |
  142|       |	/*
  143|       |	 * If this isn't some form of archive handle,
  144|       |	 * then the library user has screwed up so bad that
  145|       |	 * we don't even have a reliable way to report an error.
  146|       |	 */
  147|   692k|	handle_type = archive_handle_type_name(a->magic);
  148|       |
  149|   692k|	if (!handle_type) {
  ------------------
  |  Branch (149:6): [True: 0, False: 692k]
  ------------------
  150|      0|		errmsg("PROGRAMMER ERROR: Function ");
  151|      0|		errmsg(function);
  152|      0|		errmsg(" invoked with invalid archive handle\n");
  153|      0|		diediedie();
  154|      0|	}
  155|       |
  156|   692k|	if (a->magic != magic) {
  ------------------
  |  Branch (156:6): [True: 0, False: 692k]
  ------------------
  157|      0|		archive_set_error(a, -1,
  158|      0|		    "PROGRAMMER ERROR: Function '%s' invoked"
  159|      0|		    " on '%s' archive object, which is not supported",
  160|      0|		    function,
  161|      0|		    handle_type);
  162|      0|		a->state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   94|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  163|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  164|      0|	}
  165|       |
  166|   692k|	if ((a->state & state) == 0) {
  ------------------
  |  Branch (166:6): [True: 2.44k, False: 690k]
  ------------------
  167|       |		/* If we're already FATAL, don't overwrite the error. */
  168|  2.44k|		if (a->state != ARCHIVE_STATE_FATAL) {
  ------------------
  |  |   94|  2.44k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  |  Branch (168:7): [True: 308, False: 2.13k]
  ------------------
  169|    308|			write_all_states(states1, a->state);
  170|    308|			write_all_states(states2, state);
  171|    308|			archive_set_error(a, -1,
  172|    308|			    "INTERNAL ERROR: Function '%s' invoked with"
  173|    308|			    " archive structure in state '%s',"
  174|    308|			    " should be in state '%s'",
  175|    308|			    function,
  176|    308|			    states1,
  177|    308|			    states2);
  178|    308|		}
  179|  2.44k|		a->state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   94|  2.44k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  180|  2.44k|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|  2.44k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  181|  2.44k|	}
  182|   690k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|   690k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  183|   692k|}
archive_check_magic.c:archive_handle_type_name:
   98|   692k|{
   99|   692k|	switch (m) {
  100|      0|	case ARCHIVE_WRITE_MAGIC:	return ("archive_write");
  ------------------
  |  |   58|      0|#define	ARCHIVE_WRITE_MAGIC	(0xb0c5c0deU)
  ------------------
  |  Branch (100:2): [True: 0, False: 692k]
  ------------------
  101|   692k|	case ARCHIVE_READ_MAGIC:	return ("archive_read");
  ------------------
  |  |   59|   692k|#define	ARCHIVE_READ_MAGIC	(0xdeb0c5U)
  ------------------
  |  Branch (101:2): [True: 692k, False: 0]
  ------------------
  102|      0|	case ARCHIVE_WRITE_DISK_MAGIC:	return ("archive_write_disk");
  ------------------
  |  |   60|      0|#define	ARCHIVE_WRITE_DISK_MAGIC (0xc001b0c5U)
  ------------------
  |  Branch (102:2): [True: 0, False: 692k]
  ------------------
  103|      0|	case ARCHIVE_READ_DISK_MAGIC:	return ("archive_read_disk");
  ------------------
  |  |   61|      0|#define	ARCHIVE_READ_DISK_MAGIC (0xbadb0c5U)
  ------------------
  |  Branch (103:2): [True: 0, False: 692k]
  ------------------
  104|      0|	case ARCHIVE_MATCH_MAGIC:	return ("archive_match");
  ------------------
  |  |   62|      0|#define	ARCHIVE_MATCH_MAGIC	(0xcad11c9U)
  ------------------
  |  Branch (104:2): [True: 0, False: 692k]
  ------------------
  105|      0|	default:			return NULL;
  ------------------
  |  Branch (105:2): [True: 0, False: 692k]
  ------------------
  106|   692k|	}
  107|   692k|}
archive_check_magic.c:write_all_states:
  111|    616|{
  112|    616|	unsigned int lowbit;
  113|       |
  114|    616|	*buff = '\0';
  115|       |
  116|       |	/* A trick for computing the lowest set bit. */
  117|  1.23k|	while ((lowbit = states & (1 + ~states)) != 0) {
  ------------------
  |  Branch (117:9): [True: 616, False: 616]
  ------------------
  118|    616|		states &= ~lowbit;		/* Clear the low bit. */
  119|    616|		strcat(buff, state_name(lowbit));
  120|    616|		if (states != 0)
  ------------------
  |  Branch (120:7): [True: 0, False: 616]
  ------------------
  121|      0|			strcat(buff, "/");
  122|    616|	}
  123|    616|}
archive_check_magic.c:state_name:
   83|    616|{
   84|    616|	switch (s) {
   85|      0|	case ARCHIVE_STATE_NEW:		return ("new");
  ------------------
  |  |   76|      0|#define	ARCHIVE_STATE_NEW	1U
  ------------------
  |  Branch (85:2): [True: 0, False: 616]
  ------------------
   86|      0|	case ARCHIVE_STATE_HEADER:	return ("header");
  ------------------
  |  |   78|      0|#define	ARCHIVE_STATE_HEADER	2U
  ------------------
  |  Branch (86:2): [True: 0, False: 616]
  ------------------
   87|    308|	case ARCHIVE_STATE_DATA:	return ("data");
  ------------------
  |  |   82|    308|#define	ARCHIVE_STATE_DATA	4U
  ------------------
  |  Branch (87:2): [True: 308, False: 308]
  ------------------
   88|      1|	case ARCHIVE_STATE_DATA_RECOVERY: return ("data_recovery");
  ------------------
  |  |   86|      1|#define	ARCHIVE_STATE_DATA_RECOVERY	8U
  ------------------
  |  Branch (88:2): [True: 1, False: 615]
  ------------------
   89|    307|	case ARCHIVE_STATE_EOF:		return ("eof");
  ------------------
  |  |   89|    307|#define	ARCHIVE_STATE_EOF	0x10U
  ------------------
  |  Branch (89:2): [True: 307, False: 309]
  ------------------
   90|      0|	case ARCHIVE_STATE_CLOSED:	return ("closed");
  ------------------
  |  |   91|      0|#define	ARCHIVE_STATE_CLOSED	0x20U
  ------------------
  |  Branch (90:2): [True: 0, False: 616]
  ------------------
   91|      0|	case ARCHIVE_STATE_FATAL:	return ("fatal");
  ------------------
  |  |   94|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  |  Branch (91:2): [True: 0, False: 616]
  ------------------
   92|      0|	default:			return ("??");
  ------------------
  |  Branch (92:2): [True: 0, False: 616]
  ------------------
   93|    616|	}
   94|    616|}

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

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|   105k|{
  145|   105k|	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|   105k|	unsigned int p3 = p[3];
  151|   105k|	unsigned int p2 = p[2];
  152|   105k|	unsigned int p1 = p[1];
  153|   105k|	unsigned int p0 = p[0];
  154|       |
  155|   105k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|   105k|}
archive_read_support_format_cab.c:archive_le16dec:
  115|  2.31k|{
  116|  2.31k|	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.31k|	unsigned int p1 = p[1];
  122|  2.31k|	unsigned int p0 = p[0];
  123|       |
  124|  2.31k|	return ((p1 << 8) | p0);
  125|  2.31k|}
archive_read_support_format_cab.c:archive_le16enc:
  197|    902|{
  198|    902|	unsigned char *p = (unsigned char *)pp;
  199|       |
  200|    902|	p[0] = u & 0xff;
  201|    902|	p[1] = (u >> 8) & 0xff;
  202|    902|}
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|   215k|{
  116|   215k|	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|   215k|	unsigned int p1 = p[1];
  122|   215k|	unsigned int p0 = p[0];
  123|       |
  124|   215k|	return ((p1 << 8) | p0);
  125|   215k|}
archive_read_support_format_zip.c:archive_le32dec:
  144|   318k|{
  145|   318k|	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|   318k|	unsigned int p3 = p[3];
  151|   318k|	unsigned int p2 = p[2];
  152|   318k|	unsigned int p1 = p[1];
  153|   318k|	unsigned int p0 = p[0];
  154|       |
  155|   318k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|   318k|}
archive_read_support_format_zip.c:archive_le64dec:
  160|  29.1k|{
  161|  29.1k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  29.1k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  29.1k|}
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|   310k|{
  156|   310k|	if (entry == NULL)
  ------------------
  |  Branch (156:6): [True: 0, False: 310k]
  ------------------
  157|      0|		return (NULL);
  158|   310k|	archive_mstring_clean(&entry->ae_fflags_text);
  159|   310k|	archive_mstring_clean(&entry->ae_gname);
  160|   310k|	archive_mstring_clean(&entry->ae_linkname);
  161|   310k|	archive_mstring_clean(&entry->ae_pathname);
  162|   310k|	archive_mstring_clean(&entry->ae_sourcepath);
  163|   310k|	archive_mstring_clean(&entry->ae_uname);
  164|   310k|	archive_entry_copy_mac_metadata(entry, NULL, 0);
  165|   310k|	archive_acl_clear(&entry->acl);
  166|   310k|	archive_entry_xattr_clear(entry);
  167|   310k|	archive_entry_sparse_clear(entry);
  168|   310k|	free(entry->stat);
  169|   310k|	entry->ae_symlink_type = AE_SYMLINK_TYPE_UNDEFINED;
  ------------------
  |  |  227|   310k|#define AE_SYMLINK_TYPE_UNDEFINED	0
  ------------------
  170|   310k|	memset(entry, 0, sizeof(*entry));
  171|   310k|	return entry;
  172|   310k|}
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|  83.5k|{
  281|  83.5k|	return (entry->ae_stat.aest_atime);
  282|  83.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|  83.5k|{
  299|  83.5k|	return (entry->ae_stat.aest_birthtime);
  300|  83.5k|}
archive_entry_ctime:
  316|  83.5k|{
  317|  83.5k|	return (entry->ae_stat.aest_ctime);
  318|  83.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|  88.0k|{
  335|  88.0k|	if (entry->ae_stat.aest_dev_is_broken_down)
  ------------------
  |  Branch (335:6): [True: 8.64k, False: 79.4k]
  ------------------
  336|  8.64k|		return ae_makedev(entry->ae_stat.aest_devmajor,
  ------------------
  |  |   94|  8.64k|#define ae_makedev(maj, min) makedev((maj), (min))
  ------------------
  337|  79.4k|		    entry->ae_stat.aest_devminor);
  338|  79.4k|	else
  339|  79.4k|		return (entry->ae_stat.aest_dev);
  340|  88.0k|}
archive_entry_filetype:
  368|   118k|{
  369|   118k|	return (AE_IFMT & entry->acl.mode);
  ------------------
  |  |  215|   118k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  370|   118k|}
archive_entry_gid:
  427|  83.5k|{
  428|  83.5k|	return (entry->ae_stat.aest_gid);
  429|  83.5k|}
archive_entry_gid_is_set:
  433|  20.9k|{
  434|  20.9k|	return (entry->ae_set & AE_SET_GID);
  ------------------
  |  |  151|  20.9k|#define	AE_SET_GID	4096
  ------------------
  435|  20.9k|}
archive_entry_gname:
  439|  7.76k|{
  440|  7.76k|	const char *p;
  441|  7.76k|	if (archive_mstring_get_mbs(entry->archive, &entry->ae_gname, &p) == 0)
  ------------------
  |  Branch (441:6): [True: 7.76k, False: 0]
  ------------------
  442|  7.76k|		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|  83.5k|{
  568|  83.5k|	return (entry->acl.mode);
  569|  83.5k|}
archive_entry_mtime:
  573|  83.5k|{
  574|  83.5k|	return (entry->ae_stat.aest_mtime);
  575|  83.5k|}
archive_entry_mtime_is_set:
  585|  20.9k|{
  586|  20.9k|	return (entry->ae_set & AE_SET_MTIME);
  ------------------
  |  |  143|  20.9k|#define	AE_SET_MTIME	16
  ------------------
  587|  20.9k|}
archive_entry_nlink:
  591|  6.93k|{
  592|  6.93k|	return (entry->ae_stat.aest_nlink);
  593|  6.93k|}
archive_entry_pathname:
  604|   153k|{
  605|   153k|	const char *p;
  606|   153k|	if (archive_mstring_get_mbs(
  ------------------
  |  Branch (606:6): [True: 153k, False: 6]
  ------------------
  607|   153k|	    entry->archive, &entry->ae_pathname, &p) == 0)
  608|   153k|		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|  90.1k|{
  624|  90.1k|	const char *p;
  625|  90.1k|	if (archive_mstring_get_utf8(
  ------------------
  |  Branch (625:6): [True: 73.6k, False: 16.5k]
  ------------------
  626|  90.1k|	    entry->archive, &entry->ae_pathname, &p) == 0)
  627|  73.6k|		return (p);
  628|  16.5k|	if (errno == ENOMEM)
  ------------------
  |  Branch (628:6): [True: 0, False: 16.5k]
  ------------------
  629|      0|		__archive_errx(1, "No memory");
  630|  16.5k|	return (NULL);
  631|  16.5k|}
archive_entry_pathname_w:
  635|   156k|{
  636|   156k|	const wchar_t *p;
  637|   156k|	if (archive_mstring_get_wcs(
  ------------------
  |  Branch (637:6): [True: 126k, False: 29.4k]
  ------------------
  638|   156k|	    entry->archive, &entry->ae_pathname, &p) == 0)
  639|   126k|		return (p);
  640|  29.4k|	if (errno == ENOMEM)
  ------------------
  |  Branch (640:6): [True: 0, False: 29.4k]
  ------------------
  641|      0|		__archive_errx(1, "No memory");
  642|  29.4k|	return (NULL);
  643|  29.4k|}
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|  20.9k|{
  661|  20.9k|	return (entry->ae_set & AE_SET_PERM);
  ------------------
  |  |  148|  20.9k|#define	AE_SET_PERM	512
  ------------------
  662|  20.9k|}
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|   218k|{
  713|   218k|	return (entry->ae_stat.aest_size);
  714|   218k|}
archive_entry_size_is_set:
  718|  83.5k|{
  719|  83.5k|	return (entry->ae_set & AE_SET_SIZE);
  ------------------
  |  |  145|  83.5k|#define	AE_SET_SIZE	64
  ------------------
  720|  83.5k|}
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|  83.5k|{
  816|  83.5k|	return (entry->ae_stat.aest_uid);
  817|  83.5k|}
archive_entry_uid_is_set:
  821|  20.9k|{
  822|  20.9k|	return (entry->ae_set & AE_SET_UID);
  ------------------
  |  |  150|  20.9k|#define	AE_SET_UID	2048
  ------------------
  823|  20.9k|}
archive_entry_uname:
  827|  7.76k|{
  828|  7.76k|	const char *p;
  829|  7.76k|	if (archive_mstring_get_mbs(entry->archive, &entry->ae_uname, &p) == 0)
  ------------------
  |  Branch (829:6): [True: 7.76k, False: 0]
  ------------------
  830|  7.76k|		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|  83.5k|{
  868|  83.5k|	return ((entry->encryption & AE_ENCRYPTION_DATA) == AE_ENCRYPTION_DATA);
  ------------------
  |  |  169|  83.5k|#define AE_ENCRYPTION_DATA 1
  ------------------
              	return ((entry->encryption & AE_ENCRYPTION_DATA) == AE_ENCRYPTION_DATA);
  ------------------
  |  |  169|  83.5k|#define AE_ENCRYPTION_DATA 1
  ------------------
  869|  83.5k|}
archive_entry_is_metadata_encrypted:
  873|  83.5k|{
  874|  83.5k|	return ((entry->encryption & AE_ENCRYPTION_METADATA) == AE_ENCRYPTION_METADATA);
  ------------------
  |  |  170|  83.5k|#define AE_ENCRYPTION_METADATA 2
  ------------------
              	return ((entry->encryption & AE_ENCRYPTION_METADATA) == AE_ENCRYPTION_METADATA);
  ------------------
  |  |  170|  83.5k|#define AE_ENCRYPTION_METADATA 2
  ------------------
  875|  83.5k|}
archive_entry_is_encrypted:
  879|  83.5k|{
  880|  83.5k|	return (entry->encryption & (AE_ENCRYPTION_DATA|AE_ENCRYPTION_METADATA));
  ------------------
  |  |  169|  83.5k|#define AE_ENCRYPTION_DATA 1
  ------------------
              	return (entry->encryption & (AE_ENCRYPTION_DATA|AE_ENCRYPTION_METADATA));
  ------------------
  |  |  170|  83.5k|#define AE_ENCRYPTION_METADATA 2
  ------------------
  881|  83.5k|}
archive_entry_set_filetype:
  889|  63.5k|{
  890|  63.5k|	entry->stat_valid = 0;
  891|  63.5k|	entry->acl.mode &= ~AE_IFMT;
  ------------------
  |  |  215|  63.5k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  892|  63.5k|	entry->acl.mode |= AE_IFMT & type;
  ------------------
  |  |  215|  63.5k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  893|  63.5k|	entry->ae_set |= AE_SET_FILETYPE;
  ------------------
  |  |  149|  63.5k|#define	AE_SET_FILETYPE	1024
  ------------------
  894|  63.5k|}
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|  66.3k|{
  933|  66.3k|	if (g < 0) {
  ------------------
  |  Branch (933:6): [True: 124, False: 66.1k]
  ------------------
  934|    124|		g = 0;
  935|    124|	}
  936|  66.3k|	entry->stat_valid = 0;
  937|  66.3k|	entry->ae_stat.aest_gid = g;
  938|  66.3k|	entry->ae_set |= AE_SET_GID;
  ------------------
  |  |  151|  66.3k|#define	AE_SET_GID	4096
  ------------------
  939|  66.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|  7.76k|{
  980|  7.76k|	return (archive_mstring_copy_mbs_len_l(&entry->ae_gname, name, len, sc));
  981|  7.76k|}
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|  39.5k|{
 1097|  39.5k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  39.5k|	do {	\
  |  |  113|  39.5k|		t += ns / 1000000000; \
  |  |  114|  39.5k|		ns %= 1000000000; \
  |  |  115|  39.5k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 39.5k]
  |  |  ------------------
  |  |  116|  39.5k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 39.5k]
  |  |  ------------------
  ------------------
 1098|  39.5k|	entry->stat_valid = 0;
 1099|  39.5k|	entry->ae_set |= AE_SET_ATIME;
  ------------------
  |  |  141|  39.5k|#define	AE_SET_ATIME	4
  ------------------
 1100|  39.5k|	entry->ae_stat.aest_atime = t;
 1101|  39.5k|	entry->ae_stat.aest_atime_nsec = ns;
 1102|  39.5k|}
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|  47.6k|{
 1131|  47.6k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  47.6k|	do {	\
  |  |  113|  47.6k|		t += ns / 1000000000; \
  |  |  114|  47.6k|		ns %= 1000000000; \
  |  |  115|  47.6k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 47.6k]
  |  |  ------------------
  |  |  116|  47.6k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 47.6k]
  |  |  ------------------
  ------------------
 1132|  47.6k|	entry->stat_valid = 0;
 1133|  47.6k|	entry->ae_set |= AE_SET_CTIME;
  ------------------
  |  |  142|  47.6k|#define	AE_SET_CTIME	8
  ------------------
 1134|  47.6k|	entry->ae_stat.aest_ctime = t;
 1135|  47.6k|	entry->ae_stat.aest_ctime_nsec = ns;
 1136|  47.6k|}
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|  50.3k|{
 1244|  50.3k|	entry->stat_valid = 0;
 1245|  50.3k|	entry->acl.mode = m;
 1246|  50.3k|	entry->ae_set |= AE_SET_PERM | AE_SET_FILETYPE;
  ------------------
  |  |  148|  50.3k|#define	AE_SET_PERM	512
  ------------------
              	entry->ae_set |= AE_SET_PERM | AE_SET_FILETYPE;
  ------------------
  |  |  149|  50.3k|#define	AE_SET_FILETYPE	1024
  ------------------
 1247|  50.3k|}
archive_entry_set_mtime:
 1251|  79.0k|{
 1252|  79.0k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  79.0k|	do {	\
  |  |  113|  79.0k|		t += ns / 1000000000; \
  |  |  114|  79.0k|		ns %= 1000000000; \
  |  |  115|  79.0k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 79.0k]
  |  |  ------------------
  |  |  116|  79.0k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 79.0k]
  |  |  ------------------
  ------------------
 1253|  79.0k|	entry->stat_valid = 0;
 1254|  79.0k|	entry->ae_set |= AE_SET_MTIME;
  ------------------
  |  |  143|  79.0k|#define	AE_SET_MTIME	16
  ------------------
 1255|  79.0k|	entry->ae_stat.aest_mtime = t;
 1256|  79.0k|	entry->ae_stat.aest_mtime_nsec = ns;
 1257|  79.0k|}
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|  63.3k|{
 1312|  63.3k|	return (archive_mstring_copy_mbs_len_l(&entry->ae_pathname,
 1313|  63.3k|	    name, len, sc));
 1314|  63.3k|}
archive_entry_set_perm:
 1318|  28.7k|{
 1319|  28.7k|	entry->stat_valid = 0;
 1320|  28.7k|	entry->acl.mode &= AE_IFMT;
  ------------------
  |  |  215|  28.7k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1321|  28.7k|	entry->acl.mode |= ~AE_IFMT & p;
  ------------------
  |  |  215|  28.7k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1322|  28.7k|	entry->ae_set |= AE_SET_PERM;
  ------------------
  |  |  148|  28.7k|#define	AE_SET_PERM	512
  ------------------
 1323|  28.7k|}
archive_entry_set_rdev:
 1327|  9.19k|{
 1328|  9.19k|	entry->stat_valid = 0;
 1329|  9.19k|	entry->ae_stat.aest_rdev = m;
 1330|  9.19k|	entry->ae_stat.aest_rdev_is_broken_down = 0;
 1331|  9.19k|	entry->ae_stat.aest_rdevmajor = 0;
 1332|  9.19k|	entry->ae_stat.aest_rdevminor = 0;
 1333|  9.19k|	entry->ae_set |= AE_SET_RDEV;
  ------------------
  |  |  152|  9.19k|#define	AE_SET_RDEV	8192
  ------------------
 1334|  9.19k|}
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|  82.6k|{
 1359|  82.6k|	if (s < 0) {
  ------------------
  |  Branch (1359:6): [True: 0, False: 82.6k]
  ------------------
 1360|      0|		s = 0;
 1361|      0|	}
 1362|  82.6k|	entry->stat_valid = 0;
 1363|  82.6k|	entry->ae_stat.aest_size = s;
 1364|  82.6k|	entry->ae_set |= AE_SET_SIZE;
  ------------------
  |  |  145|  82.6k|#define	AE_SET_SIZE	64
  ------------------
 1365|  82.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|  66.9k|{
 1483|  66.9k|	if (u < 0) {
  ------------------
  |  Branch (1483:6): [True: 270, False: 66.7k]
  ------------------
 1484|    270|		u = 0;
 1485|    270|	}
 1486|  66.9k|	entry->stat_valid = 0;
 1487|  66.9k|	entry->ae_stat.aest_uid = u;
 1488|  66.9k|	entry->ae_set |= AE_SET_UID;
  ------------------
  |  |  150|  66.9k|#define	AE_SET_UID	2048
  ------------------
 1489|  66.9k|}
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.2k|{
 1529|  12.2k|	if (is_encrypted) {
  ------------------
  |  Branch (1529:6): [True: 12.2k, False: 0]
  ------------------
 1530|  12.2k|		entry->encryption |= AE_ENCRYPTION_DATA;
  ------------------
  |  |  169|  12.2k|#define AE_ENCRYPTION_DATA 1
  ------------------
 1531|  12.2k|	} else {
 1532|      0|		entry->encryption &= ~AE_ENCRYPTION_DATA;
  ------------------
  |  |  169|      0|#define AE_ENCRYPTION_DATA 1
  ------------------
 1533|      0|	}
 1534|  12.2k|}
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|  7.76k|{
 1550|  7.76k|	return (archive_mstring_copy_mbs_len_l(&entry->ae_uname,
 1551|  7.76k|	    name, len, sc));
 1552|  7.76k|}
archive_entry_copy_mac_metadata:
 1564|   310k|{
 1565|   310k|  free(entry->mac_metadata);
 1566|   310k|  if (p == NULL || s == 0) {
  ------------------
  |  Branch (1566:7): [True: 310k, False: 0]
  |  Branch (1566:20): [True: 0, False: 0]
  ------------------
 1567|   310k|    entry->mac_metadata = NULL;
 1568|   310k|    entry->mac_metadata_size = 0;
 1569|   310k|  } 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|   310k|}
archive_entry_digest:
 1581|  83.5k|{
 1582|  83.5k|	switch (type) {
 1583|      0|	case ARCHIVE_ENTRY_DIGEST_MD5:
  ------------------
  |  |  444|      0|#define ARCHIVE_ENTRY_DIGEST_MD5              0x00000001
  ------------------
  |  Branch (1583:2): [True: 0, False: 83.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: 83.5k]
  ------------------
 1586|      0|		return entry->digest.rmd160;
 1587|  83.5k|	case ARCHIVE_ENTRY_DIGEST_SHA1:
  ------------------
  |  |  446|  83.5k|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
  |  Branch (1587:2): [True: 83.5k, False: 0]
  ------------------
 1588|  83.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: 83.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: 83.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: 83.5k]
  ------------------
 1594|      0|		return entry->digest.sha512;
 1595|      0|	default:
  ------------------
  |  Branch (1595:2): [True: 0, False: 83.5k]
  ------------------
 1596|       |		return NULL;
 1597|  83.5k|	}
 1598|  83.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:
  101|     33|{
  102|     33|	struct archive_entry_linkresolver *res;
  103|       |
  104|       |	/* Check for positive power-of-two */
  105|     33|	if (links_cache_initial_size == 0 ||
  ------------------
  |  |   68|     33|#define	links_cache_initial_size 1024
  ------------------
  |  Branch (105:6): [Folded, False: 0]
  ------------------
  106|      0|	    (links_cache_initial_size & (links_cache_initial_size - 1)) != 0)
  ------------------
  |  |   68|      0|#define	links_cache_initial_size 1024
  ------------------
              	    (links_cache_initial_size & (links_cache_initial_size - 1)) != 0)
  ------------------
  |  |   68|      0|#define	links_cache_initial_size 1024
  ------------------
  |  Branch (106:6): [Folded, False: 0]
  ------------------
  107|      0|		return (NULL);
  108|       |
  109|     33|	res = calloc(1, sizeof(struct archive_entry_linkresolver));
  110|     33|	if (res == NULL)
  ------------------
  |  Branch (110:6): [True: 0, False: 33]
  ------------------
  111|      0|		return (NULL);
  112|     33|	res->number_buckets = links_cache_initial_size;
  ------------------
  |  |   68|     33|#define	links_cache_initial_size 1024
  ------------------
  113|     33|	res->buckets = calloc(res->number_buckets, sizeof(res->buckets[0]));
  114|     33|	if (res->buckets == NULL) {
  ------------------
  |  Branch (114:6): [True: 0, False: 33]
  ------------------
  115|      0|		free(res);
  116|      0|		return (NULL);
  117|      0|	}
  118|     33|	return (res);
  119|     33|}
archive_entry_linkresolver_set_strategy:
  124|     33|{
  125|     33|	int fmtbase = fmt & ARCHIVE_FORMAT_BASE_MASK;
  ------------------
  |  |  355|     33|#define	ARCHIVE_FORMAT_BASE_MASK		0xff0000
  ------------------
  126|       |
  127|     33|	switch (fmtbase) {
  128|      0|	case ARCHIVE_FORMAT_7ZIP:
  ------------------
  |  |  385|      0|#define	ARCHIVE_FORMAT_7ZIP			0xE0000
  ------------------
  |  Branch (128:2): [True: 0, False: 33]
  ------------------
  129|      0|	case ARCHIVE_FORMAT_AR:
  ------------------
  |  |  376|      0|#define	ARCHIVE_FORMAT_AR			0x70000
  ------------------
  |  Branch (129:2): [True: 0, False: 33]
  ------------------
  130|      0|	case ARCHIVE_FORMAT_ZIP:
  ------------------
  |  |  374|      0|#define	ARCHIVE_FORMAT_ZIP			0x50000
  ------------------
  |  Branch (130:2): [True: 0, False: 33]
  ------------------
  131|      0|		res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO;
  ------------------
  |  |   64|      0|#define ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO 2
  ------------------
  132|      0|		break;
  133|      0|	case ARCHIVE_FORMAT_CPIO:
  ------------------
  |  |  356|      0|#define	ARCHIVE_FORMAT_CPIO			0x10000
  ------------------
  |  Branch (133:2): [True: 0, False: 33]
  ------------------
  134|      0|		switch (fmt) {
  135|      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 (135:3): [True: 0, False: 0]
  ------------------
  136|      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 (136:3): [True: 0, False: 0]
  ------------------
  137|      0|			res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_NEW_CPIO;
  ------------------
  |  |   65|      0|#define ARCHIVE_ENTRY_LINKIFY_LIKE_NEW_CPIO 3
  ------------------
  138|      0|			break;
  139|      0|		default:
  ------------------
  |  Branch (139:3): [True: 0, False: 0]
  ------------------
  140|      0|			res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO;
  ------------------
  |  |   64|      0|#define ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO 2
  ------------------
  141|      0|			break;
  142|      0|		}
  143|      0|		break;
  144|     33|	case ARCHIVE_FORMAT_MTREE:
  ------------------
  |  |  379|     33|#define	ARCHIVE_FORMAT_MTREE			0x80000
  ------------------
  |  Branch (144:2): [True: 33, False: 0]
  ------------------
  145|     33|		res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_MTREE;
  ------------------
  |  |   63|     33|#define ARCHIVE_ENTRY_LINKIFY_LIKE_MTREE 1
  ------------------
  146|     33|		break;
  147|      0|	case ARCHIVE_FORMAT_ISO9660:
  ------------------
  |  |  372|      0|#define	ARCHIVE_FORMAT_ISO9660			0x40000
  ------------------
  |  Branch (147:2): [True: 0, False: 33]
  ------------------
  148|      0|	case ARCHIVE_FORMAT_SHAR:
  ------------------
  |  |  364|      0|#define	ARCHIVE_FORMAT_SHAR			0x20000
  ------------------
  |  Branch (148:2): [True: 0, False: 33]
  ------------------
  149|      0|	case ARCHIVE_FORMAT_TAR:
  ------------------
  |  |  367|      0|#define	ARCHIVE_FORMAT_TAR			0x30000
  ------------------
  |  Branch (149:2): [True: 0, False: 33]
  ------------------
  150|      0|	case ARCHIVE_FORMAT_XAR:
  ------------------
  |  |  381|      0|#define	ARCHIVE_FORMAT_XAR			0xA0000
  ------------------
  |  Branch (150:2): [True: 0, False: 33]
  ------------------
  151|      0|		res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_TAR;
  ------------------
  |  |   62|      0|#define ARCHIVE_ENTRY_LINKIFY_LIKE_TAR	0
  ------------------
  152|      0|		break;
  153|      0|	default:
  ------------------
  |  Branch (153:2): [True: 0, False: 33]
  ------------------
  154|      0|		res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO;
  ------------------
  |  |   64|      0|#define ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO 2
  ------------------
  155|      0|		break;
  156|     33|	}
  157|     33|}
archive_entry_linkresolver_free:
  161|  2.49k|{
  162|  2.49k|	if (res == NULL)
  ------------------
  |  Branch (162:6): [True: 2.46k, False: 33]
  ------------------
  163|  2.46k|		return;
  164|       |
  165|     33|	while (next_entry(res, NEXT_ENTRY_ALL) != NULL) {
  ------------------
  |  |   89|     33|#define	NEXT_ENTRY_ALL		(NEXT_ENTRY_DEFERRED | NEXT_ENTRY_PARTIAL)
  |  |  ------------------
  |  |  |  |   87|     33|#define	NEXT_ENTRY_DEFERRED	1
  |  |  ------------------
  |  |               #define	NEXT_ENTRY_ALL		(NEXT_ENTRY_DEFERRED | NEXT_ENTRY_PARTIAL)
  |  |  ------------------
  |  |  |  |   88|     33|#define	NEXT_ENTRY_PARTIAL	2
  |  |  ------------------
  ------------------
  |  Branch (165:9): [True: 0, False: 33]
  ------------------
  166|       |		/* Actual freeing done by next_entry() */
  167|      0|	}
  168|     33|	free(res->buckets);
  169|     33|	free(res);
  170|     33|}
archive_entry_link_resolver.c:next_entry:
  332|     33|{
  333|     33|	struct links_entry	*le;
  334|     33|	size_t			 bucket;
  335|       |
  336|       |	/* Free a held entry. */
  337|     33|	if (res->spare != NULL) {
  ------------------
  |  Branch (337:6): [True: 0, False: 33]
  ------------------
  338|      0|		archive_entry_free(res->spare->canonical);
  339|      0|		archive_entry_free(res->spare->entry);
  340|      0|		free(res->spare);
  341|      0|		res->spare = NULL;
  342|      0|	}
  343|       |
  344|       |	/* Look for next non-empty bucket in the links cache. */
  345|  33.8k|	for (bucket = 0; bucket < res->number_buckets; bucket++) {
  ------------------
  |  Branch (345:19): [True: 33.7k, False: 33]
  ------------------
  346|  33.7k|		for (le = res->buckets[bucket]; le != NULL; le = le->next) {
  ------------------
  |  Branch (346:35): [True: 0, False: 33.7k]
  ------------------
  347|      0|			if (le->entry != NULL &&
  ------------------
  |  Branch (347:8): [True: 0, False: 0]
  ------------------
  348|      0|			    (mode & NEXT_ENTRY_DEFERRED) == 0)
  ------------------
  |  |   87|      0|#define	NEXT_ENTRY_DEFERRED	1
  ------------------
  |  Branch (348:8): [True: 0, False: 0]
  ------------------
  349|      0|				continue;
  350|      0|			if (le->entry == NULL &&
  ------------------
  |  Branch (350:8): [True: 0, False: 0]
  ------------------
  351|      0|			    (mode & NEXT_ENTRY_PARTIAL) == 0)
  ------------------
  |  |   88|      0|#define	NEXT_ENTRY_PARTIAL	2
  ------------------
  |  Branch (351:8): [True: 0, False: 0]
  ------------------
  352|      0|				continue;
  353|       |			/* Remove it from this hash bucket. */
  354|      0|			if (le->next != NULL)
  ------------------
  |  Branch (354:8): [True: 0, False: 0]
  ------------------
  355|      0|				le->next->previous = le->previous;
  356|      0|			if (le->previous != NULL)
  ------------------
  |  Branch (356:8): [True: 0, False: 0]
  ------------------
  357|      0|				le->previous->next = le->next;
  358|      0|			else
  359|      0|				res->buckets[bucket] = le->next;
  360|      0|			res->number_entries--;
  361|       |			/* Defer freeing this entry. */
  362|      0|			res->spare = le;
  363|      0|			return (le);
  364|      0|		}
  365|  33.7k|	}
  366|     33|	return (NULL);
  367|     33|}

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

archive_entry_xattr_clear:
   73|   310k|{
   74|   310k|	struct ae_xattr	*xp;
   75|       |
   76|   310k|	while (entry->xattr_head != NULL) {
  ------------------
  |  Branch (76:9): [True: 36, False: 310k]
  ------------------
   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|   310k|	entry->xattr_head = NULL;
   85|       |	entry->xattr_p = NULL;
   86|   310k|}
archive_entry_xattr_add_entry:
   91|     36|{
   92|     36|	struct ae_xattr	*xp;
   93|       |
   94|     36|	if ((xp = malloc(sizeof(struct ae_xattr))) == NULL)
  ------------------
  |  Branch (94:6): [True: 0, False: 36]
  ------------------
   95|      0|		__archive_errx(1, "Out of memory");
   96|       |
   97|     36|	if ((xp->name = strdup(name)) == NULL)
  ------------------
  |  Branch (97:6): [True: 0, False: 36]
  ------------------
   98|      0|		__archive_errx(1, "Out of memory");
   99|       |
  100|     36|	if ((xp->value = malloc(size)) == NULL)
  ------------------
  |  Branch (100:6): [True: 0, False: 36]
  ------------------
  101|      0|		__archive_errx(1, "Out of memory");
  102|       |
  103|     36|	memcpy(xp->value, value, size);
  104|     36|	xp->size = size;
  105|       |
  106|     36|	xp->next = entry->xattr_head;
  107|     36|	entry->xattr_head = xp;
  108|     36|}

archive_hmac.c:__hmac_sha1_init:
  238|  2.36k|{
  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.36k|	*ctx = HMAC_CTX_new();
  257|  2.36k|	if (*ctx == NULL)
  ------------------
  |  Branch (257:6): [True: 0, False: 2.36k]
  ------------------
  258|      0|		return -1;
  259|  2.36k|	HMAC_Init_ex(*ctx, key, key_len, EVP_sha1(), NULL);
  260|  2.36k|#endif
  261|  2.36k|	return 0;
  262|  2.36k|}
archive_hmac.c:__hmac_sha1_update:
  267|  2.29k|{
  268|       |#if OPENSSL_VERSION_NUMBER >= 0x30000000L
  269|       |	EVP_MAC_update(*ctx, data, data_len);
  270|       |#else
  271|  2.29k|	HMAC_Update(*ctx, data, data_len);
  272|  2.29k|#endif
  273|  2.29k|}
archive_hmac.c:__hmac_sha1_final:
  277|  2.24k|{
  278|       |#if OPENSSL_VERSION_NUMBER >= 0x30000000L
  279|       |	size_t len = *out_len;
  280|       |#else
  281|  2.24k|	unsigned int len = (unsigned int)*out_len;
  282|  2.24k|#endif
  283|       |
  284|       |#if OPENSSL_VERSION_NUMBER >= 0x30000000L
  285|       |	EVP_MAC_final(*ctx, out, &len, *out_len);
  286|       |#else
  287|  2.24k|	HMAC_Final(*ctx, out, &len);
  288|  2.24k|#endif
  289|  2.24k|	*out_len = len;
  290|  2.24k|}
archive_hmac.c:__hmac_sha1_cleanup:
  294|  2.36k|{
  295|       |#if OPENSSL_VERSION_NUMBER >= 0x30000000L
  296|       |	EVP_MAC_CTX_free(*ctx);
  297|       |#else
  298|  2.36k|	HMAC_CTX_free(*ctx);
  299|  2.36k|#endif
  300|       |	*ctx = NULL;
  301|  2.36k|}

archive_read.c:archive_ckd_mul_size:
  187|    222|{
  188|    222|#if USE_STDCKDINT
  189|    222|	return ckd_mul(result, a, b);
  190|       |#elif USE_BUILTIN
  191|       |	return __builtin_mul_overflow(a, b, result);
  192|       |#elif USE_INTSAFE
  193|       |	return SizeTMult(a, b, result);
  194|       |#else
  195|       |	if (b != 0 && a > SIZE_MAX / b)
  196|       |		return 1;
  197|       |	*result = a * b;
  198|       |	return 0;
  199|       |#endif
  200|    222|}
archive_read_support_format_ar.c:archive_ckd_mul_u64:
  205|  3.76k|{
  206|  3.76k|#if USE_STDCKDINT
  207|  3.76k|	return ckd_mul(result, a, b);
  208|       |#elif USE_BUILTIN
  209|       |	return __builtin_mul_overflow(a, b, result);
  210|       |#elif USE_INTSAFE
  211|       |	ULONGLONG res;
  212|       |	int ret;
  213|       |
  214|       |	ret = ULongLongMult(a, b, &res);
  215|       |	*result = (uint64_t)res;
  216|       |	return ret;
  217|       |#else
  218|       |	if (b != 0 && a > UINT64_MAX / b)
  219|       |		return 1;
  220|       |	*result = a * b;
  221|       |	return 0;
  222|       |#endif
  223|  3.76k|}
archive_read_support_format_ar.c:archive_ckd_add_u64:
  137|  3.76k|{
  138|  3.76k|#if USE_STDCKDINT
  139|  3.76k|	return ckd_add(result, a, b);
  140|       |#elif USE_BUILTIN
  141|       |	return __builtin_add_overflow(a, b, result);
  142|       |#elif USE_INTSAFE
  143|       |	ULONGLONG res;
  144|       |	int ret;
  145|       |
  146|       |	ret = ULongLongAdd(a, b, &res);
  147|       |	*result = (uint64_t)res;
  148|       |	return ret;
  149|       |#else
  150|       |	if (a > UINT64_MAX - b)
  151|       |		return 1;
  152|       |	*result = a + b;
  153|       |	return 0;
  154|       |#endif
  155|  3.76k|}
archive_read_support_format_mtree.c:archive_ckd_mul_i64:
  160|  26.2k|{
  161|  26.2k|#if USE_STDCKDINT
  162|  26.2k|	return ckd_mul(result, a, b);
  163|       |#elif USE_BUILTIN
  164|       |	return __builtin_mul_overflow(a, b, result);
  165|       |#elif USE_INTSAFE
  166|       |	LONGLONG res;
  167|       |	int ret;
  168|       |
  169|       |	ret = LongLongMult(a, b, &res);
  170|       |	*result = (int64_t)res;
  171|       |	return ret;
  172|       |#else
  173|       |	if ((a > 0 && b > 0 && a > INT64_MAX / b) ||
  174|       |	    (a < 0 && b > 0 && a < INT64_MIN / b) ||
  175|       |	    (a > 0 && b < 0 && b < INT64_MIN / a) ||
  176|       |	    (a < 0 && b < 0 && a < INT64_MAX / b))
  177|       |		return 1;
  178|       |
  179|       |	*result = a * b;
  180|       |	return 0;
  181|       |#endif
  182|  26.2k|}
archive_read_support_format_mtree.c:archive_ckd_sub_i64:
  228|  25.4k|{
  229|  25.4k|#if USE_STDCKDINT
  230|  25.4k|	return ckd_sub(result, a, b);
  231|       |#elif USE_BUILTIN
  232|       |	return __builtin_sub_overflow(a, b, result);
  233|       |#elif USE_INTSAFE
  234|       |	LONGLONG res;
  235|       |	int ret;
  236|       |
  237|       |	ret = LongLongSub(a, b, &res);
  238|       |	*result = (int64_t)res;
  239|       |	return ret;
  240|       |#else
  241|       |	if ((b > 0 && a < INT64_MIN + b) ||
  242|       |	    (b < 0 && a > INT64_MAX + b))
  243|       |		return 1;
  244|       |
  245|       |	*result = a - b;
  246|       |	return 0;
  247|       |#endif
  248|  25.4k|}
archive_read_support_format_mtree.c:archive_ckd_add_i64:
   94|    843|{
   95|    843|#if USE_STDCKDINT
   96|    843|	return ckd_add(result, a, b);
   97|       |#elif USE_BUILTIN
   98|       |	return __builtin_add_overflow(a, b, result);
   99|       |#elif USE_INTSAFE
  100|       |	LONGLONG res;
  101|       |	int ret;
  102|       |
  103|       |	ret = LongLongAdd(a, b, &res);
  104|       |	*result = (int64_t)res;
  105|       |	return ret;
  106|       |#else
  107|       |	if ((b > 0 && a > INT64_MAX - b) ||
  108|       |	    (b < 0 && a < INT64_MIN - b))
  109|       |		return 1;
  110|       |
  111|       |	*result = a + b;
  112|       |	return 0;
  113|       |#endif
  114|    843|}
archive_read_support_format_rar.c:archive_ckd_mul_size:
  187|  5.65k|{
  188|  5.65k|#if USE_STDCKDINT
  189|  5.65k|	return ckd_mul(result, a, b);
  190|       |#elif USE_BUILTIN
  191|       |	return __builtin_mul_overflow(a, b, result);
  192|       |#elif USE_INTSAFE
  193|       |	return SizeTMult(a, b, result);
  194|       |#else
  195|       |	if (b != 0 && a > SIZE_MAX / b)
  196|       |		return 1;
  197|       |	*result = a * b;
  198|       |	return 0;
  199|       |#endif
  200|  5.65k|}
archive_read_support_format_raw.c:archive_ckd_add_i64:
   94|    569|{
   95|    569|#if USE_STDCKDINT
   96|    569|	return ckd_add(result, a, b);
   97|       |#elif USE_BUILTIN
   98|       |	return __builtin_add_overflow(a, b, result);
   99|       |#elif USE_INTSAFE
  100|       |	LONGLONG res;
  101|       |	int ret;
  102|       |
  103|       |	ret = LongLongAdd(a, b, &res);
  104|       |	*result = (int64_t)res;
  105|       |	return ret;
  106|       |#else
  107|       |	if ((b > 0 && a > INT64_MAX - b) ||
  108|       |	    (b < 0 && a < INT64_MIN - b))
  109|       |		return 1;
  110|       |
  111|       |	*result = a + b;
  112|       |	return 0;
  113|       |#endif
  114|    569|}
archive_read_support_format_tar.c:archive_ckd_mul_i64:
  160|   348k|{
  161|   348k|#if USE_STDCKDINT
  162|   348k|	return ckd_mul(result, a, b);
  163|       |#elif USE_BUILTIN
  164|       |	return __builtin_mul_overflow(a, b, result);
  165|       |#elif USE_INTSAFE
  166|       |	LONGLONG res;
  167|       |	int ret;
  168|       |
  169|       |	ret = LongLongMult(a, b, &res);
  170|       |	*result = (int64_t)res;
  171|       |	return ret;
  172|       |#else
  173|       |	if ((a > 0 && b > 0 && a > INT64_MAX / b) ||
  174|       |	    (a < 0 && b > 0 && a < INT64_MIN / b) ||
  175|       |	    (a > 0 && b < 0 && b < INT64_MIN / a) ||
  176|       |	    (a < 0 && b < 0 && a < INT64_MAX / b))
  177|       |		return 1;
  178|       |
  179|       |	*result = a * b;
  180|       |	return 0;
  181|       |#endif
  182|   348k|}
archive_read_support_format_tar.c:archive_ckd_add_i64:
   94|   348k|{
   95|   348k|#if USE_STDCKDINT
   96|   348k|	return ckd_add(result, a, b);
   97|       |#elif USE_BUILTIN
   98|       |	return __builtin_add_overflow(a, b, result);
   99|       |#elif USE_INTSAFE
  100|       |	LONGLONG res;
  101|       |	int ret;
  102|       |
  103|       |	ret = LongLongAdd(a, b, &res);
  104|       |	*result = (int64_t)res;
  105|       |	return ret;
  106|       |#else
  107|       |	if ((b > 0 && a > INT64_MAX - b) ||
  108|       |	    (b < 0 && a < INT64_MIN - b))
  109|       |		return 1;
  110|       |
  111|       |	*result = a + b;
  112|       |	return 0;
  113|       |#endif
  114|   348k|}
archive_read_support_format_warc.c:archive_ckd_mul_i64:
  160|  27.7k|{
  161|  27.7k|#if USE_STDCKDINT
  162|  27.7k|	return ckd_mul(result, a, b);
  163|       |#elif USE_BUILTIN
  164|       |	return __builtin_mul_overflow(a, b, result);
  165|       |#elif USE_INTSAFE
  166|       |	LONGLONG res;
  167|       |	int ret;
  168|       |
  169|       |	ret = LongLongMult(a, b, &res);
  170|       |	*result = (int64_t)res;
  171|       |	return ret;
  172|       |#else
  173|       |	if ((a > 0 && b > 0 && a > INT64_MAX / b) ||
  174|       |	    (a < 0 && b > 0 && a < INT64_MIN / b) ||
  175|       |	    (a > 0 && b < 0 && b < INT64_MIN / a) ||
  176|       |	    (a < 0 && b < 0 && a < INT64_MAX / b))
  177|       |		return 1;
  178|       |
  179|       |	*result = a * b;
  180|       |	return 0;
  181|       |#endif
  182|  27.7k|}
archive_read_support_format_warc.c:archive_ckd_add_i64:
   94|  27.7k|{
   95|  27.7k|#if USE_STDCKDINT
   96|  27.7k|	return ckd_add(result, a, b);
   97|       |#elif USE_BUILTIN
   98|       |	return __builtin_add_overflow(a, b, result);
   99|       |#elif USE_INTSAFE
  100|       |	LONGLONG res;
  101|       |	int ret;
  102|       |
  103|       |	ret = LongLongAdd(a, b, &res);
  104|       |	*result = (int64_t)res;
  105|       |	return ret;
  106|       |#else
  107|       |	if ((b > 0 && a > INT64_MAX - b) ||
  108|       |	    (b < 0 && a < INT64_MIN - b))
  109|       |		return 1;
  110|       |
  111|       |	*result = a + b;
  112|       |	return 0;
  113|       |#endif
  114|  27.7k|}
archive_read_support_format_xar.c:archive_ckd_mul_size:
  187|     11|{
  188|     11|#if USE_STDCKDINT
  189|     11|	return ckd_mul(result, a, b);
  190|       |#elif USE_BUILTIN
  191|       |	return __builtin_mul_overflow(a, b, result);
  192|       |#elif USE_INTSAFE
  193|       |	return SizeTMult(a, b, result);
  194|       |#else
  195|       |	if (b != 0 && a > SIZE_MAX / b)
  196|       |		return 1;
  197|       |	*result = a * b;
  198|       |	return 0;
  199|       |#endif
  200|     11|}
archive_read_support_format_xar.c:archive_ckd_mul_u64:
  205|  29.6k|{
  206|  29.6k|#if USE_STDCKDINT
  207|  29.6k|	return ckd_mul(result, a, b);
  208|       |#elif USE_BUILTIN
  209|       |	return __builtin_mul_overflow(a, b, result);
  210|       |#elif USE_INTSAFE
  211|       |	ULONGLONG res;
  212|       |	int ret;
  213|       |
  214|       |	ret = ULongLongMult(a, b, &res);
  215|       |	*result = (uint64_t)res;
  216|       |	return ret;
  217|       |#else
  218|       |	if (b != 0 && a > UINT64_MAX / b)
  219|       |		return 1;
  220|       |	*result = a * b;
  221|       |	return 0;
  222|       |#endif
  223|  29.6k|}
archive_read_support_format_xar.c:archive_ckd_add_u64:
  137|  29.6k|{
  138|  29.6k|#if USE_STDCKDINT
  139|  29.6k|	return ckd_add(result, a, b);
  140|       |#elif USE_BUILTIN
  141|       |	return __builtin_add_overflow(a, b, result);
  142|       |#elif USE_INTSAFE
  143|       |	ULONGLONG res;
  144|       |	int ret;
  145|       |
  146|       |	ret = ULongLongAdd(a, b, &res);
  147|       |	*result = (uint64_t)res;
  148|       |	return ret;
  149|       |#else
  150|       |	if (a > UINT64_MAX - b)
  151|       |		return 1;
  152|       |	*result = a + b;
  153|       |	return 0;
  154|       |#endif
  155|  29.6k|}
archive_read_support_format_7zip.c:archive_ckd_add_i64:
   94|  12.9k|{
   95|  12.9k|#if USE_STDCKDINT
   96|  12.9k|	return ckd_add(result, a, b);
   97|       |#elif USE_BUILTIN
   98|       |	return __builtin_add_overflow(a, b, result);
   99|       |#elif USE_INTSAFE
  100|       |	LONGLONG res;
  101|       |	int ret;
  102|       |
  103|       |	ret = LongLongAdd(a, b, &res);
  104|       |	*result = (int64_t)res;
  105|       |	return ret;
  106|       |#else
  107|       |	if ((b > 0 && a > INT64_MAX - b) ||
  108|       |	    (b < 0 && a < INT64_MIN - b))
  109|       |		return 1;
  110|       |
  111|       |	*result = a + b;
  112|       |	return 0;
  113|       |#endif
  114|  12.9k|}
archive_read_support_format_7zip.c:archive_ckd_add_size:
  119|    269|{
  120|    269|#if USE_STDCKDINT
  121|    269|	return ckd_add(result, a, b);
  122|       |#elif USE_BUILTIN
  123|       |	return __builtin_add_overflow(a, b, result);
  124|       |#elif USE_INTSAFE
  125|       |	return SizeTAdd(a, b, result);
  126|       |#else
  127|       |	if (a > SIZE_MAX - b)
  128|       |		return 1;
  129|       |	*result = a + b;
  130|       |	return 0;
  131|       |#endif
  132|    269|}
archive_read_support_format_7zip.c:archive_ckd_mul_i64:
  160|    227|{
  161|    227|#if USE_STDCKDINT
  162|    227|	return ckd_mul(result, a, b);
  163|       |#elif USE_BUILTIN
  164|       |	return __builtin_mul_overflow(a, b, result);
  165|       |#elif USE_INTSAFE
  166|       |	LONGLONG res;
  167|       |	int ret;
  168|       |
  169|       |	ret = LongLongMult(a, b, &res);
  170|       |	*result = (int64_t)res;
  171|       |	return ret;
  172|       |#else
  173|       |	if ((a > 0 && b > 0 && a > INT64_MAX / b) ||
  174|       |	    (a < 0 && b > 0 && a < INT64_MIN / b) ||
  175|       |	    (a > 0 && b < 0 && b < INT64_MIN / a) ||
  176|       |	    (a < 0 && b < 0 && a < INT64_MAX / b))
  177|       |		return 1;
  178|       |
  179|       |	*result = a * b;
  180|       |	return 0;
  181|       |#endif
  182|    227|}

_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, *s;
  106|  2.49k|	const char *mod, *opt, *val;
  107|       |
  108|  2.49k|	archive_check_magic(a, magic, ARCHIVE_STATE_NEW, fn);
  ------------------
  |  |  177|  2.49k|	do { \
  |  |  178|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  2.49k|			(allowed_states), (function_name)); \
  |  |  180|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  181|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182: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|	const char *mod, *val;
  174|  7.49k|	char *end, *opt, *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|     71|{
   89|     71|  unsigned i, k, m;
   90|       |
   91|     71|  p->Base = 0;
   92|       |
   93|  2.76k|  for (i = 0, k = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|  2.76k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|  2.76k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|  2.76k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|  2.76k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|  2.76k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|  2.76k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  2.76k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|  2.76k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (93:22): [True: 2.69k, False: 71]
  ------------------
   94|  2.69k|  {
   95|  2.69k|    unsigned step = (i >= 12 ? 4 : (i >> 2) + 1);
  ------------------
  |  Branch (95:22): [True: 1.84k, False: 852]
  ------------------
   96|  9.08k|    do { p->Units2Indx[k++] = (Byte)i; } while(--step);
  ------------------
  |  Branch (96:48): [True: 6.39k, False: 2.69k]
  ------------------
   97|  2.69k|    p->Indx2Units[i] = (Byte)k;
   98|  2.69k|  }
   99|       |
  100|     71|  p->NS2BSIndx[0] = (0 << 1);
  101|     71|  p->NS2BSIndx[1] = (1 << 1);
  102|     71|  memset(p->NS2BSIndx + 2, (2 << 1), 9);
  103|     71|  memset(p->NS2BSIndx + 11, (3 << 1), 256 - 11);
  104|       |
  105|    284|  for (i = 0; i < 3; i++)
  ------------------
  |  Branch (105:15): [True: 213, False: 71]
  ------------------
  106|    213|    p->NS2Indx[i] = (Byte)i;
  107|  18.0k|  for (m = i, k = 1; i < 256; i++)
  ------------------
  |  Branch (107:22): [True: 17.9k, False: 71]
  ------------------
  108|  17.9k|  {
  109|  17.9k|    p->NS2Indx[i] = (Byte)m;
  110|  17.9k|    if (--k == 0)
  ------------------
  |  Branch (110:9): [True: 1.56k, False: 16.4k]
  ------------------
  111|  1.56k|      k = (++m) - 2;
  112|  17.9k|  }
  113|       |
  114|     71|  memset(p->HB2Flag, 0, 0x40);
  115|     71|  memset(p->HB2Flag + 0x40, 8, 0x100 - 0x40);
  116|     71|}
archive_ppmd7.c:Ppmd7_Alloc:
  126|     71|{
  127|     71|  if (p->Base == 0 || p->Size != size)
  ------------------
  |  Branch (127:7): [True: 71, False: 0]
  |  Branch (127:23): [True: 0, False: 0]
  ------------------
  128|     71|  {
  129|       |    /* RestartModel() below assumes that p->Size >= UNIT_SIZE
  130|       |       (see the calculation of m->MinContext). */
  131|     71|    if (size < UNIT_SIZE) {
  ------------------
  |  |   30|     71|#define UNIT_SIZE 12
  ------------------
  |  Branch (131:9): [True: 0, False: 71]
  ------------------
  132|      0|      return False;
  ------------------
  |  |   56|      0|#define False 0
  ------------------
  133|      0|    }
  134|     71|    Ppmd7_Free(p);
  135|     71|    p->AlignOffset =
  136|       |      #ifdef PPMD_32BIT
  137|       |        (4 - size) & 3;
  138|       |      #else
  139|     71|        4 - (size & 3);
  140|     71|      #endif
  141|     71|    if ((p->Base = malloc(p->AlignOffset + size
  ------------------
  |  Branch (141:9): [True: 0, False: 71]
  ------------------
  142|     71|        #ifndef PPMD_32BIT
  143|     71|        + UNIT_SIZE
  ------------------
  |  |   30|     71|#define UNIT_SIZE 12
  ------------------
  144|     71|        #endif
  145|     71|        )) == 0)
  146|      0|      return False;
  ------------------
  |  |   56|      0|#define False 0
  ------------------
  147|     71|    p->Size = size;
  148|     71|  }
  149|     71|  return True;
  ------------------
  |  |   55|     71|#define True 1
  ------------------
  150|     71|}
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|     67|{
  373|     67|  p->MaxOrder = maxOrder;
  374|     67|  RestartModel(p);
  375|     67|  p->DummySee.Shift = PPMD_PERIOD_BITS;
  ------------------
  |  |   90|     67|#define PPMD_PERIOD_BITS 7
  ------------------
  376|     67|  p->DummySee.Summ = 0; /* unused */
  377|     67|  p->DummySee.Count = 64; /* unused */
  378|     67|}
archive_ppmd7.c:RestartModel:
  325|    222|{
  326|    222|  unsigned i, k, m;
  327|       |
  328|    222|  memset(p->FreeList, 0, sizeof(p->FreeList));
  329|    222|  p->Text = p->Base + p->AlignOffset;
  330|    222|  p->HiUnit = p->Text + p->Size;
  331|    222|  p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   30|    222|#define UNIT_SIZE 12
  ------------------
                p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   30|    222|#define UNIT_SIZE 12
  ------------------
  332|    222|  p->GlueCount = 0;
  333|       |
  334|    222|  p->OrderFall = p->MaxOrder;
  335|    222|  p->RunLength = p->InitRL = -(Int32)((p->MaxOrder < 12) ? p->MaxOrder : 12) - 1;
  ------------------
  |  Branch (335:39): [True: 70, False: 152]
  ------------------
  336|    222|  p->PrevSuccess = 0;
  337|       |
  338|    222|  p->MinContext = p->MaxContext = (CTX_PTR)(p->HiUnit -= UNIT_SIZE); /* AllocContext(p); */
  ------------------
  |  |   30|    222|#define UNIT_SIZE 12
  ------------------
  339|    222|  p->MinContext->Suffix = 0;
  340|    222|  p->MinContext->NumStats = 256;
  341|    222|  p->MinContext->SummFreq = 256 + 1;
  342|    222|  p->FoundState = (CPpmd_State *)p->LoUnit; /* AllocUnits(p, PPMD_NUM_INDEXES - 1); */
  343|    222|  p->LoUnit += U2B(256 / 2);
  ------------------
  |  |   32|    222|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   30|    222|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  344|    222|  p->MinContext->Stats = REF(p->FoundState);
  ------------------
  |  |   39|    222|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  345|  57.0k|  for (i = 0; i < 256; i++)
  ------------------
  |  Branch (345:15): [True: 56.8k, False: 222]
  ------------------
  346|  56.8k|  {
  347|  56.8k|    CPpmd_State *s = &p->FoundState[i];
  348|  56.8k|    s->Symbol = (Byte)i;
  349|  56.8k|    s->Freq = 1;
  350|  56.8k|    SetSuccessor(s, 0);
  351|  56.8k|  }
  352|       |
  353|  28.6k|  for (i = 0; i < 128; i++)
  ------------------
  |  Branch (353:15): [True: 28.4k, False: 222]
  ------------------
  354|   255k|    for (k = 0; k < 8; k++)
  ------------------
  |  Branch (354:17): [True: 227k, False: 28.4k]
  ------------------
  355|   227k|    {
  356|   227k|      UInt16 *dest = p->BinSumm[i] + k;
  357|   227k|      UInt16 val = (UInt16)(PPMD_BIN_SCALE - kInitBinEsc[k] / (i + 2));
  ------------------
  |  |   91|   227k|#define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   89|   227k|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   90|   227k|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  ------------------
  358|  2.04M|      for (m = 0; m < 64; m += 8)
  ------------------
  |  Branch (358:19): [True: 1.81M, False: 227k]
  ------------------
  359|  1.81M|        dest[m] = val;
  360|   227k|    }
  361|       |  
  362|  5.77k|  for (i = 0; i < 25; i++)
  ------------------
  |  Branch (362:15): [True: 5.55k, False: 222]
  ------------------
  363|  94.3k|    for (k = 0; k < 16; k++)
  ------------------
  |  Branch (363:17): [True: 88.8k, False: 5.55k]
  ------------------
  364|  88.8k|    {
  365|  88.8k|      CPpmd_See *s = &p->See[i][k];
  366|  88.8k|      s->Summ = (UInt16)((5 * i + 10) << (s->Shift = PPMD_PERIOD_BITS - 4));
  ------------------
  |  |   90|  88.8k|#define PPMD_PERIOD_BITS 7
  ------------------
  367|  88.8k|      s->Count = 4;
  368|  88.8k|    }
  369|    222|}
archive_ppmd7.c:SetSuccessor:
  319|   438k|{
  320|   438k|  (p)->SuccessorLow = (UInt16)((UInt32)(v) & 0xFFFF);
  321|   438k|  (p)->SuccessorHigh = (UInt16)(((UInt32)(v) >> 16) & 0xFFFF);
  322|   438k|}
archive_ppmd7.c:Ppmd7z_RangeDec_CreateVTable:
  852|     63|{
  853|     63|  p->p.GetThreshold = Range_GetThreshold;
  854|     63|  p->p.Decode = Range_Decode_7z;
  855|     63|  p->p.DecodeBit = Range_DecodeBit_7z;
  856|     63|}
archive_ppmd7.c:Range_GetThreshold:
  776|   208k|{
  777|   208k|  CPpmd7z_RangeDec *p = (CPpmd7z_RangeDec *)pp;
  778|   208k|  return (p->Code - p->Low) / (p->Range /= total);
  779|   208k|}
archive_ppmd7.c:Range_Decode_7z:
  799|   195k|{
  800|   195k|  CPpmd7z_RangeDec *p = (CPpmd7z_RangeDec *)pp;
  801|   195k|  p->Code -= start * p->Range;
  802|   195k|  p->Range *= size;
  803|   195k|  Range_Normalize(p);
  804|   195k|}
archive_ppmd7.c:Range_Normalize:
  782|   338k|{
  783|   423k|  while (1)
  ------------------
  |  Branch (783:10): [True: 423k, Folded]
  ------------------
  784|   423k|  {
  785|   423k|    if((p->Low ^ (p->Low + p->Range)) >= kTopValue)
  ------------------
  |  |   28|   423k|#define kTopValue (1 << 24)
  ------------------
  |  Branch (785:8): [True: 338k, False: 84.2k]
  ------------------
  786|   338k|    {
  787|   338k|      if(p->Range >= p->Bottom)
  ------------------
  |  Branch (787:10): [True: 338k, False: 0]
  ------------------
  788|   338k|        break;
  789|      0|      else
  790|      0|        p->Range = ((uint32_t)(-(int32_t)p->Low)) & (p->Bottom - 1);
  791|   338k|    }
  792|  84.2k|    p->Code = (p->Code << 8) | p->Stream->Read((void *)p->Stream);
  793|  84.2k|    p->Range <<= 8;
  794|  84.2k|    p->Low <<= 8;
  795|  84.2k|  }
  796|   338k|}
archive_ppmd7.c:Range_DecodeBit_7z:
  815|   129k|{
  816|   129k|  CPpmd7z_RangeDec *p = (CPpmd7z_RangeDec *)pp;
  817|   129k|  UInt32 newBound = (p->Range >> 14) * size0;
  818|   129k|  UInt32 symbol;
  819|   129k|  if (p->Code < newBound)
  ------------------
  |  Branch (819:7): [True: 99.1k, False: 30.8k]
  ------------------
  820|  99.1k|  {
  821|  99.1k|    symbol = 0;
  822|  99.1k|    p->Range = newBound;
  823|  99.1k|  }
  824|  30.8k|  else
  825|  30.8k|  {
  826|  30.8k|    symbol = 1;
  827|  30.8k|    p->Code -= newBound;
  828|  30.8k|    p->Range -= newBound;
  829|  30.8k|  }
  830|   129k|  Range_Normalize(p);
  831|   129k|  return symbol;
  832|   129k|}
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|     63|{
  762|     63|  if (p->Stream->Read((void *)p->Stream) != 0)
  ------------------
  |  Branch (762:7): [True: 0, False: 63]
  ------------------
  763|      0|    return False;
  ------------------
  |  |   56|      0|#define False 0
  ------------------
  764|     63|  return Ppmd_RangeDec_Init(p);
  765|     63|}
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|   245k|{
  869|   245k|  size_t charMask[256 / sizeof(size_t)];
  870|   245k|  if (p->MinContext->NumStats != 1)
  ------------------
  |  Branch (870:7): [True: 102k, False: 142k]
  ------------------
  871|   102k|  {
  872|   102k|    CPpmd_State *s = Ppmd7_GetStats(p, p->MinContext);
  ------------------
  |  |   18|   102k|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  ------------------
  |  |  |  |   16|   102k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
  873|   102k|    unsigned i;
  874|   102k|    UInt32 count, hiCnt;
  875|   102k|    if ((count = rc->GetThreshold(rc, p->MinContext->SummFreq)) < (hiCnt = s->Freq))
  ------------------
  |  Branch (875:9): [True: 31.9k, False: 70.8k]
  ------------------
  876|  31.9k|    {
  877|  31.9k|      Byte symbol;
  878|  31.9k|      rc->Decode(rc, 0, s->Freq);
  879|  31.9k|      p->FoundState = s;
  880|  31.9k|      symbol = s->Symbol;
  881|  31.9k|      Ppmd7_Update1_0(p);
  882|  31.9k|      return symbol;
  883|  31.9k|    }
  884|  70.8k|    p->PrevSuccess = 0;
  885|  70.8k|    i = p->MinContext->NumStats - 1;
  886|  70.8k|    do
  887|  1.54M|    {
  888|  1.54M|      if ((hiCnt += (++s)->Freq) > count)
  ------------------
  |  Branch (888:11): [True: 37.6k, False: 1.50M]
  ------------------
  889|  37.6k|      {
  890|  37.6k|        Byte symbol;
  891|  37.6k|        rc->Decode(rc, hiCnt - s->Freq, s->Freq);
  892|  37.6k|        p->FoundState = s;
  893|  37.6k|        symbol = s->Symbol;
  894|  37.6k|        Ppmd7_Update1(p);
  895|  37.6k|        return symbol;
  896|  37.6k|      }
  897|  1.54M|    }
  898|  1.50M|    while (--i);
  ------------------
  |  Branch (898:12): [True: 1.47M, False: 33.2k]
  ------------------
  899|  33.2k|    if (count >= p->MinContext->SummFreq)
  ------------------
  |  Branch (899:9): [True: 0, False: 33.2k]
  ------------------
  900|      0|      return -2;
  901|  33.2k|    p->HiBitsFlag = p->HB2Flag[p->FoundState->Symbol];
  902|  33.2k|    rc->Decode(rc, hiCnt, p->MinContext->SummFreq - hiCnt);
  903|  33.2k|    PPMD_SetAllBitsIn256Bytes(charMask);
  ------------------
  |  |  151|  33.2k|#define PPMD_SetAllBitsIn256Bytes(p) do {				\
  |  |  152|  33.2k|	unsigned j;							\
  |  |  153|   166k|	for (j = 0; j < 256 / sizeof(p[0]); j += 8) {			\
  |  |  ------------------
  |  |  |  Branch (153:14): [True: 132k, False: 33.2k]
  |  |  ------------------
  |  |  154|   132k|		p[j+7] = p[j+6] = p[j+5] = p[j+4] =			\
  |  |  155|   132k|		    p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0;	\
  |  |  156|   132k|	}								\
  |  |  157|  33.2k|} while (0)
  |  |  ------------------
  |  |  |  Branch (157:10): [Folded, False: 33.2k]
  |  |  ------------------
  ------------------
  904|  33.2k|    MASK(s->Symbol) = 0;
  ------------------
  |  |  865|  33.2k|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  905|  33.2k|    i = p->MinContext->NumStats - 1;
  906|   147k|    do { MASK((--s)->Symbol) = 0; } while (--i);
  ------------------
  |  |  865|   147k|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  |  Branch (906:44): [True: 114k, False: 33.2k]
  ------------------
  907|  33.2k|  }
  908|   142k|  else
  909|   142k|  {
  910|   142k|    UInt16 *prob = Ppmd7_GetBinSumm(p);
  ------------------
  |  |   22|   142k|    &p->BinSumm[Ppmd7Context_OneState(p->MinContext)->Freq - 1][p->PrevSuccess + \
  |  |  ------------------
  |  |  |  |   42|   142k|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  |  |   23|   142k|    p->NS2BSIndx[Ppmd7_GetContext(p, p->MinContext->Suffix)->NumStats - 1] + \
  |  |  ------------------
  |  |  |  |   17|   142k|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|   142k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   24|   142k|    (p->HiBitsFlag = p->HB2Flag[p->FoundState->Symbol]) + \
  |  |   25|   142k|    2 * p->HB2Flag[Ppmd7Context_OneState(p->MinContext)->Symbol] + \
  |  |  ------------------
  |  |  |  |   42|   142k|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  |  |   26|   142k|    ((p->RunLength >> 26) & 0x20)]
  ------------------
  911|   142k|    if (rc->DecodeBit(rc, *prob) == 0)
  ------------------
  |  Branch (911:9): [True: 111k, False: 30.8k]
  ------------------
  912|   111k|    {
  913|   111k|      Byte symbol;
  914|   111k|      *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob);
  ------------------
  |  |   95|   111k|#define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   89|   111k|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   94|   111k|#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|   111k|#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  915|   111k|      symbol = (p->FoundState = Ppmd7Context_OneState(p->MinContext))->Symbol;
  ------------------
  |  |   42|   111k|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  ------------------
  916|   111k|      Ppmd7_UpdateBin(p);
  917|   111k|      return symbol;
  918|   111k|    }
  919|  30.8k|    *prob = (UInt16)PPMD_UPDATE_PROB_1(*prob);
  ------------------
  |  |   96|  30.8k|#define PPMD_UPDATE_PROB_1(prob) ((prob) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   94|  30.8k|#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  30.8k|#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  920|  30.8k|    p->InitEsc = PPMD7_kExpEscape[*prob >> 10];
  921|  30.8k|    PPMD_SetAllBitsIn256Bytes(charMask);
  ------------------
  |  |  151|  30.8k|#define PPMD_SetAllBitsIn256Bytes(p) do {				\
  |  |  152|  30.8k|	unsigned j;							\
  |  |  153|   154k|	for (j = 0; j < 256 / sizeof(p[0]); j += 8) {			\
  |  |  ------------------
  |  |  |  Branch (153:14): [True: 123k, False: 30.8k]
  |  |  ------------------
  |  |  154|   123k|		p[j+7] = p[j+6] = p[j+5] = p[j+4] =			\
  |  |  155|   123k|		    p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0;	\
  |  |  156|   123k|	}								\
  |  |  157|  30.8k|} while (0)
  |  |  ------------------
  |  |  |  Branch (157:10): [Folded, False: 30.8k]
  |  |  ------------------
  ------------------
  922|  30.8k|    MASK(Ppmd7Context_OneState(p->MinContext)->Symbol) = 0;
  ------------------
  |  |  865|  30.8k|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  923|  30.8k|    p->PrevSuccess = 0;
  924|  30.8k|  }
  925|  64.1k|  for (;;)
  926|  93.2k|  {
  927|  93.2k|    CPpmd_State *ps[256], *s;
  928|  93.2k|    UInt32 freqSum, count, hiCnt;
  929|  93.2k|    CPpmd_See *see;
  930|  93.2k|    unsigned i, num, numMasked = p->MinContext->NumStats;
  931|  93.2k|    do
  932|   136k|    {
  933|   136k|      p->OrderFall++;
  934|   136k|      if (!p->MinContext->Suffix)
  ------------------
  |  Branch (934:11): [True: 22, False: 136k]
  ------------------
  935|     22|        return -1;
  936|   136k|      p->MinContext = Ppmd7_GetContext(p, p->MinContext->Suffix);
  ------------------
  |  |   17|   136k|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  ------------------
  |  |  |  |   16|   136k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
  937|   136k|    }
  938|   136k|    while (p->MinContext->NumStats == numMasked);
  ------------------
  |  Branch (938:12): [True: 43.1k, False: 93.2k]
  ------------------
  939|  93.2k|    hiCnt = 0;
  940|  93.2k|    s = Ppmd7_GetStats(p, p->MinContext);
  ------------------
  |  |   18|  93.2k|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  ------------------
  |  |  |  |   16|  93.2k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
  941|  93.2k|    i = 0;
  942|  93.2k|    num = p->MinContext->NumStats - numMasked;
  943|  93.2k|    do
  944|  9.22M|    {
  945|  9.22M|      int k = (int)(MASK(s->Symbol));
  ------------------
  |  |  865|  9.22M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  946|  9.22M|      hiCnt += (s->Freq & k);
  947|  9.22M|      ps[i] = s++;
  948|  9.22M|      i -= k;
  949|  9.22M|    }
  950|  9.22M|    while (i != num);
  ------------------
  |  Branch (950:12): [True: 9.12M, False: 93.2k]
  ------------------
  951|       |
  952|  93.2k|    see = Ppmd7_MakeEscFreq(p, numMasked, &freqSum);
  953|  93.2k|    freqSum += hiCnt;
  954|  93.2k|    count = rc->GetThreshold(rc, freqSum);
  955|       |
  956|  93.2k|    if (count < hiCnt)
  ------------------
  |  Branch (956:9): [True: 64.0k, False: 29.1k]
  ------------------
  957|  64.0k|    {
  958|  64.0k|      Byte symbol;
  959|  64.0k|      CPpmd_State **pps = ps;
  960|  3.00M|      for (hiCnt = 0; (hiCnt += (*pps)->Freq) <= count; pps++);
  ------------------
  |  Branch (960:23): [True: 2.94M, False: 64.0k]
  ------------------
  961|  64.0k|      s = *pps;
  962|  64.0k|      rc->Decode(rc, hiCnt - s->Freq, s->Freq);
  963|  64.0k|      Ppmd_See_Update(see);
  ------------------
  |  |  112|  64.0k|#define Ppmd_See_Update(p) do {						\
  |  |  113|  64.0k|	if ((p)->Shift < PPMD_PERIOD_BITS && --(p)->Count == 0) {	\
  |  |  ------------------
  |  |  |  |   90|   128k|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  |  |  |  Branch (113:6): [True: 25.6k, False: 38.4k]
  |  |  |  Branch (113:39): [True: 1.34k, False: 24.2k]
  |  |  ------------------
  |  |  114|  1.34k|		(p)->Summ <<= 1;					\
  |  |  115|  1.34k|		(p)->Count = (Byte)(3 << (p)->Shift++);			\
  |  |  116|  1.34k|    	}								\
  |  |  117|  64.0k|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 64.0k]
  |  |  ------------------
  ------------------
  964|  64.0k|      p->FoundState = s;
  965|  64.0k|      symbol = s->Symbol;
  966|  64.0k|      Ppmd7_Update2(p);
  967|  64.0k|      return symbol;
  968|  64.0k|    }
  969|  29.1k|    if (count >= freqSum)
  ------------------
  |  Branch (969:9): [True: 0, False: 29.1k]
  ------------------
  970|      0|      return -2;
  971|  29.1k|    rc->Decode(rc, hiCnt, freqSum - hiCnt);
  972|  29.1k|    see->Summ = (UInt16)(see->Summ + freqSum);
  973|   175k|    do { MASK(ps[--i]->Symbol) = 0; } while (i != 0);
  ------------------
  |  |  865|   175k|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  |  Branch (973:46): [True: 146k, False: 29.1k]
  ------------------
  974|  29.1k|  }
  975|  64.1k|}
archive_ppmd7.c:Ppmd7_Update1_0:
  722|  31.9k|{
  723|  31.9k|  p->PrevSuccess = (2 * p->FoundState->Freq > p->MinContext->SummFreq);
  724|  31.9k|  p->RunLength += p->PrevSuccess;
  725|  31.9k|  p->MinContext->SummFreq += 4;
  726|  31.9k|  if ((p->FoundState->Freq += 4) > MAX_FREQ)
  ------------------
  |  |   29|  31.9k|#define MAX_FREQ 124
  ------------------
  |  Branch (726:7): [True: 273, False: 31.7k]
  ------------------
  727|    273|    Rescale(p);
  728|  31.9k|  NextContext(p);
  729|  31.9k|}
archive_ppmd7.c:Rescale:
  609|    383|{
  610|    383|  unsigned i, adder, sumFreq, escFreq;
  611|    383|  CPpmd_State *stats = STATS(p->MinContext);
  ------------------
  |  |   45|    383|#define STATS(ctx) Ppmd7_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   18|    383|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|    383|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  612|    383|  CPpmd_State *s = p->FoundState;
  613|    383|  {
  614|    383|    CPpmd_State tmp = *s;
  615|  3.60k|    for (; s != stats; s--)
  ------------------
  |  Branch (615:12): [True: 3.21k, False: 383]
  ------------------
  616|  3.21k|      s[0] = s[-1];
  617|    383|    *s = tmp;
  618|    383|  }
  619|    383|  escFreq = p->MinContext->SummFreq - s->Freq;
  620|    383|  s->Freq += 4;
  621|    383|  adder = (p->OrderFall != 0);
  622|    383|  s->Freq = (Byte)((s->Freq + adder) >> 1);
  623|    383|  sumFreq = s->Freq;
  624|       |  
  625|    383|  i = p->MinContext->NumStats - 1;
  626|    383|  do
  627|  20.5k|  {
  628|  20.5k|    escFreq -= (++s)->Freq;
  629|  20.5k|    s->Freq = (Byte)((s->Freq + adder) >> 1);
  630|  20.5k|    sumFreq += s->Freq;
  631|  20.5k|    if (s[0].Freq > s[-1].Freq)
  ------------------
  |  Branch (631:9): [True: 7.77k, False: 12.7k]
  ------------------
  632|  7.77k|    {
  633|  7.77k|      CPpmd_State *s1 = s;
  634|  7.77k|      CPpmd_State tmp = *s1;
  635|  7.77k|      do
  636|   374k|        s1[0] = s1[-1];
  637|   374k|      while (--s1 != stats && tmp.Freq > s1[-1].Freq);
  ------------------
  |  Branch (637:14): [True: 374k, False: 0]
  |  Branch (637:31): [True: 367k, False: 7.77k]
  ------------------
  638|  7.77k|      *s1 = tmp;
  639|  7.77k|    }
  640|  20.5k|  }
  641|  20.5k|  while (--i);
  ------------------
  |  Branch (641:10): [True: 20.1k, False: 383]
  ------------------
  642|       |  
  643|    383|  if (s->Freq == 0)
  ------------------
  |  Branch (643:7): [True: 74, False: 309]
  ------------------
  644|     74|  {
  645|     74|    unsigned numStats = p->MinContext->NumStats;
  646|     74|    unsigned n0, n1;
  647|     93|    do { i++; } while ((--s)->Freq == 0);
  ------------------
  |  Branch (647:24): [True: 19, False: 74]
  ------------------
  648|     74|    escFreq += i;
  649|     74|    p->MinContext->NumStats = (UInt16)(p->MinContext->NumStats - i);
  650|     74|    if (p->MinContext->NumStats == 1)
  ------------------
  |  Branch (650:9): [True: 33, False: 41]
  ------------------
  651|     33|    {
  652|     33|      CPpmd_State tmp = *stats;
  653|     33|      do
  654|     50|      {
  655|     50|        tmp.Freq = (Byte)(tmp.Freq - (tmp.Freq >> 1));
  656|     50|        escFreq >>= 1;
  657|     50|      }
  658|     50|      while (escFreq > 1);
  ------------------
  |  Branch (658:14): [True: 17, False: 33]
  ------------------
  659|     33|      InsertNode(p, stats, U2I(((numStats + 1) >> 1)));
  ------------------
  |  |   33|     33|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  660|     33|      *(p->FoundState = ONE_STATE(p->MinContext)) = tmp;
  ------------------
  |  |   46|     33|#define ONE_STATE(ctx) Ppmd7Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   42|     33|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  661|     33|      return;
  662|     33|    }
  663|     41|    n0 = (numStats + 1) >> 1;
  664|     41|    n1 = (p->MinContext->NumStats + 1) >> 1;
  665|     41|    if (n0 != n1)
  ------------------
  |  Branch (665:9): [True: 27, False: 14]
  ------------------
  666|     27|      p->MinContext->Stats = STATS_REF(ShrinkUnits(p, stats, n0, n1));
  ------------------
  |  |   42|     27|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   39|     27|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
  667|     41|  }
  668|    350|  p->MinContext->SummFreq = (UInt16)(sumFreq + escFreq - (escFreq >> 1));
  669|    350|  p->FoundState = STATS(p->MinContext);
  ------------------
  |  |   45|    350|#define STATS(ctx) Ppmd7_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   18|    350|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|    350|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  670|    350|}
archive_ppmd7.c:InsertNode:
  153|  43.4k|{
  154|  43.4k|  *((CPpmd_Void_Ref *)node) = p->FreeList[indx];
  155|  43.4k|  p->FreeList[indx] = REF(node);
  ------------------
  |  |   39|  43.4k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  156|  43.4k|}
archive_ppmd7.c:ShrinkUnits:
  300|     27|{
  301|     27|  unsigned i0 = U2I(oldNU);
  ------------------
  |  |   33|     27|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  302|     27|  unsigned i1 = U2I(newNU);
  ------------------
  |  |   33|     27|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  303|     27|  if (i0 == i1)
  ------------------
  |  Branch (303:7): [True: 1, False: 26]
  ------------------
  304|      1|    return oldPtr;
  305|     26|  if (p->FreeList[i1] != 0)
  ------------------
  |  Branch (305:7): [True: 14, False: 12]
  ------------------
  306|     14|  {
  307|     14|    void *ptr = RemoveNode(p, i1);
  308|     14|    MyMem12Cpy(ptr, oldPtr, newNU);
  ------------------
  |  |  290|     14|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  291|     14|	UInt32 *d = (UInt32 *)dest;					\
  |  |  292|     14|	const UInt32 *s = (const UInt32 *)src;				\
  |  |  293|     14|	UInt32 n = num;							\
  |  |  294|     24|	do {								\
  |  |  295|     24|		d[0] = s[0]; d[1] = s[1]; d[2] = s[2]; s += 3; d += 3;	\
  |  |  296|     24|	} while(--n);							\
  |  |  ------------------
  |  |  |  Branch (296:10): [True: 10, False: 14]
  |  |  ------------------
  |  |  297|     14|} while (0)
  |  |  ------------------
  |  |  |  Branch (297:10): [Folded, False: 14]
  |  |  ------------------
  ------------------
  309|     14|    InsertNode(p, oldPtr, i0);
  310|     14|    return ptr;
  311|     14|  }
  312|     12|  SplitBlock(p, oldPtr, i0, i1);
  313|     12|  return oldPtr;
  314|     26|}
archive_ppmd7.c:RemoveNode:
  159|  42.7k|{
  160|  42.7k|  CPpmd_Void_Ref *node = (CPpmd_Void_Ref *)Ppmd7_GetPtr(p, p->FreeList[indx]);
  ------------------
  |  |   16|  42.7k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  161|  42.7k|  p->FreeList[indx] = *node;
  162|  42.7k|  return node;
  163|  42.7k|}
archive_ppmd7.c:SplitBlock:
  166|  1.87k|{
  167|  1.87k|  unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
  ------------------
  |  |   34|  1.87k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
                unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
  ------------------
  |  |   34|  1.87k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  168|  1.87k|  ptr = (Byte *)ptr + U2B(I2U(newIndx));
  ------------------
  |  |   32|  1.87k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   30|  1.87k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  169|  1.87k|  if (I2U(i = U2I(nu)) != nu)
  ------------------
  |  |   34|  1.87k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  |  Branch (169:7): [True: 349, False: 1.52k]
  ------------------
  170|    349|  {
  171|    349|    unsigned k = I2U(--i);
  ------------------
  |  |   34|    349|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  172|    349|    InsertNode(p, ((Byte *)ptr) + U2B(k), nu - k - 1);
  ------------------
  |  |   32|    349|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   30|    349|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  173|    349|  }
  174|  1.87k|  InsertNode(p, ptr, i);
  175|  1.87k|}
archive_ppmd7.c:NextContext:
  698|   181k|{
  699|   181k|  CTX_PTR c = CTX(SUCCESSOR(p->FoundState));
  ------------------
  |  |   44|   181k|#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   17|   181k|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|   181k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  700|   181k|  if (p->OrderFall == 0 && (Byte *)c > p->Text)
  ------------------
  |  Branch (700:7): [True: 96.7k, False: 84.7k]
  |  Branch (700:28): [True: 78.1k, False: 18.5k]
  ------------------
  701|  78.1k|    p->MinContext = p->MaxContext = c;
  702|   103k|  else
  703|   103k|    UpdateModel(p);
  704|   181k|}
archive_ppmd7.c:UpdateModel:
  460|   167k|{
  461|   167k|  CPpmd_Void_Ref successor, fSuccessor = SUCCESSOR(p->FoundState);
  ------------------
  |  |  316|   167k|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  462|   167k|  CTX_PTR c;
  463|   167k|  unsigned s0, ns;
  464|       |  
  465|   167k|  if (p->FoundState->Freq < MAX_FREQ / 4 && p->MinContext->Suffix != 0)
  ------------------
  |  |   29|   167k|#define MAX_FREQ 124
  ------------------
  |  Branch (465:7): [True: 143k, False: 24.0k]
  |  Branch (465:45): [True: 112k, False: 31.3k]
  ------------------
  466|   112k|  {
  467|   112k|    c = SUFFIX(p->MinContext);
  ------------------
  |  |   47|   112k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   44|   112k|#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   17|   112k|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   16|   112k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  468|       |    
  469|   112k|    if (c->NumStats == 1)
  ------------------
  |  Branch (469:9): [True: 35.1k, False: 76.9k]
  ------------------
  470|  35.1k|    {
  471|  35.1k|      CPpmd_State *s = ONE_STATE(c);
  ------------------
  |  |   46|  35.1k|#define ONE_STATE(ctx) Ppmd7Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   42|  35.1k|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  472|  35.1k|      if (s->Freq < 32)
  ------------------
  |  Branch (472:11): [True: 35.1k, False: 22]
  ------------------
  473|  35.1k|        s->Freq++;
  474|  35.1k|    }
  475|  76.9k|    else
  476|  76.9k|    {
  477|  76.9k|      CPpmd_State *s = STATS(c);
  ------------------
  |  |   45|  76.9k|#define STATS(ctx) Ppmd7_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   18|  76.9k|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  76.9k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  478|  76.9k|      if (s->Symbol != p->FoundState->Symbol)
  ------------------
  |  Branch (478:11): [True: 56.7k, False: 20.1k]
  ------------------
  479|  56.7k|      {
  480|  1.90M|        do { s++; } while (s->Symbol != p->FoundState->Symbol);
  ------------------
  |  Branch (480:28): [True: 1.84M, False: 56.7k]
  ------------------
  481|  56.7k|        if (s[0].Freq >= s[-1].Freq)
  ------------------
  |  Branch (481:13): [True: 30.6k, False: 26.0k]
  ------------------
  482|  30.6k|        {
  483|  30.6k|          SwapStates(&s[0], &s[-1]);
  484|  30.6k|          s--;
  485|  30.6k|        }
  486|  56.7k|      }
  487|  76.9k|      if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   29|  76.9k|#define MAX_FREQ 124
  ------------------
  |  Branch (487:11): [True: 75.6k, False: 1.23k]
  ------------------
  488|  75.6k|      {
  489|  75.6k|        s->Freq += 2;
  490|  75.6k|        c->SummFreq += 2;
  491|  75.6k|      }
  492|  76.9k|    }
  493|   112k|  }
  494|       |
  495|   167k|  if (p->OrderFall == 0)
  ------------------
  |  Branch (495:7): [True: 18.5k, False: 148k]
  ------------------
  496|  18.5k|  {
  497|  18.5k|    p->MinContext = p->MaxContext = CreateSuccessors(p, True);
  ------------------
  |  |   55|  18.5k|#define True 1
  ------------------
  498|  18.5k|    if (p->MinContext == 0)
  ------------------
  |  Branch (498:9): [True: 9, False: 18.5k]
  ------------------
  499|      9|    {
  500|      9|      RestartModel(p);
  501|      9|      return;
  502|      9|    }
  503|  18.5k|    SetSuccessor(p->FoundState, REF(p->MinContext));
  ------------------
  |  |   39|  18.5k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  504|  18.5k|    return;
  505|  18.5k|  }
  506|       |  
  507|   148k|  *p->Text++ = p->FoundState->Symbol;
  508|   148k|  successor = REF(p->Text);
  ------------------
  |  |   39|   148k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  509|   148k|  if (p->Text >= p->UnitsStart)
  ------------------
  |  Branch (509:7): [True: 10, False: 148k]
  ------------------
  510|     10|  {
  511|     10|    RestartModel(p);
  512|     10|    return;
  513|     10|  }
  514|       |  
  515|   148k|  if (fSuccessor)
  ------------------
  |  Branch (515:7): [True: 137k, False: 11.2k]
  ------------------
  516|   137k|  {
  517|   137k|    if (fSuccessor <= successor)
  ------------------
  |  Branch (517:9): [True: 45.6k, False: 91.9k]
  ------------------
  518|  45.6k|    {
  519|  45.6k|      CTX_PTR cs = CreateSuccessors(p, False);
  ------------------
  |  |   56|  45.6k|#define False 0
  ------------------
  520|  45.6k|      if (cs == NULL)
  ------------------
  |  Branch (520:11): [True: 72, False: 45.5k]
  ------------------
  521|     72|      {
  522|     72|        RestartModel(p);
  523|     72|        return;
  524|     72|      }
  525|  45.5k|      fSuccessor = REF(cs);
  ------------------
  |  |   39|  45.5k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  526|  45.5k|    }
  527|   137k|    if (--p->OrderFall == 0)
  ------------------
  |  Branch (527:9): [True: 16.6k, False: 120k]
  ------------------
  528|  16.6k|    {
  529|  16.6k|      successor = fSuccessor;
  530|  16.6k|      p->Text -= (p->MaxContext != p->MinContext);
  531|  16.6k|    }
  532|   137k|  }
  533|  11.2k|  else
  534|  11.2k|  {
  535|  11.2k|    SetSuccessor(p->FoundState, successor);
  536|  11.2k|    fSuccessor = REF(p->MinContext);
  ------------------
  |  |   39|  11.2k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  537|  11.2k|  }
  538|       |  
  539|   148k|  s0 = p->MinContext->SummFreq - (ns = p->MinContext->NumStats) - (p->FoundState->Freq - 1);
  540|       |  
  541|   284k|  for (c = p->MaxContext; c != p->MinContext; c = SUFFIX(c))
  ------------------
  |  |   47|   136k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   44|   136k|#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   17|   136k|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   16|   136k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (541:27): [True: 136k, False: 148k]
  ------------------
  542|   136k|  {
  543|   136k|    unsigned ns1;
  544|   136k|    UInt32 cf, sf;
  545|   136k|    if ((ns1 = c->NumStats) != 1)
  ------------------
  |  Branch (545:9): [True: 76.7k, False: 59.5k]
  ------------------
  546|  76.7k|    {
  547|  76.7k|      if ((ns1 & 1) == 0)
  ------------------
  |  Branch (547:11): [True: 45.5k, False: 31.1k]
  ------------------
  548|  45.5k|      {
  549|       |        /* Expand for one UNIT */
  550|  45.5k|        unsigned oldNU = ns1 >> 1;
  551|  45.5k|        unsigned i = U2I(oldNU);
  ------------------
  |  |   33|  45.5k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  552|  45.5k|        if (i != U2I(oldNU + 1))
  ------------------
  |  |   33|  45.5k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  |  Branch (552:13): [True: 41.0k, False: 4.50k]
  ------------------
  553|  41.0k|        {
  554|  41.0k|          void *ptr = AllocUnits(p, i + 1);
  555|  41.0k|          void *oldPtr;
  556|  41.0k|          if (!ptr)
  ------------------
  |  Branch (556:15): [True: 23, False: 41.0k]
  ------------------
  557|     23|          {
  558|     23|            RestartModel(p);
  559|     23|            return;
  560|     23|          }
  561|  41.0k|          oldPtr = STATS(c);
  ------------------
  |  |   45|  41.0k|#define STATS(ctx) Ppmd7_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   18|  41.0k|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  41.0k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  562|  41.0k|          MyMem12Cpy(ptr, oldPtr, oldNU);
  ------------------
  |  |  290|  41.0k|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  291|  41.0k|	UInt32 *d = (UInt32 *)dest;					\
  |  |  292|  41.0k|	const UInt32 *s = (const UInt32 *)src;				\
  |  |  293|  41.0k|	UInt32 n = num;							\
  |  |  294|  90.2k|	do {								\
  |  |  295|  90.2k|		d[0] = s[0]; d[1] = s[1]; d[2] = s[2]; s += 3; d += 3;	\
  |  |  296|  90.2k|	} while(--n);							\
  |  |  ------------------
  |  |  |  Branch (296:10): [True: 49.1k, False: 41.0k]
  |  |  ------------------
  |  |  297|  41.0k|} while (0)
  |  |  ------------------
  |  |  |  Branch (297:10): [Folded, False: 41.0k]
  |  |  ------------------
  ------------------
  563|  41.0k|          InsertNode(p, oldPtr, i);
  564|  41.0k|          c->Stats = STATS_REF(ptr);
  ------------------
  |  |   42|  41.0k|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   39|  41.0k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
  565|  41.0k|        }
  566|  45.5k|      }
  567|  76.7k|      c->SummFreq = (UInt16)(c->SummFreq + (2 * ns1 < ns) + 2 * ((4 * ns1 <= ns) & (c->SummFreq <= 8 * ns1)));
  568|  76.7k|    }
  569|  59.5k|    else
  570|  59.5k|    {
  571|  59.5k|      CPpmd_State *s = (CPpmd_State*)AllocUnits(p, 0);
  572|  59.5k|      if (!s)
  ------------------
  |  Branch (572:11): [True: 41, False: 59.4k]
  ------------------
  573|     41|      {
  574|     41|        RestartModel(p);
  575|     41|        return;
  576|     41|      }
  577|  59.4k|      *s = *ONE_STATE(c);
  ------------------
  |  |   46|  59.4k|#define ONE_STATE(ctx) Ppmd7Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   42|  59.4k|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  578|  59.4k|      c->Stats = REF(s);
  ------------------
  |  |   39|  59.4k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  579|  59.4k|      if (s->Freq < MAX_FREQ / 4 - 1)
  ------------------
  |  |   29|  59.4k|#define MAX_FREQ 124
  ------------------
  |  Branch (579:11): [True: 59.3k, False: 126]
  ------------------
  580|  59.3k|        s->Freq <<= 1;
  581|    126|      else
  582|    126|        s->Freq = MAX_FREQ - 4;
  ------------------
  |  |   29|    126|#define MAX_FREQ 124
  ------------------
  583|  59.4k|      c->SummFreq = (UInt16)(s->Freq + p->InitEsc + (ns > 3));
  584|  59.4k|    }
  585|   136k|    cf = 2 * (UInt32)p->FoundState->Freq * (c->SummFreq + 6);
  586|   136k|    sf = (UInt32)s0 + c->SummFreq;
  587|   136k|    if (cf < 6 * sf)
  ------------------
  |  Branch (587:9): [True: 106k, False: 29.4k]
  ------------------
  588|   106k|    {
  589|   106k|      cf = 1 + (cf > sf) + (cf >= 4 * sf);
  590|   106k|      c->SummFreq += 3;
  591|   106k|    }
  592|  29.4k|    else
  593|  29.4k|    {
  594|  29.4k|      cf = 4 + (cf >= 9 * sf) + (cf >= 12 * sf) + (cf >= 15 * sf);
  595|  29.4k|      c->SummFreq = (UInt16)(c->SummFreq + cf);
  596|  29.4k|    }
  597|   136k|    {
  598|   136k|      CPpmd_State *s = STATS(c) + ns1;
  ------------------
  |  |   45|   136k|#define STATS(ctx) Ppmd7_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   18|   136k|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|   136k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  599|   136k|      SetSuccessor(s, successor);
  600|   136k|      s->Symbol = p->FoundState->Symbol;
  601|   136k|      s->Freq = (Byte)cf;
  602|   136k|      c->NumStats = (UInt16)(ns1 + 1);
  603|   136k|    }
  604|   136k|  }
  605|   148k|  p->MaxContext = p->MinContext = CTX(fSuccessor);
  ------------------
  |  |   44|   148k|#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   17|   148k|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|   148k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  606|   148k|}
archive_ppmd7.c:SwapStates:
  453|  58.9k|{
  454|  58.9k|  CPpmd_State tmp = *t1;
  455|  58.9k|  *t1 = *t2;
  456|  58.9k|  *t2 = tmp;
  457|  58.9k|}
archive_ppmd7.c:CreateSuccessors:
  381|  64.2k|{
  382|  64.2k|  CPpmd_State upState;
  383|  64.2k|  CTX_PTR c = p->MinContext;
  384|  64.2k|  CPpmd_Byte_Ref upBranch = (CPpmd_Byte_Ref)SUCCESSOR(p->FoundState);
  ------------------
  |  |  316|  64.2k|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  385|  64.2k|  CPpmd_State *ps[PPMD7_MAX_ORDER];
  386|  64.2k|  unsigned numPs = 0;
  387|       |  
  388|  64.2k|  if (!skip)
  ------------------
  |  Branch (388:7): [True: 45.6k, False: 18.5k]
  ------------------
  389|  45.6k|    ps[numPs++] = p->FoundState;
  390|       |  
  391|   175k|  while (c->Suffix)
  ------------------
  |  Branch (391:10): [True: 168k, False: 7.16k]
  ------------------
  392|   168k|  {
  393|   168k|    CPpmd_Void_Ref successor;
  394|   168k|    CPpmd_State *s;
  395|   168k|    c = SUFFIX(c);
  ------------------
  |  |   47|   168k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   44|   168k|#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   17|   168k|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   16|   168k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  396|   168k|    if (c->NumStats != 1)
  ------------------
  |  Branch (396:9): [True: 78.9k, False: 89.1k]
  ------------------
  397|  78.9k|    {
  398|  1.76M|      for (s = STATS(c); s->Symbol != p->FoundState->Symbol; s++);
  ------------------
  |  |   45|  78.9k|#define STATS(ctx) Ppmd7_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   18|  78.9k|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  78.9k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (398:26): [True: 1.68M, False: 78.9k]
  ------------------
  399|  78.9k|    }
  400|  89.1k|    else
  401|  89.1k|      s = ONE_STATE(c);
  ------------------
  |  |   46|  89.1k|#define ONE_STATE(ctx) Ppmd7Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   42|  89.1k|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  402|   168k|    successor = SUCCESSOR(s);
  ------------------
  |  |  316|   168k|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  403|   168k|    if (successor != upBranch)
  ------------------
  |  Branch (403:9): [True: 57.0k, False: 110k]
  ------------------
  404|  57.0k|    {
  405|  57.0k|      c = CTX(successor);
  ------------------
  |  |   44|  57.0k|#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   17|  57.0k|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  57.0k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  406|  57.0k|      if (numPs == 0)
  ------------------
  |  Branch (406:11): [True: 4.56k, False: 52.5k]
  ------------------
  407|  4.56k|        return c;
  408|  52.5k|      break;
  409|  57.0k|    }
  410|   110k|    ps[numPs++] = s;
  411|   110k|  }
  412|       |  
  413|  59.6k|  upState.Symbol = *(const Byte *)Ppmd7_GetPtr(p, upBranch);
  ------------------
  |  |   16|  59.6k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  414|  59.6k|  SetSuccessor(&upState, upBranch + 1);
  415|       |  
  416|  59.6k|  if (c->NumStats == 1)
  ------------------
  |  Branch (416:7): [True: 12.9k, False: 46.7k]
  ------------------
  417|  12.9k|    upState.Freq = ONE_STATE(c)->Freq;
  ------------------
  |  |   46|  12.9k|#define ONE_STATE(ctx) Ppmd7Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   42|  12.9k|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  418|  46.7k|  else
  419|  46.7k|  {
  420|  46.7k|    UInt32 cf, s0;
  421|  46.7k|    CPpmd_State *s;
  422|   899k|    for (s = STATS(c); s->Symbol != upState.Symbol; s++);
  ------------------
  |  |   45|  46.7k|#define STATS(ctx) Ppmd7_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   18|  46.7k|  #define Ppmd7_GetStats(p, ctx) ((CPpmd_State *)Ppmd7_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   16|  46.7k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (422:24): [True: 853k, False: 46.7k]
  ------------------
  423|  46.7k|    cf = s->Freq - 1;
  424|  46.7k|    s0 = c->SummFreq - c->NumStats - cf;
  425|  46.7k|    upState.Freq = (Byte)(1 + ((2 * cf <= s0) ? (5 * cf > s0) : ((2 * cf + 3 * s0 - 1) / (2 * s0))));
  ------------------
  |  Branch (425:32): [True: 37.8k, False: 8.84k]
  ------------------
  426|  46.7k|  }
  427|       |
  428|   216k|  while (numPs != 0)
  ------------------
  |  Branch (428:10): [True: 156k, False: 59.6k]
  ------------------
  429|   156k|  {
  430|       |    /* Create Child */
  431|   156k|    CTX_PTR c1; /* = AllocContext(p); */
  432|   156k|    if (p->HiUnit != p->LoUnit)
  ------------------
  |  Branch (432:9): [True: 143k, False: 12.8k]
  ------------------
  433|   143k|      c1 = (CTX_PTR)(p->HiUnit -= UNIT_SIZE);
  ------------------
  |  |   30|   143k|#define UNIT_SIZE 12
  ------------------
  434|  12.8k|    else if (p->FreeList[0] != 0)
  ------------------
  |  Branch (434:14): [True: 1.58k, False: 11.2k]
  ------------------
  435|  1.58k|      c1 = (CTX_PTR)RemoveNode(p, 0);
  436|  11.2k|    else
  437|  11.2k|    {
  438|  11.2k|      c1 = (CTX_PTR)AllocUnitsRare(p, 0);
  439|  11.2k|      if (!c1)
  ------------------
  |  Branch (439:11): [True: 81, False: 11.1k]
  ------------------
  440|     81|        return NULL;
  441|  11.2k|    }
  442|   156k|    c1->NumStats = 1;
  443|   156k|    *ONE_STATE(c1) = upState;
  ------------------
  |  |   46|   156k|#define ONE_STATE(ctx) Ppmd7Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   42|   156k|#define Ppmd7Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  444|   156k|    c1->Suffix = REF(c);
  ------------------
  |  |   39|   156k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  445|   156k|    SetSuccessor(ps[--numPs], REF(c1));
  ------------------
  |  |   39|   156k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  446|   156k|    c = c1;
  447|   156k|  }
  448|       |  
  449|  59.6k|  return c;
  450|  59.6k|}
archive_ppmd7.c:AllocUnitsRare:
  250|  16.1k|{
  251|  16.1k|  unsigned i;
  252|  16.1k|  void *retVal;
  253|  16.1k|  if (p->GlueCount == 0)
  ------------------
  |  Branch (253:7): [True: 193, False: 15.9k]
  ------------------
  254|    193|  {
  255|    193|    GlueFreeBlocks(p);
  256|    193|    if (p->FreeList[indx] != 0)
  ------------------
  |  Branch (256:9): [True: 2, False: 191]
  ------------------
  257|      2|      return RemoveNode(p, indx);
  258|    193|  }
  259|  16.1k|  i = indx;
  260|  16.1k|  do
  261|   543k|  {
  262|   543k|    if (++i == PPMD_NUM_INDEXES)
  ------------------
  |  |  102|   543k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   543k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   543k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   543k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   543k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   543k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   543k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   543k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (262:9): [True: 14.2k, False: 528k]
  ------------------
  263|  14.2k|    {
  264|  14.2k|      UInt32 numBytes = U2B(I2U(indx));
  ------------------
  |  |   32|  14.2k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   30|  14.2k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  265|  14.2k|      p->GlueCount--;
  266|  14.2k|      return ((UInt32)(p->UnitsStart - p->Text) > numBytes) ? (p->UnitsStart -= numBytes) : (NULL);
  ------------------
  |  Branch (266:14): [True: 14.1k, False: 145]
  ------------------
  267|  14.2k|    }
  268|   543k|  }
  269|   528k|  while (p->FreeList[i] == 0);
  ------------------
  |  Branch (269:10): [True: 527k, False: 1.86k]
  ------------------
  270|  1.86k|  retVal = RemoveNode(p, i);
  271|  1.86k|  SplitBlock(p, retVal, i, indx);
  272|  1.86k|  return retVal;
  273|  16.1k|}
archive_ppmd7.c:GlueFreeBlocks:
  178|    193|{
  179|       |  #ifdef PPMD_32BIT
  180|       |  CPpmd7_Node headItem;
  181|       |  CPpmd7_Node_Ref head = &headItem;
  182|       |  #else
  183|    193|  CPpmd7_Node_Ref head = p->AlignOffset + p->Size;
  184|    193|  #endif
  185|       |  
  186|    193|  CPpmd7_Node_Ref n = head;
  187|    193|  unsigned i;
  188|       |
  189|    193|  p->GlueCount = 255;
  190|       |
  191|       |  /* create doubly-linked list of free blocks */
  192|  7.52k|  for (i = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|  7.52k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|  7.52k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|  7.52k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|  7.52k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|  7.52k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|  7.52k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  7.52k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|  7.52k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (192:15): [True: 7.33k, False: 193]
  ------------------
  193|  7.33k|  {
  194|  7.33k|    UInt16 nu = I2U(i);
  ------------------
  |  |   34|  7.33k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  195|  7.33k|    CPpmd7_Node_Ref next = (CPpmd7_Node_Ref)p->FreeList[i];
  196|  7.33k|    p->FreeList[i] = 0;
  197|  7.51k|    while (next != 0)
  ------------------
  |  Branch (197:12): [True: 181, False: 7.33k]
  ------------------
  198|    181|    {
  199|    181|      CPpmd7_Node *node = NODE(next);
  ------------------
  |  |   75|    181|  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
  ------------------
  200|    181|      node->Next = n;
  201|    181|      n = NODE(n)->Prev = next;
  ------------------
  |  |   75|    181|  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
  ------------------
  202|    181|      next = *(const CPpmd7_Node_Ref *)node;
  203|    181|      node->Stamp = 0;
  204|    181|      node->NU = (UInt16)nu;
  205|    181|    }
  206|  7.33k|  }
  207|    193|  NODE(head)->Stamp = 1;
  ------------------
  |  |   75|    193|  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
  ------------------
  208|    193|  NODE(head)->Next = n;
  ------------------
  |  |   75|    193|  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
  ------------------
  209|    193|  NODE(n)->Prev = head;
  ------------------
  |  |   75|    193|  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
  ------------------
  210|    193|  if (p->LoUnit != p->HiUnit)
  ------------------
  |  Branch (210:7): [True: 11, False: 182]
  ------------------
  211|     11|    ((CPpmd7_Node *)p->LoUnit)->Stamp = 1;
  212|       |  
  213|       |  /* Glue free blocks */
  214|    365|  while (n != head)
  ------------------
  |  Branch (214:10): [True: 172, False: 193]
  ------------------
  215|    172|  {
  216|    172|    CPpmd7_Node *node = NODE(n);
  ------------------
  |  |   75|    172|  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
  ------------------
  217|    172|    UInt32 nu = (UInt32)node->NU;
  218|    172|    for (;;)
  219|    182|    {
  220|    182|      CPpmd7_Node *node2 = NODE(n) + nu;
  ------------------
  |  |   75|    182|  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
  ------------------
  221|    182|      nu += node2->NU;
  222|    182|      if (node2->Stamp != 0 || nu >= 0x10000)
  ------------------
  |  Branch (222:11): [True: 172, False: 10]
  |  Branch (222:32): [True: 0, False: 10]
  ------------------
  223|    172|        break;
  224|     10|      NODE(node2->Prev)->Next = node2->Next;
  ------------------
  |  |   75|     10|  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
  ------------------
  225|     10|      NODE(node2->Next)->Prev = node2->Prev;
  ------------------
  |  |   75|     10|  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
  ------------------
  226|     10|      node->NU = (UInt16)nu;
  227|     10|    }
  228|    172|    n = node->Next;
  229|    172|  }
  230|       |  
  231|       |  /* Fill lists of free blocks */
  232|    364|  for (n = NODE(head)->Next; n != head;)
  ------------------
  |  |   75|    193|  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
  ------------------
  |  Branch (232:30): [True: 171, False: 193]
  ------------------
  233|    171|  {
  234|    171|    CPpmd7_Node *node = NODE(n);
  ------------------
  |  |   75|    171|  #define NODE(offs) ((CPpmd7_Node *)(p->Base + (offs)))
  ------------------
  235|    171|    unsigned nu;
  236|    171|    CPpmd7_Node_Ref next = node->Next;
  237|    171|    for (nu = node->NU; nu > 128; nu -= 128, node += 128)
  ------------------
  |  Branch (237:25): [True: 0, False: 171]
  ------------------
  238|      0|      InsertNode(p, node, PPMD_NUM_INDEXES - 1);
  ------------------
  |  |  102|      0|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|      0|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|      0|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|      0|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|      0|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|      0|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|      0|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|      0|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  239|    171|    if (I2U(i = U2I(nu)) != nu)
  ------------------
  |  |   34|    171|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  |  Branch (239:9): [True: 2, False: 169]
  ------------------
  240|      2|    {
  241|      2|      unsigned k = I2U(--i);
  ------------------
  |  |   34|      2|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  242|      2|      InsertNode(p, node + k, nu - k - 1);
  243|      2|    }
  244|    171|    InsertNode(p, node, i);
  245|    171|    n = next;
  246|    171|  }
  247|    193|}
archive_ppmd7.c:AllocUnits:
  276|   100k|{
  277|   100k|  UInt32 numBytes;
  278|   100k|  if (p->FreeList[indx] != 0)
  ------------------
  |  Branch (278:7): [True: 39.3k, False: 61.2k]
  ------------------
  279|  39.3k|    return RemoveNode(p, indx);
  280|  61.2k|  numBytes = U2B(I2U(indx));
  ------------------
  |  |   32|  61.2k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   30|  61.2k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  281|  61.2k|  if (numBytes <= (UInt32)(p->HiUnit - p->LoUnit))
  ------------------
  |  Branch (281:7): [True: 56.3k, False: 4.87k]
  ------------------
  282|  56.3k|  {
  283|  56.3k|    void *retVal = p->LoUnit;
  284|  56.3k|    p->LoUnit += numBytes;
  285|  56.3k|    return retVal;
  286|  56.3k|  }
  287|  4.87k|  return AllocUnitsRare(p, indx);
  288|  61.2k|}
archive_ppmd7.c:Ppmd7_Update1:
  707|  37.6k|{
  708|  37.6k|  CPpmd_State *s = p->FoundState;
  709|  37.6k|  s->Freq += 4;
  710|  37.6k|  p->MinContext->SummFreq += 4;
  711|  37.6k|  if (s[0].Freq > s[-1].Freq)
  ------------------
  |  Branch (711:7): [True: 28.2k, False: 9.36k]
  ------------------
  712|  28.2k|  {
  713|  28.2k|    SwapStates(&s[0], &s[-1]);
  714|  28.2k|    p->FoundState = --s;
  715|  28.2k|    if (s->Freq > MAX_FREQ)
  ------------------
  |  |   29|  28.2k|#define MAX_FREQ 124
  ------------------
  |  Branch (715:9): [True: 8, False: 28.2k]
  ------------------
  716|      8|      Rescale(p);
  717|  28.2k|  }
  718|  37.6k|  NextContext(p);
  719|  37.6k|}
archive_ppmd7.c:Ppmd7_UpdateBin:
  732|   111k|{
  733|   111k|  p->FoundState->Freq = (Byte)(p->FoundState->Freq + (p->FoundState->Freq < 128 ? 1: 0));
  ------------------
  |  Branch (733:55): [True: 74.7k, False: 37.2k]
  ------------------
  734|   111k|  p->PrevSuccess = 1;
  735|   111k|  p->RunLength++;
  736|   111k|  NextContext(p);
  737|   111k|}
archive_ppmd7.c:Ppmd7_MakeEscFreq:
  673|  93.2k|{
  674|  93.2k|  CPpmd_See *see;
  675|  93.2k|  unsigned nonMasked = p->MinContext->NumStats - numMasked;
  676|  93.2k|  if (p->MinContext->NumStats != 256)
  ------------------
  |  Branch (676:7): [True: 60.5k, False: 32.6k]
  ------------------
  677|  60.5k|  {
  678|  60.5k|    see = p->See[p->NS2Indx[nonMasked - 1]] +
  679|  60.5k|        (nonMasked < (unsigned)SUFFIX(p->MinContext)->NumStats - p->MinContext->NumStats) +
  ------------------
  |  |   47|  60.5k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   44|  60.5k|#define CTX(ref) ((CPpmd7_Context *)Ppmd7_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   17|  60.5k|  #define Ppmd7_GetContext(p, offs) ((CPpmd7_Context *)Ppmd7_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   16|  60.5k|  #define Ppmd7_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  680|  60.5k|        2 * (p->MinContext->SummFreq < 11 * p->MinContext->NumStats) +
  681|  60.5k|        4 * (numMasked > nonMasked) +
  682|  60.5k|        p->HiBitsFlag;
  683|  60.5k|    {
  684|  60.5k|      unsigned r = (see->Summ >> see->Shift);
  685|  60.5k|      see->Summ = (UInt16)(see->Summ - r);
  686|  60.5k|      *escFreq = r + (r == 0);
  687|  60.5k|    }
  688|  60.5k|  }
  689|  32.6k|  else
  690|  32.6k|  {
  691|  32.6k|    see = &p->DummySee;
  692|  32.6k|    *escFreq = 1;
  693|  32.6k|  }
  694|  93.2k|  return see;
  695|  93.2k|}
archive_ppmd7.c:Ppmd7_Update2:
  740|  64.0k|{
  741|  64.0k|  p->MinContext->SummFreq += 4;
  742|  64.0k|  if ((p->FoundState->Freq += 4) > MAX_FREQ)
  ------------------
  |  |   29|  64.0k|#define MAX_FREQ 124
  ------------------
  |  Branch (742:7): [True: 102, False: 63.9k]
  ------------------
  743|    102|    Rescale(p);
  744|  64.0k|  p->RunLength = p->InitRL;
  745|  64.0k|  UpdateModel(p);
  746|  64.0k|}

archive_ppmd8.c:Ppmd8_Construct:
   65|  14.3k|{
   66|  14.3k|  unsigned i, k, m;
   67|       |
   68|  14.3k|  p->Base = 0;
   69|       |
   70|   559k|  for (i = 0, k = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|   559k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   559k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   559k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   559k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   559k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   559k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   559k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   559k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (70:22): [True: 544k, False: 14.3k]
  ------------------
   71|   544k|  {
   72|   544k|    unsigned step = (i >= 12 ? 4 : (i >> 2) + 1);
  ------------------
  |  Branch (72:22): [True: 372k, False: 172k]
  ------------------
   73|  1.83M|    do { p->Units2Indx[k++] = (Byte)i; } while (--step);
  ------------------
  |  Branch (73:49): [True: 1.29M, False: 544k]
  ------------------
   74|   544k|    p->Indx2Units[i] = (Byte)k;
   75|   544k|  }
   76|       |
   77|  14.3k|  p->NS2BSIndx[0] = (0 << 1);
   78|  14.3k|  p->NS2BSIndx[1] = (1 << 1);
   79|  14.3k|  memset(p->NS2BSIndx + 2, (2 << 1), 9);
   80|  14.3k|  memset(p->NS2BSIndx + 11, (3 << 1), 256 - 11);
   81|       |
   82|  86.0k|  for (i = 0; i < 5; i++)
  ------------------
  |  Branch (82:15): [True: 71.6k, False: 14.3k]
  ------------------
   83|  71.6k|    p->NS2Indx[i] = (Byte)i;
   84|  3.67M|  for (m = i, k = 1; i < 260; i++)
  ------------------
  |  Branch (84:22): [True: 3.65M, False: 14.3k]
  ------------------
   85|  3.65M|  {
   86|  3.65M|    p->NS2Indx[i] = (Byte)m;
   87|  3.65M|    if (--k == 0)
  ------------------
  |  Branch (87:9): [True: 315k, False: 3.34M]
  ------------------
   88|   315k|      k = (++m) - 4;
   89|  3.65M|  }
   90|  14.3k|}
archive_ppmd8.c:Ppmd8_Alloc:
  100|  11.2k|{
  101|  11.2k|  if (p->Base == 0 || p->Size != size)
  ------------------
  |  Branch (101:7): [True: 11.2k, False: 0]
  |  Branch (101:23): [True: 0, False: 0]
  ------------------
  102|  11.2k|  {
  103|  11.2k|    Ppmd8_Free(p);
  104|  11.2k|    p->AlignOffset =
  105|       |      #ifdef PPMD_32BIT
  106|       |        (4 - size) & 3;
  107|       |      #else
  108|  11.2k|        4 - (size & 3);
  109|  11.2k|      #endif
  110|  11.2k|    if ((p->Base = malloc(p->AlignOffset + size)) == 0)
  ------------------
  |  Branch (110:9): [True: 0, False: 11.2k]
  ------------------
  111|      0|      return False;
  ------------------
  |  |   56|      0|#define False 0
  ------------------
  112|  11.2k|    p->Size = size;
  113|  11.2k|  }
  114|  11.2k|  return True;
  ------------------
  |  |   55|  11.2k|#define True 1
  ------------------
  115|  11.2k|}
archive_ppmd8.c:Ppmd8_Free:
   93|  22.4k|{
   94|  22.4k|  free(p->Base);
   95|  22.4k|  p->Size = 0;
   96|  22.4k|  p->Base = 0;
   97|  22.4k|}
archive_ppmd8.c:Ppmd8_Init:
  411|  11.2k|{
  412|  11.2k|  p->MaxOrder = maxOrder;
  413|  11.2k|  p->RestoreMethod = restoreMethod;
  414|  11.2k|  RestartModel(p);
  415|  11.2k|  p->DummySee.Shift = PPMD_PERIOD_BITS;
  ------------------
  |  |   90|  11.2k|#define PPMD_PERIOD_BITS 7
  ------------------
  416|  11.2k|  p->DummySee.Summ = 0; /* unused */
  417|  11.2k|  p->DummySee.Count = 64; /* unused */
  418|  11.2k|}
archive_ppmd8.c:RestartModel:
  354|  11.3k|{
  355|  11.3k|  unsigned i, k, m, r;
  356|       |
  357|  11.3k|  memset(p->FreeList, 0, sizeof(p->FreeList));
  358|  11.3k|  memset(p->Stamps, 0, sizeof(p->Stamps));
  359|  11.3k|  RESET_TEXT(0);
  ------------------
  |  |  349|  11.3k|#define RESET_TEXT(offs) do {						\
  |  |  350|  11.3k|	p->Text = p->Base + p->AlignOffset + (offs);			\
  |  |  351|  11.3k|} while (0)
  |  |  ------------------
  |  |  |  Branch (351:10): [Folded, False: 11.3k]
  |  |  ------------------
  ------------------
  360|  11.3k|  p->HiUnit = p->Text + p->Size;
  361|  11.3k|  p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   15|  11.3k|#define UNIT_SIZE 12
  ------------------
                p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   15|  11.3k|#define UNIT_SIZE 12
  ------------------
  362|  11.3k|  p->GlueCount = 0;
  363|       |
  364|  11.3k|  p->OrderFall = p->MaxOrder;
  365|  11.3k|  p->RunLength = p->InitRL = -(Int32)((p->MaxOrder < 12) ? p->MaxOrder : 12) - 1;
  ------------------
  |  Branch (365:39): [True: 6.75k, False: 4.64k]
  ------------------
  366|  11.3k|  p->PrevSuccess = 0;
  367|       |
  368|  11.3k|  p->MinContext = p->MaxContext = (CTX_PTR)(p->HiUnit -= UNIT_SIZE); /* AllocContext(p); */
  ------------------
  |  |   15|  11.3k|#define UNIT_SIZE 12
  ------------------
  369|  11.3k|  p->MinContext->Suffix = 0;
  370|  11.3k|  p->MinContext->NumStats = 255;
  371|  11.3k|  p->MinContext->Flags = 0;
  372|  11.3k|  p->MinContext->SummFreq = 256 + 1;
  373|  11.3k|  p->FoundState = (CPpmd_State *)p->LoUnit; /* AllocUnits(p, PPMD_NUM_INDEXES - 1); */
  374|  11.3k|  p->LoUnit += U2B(256 / 2);
  ------------------
  |  |   17|  11.3k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  11.3k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  375|  11.3k|  p->MinContext->Stats = REF(p->FoundState);
  ------------------
  |  |   24|  11.3k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  376|  2.92M|  for (i = 0; i < 256; i++)
  ------------------
  |  Branch (376:15): [True: 2.91M, False: 11.3k]
  ------------------
  377|  2.91M|  {
  378|  2.91M|    CPpmd_State *s = &p->FoundState[i];
  379|  2.91M|    s->Symbol = (Byte)i;
  380|  2.91M|    s->Freq = 1;
  381|  2.91M|    SetSuccessor(s, 0);
  382|  2.91M|  }
  383|       |
  384|   296k|  for (i = m = 0; m < 25; m++)
  ------------------
  |  Branch (384:19): [True: 284k, False: 11.3k]
  ------------------
  385|   284k|  {
  386|  2.73M|    while (p->NS2Indx[i] == m)
  ------------------
  |  Branch (386:12): [True: 2.45M, False: 284k]
  ------------------
  387|  2.45M|      i++;
  388|  2.56M|    for (k = 0; k < 8; k++)
  ------------------
  |  Branch (388:17): [True: 2.27M, False: 284k]
  ------------------
  389|  2.27M|    {
  390|  2.27M|      UInt16 val = (UInt16)(PPMD_BIN_SCALE - kInitBinEsc[k] / (i + 1));
  ------------------
  |  |   91|  2.27M|#define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   89|  2.27M|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   90|  2.27M|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  ------------------
  391|  2.27M|      UInt16 *dest = p->BinSumm[m] + k;
  392|  20.5M|      for (r = 0; r < 64; r += 8)
  ------------------
  |  Branch (392:19): [True: 18.2M, False: 2.27M]
  ------------------
  393|  18.2M|        dest[r] = val;
  394|  2.27M|    }
  395|   284k|  }
  396|       |
  397|   284k|  for (i = m = 0; m < 24; m++)
  ------------------
  |  Branch (397:19): [True: 273k, False: 11.3k]
  ------------------
  398|   273k|  {
  399|  3.18M|    while (p->NS2Indx[i + 3] == m + 3)
  ------------------
  |  Branch (399:12): [True: 2.90M, False: 273k]
  ------------------
  400|  2.90M|      i++;
  401|  9.02M|    for (k = 0; k < 32; k++)
  ------------------
  |  Branch (401:17): [True: 8.75M, False: 273k]
  ------------------
  402|  8.75M|    {
  403|  8.75M|      CPpmd_See *s = &p->See[m][k];
  404|  8.75M|      s->Summ = (UInt16)((2 * i + 5) << (s->Shift = PPMD_PERIOD_BITS - 4));
  ------------------
  |  |   90|  8.75M|#define PPMD_PERIOD_BITS 7
  ------------------
  405|  8.75M|      s->Count = 7;
  406|  8.75M|    }
  407|   273k|  }
  408|  11.3k|}
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.2k|{
 1132|  11.2k|  unsigned i;
 1133|  11.2k|  p->Low = 0;
 1134|  11.2k|  p->Range = 0xFFFFFFFF;
 1135|  11.2k|  p->Code = 0;
 1136|  56.1k|  for (i = 0; i < 4; i++)
  ------------------
  |  Branch (1136:15): [True: 44.9k, False: 11.2k]
  ------------------
 1137|  44.9k|    p->Code = (p->Code << 8) | p->Stream.In->Read(p->Stream.In);
 1138|  11.2k|  return (p->Code < 0xFFFFFFFF);
 1139|  11.2k|}
archive_ppmd8.c:Ppmd8_DecodeSymbol:
 1165|  66.2M|{
 1166|  66.2M|  size_t charMask[256 / sizeof(size_t)];
 1167|  66.2M|  if (p->MinContext->NumStats != 0)
  ------------------
  |  Branch (1167:7): [True: 15.2M, False: 51.0M]
  ------------------
 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.4M|    {
 1185|  88.4M|      if ((hiCnt += (++s)->Freq) > count)
  ------------------
  |  Branch (1185:11): [True: 5.47M, False: 82.9M]
  ------------------
 1186|  5.47M|      {
 1187|  5.47M|        Byte symbol;
 1188|  5.47M|        RangeDec_Decode(p, hiCnt - s->Freq, s->Freq);
 1189|  5.47M|        p->FoundState = s;
 1190|  5.47M|        symbol = s->Symbol;
 1191|  5.47M|        Ppmd8_Update1(p);
 1192|  5.47M|        return symbol;
 1193|  5.47M|      }
 1194|  88.4M|    }
 1195|  82.9M|    while (--i);
  ------------------
  |  Branch (1195:12): [True: 78.8M, False: 4.08M]
  ------------------
 1196|  4.08M|    if (count >= p->MinContext->SummFreq)
  ------------------
  |  Branch (1196:9): [True: 4.95k, False: 4.08M]
  ------------------
 1197|  4.95k|      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|  51.0M|  else
 1205|  51.0M|  {
 1206|  51.0M|    UInt16 *prob = Ppmd8_GetBinSumm(p);
  ------------------
  |  |  102|  51.0M|    &p->BinSumm[p->NS2Indx[Ppmd8Context_OneState(p->MinContext)->Freq - 1]][ \
  |  |  ------------------
  |  |  |  |   38|  51.0M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  |  |  103|  51.0M|    p->NS2BSIndx[Ppmd8_GetContext(p, p->MinContext->Suffix)->NumStats] + \
  |  |  ------------------
  |  |  |  |   97|  51.0M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  51.0M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|  51.0M|    p->PrevSuccess + p->MinContext->Flags + ((p->RunLength >> 26) & 0x20)]
  ------------------
 1207|  51.0M|    if (((p->Code / (p->Range >>= 14)) < *prob))
  ------------------
  |  Branch (1207:9): [True: 44.2M, False: 6.84M]
  ------------------
 1208|  44.2M|    {
 1209|  44.2M|      Byte symbol;
 1210|  44.2M|      RangeDec_Decode(p, 0, *prob);
 1211|  44.2M|      *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob);
  ------------------
  |  |   95|  44.2M|#define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   89|  44.2M|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   94|  44.2M|#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  44.2M|#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1212|  44.2M|      symbol = (p->FoundState = Ppmd8Context_OneState(p->MinContext))->Symbol;
  ------------------
  |  |   38|  44.2M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  ------------------
 1213|  44.2M|      Ppmd8_UpdateBin(p);
 1214|  44.2M|      return symbol;
 1215|  44.2M|    }
 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: 700M, 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.08k, False: 4.54M]
  ------------------
 1268|  5.08k|      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|  81.7M|{
 1148|  81.7M|  start *= p->Range;
 1149|  81.7M|  p->Low += start;
 1150|  81.7M|  p->Code -= start;
 1151|  81.7M|  p->Range *= size;
 1152|       |
 1153|  93.1M|  while ((p->Low ^ (p->Low + p->Range)) < kTop ||
  ------------------
  |  |   34|   186M|#define kTop (1 << 24)
  ------------------
  |  Branch (1153:10): [True: 11.4M, False: 81.7M]
  ------------------
 1154|  81.7M|      (p->Range < kBot && ((p->Range = (0 - p->Low) & (kBot - 1)), 1)))
  ------------------
  |  |   35|   163M|#define kBot (1 << 15)
  ------------------
                    (p->Range < kBot && ((p->Range = (0 - p->Low) & (kBot - 1)), 1)))
  ------------------
  |  |   35|  13.1k|#define kBot (1 << 15)
  ------------------
  |  Branch (1154:8): [True: 13.1k, False: 81.7M]
  |  Branch (1154:27): [True: 13.1k, 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|  81.7M|}
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.2k, False: 5.59M]
  ------------------
 1102|  41.2k|    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.4k]
  ------------------
 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.43k, False: 6.31k]
  ------------------
 1021|  4.43k|    {
 1022|  4.43k|      CPpmd_State tmp = *stats;
 1023|  4.43k|      tmp.Freq = (Byte)((2 * tmp.Freq + escFreq - 1) / escFreq);
 1024|  4.43k|      if (tmp.Freq > MAX_FREQ / 3)
  ------------------
  |  |   14|  4.43k|#define MAX_FREQ 124
  ------------------
  |  Branch (1024:11): [True: 4.29k, False: 139]
  ------------------
 1025|  4.29k|        tmp.Freq = MAX_FREQ / 3;
  ------------------
  |  |   14|  4.29k|#define MAX_FREQ 124
  ------------------
 1026|  4.43k|      InsertNode(p, stats, U2I((numStats + 2) >> 1));
  ------------------
  |  |   18|  4.43k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
 1027|  4.43k|      p->MinContext->Flags = (Byte)((p->MinContext->Flags & 0x10) + 0x08 * (tmp.Symbol >= 0x40));
 1028|  4.43k|      *(p->FoundState = ONE_STATE(p->MinContext)) = tmp;
  ------------------
  |  |   31|  4.43k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  4.43k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
 1029|  4.43k|      return;
 1030|  4.43k|    }
 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|  55.3M|{
 1071|  55.3M|  CTX_PTR c = CTX(SUCCESSOR(p->FoundState));
  ------------------
  |  |   29|  55.3M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  55.3M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  55.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1072|  55.3M|  if (p->OrderFall == 0 && (Byte *)c >= p->UnitsStart)
  ------------------
  |  Branch (1072:7): [True: 20.5M, False: 34.7M]
  |  Branch (1072:28): [True: 13.2M, False: 7.28M]
  ------------------
 1073|  13.2M|    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|  55.3M|}
archive_ppmd8.c:UpdateModel:
  806|  52.9M|{
  807|  52.9M|  CPpmd_Void_Ref successor, fSuccessor = SUCCESSOR(p->FoundState);
  ------------------
  |  |  341|  52.9M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  808|  52.9M|  CTX_PTR c;
  809|  52.9M|  unsigned s0, ns, fFreq = p->FoundState->Freq;
  810|  52.9M|  Byte flag, fSymbol = p->FoundState->Symbol;
  811|  52.9M|  CPpmd_State *s = NULL;
  812|       |  
  813|  52.9M|  if (p->FoundState->Freq < MAX_FREQ / 4 && p->MinContext->Suffix != 0)
  ------------------
  |  |   14|  52.9M|#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|  52.9M|  c = p->MaxContext;
  844|  52.9M|  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.7k]
  ------------------
  945|  26.2M|        s2->Freq <<= 1;
  946|  11.7k|      else
  947|  11.7k|        s2->Freq = MAX_FREQ - 4;
  ------------------
  |  |   14|  11.7k|#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: 449k]
  ------------------
  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: 497k, False: 22.2M]
  ------------------
  659|   497k|        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.6M|    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.4M, 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: 584k, False: 1.08M]
  ------------------
  733|   584k|      {
  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|   584k|        return c;
  743|   584k|      }
  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.47M|{
 1083|  5.47M|  CPpmd_State *s = p->FoundState;
 1084|  5.47M|  s->Freq += 4;
 1085|  5.47M|  p->MinContext->SummFreq += 4;
 1086|  5.47M|  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.47M|  NextContext(p);
 1094|  5.47M|}
archive_ppmd8.c:Ppmd8_UpdateBin:
 1107|  44.2M|{
 1108|  44.2M|  p->FoundState->Freq = (Byte)(p->FoundState->Freq + (p->FoundState->Freq < 196));
 1109|  44.2M|  p->PrevSuccess = 1;
 1110|  44.2M|  p->RunLength++;
 1111|  44.2M|  NextContext(p);
 1112|  44.2M|}
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.42M]
  ------------------
 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.42M|  else
 1062|  2.42M|  {
 1063|  2.42M|    see = &p->DummySee;
 1064|  2.42M|    *escFreq = 1;
 1065|  2.42M|  }
 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:
   96|  2.49k|{
   97|  2.49k|	struct archive_read *a;
   98|       |
   99|  2.49k|	a = calloc(1, sizeof(*a));
  100|  2.49k|	if (a == NULL)
  ------------------
  |  Branch (100:6): [True: 0, False: 2.49k]
  ------------------
  101|      0|		return (NULL);
  102|  2.49k|	a->archive.magic = ARCHIVE_READ_MAGIC;
  ------------------
  |  |   59|  2.49k|#define	ARCHIVE_READ_MAGIC	(0xdeb0c5U)
  ------------------
  103|       |
  104|  2.49k|	a->archive.state = ARCHIVE_STATE_NEW;
  ------------------
  |  |   76|  2.49k|#define	ARCHIVE_STATE_NEW	1U
  ------------------
  105|  2.49k|	a->entry = archive_entry_new2(&a->archive);
  106|  2.49k|	if (a->entry == NULL) {
  ------------------
  |  Branch (106:6): [True: 0, False: 2.49k]
  ------------------
  107|      0|		free(a);
  108|      0|		return (NULL);
  109|      0|	}
  110|  2.49k|	a->archive.vtable = &archive_read_vtable;
  111|  2.49k|	a->entry_bytes_declared = -1;
  112|       |
  113|  2.49k|	a->passphrases.last = &a->passphrases.first;
  114|       |
  115|  2.49k|	return (&a->archive);
  116|  2.49k|}
archive_read_set_open_callback:
  312|  2.49k|{
  313|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  314|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  177|  2.49k|	do { \
  |  |  178|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  2.49k|			(allowed_states), (function_name)); \
  |  |  180|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  181|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  315|  2.49k|	    "archive_read_set_open_callback");
  316|  2.49k|	a->client.opener = client_opener;
  317|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  318|  2.49k|}
archive_read_set_read_callback:
  323|  2.49k|{
  324|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  325|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  177|  2.49k|	do { \
  |  |  178|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  2.49k|			(allowed_states), (function_name)); \
  |  |  180|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  181|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  326|  2.49k|	    "archive_read_set_read_callback");
  327|  2.49k|	a->client.reader = client_reader;
  328|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  329|  2.49k|}
archive_read_set_skip_callback:
  334|  2.49k|{
  335|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  336|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  177|  2.49k|	do { \
  |  |  178|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  2.49k|			(allowed_states), (function_name)); \
  |  |  180|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  181|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  337|  2.49k|	    "archive_read_set_skip_callback");
  338|  2.49k|	a->client.skipper = client_skipper;
  339|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  340|  2.49k|}
archive_read_set_seek_callback:
  345|  2.49k|{
  346|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  347|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  177|  2.49k|	do { \
  |  |  178|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  2.49k|			(allowed_states), (function_name)); \
  |  |  180|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  181|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  348|  2.49k|	    "archive_read_set_seek_callback");
  349|  2.49k|	a->client.seeker = client_seeker;
  350|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  351|  2.49k|}
archive_read_set_close_callback:
  356|  2.49k|{
  357|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  358|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  177|  2.49k|	do { \
  |  |  178|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  2.49k|			(allowed_states), (function_name)); \
  |  |  180|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  181|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  359|  2.49k|	    "archive_read_set_close_callback");
  360|  2.49k|	a->client.closer = client_closer;
  361|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  362|  2.49k|}
archive_read_set_callback_data:
  377|  2.49k|{
  378|  2.49k|	return archive_read_set_callback_data2(_a, client_data, 0);
  379|  2.49k|}
archive_read_set_callback_data2:
  384|  2.49k|{
  385|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  386|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  177|  2.49k|	do { \
  |  |  178|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  2.49k|			(allowed_states), (function_name)); \
  |  |  180|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  181|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  387|  2.49k|	    "archive_read_set_callback_data2");
  388|       |
  389|  2.49k|	if (a->client.nodes == 0)
  ------------------
  |  Branch (389:6): [True: 2.49k, False: 0]
  ------------------
  390|  2.49k|	{
  391|  2.49k|		a->client.dataset = (struct archive_read_data_node *)
  392|  2.49k|		    calloc(1, sizeof(*a->client.dataset));
  393|  2.49k|		if (a->client.dataset == NULL)
  ------------------
  |  Branch (393:7): [True: 0, False: 2.49k]
  ------------------
  394|      0|		{
  395|      0|			archive_set_error(&a->archive, ENOMEM,
  396|      0|				"No memory");
  397|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  398|      0|		}
  399|  2.49k|		a->client.nodes = 1;
  400|  2.49k|	}
  401|       |
  402|  2.49k|	if (iindex > a->client.nodes - 1)
  ------------------
  |  Branch (402:6): [True: 0, False: 2.49k]
  ------------------
  403|      0|	{
  404|      0|		archive_set_error(&a->archive, EINVAL,
  405|      0|			"Invalid index specified");
  406|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  407|      0|	}
  408|  2.49k|	a->client.dataset[iindex].data = client_data;
  409|  2.49k|	a->client.dataset[iindex].begin_position = -1;
  410|  2.49k|	a->client.dataset[iindex].total_size = -1;
  411|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  412|  2.49k|}
archive_read_open1:
  483|  2.49k|{
  484|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  485|  2.49k|	struct archive_read_filter *filter, *tmp;
  486|  2.49k|	int slot, e = ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  487|       |
  488|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  177|  2.49k|	do { \
  |  |  178|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  2.49k|			(allowed_states), (function_name)); \
  |  |  180|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  181|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  489|  2.49k|	    "archive_read_open");
  490|  2.49k|	archive_clear_error(&a->archive);
  491|       |
  492|  2.49k|	if (a->client.reader == NULL) {
  ------------------
  |  Branch (492:6): [True: 0, False: 2.49k]
  ------------------
  493|      0|		archive_set_error(&a->archive, EINVAL,
  494|      0|		    "No reader function provided to archive_read_open");
  495|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   94|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  496|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  497|      0|	}
  498|       |
  499|       |	/* Open data source. */
  500|  2.49k|	if (a->client.opener != NULL) {
  ------------------
  |  Branch (500:6): [True: 2.49k, False: 0]
  ------------------
  501|  2.49k|		e = (a->client.opener)(&a->archive, a->client.dataset[0].data);
  502|  2.49k|		if (e != 0) {
  ------------------
  |  Branch (502:7): [True: 0, False: 2.49k]
  ------------------
  503|       |			/* If the open failed, call the closer to clean up. */
  504|      0|			read_client_close_proxy(a);
  505|      0|			return (e);
  506|      0|		}
  507|  2.49k|	}
  508|       |
  509|  2.49k|	filter = calloc(1, sizeof(*filter));
  510|  2.49k|	if (filter == NULL)
  ------------------
  |  Branch (510:6): [True: 0, False: 2.49k]
  ------------------
  511|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  512|  2.49k|	filter->bidder = NULL;
  513|  2.49k|	filter->upstream = NULL;
  514|  2.49k|	filter->archive = a;
  515|  2.49k|	filter->data = a->client.dataset[0].data;
  516|  2.49k|	filter->vtable = &none_reader_vtable;
  517|  2.49k|	filter->name = "none";
  518|  2.49k|	filter->code = ARCHIVE_FILTER_NONE;
  ------------------
  |  |  309|  2.49k|#define	ARCHIVE_FILTER_NONE	0
  ------------------
  519|  2.49k|	filter->can_skip = 1;
  520|  2.49k|	filter->can_seek = 1;
  521|       |
  522|  2.49k|	a->client.dataset[0].begin_position = 0;
  523|  2.49k|	if (!a->filter || !a->bypass_filter_bidding)
  ------------------
  |  Branch (523:6): [True: 2.49k, False: 0]
  |  Branch (523:20): [True: 0, False: 0]
  ------------------
  524|  2.49k|	{
  525|  2.49k|		a->filter = filter;
  526|       |		/* Build out the input pipeline. */
  527|  2.49k|		e = choose_filters(a);
  528|  2.49k|		if (e < ARCHIVE_WARN) {
  ------------------
  |  |  235|  2.49k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (528:7): [True: 41, False: 2.45k]
  ------------------
  529|     41|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   94|     41|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  530|     41|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     41|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  531|     41|		}
  532|  2.49k|	}
  533|      0|	else
  534|      0|	{
  535|       |		/* Need to add "NONE" type filter at the end of the filter chain */
  536|      0|		tmp = a->filter;
  537|      0|		while (tmp->upstream)
  ------------------
  |  Branch (537:10): [True: 0, False: 0]
  ------------------
  538|      0|			tmp = tmp->upstream;
  539|      0|		tmp->upstream = filter;
  540|      0|	}
  541|       |
  542|  2.45k|	if (!a->format)
  ------------------
  |  Branch (542:6): [True: 2.45k, False: 0]
  ------------------
  543|  2.45k|	{
  544|  2.45k|		slot = choose_format(a);
  545|  2.45k|		if (slot < 0) {
  ------------------
  |  Branch (545:7): [True: 17, False: 2.44k]
  ------------------
  546|     17|			close_filters(a);
  547|     17|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   94|     17|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  548|     17|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     17|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  549|     17|		}
  550|  2.44k|		a->format = &(a->formats[slot]);
  551|  2.44k|	}
  552|       |
  553|  2.44k|	a->archive.state = ARCHIVE_STATE_HEADER;
  ------------------
  |  |   78|  2.44k|#define	ARCHIVE_STATE_HEADER	2U
  ------------------
  554|       |
  555|       |	/* Ensure libarchive starts from the first node in a multivolume set */
  556|  2.44k|	client_switch_proxy(a->filter, 0);
  557|  2.44k|	return (e);
  558|  2.45k|}
__archive_read_header:
  626|     64|{
  627|     64|	if (!a->filter->vtable->read_header)
  ------------------
  |  Branch (627:6): [True: 44, False: 20]
  ------------------
  628|     44|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     44|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  629|     20|	return a->filter->vtable->read_header(a->filter, entry);
  630|     64|}
archive_read_has_encrypted_entries:
  821|  2.44k|{
  822|  2.44k|	struct archive_read *a = (struct archive_read *)_a;
  823|  2.44k|	int format_supports_encryption = archive_read_format_capabilities(_a)
  824|  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.) */
  ------------------
  825|       |
  826|  2.44k|	if (!_a || !format_supports_encryption) {
  ------------------
  |  Branch (826:6): [True: 0, False: 2.44k]
  |  Branch (826:13): [True: 1.22k, False: 1.21k]
  ------------------
  827|       |		/* Format in general doesn't support encryption */
  828|  1.22k|		return ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED;
  ------------------
  |  |  410|  1.22k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED -2
  ------------------
  829|  1.22k|	}
  830|       |
  831|       |	/* A reader potentially has read enough data now. */
  832|  1.21k|	if (a->format && a->format->has_encrypted_entries) {
  ------------------
  |  Branch (832:6): [True: 1.21k, False: 0]
  |  Branch (832:19): [True: 1.21k, False: 0]
  ------------------
  833|  1.21k|		return (a->format->has_encrypted_entries)(a);
  834|  1.21k|	}
  835|       |
  836|       |	/* For any other reason we cannot say how many entries are there. */
  837|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  838|  1.21k|}
archive_read_format_capabilities:
  846|  4.88k|{
  847|  4.88k|	struct archive_read *a = (struct archive_read *)_a;
  848|  4.88k|	if (a && a->format && a->format->format_capabilties) {
  ------------------
  |  Branch (848:6): [True: 4.88k, False: 0]
  |  Branch (848:11): [True: 4.88k, False: 0]
  |  Branch (848:24): [True: 2.43k, False: 2.44k]
  ------------------
  849|  2.43k|		return (a->format->format_capabilties)(a);
  850|  2.43k|	}
  851|  2.44k|	return ARCHIVE_READ_FORMAT_CAPS_NONE;
  ------------------
  |  |  397|  2.44k|#define ARCHIVE_READ_FORMAT_CAPS_NONE (0) /* no special capabilities */
  ------------------
  852|  4.88k|}
archive_read_data:
  867|   106M|{
  868|   106M|	struct archive *a = (struct archive *)_a;
  869|   106M|	char	*dest;
  870|   106M|	const void *read_buf;
  871|   106M|	size_t	 bytes_read;
  872|   106M|	size_t	 len;
  873|   106M|	int	 r;
  874|       |
  875|   106M|	bytes_read = 0;
  876|   106M|	dest = (char *)buff;
  877|       |
  878|   213M|	while (s > 0) {
  ------------------
  |  Branch (878:9): [True: 106M, False: 106M]
  ------------------
  879|   106M|		if (a->read_data_offset == a->read_data_output_offset &&
  ------------------
  |  Branch (879:7): [True: 524k, False: 106M]
  ------------------
  880|   524k|		    a->read_data_remaining == 0) {
  ------------------
  |  Branch (880:7): [True: 154k, False: 369k]
  ------------------
  881|   154k|			read_buf = a->read_data_block;
  882|   154k|			a->read_data_is_posix_read = 1;
  883|   154k|			a->read_data_requested = s;
  884|   154k|			r = archive_read_data_block(a, &read_buf,
  885|   154k|			    &a->read_data_remaining, &a->read_data_offset);
  886|   154k|			a->read_data_block = read_buf;
  887|   154k|			if (r == ARCHIVE_EOF &&
  ------------------
  |  |  232|   308k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (887:8): [True: 85.2k, False: 69.0k]
  ------------------
  888|  85.2k|			    a->read_data_offset == a->read_data_output_offset &&
  ------------------
  |  Branch (888:8): [True: 77.8k, False: 7.37k]
  ------------------
  889|  77.8k|			    a->read_data_remaining == 0)
  ------------------
  |  Branch (889:8): [True: 77.8k, False: 0]
  ------------------
  890|  77.8k|				return (bytes_read);
  891|       |			/*
  892|       |			 * Error codes are all negative, so the status
  893|       |			 * return here cannot be confused with a valid
  894|       |			 * byte count.  (ARCHIVE_OK is zero.)
  895|       |			 */
  896|  76.4k|			if (r < ARCHIVE_OK)
  ------------------
  |  |  233|  76.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (896:8): [True: 29.0k, False: 47.4k]
  ------------------
  897|  29.0k|				return (r);
  898|  76.4k|		}
  899|       |
  900|   106M|		if (a->read_data_offset < a->read_data_output_offset) {
  ------------------
  |  Branch (900:7): [True: 224, False: 106M]
  ------------------
  901|    224|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    224|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  902|    224|			    "Encountered out-of-order sparse blocks");
  903|    224|			return (ARCHIVE_RETRY);
  ------------------
  |  |  234|    224|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  904|    224|		}
  905|       |
  906|       |		/* Compute the amount of zero padding needed. */
  907|   106M|		if (a->read_data_output_offset + (int64_t)s <
  ------------------
  |  Branch (907:7): [True: 106M, False: 417k]
  ------------------
  908|   106M|		    a->read_data_offset) {
  909|   106M|			len = s;
  910|   106M|		} else if (a->read_data_output_offset <
  ------------------
  |  Branch (910:14): [True: 7.50k, False: 409k]
  ------------------
  911|   417k|		    a->read_data_offset) {
  912|  7.50k|			len = (size_t)(a->read_data_offset -
  913|  7.50k|			    a->read_data_output_offset);
  914|  7.50k|		} else
  915|   409k|			len = 0;
  916|       |
  917|       |		/* Add zeroes. */
  918|   106M|		memset(dest, 0, len);
  919|   106M|		s -= len;
  920|   106M|		a->read_data_output_offset += len;
  921|   106M|		dest += len;
  922|   106M|		bytes_read += len;
  923|       |
  924|       |		/* Copy data if there is any space left. */
  925|   106M|		if (s > 0) {
  ------------------
  |  Branch (925:7): [True: 417k, False: 106M]
  ------------------
  926|   417k|			len = a->read_data_remaining;
  927|   417k|			if (len > s)
  ------------------
  |  Branch (927:8): [True: 369k, False: 47.1k]
  ------------------
  928|   369k|				len = s;
  929|   417k|			if (len) {
  ------------------
  |  Branch (929:8): [True: 407k, False: 9.40k]
  ------------------
  930|   407k|				memcpy(dest, a->read_data_block, len);
  931|   407k|				s -= len;
  932|   407k|				a->read_data_block += len;
  933|   407k|				a->read_data_remaining -= len;
  934|   407k|				a->read_data_output_offset += len;
  935|   407k|				a->read_data_offset += len;
  936|   407k|				dest += len;
  937|   407k|				bytes_read += len;
  938|   407k|			}
  939|   417k|		}
  940|   106M|	}
  941|   106M|	a->read_data_is_posix_read = 0;
  942|   106M|	a->read_data_requested = 0;
  943|   106M|	return (bytes_read);
  944|   106M|}
__archive_reset_read_data:
  950|   297k|{
  951|   297k|	a->read_data_output_offset = 0;
  952|   297k|	a->read_data_remaining = 0;
  953|   297k|	a->read_data_is_posix_read = 0;
  954|   297k|	a->read_data_requested = 0;
  955|       |
  956|       |   /* extra resets, from rar.c */
  957|       |   a->read_data_block = NULL;
  958|   297k|   a->read_data_offset = 0;
  959|   297k|}
archive_read_data_skip:
  966|  83.1k|{
  967|  83.1k|	struct archive_read *a = (struct archive_read *)_a;
  968|  83.1k|	int r;
  969|  83.1k|	const void *buff;
  970|  83.1k|	size_t size;
  971|  83.1k|	int64_t offset;
  972|       |
  973|  83.1k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|  83.1k|	do { \
  |  |  178|  83.1k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  83.1k|			(allowed_states), (function_name)); \
  |  |  180|  83.1k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  83.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 83.1k]
  |  |  ------------------
  |  |  181|  83.1k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  83.1k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 83.1k]
  |  |  ------------------
  ------------------
  974|  83.1k|	    ARCHIVE_STATE_DATA | ARCHIVE_STATE_DATA_RECOVERY,
  975|  83.1k|	    "archive_read_data_skip");
  976|       |
  977|  83.1k|	if (a->format->read_data_skip != NULL)
  ------------------
  |  Branch (977:6): [True: 83.1k, False: 0]
  ------------------
  978|  83.1k|		r = (a->format->read_data_skip)(a);
  979|      0|	else {
  980|      0|		while ((r = archive_read_data_block(&a->archive,
  ------------------
  |  Branch (980:10): [True: 0, False: 0]
  ------------------
  981|      0|			    &buff, &size, &offset))
  982|      0|		    == ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  983|      0|			;
  984|      0|	}
  985|       |
  986|  83.1k|	if (r == ARCHIVE_EOF)
  ------------------
  |  |  232|  83.1k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (986:6): [True: 2, False: 83.1k]
  ------------------
  987|      2|		r = ARCHIVE_OK;
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  988|       |
  989|  83.1k|	if (r == ARCHIVE_FATAL)
  ------------------
  |  |  239|  83.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (989:6): [True: 259, False: 82.8k]
  ------------------
  990|    259|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   94|    259|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  991|  82.8k|	else
  992|  82.8k|		a->archive.state = ARCHIVE_STATE_HEADER;
  ------------------
  |  |   78|  82.8k|#define	ARCHIVE_STATE_HEADER	2U
  ------------------
  993|  83.1k|	return (r);
  994|  83.1k|}
archive_seek_data:
  998|  2.44k|{
  999|  2.44k|	struct archive_read *a = (struct archive_read *)_a;
 1000|  2.44k|	la_int64_t r;
 1001|       |
 1002|  2.44k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_DATA,
  ------------------
  |  |  177|  2.44k|	do { \
  |  |  178|  2.44k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  2.44k|			(allowed_states), (function_name)); \
  |  |  180|  2.44k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.44k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 2.44k, False: 0]
  |  |  ------------------
  |  |  181|  2.44k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|  2.44k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  2.44k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
 1003|  2.44k|	    "archive_seek_data_block");
 1004|       |
 1005|      0|	if (a->format->seek_data == NULL) {
  ------------------
  |  Branch (1005:6): [True: 0, False: 0]
  ------------------
 1006|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1007|      0|		    "Internal error: "
 1008|      0|		    "No format_seek_data_block function registered");
 1009|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   94|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
 1010|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1011|      0|	}
 1012|       |
 1013|      0|	r = (a->format->seek_data)(a, offset, whence);
 1014|      0|	if (r == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1014:6): [True: 0, False: 0]
  ------------------
 1015|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   94|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
 1016|      0|	return (r);
 1017|      0|}
__archive_read_free_filters:
 1074|  2.54k|{
 1075|       |	/* Make sure filters are closed and their buffers are freed */
 1076|  2.54k|	close_filters(a);
 1077|       |
 1078|  5.40k|	while (a->filter != NULL) {
  ------------------
  |  Branch (1078:9): [True: 2.86k, False: 2.54k]
  ------------------
 1079|  2.86k|		struct archive_read_filter *t = a->filter->upstream;
 1080|  2.86k|		free(a->filter);
 1081|  2.86k|		a->filter = t;
 1082|  2.86k|	}
 1083|  2.54k|}
__archive_read_register_format:
 1255|  44.9k|{
 1256|  44.9k|	int i, number_slots;
 1257|       |
 1258|  44.9k|	archive_check_magic(&a->archive,
  ------------------
  |  |  177|  44.9k|	do { \
  |  |  178|  44.9k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  44.9k|			(allowed_states), (function_name)); \
  |  |  180|  44.9k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  44.9k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 44.9k]
  |  |  ------------------
  |  |  181|  44.9k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  44.9k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 44.9k]
  |  |  ------------------
  ------------------
 1259|  44.9k|	    ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
 1260|  44.9k|	    "__archive_read_register_format");
 1261|       |
 1262|  44.9k|	number_slots = sizeof(a->formats) / sizeof(a->formats[0]);
 1263|       |
 1264|   362k|	for (i = 0; i < number_slots; i++) {
  ------------------
  |  Branch (1264:14): [True: 362k, False: 0]
  ------------------
 1265|   362k|		if (a->formats[i].bid == bid)
  ------------------
  |  Branch (1265:7): [True: 4.99k, False: 357k]
  ------------------
 1266|  4.99k|			return (ARCHIVE_WARN); /* We've already installed */
  ------------------
  |  |  235|  4.99k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1267|   357k|		if (a->formats[i].bid == NULL) {
  ------------------
  |  Branch (1267:7): [True: 39.9k, False: 317k]
  ------------------
 1268|  39.9k|			a->formats[i].bid = bid;
 1269|  39.9k|			a->formats[i].options = options;
 1270|  39.9k|			a->formats[i].read_header = read_header;
 1271|  39.9k|			a->formats[i].read_data = read_data;
 1272|  39.9k|			a->formats[i].read_data_skip = read_data_skip;
 1273|  39.9k|			a->formats[i].seek_data = seek_data;
 1274|  39.9k|			a->formats[i].cleanup = cleanup;
 1275|  39.9k|			a->formats[i].data = format_data;
 1276|  39.9k|			a->formats[i].name = name;
 1277|  39.9k|			a->formats[i].format_capabilties = format_capabilities;
 1278|  39.9k|			a->formats[i].has_encrypted_entries = has_encrypted_entries;
 1279|  39.9k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  39.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1280|  39.9k|		}
 1281|   357k|	}
 1282|       |
 1283|      0|	archive_set_error(&a->archive, ENOMEM,
 1284|      0|	    "Not enough slots for format registration");
 1285|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1286|  44.9k|}
__archive_read_register_bidder:
 1297|  32.4k|{
 1298|  32.4k|	struct archive_read_filter_bidder *bidder;
 1299|  32.4k|	int i, number_slots;
 1300|       |
 1301|  32.4k|	archive_check_magic(&a->archive, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|  32.4k|	do { \
  |  |  178|  32.4k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  32.4k|			(allowed_states), (function_name)); \
  |  |  180|  32.4k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  32.4k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 32.4k]
  |  |  ------------------
  |  |  181|  32.4k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  32.4k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 32.4k]
  |  |  ------------------
  ------------------
 1302|  32.4k|	    ARCHIVE_STATE_NEW, "__archive_read_register_bidder");
 1303|       |
 1304|  32.4k|	number_slots = sizeof(a->bidders) / sizeof(a->bidders[0]);
 1305|       |
 1306|   227k|	for (i = 0; i < number_slots; i++) {
  ------------------
  |  Branch (1306:14): [True: 227k, False: 0]
  ------------------
 1307|   227k|		if (a->bidders[i].vtable != NULL)
  ------------------
  |  Branch (1307:7): [True: 194k, False: 32.4k]
  ------------------
 1308|   194k|			continue;
 1309|  32.4k|		memset(a->bidders + i, 0, sizeof(a->bidders[0]));
 1310|  32.4k|		bidder = (a->bidders + i);
 1311|  32.4k|		bidder->data = bidder_data;
 1312|  32.4k|		bidder->name = name;
 1313|  32.4k|		bidder->vtable = vtable;
 1314|  32.4k|		if (bidder->vtable->bid == NULL || bidder->vtable->init == NULL) {
  ------------------
  |  Branch (1314:7): [True: 0, False: 32.4k]
  |  Branch (1314:38): [True: 0, False: 32.4k]
  ------------------
 1315|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1316|      0|					"Internal error: "
 1317|      0|					"no bid/init for filter bidder");
 1318|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1319|      0|		}
 1320|       |
 1321|  32.4k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  32.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1322|  32.4k|	}
 1323|       |
 1324|      0|	archive_set_error(&a->archive, ENOMEM,
 1325|      0|	    "Not enough slots for filter registration");
 1326|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1327|  32.4k|}
__archive_read_ahead:
 1382|  12.3M|{
 1383|  12.3M|	return (__archive_read_filter_ahead(a->filter, min, avail));
 1384|  12.3M|}
__archive_read_filter_ahead:
 1389|  12.4M|{
 1390|  12.4M|	ssize_t bytes_read;
 1391|  12.4M|	size_t tocopy;
 1392|       |
 1393|  12.4M|	if (filter->fatal) {
  ------------------
  |  Branch (1393:6): [True: 609, False: 12.4M]
  ------------------
 1394|    609|		if (avail)
  ------------------
  |  Branch (1394:7): [True: 213, False: 396]
  ------------------
 1395|    213|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|    213|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1396|    609|		return (NULL);
 1397|    609|	}
 1398|       |
 1399|       |	/*
 1400|       |	 * Keep pulling more data until we can satisfy the request.
 1401|       |	 */
 1402|  12.4M|	for (;;) {
 1403|       |
 1404|       |		/*
 1405|       |		 * If we can satisfy from the copy buffer (and the
 1406|       |		 * copy buffer isn't empty), we're done.  In particular,
 1407|       |		 * note that min == 0 is a perfectly well-defined
 1408|       |		 * request.
 1409|       |		 */
 1410|  12.4M|		if (filter->avail >= min && filter->avail > 0) {
  ------------------
  |  Branch (1410:7): [True: 121k, False: 12.3M]
  |  Branch (1410:31): [True: 75.3k, False: 45.7k]
  ------------------
 1411|  75.3k|			if (avail != NULL)
  ------------------
  |  Branch (1411:8): [True: 12.2k, False: 63.1k]
  ------------------
 1412|  12.2k|				*avail = filter->avail;
 1413|  75.3k|			return (filter->next);
 1414|  75.3k|		}
 1415|       |
 1416|       |		/*
 1417|       |		 * We can satisfy directly from client buffer if everything
 1418|       |		 * currently in the copy buffer is still in the client buffer.
 1419|       |		 */
 1420|  12.3M|		if (filter->client_total >= filter->client_avail + filter->avail
  ------------------
  |  Branch (1420:7): [True: 12.3M, False: 11.1k]
  ------------------
 1421|  12.3M|		    && filter->client_avail + filter->avail >= min) {
  ------------------
  |  Branch (1421:10): [True: 12.3M, False: 13.4k]
  ------------------
 1422|       |			/* "Roll back" to client buffer. */
 1423|  12.3M|			filter->client_avail += filter->avail;
 1424|  12.3M|			filter->client_next -= filter->avail;
 1425|       |			/* Copy buffer is now empty. */
 1426|  12.3M|			filter->avail = 0;
 1427|  12.3M|			filter->next = filter->buffer;
 1428|       |			/* Return data from client buffer. */
 1429|  12.3M|			if (avail != NULL)
  ------------------
  |  Branch (1429:8): [True: 413k, False: 11.9M]
  ------------------
 1430|   413k|				*avail = filter->client_avail;
 1431|  12.3M|			return (filter->client_next);
 1432|  12.3M|		}
 1433|       |
 1434|       |		/* Move data forward in copy buffer if necessary. */
 1435|  24.5k|		if (filter->next > filter->buffer &&
  ------------------
  |  Branch (1435:7): [True: 3.28k, False: 21.2k]
  ------------------
 1436|  3.28k|		    min > filter->buffer_size - (filter->next - filter->buffer)) {
  ------------------
  |  Branch (1436:7): [True: 372, False: 2.91k]
  ------------------
 1437|    372|			if (filter->avail > 0)
  ------------------
  |  Branch (1437:8): [True: 370, False: 2]
  ------------------
 1438|    370|				memmove(filter->buffer, filter->next,
 1439|    370|				    filter->avail);
 1440|    372|			filter->next = filter->buffer;
 1441|    372|		}
 1442|       |
 1443|       |		/* If we've used up the client data, get more. */
 1444|  24.5k|		if (filter->client_avail <= 0) {
  ------------------
  |  Branch (1444:7): [True: 16.2k, False: 8.32k]
  ------------------
 1445|  16.2k|			if (filter->end_of_file) {
  ------------------
  |  Branch (1445:8): [True: 2.49k, False: 13.7k]
  ------------------
 1446|  2.49k|				if (avail != NULL)
  ------------------
  |  Branch (1446:9): [True: 1.85k, False: 641]
  ------------------
 1447|  1.85k|					*avail = filter->avail;
 1448|  2.49k|				return (NULL);
 1449|  2.49k|			}
 1450|  13.7k|			bytes_read = (filter->vtable->read)(filter,
 1451|  13.7k|			    &filter->client_buff);
 1452|  13.7k|			if (bytes_read < 0) {		/* Read error. */
  ------------------
  |  Branch (1452:8): [True: 100, False: 13.6k]
  ------------------
 1453|    100|				filter->client_total = filter->client_avail = 0;
 1454|    100|				filter->client_next =
 1455|    100|				    filter->client_buff = NULL;
 1456|    100|				filter->fatal = 1;
 1457|    100|				if (avail != NULL)
  ------------------
  |  Branch (1457:9): [True: 55, False: 45]
  ------------------
 1458|     55|					*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|     55|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1459|    100|				return (NULL);
 1460|    100|			}
 1461|  13.6k|			if (bytes_read == 0) {
  ------------------
  |  Branch (1461:8): [True: 2.44k, False: 11.1k]
  ------------------
 1462|       |				/* Check for another client object first */
 1463|  2.44k|				if (filter->archive->client.cursor !=
  ------------------
  |  Branch (1463:9): [True: 0, False: 2.44k]
  ------------------
 1464|  2.44k|				      filter->archive->client.nodes - 1) {
 1465|      0|					if (client_switch_proxy(filter,
  ------------------
  |  Branch (1465:10): [True: 0, False: 0]
  ------------------
 1466|      0|					    filter->archive->client.cursor + 1)
 1467|      0|					    == ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1468|      0|						continue;
 1469|      0|				}
 1470|       |				/* Premature end-of-file. */
 1471|  2.44k|				filter->client_total = filter->client_avail = 0;
 1472|  2.44k|				filter->client_next =
 1473|  2.44k|				    filter->client_buff = NULL;
 1474|  2.44k|				filter->end_of_file = 1;
 1475|       |				/* Return whatever we do have. */
 1476|  2.44k|				if (avail != NULL)
  ------------------
  |  Branch (1476:9): [True: 2.05k, False: 385]
  ------------------
 1477|  2.05k|					*avail = filter->avail;
 1478|  2.44k|				return (NULL);
 1479|  2.44k|			}
 1480|  11.1k|			filter->client_total = bytes_read;
 1481|  11.1k|			filter->client_avail = filter->client_total;
 1482|  11.1k|			filter->client_next = filter->client_buff;
 1483|  11.1k|		} else {
 1484|       |			/*
 1485|       |			 * We can't satisfy the request from the copy
 1486|       |			 * buffer or the existing client data, so we
 1487|       |			 * need to copy more client data over to the
 1488|       |			 * copy buffer.
 1489|       |			 */
 1490|       |
 1491|       |			/* Ensure the buffer is big enough. */
 1492|  8.32k|			if (min > filter->buffer_size) {
  ------------------
  |  Branch (1492:8): [True: 1.65k, False: 6.66k]
  ------------------
 1493|  1.65k|				size_t s;
 1494|  1.65k|				char *p;
 1495|       |
 1496|       |				/* Double the buffer; watch for overflow. */
 1497|  1.65k|				s = filter->buffer_size;
 1498|  1.65k|				if (s == 0)
  ------------------
  |  Branch (1498:9): [True: 1.59k, False: 64]
  ------------------
 1499|  1.59k|					s = min;
 1500|  1.88k|				while (s < min) {
  ------------------
  |  Branch (1500:12): [True: 222, False: 1.65k]
  ------------------
 1501|    222|					if (archive_ckd_mul_size(&s, s, 2)) {
  ------------------
  |  Branch (1501:10): [True: 0, False: 222]
  ------------------
 1502|       |						/* Integer overflow! */
 1503|      0|						archive_set_error(
 1504|      0|						    &filter->archive->archive,
 1505|      0|						    ENOMEM,
 1506|      0|						    "Unable to allocate copy"
 1507|      0|						    " buffer");
 1508|      0|						filter->fatal = 1;
 1509|      0|						if (avail != NULL)
  ------------------
  |  Branch (1509:11): [True: 0, False: 0]
  ------------------
 1510|      0|							*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1511|      0|						return (NULL);
 1512|      0|					}
 1513|    222|				}
 1514|       |				/* Now s >= min, so allocate a new buffer. */
 1515|  1.65k|				p = malloc(s);
 1516|  1.65k|				if (p == NULL) {
  ------------------
  |  Branch (1516:9): [True: 0, False: 1.65k]
  ------------------
 1517|      0|					archive_set_error(
 1518|      0|						&filter->archive->archive,
 1519|      0|						ENOMEM,
 1520|      0|					    "Unable to allocate copy buffer");
 1521|      0|					filter->fatal = 1;
 1522|      0|					if (avail != NULL)
  ------------------
  |  Branch (1522:10): [True: 0, False: 0]
  ------------------
 1523|      0|						*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1524|      0|					return (NULL);
 1525|      0|				}
 1526|       |				/* Move data into newly-enlarged buffer. */
 1527|  1.65k|				if (filter->avail > 0)
  ------------------
  |  Branch (1527:9): [True: 36, False: 1.62k]
  ------------------
 1528|     36|					memmove(p, filter->next, filter->avail);
 1529|  1.65k|				free(filter->buffer);
 1530|  1.65k|				filter->next = filter->buffer = p;
 1531|  1.65k|				filter->buffer_size = s;
 1532|  1.65k|			}
 1533|       |
 1534|       |			/* We can add client data to copy buffer. */
 1535|       |			/* First estimate: copy to fill rest of buffer. */
 1536|  8.32k|			tocopy = (filter->buffer + filter->buffer_size)
 1537|  8.32k|			    - (filter->next + filter->avail);
 1538|       |			/* Don't waste time buffering more than we need to. */
 1539|  8.32k|			if (tocopy + filter->avail > min)
  ------------------
  |  Branch (1539:8): [True: 4.94k, False: 3.37k]
  ------------------
 1540|  4.94k|				tocopy = min - filter->avail;
 1541|       |			/* Don't copy more than is available. */
 1542|  8.32k|			if (tocopy > filter->client_avail)
  ------------------
  |  Branch (1542:8): [True: 4.96k, False: 3.36k]
  ------------------
 1543|  4.96k|				tocopy = filter->client_avail;
 1544|       |
 1545|  8.32k|			memcpy(filter->next + filter->avail,
 1546|  8.32k|			    filter->client_next, tocopy);
 1547|       |			/* Remove this data from client buffer. */
 1548|  8.32k|			filter->client_next += tocopy;
 1549|  8.32k|			filter->client_avail -= tocopy;
 1550|       |			/* add it to copy buffer. */
 1551|  8.32k|			filter->avail += tocopy;
 1552|  8.32k|		}
 1553|  24.5k|	}
 1554|  12.4M|}
__archive_read_consume:
 1561|  12.4M|{
 1562|  12.4M|	return (__archive_read_filter_consume(a->filter, request));
 1563|  12.4M|}
__archive_read_filter_consume:
 1568|  12.4M|{
 1569|  12.4M|	int64_t skipped;
 1570|       |
 1571|  12.4M|	if (request < 0)
  ------------------
  |  Branch (1571:6): [True: 8, False: 12.4M]
  ------------------
 1572|      8|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1573|  12.4M|	if (request == 0)
  ------------------
  |  Branch (1573:6): [True: 233k, False: 12.2M]
  ------------------
 1574|   233k|		return 0;
 1575|       |
 1576|  12.2M|	skipped = advance_file_pointer(filter, request);
 1577|  12.2M|	if (skipped == request)
  ------------------
  |  Branch (1577:6): [True: 12.2M, False: 432]
  ------------------
 1578|  12.2M|		return (skipped);
 1579|       |	/* We hit EOF before we satisfied the skip request. */
 1580|    432|	if (skipped < 0)  /* Map error code to 0 for error message below. */
  ------------------
  |  Branch (1580:6): [True: 4, False: 428]
  ------------------
 1581|      4|		skipped = 0;
 1582|    432|	archive_set_error(&filter->archive->archive,
 1583|    432|	    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    432|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1584|    432|	    "Truncated input file (needed %jd bytes, only %jd available)",
 1585|    432|	    (intmax_t)request, (intmax_t)skipped);
 1586|    432|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    432|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1587|  12.2M|}
__archive_read_seek:
 1684|  3.36k|{
 1685|  3.36k|	return __archive_read_filter_seek(a->filter, offset, whence);
 1686|  3.36k|}
__archive_read_filter_seek:
 1691|  3.36k|{
 1692|  3.36k|	struct archive_read_client *client;
 1693|  3.36k|	int64_t r;
 1694|  3.36k|	unsigned int cursor;
 1695|       |
 1696|  3.36k|	if (filter->closed || filter->fatal)
  ------------------
  |  Branch (1696:6): [True: 0, False: 3.36k]
  |  Branch (1696:24): [True: 17, False: 3.34k]
  ------------------
 1697|     17|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     17|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1698|  3.34k|	if (filter->can_seek == 0)
  ------------------
  |  Branch (1698:6): [True: 58, False: 3.28k]
  ------------------
 1699|     58|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     58|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1700|       |
 1701|  3.28k|	client = &(filter->archive->client);
 1702|  3.28k|	switch (whence) {
 1703|      0|	case SEEK_CUR:
  ------------------
  |  Branch (1703:2): [True: 0, False: 3.28k]
  ------------------
 1704|       |		/* Adjust the offset and use SEEK_SET instead */
 1705|      0|		offset += filter->position;
 1706|      0|		__LA_FALLTHROUGH;
 1707|    797|	case SEEK_SET:
  ------------------
  |  Branch (1707:2): [True: 797, False: 2.48k]
  ------------------
 1708|    797|		cursor = 0;
 1709|    797|		while (1)
  ------------------
  |  Branch (1709:10): [True: 797, Folded]
  ------------------
 1710|    797|		{
 1711|    797|			if (client->dataset[cursor].begin_position < 0 ||
  ------------------
  |  Branch (1711:8): [True: 0, False: 797]
  ------------------
 1712|    797|			    client->dataset[cursor].total_size < 0 ||
  ------------------
  |  Branch (1712:8): [True: 149, False: 648]
  ------------------
 1713|    648|			    client->dataset[cursor].begin_position +
  ------------------
  |  Branch (1713:8): [True: 648, False: 0]
  ------------------
 1714|    648|			      client->dataset[cursor].total_size - 1 > offset ||
 1715|      0|			    cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1715:8): [True: 0, False: 0]
  ------------------
 1716|    797|				break;
 1717|      0|			r = client->dataset[cursor].begin_position +
 1718|      0|				client->dataset[cursor].total_size;
 1719|      0|			client->dataset[++cursor].begin_position = r;
 1720|      0|		}
 1721|    797|		while (1) {
  ------------------
  |  Branch (1721:10): [True: 797, Folded]
  ------------------
 1722|    797|			r = client_switch_proxy(filter, cursor);
 1723|    797|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    797|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1723:8): [True: 0, False: 797]
  ------------------
 1724|      0|				return r;
 1725|    797|			if ((r = client_seek_proxy(filter, 0, SEEK_END)) < 0)
  ------------------
  |  Branch (1725:8): [True: 0, False: 797]
  ------------------
 1726|      0|				return r;
 1727|    797|			client->dataset[cursor].total_size = r;
 1728|    797|			if (client->dataset[cursor].begin_position +
  ------------------
  |  Branch (1728:8): [True: 794, False: 3]
  ------------------
 1729|    797|			    client->dataset[cursor].total_size - 1 > offset ||
 1730|      3|			    cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1730:8): [True: 3, False: 0]
  ------------------
 1731|    797|				break;
 1732|      0|			r = client->dataset[cursor].begin_position +
 1733|      0|				client->dataset[cursor].total_size;
 1734|      0|			client->dataset[++cursor].begin_position = r;
 1735|      0|		}
 1736|    797|		offset -= client->dataset[cursor].begin_position;
 1737|    797|		if (offset < 0
  ------------------
  |  Branch (1737:7): [True: 0, False: 797]
  ------------------
 1738|    797|		    || offset > client->dataset[cursor].total_size)
  ------------------
  |  Branch (1738:10): [True: 3, False: 794]
  ------------------
 1739|      3|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1740|    794|		if ((r = client_seek_proxy(filter, offset, SEEK_SET)) < 0)
  ------------------
  |  Branch (1740:7): [True: 0, False: 794]
  ------------------
 1741|      0|			return r;
 1742|    794|		break;
 1743|       |
 1744|  2.48k|	case SEEK_END:
  ------------------
  |  Branch (1744:2): [True: 2.48k, False: 797]
  ------------------
 1745|  2.48k|		cursor = 0;
 1746|  2.48k|		while (1) {
  ------------------
  |  Branch (1746:10): [True: 2.48k, Folded]
  ------------------
 1747|  2.48k|			if (client->dataset[cursor].begin_position < 0 ||
  ------------------
  |  Branch (1747:8): [True: 0, False: 2.48k]
  ------------------
 1748|  2.48k|			    client->dataset[cursor].total_size < 0 ||
  ------------------
  |  Branch (1748:8): [True: 1.23k, False: 1.25k]
  ------------------
 1749|  1.25k|			    cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1749:8): [True: 1.25k, False: 0]
  ------------------
 1750|  2.48k|				break;
 1751|      0|			r = client->dataset[cursor].begin_position +
 1752|      0|				client->dataset[cursor].total_size;
 1753|      0|			client->dataset[++cursor].begin_position = r;
 1754|      0|		}
 1755|  2.48k|		while (1) {
  ------------------
  |  Branch (1755:10): [True: 2.48k, Folded]
  ------------------
 1756|  2.48k|			r = client_switch_proxy(filter, cursor);
 1757|  2.48k|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.48k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1757:8): [True: 0, False: 2.48k]
  ------------------
 1758|      0|				return r;
 1759|  2.48k|			if ((r = client_seek_proxy(filter, 0, SEEK_END)) < 0)
  ------------------
  |  Branch (1759:8): [True: 0, False: 2.48k]
  ------------------
 1760|      0|				return r;
 1761|  2.48k|			client->dataset[cursor].total_size = r;
 1762|  2.48k|			r = client->dataset[cursor].begin_position +
 1763|  2.48k|				client->dataset[cursor].total_size;
 1764|  2.48k|			if (cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1764:8): [True: 2.48k, False: 0]
  ------------------
 1765|  2.48k|				break;
 1766|      0|			client->dataset[++cursor].begin_position = r;
 1767|      0|		}
 1768|  2.48k|		while (1) {
  ------------------
  |  Branch (1768:10): [True: 2.48k, Folded]
  ------------------
 1769|  2.48k|			if (r + offset >=
  ------------------
  |  Branch (1769:8): [True: 2.48k, False: 0]
  ------------------
 1770|  2.48k|			    client->dataset[cursor].begin_position)
 1771|  2.48k|				break;
 1772|      0|			offset += client->dataset[cursor].total_size;
 1773|      0|			if (cursor == 0)
  ------------------
  |  Branch (1773:8): [True: 0, False: 0]
  ------------------
 1774|      0|				break;
 1775|      0|			cursor--;
 1776|      0|			r = client->dataset[cursor].begin_position +
 1777|      0|				client->dataset[cursor].total_size;
 1778|      0|		}
 1779|  2.48k|		offset = (r + offset) - client->dataset[cursor].begin_position;
 1780|  2.48k|		if ((r = client_switch_proxy(filter, cursor)) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.48k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1780:7): [True: 0, False: 2.48k]
  ------------------
 1781|      0|			return r;
 1782|  2.48k|		r = client_seek_proxy(filter, offset, SEEK_SET);
 1783|  2.48k|		if (r < ARCHIVE_OK)
  ------------------
  |  |  233|  2.48k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1783:7): [True: 0, False: 2.48k]
  ------------------
 1784|      0|			return r;
 1785|  2.48k|		break;
 1786|       |
 1787|  2.48k|	default:
  ------------------
  |  Branch (1787:2): [True: 0, False: 3.28k]
  ------------------
 1788|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1789|  3.28k|	}
 1790|  3.28k|	r += client->dataset[cursor].begin_position;
 1791|       |
 1792|  3.28k|	if (r >= 0) {
  ------------------
  |  Branch (1792:6): [True: 3.28k, False: 0]
  ------------------
 1793|       |		/*
 1794|       |		 * Ouch.  Clearing the buffer like this hurts, especially
 1795|       |		 * at bid time.  A lot of our efficiency at bid time comes
 1796|       |		 * from having bidders reuse the data we've already read.
 1797|       |		 *
 1798|       |		 * TODO: If the seek request is in data we already
 1799|       |		 * have, then don't call the seek callback.
 1800|       |		 *
 1801|       |		 * TODO: Zip seeks to end-of-file at bid time.  If
 1802|       |		 * other formats also start doing this, we may need to
 1803|       |		 * find a way for clients to fudge the seek offset to
 1804|       |		 * a block boundary.
 1805|       |		 *
 1806|       |		 * Hmmm... If whence was SEEK_END, we know the file
 1807|       |		 * size is (r - offset).  Can we use that to simplify
 1808|       |		 * the TODO items above?
 1809|       |		 */
 1810|  3.28k|		filter->avail = filter->client_avail = 0;
 1811|  3.28k|		filter->next = filter->buffer;
 1812|  3.28k|		filter->position = r;
 1813|  3.28k|		filter->end_of_file = 0;
 1814|  3.28k|	}
 1815|  3.28k|	return r;
 1816|  3.28k|}
archive_read.c:_archive_read_free:
 1132|  2.49k|{
 1133|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
 1134|  2.49k|	struct archive_read_passphrase *p;
 1135|  2.49k|	int i, n;
 1136|  2.49k|	int slots;
 1137|  2.49k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1138|       |
 1139|  2.49k|	if (_a == NULL)
  ------------------
  |  Branch (1139:6): [True: 0, False: 2.49k]
  ------------------
 1140|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1141|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|  2.49k|	do { \
  |  |  178|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  2.49k|			(allowed_states), (function_name)); \
  |  |  180|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  181|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
 1142|  2.49k|	    ARCHIVE_STATE_ANY | ARCHIVE_STATE_FATAL, "archive_read_free");
 1143|  2.49k|	if (a->archive.state != ARCHIVE_STATE_CLOSED
  ------------------
  |  |   91|  4.99k|#define	ARCHIVE_STATE_CLOSED	0x20U
  ------------------
  |  Branch (1143:6): [True: 2.49k, False: 0]
  ------------------
 1144|  2.49k|	    && a->archive.state != ARCHIVE_STATE_FATAL)
  ------------------
  |  |   94|  2.49k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  |  Branch (1144:9): [True: 0, False: 2.49k]
  ------------------
 1145|      0|		r = archive_read_close(&a->archive);
 1146|       |
 1147|       |	/* Call cleanup functions registered by optional components. */
 1148|  2.49k|	if (a->cleanup_archive_extract != NULL)
  ------------------
  |  Branch (1148:6): [True: 0, False: 2.49k]
  ------------------
 1149|      0|		r = (a->cleanup_archive_extract)(a);
 1150|       |
 1151|       |	/* Cleanup format-specific data. */
 1152|  2.49k|	slots = sizeof(a->formats) / sizeof(a->formats[0]);
 1153|  42.4k|	for (i = 0; i < slots; i++) {
  ------------------
  |  Branch (1153:14): [True: 39.9k, False: 2.49k]
  ------------------
 1154|  39.9k|		a->format = &(a->formats[i]);
 1155|  39.9k|		if (a->formats[i].cleanup)
  ------------------
  |  Branch (1155:7): [True: 37.4k, False: 2.49k]
  ------------------
 1156|  37.4k|			(a->formats[i].cleanup)(a);
 1157|  39.9k|	}
 1158|       |
 1159|       |	/* Free the filters */
 1160|  2.49k|	__archive_read_free_filters(a);
 1161|       |
 1162|       |	/* Release the bidder objects. */
 1163|  2.49k|	n = sizeof(a->bidders)/sizeof(a->bidders[0]);
 1164|  42.4k|	for (i = 0; i < n; i++) {
  ------------------
  |  Branch (1164:14): [True: 39.9k, False: 2.49k]
  ------------------
 1165|  39.9k|		if (a->bidders[i].vtable == NULL ||
  ------------------
  |  Branch (1165:7): [True: 7.49k, False: 32.4k]
  ------------------
 1166|  32.4k|		    a->bidders[i].vtable->free == NULL)
  ------------------
  |  Branch (1166:7): [True: 32.4k, False: 0]
  ------------------
 1167|  39.9k|			continue;
 1168|      0|		(a->bidders[i].vtable->free)(&a->bidders[i]);
 1169|      0|	}
 1170|       |
 1171|       |	/* Release passphrase list. */
 1172|  2.49k|	p = a->passphrases.first;
 1173|  4.99k|	while (p != NULL) {
  ------------------
  |  Branch (1173:9): [True: 2.49k, False: 2.49k]
  ------------------
 1174|  2.49k|		struct archive_read_passphrase *np = p->next;
 1175|       |
 1176|       |		/* A passphrase should be cleaned. */
 1177|  2.49k|		memset(p->passphrase, 0, strlen(p->passphrase));
 1178|  2.49k|		free(p->passphrase);
 1179|  2.49k|		free(p);
 1180|  2.49k|		p = np;
 1181|  2.49k|	}
 1182|       |
 1183|  2.49k|	archive_string_free(&a->archive.error_string);
 1184|  2.49k|	archive_entry_free(a->entry);
 1185|  2.49k|	a->archive.magic = 0;
 1186|  2.49k|	__archive_clean(&a->archive);
 1187|  2.49k|	free(a->client.dataset);
 1188|  2.49k|	free(a);
 1189|  2.49k|	return (r);
 1190|  2.49k|}
archive_read.c:_archive_read_next_header:
  724|   297k|{
  725|   297k|	int ret;
  726|   297k|	struct archive_read *a = (struct archive_read *)_a;
  727|       |	*entryp = NULL;
  728|   297k|	ret = _archive_read_next_header2(_a, a->entry);
  729|   297k|	*entryp = a->entry;
  730|   297k|	return ret;
  731|   297k|}
archive_read.c:_archive_read_next_header2:
  637|   297k|{
  638|   297k|	struct archive_read *a = (struct archive_read *)_a;
  639|   297k|	int r1 = ARCHIVE_OK, r2;
  ------------------
  |  |  233|   297k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  640|       |
  641|   297k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|   297k|	do { \
  |  |  178|   297k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|   297k|			(allowed_states), (function_name)); \
  |  |  180|   297k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|   297k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 297k]
  |  |  ------------------
  |  |  181|   297k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|   297k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 297k]
  |  |  ------------------
  ------------------
  642|   297k|	    ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA |
  643|   297k|	    ARCHIVE_STATE_DATA_RECOVERY,
  644|   297k|	    "archive_read_next_header");
  645|       |
  646|   297k|	archive_entry_clear(entry);
  647|   297k|	archive_clear_error(&a->archive);
  648|       |
  649|       |	/*
  650|       |	 * If client didn't consume entire data, skip any remainder
  651|       |	 * (This is especially important for GNU incremental directories.)
  652|       |	 * A header that failed to parse (DATA_RECOVERY) still needs the
  653|       |	 * same treatment: whatever of its body the format reader left
  654|       |	 * unconsumed must be skipped before we can read the next header.
  655|       |	 */
  656|   297k|	if (a->archive.state == ARCHIVE_STATE_DATA ||
  ------------------
  |  |   82|   595k|#define	ARCHIVE_STATE_DATA	4U
  ------------------
  |  Branch (656:6): [True: 83.1k, False: 214k]
  ------------------
  657|   214k|	    a->archive.state == ARCHIVE_STATE_DATA_RECOVERY) {
  ------------------
  |  |   86|   214k|#define	ARCHIVE_STATE_DATA_RECOVERY	8U
  ------------------
  |  Branch (657:6): [True: 0, False: 214k]
  ------------------
  658|  83.1k|		r1 = archive_read_data_skip(&a->archive);
  659|  83.1k|		if (r1 == ARCHIVE_EOF)
  ------------------
  |  |  232|  83.1k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (659:7): [True: 0, False: 83.1k]
  ------------------
  660|      0|			archive_set_error(&a->archive, EIO,
  661|      0|			    "Premature end-of-file");
  662|  83.1k|		if (r1 == ARCHIVE_EOF || r1 == ARCHIVE_FATAL) {
  ------------------
  |  |  232|   166k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
              		if (r1 == ARCHIVE_EOF || r1 == ARCHIVE_FATAL) {
  ------------------
  |  |  239|  83.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (662:7): [True: 0, False: 83.1k]
  |  Branch (662:28): [True: 259, False: 82.8k]
  ------------------
  663|    259|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   94|    259|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  664|    259|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    259|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  665|    259|		}
  666|  83.1k|	}
  667|       |
  668|       |	/* Record start-of-header offset in uncompressed stream. */
  669|   297k|	a->header_position = a->filter->position;
  670|       |
  671|   297k|	++_a->file_count;
  672|   297k|	r2 = (a->format->read_header)(a, entry);
  673|       |
  674|       |	/*
  675|       |	 * EOF and FATAL are persistent at this layer.  By
  676|       |	 * modifying the state, we guarantee that future calls to
  677|       |	 * read a header or read data will fail.
  678|       |	 */
  679|   297k|	switch (r2) {
  ------------------
  |  Branch (679:10): [True: 297k, False: 0]
  ------------------
  680|    307|	case ARCHIVE_EOF:
  ------------------
  |  |  232|    307|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (680:2): [True: 307, False: 297k]
  ------------------
  681|    307|		a->archive.state = ARCHIVE_STATE_EOF;
  ------------------
  |  |   89|    307|#define	ARCHIVE_STATE_EOF	0x10U
  ------------------
  682|    307|		--_a->file_count;/* Revert a file counter. */
  683|    307|		break;
  684|  70.1k|	case ARCHIVE_OK:
  ------------------
  |  |  233|  70.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (684:2): [True: 70.1k, False: 227k]
  ------------------
  685|  70.1k|		a->archive.state = ARCHIVE_STATE_DATA;
  ------------------
  |  |   82|  70.1k|#define	ARCHIVE_STATE_DATA	4U
  ------------------
  686|  70.1k|		break;
  687|  13.3k|	case ARCHIVE_WARN:
  ------------------
  |  |  235|  13.3k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (687:2): [True: 13.3k, False: 284k]
  ------------------
  688|  13.3k|		a->archive.state = ARCHIVE_STATE_DATA;
  ------------------
  |  |   82|  13.3k|#define	ARCHIVE_STATE_DATA	4U
  ------------------
  689|  13.3k|		break;
  690|   212k|	case ARCHIVE_RETRY:
  ------------------
  |  |  234|   212k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (690:2): [True: 212k, False: 85.2k]
  ------------------
  691|   212k|		break;
  692|  1.48k|	case ARCHIVE_FATAL:
  ------------------
  |  |  239|  1.48k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (692:2): [True: 1.48k, False: 296k]
  ------------------
  693|  1.48k|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   94|  1.48k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  694|  1.48k|		break;
  695|      1|	case ARCHIVE_FAILED:
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (695:2): [True: 1, False: 297k]
  ------------------
  696|       |		/*
  697|       |		 * This entry's header could not be parsed, so its metadata
  698|       |		 * cannot be trusted.  ARCHIVE_STATE_DATA_RECOVERY still
  699|       |		 * permits skipping past it (the format reader is
  700|       |		 * responsible for ensuring that's actually possible), but
  701|       |		 * blocks archive_read_data() and friends, which all check
  702|       |		 * for ARCHIVE_STATE_DATA specifically and would otherwise
  703|       |		 * return content for an entry we don't actually understand.
  704|       |		 */
  705|      1|		a->archive.state = ARCHIVE_STATE_DATA_RECOVERY;
  ------------------
  |  |   86|      1|#define	ARCHIVE_STATE_DATA_RECOVERY	8U
  ------------------
  706|      1|		break;
  707|   297k|	}
  708|       |
  709|   297k|	if (r2 == ARCHIVE_OK || r2 == ARCHIVE_WARN)
  ------------------
  |  |  233|   595k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	if (r2 == ARCHIVE_OK || r2 == ARCHIVE_WARN)
  ------------------
  |  |  235|   227k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (709:6): [True: 70.1k, False: 227k]
  |  Branch (709:26): [True: 13.3k, False: 214k]
  ------------------
  710|  83.5k|		a->entry_bytes_declared = archive_entry_size_is_set(entry)
  ------------------
  |  Branch (710:29): [True: 76.1k, False: 7.39k]
  ------------------
  711|  83.5k|		    ? archive_entry_size(entry) : -1;
  712|   214k|	else
  713|   214k|		a->entry_bytes_declared = -1;
  714|       |
  715|   297k|	__archive_reset_read_data(&a->archive);
  716|       |
  717|   297k|	a->data_start_node = a->client.cursor;
  718|       |	/* EOF always wins; otherwise return the worst error. */
  719|   297k|	return (r2 < r1 || r2 == ARCHIVE_EOF) ? r2 : r1;
  ------------------
  |  |  232|  70.6k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (719:10): [True: 226k, False: 70.6k]
  |  Branch (719:21): [True: 307, False: 70.3k]
  ------------------
  720|   297k|}
archive_read.c:_archive_read_data_block:
 1030|   154k|{
 1031|   154k|	struct archive_read *a = (struct archive_read *)_a;
 1032|   154k|	int r;
 1033|       |
 1034|   154k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_DATA,
  ------------------
  |  |  177|   154k|	do { \
  |  |  178|   154k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|   154k|			(allowed_states), (function_name)); \
  |  |  180|   154k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|   154k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 1, False: 154k]
  |  |  ------------------
  |  |  181|   154k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|   154k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 154k]
  |  |  ------------------
  ------------------
 1035|   154k|	    "archive_read_data_block");
 1036|       |
 1037|   154k|	if (a->format->read_data == NULL) {
  ------------------
  |  Branch (1037:6): [True: 0, False: 154k]
  ------------------
 1038|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1039|      0|		    "Internal error: "
 1040|      0|		    "No format->read_data function registered");
 1041|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   94|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
 1042|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1043|      0|	}
 1044|       |
 1045|   154k|	r = (a->format->read_data)(a, buff, size, offset);
 1046|   154k|	if (r == ARCHIVE_FATAL)
  ------------------
  |  |  239|   154k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1046:6): [True: 391, False: 153k]
  ------------------
 1047|    391|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   94|    391|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
 1048|   154k|	return (r);
 1049|   154k|}
archive_read.c:_archive_filter_bytes:
 1233|    263|{
 1234|    263|	struct archive_read_filter *f = get_filter(_a, n);
 1235|    263|	return f == NULL ? -1 : f->position;
  ------------------
  |  Branch (1235:9): [True: 0, False: 263]
  ------------------
 1236|    263|}
archive_read.c:get_filter:
 1194|    263|{
 1195|    263|	struct archive_read *a = (struct archive_read *)_a;
 1196|    263|	struct archive_read_filter *f = a->filter;
 1197|       |	/* We use n == -1 for 'the last filter', which is always the
 1198|       |	 * client proxy. */
 1199|    263|	if (n == -1 && f != NULL) {
  ------------------
  |  Branch (1199:6): [True: 0, False: 263]
  |  Branch (1199:17): [True: 0, False: 0]
  ------------------
 1200|      0|		struct archive_read_filter *last = f;
 1201|      0|		f = f->upstream;
 1202|      0|		while (f != NULL) {
  ------------------
  |  Branch (1202:10): [True: 0, False: 0]
  ------------------
 1203|      0|			last = f;
 1204|      0|			f = f->upstream;
 1205|      0|		}
 1206|      0|		return (last);
 1207|      0|	}
 1208|    263|	if (n < 0)
  ------------------
  |  Branch (1208:6): [True: 0, False: 263]
  ------------------
 1209|      0|		return NULL;
 1210|    263|	while (n > 0 && f != NULL) {
  ------------------
  |  Branch (1210:9): [True: 0, False: 263]
  |  Branch (1210:18): [True: 0, False: 0]
  ------------------
 1211|      0|		f = f->upstream;
 1212|      0|		--n;
 1213|      0|	}
 1214|    263|	return (f);
 1215|    263|}
archive_read.c:read_client_close_proxy:
  250|  2.49k|{
  251|  2.49k|	int r = ARCHIVE_OK, r2;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  252|  2.49k|	unsigned int i;
  253|       |
  254|  2.49k|	if (a->client.closer == NULL)
  ------------------
  |  Branch (254:6): [True: 0, False: 2.49k]
  ------------------
  255|      0|		return (r);
  256|  4.99k|	for (i = 0; i < a->client.nodes; i++)
  ------------------
  |  Branch (256:14): [True: 2.49k, False: 2.49k]
  ------------------
  257|  2.49k|	{
  258|  2.49k|		r2 = (a->client.closer)
  259|  2.49k|			((struct archive *)a, a->client.dataset[i].data);
  260|  2.49k|		if (r > r2)
  ------------------
  |  Branch (260:7): [True: 0, False: 2.49k]
  ------------------
  261|      0|			r = r2;
  262|  2.49k|	}
  263|  2.49k|	return (r);
  264|  2.49k|}
archive_read.c:client_read_proxy:
  180|  7.16k|{
  181|  7.16k|	ssize_t r;
  182|  7.16k|	r = (self->archive->client.reader)(&self->archive->archive,
  183|  7.16k|	    self->data, buff);
  184|  7.16k|	return (r);
  185|  7.16k|}
archive_read.c:client_close_proxy:
  268|  2.49k|{
  269|  2.49k|	return read_client_close_proxy(self->archive);
  270|  2.49k|}
archive_read.c:client_switch_proxy:
  274|  8.21k|{
  275|  8.21k|	struct archive_read *a;
  276|  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. */
  ------------------
  277|  8.21k|	void *data2;
  278|       |
  279|  8.50k|	while (self->upstream != NULL)
  ------------------
  |  Branch (279:9): [True: 287, False: 8.21k]
  ------------------
  280|    287|		self = self->upstream;
  281|  8.21k|	a = self->archive;
  282|       |
  283|       |	/* Don't do anything if already in the specified data node */
  284|  8.21k|	if (a->client.cursor == iindex)
  ------------------
  |  Branch (284:6): [True: 8.21k, False: 0]
  ------------------
  285|  8.21k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  8.21k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  286|       |
  287|      0|	a->client.cursor = iindex;
  288|      0|	data2 = a->client.dataset[a->client.cursor].data;
  289|      0|	if (a->client.switcher != NULL)
  ------------------
  |  Branch (289:6): [True: 0, False: 0]
  ------------------
  290|      0|	{
  291|      0|		r1 = r2 = (a->client.switcher)
  292|      0|			((struct archive *)a, self->data, data2);
  293|      0|		self->data = data2;
  294|      0|	}
  295|      0|	else
  296|      0|	{
  297|       |		/* Attempt to call close and open instead */
  298|      0|		if (a->client.closer != NULL)
  ------------------
  |  Branch (298:7): [True: 0, False: 0]
  ------------------
  299|      0|			r1 = (a->client.closer)
  300|      0|				((struct archive *)a, self->data);
  301|      0|		self->data = data2;
  302|      0|		if (a->client.opener != NULL)
  ------------------
  |  Branch (302:7): [True: 0, False: 0]
  ------------------
  303|      0|			r2 = (a->client.opener)
  304|      0|				((struct archive *)a, self->data);
  305|      0|	}
  306|      0|	return (r1 < r2) ? r1 : r2;
  ------------------
  |  Branch (306:9): [True: 0, False: 0]
  ------------------
  307|  8.21k|}
archive_read.c:choose_filters:
  571|  2.49k|{
  572|  2.49k|	int number_bidders, i, bid, best_bid, number_filters;
  573|  2.49k|	struct archive_read_filter_bidder *bidder, *best_bidder;
  574|  2.49k|	struct archive_read_filter *filter;
  575|  2.49k|	ssize_t avail;
  576|  2.49k|	int r;
  577|       |
  578|  2.86k|	for (number_filters = 0; number_filters < MAX_NUMBER_FILTERS; ++number_filters) {
  ------------------
  |  |  567|  2.86k|#define MAX_NUMBER_FILTERS 25
  ------------------
  |  Branch (578:27): [True: 2.86k, False: 0]
  ------------------
  579|  2.86k|		number_bidders = sizeof(a->bidders) / sizeof(a->bidders[0]);
  580|       |
  581|  2.86k|		best_bid = 0;
  582|  2.86k|		best_bidder = NULL;
  583|       |
  584|  2.86k|		bidder = a->bidders;
  585|  48.6k|		for (i = 0; i < number_bidders; i++, bidder++) {
  ------------------
  |  Branch (585:15): [True: 45.8k, False: 2.86k]
  ------------------
  586|  45.8k|			if (bidder->vtable == NULL)
  ------------------
  |  Branch (586:8): [True: 8.58k, False: 37.2k]
  ------------------
  587|  8.58k|				continue;
  588|  37.2k|			bid = (bidder->vtable->bid)(bidder, a->filter);
  589|  37.2k|			if (bid > best_bid) {
  ------------------
  |  Branch (589:8): [True: 364, False: 36.8k]
  ------------------
  590|    364|				best_bid = bid;
  591|    364|				best_bidder = bidder;
  592|    364|			}
  593|  37.2k|		}
  594|       |
  595|       |		/* If no bidder, we're done. */
  596|  2.86k|		if (best_bidder == NULL) {
  ------------------
  |  Branch (596:7): [True: 2.49k, False: 364]
  ------------------
  597|       |			/* Verify the filter by asking it for some data. */
  598|  2.49k|			__archive_read_filter_ahead(a->filter, 1, &avail);
  599|  2.49k|			if (avail < 0) {
  ------------------
  |  Branch (599:8): [True: 41, False: 2.45k]
  ------------------
  600|     41|				__archive_read_free_filters(a);
  601|     41|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     41|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  602|     41|			}
  603|  2.45k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.45k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  604|  2.49k|		}
  605|       |
  606|    364|		filter = calloc(1, sizeof(*filter));
  607|    364|		if (filter == NULL)
  ------------------
  |  Branch (607:7): [True: 0, False: 364]
  ------------------
  608|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  609|    364|		filter->bidder = best_bidder;
  610|    364|		filter->archive = a;
  611|    364|		filter->upstream = a->filter;
  612|    364|		a->filter = filter;
  613|    364|		r = (best_bidder->vtable->init)(a->filter);
  614|    364|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|    364|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (614:7): [True: 0, False: 364]
  ------------------
  615|      0|			__archive_read_free_filters(a);
  616|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  617|      0|		}
  618|    364|	}
  619|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  620|      0|	    "Input requires too many filters for decoding");
  621|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  622|  2.49k|}
archive_read.c:choose_format:
  739|  2.45k|{
  740|  2.45k|	int slots;
  741|  2.45k|	int i;
  742|  2.45k|	int bid, best_bid;
  743|  2.45k|	int best_bid_slot;
  744|       |
  745|  2.45k|	slots = sizeof(a->formats) / sizeof(a->formats[0]);
  746|  2.45k|	best_bid = -1;
  747|  2.45k|	best_bid_slot = -1;
  748|       |
  749|       |	/* Set up a->format for convenience of bidders. */
  750|  2.45k|	a->format = &(a->formats[0]);
  751|  41.7k|	for (i = 0; i < slots; i++, a->format++) {
  ------------------
  |  Branch (751:14): [True: 39.3k, False: 2.45k]
  ------------------
  752|  39.3k|		if (a->format->bid) {
  ------------------
  |  Branch (752:7): [True: 39.3k, False: 0]
  ------------------
  753|  39.3k|			bid = (a->format->bid)(a, best_bid);
  754|  39.3k|			if (bid == ARCHIVE_FATAL)
  ------------------
  |  |  239|  39.3k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (754:8): [True: 0, False: 39.3k]
  ------------------
  755|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  756|  39.3k|			if (a->filter->position != 0)
  ------------------
  |  Branch (756:8): [True: 545, False: 38.7k]
  ------------------
  757|    545|				__archive_read_seek(a, 0, SEEK_SET);
  758|  39.3k|			if ((bid > best_bid) || (best_bid_slot < 0)) {
  ------------------
  |  Branch (758:8): [True: 4.94k, False: 34.3k]
  |  Branch (758:28): [True: 2.43k, False: 31.9k]
  ------------------
  759|  7.38k|				best_bid = bid;
  760|  7.38k|				best_bid_slot = i;
  761|  7.38k|			}
  762|  39.3k|		}
  763|  39.3k|	}
  764|       |
  765|       |	/*
  766|       |	 * There were no bidders; this is a serious programmer error
  767|       |	 * and demands a quick and definitive abort.
  768|       |	 */
  769|  2.45k|	if (best_bid_slot < 0) {
  ------------------
  |  Branch (769:6): [True: 0, False: 2.45k]
  ------------------
  770|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  771|      0|		    "No formats registered");
  772|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  773|      0|	}
  774|       |
  775|       |	/*
  776|       |	 * There were bidders, but no non-zero bids; this means we
  777|       |	 * can't support this stream.
  778|       |	 */
  779|  2.45k|	if (best_bid < 1) {
  ------------------
  |  Branch (779:6): [True: 17, False: 2.44k]
  ------------------
  780|     17|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     17|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  781|     17|		    "Unrecognized archive format");
  782|     17|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     17|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  783|     17|	}
  784|       |
  785|  2.44k|	return (best_bid_slot);
  786|  2.45k|}
archive_read.c:close_filters:
 1053|  2.55k|{
 1054|  2.55k|	struct archive_read_filter *f = a->filter;
 1055|  2.55k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  2.55k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1056|       |	/* Close each filter in the pipeline. */
 1057|  5.45k|	while (f != NULL) {
  ------------------
  |  Branch (1057:9): [True: 2.89k, False: 2.55k]
  ------------------
 1058|  2.89k|		struct archive_read_filter *t = f->upstream;
 1059|  2.89k|		if (!f->closed && f->vtable != NULL) {
  ------------------
  |  Branch (1059:7): [True: 2.86k, False: 35]
  |  Branch (1059:21): [True: 2.86k, False: 0]
  ------------------
 1060|  2.86k|			int r1 = (f->vtable->close)(f);
 1061|  2.86k|			f->closed = 1;
 1062|  2.86k|			if (r1 < r)
  ------------------
  |  Branch (1062:8): [True: 0, False: 2.86k]
  ------------------
 1063|      0|				r = r1;
 1064|  2.86k|		}
 1065|  2.89k|		free(f->buffer);
 1066|       |		f->buffer = NULL;
 1067|  2.89k|		f = t;
 1068|  2.89k|	}
 1069|  2.55k|	return r;
 1070|  2.55k|}
archive_read.c:advance_file_pointer:
 1597|  12.2M|{
 1598|  12.2M|	int64_t bytes_skipped, total_bytes_skipped = 0;
 1599|  12.2M|	ssize_t bytes_read;
 1600|  12.2M|	size_t min;
 1601|       |
 1602|  12.2M|	if (filter->fatal)
  ------------------
  |  Branch (1602:6): [True: 1, False: 12.2M]
  ------------------
 1603|      1|		return (-1);
 1604|       |
 1605|       |	/* Use up the copy buffer first. */
 1606|  12.2M|	if (filter->avail > 0) {
  ------------------
  |  Branch (1606:6): [True: 71.6k, False: 12.1M]
  ------------------
 1607|  71.6k|		min = (size_t)minimum(request, (int64_t)filter->avail);
  ------------------
  |  |   59|  71.6k|#define minimum(a, b) (a < b ? a : b)
  |  |  ------------------
  |  |  |  Branch (59:24): [True: 71.4k, False: 130]
  |  |  ------------------
  ------------------
 1608|  71.6k|		filter->next += min;
 1609|  71.6k|		filter->avail -= min;
 1610|  71.6k|		request -= min;
 1611|  71.6k|		filter->position += min;
 1612|  71.6k|		total_bytes_skipped += min;
 1613|  71.6k|	}
 1614|       |
 1615|       |	/* Then use up the client buffer. */
 1616|  12.2M|	if (filter->client_avail > 0) {
  ------------------
  |  Branch (1616:6): [True: 12.1M, False: 68.5k]
  ------------------
 1617|  12.1M|		min = (size_t)minimum(request, (int64_t)filter->client_avail);
  ------------------
  |  |   59|  12.1M|#define minimum(a, b) (a < b ? a : b)
  |  |  ------------------
  |  |  |  Branch (59:24): [True: 12.1M, False: 4.35k]
  |  |  ------------------
  ------------------
 1618|  12.1M|		filter->client_next += min;
 1619|  12.1M|		filter->client_avail -= min;
 1620|  12.1M|		request -= min;
 1621|  12.1M|		filter->position += min;
 1622|  12.1M|		total_bytes_skipped += min;
 1623|  12.1M|	}
 1624|  12.2M|	if (request == 0)
  ------------------
  |  Branch (1624:6): [True: 12.2M, False: 510]
  ------------------
 1625|  12.2M|		return (total_bytes_skipped);
 1626|       |
 1627|       |	/* If there's an optimized skip function, use it. */
 1628|    510|	if (filter->can_skip != 0) {
  ------------------
  |  Branch (1628:6): [True: 425, False: 85]
  ------------------
 1629|    425|		bytes_skipped = client_skip_proxy(filter, request);
 1630|    425|		if (bytes_skipped < 0) {	/* error */
  ------------------
  |  Branch (1630:7): [True: 0, False: 425]
  ------------------
 1631|      0|			filter->fatal = 1;
 1632|      0|			return (bytes_skipped);
 1633|      0|		}
 1634|    425|		filter->position += bytes_skipped;
 1635|    425|		total_bytes_skipped += bytes_skipped;
 1636|    425|		request -= bytes_skipped;
 1637|    425|		if (request == 0)
  ------------------
  |  Branch (1637:7): [True: 0, False: 425]
  ------------------
 1638|      0|			return (total_bytes_skipped);
 1639|    425|	}
 1640|       |
 1641|       |	/* Use ordinary reads as necessary to complete the request. */
 1642|    842|	for (;;) {
 1643|    842|		bytes_read = (filter->vtable->read)(filter, &filter->client_buff);
 1644|    842|		if (bytes_read < 0) {
  ------------------
  |  Branch (1644:7): [True: 3, False: 839]
  ------------------
 1645|      3|			filter->client_buff = NULL;
 1646|      3|			filter->fatal = 1;
 1647|      3|			return (bytes_read);
 1648|      3|		}
 1649|       |
 1650|    839|		if (bytes_read == 0) {
  ------------------
  |  Branch (1650:7): [True: 428, False: 411]
  ------------------
 1651|    428|			if (filter->archive->client.cursor !=
  ------------------
  |  Branch (1651:8): [True: 0, False: 428]
  ------------------
 1652|    428|			      filter->archive->client.nodes - 1) {
 1653|      0|				if (client_switch_proxy(filter,
  ------------------
  |  Branch (1653:9): [True: 0, False: 0]
  ------------------
 1654|      0|				    filter->archive->client.cursor + 1)
 1655|      0|				    == ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1656|      0|					continue;
 1657|      0|			}
 1658|    428|			filter->client_buff = NULL;
 1659|    428|			filter->end_of_file = 1;
 1660|    428|			return (total_bytes_skipped);
 1661|    428|		}
 1662|       |
 1663|    411|		if (bytes_read >= request) {
  ------------------
  |  Branch (1663:7): [True: 79, False: 332]
  ------------------
 1664|     79|			filter->client_next =
 1665|     79|			    ((const char *)filter->client_buff) + request;
 1666|     79|			filter->client_avail = (size_t)(bytes_read - request);
 1667|     79|			filter->client_total = bytes_read;
 1668|     79|			total_bytes_skipped += request;
 1669|     79|			filter->position += request;
 1670|     79|			return (total_bytes_skipped);
 1671|     79|		}
 1672|       |
 1673|    332|		filter->position += bytes_read;
 1674|    332|		total_bytes_skipped += bytes_read;
 1675|    332|		request -= bytes_read;
 1676|    332|	}
 1677|    510|}
archive_read.c:client_skip_proxy:
  189|    425|{
  190|    425|	if (request < 0)
  ------------------
  |  Branch (190:6): [True: 0, False: 425]
  ------------------
  191|      0|		__archive_errx(1, "Negative skip requested");
  192|    425|	if (request == 0)
  ------------------
  |  Branch (192:6): [True: 0, False: 425]
  ------------------
  193|      0|		return 0;
  194|       |
  195|    425|	if (self->archive->client.skipper != NULL) {
  ------------------
  |  Branch (195:6): [True: 425, False: 0]
  ------------------
  196|    425|		int64_t total = 0;
  197|    425|		for (;;) {
  198|    425|			int64_t get, ask = request;
  199|    425|			get = (self->archive->client.skipper)
  200|    425|				(&self->archive->archive, self->data, ask);
  201|    425|			total += get;
  202|    425|			if (get == 0 || get == request)
  ------------------
  |  Branch (202:8): [True: 425, False: 0]
  |  Branch (202:20): [True: 0, False: 0]
  ------------------
  203|    425|				return (total);
  204|      0|			if (get > request)
  ------------------
  |  Branch (204:8): [True: 0, False: 0]
  ------------------
  205|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  206|      0|			request -= get;
  207|      0|		}
  208|    425|	} else if (self->archive->client.seeker != NULL
  ------------------
  |  Branch (208:13): [True: 0, False: 0]
  ------------------
  209|      0|		&& request > 64 * 1024) {
  ------------------
  |  Branch (209:6): [True: 0, False: 0]
  ------------------
  210|       |		/* If the client provided a seeker but not a skipper,
  211|       |		 * we can use the seeker to skip forward.
  212|       |		 *
  213|       |		 * Note: This isn't always a good idea.  The client
  214|       |		 * skipper is allowed to skip by less than requested
  215|       |		 * if it needs to maintain block alignment.  The
  216|       |		 * seeker is not allowed to play such games, so using
  217|       |		 * the seeker here may be a performance loss compared
  218|       |		 * to just reading and discarding.  That's why we
  219|       |		 * only do this for skips of over 64k.
  220|       |		 */
  221|      0|		int64_t before = self->position;
  222|      0|		int64_t after = (self->archive->client.seeker)
  223|      0|		    (&self->archive->archive, self->data, request, SEEK_CUR);
  224|      0|		if (after != before + request)
  ------------------
  |  Branch (224:7): [True: 0, False: 0]
  ------------------
  225|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  226|      0|		return after - before;
  227|      0|	}
  228|      0|	return 0;
  229|    425|}
archive_read.c:client_seek_proxy:
  233|  6.56k|{
  234|       |	/* DO NOT use the skipper here!  If we transparently handled
  235|       |	 * forward seek here by using the skipper, that will break
  236|       |	 * other libarchive code that assumes a successful forward
  237|       |	 * seek means it can also seek backwards.
  238|       |	 */
  239|  6.56k|	if (self->archive->client.seeker == NULL) {
  ------------------
  |  Branch (239:6): [True: 0, False: 6.56k]
  ------------------
  240|      0|		archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  241|      0|		    "Current client reader does not support seeking a device");
  242|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  243|      0|	}
  244|  6.56k|	return (self->archive->client.seeker)(&self->archive->archive,
  245|  6.56k|	    self->data, offset, whence);
  246|  6.56k|}

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,
  ------------------
  |  |  177|  2.49k|	do { \
  |  |  178|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  2.49k|			(allowed_states), (function_name)); \
  |  |  180|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  181|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182: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.0k|{
  130|       |
  131|  35.0k|	a->passphrases.candidate = -1;
  132|  35.0k|}
__archive_read_next_passphrase:
  139|  9.28k|{
  140|  9.28k|	struct archive_read_passphrase *p;
  141|  9.28k|	const char *passphrase;
  142|       |
  143|  9.28k|	if (a->passphrases.candidate < 0) {
  ------------------
  |  Branch (143:6): [True: 5.70k, False: 3.57k]
  ------------------
  144|       |		/* Count out how many passphrases we have. */
  145|  5.70k|		int cnt = 0;
  146|       |
  147|  11.4k|		for (p = a->passphrases.first; p != NULL; p = p->next)
  ------------------
  |  Branch (147:34): [True: 5.70k, False: 5.70k]
  ------------------
  148|  5.70k|			cnt++;
  149|  5.70k|		a->passphrases.candidate = cnt;
  150|  5.70k|		p = a->passphrases.first;
  151|  5.70k|	} 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.28k|	if (p != NULL)
  ------------------
  |  Branch (170:6): [True: 5.70k, False: 3.57k]
  ------------------
  171|  5.70k|		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.28k|	return (passphrase);
  189|  9.28k|}
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|  2.49k|	int r;
   72|       |
   73|  2.49k|	mine = calloc(1, sizeof(*mine));
   74|  2.49k|	if (mine == NULL) {
  ------------------
  |  Branch (74:6): [True: 0, False: 2.49k]
  ------------------
   75|      0|		archive_set_error(a, ENOMEM, "No memory");
   76|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
   77|      0|	}
   78|  2.49k|	mine->start = mine->p = (const unsigned char *)buff;
   79|  2.49k|	mine->end = mine->start + size;
   80|  2.49k|	mine->read_size = read_size;
   81|  2.49k|	archive_read_set_open_callback(a, memory_read_open);
   82|  2.49k|	archive_read_set_read_callback(a, memory_read);
   83|  2.49k|	archive_read_set_seek_callback(a, memory_read_seek);
   84|  2.49k|	archive_read_set_skip_callback(a, memory_read_skip);
   85|  2.49k|	archive_read_set_close_callback(a, memory_read_close);
   86|  2.49k|	r = archive_read_set_callback_data(a, mine);
   87|  2.49k|	if (r < 0)
  ------------------
  |  Branch (87:6): [True: 0, False: 2.49k]
  ------------------
   88|      0|		return (r);
   89|  2.49k|	return (archive_read_open1(a));
   90|  2.49k|}
archive_read_open_memory.c:memory_read_open:
   97|  2.49k|{
   98|  2.49k|	(void)a; /* UNUSED */
   99|  2.49k|	(void)client_data; /* UNUSED */
  100|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  101|  2.49k|}
archive_read_open_memory.c:memory_read:
  112|  7.16k|{
  113|  7.16k|	struct read_memory_data *mine = (struct read_memory_data *)client_data;
  114|  7.16k|	ssize_t size;
  115|       |
  116|  7.16k|	(void)a; /* UNUSED */
  117|  7.16k|	*buff = mine->p;
  118|  7.16k|	size = mine->end - mine->p;
  119|  7.16k|	if (size > mine->read_size)
  ------------------
  |  Branch (119:6): [True: 0, False: 7.16k]
  ------------------
  120|      0|		size = mine->read_size;
  121|  7.16k|        mine->p += size;
  122|  7.16k|	return (size);
  123|  7.16k|}
archive_read_open_memory.c:memory_read_skip:
  132|    425|{
  133|    425|	struct read_memory_data *mine = (struct read_memory_data *)client_data;
  134|       |
  135|    425|	(void)a; /* UNUSED */
  136|    425|	if ((int64_t)skip > (int64_t)(mine->end - mine->p))
  ------------------
  |  Branch (136:6): [True: 425, False: 0]
  ------------------
  137|    425|		skip = mine->end - mine->p;
  138|       |	/* Round down to block size. */
  139|    425|	skip /= mine->read_size;
  140|    425|	skip *= mine->read_size;
  141|    425|	mine->p += skip;
  142|    425|	return (skip);
  143|    425|}
archive_read_open_memory.c:memory_read_seek:
  150|  6.56k|{
  151|  6.56k|	struct read_memory_data *mine = (struct read_memory_data *)client_data;
  152|       |
  153|  6.56k|	(void)a; /* UNUSED */
  154|  6.56k|	switch (whence) {
  155|  3.28k|	case SEEK_SET:
  ------------------
  |  Branch (155:2): [True: 3.28k, False: 3.28k]
  ------------------
  156|  3.28k|		mine->p = mine->start + offset;
  157|  3.28k|		break;
  158|      0|	case SEEK_CUR:
  ------------------
  |  Branch (158:2): [True: 0, False: 6.56k]
  ------------------
  159|      0|		mine->p += offset;
  160|      0|		break;
  161|  3.28k|	case SEEK_END:
  ------------------
  |  Branch (161:2): [True: 3.28k, False: 3.28k]
  ------------------
  162|  3.28k|		mine->p = mine->end + offset;
  163|  3.28k|		break;
  164|      0|	default:
  ------------------
  |  Branch (164:2): [True: 0, False: 6.56k]
  ------------------
  165|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  166|  6.56k|	}
  167|  6.56k|	if (mine->p < mine->start) {
  ------------------
  |  Branch (167:6): [True: 0, False: 6.56k]
  ------------------
  168|      0|		mine->p = mine->start;
  169|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  170|      0|	}
  171|  6.56k|	if (mine->p > mine->end) {
  ------------------
  |  Branch (171:6): [True: 0, False: 6.56k]
  ------------------
  172|      0|		mine->p = mine->end;
  173|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  174|      0|	}
  175|  6.56k|	return (mine->p - mine->start);
  176|  6.56k|}
archive_read_open_memory.c:memory_read_close:
  183|  2.49k|{
  184|  2.49k|	struct read_memory_data *mine = (struct read_memory_data *)client_data;
  185|  2.49k|	(void)a; /* UNUSED */
  186|  2.49k|	free(mine);
  187|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  188|  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,
  ------------------
  |  |  177|  2.49k|	do { \
  |  |  178|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  2.49k|			(allowed_states), (function_name)); \
  |  |  180|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  181|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182: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.58k|{
  439|  3.58k|	struct private_data *state;
  440|  3.58k|	size_t decompressed;
  441|  3.58k|	ssize_t avail_in, max_in;
  442|  3.58k|	int ret;
  443|       |
  444|  3.58k|	state = (struct private_data *)self->data;
  445|       |
  446|       |	/* Empty our output buffer. */
  447|  3.58k|	state->stream.next_out = state->out_block;
  448|  3.58k|	state->stream.avail_out = (uInt)state->out_block_size;
  449|       |
  450|       |	/* Try to fill the output buffer. */
  451|  7.09k|	while (state->stream.avail_out > 0 && !state->eof) {
  ------------------
  |  Branch (451:9): [True: 3.74k, False: 3.35k]
  |  Branch (451:40): [True: 3.64k, False: 97]
  ------------------
  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: 261, False: 3.38k]
  ------------------
  455|    261|			ret = consume_header(self);
  456|    261|			if (ret == ARCHIVE_EOF) {
  ------------------
  |  |  232|    261|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (456:8): [True: 100, False: 161]
  ------------------
  457|    100|				state->eof = 1;
  458|    100|				break;
  459|    100|			}
  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.50k]
  ------------------
  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.50k|		if (UINT_MAX >= SSIZE_MAX)
  ------------------
  |  Branch (475:7): [Folded, False: 3.50k]
  ------------------
  476|      0|			max_in = SSIZE_MAX;
  477|  3.50k|		else
  478|  3.50k|			max_in = UINT_MAX;
  479|  3.50k|		if (avail_in > max_in)
  ------------------
  |  Branch (479:7): [True: 0, False: 3.50k]
  ------------------
  480|      0|			avail_in = max_in;
  481|  3.50k|		state->stream.avail_in = (uInt)avail_in;
  482|       |
  483|       |		/* Decompress and consume some of that data. */
  484|  3.50k|		ret = inflate(&(state->stream), 0);
  485|  3.50k|		switch (ret) {
  486|  3.38k|		case Z_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (486:3): [True: 3.38k, False: 120]
  ------------------
  487|  3.38k|			__archive_read_filter_consume(self->upstream,
  488|  3.38k|			    avail_in - state->stream.avail_in);
  489|  3.38k|			break;
  490|    120|		case Z_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (490:3): [True: 120, False: 3.38k]
  ------------------
  491|    120|			__archive_read_filter_consume(self->upstream,
  492|    120|			    avail_in - state->stream.avail_in);
  493|       |			/* Consume the stream trailer; release the
  494|       |			 * decompression library. */
  495|    120|			ret = consume_trailer(self);
  496|    120|			if (ret < ARCHIVE_OK)
  ------------------
  |  |  233|    120|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (496:8): [True: 0, False: 120]
  ------------------
  497|      0|				return (ret);
  498|    120|			break;
  499|    120|		default:
  ------------------
  |  Branch (499:3): [True: 0, False: 3.50k]
  ------------------
  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.50k|		}
  506|  3.50k|	}
  507|       |
  508|       |	/* We've read as much as we can. */
  509|  3.54k|	decompressed = state->stream.next_out - state->out_block;
  510|  3.54k|	if (decompressed == 0)
  ------------------
  |  Branch (510:6): [True: 97, False: 3.45k]
  ------------------
  511|     97|		*p = NULL;
  512|  3.45k|	else
  513|  3.45k|		*p = state->out_block;
  514|  3.54k|	return (decompressed);
  515|  3.58k|}
archive_read_support_filter_gzip.c:consume_header:
  336|    261|{
  337|    261|	struct private_data *state;
  338|    261|	ssize_t avail, max_in;
  339|    261|	size_t len;
  340|    261|	int ret;
  341|       |
  342|    261|	state = (struct private_data *)self->data;
  343|       |
  344|       |	/* If this is a real header, consume it. */
  345|    261|	len = peek_at_header(self->upstream, NULL, state);
  346|    261|	if (len == 0)
  ------------------
  |  Branch (346:6): [True: 100, False: 161]
  ------------------
  347|    100|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|    100|#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|    120|{
  407|    120|	struct private_data *state;
  408|    120|	const unsigned char *p;
  409|       |
  410|    120|	state = (struct private_data *)self->data;
  411|       |
  412|    120|	state->in_stream = 0;
  413|    120|	switch (inflateEnd(&(state->stream))) {
  414|    120|	case Z_OK:
  ------------------
  |  Branch (414:2): [True: 120, False: 0]
  ------------------
  415|    120|		break;
  416|      0|	default:
  ------------------
  |  Branch (416:2): [True: 0, False: 120]
  ------------------
  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|    120|	}
  422|       |
  423|       |	/* GZip trailer is a fixed 8 byte structure. */
  424|    120|	p = __archive_read_filter_ahead(self->upstream, 8, NULL);
  425|    120|	if (p == NULL)
  ------------------
  |  Branch (425:6): [True: 0, False: 120]
  ------------------
  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|    120|	__archive_read_filter_consume(self->upstream, 8);
  432|       |
  433|    120|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    120|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  434|    120|}
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: 41, False: 100]
  ------------------
  530|     41|		switch (inflateEnd(&(state->stream))) {
  531|     41|		case Z_OK:
  ------------------
  |  Branch (531:3): [True: 41, False: 0]
  ------------------
  532|     41|			break;
  533|      0|		default:
  ------------------
  |  Branch (533:3): [True: 0, False: 41]
  ------------------
  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|     41|		}
  539|     41|	}
  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:
  118|  2.49k|{
  119|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  120|       |
  121|  2.49k|	if (__archive_read_register_bidder(a, NULL, "lz4",
  ------------------
  |  Branch (121:6): [True: 0, False: 2.49k]
  ------------------
  122|  2.49k|				&lz4_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  123|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  124|       |
  125|  2.49k|#if defined(HAVE_LIBLZ4)
  126|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  127|       |#else
  128|       |	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  129|       |	    "Using external lz4 program");
  130|       |	return (ARCHIVE_WARN);
  131|       |#endif
  132|  2.49k|}
archive_read_support_filter_lz4.c:lz4_reader_bid:
  144|  2.86k|{
  145|  2.86k|	const unsigned char *buffer;
  146|  2.86k|	ssize_t avail;
  147|  2.86k|	int bits_checked = 0;
  148|  2.86k|	const size_t min_lz4_archive_size = 11;
  149|       |
  150|       |	/*
  151|       |	 * LZ4 skippable frames contain a 4 byte magic number followed by
  152|       |	 * a 4 byte frame data size, then that number of bytes of data.
  153|       |	 * Regular frames contain a 4 byte magic number followed by a 2-14
  154|       |	 * byte frame header, some data, and a 3 byte end marker.
  155|       |	 */
  156|  2.86k|	const size_t min_lz4_frame_size = 8;
  157|       |
  158|  2.86k|	size_t offset_in_buffer = 0;
  159|  2.86k|	const size_t max_lookahead = 64 * 1024;
  160|  2.86k|	uint32_t magic_number;
  161|       |
  162|  2.86k|	(void)self; /* UNUSED */
  163|       |
  164|       |	/*
  165|       |	 * Zstd and LZ4 skippable frame magic numbers are identical. To
  166|       |	 * differentiate these two, we need to look for a non-skippable
  167|       |	 * frame.
  168|       |	 */
  169|       |
  170|       |	/* Minimal lz4 archive is 11 bytes. */
  171|  2.86k|	buffer = __archive_read_filter_ahead(filter, min_lz4_archive_size,
  172|  2.86k|	    &avail);
  173|  2.86k|	if (buffer == NULL)
  ------------------
  |  Branch (173:6): [True: 59, False: 2.80k]
  ------------------
  174|     59|		return (0);
  175|       |
  176|  2.80k|	magic_number = archive_le32dec(buffer);
  177|       |
  178|  2.80k|	while ((magic_number & LZ4_SKIPPABLE_MASK) == LZ4_SKIPPABLE_START) {
  ------------------
  |  |   57|  2.80k|#define LZ4_SKIPPABLE_MASK 0xFFFFFFF0
  ------------------
              	while ((magic_number & LZ4_SKIPPABLE_MASK) == LZ4_SKIPPABLE_START) {
  ------------------
  |  |   56|  2.80k|#define LZ4_SKIPPABLE_START 0x184D2A50
  ------------------
  |  Branch (178:9): [True: 0, False: 2.80k]
  ------------------
  179|      0|		size_t min;
  180|      0|		uint32_t frame_data_size;
  181|       |
  182|       |		/* Skip over the magic number */
  183|      0|		offset_in_buffer += 4;
  184|       |
  185|       |		/* Ensure that we can read another 4 bytes. */
  186|      0|		if (offset_in_buffer + 4 > (size_t)avail) {
  ------------------
  |  Branch (186:7): [True: 0, False: 0]
  ------------------
  187|      0|			buffer = __archive_read_filter_ahead(filter,
  188|      0|			    offset_in_buffer + 4, &avail);
  189|      0|			if (buffer == NULL)
  ------------------
  |  Branch (189:8): [True: 0, False: 0]
  ------------------
  190|      0|				return (0);
  191|      0|		}
  192|       |
  193|      0|		frame_data_size = archive_le32dec(buffer + offset_in_buffer);
  194|       |
  195|       |		/* Skip over the 4 frame data size bytes */
  196|      0|		offset_in_buffer += 4;
  197|       |
  198|       |		/* Skip over the value stored there. */
  199|      0|		if (archive_ckd_add_size(&offset_in_buffer,
  ------------------
  |  Branch (199:7): [True: 0, False: 0]
  ------------------
  200|      0|		    offset_in_buffer, frame_data_size))
  201|      0|			return (0);
  202|       |
  203|       |		/*
  204|       |		 * There should be at least one more frame
  205|       |		 * if this is LZ4 data.
  206|       |		 */
  207|      0|		if (archive_ckd_add_size(&min,
  ------------------
  |  Branch (207:7): [True: 0, False: 0]
  ------------------
  208|      0|		    offset_in_buffer, min_lz4_frame_size))
  209|      0|			return (0);
  210|       |		/* TODO: should this be >= ? */
  211|      0|		if (min > (size_t)avail) {
  ------------------
  |  Branch (211:7): [True: 0, False: 0]
  ------------------
  212|      0|			if (min > max_lookahead)
  ------------------
  |  Branch (212:8): [True: 0, False: 0]
  ------------------
  213|      0|				return (0); 
  214|       |
  215|      0|			buffer = __archive_read_filter_ahead(filter,
  216|      0|			    min, &avail);
  217|      0|			if (buffer == NULL)
  ------------------
  |  Branch (217:8): [True: 0, False: 0]
  ------------------
  218|      0|				return (0); 
  219|      0|		}
  220|       |
  221|      0|		magic_number = archive_le32dec(buffer + offset_in_buffer);
  222|      0|	}
  223|       |
  224|       |	/*
  225|       |	 * We have skipped over any skippable frames. Either a regular LZ4 frame
  226|       |	 * follows, or this isn't LZ4 data.
  227|       |	 */
  228|       |
  229|  2.80k|	bits_checked = offset_in_buffer;
  230|  2.80k|	buffer = buffer + offset_in_buffer;
  231|       |
  232|  2.80k|	if (magic_number == LZ4_MAGICNUMBER) {
  ------------------
  |  |   52|  2.80k|#define LZ4_MAGICNUMBER		0x184d2204
  ------------------
  |  Branch (232:6): [True: 16, False: 2.78k]
  ------------------
  233|     16|		unsigned char flag, BD;
  234|       |
  235|     16|		bits_checked += 32;
  236|       |		/* Next follows a stream descriptor. */
  237|       |		/* Descriptor Flags. */
  238|     16|		flag = buffer[4];
  239|       |		/* A version number must be "01". */
  240|     16|		if (((flag & 0xc0) >> 6) != 1)
  ------------------
  |  Branch (240:7): [True: 0, False: 16]
  ------------------
  241|      0|			return (0);
  242|       |		/* A reserved bit must be "0". */
  243|     16|		if (flag & 2)
  ------------------
  |  Branch (243:7): [True: 0, False: 16]
  ------------------
  244|      0|			return (0);
  245|     16|		bits_checked += 8;
  246|     16|		BD = buffer[5];
  247|       |		/* A block maximum size should be more than 3. */
  248|     16|		if (((BD & 0x70) >> 4) < 4)
  ------------------
  |  Branch (248:7): [True: 0, False: 16]
  ------------------
  249|      0|			return (0);
  250|       |		/* Reserved bits must be "0". */
  251|     16|		if (BD & ~0x70)
  ------------------
  |  Branch (251:7): [True: 0, False: 16]
  ------------------
  252|      0|			return (0);
  253|     16|		bits_checked += 8;
  254|       |
  255|     16|		return (bits_checked);
  256|     16|	}
  257|       |
  258|  2.78k|	if (magic_number == LZ4_LEGACY) {
  ------------------
  |  |   53|  2.78k|#define LZ4_LEGACY		0x184c2102
  ------------------
  |  Branch (258:6): [True: 0, False: 2.78k]
  ------------------
  259|      0|		bits_checked += 32;
  260|      0|		return (bits_checked);
  261|      0|	}
  262|       |
  263|  2.78k|	return (0);
  264|  2.78k|}
archive_read_support_filter_lz4.c:lz4_reader_init:
  301|     16|{
  302|     16|	struct private_data *state;
  303|       |
  304|     16|	self->code = ARCHIVE_FILTER_LZ4;
  ------------------
  |  |  322|     16|#define	ARCHIVE_FILTER_LZ4	13
  ------------------
  305|     16|	self->name = "lz4";
  306|       |
  307|     16|	state = calloc(1, sizeof(*state));
  308|     16|	if (state == NULL) {
  ------------------
  |  Branch (308:6): [True: 0, False: 16]
  ------------------
  309|      0|		archive_set_error(&self->archive->archive, ENOMEM,
  310|      0|		    "Can't allocate data for lz4 decompression");
  311|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  312|      0|	}
  313|       |
  314|     16|	self->data = state;
  315|     16|	state->stage = SELECT_STREAM;
  316|     16|	self->vtable = &lz4_reader_vtable;
  317|       |
  318|     16|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     16|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  319|     16|}
archive_read_support_filter_lz4.c:lz4_filter_read:
  376|  2.23k|{
  377|  2.23k|	struct private_data *state = (struct private_data *)self->data;
  378|  2.23k|	ssize_t ret;
  379|       |
  380|  2.23k|	if (state->eof) {
  ------------------
  |  Branch (380:6): [True: 0, False: 2.23k]
  ------------------
  381|      0|		*p = NULL;
  382|      0|		return (0);
  383|      0|	}
  384|       |
  385|  2.23k|	__archive_read_filter_consume(self->upstream, state->unconsumed);
  386|  2.23k|	state->unconsumed = 0;
  387|       |
  388|  2.23k|	switch (state->stage) {
  389|     16|	case SELECT_STREAM:
  ------------------
  |  Branch (389:2): [True: 16, False: 2.22k]
  ------------------
  390|     16|		break;
  391|      0|	case READ_DEFAULT_STREAM:
  ------------------
  |  Branch (391:2): [True: 0, False: 2.23k]
  ------------------
  392|      0|	case READ_LEGACY_STREAM:
  ------------------
  |  Branch (392:2): [True: 0, False: 2.23k]
  ------------------
  393|       |		/* Reading an lz4 stream already failed. */
  394|      0|		archive_set_error(&self->archive->archive,
  395|      0|		    ARCHIVE_ERRNO_MISC, "Invalid sequence");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  396|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  397|  2.22k|	case READ_DEFAULT_BLOCK:
  ------------------
  |  Branch (397:2): [True: 2.22k, False: 16]
  ------------------
  398|  2.22k|		ret = lz4_filter_read_default_stream(self, p);
  399|  2.22k|		if (ret != 0 || state->stage != SELECT_STREAM)
  ------------------
  |  Branch (399:7): [True: 1.83k, False: 384]
  |  Branch (399:19): [True: 0, False: 384]
  ------------------
  400|  1.83k|			return ret;
  401|    384|		break;
  402|    384|	case READ_LEGACY_BLOCK:
  ------------------
  |  Branch (402:2): [True: 0, False: 2.23k]
  ------------------
  403|      0|		ret = lz4_filter_read_legacy_stream(self, p);
  404|      0|		if (ret != 0 || state->stage != SELECT_STREAM)
  ------------------
  |  Branch (404:7): [True: 0, False: 0]
  |  Branch (404:19): [True: 0, False: 0]
  ------------------
  405|      0|			return ret;
  406|      0|		break;
  407|      0|	default:
  ------------------
  |  Branch (407:2): [True: 0, False: 2.23k]
  ------------------
  408|      0|		archive_set_error(&self->archive->archive,
  409|      0|		    ARCHIVE_ERRNO_MISC, "Program error");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  410|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  411|  2.23k|	}
  412|       |
  413|    400|	while (state->stage == SELECT_STREAM) {
  ------------------
  |  Branch (413:9): [True: 400, False: 0]
  ------------------
  414|    400|		const char *read_buf;
  415|       |
  416|       |		/* Read a magic number. */
  417|    400|		read_buf = __archive_read_filter_ahead(self->upstream, 4,
  418|    400|				NULL);
  419|    400|		if (read_buf == NULL) {
  ------------------
  |  Branch (419:7): [True: 0, False: 400]
  ------------------
  420|      0|			state->eof = 1;
  421|      0|			*p = NULL;
  422|      0|			return (0);
  423|      0|		}
  424|    400|		uint32_t number = archive_le32dec(read_buf);
  425|    400|		__archive_read_filter_consume(self->upstream, 4);
  426|    400|		if (number == LZ4_MAGICNUMBER)
  ------------------
  |  |   52|    400|#define LZ4_MAGICNUMBER		0x184d2204
  ------------------
  |  Branch (426:7): [True: 400, False: 0]
  ------------------
  427|    400|			return lz4_filter_read_default_stream(self, p);
  428|      0|		else if (number == LZ4_LEGACY)
  ------------------
  |  |   53|      0|#define LZ4_LEGACY		0x184c2102
  ------------------
  |  Branch (428:12): [True: 0, False: 0]
  ------------------
  429|      0|			return lz4_filter_read_legacy_stream(self, p);
  430|      0|		else if ((number & LZ4_SKIPPABLE_MASK) == LZ4_SKIPPABLE_START) {
  ------------------
  |  |   57|      0|#define LZ4_SKIPPABLE_MASK 0xFFFFFFF0
  ------------------
              		else if ((number & LZ4_SKIPPABLE_MASK) == LZ4_SKIPPABLE_START) {
  ------------------
  |  |   56|      0|#define LZ4_SKIPPABLE_START 0x184D2A50
  ------------------
  |  Branch (430:12): [True: 0, False: 0]
  ------------------
  431|      0|			read_buf = __archive_read_filter_ahead(
  432|      0|				self->upstream, 4, NULL);
  433|      0|			if (read_buf == NULL) {
  ------------------
  |  Branch (433:8): [True: 0, False: 0]
  ------------------
  434|      0|				archive_set_error(
  435|      0|				    &self->archive->archive,
  436|      0|		    		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  437|      0|				    "Malformed lz4 data");
  438|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  439|      0|			}
  440|      0|			int64_t skip_bytes = archive_le32dec(read_buf);
  441|      0|			if (__archive_read_filter_consume(self->upstream,
  ------------------
  |  Branch (441:8): [True: 0, False: 0]
  ------------------
  442|      0|			    4 + skip_bytes) < 0) {
  443|      0|				archive_set_error(
  444|      0|				    &self->archive->archive,
  445|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  446|      0|				    "Malformed lz4 data");
  447|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  448|      0|			}
  449|      0|		} else {
  450|       |			/* Ignore following unrecognized data. */
  451|      0|			state->eof = 1;
  452|      0|			*p = NULL;
  453|      0|			return (0);
  454|      0|		}
  455|    400|	}
  456|      0|	state->eof = 1;
  457|       |	*p = NULL;
  458|      0|	return (0);
  459|    400|}
archive_read_support_filter_lz4.c:lz4_filter_read_default_stream:
  709|  2.62k|{
  710|  2.62k|	struct private_data *state = (struct private_data *)self->data;
  711|  2.62k|	const char *read_buf;
  712|  2.62k|	ssize_t ret;
  713|       |
  714|  2.62k|	if (state->stage == SELECT_STREAM) {
  ------------------
  |  Branch (714:6): [True: 400, False: 2.22k]
  ------------------
  715|    400|		state->stage = READ_DEFAULT_STREAM;
  716|       |		/* First, read a descriptor. */
  717|    400|		if((ret = lz4_filter_read_descriptor(self)) != ARCHIVE_OK)
  ------------------
  |  |  233|    400|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (717:6): [True: 1, False: 399]
  ------------------
  718|      1|			return (ret);
  719|    399|		state->stage = READ_DEFAULT_BLOCK;
  720|    399|	}
  721|       |	/* Decompress a block. */
  722|  2.61k|	ret = lz4_filter_read_data_block(self, p);
  723|       |
  724|       |	/* If the end of block is detected, change the filter status
  725|       |	   to read next stream. */
  726|  2.61k|	if (ret == 0 && *p == NULL)
  ------------------
  |  Branch (726:6): [True: 384, False: 2.23k]
  |  Branch (726:18): [True: 384, False: 0]
  ------------------
  727|    384|		state->stage = SELECT_STREAM;
  728|       |
  729|       |	/* Optional processing, checking a stream sum. */
  730|  2.61k|	if (state->flags.stream_checksum) {
  ------------------
  |  Branch (730:6): [True: 2.37k, False: 245]
  ------------------
  731|  2.37k|		if (state->stage == SELECT_STREAM) {
  ------------------
  |  Branch (731:7): [True: 263, False: 2.11k]
  ------------------
  732|    263|			unsigned int checksum;
  733|    263|			unsigned int checksum_stream;
  734|    263|			read_buf = __archive_read_filter_ahead(self->upstream,
  735|    263|			    4, NULL);
  736|    263|			if (read_buf == NULL) {
  ------------------
  |  Branch (736:8): [True: 0, False: 263]
  ------------------
  737|      0|				archive_set_error(&self->archive->archive,
  738|      0|				    ARCHIVE_ERRNO_MISC, "truncated lz4 input");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  739|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  740|      0|			}
  741|    263|			checksum = archive_le32dec(read_buf);
  742|    263|			__archive_read_filter_consume(self->upstream, 4);
  743|    263|			checksum_stream = __archive_xxhash.XXH32_digest(
  744|    263|			    state->xxh32_state);
  745|    263|			state->xxh32_state = NULL;
  746|    263|			if (checksum != checksum_stream) {
  ------------------
  |  Branch (746:8): [True: 263, False: 0]
  ------------------
  747|       |#ifndef DONT_FAIL_ON_CRC_ERROR
  748|       |				archive_set_error(&self->archive->archive,
  749|       |				    ARCHIVE_ERRNO_MISC,
  750|       |				    "lz4 stream checksum error");
  751|       |				return (ARCHIVE_FATAL);
  752|       |#endif
  753|    263|			}
  754|  2.11k|		} else if (ret > 0)
  ------------------
  |  Branch (754:14): [True: 2.09k, False: 13]
  ------------------
  755|  2.09k|			__archive_xxhash.XXH32_update(state->xxh32_state,
  756|  2.09k|			    *p, (int)ret);
  757|  2.37k|	}
  758|  2.61k|	return (ret);
  759|  2.61k|}
archive_read_support_filter_lz4.c:lz4_filter_read_descriptor:
  463|    400|{
  464|    400|	struct private_data *state = (struct private_data *)self->data;
  465|    400|	const char *read_buf;
  466|    400|	ssize_t bytes_remaining;
  467|    400|	ssize_t descriptor_bytes;
  468|    400|	unsigned char flag, bd;
  469|    400|	unsigned int chsum, chsum_verifier;
  470|       |
  471|       |	/* Make sure we have 2 bytes for flags. */
  472|    400|	read_buf = __archive_read_filter_ahead(self->upstream, 2,
  473|    400|	    &bytes_remaining);
  474|    400|	if (read_buf == NULL) {
  ------------------
  |  Branch (474:6): [True: 1, False: 399]
  ------------------
  475|      1|		archive_set_error(&self->archive->archive,
  476|      1|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  477|      1|		    "truncated lz4 input");
  478|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  479|      1|	}
  480|       |
  481|       |	/*
  482|       |	   Parse flags.
  483|       |	 */
  484|    399|	flag = (unsigned char)read_buf[0];
  485|       |	/* Verify version number. */
  486|    399|	if ((flag & 0xc0) != 1<<6)
  ------------------
  |  Branch (486:6): [True: 0, False: 399]
  ------------------
  487|      0|		goto malformed_error;
  488|       |	/* A reserved bit must be zero. */
  489|    399|	if (flag & 0x02)
  ------------------
  |  Branch (489:6): [True: 0, False: 399]
  ------------------
  490|      0|		goto malformed_error;
  491|    399|	state->flags.block_independence = (flag & 0x20) != 0;
  492|    399|	state->flags.block_checksum = (flag & 0x10)?4:0;
  ------------------
  |  Branch (492:32): [True: 5, False: 394]
  ------------------
  493|    399|	state->flags.stream_size = (flag & 0x08) != 0;
  494|    399|	state->flags.stream_checksum = (flag & 0x04) != 0;
  495|    399|	state->flags.preset_dictionary = (flag & 0x01) != 0;
  496|       |
  497|       |	/* BD */
  498|    399|	bd = (unsigned char)read_buf[1];
  499|       |	/* Reserved bits must be zero. */
  500|    399|	if (bd & 0x8f)
  ------------------
  |  Branch (500:6): [True: 0, False: 399]
  ------------------
  501|      0|		goto malformed_error;
  502|       |	/* Get a maximum block size. */
  503|    399|	switch (read_buf[1] >> 4) {
  504|     11|	case 4: /* 64 KB */
  ------------------
  |  Branch (504:2): [True: 11, False: 388]
  ------------------
  505|     11|		state->flags.block_maximum_size = 64 * 1024;
  506|     11|		break;
  507|    266|	case 5: /* 256 KB */
  ------------------
  |  Branch (507:2): [True: 266, False: 133]
  ------------------
  508|    266|		state->flags.block_maximum_size = 256 * 1024;
  509|    266|		break;
  510|      0|	case 6: /* 1 MB */
  ------------------
  |  Branch (510:2): [True: 0, False: 399]
  ------------------
  511|      0|		state->flags.block_maximum_size = 1024 * 1024;
  512|      0|		break;
  513|    122|	case 7: /* 4 MB */
  ------------------
  |  Branch (513:2): [True: 122, False: 277]
  ------------------
  514|    122|		state->flags.block_maximum_size = 4 * 1024 * 1024;
  515|    122|		break;
  516|      0|	default:
  ------------------
  |  Branch (516:2): [True: 0, False: 399]
  ------------------
  517|      0|		goto malformed_error;
  518|    399|	}
  519|       |
  520|       |	/* Read the whole descriptor in a stream block. */
  521|    399|	descriptor_bytes = 3;
  522|    399|	if (state->flags.stream_size)
  ------------------
  |  Branch (522:6): [True: 0, False: 399]
  ------------------
  523|      0|		descriptor_bytes += 8;
  524|    399|	if (state->flags.preset_dictionary)
  ------------------
  |  Branch (524:6): [True: 0, False: 399]
  ------------------
  525|      0|		descriptor_bytes += 4;
  526|    399|	if (bytes_remaining < descriptor_bytes) {
  ------------------
  |  Branch (526:6): [True: 0, False: 399]
  ------------------
  527|      0|		read_buf = __archive_read_filter_ahead(self->upstream,
  528|      0|		    descriptor_bytes, &bytes_remaining);
  529|      0|		if (read_buf == NULL) {
  ------------------
  |  Branch (529:7): [True: 0, False: 0]
  ------------------
  530|      0|			archive_set_error(&self->archive->archive,
  531|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  532|      0|			    "truncated lz4 input");
  533|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  534|      0|		}
  535|      0|	}
  536|       |	/* Check if a descriptor is corrupted */
  537|    399|	chsum = __archive_xxhash.XXH32(read_buf, (int)descriptor_bytes -1, 0);
  538|    399|	chsum = (chsum >> 8) & 0xff;
  539|    399|	chsum_verifier = read_buf[descriptor_bytes-1] & 0xff;
  540|       |#ifndef DONT_FAIL_ON_CRC_ERROR
  541|       |	if (chsum != chsum_verifier)
  542|       |		goto malformed_error;
  543|       |#endif
  544|       |
  545|    399|	__archive_read_filter_consume(self->upstream, descriptor_bytes);
  546|       |
  547|       |	/* Make sure we have a large enough buffer for uncompressed data. */
  548|    399|	if (lz4_allocate_out_block(self) != ARCHIVE_OK)
  ------------------
  |  |  233|    399|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (548:6): [True: 0, False: 399]
  ------------------
  549|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  550|    399|	if (state->flags.stream_checksum) {
  ------------------
  |  Branch (550:6): [True: 276, False: 123]
  ------------------
  551|    276|		state->xxh32_state = __archive_xxhash.XXH32_init(0);
  552|    276|		if (state->xxh32_state == NULL)
  ------------------
  |  Branch (552:7): [True: 0, False: 276]
  ------------------
  553|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  554|    276|	}
  555|       |
  556|    399|	state->decoded_size = 0;
  557|       |	/* Success */
  558|    399|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    399|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  559|      0|malformed_error:
  560|      0|	archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  561|      0|	    "malformed lz4 data");
  562|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  563|    399|}
archive_read_support_filter_lz4.c:lz4_allocate_out_block:
  323|    399|{
  324|    399|	struct private_data *state = (struct private_data *)self->data;
  325|    399|	size_t out_block_size = state->flags.block_maximum_size;
  326|    399|	void *out_block;
  327|       |
  328|    399|	if (!state->flags.block_independence)
  ------------------
  |  Branch (328:6): [True: 272, False: 127]
  ------------------
  329|    272|		out_block_size += 64 * 1024;
  330|    399|	if (state->out_block_size < out_block_size) {
  ------------------
  |  Branch (330:6): [True: 16, False: 383]
  ------------------
  331|     16|		free(state->out_block);
  332|     16|		state->out_block = NULL;
  333|     16|		out_block = malloc(out_block_size);
  334|     16|		if (out_block == NULL) {
  ------------------
  |  Branch (334:7): [True: 0, False: 16]
  ------------------
  335|      0|			state->out_block_size = 0;
  336|      0|			archive_set_error(&self->archive->archive, ENOMEM,
  337|      0|			    "Can't allocate data for lz4 decompression");
  338|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  339|      0|		}
  340|     16|		state->out_block_size = out_block_size;
  341|     16|		state->out_block = out_block;
  342|     16|	}
  343|    399|	if (!state->flags.block_independence)
  ------------------
  |  Branch (343:6): [True: 272, False: 127]
  ------------------
  344|    272|		memset(state->out_block, 0, 64 * 1024);
  345|    399|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    399|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  346|    399|}
archive_read_support_filter_lz4.c:lz4_filter_read_data_block:
  567|  2.61k|{
  568|  2.61k|	struct private_data *state = (struct private_data *)self->data;
  569|  2.61k|	ssize_t compressed_size;
  570|  2.61k|	const char *read_buf;
  571|  2.61k|	int checksum_size;
  572|  2.61k|	ssize_t uncompressed_size;
  573|  2.61k|	size_t prefix64k;
  574|       |
  575|  2.61k|	*p = NULL;
  576|       |
  577|       |	/* Make sure we have 4 bytes for a block size. */
  578|  2.61k|	read_buf = __archive_read_filter_ahead(self->upstream, 4, NULL);
  579|  2.61k|	if (read_buf == NULL)
  ------------------
  |  Branch (579:6): [True: 2, False: 2.61k]
  ------------------
  580|      2|		goto truncated_error;
  581|  2.61k|	compressed_size = archive_le32dec(read_buf);
  582|  2.61k|	if ((compressed_size & 0x7fffffff) > state->flags.block_maximum_size)
  ------------------
  |  Branch (582:6): [True: 8, False: 2.60k]
  ------------------
  583|      8|		goto malformed_error;
  584|       |	/* A compressed size == 0 means the end of stream blocks. */
  585|  2.60k|	if (compressed_size == 0) {
  ------------------
  |  Branch (585:6): [True: 384, False: 2.22k]
  ------------------
  586|    384|		__archive_read_filter_consume(self->upstream, 4);
  587|    384|		return 0;
  588|    384|	}
  589|       |
  590|  2.22k|	checksum_size = state->flags.block_checksum;
  591|       |	/* Check if the block is uncompressed. */
  592|  2.22k|	if (compressed_size & 0x80000000U) {
  ------------------
  |  Branch (592:6): [True: 2.22k, False: 4]
  ------------------
  593|  2.22k|		compressed_size &= 0x7fffffff;
  594|  2.22k|		uncompressed_size = compressed_size;
  595|  2.22k|	} else
  596|      4|		uncompressed_size = 0;/* Unknown yet. */
  597|       |
  598|       |	/*
  599|       |	  Unfortunately, lz4 decompression API requires a whole block
  600|       |	  for its decompression speed, so we read a whole block and allocate
  601|       |	  a huge buffer used for decoded data.
  602|       |	*/
  603|  2.22k|	read_buf = __archive_read_filter_ahead(self->upstream,
  604|  2.22k|	    4 + compressed_size + checksum_size, NULL);
  605|  2.22k|	if (read_buf == NULL)
  ------------------
  |  Branch (605:6): [True: 1, False: 2.22k]
  ------------------
  606|      1|		goto truncated_error;
  607|       |
  608|       |	/* Optional processing, checking a block sum. */
  609|  2.22k|	if (checksum_size) {
  ------------------
  |  Branch (609:6): [True: 363, False: 1.86k]
  ------------------
  610|    363|		unsigned int chsum = __archive_xxhash.XXH32(
  611|    363|			read_buf + 4, (int)compressed_size, 0);
  612|    363|		unsigned int chsum_block =
  613|    363|		    archive_le32dec(read_buf + 4 + compressed_size);
  614|       |#ifndef DONT_FAIL_ON_CRC_ERROR
  615|       |		if (chsum != chsum_block)
  616|       |			goto malformed_error;
  617|       |#endif
  618|    363|	}
  619|       |
  620|       |
  621|       |	/* If the block is uncompressed, there is nothing to do. */
  622|  2.22k|	if (uncompressed_size) {
  ------------------
  |  Branch (622:6): [True: 2.22k, False: 4]
  ------------------
  623|       |		/* Prepare a prefix 64k block for next block. */
  624|  2.22k|		if (!state->flags.block_independence) {
  ------------------
  |  Branch (624:7): [True: 629, False: 1.59k]
  ------------------
  625|    629|			prefix64k = 64 * 1024;
  626|    629|			if (uncompressed_size < (ssize_t)prefix64k) {
  ------------------
  |  Branch (626:8): [True: 629, False: 0]
  ------------------
  627|    629|				memcpy(state->out_block
  628|    629|					+ prefix64k - uncompressed_size,
  629|    629|				    read_buf + 4,
  630|    629|				    uncompressed_size);
  631|    629|				memset(state->out_block, 0,
  632|    629|				    prefix64k - uncompressed_size);
  633|    629|			} else {
  634|      0|				memcpy(state->out_block,
  635|      0|				    read_buf + 4
  636|      0|					+ uncompressed_size - prefix64k,
  637|      0|				    prefix64k);
  638|      0|			}
  639|    629|			state->decoded_size = 0;
  640|    629|		}
  641|  2.22k|		state->unconsumed = 4 + uncompressed_size + checksum_size;
  642|  2.22k|		*p = read_buf + 4;
  643|  2.22k|		return uncompressed_size;
  644|  2.22k|	}
  645|       |
  646|       |	/*
  647|       |	   Decompress a block data.
  648|       |	 */
  649|      4|	if (state->flags.block_independence) {
  ------------------
  |  Branch (649:6): [True: 1, False: 3]
  ------------------
  650|      1|		prefix64k = 0;
  651|      1|		uncompressed_size = LZ4_decompress_safe(read_buf + 4,
  652|      1|		    state->out_block, (int)compressed_size,
  653|      1|		    state->flags.block_maximum_size);
  654|      3|	} else {
  655|      3|		prefix64k = 64 * 1024;
  656|      3|		if (state->decoded_size) {
  ------------------
  |  Branch (656:7): [True: 0, False: 3]
  ------------------
  657|      0|			if (state->decoded_size < prefix64k) {
  ------------------
  |  Branch (657:8): [True: 0, False: 0]
  ------------------
  658|      0|				memmove(state->out_block
  659|      0|					+ prefix64k - state->decoded_size,
  660|      0|				    state->out_block + prefix64k,
  661|      0|				    state->decoded_size);
  662|      0|				memset(state->out_block, 0,
  663|      0|				    prefix64k - state->decoded_size);
  664|      0|			} else {
  665|      0|				memmove(state->out_block,
  666|      0|				    state->out_block + state->decoded_size,
  667|      0|				    prefix64k);
  668|      0|			}
  669|      0|		}
  670|      3|#if LZ4_VERSION_MAJOR >= 1 && LZ4_VERSION_MINOR >= 7
  671|      3|		uncompressed_size = LZ4_decompress_safe_usingDict(
  672|      3|		    read_buf + 4,
  673|      3|		    state->out_block + prefix64k, (int)compressed_size,
  674|      3|		    state->flags.block_maximum_size,
  675|      3|		    state->out_block,
  676|      3|		    (int)prefix64k);
  677|       |#else
  678|       |		uncompressed_size = LZ4_decompress_safe_withPrefix64k(
  679|       |		    read_buf + 4,
  680|       |		    state->out_block + prefix64k, (int)compressed_size,
  681|       |		    state->flags.block_maximum_size);
  682|       |#endif
  683|      3|	}
  684|       |
  685|       |	/* Check if an error occurred in the decompression process. */
  686|      4|	if (uncompressed_size < 0) {
  ------------------
  |  Branch (686:6): [True: 4, False: 0]
  ------------------
  687|      4|		archive_set_error(&(self->archive->archive),
  688|      4|		    ARCHIVE_ERRNO_MISC, "lz4 decompression failed");
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  689|      4|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  690|      4|	}
  691|       |
  692|      0|	state->unconsumed = 4 + compressed_size + checksum_size;
  693|      0|	*p = state->out_block + prefix64k;
  694|      0|	state->decoded_size = uncompressed_size;
  695|      0|	return uncompressed_size;
  696|       |
  697|      8|malformed_error:
  698|      8|	archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      8|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  699|      8|	    "malformed lz4 data");
  700|      8|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  701|      3|truncated_error:
  702|      3|	archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  703|      3|	    "truncated lz4 input");
  704|      3|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  705|      4|}
archive_read_support_filter_lz4.c:lz4_filter_close:
  819|     16|{
  820|     16|	struct private_data *state;
  821|     16|	int ret = ARCHIVE_OK;
  ------------------
  |  |  233|     16|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  822|       |
  823|     16|	state = (struct private_data *)self->data;
  824|     16|	free(state->xxh32_state);
  825|     16|	free(state->out_block);
  826|     16|	free(state);
  827|     16|	return (ret);
  828|     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|    125|{
  223|    125|	struct rpm *rpm;
  224|    125|	ssize_t r;
  225|       |
  226|    125|	rpm = (struct rpm *)self->data;
  227|       |
  228|    125|	if (!rpm->data_reached) {
  ------------------
  |  Branch (228:6): [True: 79, False: 46]
  ------------------
  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|    123|	*buff = __archive_read_filter_ahead(self->upstream, 1, &r);
  236|    123|	if (r > 0)
  ------------------
  |  Branch (236:6): [True: 77, False: 46]
  ------------------
  237|     77|		__archive_read_filter_consume(self->upstream, r);
  238|       |
  239|    123|	return r;
  240|    125|}
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|		if (avail_in > 0)
  ------------------
  |  Branch (501:7): [True: 523, False: 18]
  ------------------
  502|    523|			memcpy(uudecode->in_buff + uudecode->in_cnt,
  503|    523|			    d, avail_in);
  504|    541|		d = uudecode->in_buff;
  505|    541|		avail_in += uudecode->in_cnt;
  506|    541|		uudecode->in_cnt = 0;
  507|    541|	}
  508|  23.5k|	for (;used < avail_in; d += llen, used += llen) {
  ------------------
  |  Branch (508:8): [True: 23.4k, False: 67]
  ------------------
  509|  23.4k|		ssize_t l, body;
  510|       |
  511|  23.4k|		b = d;
  512|  23.4k|		len = get_line(b, avail_in - used, &nl);
  513|  23.4k|		if (len < 0) {
  ------------------
  |  Branch (513:7): [True: 16, False: 23.4k]
  ------------------
  514|       |			/* Non-ascii character is found. */
  515|     16|			if (uudecode->state == ST_FIND_HEAD &&
  ------------------
  |  |   55|     32|#define ST_FIND_HEAD	0
  ------------------
  |  Branch (515:8): [True: 12, False: 4]
  ------------------
  516|     12|			    (uudecode->total > 0 || total > 0)) {
  ------------------
  |  Branch (516:9): [True: 0, False: 12]
  |  Branch (516:32): [True: 12, False: 0]
  ------------------
  517|     12|				uudecode->state = ST_IGNORE;
  ------------------
  |  |   59|     12|#define ST_IGNORE	4
  ------------------
  518|     12|				used = avail_in;
  519|     12|				goto finish;
  520|     12|			}
  521|      4|			archive_set_error(&self->archive->archive,
  522|      4|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  523|      4|			    "Insufficient compressed data");
  524|      4|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  525|     16|		}
  526|  23.4k|		if (len > UUENCODE_BID_MAX_READ) {
  ------------------
  |  |   44|  23.4k|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (526:7): [True: 0, False: 23.4k]
  ------------------
  527|      0|			archive_set_error(&self->archive->archive,
  528|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  529|      0|			    "Invalid format data");
  530|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  531|      0|		}
  532|  23.4k|		llen = len;
  533|  23.4k|		if ((nl == 0) && (uudecode->state != ST_UUEND)) {
  ------------------
  |  |   57|    559|#define ST_UUEND	2
  ------------------
  |  Branch (533:7): [True: 559, False: 22.8k]
  |  Branch (533:20): [True: 559, False: 0]
  ------------------
  534|    559|			if (total == 0 && ravail <= 0) {
  ------------------
  |  Branch (534:8): [True: 246, False: 313]
  |  Branch (534:22): [True: 18, False: 228]
  ------------------
  535|       |				/* There is nothing more to read, fail */
  536|     18|				archive_set_error(&self->archive->archive,
  537|     18|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     18|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  538|     18|				    "Missing format data");
  539|     18|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     18|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  540|     18|			}
  541|       |			/*
  542|       |			 * Save remaining data which does not contain
  543|       |			 * NL('\n','\r').
  544|       |			 */
  545|    541|			if (ensure_in_buff_size(self, uudecode, len)
  ------------------
  |  Branch (545:8): [True: 0, False: 541]
  ------------------
  546|    541|			    != ARCHIVE_OK)
  ------------------
  |  |  233|    541|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  547|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  548|    541|			if (uudecode->in_buff != b)
  ------------------
  |  Branch (548:8): [True: 369, False: 172]
  ------------------
  549|    369|				memmove(uudecode->in_buff, b, len);
  550|    541|			uudecode->in_cnt = len;
  551|    541|			if (total == 0) {
  ------------------
  |  Branch (551:8): [True: 228, False: 313]
  ------------------
  552|       |				/* Do not return 0; it means end-of-file.
  553|       |				 * We should try to read more bytes. */
  554|    228|				__archive_read_filter_consume(
  555|    228|				    self->upstream, ravail);
  556|    228|				goto read_more;
  557|    228|			}
  558|    313|			used += len;
  559|    313|			break;
  560|    541|		}
  561|  22.8k|		switch (uudecode->state) {
  562|      0|		default:
  ------------------
  |  Branch (562:3): [True: 0, False: 22.8k]
  ------------------
  563|  19.1k|		case ST_FIND_HEAD:
  ------------------
  |  |   55|  19.1k|#define ST_FIND_HEAD	0
  ------------------
  |  Branch (563:3): [True: 19.1k, False: 3.76k]
  ------------------
  564|       |			/* Do not read more than UUENCODE_BID_MAX_READ bytes */
  565|  19.1k|			if (total + len >= UUENCODE_BID_MAX_READ) {
  ------------------
  |  |   44|  19.1k|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (565:8): [True: 0, False: 19.1k]
  ------------------
  566|      0|				archive_set_error(&self->archive->archive,
  567|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  568|      0|				    "Invalid format data");
  569|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  570|      0|			}
  571|  19.1k|			if (len - nl >= 11 && memcmp(b, "begin ", 6) == 0)
  ------------------
  |  Branch (571:8): [True: 6.70k, False: 12.4k]
  |  Branch (571:26): [True: 5.09k, False: 1.61k]
  ------------------
  572|  5.09k|				l = 6;
  573|  14.0k|			else if (len - nl >= 18 &&
  ------------------
  |  Branch (573:13): [True: 1.60k, False: 12.4k]
  ------------------
  574|  1.60k|			    memcmp(b, "begin-base64 ", 13) == 0)
  ------------------
  |  Branch (574:8): [True: 371, False: 1.23k]
  ------------------
  575|    371|				l = 13;
  576|  13.6k|			else
  577|  13.6k|				l = 0;
  578|  19.1k|			if (l != 0 && b[l] >= '0' && b[l] <= '7' &&
  ------------------
  |  Branch (578:8): [True: 5.46k, False: 13.6k]
  |  Branch (578:18): [True: 5.46k, False: 0]
  |  Branch (578:33): [True: 5.11k, False: 346]
  ------------------
  579|  5.11k|			    b[l+1] >= '0' && b[l+1] <= '7' &&
  ------------------
  |  Branch (579:8): [True: 5.11k, False: 0]
  |  Branch (579:25): [True: 2.75k, False: 2.36k]
  ------------------
  580|  2.75k|			    b[l+2] >= '0' && b[l+2] <= '7' && b[l+3] == ' ') {
  ------------------
  |  Branch (580:8): [True: 2.75k, False: 0]
  |  Branch (580:25): [True: 1.08k, False: 1.66k]
  |  Branch (580:42): [True: 47, False: 1.03k]
  ------------------
  581|     47|				if (l == 6)
  ------------------
  |  Branch (581:9): [True: 20, False: 27]
  ------------------
  582|     20|					uudecode->state = ST_READ_UU;
  ------------------
  |  |   56|     20|#define ST_READ_UU	1
  ------------------
  583|     27|				else
  584|     27|					uudecode->state = ST_READ_BASE64;
  ------------------
  |  |   58|     27|#define ST_READ_BASE64	3
  ------------------
  585|     47|				uudecode->mode = (mode_t)(
  586|     47|				    ((int)(b[l] - '0') * 64) +
  587|     47|				    ((int)(b[l+1] - '0') * 8) +
  588|     47|				     (int)(b[l+2] - '0'));
  589|     47|				uudecode->mode_set = 1;
  590|     47|				namelen = len - nl - 4 - l;
  591|     47|				if (namelen > 1) {
  ------------------
  |  Branch (591:9): [True: 20, False: 27]
  ------------------
  592|     20|					if (uudecode->name != NULL)
  ------------------
  |  Branch (592:10): [True: 0, False: 20]
  ------------------
  593|      0|						free(uudecode->name);
  594|     20|					uudecode->name = malloc(namelen + 1);
  595|     20|					if (uudecode->name == NULL) {
  ------------------
  |  Branch (595:10): [True: 0, False: 20]
  ------------------
  596|      0|						archive_set_error(
  597|      0|						    &self->archive->archive,
  598|      0|						    ENOMEM,
  599|      0|						    "Can't allocate data for uudecode");
  600|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  601|      0|					}
  602|     20|					strncpy(uudecode->name,
  603|     20|					    (const char *)(b + l + 4),
  604|     20|					    namelen);
  605|     20|					uudecode->name[namelen] = '\0';
  606|     20|				}
  607|     47|			}
  608|  19.1k|			break;
  609|  19.1k|		case ST_READ_UU:
  ------------------
  |  |   56|     28|#define ST_READ_UU	1
  ------------------
  |  Branch (609:3): [True: 28, False: 22.8k]
  ------------------
  610|     28|			if (total + len * 2 > OUT_BUFF_SIZE)
  ------------------
  |  |   53|     28|#define OUT_BUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (610:8): [True: 3, False: 25]
  ------------------
  611|      3|				goto finish;
  612|     25|			body = len - nl;
  613|     25|			if (!uuchar[*b] || body <= 0) {
  ------------------
  |  Branch (613:8): [True: 0, False: 25]
  |  Branch (613:23): [True: 0, False: 25]
  ------------------
  614|      0|				archive_set_error(&self->archive->archive,
  615|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  616|      0|				    "Insufficient compressed data");
  617|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  618|      0|			}
  619|       |			/* Get length of undecoded bytes of current line. */
  620|     25|			l = UUDECODE(*b++);
  ------------------
  |  |  258|     25|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  621|     25|			body--;
  622|     25|			if (l > body) {
  ------------------
  |  Branch (622:8): [True: 0, False: 25]
  ------------------
  623|      0|				archive_set_error(&self->archive->archive,
  624|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  625|      0|				    "Insufficient compressed data");
  626|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  627|      0|			}
  628|     25|			if (l == 0) {
  ------------------
  |  Branch (628:8): [True: 1, False: 24]
  ------------------
  629|      1|				uudecode->state = ST_UUEND;
  ------------------
  |  |   57|      1|#define ST_UUEND	2
  ------------------
  630|      1|				break;
  631|      1|			}
  632|     49|			while (l > 0) {
  ------------------
  |  Branch (632:11): [True: 29, False: 20]
  ------------------
  633|     29|				int n = 0;
  634|       |
  635|     29|				if (!uuchar[b[0]] || !uuchar[b[1]])
  ------------------
  |  Branch (635:9): [True: 0, False: 29]
  |  Branch (635:26): [True: 0, False: 29]
  ------------------
  636|      0|					break;
  637|     29|				n = UUDECODE(*b++) << 18;
  ------------------
  |  |  258|     29|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  638|     29|				n |= UUDECODE(*b++) << 12;
  ------------------
  |  |  258|     29|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  639|     29|				*out++ = n >> 16; total++;
  640|     29|				--l;
  641|       |
  642|     29|				if (l > 0) {
  ------------------
  |  Branch (642:9): [True: 10, False: 19]
  ------------------
  643|     10|					if (!uuchar[b[0]])
  ------------------
  |  Branch (643:10): [True: 0, False: 10]
  ------------------
  644|      0|						break;
  645|     10|					n |= UUDECODE(*b++) << 6;
  ------------------
  |  |  258|     10|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  646|     10|					*out++ = (n >> 8) & 0xFF; total++;
  647|     10|					--l;
  648|     10|				}
  649|     29|				if (l > 0) {
  ------------------
  |  Branch (649:9): [True: 9, False: 20]
  ------------------
  650|      9|					if (!uuchar[b[0]])
  ------------------
  |  Branch (650:10): [True: 4, False: 5]
  ------------------
  651|      4|						break;
  652|      5|					n |= UUDECODE(*b++);
  ------------------
  |  |  258|      5|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  653|      5|					*out++ = n & 0xFF; total++;
  654|      5|					--l;
  655|      5|				}
  656|     29|			}
  657|     24|			if (l) {
  ------------------
  |  Branch (657:8): [True: 4, False: 20]
  ------------------
  658|      4|				archive_set_error(&self->archive->archive,
  659|      4|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  660|      4|				    "Insufficient compressed data");
  661|      4|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  662|      4|			}
  663|     20|			break;
  664|     20|		case ST_UUEND:
  ------------------
  |  |   57|      0|#define ST_UUEND	2
  ------------------
  |  Branch (664:3): [True: 0, False: 22.8k]
  ------------------
  665|      0|			if (len - nl == 3 && memcmp(b, "end ", 3) == 0)
  ------------------
  |  Branch (665:8): [True: 0, False: 0]
  |  Branch (665:25): [True: 0, False: 0]
  ------------------
  666|      0|				uudecode->state = ST_FIND_HEAD;
  ------------------
  |  |   55|      0|#define ST_FIND_HEAD	0
  ------------------
  667|      0|			else {
  668|      0|				archive_set_error(&self->archive->archive,
  669|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  670|      0|				    "Insufficient compressed data");
  671|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  672|      0|			}
  673|      0|			break;
  674|  3.73k|		case ST_READ_BASE64:
  ------------------
  |  |   58|  3.73k|#define ST_READ_BASE64	3
  ------------------
  |  Branch (674:3): [True: 3.73k, False: 19.1k]
  ------------------
  675|  3.73k|			if (total + len * 2 > OUT_BUFF_SIZE)
  ------------------
  |  |   53|  3.73k|#define OUT_BUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (675:8): [True: 3, False: 3.73k]
  ------------------
  676|      3|				goto finish;
  677|  3.73k|			l = len - nl;
  678|  3.73k|			if (l >= 3 && b[0] == '=' && b[1] == '=' &&
  ------------------
  |  Branch (678:8): [True: 2.78k, False: 949]
  |  Branch (678:18): [True: 2.58k, False: 194]
  |  Branch (678:33): [True: 865, False: 1.72k]
  ------------------
  679|    865|			    b[2] == '=') {
  ------------------
  |  Branch (679:8): [True: 20, False: 845]
  ------------------
  680|     20|				uudecode->state = ST_FIND_HEAD;
  ------------------
  |  |   55|     20|#define ST_FIND_HEAD	0
  ------------------
  681|     20|				break;
  682|     20|			}
  683|  10.8k|			while (l > 0) {
  ------------------
  |  Branch (683:11): [True: 10.4k, False: 437]
  ------------------
  684|  10.4k|				int n = 0;
  685|       |
  686|  10.4k|				if (!base64[b[0]] || !base64[b[1]])
  ------------------
  |  Branch (686:9): [True: 0, False: 10.4k]
  |  Branch (686:26): [True: 861, False: 9.57k]
  ------------------
  687|    861|					break;
  688|  9.57k|				n = base64num[*b++] << 18;
  689|  9.57k|				n |= base64num[*b++] << 12;
  690|  9.57k|				*out++ = n >> 16; total++;
  691|  9.57k|				l -= 2;
  692|       |
  693|  9.57k|				if (l > 0) {
  ------------------
  |  Branch (693:9): [True: 9.29k, False: 275]
  ------------------
  694|  9.29k|					if (*b == '=')
  ------------------
  |  Branch (694:10): [True: 1.14k, False: 8.15k]
  ------------------
  695|  1.14k|						break;
  696|  8.15k|					if (!base64[*b])
  ------------------
  |  Branch (696:10): [True: 0, False: 8.15k]
  ------------------
  697|      0|						break;
  698|  8.15k|					n |= base64num[*b++] << 6;
  699|  8.15k|					*out++ = (n >> 8) & 0xFF; total++;
  700|  8.15k|					--l;
  701|  8.15k|				}
  702|  8.42k|				if (l > 0) {
  ------------------
  |  Branch (702:9): [True: 8.04k, False: 382]
  ------------------
  703|  8.04k|					if (*b == '=')
  ------------------
  |  Branch (703:10): [True: 1.26k, False: 6.78k]
  ------------------
  704|  1.26k|						break;
  705|  6.78k|					if (!base64[*b])
  ------------------
  |  Branch (705:10): [True: 1, False: 6.77k]
  ------------------
  706|      1|						break;
  707|  6.77k|					n |= base64num[*b++];
  708|  6.77k|					*out++ = n & 0xFF; total++;
  709|  6.77k|					--l;
  710|  6.77k|				}
  711|  8.42k|			}
  712|  3.71k|			if (l && *b != '=') {
  ------------------
  |  Branch (712:8): [True: 3.27k, False: 437]
  |  Branch (712:13): [True: 1, False: 3.27k]
  ------------------
  713|      1|				archive_set_error(&self->archive->archive,
  714|      1|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  715|      1|				    "Insufficient compressed data");
  716|      1|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  717|      1|			}
  718|  3.70k|			break;
  719|  22.8k|		}
  720|  22.8k|	}
  721|    410|finish:
  722|    410|	if (ravail < avail_in)
  ------------------
  |  Branch (722:6): [True: 351, False: 59]
  ------------------
  723|    351|		used -= avail_in - ravail;
  724|    410|	__archive_read_filter_consume(self->upstream, used);
  725|       |
  726|    410|	*buff = uudecode->out_buff;
  727|    410|	uudecode->total += total;
  728|    410|	return (total);
  729|    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:
  733|     47|{
  734|     47|	struct uudecode *uudecode;
  735|       |
  736|     47|	uudecode = (struct uudecode *)self->data;
  737|     47|	free(uudecode->in_buff);
  738|     47|	free(uudecode->out_buff);
  739|     47|	free(uudecode->name);
  740|     47|	free(uudecode);
  741|       |
  742|     47|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     47|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  743|     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))
  ------------------
  |  |  205|  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:
   87|  2.49k|{
   88|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
   89|       |
   90|  2.49k|	if (__archive_read_register_bidder(a, NULL, "zstd",
  ------------------
  |  Branch (90:6): [True: 0, False: 2.49k]
  ------------------
   91|  2.49k|				&zstd_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   92|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
   93|       |
   94|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
   95|       |	return (ARCHIVE_OK);
   96|       |#else
   97|  2.49k|	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  2.49k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
   98|  2.49k|	    "Using external zstd program for zstd decompression");
   99|  2.49k|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|  2.49k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  100|  2.49k|#endif
  101|  2.49k|}
archive_read_support_filter_zstd.c:zstd_bidder_bid:
  109|  2.86k|{
  110|  2.86k|	const unsigned char *buffer;
  111|  2.86k|	ssize_t avail;
  112|       |	/*
  113|       |	 * Zstandard skippable frames contain a 4 byte magic number followed
  114|       |	 * by a 4 byte frame data size, then that number of bytes of data.
  115|       |	 * Regular frames contain a 4 byte magic number followed by a 2-14
  116|       |	 * byte frame header, some data, and a 3 byte end marker.
  117|       |	 */
  118|  2.86k|	const size_t min_zstd_frame_size = 8;
  119|       |
  120|  2.86k|	size_t offset_in_buffer = 0;
  121|  2.86k|	const size_t max_lookahead = 64 * 1024;
  122|  2.86k|	uint32_t magic_number;
  123|       |
  124|       |	/* Zstd regular frame magic number. */
  125|  2.86k|	const uint32_t zstd_magic = 0xFD2FB528U;
  126|       |
  127|       |	/*
  128|       |	 * Note: Zstd and LZ4 skippable frame magic numbers are identical.
  129|       |	 * To differentiate these two, we need to look for a non-skippable
  130|       |	 * frame.
  131|       |	 */
  132|  2.86k|	const uint32_t zstd_magic_skippable_start = 0x184D2A50;
  133|  2.86k|	const uint32_t zstd_magic_skippable_mask  = 0xFFFFFFF0;
  134|       |
  135|  2.86k|	(void) self; /* UNUSED */
  136|       |
  137|  2.86k|	buffer = __archive_read_filter_ahead(filter, min_zstd_frame_size,
  138|  2.86k|	    &avail);
  139|  2.86k|	if (buffer == NULL)
  ------------------
  |  Branch (139:6): [True: 59, False: 2.80k]
  ------------------
  140|     59|		return (0);
  141|       |
  142|  2.80k|	magic_number = archive_le32dec(buffer);
  143|       |
  144|  2.80k|	while ((magic_number & zstd_magic_skippable_mask) ==
  ------------------
  |  Branch (144:9): [True: 0, False: 2.80k]
  ------------------
  145|  2.80k|	    zstd_magic_skippable_start) {
  146|      0|		size_t min;
  147|      0|		uint32_t frame_data_size;
  148|       |
  149|       |		/* Skip over the magic number */
  150|      0|		offset_in_buffer += 4;
  151|       |
  152|       |		/* Ensure that we can read another 4 bytes. */
  153|      0|		if (offset_in_buffer + 4 > (size_t)avail) {
  ------------------
  |  Branch (153:7): [True: 0, False: 0]
  ------------------
  154|      0|			buffer = __archive_read_filter_ahead(filter,
  155|      0|			    offset_in_buffer + 4, &avail);
  156|      0|			if (buffer == NULL)
  ------------------
  |  Branch (156:8): [True: 0, False: 0]
  ------------------
  157|      0|				return (0);
  158|      0|		}
  159|       |
  160|      0|		frame_data_size = archive_le32dec(buffer + offset_in_buffer);
  161|       |
  162|       |		/* Skip over the 4 frame data size bytes */
  163|      0|		offset_in_buffer += 4;
  164|       |
  165|       |		/* Skip over the value stored there. */
  166|      0|		if (archive_ckd_add_size(&offset_in_buffer,
  ------------------
  |  Branch (166:7): [True: 0, False: 0]
  ------------------
  167|      0|		    offset_in_buffer, frame_data_size))
  168|      0|			return (0);
  169|       |
  170|       |		/*
  171|       |		 * There should be at least one more frame
  172|       |		 * if this is zstd data.
  173|       |		 */
  174|      0|		if (archive_ckd_add_size(&min,
  ------------------
  |  Branch (174:7): [True: 0, False: 0]
  ------------------
  175|      0|		    offset_in_buffer, min_zstd_frame_size))
  176|      0|			return (0);
  177|      0|		if (min > (size_t)avail) {
  ------------------
  |  Branch (177:7): [True: 0, False: 0]
  ------------------
  178|      0|			if (min > max_lookahead)
  ------------------
  |  Branch (178:8): [True: 0, False: 0]
  ------------------
  179|      0|				return (0);
  180|       |
  181|      0|			buffer = __archive_read_filter_ahead(filter,
  182|      0|			    min, &avail);
  183|      0|			if (buffer == NULL)
  ------------------
  |  Branch (183:8): [True: 0, False: 0]
  ------------------
  184|      0|				return (0);
  185|      0|		}
  186|       |
  187|      0|		magic_number = archive_le32dec(buffer + offset_in_buffer);
  188|      0|	}
  189|       |
  190|       |	/*
  191|       |	 * We have skipped over any skippable frames. Either a regular zstd
  192|       |	 * frame follows, or this isn't zstd data.
  193|       |	 */
  194|       |
  195|  2.80k|	if (magic_number == zstd_magic)
  ------------------
  |  Branch (195:6): [True: 0, False: 2.80k]
  ------------------
  196|      0|		return (offset_in_buffer + 4);
  197|       |
  198|  2.80k|	return (0);
  199|  2.80k|}

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

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

archive_read_support_format_cab:
  452|  2.49k|{
  453|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  454|  2.49k|	struct cab *cab;
  455|  2.49k|	int r;
  456|       |
  457|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|  2.49k|	do { \
  |  |  178|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  2.49k|			(allowed_states), (function_name)); \
  |  |  180|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  181|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  458|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_cab");
  459|       |
  460|  2.49k|	cab = calloc(1, sizeof(*cab));
  461|  2.49k|	if (cab == NULL) {
  ------------------
  |  Branch (461:6): [True: 0, False: 2.49k]
  ------------------
  462|      0|		archive_set_error(&a->archive, ENOMEM,
  463|      0|		    "Can't allocate CAB data");
  464|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  465|      0|	}
  466|  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]
  |  |  ------------------
  ------------------
  467|  2.49k|	if (archive_wstring_ensure(&cab->ws, 256) == NULL) {
  ------------------
  |  Branch (467:6): [True: 0, False: 2.49k]
  ------------------
  468|      0|		archive_set_error(&a->archive, ENOMEM,
  469|      0|		    "Can't allocate memory");
  470|      0|		free(cab);
  471|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  472|      0|	}
  473|       |
  474|  2.49k|	r = __archive_read_register_format(a,
  475|  2.49k|	    cab,
  476|  2.49k|	    "cab",
  477|  2.49k|	    archive_read_format_cab_bid,
  478|  2.49k|	    archive_read_format_cab_options,
  479|  2.49k|	    archive_read_format_cab_read_header,
  480|  2.49k|	    archive_read_format_cab_read_data,
  481|  2.49k|	    archive_read_format_cab_read_data_skip,
  482|  2.49k|	    NULL,
  483|  2.49k|	    archive_read_format_cab_cleanup,
  484|  2.49k|	    NULL,
  485|  2.49k|	    NULL);
  486|       |
  487|  2.49k|	if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (487:6): [True: 0, False: 2.49k]
  ------------------
  488|      0|		archive_wstring_free(&cab->ws);
  489|      0|		free(cab);
  490|      0|	}
  491|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  492|  2.49k|}
archive_read_support_format_cab.c:archive_read_format_cab_bid:
  519|  2.45k|{
  520|  2.45k|	const char *p;
  521|  2.45k|	ssize_t bytes_avail, offset, window;
  522|       |
  523|       |	/* If there's already a better bid than we can ever
  524|       |	   make, don't bother testing. */
  525|  2.45k|	if (best_bid > 64)
  ------------------
  |  Branch (525:6): [True: 249, False: 2.20k]
  ------------------
  526|    249|		return (-1);
  527|       |
  528|  2.20k|	if ((p = __archive_read_ahead(a, 8, NULL)) == NULL)
  ------------------
  |  Branch (528:6): [True: 24, False: 2.18k]
  ------------------
  529|     24|		return (-1);
  530|       |
  531|  2.18k|	if (memcmp(p, "MSCF\0\0\0\0", 8) == 0)
  ------------------
  |  Branch (531:6): [True: 27, False: 2.15k]
  ------------------
  532|     27|		return (64);
  533|       |
  534|       |	/*
  535|       |	 * Attempt to handle self-extracting archives
  536|       |	 * by noting a PE header and searching forward
  537|       |	 * up to 128k for an 'MSCF' marker.
  538|       |	 */
  539|  2.15k|	if (p[0] == 'M' && p[1] == 'Z') {
  ------------------
  |  Branch (539:6): [True: 110, False: 2.04k]
  |  Branch (539:21): [True: 109, False: 1]
  ------------------
  540|    109|		offset = 0;
  541|    109|		window = 4096;
  542|    457|		while (offset < (1024 * 128)) {
  ------------------
  |  Branch (542:10): [True: 446, False: 11]
  ------------------
  543|    446|			const char *h = __archive_read_ahead(a, offset + window,
  544|    446|			    &bytes_avail);
  545|    446|			if (h == NULL) {
  ------------------
  |  Branch (545:8): [True: 320, False: 126]
  ------------------
  546|       |				/* Remaining bytes are less than window. */
  547|    320|				window >>= 1;
  548|    320|				if (window < 128)
  ------------------
  |  Branch (548:9): [True: 53, False: 267]
  ------------------
  549|     53|					return (0);
  550|    267|				continue;
  551|    320|			}
  552|    126|			p = h + offset;
  553|  1.59M|			while (p + 8 < h + bytes_avail) {
  ------------------
  |  Branch (553:11): [True: 1.59M, False: 81]
  ------------------
  554|  1.59M|				int next;
  555|  1.59M|				if ((next = find_cab_magic(p)) == 0)
  ------------------
  |  Branch (555:9): [True: 45, False: 1.59M]
  ------------------
  556|     45|					return (64);
  557|  1.59M|				p += next;
  558|  1.59M|			}
  559|     81|			offset = p - h;
  560|     81|		}
  561|    109|	}
  562|  2.06k|	return (0);
  563|  2.15k|}
archive_read_support_format_cab.c:find_cab_magic:
  496|  1.63M|{
  497|  1.63M|	switch (p[4]) {
  498|   872k|	case 0:
  ------------------
  |  Branch (498:2): [True: 872k, False: 759k]
  ------------------
  499|       |		/*
  500|       |		 * Note: Self-Extraction program has 'MSCF' string in their
  501|       |		 * program. If we were finding 'MSCF' string only, we got
  502|       |		 * wrong place for Cabinet header, thus, we have to check
  503|       |		 * following four bytes which are reserved and must be set
  504|       |		 * to zero.
  505|       |		 */
  506|   872k|		if (memcmp(p, "MSCF\0\0\0\0", 8) == 0)
  ------------------
  |  Branch (506:7): [True: 90, False: 872k]
  ------------------
  507|     90|			return 0;
  508|   872k|		return 5;
  509|  1.02k|	case 'F': return 1;
  ------------------
  |  Branch (509:2): [True: 1.02k, False: 1.63M]
  ------------------
  510|  2.76k|	case 'C': return 2;
  ------------------
  |  Branch (510:2): [True: 2.76k, False: 1.62M]
  ------------------
  511|  4.46k|	case 'S': return 3;
  ------------------
  |  Branch (511:2): [True: 4.46k, False: 1.62M]
  ------------------
  512|  12.2k|	case 'M': return 4;
  ------------------
  |  Branch (512:2): [True: 12.2k, False: 1.61M]
  ------------------
  513|   738k|	default:  return 5;
  ------------------
  |  Branch (513:2): [True: 738k, False: 893k]
  ------------------
  514|  1.63M|	}
  515|  1.63M|}
archive_read_support_format_cab.c:archive_read_format_cab_read_header:
 1007|     92|{
 1008|     92|	struct cab *cab;
 1009|     92|	struct cfheader *hd;
 1010|     92|	struct cffolder *prev_folder;
 1011|     92|	struct cffile *file;
 1012|     92|	struct archive_string_conv *sconv;
 1013|     92|	int err = ARCHIVE_OK, r;
  ------------------
  |  |  233|     92|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1014|       |	
 1015|     92|	cab = (struct cab *)(a->format->data);
 1016|     92|	if (cab->found_header == 0) {
  ------------------
  |  Branch (1016:6): [True: 72, False: 20]
  ------------------
 1017|     72|		err = cab_read_header(a); 
 1018|     72|		if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|     72|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1018:7): [True: 4, False: 68]
  ------------------
 1019|      4|			return (err);
 1020|       |		/* We've found the header. */
 1021|     68|		cab->found_header = 1;
 1022|     68|	}
 1023|     88|	hd = &cab->cfheader;
 1024|       |
 1025|     88|	if (hd->file_index >= hd->file_count) {
  ------------------
  |  Branch (1025:6): [True: 8, False: 80]
  ------------------
 1026|      8|		cab->end_of_archive = 1;
 1027|      8|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|      8|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1028|      8|	}
 1029|     80|	file = &hd->file_array[hd->file_index++];
 1030|       |
 1031|     80|	cab->end_of_entry = 0;
 1032|     80|	cab->end_of_entry_cleanup = 0;
 1033|     80|	cab->entry_unconsumed = 0;
 1034|     80|	cab->entry_cffile = file;
 1035|       |
 1036|       |	/*
 1037|       |	 * Choose a proper folder.
 1038|       |	 */
 1039|     80|	prev_folder = cab->entry_cffolder;
 1040|     80|	switch (file->folder) {
 1041|      3|	case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  339|      3|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1041:2): [True: 3, False: 77]
  ------------------
 1042|      3|	case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  341|      3|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1042:2): [True: 0, False: 80]
  ------------------
 1043|      3|		cab->entry_cffolder = &hd->folder_array[0];
 1044|      3|		break;
 1045|      6|	case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  340|      6|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1045:2): [True: 6, False: 74]
  ------------------
 1046|      6|		cab->entry_cffolder = &hd->folder_array[hd->folder_count-1];
 1047|      6|		break;
 1048|     71|	default:
  ------------------
  |  Branch (1048:2): [True: 71, False: 9]
  ------------------
 1049|     71|		cab->entry_cffolder = &hd->folder_array[file->folder];
 1050|     71|		break;
 1051|     80|	}
 1052|       |	/* If a cffolder of this file is changed, reset a cfdata to read
 1053|       |	 * file contents from next cfdata. */
 1054|     80|	if (prev_folder != cab->entry_cffolder)
  ------------------
  |  Branch (1054:6): [True: 68, False: 12]
  ------------------
 1055|     68|		cab->entry_cfdata = NULL;
 1056|       |
 1057|       |	/* If a pathname is UTF-8, prepare a string conversion object
 1058|       |	 * for UTF-8 and use it. */
 1059|     80|	if (file->attr & ATTR_NAME_IS_UTF) {
  ------------------
  |  |  344|     80|#define ATTR_NAME_IS_UTF	0x80
  ------------------
  |  Branch (1059:6): [True: 1, False: 79]
  ------------------
 1060|      1|		if (cab->sconv_utf8 == NULL) {
  ------------------
  |  Branch (1060:7): [True: 1, False: 0]
  ------------------
 1061|      1|			cab->sconv_utf8 =
 1062|      1|			    archive_string_conversion_from_charset(
 1063|      1|				&(a->archive), "UTF-8", 1);
 1064|      1|			if (cab->sconv_utf8 == NULL)
  ------------------
  |  Branch (1064:8): [True: 0, False: 1]
  ------------------
 1065|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1066|      1|		}
 1067|      1|		sconv = cab->sconv_utf8;
 1068|     79|	} else if (cab->sconv != NULL) {
  ------------------
  |  Branch (1068:13): [True: 0, False: 79]
  ------------------
 1069|       |		/* Choose the conversion specified by the option. */
 1070|      0|		sconv = cab->sconv;
 1071|     79|	} else {
 1072|       |		/* Choose the default conversion. */
 1073|     79|		if (!cab->init_default_conversion) {
  ------------------
  |  Branch (1073:7): [True: 67, False: 12]
  ------------------
 1074|     67|			cab->sconv_default =
 1075|     67|			    archive_string_default_conversion_for_read(
 1076|     67|			      &(a->archive));
 1077|     67|			cab->init_default_conversion = 1;
 1078|     67|		}
 1079|     79|		sconv = cab->sconv_default;
 1080|     79|	}
 1081|       |
 1082|       |	/*
 1083|       |	 * Set a default value and common data
 1084|       |	 */
 1085|     80|	r = cab_convert_path_separator_1(&(file->pathname), file->attr);
 1086|     80|	if (archive_entry_copy_pathname_l(entry, file->pathname.s,
  ------------------
  |  |   80|     80|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (1086:6): [True: 1, False: 79]
  ------------------
 1087|     80|	    archive_strlen(&(file->pathname)), sconv) != 0) {
  ------------------
  |  |  178|     80|#define	archive_strlen(a) ((a)->length)
  ------------------
 1088|      1|		if (errno == ENOMEM) {
  ------------------
  |  Branch (1088:7): [True: 0, False: 1]
  ------------------
 1089|      0|			archive_set_error(&a->archive, ENOMEM,
 1090|      0|			    "Can't allocate memory for Pathname");
 1091|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1092|      0|		}
 1093|      1|		archive_set_error(&a->archive,
 1094|      1|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1095|      1|		    "Pathname cannot be converted "
 1096|      1|		    "from %s to current locale",
 1097|      1|		    archive_string_conversion_charset_name(sconv));
 1098|      1|		err = ARCHIVE_WARN;
  ------------------
  |  |  235|      1|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1099|      1|	}
 1100|     80|	if (r < 0) {
  ------------------
  |  Branch (1100:6): [True: 0, False: 80]
  ------------------
 1101|       |		/* Convert a path separator '\' -> '/' */
 1102|      0|		cab_convert_path_separator_2(cab, entry);
 1103|      0|	}
 1104|       |
 1105|     80|	archive_entry_set_size(entry, file->uncompressed_size);
 1106|     80|	if (file->attr & ATTR_RDONLY)
  ------------------
  |  |  343|     80|#define ATTR_RDONLY		0x01
  ------------------
  |  Branch (1106:6): [True: 13, False: 67]
  ------------------
 1107|     13|		archive_entry_set_mode(entry, AE_IFREG | 0555);
  ------------------
  |  |  216|     13|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1108|     67|	else
 1109|     67|		archive_entry_set_mode(entry, AE_IFREG | 0666);
  ------------------
  |  |  216|     67|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1110|     80|	archive_entry_set_mtime(entry, file->mtime, 0);
 1111|       |
 1112|     80|	cab->entry_bytes_remaining = file->uncompressed_size;
 1113|     80|	cab->entry_offset = 0;
 1114|       |	/* We don't need compress data. */
 1115|     80|	if (file->uncompressed_size == 0)
  ------------------
  |  Branch (1115:6): [True: 0, False: 80]
  ------------------
 1116|      0|		cab->end_of_entry_cleanup = cab->end_of_entry = 1;
 1117|       |
 1118|       |	/* Set up a more descriptive format name. */
 1119|     80|	snprintf(cab->format_name, sizeof(cab->format_name), "CAB %d.%d (%s)",
 1120|     80|	    hd->major, hd->minor, cab->entry_cffolder->compname);
 1121|     80|	a->archive.archive_format_name = cab->format_name;
 1122|       |
 1123|     80|	return (err);
 1124|     80|}
archive_read_support_format_cab.c:cab_read_header:
  727|     72|{
  728|     72|	const char *p;
  729|     72|	struct cab *cab;
  730|     72|	struct cfheader *hd;
  731|     72|	size_t bytes, len, maxlen, used;
  732|     72|	ssize_t avail;
  733|     72|	int64_t skip;
  734|     72|	int err, i;
  735|     72|	int cur_folder, prev_folder;
  736|     72|	uint32_t offset32;
  737|       |	
  738|     72|	a->archive.archive_format = ARCHIVE_FORMAT_CAB;
  ------------------
  |  |  383|     72|#define	ARCHIVE_FORMAT_CAB			0xC0000
  ------------------
  739|     72|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (739:6): [True: 72, False: 0]
  ------------------
  740|     72|		a->archive.archive_format_name = "CAB";
  741|       |
  742|     72|	if ((p = __archive_read_ahead(a, 42, NULL)) == NULL)
  ------------------
  |  Branch (742:6): [True: 0, False: 72]
  ------------------
  743|      0|		return (truncated_error(a));
  744|       |
  745|     72|	cab = (struct cab *)(a->format->data);
  746|     72|	if (cab->found_header == 0 &&
  ------------------
  |  Branch (746:6): [True: 72, False: 0]
  ------------------
  747|     72|	    p[0] == 'M' && p[1] == 'Z') {
  ------------------
  |  Branch (747:6): [True: 72, False: 0]
  |  Branch (747:21): [True: 45, False: 27]
  ------------------
  748|       |		/* This is an executable?  Must be self-extracting... */
  749|     45|		err = cab_skip_sfx(a);
  750|     45|		if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|     45|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (750:7): [True: 0, False: 45]
  ------------------
  751|      0|			return (err);
  752|       |
  753|       |		/* Re-read header after processing the SFX. */
  754|     45|		if ((p = __archive_read_ahead(a, 42, NULL)) == NULL)
  ------------------
  |  Branch (754:7): [True: 0, False: 45]
  ------------------
  755|      0|			return (truncated_error(a));
  756|     45|	}
  757|       |
  758|     72|	cab->cab_offset = 0;
  759|       |	/*
  760|       |	 * Read CFHEADER.
  761|       |	 */
  762|     72|	hd = &cab->cfheader;
  763|     72|	if (p[CFHEADER_signature+0] != 'M' || p[CFHEADER_signature+1] != 'S' ||
  ------------------
  |  |  251|     72|#define CFHEADER_signature	0
  ------------------
              	if (p[CFHEADER_signature+0] != 'M' || p[CFHEADER_signature+1] != 'S' ||
  ------------------
  |  |  251|     72|#define CFHEADER_signature	0
  ------------------
  |  Branch (763:6): [True: 0, False: 72]
  |  Branch (763:40): [True: 0, False: 72]
  ------------------
  764|     72|	    p[CFHEADER_signature+2] != 'C' || p[CFHEADER_signature+3] != 'F') {
  ------------------
  |  |  251|     72|#define CFHEADER_signature	0
  ------------------
              	    p[CFHEADER_signature+2] != 'C' || p[CFHEADER_signature+3] != 'F') {
  ------------------
  |  |  251|     72|#define CFHEADER_signature	0
  ------------------
  |  Branch (764:6): [True: 0, False: 72]
  |  Branch (764:40): [True: 0, False: 72]
  ------------------
  765|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  766|      0|		    "Couldn't find out CAB header");
  767|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  768|      0|	}
  769|     72|	hd->files_offset = archive_le32dec(p + CFHEADER_coffFiles);
  ------------------
  |  |  253|     72|#define CFHEADER_coffFiles	16
  ------------------
  770|     72|	hd->minor = p[CFHEADER_versionMinor];
  ------------------
  |  |  254|     72|#define CFHEADER_versionMinor	24
  ------------------
  771|     72|	hd->major = p[CFHEADER_versionMajor];
  ------------------
  |  |  255|     72|#define CFHEADER_versionMajor	25
  ------------------
  772|     72|	hd->folder_count = archive_le16dec(p + CFHEADER_cFolders);
  ------------------
  |  |  256|     72|#define CFHEADER_cFolders	26
  ------------------
  773|     72|	if (hd->folder_count == 0)
  ------------------
  |  Branch (773:6): [True: 0, False: 72]
  ------------------
  774|      0|		goto invalid;
  775|     72|	hd->file_count = archive_le16dec(p + CFHEADER_cFiles);
  ------------------
  |  |  257|     72|#define CFHEADER_cFiles		28
  ------------------
  776|     72|	if (hd->file_count == 0)
  ------------------
  |  Branch (776:6): [True: 0, False: 72]
  ------------------
  777|      0|		goto invalid;
  778|     72|	hd->flags = archive_le16dec(p + CFHEADER_flags);
  ------------------
  |  |  258|     72|#define CFHEADER_flags		30
  ------------------
  779|     72|	hd->cabinet = archive_le16dec(p + CFHEADER_iCabinet);
  ------------------
  |  |  260|     72|#define CFHEADER_iCabinet	34
  ------------------
  780|     72|	used = CFHEADER_iCabinet + 2;
  ------------------
  |  |  260|     72|#define CFHEADER_iCabinet	34
  ------------------
  781|     72|	if (hd->flags & RESERVE_PRESENT) {
  ------------------
  |  |  355|     72|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (781:6): [True: 0, False: 72]
  ------------------
  782|      0|		uint16_t cfheader;
  783|      0|		cfheader = archive_le16dec(p + CFHEADER_cbCFHeader);
  ------------------
  |  |  261|      0|#define CFHEADER_cbCFHeader	36
  ------------------
  784|      0|		if (cfheader > 60000U)
  ------------------
  |  Branch (784:7): [True: 0, False: 0]
  ------------------
  785|      0|			goto invalid;
  786|      0|		hd->cffolder = p[CFHEADER_cbCFFolder];
  ------------------
  |  |  262|      0|#define CFHEADER_cbCFFolder	38
  ------------------
  787|      0|		hd->cfdata = p[CFHEADER_cbCFData];
  ------------------
  |  |  263|      0|#define CFHEADER_cbCFData	39
  ------------------
  788|      0|		used += 4;/* cbCFHeader, cbCFFolder and cbCFData */
  789|      0|		used += cfheader;/* abReserve */
  790|      0|	} else
  791|     72|		hd->cffolder = 0;/* Avoid compiling warning. */
  792|     72|	if (hd->flags & PREV_CABINET) {
  ------------------
  |  |  353|     72|#define PREV_CABINET	0x0001
  ------------------
  |  Branch (792:6): [True: 0, False: 72]
  ------------------
  793|       |		/* How many bytes are used for szCabinetPrev. */
  794|      0|		if ((p = cab_read_ahead_remaining(a, used + 256,
  ------------------
  |  Branch (794:7): [True: 0, False: 0]
  ------------------
  795|      0|		    &avail)) == NULL || (size_t)avail <= used)
  ------------------
  |  Branch (795:27): [True: 0, False: 0]
  ------------------
  796|      0|			return (truncated_error(a));
  797|      0|		maxlen = avail - used;
  798|      0|		len = cab_strnlen(p + used, maxlen);
  ------------------
  |  |  645|      0|#define cab_strnlen(a,b) strnlen(a,b)
  ------------------
  799|      0|		if (len == 0 || len == maxlen) {
  ------------------
  |  Branch (799:7): [True: 0, False: 0]
  |  Branch (799:19): [True: 0, False: 0]
  ------------------
  800|      0|			goto invalid;
  801|      0|		}
  802|      0|		used += len + 1;
  803|       |		/* How many bytes are used for szDiskPrev. */
  804|      0|		if ((p = cab_read_ahead_remaining(a, used + 256,
  ------------------
  |  Branch (804:7): [True: 0, False: 0]
  ------------------
  805|      0|		    &avail)) == NULL || (size_t)avail <= used)
  ------------------
  |  Branch (805:27): [True: 0, False: 0]
  ------------------
  806|      0|			return (truncated_error(a));
  807|      0|		maxlen = avail - used;
  808|      0|		len = cab_strnlen(p + used, maxlen);
  ------------------
  |  |  645|      0|#define cab_strnlen(a,b) strnlen(a,b)
  ------------------
  809|      0|		if (len == maxlen)
  ------------------
  |  Branch (809:7): [True: 0, False: 0]
  ------------------
  810|      0|			goto invalid;
  811|      0|		used += len + 1;
  812|      0|	}
  813|     72|	if (hd->flags & NEXT_CABINET) {
  ------------------
  |  |  354|     72|#define NEXT_CABINET	0x0002
  ------------------
  |  Branch (813:6): [True: 2, False: 70]
  ------------------
  814|       |		/* How many bytes are used for szCabinetNext. */
  815|      2|		if ((p = cab_read_ahead_remaining(a, used + 256,
  ------------------
  |  Branch (815:7): [True: 0, False: 2]
  ------------------
  816|      2|		    &avail)) == NULL || (size_t)avail <= used)
  ------------------
  |  Branch (816:27): [True: 0, False: 2]
  ------------------
  817|      0|			return (truncated_error(a));
  818|      2|		maxlen = avail - used;
  819|      2|		len = cab_strnlen(p + used, maxlen);
  ------------------
  |  |  645|      2|#define cab_strnlen(a,b) strnlen(a,b)
  ------------------
  820|      2|		if (len == 0 || len == maxlen)
  ------------------
  |  Branch (820:7): [True: 0, False: 2]
  |  Branch (820:19): [True: 0, False: 2]
  ------------------
  821|      0|			goto invalid;
  822|      2|		used += len + 1;
  823|       |		/* How many bytes are used for szDiskNext. */
  824|      2|		if ((p = cab_read_ahead_remaining(a, used + 256,
  ------------------
  |  Branch (824:7): [True: 0, False: 2]
  ------------------
  825|      2|		    &avail)) == NULL || (size_t)avail <= used)
  ------------------
  |  Branch (825:27): [True: 0, False: 2]
  ------------------
  826|      0|			return (truncated_error(a));
  827|      2|		maxlen = avail - used;
  828|      2|		len = cab_strnlen(p + used, maxlen);
  ------------------
  |  |  645|      2|#define cab_strnlen(a,b) strnlen(a,b)
  ------------------
  829|      2|		if (len == maxlen)
  ------------------
  |  Branch (829:7): [True: 0, False: 2]
  ------------------
  830|      0|			goto invalid;
  831|      2|		used += len + 1;
  832|      2|	}
  833|     72|	__archive_read_consume(a, used);
  834|     72|	cab->cab_offset += used;
  835|     72|	used = 0;
  836|       |
  837|       |	/*
  838|       |	 * Read CFFOLDER.
  839|       |	 */
  840|     72|	hd->folder_array = calloc(
  841|     72|	    hd->folder_count, sizeof(struct cffolder));
  842|     72|	if (hd->folder_array == NULL)
  ------------------
  |  Branch (842:6): [True: 0, False: 72]
  ------------------
  843|      0|		goto nomem;
  844|       |	
  845|     72|	bytes = 8;
  846|     72|	if (hd->flags & RESERVE_PRESENT)
  ------------------
  |  |  355|     72|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (846:6): [True: 0, False: 72]
  ------------------
  847|      0|		bytes += hd->cffolder;
  848|     72|	bytes *= hd->folder_count;
  849|     72|	if ((p = __archive_read_ahead(a, bytes, NULL)) == NULL)
  ------------------
  |  Branch (849:6): [True: 0, False: 72]
  ------------------
  850|      0|		return (truncated_error(a));
  851|     72|	offset32 = 0;
  852|    575|	for (i = 0; i < hd->folder_count; i++) {
  ------------------
  |  Branch (852:14): [True: 505, False: 70]
  ------------------
  853|    505|		struct cffolder *folder = &(hd->folder_array[i]);
  854|    505|		folder->cfdata_offset_in_cab =
  855|    505|		    archive_le32dec(p + CFFOLDER_coffCabStart);
  ------------------
  |  |  266|    505|#define CFFOLDER_coffCabStart	0
  ------------------
  856|    505|		folder->cfdata_count = archive_le16dec(p+CFFOLDER_cCFData);
  ------------------
  |  |  267|    505|#define CFFOLDER_cCFData	4
  ------------------
  857|    505|		folder->comptype =
  858|    505|		    archive_le16dec(p+CFFOLDER_typeCompress) & 0x0F;
  ------------------
  |  |  268|    505|#define CFFOLDER_typeCompress	6
  ------------------
  859|    505|		folder->compdata =
  860|    505|		    archive_le16dec(p+CFFOLDER_typeCompress) >> 8;
  ------------------
  |  |  268|    505|#define CFFOLDER_typeCompress	6
  ------------------
  861|       |		/* Get a compression name. */
  862|    505|		if (folder->comptype <
  ------------------
  |  Branch (862:7): [True: 329, False: 176]
  ------------------
  863|    505|		    sizeof(compression_name) / sizeof(compression_name[0]))
  864|    329|			folder->compname = compression_name[folder->comptype];
  865|    176|		else
  866|    176|			folder->compname = "UNKNOWN";
  867|    505|		p += 8;
  868|    505|		used += 8;
  869|    505|		if (hd->flags & RESERVE_PRESENT) {
  ------------------
  |  |  355|    505|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (869:7): [True: 0, False: 505]
  ------------------
  870|      0|			p += hd->cffolder;/* abReserve */
  871|      0|			used += hd->cffolder;
  872|      0|		}
  873|       |		/*
  874|       |		 * Sanity check if each data is acceptable.
  875|       |		 */
  876|    505|		if (offset32 >= folder->cfdata_offset_in_cab)
  ------------------
  |  Branch (876:7): [True: 2, False: 503]
  ------------------
  877|      2|			goto invalid;
  878|    503|		offset32 = folder->cfdata_offset_in_cab;
  879|       |
  880|       |		/* Set a request to initialize zlib for the CFDATA of
  881|       |		 * this folder. */
  882|    503|		folder->decompress_init = 0;
  883|    503|	}
  884|     70|	__archive_read_consume(a, used);
  885|     70|	cab->cab_offset += used;
  886|       |
  887|       |	/*
  888|       |	 * Read CFFILE.
  889|       |	 */
  890|       |	/* Seek read pointer to the offset of CFFILE if needed. */
  891|     70|	skip = (int64_t)hd->files_offset - cab->cab_offset;
  892|     70|	if (skip < 0) {
  ------------------
  |  Branch (892:6): [True: 0, False: 70]
  ------------------
  893|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  894|      0|		    "Invalid offset of CFFILE %jd < %jd",
  895|      0|		    (intmax_t)hd->files_offset, (intmax_t)cab->cab_offset);
  896|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  897|      0|	}
  898|     70|	if (skip) {
  ------------------
  |  Branch (898:6): [True: 0, False: 70]
  ------------------
  899|      0|		if (__archive_read_consume(a, skip) < 0)
  ------------------
  |  Branch (899:7): [True: 0, False: 0]
  ------------------
  900|      0|			return (truncated_error(a));
  901|      0|		cab->cab_offset += skip;
  902|      0|	}
  903|       |	/* Allocate memory for CFDATA */
  904|     70|	hd->file_array = calloc(
  905|     70|	    hd->file_count, sizeof(struct cffile));
  906|     70|	if (hd->file_array == NULL)
  ------------------
  |  Branch (906:6): [True: 0, False: 70]
  ------------------
  907|      0|		goto nomem;
  908|       |
  909|     70|	prev_folder = -1;
  910|    158|	for (i = 0; i < hd->file_count; i++) {
  ------------------
  |  Branch (910:14): [True: 90, False: 68]
  ------------------
  911|     90|		struct cffile *file = &(hd->file_array[i]);
  912|       |
  913|     90|		if ((p = __archive_read_ahead(a, 16, NULL)) == NULL)
  ------------------
  |  Branch (913:7): [True: 0, False: 90]
  ------------------
  914|      0|			return (truncated_error(a));
  915|     90|		file->uncompressed_size = archive_le32dec(p + CFFILE_cbFile);
  ------------------
  |  |  272|     90|#define CFFILE_cbFile		0
  ------------------
  916|     90|		file->offset = archive_le32dec(p + CFFILE_uoffFolderStart);
  ------------------
  |  |  273|     90|#define CFFILE_uoffFolderStart	4
  ------------------
  917|     90|		file->folder = archive_le16dec(p + CFFILE_iFolder);
  ------------------
  |  |  274|     90|#define CFFILE_iFolder		8
  ------------------
  918|     90|		file->mtime = cab_dos_time(p + CFFILE_date_time);
  ------------------
  |  |  275|     90|#define CFFILE_date_time	10
  ------------------
  919|     90|		file->attr = (uint8_t)archive_le16dec(p + CFFILE_attribs);
  ------------------
  |  |  276|     90|#define CFFILE_attribs		14
  ------------------
  920|     90|		__archive_read_consume(a, 16);
  921|       |
  922|     90|		cab->cab_offset += 16;
  923|     90|		if ((p = cab_read_ahead_remaining(a, 256, &avail)) == NULL)
  ------------------
  |  Branch (923:7): [True: 0, False: 90]
  ------------------
  924|      0|			return (truncated_error(a));
  925|     90|		maxlen = avail;
  926|     90|		len = cab_strnlen(p, maxlen);
  ------------------
  |  |  645|     90|#define cab_strnlen(a,b) strnlen(a,b)
  ------------------
  927|     90|		if (len == 0 || len == maxlen)
  ------------------
  |  Branch (927:7): [True: 0, False: 90]
  |  Branch (927:19): [True: 2, False: 88]
  ------------------
  928|      2|			goto invalid;
  929|       |
  930|       |		/* Copy a pathname.  */
  931|     88|		archive_string_init(&(file->pathname));
  ------------------
  |  |   71|     88|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 88]
  |  |  ------------------
  ------------------
  932|     88|		archive_strncpy(&(file->pathname), p, len);
  ------------------
  |  |  173|     88|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
  933|     88|		__archive_read_consume(a, len + 1);
  934|     88|		cab->cab_offset += len + 1;
  935|       |
  936|       |		/*
  937|       |		 * Sanity check if each data is acceptable.
  938|       |		 */
  939|     88|		if (file->uncompressed_size > MAX_FILE_SIZE)
  ------------------
  |  |  285|     88|#define MAX_FILE_SIZE		(UINT16_MAX * MAX_UNCOMPRESS_SIZE)
  |  |  ------------------
  |  |  |  |  284|     88|#define MAX_UNCOMPRESS_SIZE	0x8000
  |  |  ------------------
  ------------------
  |  Branch (939:7): [True: 0, False: 88]
  ------------------
  940|      0|			goto invalid;/* Too large */
  941|     88|		if ((int64_t)file->offset + (int64_t)file->uncompressed_size
  ------------------
  |  Branch (941:7): [True: 0, False: 88]
  ------------------
  942|     88|		    > (int64_t)MAX_FILE_SIZE)
  ------------------
  |  |  285|     88|#define MAX_FILE_SIZE		(UINT16_MAX * MAX_UNCOMPRESS_SIZE)
  |  |  ------------------
  |  |  |  |  284|     88|#define MAX_UNCOMPRESS_SIZE	0x8000
  |  |  ------------------
  ------------------
  943|      0|			goto invalid;/* Too large */
  944|     88|		switch (file->folder) {
  945|     10|		case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  340|     10|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (945:3): [True: 10, False: 78]
  ------------------
  946|       |			/* This must be last file in a folder. */
  947|     10|			if (i != hd->file_count -1)
  ------------------
  |  Branch (947:8): [True: 0, False: 10]
  ------------------
  948|      0|				goto invalid;
  949|     10|			cur_folder = hd->folder_count -1;
  950|     10|			break;
  951|      0|		case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  341|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (951:3): [True: 0, False: 88]
  ------------------
  952|       |			/* This must be only one file in a folder. */
  953|      0|			if (hd->file_count != 1)
  ------------------
  |  Branch (953:8): [True: 0, False: 0]
  ------------------
  954|      0|				goto invalid;
  955|       |			/* FALL THROUGH */
  956|      3|		case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  339|      3|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (956:3): [True: 3, False: 85]
  ------------------
  957|       |			/* This must be first file in a folder. */
  958|      3|			if (i != 0)
  ------------------
  |  Branch (958:8): [True: 0, False: 3]
  ------------------
  959|      0|				goto invalid;
  960|      3|			prev_folder = cur_folder = 0;
  961|      3|			offset32 = file->offset;
  962|      3|			break;
  963|     75|		default:
  ------------------
  |  Branch (963:3): [True: 75, False: 13]
  ------------------
  964|     75|			if (file->folder >= hd->folder_count)
  ------------------
  |  Branch (964:8): [True: 0, False: 75]
  ------------------
  965|      0|				goto invalid;
  966|     75|			cur_folder = file->folder;
  967|     75|			break;
  968|     88|		}
  969|       |		/* Dot not back track. */
  970|     88|		if (cur_folder < prev_folder)
  ------------------
  |  Branch (970:7): [True: 0, False: 88]
  ------------------
  971|      0|			goto invalid;
  972|     88|		if (cur_folder != prev_folder)
  ------------------
  |  Branch (972:7): [True: 65, False: 23]
  ------------------
  973|     65|			offset32 = 0;
  974|     88|		prev_folder = cur_folder;
  975|       |
  976|       |		/* Make sure there are not any blanks from last file
  977|       |		 * contents. */
  978|     88|		if (offset32 != file->offset)
  ------------------
  |  Branch (978:7): [True: 0, False: 88]
  ------------------
  979|      0|			goto invalid;
  980|     88|		offset32 += file->uncompressed_size;
  981|       |
  982|       |		/* CFDATA is available for file contents. */
  983|     88|		if (file->uncompressed_size > 0 &&
  ------------------
  |  Branch (983:7): [True: 88, False: 0]
  ------------------
  984|     88|		    hd->folder_array[cur_folder].cfdata_count == 0)
  ------------------
  |  Branch (984:7): [True: 0, False: 88]
  ------------------
  985|      0|			goto invalid;
  986|     88|	}
  987|       |
  988|     68|	if (hd->cabinet != 0 || hd->flags & (PREV_CABINET | NEXT_CABINET)) {
  ------------------
  |  |  353|     67|#define PREV_CABINET	0x0001
  ------------------
              	if (hd->cabinet != 0 || hd->flags & (PREV_CABINET | NEXT_CABINET)) {
  ------------------
  |  |  354|     67|#define NEXT_CABINET	0x0002
  ------------------
  |  Branch (988:6): [True: 1, False: 67]
  |  Branch (988:26): [True: 0, False: 67]
  ------------------
  989|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  990|      1|		    "Multivolume cabinet file is unsupported");
  991|      1|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      1|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  992|      1|	}
  993|     67|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     67|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  994|      4|invalid:
  995|      4|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  996|      4|	    "Invalid CAB header");
  997|      4|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  998|      0|nomem:
  999|      0|	archive_set_error(&a->archive, ENOMEM,
 1000|      0|	    "Can't allocate memory for CAB data");
 1001|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1002|     68|}
archive_read_support_format_cab.c:truncated_error:
  638|      5|{
  639|      5|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      5|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  640|      5|	    "Truncated CAB header");
  641|      5|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  642|      5|}
archive_read_support_format_cab.c:cab_skip_sfx:
  596|     45|{
  597|     45|	const char *p, *q;
  598|     45|	size_t skip;
  599|     45|	ssize_t bytes, window;
  600|       |
  601|     45|	window = 4096;
  602|     47|	for (;;) {
  603|     47|		const char *h = __archive_read_ahead(a, window, &bytes);
  604|     47|		if (h == NULL) {
  ------------------
  |  Branch (604:7): [True: 2, False: 45]
  ------------------
  605|       |			/* Remaining size is less than window. */
  606|      2|			window >>= 1;
  607|      2|			if (window < 128) {
  ------------------
  |  Branch (607:8): [True: 0, False: 2]
  ------------------
  608|      0|				archive_set_error(&a->archive,
  609|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  610|      0|				    "Couldn't find out CAB header");
  611|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  612|      0|			}
  613|      2|			continue;
  614|      2|		}
  615|     45|		p = h;
  616|     45|		q = p + bytes;
  617|       |
  618|       |		/*
  619|       |		 * Scan ahead until we find something that looks
  620|       |		 * like the cab header.
  621|       |		 */
  622|  32.7k|		while (p + 8 < q) {
  ------------------
  |  Branch (622:10): [True: 32.7k, False: 0]
  ------------------
  623|  32.7k|			int next;
  624|  32.7k|			if ((next = find_cab_magic(p)) == 0) {
  ------------------
  |  Branch (624:8): [True: 45, False: 32.7k]
  ------------------
  625|     45|				skip = p - h;
  626|     45|				__archive_read_consume(a, skip);
  627|     45|				return (ARCHIVE_OK);
  ------------------
  |  |  233|     45|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  628|     45|			}
  629|  32.7k|			p += next;
  630|  32.7k|		}
  631|      0|		skip = p - h;
  632|      0|		__archive_read_consume(a, skip);
  633|      0|	}
  634|     45|}
archive_read_support_format_cab.c:cab_read_ahead_remaining:
  663|     94|{
  664|     94|	const void *p = __archive_read_ahead(a, max, avail);
  665|       |
  666|     94|	if (p == NULL && *avail > 0)
  ------------------
  |  Branch (666:6): [True: 0, False: 94]
  |  Branch (666:19): [True: 0, False: 0]
  ------------------
  667|      0|		p = __archive_read_ahead(a, *avail, avail);
  668|     94|	if (p != NULL && (size_t)*avail > max)
  ------------------
  |  Branch (668:6): [True: 94, False: 0]
  |  Branch (668:19): [True: 94, False: 0]
  ------------------
  669|     94|		*avail = max;
  670|       |
  671|     94|	return (p);
  672|     94|}
archive_read_support_format_cab.c:cab_dos_time:
 2164|     90|{
 2165|     90|	int msTime, msDate;
 2166|     90|	struct tm ts;
 2167|       |
 2168|     90|	msDate = archive_le16dec(p);
 2169|     90|	msTime = archive_le16dec(p+2);
 2170|       |
 2171|     90|	memset(&ts, 0, sizeof(ts));
 2172|     90|	ts.tm_year = ((msDate >> 9) & 0x7f) + 80;   /* Years since 1900. */
 2173|     90|	ts.tm_mon = ((msDate >> 5) & 0x0f) - 1;     /* Month number.     */
 2174|     90|	ts.tm_mday = msDate & 0x1f;		    /* Day of month.     */
 2175|     90|	ts.tm_hour = (msTime >> 11) & 0x1f;
 2176|     90|	ts.tm_min = (msTime >> 5) & 0x3f;
 2177|     90|	ts.tm_sec = (msTime << 1) & 0x3e;
 2178|     90|	ts.tm_isdst = -1;
 2179|     90|	return (mktime(&ts));
 2180|     90|}
archive_read_support_format_cab.c:cab_convert_path_separator_1:
  677|     80|{
  678|     80|	size_t i;
  679|     80|	int mb;
  680|       |
  681|       |	/* Easy check if we have '\' in multi-byte string. */
  682|     80|	mb = 0;
  683|    449|	for (i = 0; i < archive_strlen(fn); i++) {
  ------------------
  |  |  178|    449|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (683:14): [True: 369, False: 80]
  ------------------
  684|    369|		if (fn->s[i] == '\\') {
  ------------------
  |  Branch (684:7): [True: 1, False: 368]
  ------------------
  685|      1|			if (mb) {
  ------------------
  |  Branch (685:8): [True: 0, False: 1]
  ------------------
  686|       |				/* This may be second byte of multi-byte
  687|       |				 * character. */
  688|      0|				break;
  689|      0|			}
  690|      1|			fn->s[i] = '/';
  691|      1|			mb = 0;
  692|    368|		} else if ((fn->s[i] & 0x80) && !(attr & ATTR_NAME_IS_UTF))
  ------------------
  |  |  344|     65|#define ATTR_NAME_IS_UTF	0x80
  ------------------
  |  Branch (692:14): [True: 65, False: 303]
  |  Branch (692:35): [True: 62, False: 3]
  ------------------
  693|     62|			mb = 1;
  694|    306|		else
  695|    306|			mb = 0;
  696|    369|	}
  697|     80|	if (i == archive_strlen(fn))
  ------------------
  |  |  178|     80|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (697:6): [True: 80, False: 0]
  ------------------
  698|     80|		return (0);
  699|      0|	return (-1);
  700|     80|}
archive_read_support_format_cab.c:archive_read_format_cab_read_data:
 1129|    117|{
 1130|    117|	struct cab *cab = (struct cab *)(a->format->data);
 1131|    117|	int r;
 1132|       |
 1133|    117|	switch (cab->entry_cffile->folder) {
 1134|      3|	case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  339|      3|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1134:2): [True: 3, False: 114]
  ------------------
 1135|      9|	case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  340|      9|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1135:2): [True: 6, False: 111]
  ------------------
 1136|      9|	case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  341|      9|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1136:2): [True: 0, False: 117]
  ------------------
 1137|      9|		*buff = NULL;
 1138|      9|		*size = 0;
 1139|      9|		*offset = 0;
 1140|      9|		archive_clear_error(&a->archive);
 1141|      9|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      9|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1142|      9|		    "Cannot restore this file split in multivolume");
 1143|      9|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      9|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1144|    108|	default:
  ------------------
  |  Branch (1144:2): [True: 108, False: 9]
  ------------------
 1145|    108|		break;
 1146|    117|	}
 1147|    108|	if (cab->read_data_invoked == 0) {
  ------------------
  |  Branch (1147:6): [True: 68, False: 40]
  ------------------
 1148|     68|		if (cab->bytes_skipped) {
  ------------------
  |  Branch (1148:7): [True: 3, False: 65]
  ------------------
 1149|      3|			if (cab->entry_cfdata == NULL) {
  ------------------
  |  Branch (1149:8): [True: 3, False: 0]
  ------------------
 1150|      3|				r = cab_next_cfdata(a);
 1151|      3|				if (r < 0)
  ------------------
  |  Branch (1151:9): [True: 0, False: 3]
  ------------------
 1152|      0|					return (r);
 1153|      3|			}
 1154|      3|			if (cab_consume_cfdata(a, cab->bytes_skipped) < 0)
  ------------------
  |  Branch (1154:8): [True: 0, False: 3]
  ------------------
 1155|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1156|      3|			cab->bytes_skipped = 0;
 1157|      3|		}
 1158|     68|		cab->read_data_invoked = 1;
 1159|     68|	}
 1160|    108|	if (cab->entry_unconsumed) {
  ------------------
  |  Branch (1160:6): [True: 21, False: 87]
  ------------------
 1161|       |		/* Consume as much as the compressor actually used. */
 1162|     21|		r = (int)cab_consume_cfdata(a, cab->entry_unconsumed);
 1163|     21|		cab->entry_unconsumed = 0;
 1164|     21|		if (r < 0)
  ------------------
  |  Branch (1164:7): [True: 0, False: 21]
  ------------------
 1165|      0|			return (r);
 1166|     21|	}
 1167|    108|	if (cab->end_of_archive || cab->end_of_entry) {
  ------------------
  |  Branch (1167:6): [True: 0, False: 108]
  |  Branch (1167:29): [True: 32, False: 76]
  ------------------
 1168|     32|		if (!cab->end_of_entry_cleanup) {
  ------------------
  |  Branch (1168:7): [True: 16, False: 16]
  ------------------
 1169|       |			/* End-of-entry cleanup done. */
 1170|     16|			cab->end_of_entry_cleanup = 1;
 1171|     16|		}
 1172|     32|		*offset = cab->entry_offset;
 1173|     32|		*size = 0;
 1174|     32|		*buff = NULL;
 1175|     32|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|     32|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1176|     32|	}
 1177|       |
 1178|     76|	return (cab_read_data(a, buff, size, offset));
 1179|    108|}
archive_read_support_format_cab.c:cab_next_cfdata:
 1314|     91|{
 1315|     91|	struct cab *cab = (struct cab *)(a->format->data);
 1316|     91|	struct cfdata *cfdata = cab->entry_cfdata;
 1317|       |
 1318|       |	/* There are remaining bytes in current CFDATA, use it first. */
 1319|     91|	if (cfdata != NULL && cfdata->uncompressed_bytes_remaining > 0)
  ------------------
  |  Branch (1319:6): [True: 23, False: 68]
  |  Branch (1319:24): [True: 13, False: 10]
  ------------------
 1320|     13|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     13|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1321|       |
 1322|     78|	if (cfdata == NULL) {
  ------------------
  |  Branch (1322:6): [True: 68, False: 10]
  ------------------
 1323|     68|		int64_t skip;
 1324|       |
 1325|     68|		cab->entry_cffolder->cfdata_index = 0;
 1326|       |
 1327|       |		/* Seek read pointer to the offset of CFDATA if needed. */
 1328|     68|		skip = cab->entry_cffolder->cfdata_offset_in_cab
 1329|     68|			- cab->cab_offset;
 1330|     68|		if (skip < 0) {
  ------------------
  |  Branch (1330:7): [True: 0, False: 68]
  ------------------
 1331|      0|			int folder_index;
 1332|      0|			switch (cab->entry_cffile->folder) {
 1333|      0|			case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  339|      0|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1333:4): [True: 0, False: 0]
  ------------------
 1334|      0|			case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  341|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1334:4): [True: 0, False: 0]
  ------------------
 1335|      0|				folder_index = 0;
 1336|      0|				break;
 1337|      0|			case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  340|      0|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1337:4): [True: 0, False: 0]
  ------------------
 1338|      0|				folder_index = cab->cfheader.folder_count-1;
 1339|      0|				break;
 1340|      0|			default:
  ------------------
  |  Branch (1340:4): [True: 0, False: 0]
  ------------------
 1341|      0|				folder_index = cab->entry_cffile->folder;
 1342|      0|				break;
 1343|      0|			}
 1344|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1345|      0|			    "Invalid offset of CFDATA in folder(%d) %jd < %jd",
 1346|      0|			    folder_index,
 1347|      0|			    (intmax_t)cab->entry_cffolder->cfdata_offset_in_cab,
 1348|      0|			    (intmax_t)cab->cab_offset);
 1349|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1350|      0|		}
 1351|     68|		if (skip > 0) {
  ------------------
  |  Branch (1351:7): [True: 14, False: 54]
  ------------------
 1352|     14|			if (__archive_read_consume(a, skip) < 0)
  ------------------
  |  Branch (1352:8): [True: 0, False: 14]
  ------------------
 1353|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1354|     14|			cab->cab_offset =
 1355|     14|			    cab->entry_cffolder->cfdata_offset_in_cab;
 1356|     14|		}
 1357|     68|	}
 1358|       |
 1359|       |	/*
 1360|       |	 * Read a CFDATA.
 1361|       |	 */
 1362|     78|	if (cab->entry_cffolder->cfdata_index <
  ------------------
  |  Branch (1362:6): [True: 76, False: 2]
  ------------------
 1363|     78|	    cab->entry_cffolder->cfdata_count) {
 1364|     76|		const unsigned char *p;
 1365|     76|		int l;
 1366|       |
 1367|     76|		cfdata = &(cab->entry_cffolder->cfdata);
 1368|     76|		cab->entry_cffolder->cfdata_index++;
 1369|     76|		cab->entry_cfdata = cfdata;
 1370|     76|		cfdata->sum_calculated = 0;
 1371|     76|		cfdata->sum_extra_avail = 0;
 1372|     76|		cfdata->sum_ptr = NULL;
 1373|     76|		l = 8;
 1374|     76|		if (cab->cfheader.flags & RESERVE_PRESENT)
  ------------------
  |  |  355|     76|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (1374:7): [True: 0, False: 76]
  ------------------
 1375|      0|			l += cab->cfheader.cfdata;
 1376|     76|		if ((p = __archive_read_ahead(a, l, NULL)) == NULL)
  ------------------
  |  Branch (1376:7): [True: 0, False: 76]
  ------------------
 1377|      0|			return (truncated_error(a));
 1378|     76|		cfdata->sum = archive_le32dec(p + CFDATA_csum);
  ------------------
  |  |  279|     76|#define CFDATA_csum		0
  ------------------
 1379|     76|		cfdata->compressed_size = archive_le16dec(p + CFDATA_cbData);
  ------------------
  |  |  280|     76|#define CFDATA_cbData		4
  ------------------
 1380|     76|		cfdata->compressed_bytes_remaining = cfdata->compressed_size;
 1381|     76|		cfdata->uncompressed_size =
 1382|     76|		    archive_le16dec(p + CFDATA_cbUncomp);
  ------------------
  |  |  281|     76|#define CFDATA_cbUncomp		6
  ------------------
 1383|     76|		cfdata->uncompressed_bytes_remaining =
 1384|     76|		    cfdata->uncompressed_size;
 1385|     76|		cfdata->uncompressed_avail = 0;
 1386|     76|		cfdata->read_offset = 0;
 1387|     76|		cfdata->unconsumed = 0;
 1388|       |
 1389|       |		/*
 1390|       |		 * Sanity check if data size is acceptable.
 1391|       |		 */
 1392|     76|		if (cfdata->compressed_size == 0 ||
  ------------------
  |  Branch (1392:7): [True: 0, False: 76]
  ------------------
 1393|     76|		    cfdata->compressed_size > (MAX_UNCOMPRESS_SIZE + 6144))
  ------------------
  |  |  284|     76|#define MAX_UNCOMPRESS_SIZE	0x8000
  ------------------
  |  Branch (1393:7): [True: 0, False: 76]
  ------------------
 1394|      0|			goto invalid;
 1395|     76|		if (cfdata->uncompressed_size > MAX_UNCOMPRESS_SIZE)
  ------------------
  |  |  284|     76|#define MAX_UNCOMPRESS_SIZE	0x8000
  ------------------
  |  Branch (1395:7): [True: 0, False: 76]
  ------------------
 1396|      0|			goto invalid;
 1397|     76|		if (cfdata->uncompressed_size == 0) {
  ------------------
  |  Branch (1397:7): [True: 1, False: 75]
  ------------------
 1398|      1|			switch (cab->entry_cffile->folder) {
 1399|      0|			case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  341|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1399:4): [True: 0, False: 1]
  ------------------
 1400|      1|			case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  340|      1|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1400:4): [True: 1, False: 0]
  ------------------
 1401|      1|				break;
 1402|      0|			case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  339|      0|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1402:4): [True: 0, False: 1]
  ------------------
 1403|      0|			default:
  ------------------
  |  Branch (1403:4): [True: 0, False: 1]
  ------------------
 1404|      0|				goto invalid;
 1405|      1|			}
 1406|      1|		}
 1407|       |		/* If CFDATA is not last in a folder, an uncompressed
 1408|       |		 * size must be 0x8000(32KBi) */
 1409|     76|		if ((cab->entry_cffolder->cfdata_index <
  ------------------
  |  Branch (1409:7): [True: 46, False: 30]
  ------------------
 1410|     76|		     cab->entry_cffolder->cfdata_count) &&
 1411|     46|		       cfdata->uncompressed_size != MAX_UNCOMPRESS_SIZE)
  ------------------
  |  |  284|     46|#define MAX_UNCOMPRESS_SIZE	0x8000
  ------------------
  |  Branch (1411:10): [True: 0, False: 46]
  ------------------
 1412|      0|			goto invalid;
 1413|       |
 1414|       |		/* A compressed data size and an uncompressed data size must
 1415|       |		 * be the same in no compression mode. */
 1416|     76|		if (cab->entry_cffolder->comptype == COMPTYPE_NONE &&
  ------------------
  |  |  321|    152|#define COMPTYPE_NONE		0x0000
  ------------------
  |  Branch (1416:7): [True: 3, False: 73]
  ------------------
 1417|      3|		    cfdata->compressed_size != cfdata->uncompressed_size)
  ------------------
  |  Branch (1417:7): [True: 0, False: 3]
  ------------------
 1418|      0|			goto invalid;
 1419|       |
 1420|       |		/*
 1421|       |		 * Save CFDATA image for sum check.
 1422|       |		 */
 1423|     76|		if (cfdata->memimage_size < (size_t)l) {
  ------------------
  |  Branch (1423:7): [True: 68, False: 8]
  ------------------
 1424|     68|			free(cfdata->memimage);
 1425|     68|			cfdata->memimage = malloc(l);
 1426|     68|			if (cfdata->memimage == NULL) {
  ------------------
  |  Branch (1426:8): [True: 0, False: 68]
  ------------------
 1427|      0|				archive_set_error(&a->archive, ENOMEM,
 1428|      0|				    "Can't allocate memory for CAB data");
 1429|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1430|      0|			}
 1431|     68|			cfdata->memimage_size = l;
 1432|     68|		}
 1433|     76|		memcpy(cfdata->memimage, p, l);
 1434|       |
 1435|       |		/* Consume bytes as much as we used. */
 1436|     76|		__archive_read_consume(a, l);
 1437|     76|		cab->cab_offset += l;
 1438|     76|	} else if (cab->entry_cffolder->cfdata_count > 0) {
  ------------------
  |  Branch (1438:13): [True: 2, False: 0]
  ------------------
 1439|       |		/* Run out of all CFDATA in a folder. */
 1440|      2|		cfdata->compressed_size = 0;
 1441|      2|		cfdata->uncompressed_size = 0;
 1442|      2|		cfdata->compressed_bytes_remaining = 0;
 1443|      2|		cfdata->uncompressed_bytes_remaining = 0;
 1444|      2|	} else {
 1445|       |		/* Current folder does not have any CFDATA. */
 1446|      0|		cfdata = &(cab->entry_cffolder->cfdata);
 1447|      0|		cab->entry_cfdata = cfdata;
 1448|      0|		memset(cfdata, 0, sizeof(*cfdata));
 1449|      0|	}
 1450|     78|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     78|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1451|      0|invalid:
 1452|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1453|      0|	    "Invalid CFDATA");
 1454|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1455|     78|}
archive_read_support_format_cab.c:cab_consume_cfdata:
 1883|     30|{
 1884|     30|	struct cab *cab = (struct cab *)(a->format->data);
 1885|     30|	struct cfdata *cfdata;
 1886|     30|	int64_t cbytes, rbytes;
 1887|     30|	int err;
 1888|       |
 1889|     30|	rbytes = cab_minimum_consume_cfdata(a, consumed_bytes);
 1890|     30|	if (rbytes < 0)
  ------------------
  |  Branch (1890:6): [True: 0, False: 30]
  ------------------
 1891|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1892|       |
 1893|     30|	cfdata = cab->entry_cfdata;
 1894|     37|	while (rbytes > 0) {
  ------------------
  |  Branch (1894:9): [True: 12, False: 25]
  ------------------
 1895|     12|		ssize_t avail;
 1896|       |
 1897|     12|		if (cfdata->compressed_size == 0) {
  ------------------
  |  Branch (1897:7): [True: 0, False: 12]
  ------------------
 1898|      0|			archive_set_error(&a->archive,
 1899|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1900|      0|			    "Invalid CFDATA");
 1901|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1902|      0|		}
 1903|     12|		cbytes = cfdata->uncompressed_bytes_remaining;
 1904|     12|		if (cbytes > rbytes)
  ------------------
  |  Branch (1904:7): [True: 3, False: 9]
  ------------------
 1905|      3|			cbytes = rbytes;
 1906|     12|		rbytes -= cbytes;
 1907|       |
 1908|     12|		if (cfdata->uncompressed_avail == 0 &&
  ------------------
  |  Branch (1908:7): [True: 7, False: 5]
  ------------------
 1909|      7|		   (cab->entry_cffile->folder == iFoldCONTINUED_PREV_AND_NEXT ||
  ------------------
  |  |  341|     14|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1909:7): [True: 0, False: 7]
  ------------------
 1910|      7|		    cab->entry_cffile->folder == iFoldCONTINUED_FROM_PREV)) {
  ------------------
  |  |  339|      7|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1910:7): [True: 0, False: 7]
  ------------------
 1911|       |			/* We have not read any data yet. */
 1912|      0|			if (cbytes == cfdata->uncompressed_bytes_remaining) {
  ------------------
  |  Branch (1912:8): [True: 0, False: 0]
  ------------------
 1913|       |				/* Skip whole current CFDATA. */
 1914|      0|				__archive_read_consume(a,
 1915|      0|				    cfdata->compressed_size);
 1916|      0|				cab->cab_offset += cfdata->compressed_size;
 1917|      0|				cfdata->compressed_bytes_remaining = 0;
 1918|      0|				cfdata->uncompressed_bytes_remaining = 0;
 1919|      0|				err = cab_next_cfdata(a);
 1920|      0|				if (err < 0)
  ------------------
  |  Branch (1920:9): [True: 0, False: 0]
  ------------------
 1921|      0|					return (err);
 1922|      0|				cfdata = cab->entry_cfdata;
 1923|      0|				if (cfdata->uncompressed_size == 0) {
  ------------------
  |  Branch (1923:9): [True: 0, False: 0]
  ------------------
 1924|      0|					switch (cab->entry_cffile->folder) {
 1925|      0|					case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  341|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1925:6): [True: 0, False: 0]
  ------------------
 1926|      0|					case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  340|      0|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1926:6): [True: 0, False: 0]
  ------------------
 1927|      0|					case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  339|      0|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1927:6): [True: 0, False: 0]
  ------------------
 1928|      0|						rbytes = 0;
 1929|      0|						break;
 1930|      0|					default:
  ------------------
  |  Branch (1930:6): [True: 0, False: 0]
  ------------------
 1931|      0|						break;
 1932|      0|					}
 1933|      0|				}
 1934|      0|				continue;
 1935|      0|			}
 1936|      0|			cfdata->read_offset += (uint16_t)cbytes;
 1937|      0|			cfdata->uncompressed_bytes_remaining -= (uint16_t)cbytes;
 1938|      0|			break;
 1939|     12|		} else if (cbytes == 0) {
  ------------------
  |  Branch (1939:14): [True: 5, False: 7]
  ------------------
 1940|      5|			err = cab_next_cfdata(a);
 1941|      5|			if (err < 0)
  ------------------
  |  Branch (1941:8): [True: 0, False: 5]
  ------------------
 1942|      0|				return (err);
 1943|      5|			cfdata = cab->entry_cfdata;
 1944|      5|			if (cfdata->uncompressed_size == 0) {
  ------------------
  |  Branch (1944:8): [True: 1, False: 4]
  ------------------
 1945|      1|				switch (cab->entry_cffile->folder) {
 1946|      0|				case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  341|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1946:5): [True: 0, False: 1]
  ------------------
 1947|      1|				case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  340|      1|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1947:5): [True: 1, False: 0]
  ------------------
 1948|      1|				case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  339|      1|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1948:5): [True: 0, False: 1]
  ------------------
 1949|      1|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1950|      0|				default:
  ------------------
  |  Branch (1950:5): [True: 0, False: 1]
  ------------------
 1951|      0|					break;
 1952|      1|				}
 1953|      1|			}
 1954|      4|			continue;
 1955|      5|		}
 1956|     10|		while (cbytes > 0) {
  ------------------
  |  Branch (1956:10): [True: 7, False: 3]
  ------------------
 1957|      7|			(void)cab_read_ahead_cfdata(a, &avail);
 1958|      7|			if (avail <= 0)
  ------------------
  |  Branch (1958:8): [True: 4, False: 3]
  ------------------
 1959|      4|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1960|      3|			if (avail > cbytes)
  ------------------
  |  Branch (1960:8): [True: 3, False: 0]
  ------------------
 1961|      3|				avail = (ssize_t)cbytes;
 1962|      3|			if (cab_minimum_consume_cfdata(a, avail) < 0)
  ------------------
  |  Branch (1962:8): [True: 0, False: 3]
  ------------------
 1963|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1964|      3|			cbytes -= avail;
 1965|      3|		}
 1966|      7|	}
 1967|     25|	return (consumed_bytes);
 1968|     30|}
archive_read_support_format_cab.c:cab_minimum_consume_cfdata:
 1976|    516|{
 1977|    516|	struct cab *cab = (struct cab *)(a->format->data);
 1978|    516|	struct cfdata *cfdata;
 1979|    516|	int64_t cbytes, rbytes;
 1980|    516|	int err;
 1981|       |
 1982|    516|	cfdata = cab->entry_cfdata;
 1983|    516|	rbytes = consumed_bytes;
 1984|    516|	if (cab->entry_cffolder->comptype == COMPTYPE_NONE) {
  ------------------
  |  |  321|    516|#define COMPTYPE_NONE		0x0000
  ------------------
  |  Branch (1984:6): [True: 9, False: 507]
  ------------------
 1985|      9|		if (consumed_bytes < cfdata->unconsumed)
  ------------------
  |  Branch (1985:7): [True: 3, False: 6]
  ------------------
 1986|      3|			cbytes = consumed_bytes;
 1987|      6|		else
 1988|      6|			cbytes = cfdata->unconsumed;
 1989|      9|		rbytes -= cbytes; 
 1990|      9|		cfdata->read_offset += (uint16_t)cbytes;
 1991|      9|		cfdata->uncompressed_bytes_remaining -= (uint16_t)cbytes;
 1992|      9|		cfdata->unconsumed -= cbytes;
 1993|    507|	} else {
 1994|    507|		cbytes = cfdata->uncompressed_avail - cfdata->read_offset;
 1995|    507|		if (cbytes > 0) {
  ------------------
  |  Branch (1995:7): [True: 24, False: 483]
  ------------------
 1996|     24|			if (consumed_bytes < cbytes)
  ------------------
  |  Branch (1996:8): [True: 15, False: 9]
  ------------------
 1997|     15|				cbytes = consumed_bytes;
 1998|     24|			rbytes -= cbytes;
 1999|     24|			cfdata->read_offset += (uint16_t)cbytes;
 2000|     24|			cfdata->uncompressed_bytes_remaining -= (uint16_t)cbytes;
 2001|     24|		}
 2002|       |
 2003|    507|		if (cfdata->unconsumed) {
  ------------------
  |  Branch (2003:7): [True: 482, False: 25]
  ------------------
 2004|    482|			cbytes = cfdata->unconsumed;
 2005|    482|			cfdata->unconsumed = 0;
 2006|    482|		} else
 2007|     25|			cbytes = 0;
 2008|    507|	}
 2009|    516|	if (cbytes) {
  ------------------
  |  Branch (2009:6): [True: 488, False: 28]
  ------------------
 2010|       |		/* Compute the sum. */
 2011|    488|		cab_checksum_update(a, (size_t)cbytes);
 2012|       |
 2013|       |		/* Consume as much as the compressor actually used. */
 2014|    488|		__archive_read_consume(a, cbytes);
 2015|    488|		cab->cab_offset += cbytes;
 2016|    488|		cfdata->compressed_bytes_remaining -= (uint16_t)cbytes;
 2017|    488|		if (cfdata->compressed_bytes_remaining == 0) {
  ------------------
  |  Branch (2017:7): [True: 17, False: 471]
  ------------------
 2018|     17|			err = cab_checksum_finish(a);
 2019|     17|			if (err < 0)
  ------------------
  |  Branch (2019:8): [True: 0, False: 17]
  ------------------
 2020|      0|				return (err);
 2021|     17|		}
 2022|    488|	}
 2023|    516|	return (rbytes);
 2024|    516|}
archive_read_support_format_cab.c:cab_checksum_update:
 1229|    488|{
 1230|    488|	struct cab *cab = (struct cab *)(a->format->data);
 1231|    488|	struct cfdata *cfdata = cab->entry_cfdata;
 1232|    488|	const unsigned char *p;
 1233|    488|	size_t sumbytes;
 1234|       |
 1235|    488|	if (cfdata->sum == 0 || cfdata->sum_ptr == NULL)
  ------------------
  |  Branch (1235:6): [True: 52, False: 436]
  |  Branch (1235:26): [True: 0, False: 436]
  ------------------
 1236|     52|		return;
 1237|       |	/*
 1238|       |	 * Calculate the sum of this CFDATA.
 1239|       |	 * Make sure CFDATA must be calculated in four bytes.
 1240|       |	 */
 1241|    436|	p = cfdata->sum_ptr;
 1242|    436|	sumbytes = bytes;
 1243|    436|	if (cfdata->sum_extra_avail) {
  ------------------
  |  Branch (1243:6): [True: 192, False: 244]
  ------------------
 1244|    574|		while (cfdata->sum_extra_avail < 4 && sumbytes > 0) {
  ------------------
  |  Branch (1244:10): [True: 382, False: 192]
  |  Branch (1244:41): [True: 382, False: 0]
  ------------------
 1245|    382|			cfdata->sum_extra[
 1246|    382|			    cfdata->sum_extra_avail++] = *p++;
 1247|    382|			sumbytes--;
 1248|    382|		}
 1249|    192|		if (cfdata->sum_extra_avail == 4) {
  ------------------
  |  Branch (1249:7): [True: 192, False: 0]
  ------------------
 1250|    192|			cfdata->sum_calculated = cab_checksum_cfdata_4(
 1251|    192|			    cfdata->sum_extra, 4, cfdata->sum_calculated);
 1252|    192|			cfdata->sum_extra_avail = 0;
 1253|    192|		}
 1254|    192|	}
 1255|    436|	if (sumbytes) {
  ------------------
  |  Branch (1255:6): [True: 436, False: 0]
  ------------------
 1256|    436|		int odd = sumbytes & 3;
 1257|    436|		if ((int)(sumbytes - odd) > 0)
  ------------------
  |  Branch (1257:7): [True: 436, False: 0]
  ------------------
 1258|    436|			cfdata->sum_calculated = cab_checksum_cfdata_4(
 1259|    436|			    p, sumbytes - odd, cfdata->sum_calculated);
 1260|    436|		if (odd)
  ------------------
  |  Branch (1260:7): [True: 203, False: 233]
  ------------------
 1261|    203|			memcpy(cfdata->sum_extra, p + sumbytes - odd, odd);
 1262|    436|		cfdata->sum_extra_avail = odd;
 1263|    436|	}
 1264|       |	cfdata->sum_ptr = NULL;
 1265|    436|}
archive_read_support_format_cab.c:cab_checksum_cfdata_4:
 1183|    650|{
 1184|    650|	const unsigned char *b;
 1185|    650|	unsigned u32num;
 1186|    650|	uint32_t sum;
 1187|       |
 1188|    650|	u32num = (unsigned)bytes / 4;
 1189|    650|	sum = seed;
 1190|    650|	b = p;
 1191|   104k|	for (;u32num > 0; --u32num) {
  ------------------
  |  Branch (1191:8): [True: 103k, False: 650]
  ------------------
 1192|   103k|		sum ^= archive_le32dec(b);
 1193|   103k|		b += 4;
 1194|   103k|	}
 1195|    650|	return (sum);
 1196|    650|}
archive_read_support_format_cab.c:cab_checksum_finish:
 1269|     17|{
 1270|     17|	struct cab *cab = (struct cab *)(a->format->data);
 1271|     17|	struct cfdata *cfdata = cab->entry_cfdata;
 1272|     17|	int l;
 1273|       |
 1274|       |	/* Do not need to compute a sum. */
 1275|     17|	if (cfdata->sum == 0)
  ------------------
  |  Branch (1275:6): [True: 0, False: 17]
  ------------------
 1276|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1277|       |
 1278|       |	/*
 1279|       |	 * Calculate the sum of remaining CFDATA.
 1280|       |	 */
 1281|     17|	if (cfdata->sum_extra_avail) {
  ------------------
  |  Branch (1281:6): [True: 5, False: 12]
  ------------------
 1282|      5|		cfdata->sum_calculated =
 1283|      5|		    cab_checksum_cfdata(cfdata->sum_extra,
 1284|      5|		       cfdata->sum_extra_avail, cfdata->sum_calculated);
 1285|      5|		cfdata->sum_extra_avail = 0;
 1286|      5|	}
 1287|       |
 1288|     17|	l = 4;
 1289|     17|	if (cab->cfheader.flags & RESERVE_PRESENT)
  ------------------
  |  |  355|     17|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (1289:6): [True: 0, False: 17]
  ------------------
 1290|      0|		l += cab->cfheader.cfdata;
 1291|     17|	if (cfdata->memimage == NULL) {
  ------------------
  |  Branch (1291:6): [True: 0, False: 17]
  ------------------
 1292|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1293|      0|	}
 1294|     17|	cfdata->sum_calculated = cab_checksum_cfdata(
 1295|     17|	    cfdata->memimage + CFDATA_cbData, l, cfdata->sum_calculated);
  ------------------
  |  |  280|     17|#define CFDATA_cbData		4
  ------------------
 1296|     17|	if (cfdata->sum_calculated != cfdata->sum) {
  ------------------
  |  Branch (1296:6): [True: 17, False: 0]
  ------------------
 1297|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 1298|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 1299|       |		    "Checksum error CFDATA[%d] %" PRIx32 ":%" PRIx32 " in %d bytes",
 1300|       |		    cab->entry_cffolder->cfdata_index -1,
 1301|       |		    cfdata->sum, cfdata->sum_calculated,
 1302|       |		    cfdata->compressed_size);
 1303|       |		return (ARCHIVE_FAILED);
 1304|       |#endif
 1305|     17|	}
 1306|     17|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     17|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1307|     17|}
archive_read_support_format_cab.c:cab_checksum_cfdata:
 1200|     22|{
 1201|     22|	const unsigned char *b;
 1202|     22|	uint32_t sum;
 1203|     22|	uint32_t t;
 1204|       |
 1205|     22|	sum = cab_checksum_cfdata_4(p, bytes, seed);
 1206|     22|	b = p;
 1207|     22|	b += bytes & ~3;
 1208|     22|	t = 0;
 1209|     22|	switch (bytes & 3) {
 1210|      2|	case 3:
  ------------------
  |  Branch (1210:2): [True: 2, False: 20]
  ------------------
 1211|      2|		t |= ((uint32_t)(*b++)) << 16;
 1212|       |		/* FALL THROUGH */
 1213|      2|	case 2:
  ------------------
  |  Branch (1213:2): [True: 0, False: 22]
  ------------------
 1214|      2|		t |= ((uint32_t)(*b++)) << 8;
 1215|       |		/* FALL THROUGH */
 1216|      5|	case 1:
  ------------------
  |  Branch (1216:2): [True: 3, False: 19]
  ------------------
 1217|      5|		t |= *b;
 1218|       |		/* FALL THROUGH */
 1219|     22|	default:
  ------------------
  |  Branch (1219:2): [True: 17, False: 5]
  ------------------
 1220|     22|		break;
 1221|     22|	}
 1222|     22|	sum ^= t;
 1223|       |
 1224|     22|	return (sum);
 1225|     22|}
archive_read_support_format_cab.c:cab_read_ahead_cfdata:
 1462|     83|{
 1463|     83|	struct cab *cab = (struct cab *)(a->format->data);
 1464|     83|	int err;
 1465|       |
 1466|     83|	err = cab_next_cfdata(a);
 1467|     83|	if (err < ARCHIVE_OK) {
  ------------------
  |  |  233|     83|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1467:6): [True: 0, False: 83]
  ------------------
 1468|      0|		*avail = err;
 1469|      0|		return (NULL);
 1470|      0|	}
 1471|       |
 1472|     83|	switch (cab->entry_cffolder->comptype) {
 1473|      7|	case COMPTYPE_NONE:
  ------------------
  |  |  321|      7|#define COMPTYPE_NONE		0x0000
  ------------------
  |  Branch (1473:2): [True: 7, False: 76]
  ------------------
 1474|      7|		return (cab_read_ahead_cfdata_none(a, avail));
 1475|     27|	case COMPTYPE_MSZIP:
  ------------------
  |  |  322|     27|#define COMPTYPE_MSZIP		0x0001
  ------------------
  |  Branch (1475:2): [True: 27, False: 56]
  ------------------
 1476|     27|		return (cab_read_ahead_cfdata_deflate(a, avail));
 1477|     49|	case COMPTYPE_LZX:
  ------------------
  |  |  324|     49|#define COMPTYPE_LZX		0x0003
  ------------------
  |  Branch (1477:2): [True: 49, False: 34]
  ------------------
 1478|     49|		return (cab_read_ahead_cfdata_lzx(a, avail));
 1479|      0|	default: /* Unsupported compression. */
  ------------------
  |  Branch (1479:2): [True: 0, False: 83]
  ------------------
 1480|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1481|      0|		    "Unsupported CAB compression: %s",
 1482|      0|		    cab->entry_cffolder->compname);
 1483|      0|		*avail = ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1484|       |		return (NULL);
 1485|     83|	}
 1486|     83|}
archive_read_support_format_cab.c:cab_read_ahead_cfdata_none:
 1493|      7|{
 1494|      7|	struct cab *cab = (struct cab *)(a->format->data);
 1495|      7|	struct cfdata *cfdata;
 1496|      7|	const void *d;
 1497|       |
 1498|      7|	cfdata = cab->entry_cfdata;
 1499|       |
 1500|       |	/*
 1501|       |	 * Note: '1' here is a performance optimization.
 1502|       |	 * Recall that the decompression layer returns a count of
 1503|       |	 * available bytes; asking for more than that forces the
 1504|       |	 * decompressor to combine reads by copying data.
 1505|       |	 */
 1506|      7|	d = __archive_read_ahead(a, 1, avail);
 1507|      7|	if (*avail <= 0) {
  ------------------
  |  Branch (1507:6): [True: 0, False: 7]
  ------------------
 1508|      0|		*avail = truncated_error(a);
 1509|      0|		return (NULL);
 1510|      0|	}
 1511|      7|	if (*avail > cfdata->uncompressed_bytes_remaining)
  ------------------
  |  Branch (1511:6): [True: 3, False: 4]
  ------------------
 1512|      3|		*avail = cfdata->uncompressed_bytes_remaining;
 1513|      7|	cfdata->uncompressed_avail = cfdata->uncompressed_size;
 1514|      7|	cfdata->unconsumed = *avail;
 1515|      7|	cfdata->sum_ptr = d;
 1516|      7|	return (d);
 1517|      7|}
archive_read_support_format_cab.c:cab_read_ahead_cfdata_deflate:
 1525|     27|{
 1526|     27|	struct cab *cab = (struct cab *)(a->format->data);
 1527|     27|	struct cfdata *cfdata;
 1528|     27|	const void *d;
 1529|     27|	int r, mszip;
 1530|     27|	uint16_t uavail;
 1531|     27|	char eod = 0;
 1532|       |
 1533|     27|	cfdata = cab->entry_cfdata;
 1534|       |	/* If the buffer hasn't been allocated, allocate it now. */
 1535|     27|	if (cab->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (1535:6): [True: 18, False: 9]
  ------------------
 1536|     18|		cab->uncompressed_buffer_size = MAX_UNCOMPRESS_SIZE;
  ------------------
  |  |  284|     18|#define MAX_UNCOMPRESS_SIZE	0x8000
  ------------------
 1537|     18|		cab->uncompressed_buffer
 1538|     18|		    = malloc(cab->uncompressed_buffer_size);
 1539|     18|		if (cab->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (1539:7): [True: 0, False: 18]
  ------------------
 1540|      0|			archive_set_error(&a->archive, ENOMEM,
 1541|      0|			    "No memory for CAB reader");
 1542|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1543|      0|			return (NULL);
 1544|      0|		}
 1545|     18|	}
 1546|       |
 1547|     27|	uavail = cfdata->uncompressed_avail;
 1548|     27|	if (uavail == cfdata->uncompressed_size) {
  ------------------
  |  Branch (1548:6): [True: 3, False: 24]
  ------------------
 1549|      3|		d = cab->uncompressed_buffer + cfdata->read_offset;
 1550|      3|		*avail = uavail - cfdata->read_offset;
 1551|      3|		return (d);
 1552|      3|	}
 1553|       |
 1554|     24|	if (!cab->entry_cffolder->decompress_init) {
  ------------------
  |  Branch (1554:6): [True: 18, False: 6]
  ------------------
 1555|     18|		cab->stream.next_in = NULL;
 1556|     18|		cab->stream.avail_in = 0;
 1557|     18|		cab->stream.total_in = 0;
 1558|     18|		cab->stream.next_out = NULL;
 1559|     18|		cab->stream.avail_out = 0;
 1560|     18|		cab->stream.total_out = 0;
 1561|     18|		if (cab->stream_valid)
  ------------------
  |  Branch (1561:7): [True: 0, False: 18]
  ------------------
 1562|      0|			r = inflateReset(&cab->stream);
 1563|     18|		else
 1564|     18|			r = inflateInit2(&cab->stream,
 1565|     18|			    -15 /* Don't check for zlib header */);
 1566|     18|		if (r != Z_OK) {
  ------------------
  |  Branch (1566:7): [True: 0, False: 18]
  ------------------
 1567|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1568|      0|			    "Can't initialize deflate decompression");
 1569|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1570|      0|			return (NULL);
 1571|      0|		}
 1572|       |		/* Stream structure has been set up. */
 1573|     18|		cab->stream_valid = 1;
 1574|       |		/* We've initialized decompression for this stream. */
 1575|     18|		cab->entry_cffolder->decompress_init = 1;
 1576|     18|	}
 1577|       |
 1578|     24|	if (cfdata->compressed_bytes_remaining == cfdata->compressed_size)
  ------------------
  |  Branch (1578:6): [True: 24, False: 0]
  ------------------
 1579|     24|		mszip = 2;
 1580|      0|	else
 1581|      0|		mszip = 0;
 1582|     24|	eod = 0;
 1583|     24|	cab->stream.total_out = uavail;
 1584|       |	/*
 1585|       |	 * We always uncompress all data in current CFDATA.
 1586|       |	 */
 1587|     39|	while (!eod && cab->stream.total_out < cfdata->uncompressed_size) {
  ------------------
  |  Branch (1587:9): [True: 39, False: 0]
  |  Branch (1587:17): [True: 25, False: 14]
  ------------------
 1588|     25|		ssize_t bytes_avail;
 1589|       |
 1590|     25|		cab->stream.next_out =
 1591|     25|		    cab->uncompressed_buffer + cab->stream.total_out;
 1592|     25|		cab->stream.avail_out =
 1593|     25|		    cfdata->uncompressed_size - cab->stream.total_out;
 1594|       |
 1595|     25|		d = __archive_read_ahead(a, 1, &bytes_avail);
 1596|     25|		if (bytes_avail <= 0) {
  ------------------
  |  Branch (1596:7): [True: 0, False: 25]
  ------------------
 1597|      0|			*avail = truncated_error(a);
 1598|      0|			return (NULL);
 1599|      0|		}
 1600|     25|		if (bytes_avail > cfdata->compressed_bytes_remaining)
  ------------------
  |  Branch (1600:7): [True: 13, False: 12]
  ------------------
 1601|     13|			bytes_avail = cfdata->compressed_bytes_remaining;
 1602|       |		/*
 1603|       |		 * A bug in zlib.h: stream.next_in should be marked 'const'
 1604|       |		 * but isn't (the library never alters data through the
 1605|       |		 * next_in pointer, only reads it).  The result: this ugly
 1606|       |		 * cast to remove 'const'.
 1607|       |		 */
 1608|     25|		cab->stream.next_in = (Bytef *)(uintptr_t)d;
 1609|     25|		cab->stream.avail_in = (uInt)bytes_avail;
 1610|     25|		cab->stream.total_in = 0;
 1611|       |
 1612|       |		/* Cut out a tow-byte MSZIP signature(0x43, 0x4b). */
 1613|     25|		if (mszip > 0) {
  ------------------
  |  Branch (1613:7): [True: 24, False: 1]
  ------------------
 1614|     24|			if (bytes_avail <= 0)
  ------------------
  |  Branch (1614:8): [True: 0, False: 24]
  ------------------
 1615|      0|				goto nomszip;
 1616|     24|			if (bytes_avail <= mszip) {
  ------------------
  |  Branch (1616:8): [True: 1, False: 23]
  ------------------
 1617|      1|				if (mszip == 2) {
  ------------------
  |  Branch (1617:9): [True: 1, False: 0]
  ------------------
 1618|      1|					if (cab->stream.next_in[0] != 0x43)
  ------------------
  |  Branch (1618:10): [True: 1, False: 0]
  ------------------
 1619|      1|						goto nomszip;
 1620|      0|					if (bytes_avail > 1 &&
  ------------------
  |  Branch (1620:10): [True: 0, False: 0]
  ------------------
 1621|      0|					    cab->stream.next_in[1] != 0x4b)
  ------------------
  |  Branch (1621:10): [True: 0, False: 0]
  ------------------
 1622|      0|						goto nomszip;
 1623|      0|				} else if (cab->stream.next_in[0] != 0x4b)
  ------------------
  |  Branch (1623:16): [True: 0, False: 0]
  ------------------
 1624|      0|					goto nomszip;
 1625|      0|				cfdata->unconsumed = bytes_avail;
 1626|      0|				cfdata->sum_ptr = d;
 1627|      0|				if (cab_minimum_consume_cfdata(
  ------------------
  |  Branch (1627:9): [True: 0, False: 0]
  ------------------
 1628|      0|				    a, cfdata->unconsumed) < 0) {
 1629|      0|					*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1630|      0|					return (NULL);
 1631|      0|				}
 1632|      0|				mszip -= (int)bytes_avail;
 1633|      0|				continue;
 1634|      0|			}
 1635|     23|			if (mszip == 1 && cab->stream.next_in[0] != 0x4b)
  ------------------
  |  Branch (1635:8): [True: 0, False: 23]
  |  Branch (1635:22): [True: 0, False: 0]
  ------------------
 1636|      0|				goto nomszip;
 1637|     23|			else if (mszip == 2 && (cab->stream.next_in[0] != 0x43 ||
  ------------------
  |  Branch (1637:13): [True: 23, False: 0]
  |  Branch (1637:28): [True: 5, False: 18]
  ------------------
 1638|     18|			    cab->stream.next_in[1] != 0x4b))
  ------------------
  |  Branch (1638:8): [True: 1, False: 17]
  ------------------
 1639|      6|				goto nomszip;
 1640|     17|			cab->stream.next_in += mszip;
 1641|     17|			cab->stream.avail_in -= mszip;
 1642|     17|			cab->stream.total_in += mszip;
 1643|     17|			mszip = 0;
 1644|     17|		}
 1645|       |
 1646|     18|		r = inflate(&cab->stream, 0);
 1647|     18|		switch (r) {
 1648|     15|		case Z_OK:
  ------------------
  |  Branch (1648:3): [True: 15, False: 3]
  ------------------
 1649|     15|			break;
 1650|      0|		case Z_STREAM_END:
  ------------------
  |  Branch (1650:3): [True: 0, False: 18]
  ------------------
 1651|      0|			eod = 1;
 1652|      0|			break;
 1653|      3|		default:
  ------------------
  |  Branch (1653:3): [True: 3, False: 15]
  ------------------
 1654|      3|			goto zlibfailed;
 1655|     18|		}
 1656|     15|		cfdata->unconsumed = cab->stream.total_in;
 1657|     15|		cfdata->sum_ptr = d;
 1658|     15|		if (cab_minimum_consume_cfdata(a, cfdata->unconsumed) < 0) {
  ------------------
  |  Branch (1658:7): [True: 0, False: 15]
  ------------------
 1659|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1660|      0|			return (NULL);
 1661|      0|		}
 1662|     15|	}
 1663|     14|	uavail = (uint16_t)cab->stream.total_out;
 1664|       |
 1665|     14|	if (uavail < cfdata->uncompressed_size) {
  ------------------
  |  Branch (1665:6): [True: 0, False: 14]
  ------------------
 1666|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1667|      0|		    "Invalid uncompressed size (%d < %d)",
 1668|      0|		    uavail, cfdata->uncompressed_size);
 1669|      0|		*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1670|      0|		return (NULL);
 1671|      0|	}
 1672|       |
 1673|       |	/*
 1674|       |	 * Note: I suspect there is a bug in makecab.exe because, in rare
 1675|       |	 * case, compressed bytes are still remaining regardless we have
 1676|       |	 * gotten all uncompressed bytes, which size is recorded in CFDATA,
 1677|       |	 * as much as we need, and we have to use the garbage so as to
 1678|       |	 * correctly compute the sum of CFDATA accordingly.
 1679|       |	 */
 1680|     14|	if (cfdata->compressed_bytes_remaining > 0) {
  ------------------
  |  Branch (1680:6): [True: 14, False: 0]
  ------------------
 1681|     14|		d = __archive_read_ahead(a, cfdata->compressed_bytes_remaining,
 1682|     14|		    NULL);
 1683|     14|		if (d == NULL) {
  ------------------
  |  Branch (1683:7): [True: 4, False: 10]
  ------------------
 1684|      4|			*avail = truncated_error(a);
 1685|      4|			return (NULL);
 1686|      4|		}
 1687|     10|		cfdata->unconsumed = cfdata->compressed_bytes_remaining;
 1688|     10|		cfdata->sum_ptr = d;
 1689|     10|		if (cab_minimum_consume_cfdata(a, cfdata->unconsumed) < 0) {
  ------------------
  |  Branch (1689:7): [True: 0, False: 10]
  ------------------
 1690|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1691|      0|			return (NULL);
 1692|      0|		}
 1693|     10|	}
 1694|       |
 1695|       |	/*
 1696|       |	 * Set dictionary data for decompressing of next CFDATA, which
 1697|       |	 * in the same folder. This is why we always do decompress CFDATA
 1698|       |	 * even if beginning CFDATA or some of CFDATA are not used in
 1699|       |	 * skipping file data.
 1700|       |	 */
 1701|     10|	if (cab->entry_cffolder->cfdata_index <
  ------------------
  |  Branch (1701:6): [True: 9, False: 1]
  ------------------
 1702|     10|	    cab->entry_cffolder->cfdata_count) {
 1703|      9|		r = inflateReset(&cab->stream);
 1704|      9|		if (r != Z_OK)
  ------------------
  |  Branch (1704:7): [True: 0, False: 9]
  ------------------
 1705|      0|			goto zlibfailed;
 1706|      9|		r = inflateSetDictionary(&cab->stream,
 1707|      9|		    cab->uncompressed_buffer, cfdata->uncompressed_size);
 1708|      9|		if (r != Z_OK)
  ------------------
  |  Branch (1708:7): [True: 0, False: 9]
  ------------------
 1709|      0|			goto zlibfailed;
 1710|      9|	}
 1711|       |
 1712|     10|	d = cab->uncompressed_buffer + cfdata->read_offset;
 1713|     10|	*avail = uavail - cfdata->read_offset;
 1714|     10|	cfdata->uncompressed_avail = uavail;
 1715|       |
 1716|     10|	return (d);
 1717|       |
 1718|      3|zlibfailed:
 1719|      3|	switch (r) {
 1720|      0|	case Z_MEM_ERROR:
  ------------------
  |  Branch (1720:2): [True: 0, False: 3]
  ------------------
 1721|      0|		archive_set_error(&a->archive, ENOMEM,
 1722|      0|		    "Out of memory for deflate decompression");
 1723|      0|		break;
 1724|      3|	default:
  ------------------
  |  Branch (1724:2): [True: 3, False: 0]
  ------------------
 1725|      3|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1726|      3|		    "Deflate decompression failed (%d)", r);
 1727|      3|		break;
 1728|      3|	}
 1729|      3|	*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1730|      3|	return (NULL);
 1731|      7|nomszip:
 1732|      7|	archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      7|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1733|      7|	    "CFDATA incorrect(no MSZIP signature)");
 1734|      7|	*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1735|       |	return (NULL);
 1736|      3|}
archive_read_support_format_cab.c:cab_read_ahead_cfdata_lzx:
 1753|     49|{
 1754|     49|	struct cab *cab = (struct cab *)(a->format->data);
 1755|     49|	struct cfdata *cfdata;
 1756|     49|	const void *d;
 1757|     49|	int r;
 1758|     49|	uint16_t uavail;
 1759|       |
 1760|     49|	cfdata = cab->entry_cfdata;
 1761|       |	/* If the buffer hasn't been allocated, allocate it now. */
 1762|     49|	if (cab->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (1762:6): [True: 47, False: 2]
  ------------------
 1763|     47|		cab->uncompressed_buffer_size = MAX_UNCOMPRESS_SIZE;
  ------------------
  |  |  284|     47|#define MAX_UNCOMPRESS_SIZE	0x8000
  ------------------
 1764|     47|		cab->uncompressed_buffer
 1765|     47|		    = malloc(cab->uncompressed_buffer_size);
 1766|     47|		if (cab->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (1766:7): [True: 0, False: 47]
  ------------------
 1767|      0|			archive_set_error(&a->archive, ENOMEM,
 1768|      0|			    "No memory for CAB reader");
 1769|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1770|      0|			return (NULL);
 1771|      0|		}
 1772|     47|	}
 1773|       |
 1774|     49|	uavail = cfdata->uncompressed_avail;
 1775|     49|	if (uavail == cfdata->uncompressed_size) {
  ------------------
  |  Branch (1775:6): [True: 0, False: 49]
  ------------------
 1776|      0|		d = cab->uncompressed_buffer + cfdata->read_offset;
 1777|      0|		*avail = uavail - cfdata->read_offset;
 1778|      0|		return (d);
 1779|      0|	}
 1780|       |
 1781|     49|	if (!cab->entry_cffolder->decompress_init) {
  ------------------
  |  Branch (1781:6): [True: 47, False: 2]
  ------------------
 1782|     47|		r = lzx_decode_init(&cab->xstrm,
 1783|     47|		    cab->entry_cffolder->compdata);
 1784|     47|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|     47|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1784:7): [True: 0, False: 47]
  ------------------
 1785|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1786|      0|			    "Can't initialize LZX decompression");
 1787|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1788|      0|			return (NULL);
 1789|      0|		}
 1790|       |		/* We've initialized decompression for this stream. */
 1791|     47|		cab->entry_cffolder->decompress_init = 1;
 1792|     47|	}
 1793|       |
 1794|       |	/* Clean up remaining bits of previous CFDATA. */
 1795|     49|	lzx_cleanup_bitstream(&cab->xstrm);
 1796|     49|	cab->xstrm.total_out = uavail;
 1797|    502|	while (cab->xstrm.total_out < cfdata->uncompressed_size) {
  ------------------
  |  Branch (1797:9): [True: 495, False: 7]
  ------------------
 1798|    495|		ssize_t bytes_avail;
 1799|       |
 1800|    495|		cab->xstrm.next_out =
 1801|    495|		    cab->uncompressed_buffer + cab->xstrm.total_out;
 1802|    495|		cab->xstrm.avail_out =
 1803|    495|		    cfdata->uncompressed_size - cab->xstrm.total_out;
 1804|       |
 1805|    495|		d = __archive_read_ahead(a, 1, &bytes_avail);
 1806|    495|		if (d == NULL) {
  ------------------
  |  Branch (1806:7): [True: 1, False: 494]
  ------------------
 1807|      1|			archive_set_error(&a->archive,
 1808|      1|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1809|      1|			    "Truncated CAB file data");
 1810|      1|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1811|      1|			return (NULL);
 1812|      1|		}
 1813|    494|		if (bytes_avail > cfdata->compressed_bytes_remaining)
  ------------------
  |  Branch (1813:7): [True: 218, False: 276]
  ------------------
 1814|    218|			bytes_avail = cfdata->compressed_bytes_remaining;
 1815|       |
 1816|    494|		cab->xstrm.next_in = d;
 1817|    494|		cab->xstrm.avail_in = bytes_avail;
 1818|    494|		cab->xstrm.total_in = 0;
 1819|    494|		r = lzx_decode(&cab->xstrm,
 1820|    494|		    cfdata->compressed_bytes_remaining == bytes_avail);
 1821|    494|		switch (r) {
 1822|      7|		case ARCHIVE_OK:
  ------------------
  |  |  233|      7|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1822:3): [True: 7, False: 487]
  ------------------
 1823|    453|		case ARCHIVE_EOF:
  ------------------
  |  |  232|    453|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1823:3): [True: 446, False: 48]
  ------------------
 1824|    453|			break;
 1825|     41|		default:
  ------------------
  |  Branch (1825:3): [True: 41, False: 453]
  ------------------
 1826|     41|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     41|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1827|     41|			    "LZX decompression failed (%d)", r);
 1828|     41|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|     41|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1829|     41|			return (NULL);
 1830|    494|		}
 1831|    453|		cfdata->unconsumed = cab->xstrm.total_in;
 1832|    453|		cfdata->sum_ptr = d;
 1833|    453|		if (cab_minimum_consume_cfdata(a, cfdata->unconsumed) < 0) {
  ------------------
  |  Branch (1833:7): [True: 0, False: 453]
  ------------------
 1834|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1835|      0|			return (NULL);
 1836|      0|		}
 1837|    453|	}
 1838|       |
 1839|      7|	uavail = (uint16_t)cab->xstrm.total_out;
 1840|       |	/*
 1841|       |	 * Make sure a read pointer advances to next CFDATA.
 1842|       |	 */
 1843|      7|	if (cfdata->compressed_bytes_remaining > 0) {
  ------------------
  |  Branch (1843:6): [True: 6, False: 1]
  ------------------
 1844|      6|		d = __archive_read_ahead(a, cfdata->compressed_bytes_remaining,
 1845|      6|		    NULL);
 1846|      6|		if (d == NULL) {
  ------------------
  |  Branch (1846:7): [True: 1, False: 5]
  ------------------
 1847|      1|			*avail = truncated_error(a);
 1848|      1|			return (NULL);
 1849|      1|		}
 1850|      5|		cfdata->unconsumed = cfdata->compressed_bytes_remaining;
 1851|      5|		cfdata->sum_ptr = d;
 1852|      5|		if (cab_minimum_consume_cfdata(a, cfdata->unconsumed) < 0) {
  ------------------
  |  Branch (1852:7): [True: 0, False: 5]
  ------------------
 1853|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1854|      0|			return (NULL);
 1855|      0|		}
 1856|      5|	}
 1857|       |
 1858|       |	/*
 1859|       |	 * Translation reversal of x86 processor CALL byte sequence(E8).
 1860|       |	 */
 1861|      6|	lzx_translation(&cab->xstrm, cab->uncompressed_buffer,
 1862|      6|	    cfdata->uncompressed_size,
 1863|      6|	    (cab->entry_cffolder->cfdata_index - 1) * MAX_UNCOMPRESS_SIZE);
  ------------------
  |  |  284|      6|#define MAX_UNCOMPRESS_SIZE	0x8000
  ------------------
 1864|       |
 1865|      6|	d = cab->uncompressed_buffer + cfdata->read_offset;
 1866|      6|	*avail = uavail - cfdata->read_offset;
 1867|      6|	cfdata->uncompressed_avail = uavail;
 1868|       |
 1869|      6|	return (d);
 1870|      7|}
archive_read_support_format_cab.c:lzx_decode_init:
 2198|     47|{
 2199|     47|	int base_inc[18];
 2200|     47|	struct lzx_dec *ds;
 2201|     47|	uint32_t base;
 2202|     47|	uint16_t slot, w_size, w_slot;
 2203|     47|	uint8_t footer;
 2204|       |
 2205|     47|	if (strm->ds == NULL) {
  ------------------
  |  Branch (2205:6): [True: 47, False: 0]
  ------------------
 2206|     47|		strm->ds = calloc(1, sizeof(*strm->ds));
 2207|     47|		if (strm->ds == NULL)
  ------------------
  |  Branch (2207:7): [True: 0, False: 47]
  ------------------
 2208|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2209|     47|	}
 2210|     47|	ds = strm->ds;
 2211|     47|	ds->error = ARCHIVE_FAILED;
  ------------------
  |  |  237|     47|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2212|       |
 2213|       |	/* Allow bits from 15(32KBi) up to 21(2MBi) */
 2214|     47|	if (w_bits < SLOT_BASE || w_bits > SLOT_MAX)
  ------------------
  |  |  234|     94|#define SLOT_BASE	15
  ------------------
              	if (w_bits < SLOT_BASE || w_bits > SLOT_MAX)
  ------------------
  |  |  235|     47|#define SLOT_MAX	21/*->25*/
  ------------------
  |  Branch (2214:6): [True: 0, False: 47]
  |  Branch (2214:28): [True: 0, False: 47]
  ------------------
 2215|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2216|       |
 2217|     47|	ds->error = ARCHIVE_FATAL;
  ------------------
  |  |  239|     47|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2218|       |
 2219|       |	/*
 2220|       |	 * Alloc window
 2221|       |	 */
 2222|     47|	w_size = ds->w_size;
 2223|     47|	w_slot = slots[w_bits - SLOT_BASE];
  ------------------
  |  |  234|     47|#define SLOT_BASE	15
  ------------------
 2224|     47|	ds->w_size = 1U << w_bits;
 2225|     47|	ds->w_mask = ds->w_size - 1;
 2226|     47|	if (ds->w_buff == NULL || w_size != ds->w_size) {
  ------------------
  |  Branch (2226:6): [True: 47, False: 0]
  |  Branch (2226:28): [True: 0, False: 0]
  ------------------
 2227|     47|		free(ds->w_buff);
 2228|     47|		ds->w_buff = malloc(ds->w_size);
 2229|     47|		if (ds->w_buff == NULL)
  ------------------
  |  Branch (2229:7): [True: 0, False: 47]
  ------------------
 2230|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2231|     47|		free(ds->pos_tbl);
 2232|     47|		ds->pos_tbl = malloc(sizeof(ds->pos_tbl[0]) * w_slot);
 2233|     47|		if (ds->pos_tbl == NULL)
  ------------------
  |  Branch (2233:7): [True: 0, False: 47]
  ------------------
 2234|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2235|     47|	}
 2236|       |
 2237|    893|	for (footer = 0; footer < 18; footer++)
  ------------------
  |  Branch (2237:19): [True: 846, False: 47]
  ------------------
 2238|    846|		base_inc[footer] = 1 << footer;
 2239|     47|	base = footer = 0;
 2240|  2.11k|	for (slot = 0; slot < w_slot; slot++) {
  ------------------
  |  Branch (2240:17): [True: 2.06k, False: 47]
  ------------------
 2241|  2.06k|		int n;
 2242|  2.06k|		if (footer == 0)
  ------------------
  |  Branch (2242:7): [True: 235, False: 1.82k]
  ------------------
 2243|    235|			base = slot;
 2244|  1.82k|		else
 2245|  1.82k|			base += base_inc[footer];
 2246|  2.06k|		if (footer < 17) {
  ------------------
  |  Branch (2246:7): [True: 1.67k, False: 390]
  ------------------
 2247|  1.67k|			footer = 0;
 2248|  17.4k|			for (n = base; n; n >>= 1)
  ------------------
  |  Branch (2248:19): [True: 15.7k, False: 1.67k]
  ------------------
 2249|  15.7k|				footer++;
 2250|  1.67k|			if (footer <= 2)
  ------------------
  |  Branch (2250:8): [True: 188, False: 1.48k]
  ------------------
 2251|    188|				footer = 0;
 2252|  1.48k|			else
 2253|  1.48k|				footer -= 2;
 2254|  1.67k|		}
 2255|  2.06k|		ds->pos_tbl[slot].base = base;
 2256|  2.06k|		ds->pos_tbl[slot].footer_bits = footer;
 2257|  2.06k|	}
 2258|       |
 2259|     47|	ds->w_pos = 0;
 2260|     47|	ds->state = ST_RD_TRANSLATION;
  ------------------
  |  |  157|     47|#define ST_RD_TRANSLATION	0
  ------------------
 2261|     47|	ds->br.cache_buffer = 0;
 2262|     47|	ds->br.cache_avail = 0;
 2263|     47|	ds->r0 = ds->r1 = ds->r2 = 1;
 2264|       |
 2265|       |	/* Initialize aligned offset tree. */
 2266|     47|	if (lzx_huffman_init(&(ds->at), 8, 8) != ARCHIVE_OK)
  ------------------
  |  |  233|     47|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2266:6): [True: 0, False: 47]
  ------------------
 2267|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2268|       |
 2269|       |	/* Initialize pre-tree. */
 2270|     47|	if (lzx_huffman_init(&(ds->pt), 20, 10) != ARCHIVE_OK)
  ------------------
  |  |  233|     47|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2270:6): [True: 0, False: 47]
  ------------------
 2271|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2272|       |
 2273|       |	/* Initialize Main tree. */
 2274|     47|	if (lzx_huffman_init(&(ds->mt), 256 + (w_slot << 3), 16)
  ------------------
  |  Branch (2274:6): [True: 0, False: 47]
  ------------------
 2275|     47|	    != ARCHIVE_OK)
  ------------------
  |  |  233|     47|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2276|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2277|       |
 2278|       |	/* Initialize Length tree. */
 2279|     47|	if (lzx_huffman_init(&(ds->lt), 249, 16) != ARCHIVE_OK)
  ------------------
  |  |  233|     47|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2279:6): [True: 0, False: 47]
  ------------------
 2280|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2281|       |
 2282|     47|	ds->error = 0;
 2283|       |
 2284|     47|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     47|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2285|     47|}
archive_read_support_format_cab.c:lzx_huffman_init:
 3231|    188|{
 3232|    188|	size_t tbl_size = (size_t)1 << tbl_bits;
 3233|       |
 3234|    188|	if (hf->bitlen == NULL || hf->symbol_count != symbol_count) {
  ------------------
  |  Branch (3234:6): [True: 188, False: 0]
  |  Branch (3234:28): [True: 0, False: 0]
  ------------------
 3235|    188|		free(hf->bitlen);
 3236|    188|		hf->bitlen = calloc(symbol_count, sizeof(hf->bitlen[0]));
 3237|    188|		if (hf->bitlen == NULL)
  ------------------
  |  Branch (3237:7): [True: 0, False: 188]
  ------------------
 3238|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3239|    188|		hf->symbol_count = symbol_count;
 3240|    188|	} else
 3241|      0|		memset(hf->bitlen, 0, symbol_count * sizeof(hf->bitlen[0]));
 3242|    188|	if (hf->tbl == NULL) {
  ------------------
  |  Branch (3242:6): [True: 188, False: 0]
  ------------------
 3243|    188|		hf->tbl = calloc(tbl_size, sizeof(hf->tbl[0]));
 3244|    188|		if (hf->tbl == NULL)
  ------------------
  |  Branch (3244:7): [True: 0, False: 188]
  ------------------
 3245|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3246|    188|		hf->tbl_bits = tbl_bits;
 3247|    188|	} else
 3248|      0|		memset(hf->tbl, 0, tbl_size * sizeof(hf->bitlen[0]));
 3249|    188|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    188|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3250|    188|}
archive_read_support_format_cab.c:lzx_cleanup_bitstream:
 2481|     49|{
 2482|     49|	strm->ds->br.cache_avail = 0;
 2483|     49|	strm->ds->br.have_odd = 0;
 2484|     49|}
archive_read_support_format_cab.c:lzx_decode:
 2497|    494|{
 2498|    494|	struct lzx_dec *ds = strm->ds;
 2499|    494|	size_t avail_in;
 2500|    494|	int r;
 2501|       |
 2502|    494|	if (ds->error)
  ------------------
  |  Branch (2502:6): [True: 0, False: 494]
  ------------------
 2503|      0|		return (ds->error);
 2504|       |
 2505|    494|	avail_in = strm->avail_in;
 2506|    494|	lzx_br_fixup(strm, &(ds->br));
 2507|    498|	do {
 2508|    498|		if (ds->state < ST_MAIN)
  ------------------
  |  |  175|    498|#define ST_MAIN			18
  ------------------
  |  Branch (2508:7): [True: 493, False: 5]
  ------------------
 2509|    493|			r = lzx_read_blocks(strm, last);
 2510|      5|		else {
 2511|      5|			size_t bytes_written = strm->avail_out;
 2512|       |
 2513|      5|			r = lzx_decode_blocks(strm, last);
 2514|      5|			bytes_written -= strm->avail_out;
 2515|      5|			strm->next_out += bytes_written;
 2516|      5|			strm->total_out += bytes_written;
 2517|      5|		}
 2518|    498|	} while (r == 100);
  ------------------
  |  Branch (2518:11): [True: 4, False: 494]
  ------------------
 2519|    494|	strm->total_in += avail_in - strm->avail_in;
 2520|    494|	return (r);
 2521|    494|}
archive_read_support_format_cab.c:lzx_br_fixup:
 2465|    494|{
 2466|    494|	ssize_t n = CACHE_BITS - br->cache_avail;
  ------------------
  |  |  140|    494|#define CACHE_BITS		(8 * sizeof(CACHE_TYPE))
  ------------------
 2467|       |
 2468|    494|	if (br->have_odd && n >= 16 && strm->avail_in > 0) {
  ------------------
  |  Branch (2468:6): [True: 0, False: 494]
  |  Branch (2468:22): [True: 0, False: 0]
  |  Branch (2468:33): [True: 0, False: 0]
  ------------------
 2469|      0|		br->cache_buffer =
 2470|      0|		   (br->cache_buffer << 16) |
 2471|      0|		   ((uint16_t)(*strm->next_in)) << 8 | br->odd;
 2472|      0|		strm->next_in++;
 2473|      0|		strm->avail_in--;
 2474|      0|		br->cache_avail += 16;
 2475|      0|		br->have_odd = 0;
 2476|      0|	}
 2477|    494|}
archive_read_support_format_cab.c:lzx_read_blocks:
 2525|    493|{
 2526|    493|	struct lzx_dec *ds = strm->ds;
 2527|    493|	struct lzx_br *br = &(ds->br);
 2528|    493|	int r;
 2529|    493|	uint16_t i;
 2530|       |
 2531|    532|	for (;;) {
 2532|    532|		switch (ds->state) {
  ------------------
  |  Branch (2532:11): [True: 532, False: 0]
  ------------------
 2533|     47|		case ST_RD_TRANSLATION:
  ------------------
  |  |  157|     47|#define ST_RD_TRANSLATION	0
  ------------------
  |  Branch (2533:3): [True: 47, False: 485]
  ------------------
 2534|     47|			if (!lzx_br_read_ahead(strm, br, 1)) {
  ------------------
  |  | 2366|     47|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2361|     94|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2347|     94|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2347:27): [True: 0, False: 47]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|     47|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2361:28): [True: 47, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2347:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2535|      0|				ds->state = ST_RD_TRANSLATION;
  ------------------
  |  |  157|      0|#define ST_RD_TRANSLATION	0
  ------------------
 2536|      0|				if (last)
  ------------------
  |  Branch (2536:9): [True: 0, False: 0]
  ------------------
 2537|      0|					goto failed;
 2538|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2539|      0|			}
 2540|     47|			ds->translation = lzx_br_bits(br, 1);
  ------------------
  |  | 2350|     47|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2351|     47|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2541|     47|			lzx_br_consume(br, 1);
  ------------------
  |  | 2369|     47|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2542|       |			/* FALL THROUGH */
 2543|     47|		case ST_RD_TRANSLATION_SIZE:
  ------------------
  |  |  158|     47|#define ST_RD_TRANSLATION_SIZE	1
  ------------------
  |  Branch (2543:3): [True: 0, False: 532]
  ------------------
 2544|     47|			if (ds->translation) {
  ------------------
  |  Branch (2544:8): [True: 3, False: 44]
  ------------------
 2545|      3|				uint32_t v;
 2546|       |
 2547|      3|				if (!lzx_br_read_ahead(strm, br, 32)) {
  ------------------
  |  | 2366|      3|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2361|      6|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2347|      6|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2347:27): [True: 3, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2361:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2347:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2548|      0|					ds->state = ST_RD_TRANSLATION_SIZE;
  ------------------
  |  |  158|      0|#define ST_RD_TRANSLATION_SIZE	1
  ------------------
 2549|      0|					if (last)
  ------------------
  |  Branch (2549:10): [True: 0, False: 0]
  ------------------
 2550|      0|						goto failed;
 2551|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2552|      0|				}
 2553|      3|				v = lzx_br_bits(br, 16);
  ------------------
  |  | 2350|      3|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2351|      3|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2554|      3|				lzx_br_consume(br, 16);
  ------------------
  |  | 2369|      3|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2555|      3|				v <<= 16;
 2556|      3|				v |= lzx_br_bits(br, 16);
  ------------------
  |  | 2350|      3|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2351|      3|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2557|      3|				if (v > MAX_FILE_SIZE)
  ------------------
  |  |  285|      3|#define MAX_FILE_SIZE		(UINT16_MAX * MAX_UNCOMPRESS_SIZE)
  |  |  ------------------
  |  |  |  |  284|      3|#define MAX_UNCOMPRESS_SIZE	0x8000
  |  |  ------------------
  ------------------
  |  Branch (2557:9): [True: 1, False: 2]
  ------------------
 2558|      1|					goto failed;
 2559|      2|				ds->translation_size = (int32_t)v;
 2560|      2|				lzx_br_consume(br, 16);
  ------------------
  |  | 2369|      2|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2561|      2|			}
 2562|       |			/* FALL THROUGH */
 2563|    492|		case ST_RD_BLOCK_TYPE:
  ------------------
  |  |  159|    492|#define ST_RD_BLOCK_TYPE	2
  ------------------
  |  Branch (2563:3): [True: 446, False: 86]
  ------------------
 2564|    492|			if (!lzx_br_read_ahead(strm, br, 3)) {
  ------------------
  |  | 2366|    492|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2361|    984|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2347|    984|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2347:27): [True: 46, False: 446]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|    446|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2361:28): [True: 446, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2347:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2565|      0|				ds->state = ST_RD_BLOCK_TYPE;
  ------------------
  |  |  159|      0|#define ST_RD_BLOCK_TYPE	2
  ------------------
 2566|      0|				if (last)
  ------------------
  |  Branch (2566:9): [True: 0, False: 0]
  ------------------
 2567|      0|					goto failed;
 2568|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2569|      0|			}
 2570|    492|			ds->block_type = lzx_br_bits(br, 3);
  ------------------
  |  | 2350|    492|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2351|    492|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2571|    492|			lzx_br_consume(br, 3);
  ------------------
  |  | 2369|    492|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2572|       |			/* Check a block type. */
 2573|    492|			switch (ds->block_type) {
 2574|     31|			case VERBATIM_BLOCK:
  ------------------
  |  |  200|     31|#define VERBATIM_BLOCK		1
  ------------------
  |  Branch (2574:4): [True: 31, False: 461]
  ------------------
 2575|     39|			case ALIGNED_OFFSET_BLOCK:
  ------------------
  |  |  201|     39|#define ALIGNED_OFFSET_BLOCK	2
  ------------------
  |  Branch (2575:4): [True: 8, False: 484]
  ------------------
 2576|    491|			case UNCOMPRESSED_BLOCK:
  ------------------
  |  |  202|    491|#define UNCOMPRESSED_BLOCK	3
  ------------------
  |  Branch (2576:4): [True: 452, False: 40]
  ------------------
 2577|    491|				break;
 2578|      1|			default:
  ------------------
  |  Branch (2578:4): [True: 1, False: 491]
  ------------------
 2579|      1|				goto failed;/* Invalid */
 2580|    492|			}
 2581|       |			/* FALL THROUGH */
 2582|    491|		case ST_RD_BLOCK_SIZE:
  ------------------
  |  |  160|    491|#define ST_RD_BLOCK_SIZE	3
  ------------------
  |  Branch (2582:3): [True: 0, False: 532]
  ------------------
 2583|    491|			if (!lzx_br_read_ahead(strm, br, 24)) {
  ------------------
  |  | 2366|    491|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2361|    982|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2347|    982|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2347:27): [True: 491, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2361:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2347:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2584|      0|				ds->state = ST_RD_BLOCK_SIZE;
  ------------------
  |  |  160|      0|#define ST_RD_BLOCK_SIZE	3
  ------------------
 2585|      0|				if (last)
  ------------------
  |  Branch (2585:9): [True: 0, False: 0]
  ------------------
 2586|      0|					goto failed;
 2587|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2588|      0|			}
 2589|    491|			ds->block_size = lzx_br_bits(br, 8);
  ------------------
  |  | 2350|    491|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2351|    491|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2590|    491|			lzx_br_consume(br, 8);
  ------------------
  |  | 2369|    491|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2591|    491|			ds->block_size <<= 16;
 2592|    491|			ds->block_size |= lzx_br_bits(br, 16);
  ------------------
  |  | 2350|    491|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2351|    491|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2593|    491|			lzx_br_consume(br, 16);
  ------------------
  |  | 2369|    491|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2594|    491|			if (ds->block_size == 0)
  ------------------
  |  Branch (2594:8): [True: 0, False: 491]
  ------------------
 2595|      0|				goto failed;
 2596|    491|			ds->block_bytes_avail = ds->block_size;
 2597|    491|			if (ds->block_type != UNCOMPRESSED_BLOCK) {
  ------------------
  |  |  202|    491|#define UNCOMPRESSED_BLOCK	3
  ------------------
  |  Branch (2597:8): [True: 39, False: 452]
  ------------------
 2598|     39|				if (ds->block_type == VERBATIM_BLOCK)
  ------------------
  |  |  200|     39|#define VERBATIM_BLOCK		1
  ------------------
  |  Branch (2598:9): [True: 31, False: 8]
  ------------------
 2599|     31|					ds->state = ST_RD_VERBATIM;
  ------------------
  |  |  168|     31|#define ST_RD_VERBATIM		11
  ------------------
 2600|      8|				else
 2601|      8|					ds->state = ST_RD_ALIGNED_OFFSET;
  ------------------
  |  |  167|      8|#define ST_RD_ALIGNED_OFFSET	10
  ------------------
 2602|     39|				break;
 2603|     39|			}
 2604|       |			/* FALL THROUGH */
 2605|    452|		case ST_RD_ALIGNMENT:
  ------------------
  |  |  161|    452|#define ST_RD_ALIGNMENT		4
  ------------------
  |  Branch (2605:3): [True: 0, False: 532]
  ------------------
 2606|       |			/*
 2607|       |			 * Handle an Uncompressed Block.
 2608|       |			 */
 2609|       |			/* Skip padding to align following field on
 2610|       |			 * 16-bit boundary. */
 2611|    452|			if (lzx_br_is_unaligned(br))
  ------------------
  |  | 2372|    452|#define lzx_br_is_unaligned(br)	((br)->cache_avail & 0x0f)
  |  |  ------------------
  |  |  |  Branch (2372:33): [True: 452, False: 0]
  |  |  ------------------
  ------------------
 2612|    452|				lzx_br_consume_unaligned_bits(br);
  ------------------
  |  | 2370|    452|#define lzx_br_consume_unaligned_bits(br) ((br)->cache_avail &= ~0x0f)
  ------------------
 2613|      0|			else {
 2614|      0|				if (lzx_br_read_ahead(strm, br, 16))
  ------------------
  |  | 2366|      0|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2361|      0|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2347:27): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2361:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2347:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2615|      0|					lzx_br_consume(br, 16);
  ------------------
  |  | 2369|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2616|      0|				else {
 2617|      0|					ds->state = ST_RD_ALIGNMENT;
  ------------------
  |  |  161|      0|#define ST_RD_ALIGNMENT		4
  ------------------
 2618|      0|					if (last)
  ------------------
  |  Branch (2618:10): [True: 0, False: 0]
  ------------------
 2619|      0|						goto failed;
 2620|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2621|      0|				}
 2622|      0|			}
 2623|       |			/* Preparation to read repeated offsets R0,R1 and R2. */
 2624|    452|			ds->rbytes_avail = 0;
 2625|    452|			ds->state = ST_RD_R0;
  ------------------
  |  |  162|    452|#define ST_RD_R0		5
  ------------------
 2626|       |			/* FALL THROUGH */
 2627|    452|		case ST_RD_R0:
  ------------------
  |  |  162|    452|#define ST_RD_R0		5
  ------------------
  |  Branch (2627:3): [True: 0, False: 532]
  ------------------
 2628|    452|		case ST_RD_R1:
  ------------------
  |  |  163|    452|#define ST_RD_R1		6
  ------------------
  |  Branch (2628:3): [True: 0, False: 532]
  ------------------
 2629|    452|		case ST_RD_R2:
  ------------------
  |  |  164|    452|#define ST_RD_R2		7
  ------------------
  |  Branch (2629:3): [True: 0, False: 532]
  ------------------
 2630|  1.34k|			do {
 2631|  1.34k|				uint16_t u16;
 2632|       |				/* Drain bits in the cache buffer of
 2633|       |				 * bit-stream. */
 2634|  1.34k|				if (lzx_br_has(br, 32)) {
  ------------------
  |  | 2347|  1.34k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  ------------------
  |  |  |  Branch (2347:27): [True: 451, False: 898]
  |  |  ------------------
  ------------------
 2635|    451|					u16 = lzx_br_bits(br, 16);
  ------------------
  |  | 2350|    451|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2351|    451|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2636|    451|					lzx_br_consume(br, 16);
  ------------------
  |  | 2369|    451|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2637|    451|					archive_le16enc(ds->rbytes, u16);
 2638|    451|					u16 = lzx_br_bits(br, 16);
  ------------------
  |  | 2350|    451|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2351|    451|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2639|    451|					lzx_br_consume(br, 16);
  ------------------
  |  | 2369|    451|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2640|    451|					archive_le16enc(ds->rbytes+2, u16);
 2641|    451|					ds->rbytes_avail = 4;
 2642|    898|				} else if (lzx_br_has(br, 16)) {
  ------------------
  |  | 2347|    898|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  ------------------
  |  |  |  Branch (2347:27): [True: 0, False: 898]
  |  |  ------------------
  ------------------
 2643|      0|					u16 = lzx_br_bits(br, 16);
  ------------------
  |  | 2350|      0|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2351|      0|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2644|      0|					lzx_br_consume(br, 16);
  ------------------
  |  | 2369|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2645|      0|					archive_le16enc(ds->rbytes, u16);
 2646|      0|					ds->rbytes_avail = 2;
 2647|      0|				}
 2648|  1.34k|				if (ds->rbytes_avail < 4 && ds->br.have_odd) {
  ------------------
  |  Branch (2648:9): [True: 898, False: 451]
  |  Branch (2648:33): [True: 0, False: 898]
  ------------------
 2649|      0|					ds->rbytes[ds->rbytes_avail++] =
 2650|      0|					    ds->br.odd;
 2651|      0|					ds->br.have_odd = 0;
 2652|      0|				}
 2653|  4.94k|				while (ds->rbytes_avail < 4) {
  ------------------
  |  Branch (2653:12): [True: 3.59k, False: 1.34k]
  ------------------
 2654|  3.59k|					if (strm->avail_in <= 0) {
  ------------------
  |  Branch (2654:10): [True: 0, False: 3.59k]
  ------------------
 2655|      0|						if (last)
  ------------------
  |  Branch (2655:11): [True: 0, False: 0]
  ------------------
 2656|      0|							goto failed;
 2657|      0|						return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2658|      0|					}
 2659|  3.59k|					ds->rbytes[ds->rbytes_avail++] =
 2660|  3.59k|					    *strm->next_in++;
 2661|  3.59k|					strm->avail_in--;
 2662|  3.59k|				}
 2663|  1.34k|				ds->rbytes_avail = 0;
 2664|  1.34k|				if (ds->state == ST_RD_R0) {
  ------------------
  |  |  162|  1.34k|#define ST_RD_R0		5
  ------------------
  |  Branch (2664:9): [True: 452, False: 897]
  ------------------
 2665|    452|					ds->r0 = archive_le32dec(ds->rbytes);
 2666|    452|					if (ds->r0 > (size_t)INT32_MAX)
  ------------------
  |  Branch (2666:10): [True: 3, False: 449]
  ------------------
 2667|      3|						goto failed;
 2668|    449|					ds->state = ST_RD_R1;
  ------------------
  |  |  163|    449|#define ST_RD_R1		6
  ------------------
 2669|    897|				} else if (ds->state == ST_RD_R1) {
  ------------------
  |  |  163|    897|#define ST_RD_R1		6
  ------------------
  |  Branch (2669:16): [True: 449, False: 448]
  ------------------
 2670|    449|					ds->r1 = archive_le32dec(ds->rbytes);
 2671|    449|					if (ds->r1 > (size_t)INT32_MAX)
  ------------------
  |  Branch (2671:10): [True: 1, False: 448]
  ------------------
 2672|      1|						goto failed;
 2673|    448|					ds->state = ST_RD_R2;
  ------------------
  |  |  164|    448|#define ST_RD_R2		7
  ------------------
 2674|    448|				} else if (ds->state == ST_RD_R2) {
  ------------------
  |  |  164|    448|#define ST_RD_R2		7
  ------------------
  |  Branch (2674:16): [True: 448, False: 0]
  ------------------
 2675|    448|					ds->r2 = archive_le32dec(ds->rbytes);
 2676|    448|					if (ds->r2 > (size_t)INT32_MAX)
  ------------------
  |  Branch (2676:10): [True: 0, False: 448]
  ------------------
 2677|      0|						goto failed;
 2678|       |					/* We've gotten all repeated offsets. */
 2679|    448|					ds->state = ST_COPY_UNCOMP1;
  ------------------
  |  |  165|    448|#define ST_COPY_UNCOMP1		8
  ------------------
 2680|    448|				}
 2681|  1.34k|			} while (ds->state != ST_COPY_UNCOMP1);
  ------------------
  |  |  165|  1.34k|#define ST_COPY_UNCOMP1		8
  ------------------
  |  Branch (2681:13): [True: 897, False: 448]
  ------------------
 2682|       |			/* FALL THROUGH */
 2683|    448|		case ST_COPY_UNCOMP1:
  ------------------
  |  |  165|    448|#define ST_COPY_UNCOMP1		8
  ------------------
  |  Branch (2683:3): [True: 0, False: 532]
  ------------------
 2684|       |			/*
 2685|       |			 * Copy bytes form next_in to next_out directly.
 2686|       |			 */
 2687|    896|			while (ds->block_bytes_avail) {
  ------------------
  |  Branch (2687:11): [True: 450, False: 446]
  ------------------
 2688|    450|				size_t l;
 2689|       |
 2690|    450|				if (strm->avail_out <= 0)
  ------------------
  |  Branch (2690:9): [True: 1, False: 449]
  ------------------
 2691|       |					/* Output buffer is empty. */
 2692|      1|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2693|    449|				if (strm->avail_in <= 0) {
  ------------------
  |  Branch (2693:9): [True: 1, False: 448]
  ------------------
 2694|       |					/* Input buffer is empty. */
 2695|      1|					if (last)
  ------------------
  |  Branch (2695:10): [True: 0, False: 1]
  ------------------
 2696|      0|						goto failed;
 2697|      1|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2698|      1|				}
 2699|    448|				l = ds->block_bytes_avail;
 2700|    448|				if (l > ds->w_size - ds->w_pos)
  ------------------
  |  Branch (2700:9): [True: 2, False: 446]
  ------------------
 2701|      2|					l = ds->w_size - ds->w_pos;
 2702|    448|				if (l > strm->avail_out)
  ------------------
  |  Branch (2702:9): [True: 2, False: 446]
  ------------------
 2703|      2|					l = strm->avail_out;
 2704|    448|				if (l > strm->avail_in)
  ------------------
  |  Branch (2704:9): [True: 1, False: 447]
  ------------------
 2705|      1|					l = strm->avail_in;
 2706|    448|				memcpy(strm->next_out, strm->next_in, l);
 2707|    448|				memcpy(&(ds->w_buff[ds->w_pos]),
 2708|    448|				    strm->next_in, l);
 2709|    448|				strm->next_in += l;
 2710|    448|				strm->avail_in -= l;
 2711|    448|				strm->next_out += l;
 2712|    448|				strm->avail_out -= l;
 2713|    448|				strm->total_out += l;
 2714|    448|				ds->w_pos = (ds->w_pos + l) & ds->w_mask;
 2715|    448|				ds->block_bytes_avail -= l;
 2716|    448|			}
 2717|       |			/* FALL THROUGH */
 2718|    446|		case ST_COPY_UNCOMP2:
  ------------------
  |  |  166|    446|#define ST_COPY_UNCOMP2		9
  ------------------
  |  Branch (2718:3): [True: 0, False: 532]
  ------------------
 2719|       |			/* Re-align; skip padding byte. */
 2720|    446|			if (ds->block_size & 1) {
  ------------------
  |  Branch (2720:8): [True: 423, False: 23]
  ------------------
 2721|    423|				if (strm->avail_in <= 0) {
  ------------------
  |  Branch (2721:9): [True: 0, False: 423]
  ------------------
 2722|       |					/* Input buffer is empty. */
 2723|      0|					ds->state = ST_COPY_UNCOMP2;
  ------------------
  |  |  166|      0|#define ST_COPY_UNCOMP2		9
  ------------------
 2724|      0|					if (last)
  ------------------
  |  Branch (2724:10): [True: 0, False: 0]
  ------------------
 2725|      0|						goto failed;
 2726|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2727|      0|				}
 2728|    423|				strm->next_in++;
 2729|    423|				strm->avail_in --;
 2730|    423|			}
 2731|       |			/* This block ended. */
 2732|    446|			ds->state = ST_RD_BLOCK_TYPE;
  ------------------
  |  |  159|    446|#define ST_RD_BLOCK_TYPE	2
  ------------------
 2733|    446|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|    446|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2734|       |			/********************/
 2735|      8|		case ST_RD_ALIGNED_OFFSET:
  ------------------
  |  |  167|      8|#define ST_RD_ALIGNED_OFFSET	10
  ------------------
  |  Branch (2735:3): [True: 8, False: 524]
  ------------------
 2736|       |			/*
 2737|       |			 * Read Aligned offset tree.
 2738|       |			 */
 2739|      8|			if (!lzx_br_read_ahead(strm, br, 3 * ds->at.symbol_count)) {
  ------------------
  |  | 2366|      8|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2361|     16|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2347|     16|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2347:27): [True: 8, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2361:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2347:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2740|      0|				ds->state = ST_RD_ALIGNED_OFFSET;
  ------------------
  |  |  167|      0|#define ST_RD_ALIGNED_OFFSET	10
  ------------------
 2741|      0|				if (last)
  ------------------
  |  Branch (2741:9): [True: 0, False: 0]
  ------------------
 2742|      0|					goto failed;
 2743|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2744|      0|			}
 2745|      8|			memset(ds->at.freq, 0, sizeof(ds->at.freq));
 2746|     72|			for (i = 0; i < ds->at.symbol_count; i++) {
  ------------------
  |  Branch (2746:16): [True: 64, False: 8]
  ------------------
 2747|     64|				ds->at.bitlen[i] = lzx_br_bits(br, 3);
  ------------------
  |  | 2350|     64|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2351|     64|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2748|     64|				ds->at.freq[ds->at.bitlen[i]]++;
 2749|     64|				lzx_br_consume(br, 3);
  ------------------
  |  | 2369|     64|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2750|     64|			}
 2751|      8|			if (lzx_make_huffman_table(&ds->at) < 0)
  ------------------
  |  Branch (2751:8): [True: 2, False: 6]
  ------------------
 2752|      2|				goto failed;
 2753|       |			/* FALL THROUGH */
 2754|     37|		case ST_RD_VERBATIM:
  ------------------
  |  |  168|     37|#define ST_RD_VERBATIM		11
  ------------------
  |  Branch (2754:3): [True: 31, False: 501]
  ------------------
 2755|     37|			ds->loop = 0;
 2756|       |			/* FALL THROUGH */
 2757|     37|		case ST_RD_PRE_MAIN_TREE_256:
  ------------------
  |  |  169|     37|#define ST_RD_PRE_MAIN_TREE_256	12
  ------------------
  |  Branch (2757:3): [True: 0, False: 532]
  ------------------
 2758|       |			/*
 2759|       |			 * Read Pre-tree for first 256 elements of main tree.
 2760|       |			 */
 2761|     37|			if (lzx_read_pre_tree(strm) < 0) {
  ------------------
  |  Branch (2761:8): [True: 0, False: 37]
  ------------------
 2762|      0|				ds->state = ST_RD_PRE_MAIN_TREE_256;
  ------------------
  |  |  169|      0|#define ST_RD_PRE_MAIN_TREE_256	12
  ------------------
 2763|      0|				if (last)
  ------------------
  |  Branch (2763:9): [True: 0, False: 0]
  ------------------
 2764|      0|					goto failed;
 2765|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2766|      0|			}
 2767|     37|			if (lzx_make_huffman_table(&ds->pt) < 0)
  ------------------
  |  Branch (2767:8): [True: 2, False: 35]
  ------------------
 2768|      2|				goto failed;
 2769|     35|			ds->loop = 0;
 2770|       |			/* FALL THROUGH */
 2771|     35|		case ST_MAIN_TREE_256:
  ------------------
  |  |  170|     35|#define ST_MAIN_TREE_256	13
  ------------------
  |  Branch (2771:3): [True: 0, False: 532]
  ------------------
 2772|       |			/*
 2773|       |			 * Get path lengths of first 256 elements of main tree.
 2774|       |			 */
 2775|     35|			r = lzx_read_bitlen(strm, &ds->mt, 256);
 2776|     35|			if (r == ARCHIVE_EOF) {
  ------------------
  |  |  232|     35|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (2776:8): [True: 0, False: 35]
  ------------------
 2777|      0|				ds->state = ST_MAIN_TREE_256;
  ------------------
  |  |  170|      0|#define ST_MAIN_TREE_256	13
  ------------------
 2778|      0|				if (last)
  ------------------
  |  Branch (2778:9): [True: 0, False: 0]
  ------------------
 2779|      0|					goto failed;
 2780|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2781|     35|			} else if (r < 0)
  ------------------
  |  Branch (2781:15): [True: 0, False: 35]
  ------------------
 2782|      0|				goto failed;
 2783|     35|			ds->loop = 0;
 2784|       |			/* FALL THROUGH */
 2785|     35|		case ST_RD_PRE_MAIN_TREE_REM:
  ------------------
  |  |  171|     35|#define ST_RD_PRE_MAIN_TREE_REM	14
  ------------------
  |  Branch (2785:3): [True: 0, False: 532]
  ------------------
 2786|       |			/*
 2787|       |			 * Read Pre-tree for remaining elements of main tree.
 2788|       |			 */
 2789|     35|			if (lzx_read_pre_tree(strm) < 0) {
  ------------------
  |  Branch (2789:8): [True: 0, False: 35]
  ------------------
 2790|      0|				ds->state = ST_RD_PRE_MAIN_TREE_REM;
  ------------------
  |  |  171|      0|#define ST_RD_PRE_MAIN_TREE_REM	14
  ------------------
 2791|      0|				if (last)
  ------------------
  |  Branch (2791:9): [True: 0, False: 0]
  ------------------
 2792|      0|					goto failed;
 2793|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2794|      0|			}
 2795|     35|			if (lzx_make_huffman_table(&ds->pt) < 0)
  ------------------
  |  Branch (2795:8): [True: 0, False: 35]
  ------------------
 2796|      0|				goto failed;
 2797|     35|			ds->loop = 256;
 2798|       |			/* FALL THROUGH */
 2799|     35|		case ST_MAIN_TREE_REM:
  ------------------
  |  |  172|     35|#define ST_MAIN_TREE_REM	15
  ------------------
  |  Branch (2799:3): [True: 0, False: 532]
  ------------------
 2800|       |			/*
 2801|       |			 * Get path lengths of remaining elements of main tree.
 2802|       |			 */
 2803|     35|			r = lzx_read_bitlen(strm, &ds->mt, 0);
 2804|     35|			if (r == ARCHIVE_EOF) {
  ------------------
  |  |  232|     35|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (2804:8): [True: 0, False: 35]
  ------------------
 2805|      0|				ds->state = ST_MAIN_TREE_REM;
  ------------------
  |  |  172|      0|#define ST_MAIN_TREE_REM	15
  ------------------
 2806|      0|				if (last)
  ------------------
  |  Branch (2806:9): [True: 0, False: 0]
  ------------------
 2807|      0|					goto failed;
 2808|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2809|     35|			} else if (r < 0)
  ------------------
  |  Branch (2809:15): [True: 0, False: 35]
  ------------------
 2810|      0|				goto failed;
 2811|     35|			if (lzx_make_huffman_table(&ds->mt) < 0)
  ------------------
  |  Branch (2811:8): [True: 29, False: 6]
  ------------------
 2812|     29|				goto failed;
 2813|      6|			ds->loop = 0;
 2814|       |			/* FALL THROUGH */
 2815|      6|		case ST_RD_PRE_LENGTH_TREE:
  ------------------
  |  |  173|      6|#define ST_RD_PRE_LENGTH_TREE	16
  ------------------
  |  Branch (2815:3): [True: 0, False: 532]
  ------------------
 2816|       |			/*
 2817|       |			 * Read Pre-tree for remaining elements of main tree.
 2818|       |			 */
 2819|      6|			if (lzx_read_pre_tree(strm) < 0) {
  ------------------
  |  Branch (2819:8): [True: 0, False: 6]
  ------------------
 2820|      0|				ds->state = ST_RD_PRE_LENGTH_TREE;
  ------------------
  |  |  173|      0|#define ST_RD_PRE_LENGTH_TREE	16
  ------------------
 2821|      0|				if (last)
  ------------------
  |  Branch (2821:9): [True: 0, False: 0]
  ------------------
 2822|      0|					goto failed;
 2823|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2824|      0|			}
 2825|      6|			if (lzx_make_huffman_table(&ds->pt) < 0)
  ------------------
  |  Branch (2825:8): [True: 0, False: 6]
  ------------------
 2826|      0|				goto failed;
 2827|      6|			ds->loop = 0;
 2828|       |			/* FALL THROUGH */
 2829|      6|		case ST_LENGTH_TREE:
  ------------------
  |  |  174|      6|#define ST_LENGTH_TREE		17
  ------------------
  |  Branch (2829:3): [True: 0, False: 532]
  ------------------
 2830|       |			/*
 2831|       |			 * Get path lengths of remaining elements of main tree.
 2832|       |			 */
 2833|      6|			r = lzx_read_bitlen(strm, &ds->lt, 0);
 2834|      6|			if (r == ARCHIVE_EOF) {
  ------------------
  |  |  232|      6|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (2834:8): [True: 0, False: 6]
  ------------------
 2835|      0|				ds->state = ST_LENGTH_TREE;
  ------------------
  |  |  174|      0|#define ST_LENGTH_TREE		17
  ------------------
 2836|      0|				if (last)
  ------------------
  |  Branch (2836:9): [True: 0, False: 0]
  ------------------
 2837|      0|					goto failed;
 2838|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2839|      6|			} else if (r < 0)
  ------------------
  |  Branch (2839:15): [True: 0, False: 6]
  ------------------
 2840|      0|				goto failed;
 2841|      6|			if (lzx_make_huffman_table(&ds->lt) < 0)
  ------------------
  |  Branch (2841:8): [True: 2, False: 4]
  ------------------
 2842|      2|				goto failed;
 2843|      4|			ds->state = ST_MAIN;
  ------------------
  |  |  175|      4|#define ST_MAIN			18
  ------------------
 2844|      4|			return (100);
 2845|    532|		}
 2846|    532|	}
 2847|     41|failed:
 2848|     41|	return (ds->error = ARCHIVE_FAILED);
  ------------------
  |  |  237|     41|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2849|    493|}
archive_read_support_format_cab.c:lzx_br_fillup:
 2395|    797|{
 2396|       |/*
 2397|       | * x86 processor family can read misaligned data without an access error.
 2398|       | */
 2399|    797|	ssize_t n = CACHE_BITS - br->cache_avail;
  ------------------
  |  |  140|    797|#define CACHE_BITS		(8 * sizeof(CACHE_TYPE))
  ------------------
 2400|       |
 2401|    797|	for (;;) {
 2402|    797|		switch (n >> 4) {
 2403|    793|		case 4:
  ------------------
  |  Branch (2403:3): [True: 793, False: 4]
  ------------------
 2404|    793|			if (strm->avail_in >= 8) {
  ------------------
  |  Branch (2404:8): [True: 793, False: 0]
  ------------------
 2405|    793|				br->cache_buffer =
 2406|    793|				    ((uint64_t)strm->next_in[1]) << 56 |
 2407|    793|				    ((uint64_t)strm->next_in[0]) << 48 |
 2408|    793|				    ((uint64_t)strm->next_in[3]) << 40 |
 2409|    793|				    ((uint64_t)strm->next_in[2]) << 32 |
 2410|    793|				    ((uint32_t)strm->next_in[5]) << 24 |
 2411|    793|				    ((uint32_t)strm->next_in[4]) << 16 |
 2412|    793|				    ((uint32_t)strm->next_in[7]) << 8 |
 2413|    793|				     (uint32_t)strm->next_in[6];
 2414|    793|				strm->next_in += 8;
 2415|    793|				strm->avail_in -= 8;
 2416|    793|				br->cache_avail += 8 * 8;
 2417|    793|				return (ARCHIVE_OK);
  ------------------
  |  |  233|    793|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2418|    793|			}
 2419|      0|			break;
 2420|      4|		case 3:
  ------------------
  |  Branch (2420:3): [True: 4, False: 793]
  ------------------
 2421|      4|			if (strm->avail_in >= 6) {
  ------------------
  |  Branch (2421:8): [True: 4, False: 0]
  ------------------
 2422|      4|				br->cache_buffer =
 2423|      4|		 		   (br->cache_buffer << 48) |
 2424|      4|				    ((uint64_t)strm->next_in[1]) << 40 |
 2425|      4|				    ((uint64_t)strm->next_in[0]) << 32 |
 2426|      4|				    ((uint64_t)strm->next_in[3]) << 24 |
 2427|      4|				    ((uint64_t)strm->next_in[2]) << 16 |
 2428|      4|				    ((uint64_t)strm->next_in[5]) << 8 |
 2429|      4|				     (uint64_t)strm->next_in[4];
 2430|      4|				strm->next_in += 6;
 2431|      4|				strm->avail_in -= 6;
 2432|      4|				br->cache_avail += 6 * 8;
 2433|      4|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      4|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2434|      4|			}
 2435|      0|			break;
 2436|      0|		case 0:
  ------------------
  |  Branch (2436:3): [True: 0, False: 797]
  ------------------
 2437|       |			/* We have enough compressed data in
 2438|       |			 * the cache buffer.*/
 2439|      0|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2440|      0|		default:
  ------------------
  |  Branch (2440:3): [True: 0, False: 797]
  ------------------
 2441|      0|			break;
 2442|    797|		}
 2443|      0|		if (strm->avail_in < 2) {
  ------------------
  |  Branch (2443:7): [True: 0, False: 0]
  ------------------
 2444|       |			/* There is not enough compressed data to
 2445|       |			 * fill up the cache buffer. */
 2446|      0|			if (strm->avail_in == 1) {
  ------------------
  |  Branch (2446:8): [True: 0, False: 0]
  ------------------
 2447|      0|				br->odd = *strm->next_in++;
 2448|      0|				strm->avail_in--;
 2449|      0|				br->have_odd = 1;
 2450|      0|			}
 2451|      0|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2452|      0|		}
 2453|      0|		br->cache_buffer =
 2454|      0|		   (br->cache_buffer << 16) |
 2455|      0|		    archive_le16dec(strm->next_in);
 2456|      0|		strm->next_in += 2;
 2457|      0|		strm->avail_in -= 2;
 2458|      0|		br->cache_avail += 16;
 2459|      0|		n -= 16;
 2460|      0|	}
 2461|    797|}
archive_read_support_format_cab.c:lzx_make_huffman_table:
 3265|    127|{
 3266|    127|	uint16_t bitptn[17], weight[17];
 3267|    127|	uint16_t *tbl;
 3268|    127|	const uint8_t *bitlen;
 3269|    127|	uint8_t maxbits = 0;
 3270|    127|	uint32_t ptn;
 3271|    127|	uint16_t i, symbol_count, w;
 3272|       |
 3273|       |	/*
 3274|       |	 * Initialize bit patterns.
 3275|       |	 *
 3276|       |	 * Each bitptn element represents the smallest possible
 3277|       |	 * code sequence allowed. The weight represents the amount
 3278|       |	 * of lookup bit patterns covered by a code of this length.
 3279|       |	 *
 3280|       |	 * Example of a Huffman tree:
 3281|       |	 *
 3282|       |	 * idx | freq[idx]
 3283|       |	 * ----+----------
 3284|       |	 *   1 |         1
 3285|       |	 *   2 |         2
 3286|       |	 *
 3287|       |	 * The result will be:
 3288|       |	 *
 3289|       |	 * idx | bitptn[idx] | weight[idx]
 3290|       |	 * ----+-------------+------------
 3291|       |	 *   1 |      0x0000 |       32768
 3292|       |	 *   2 |      0x8000 |       16384
 3293|       |	 *
 3294|       |	 * This means that a code with bit length 1 will take 32768
 3295|       |	 * possible combinations starting with 0b0. Since one such code exists
 3296|       |	 * (freq[1] = 1), codes with bit length 2 must start with 0b1. Since
 3297|       |	 * two codes with bit length 2 exist (freq[2] = 2), no more codes can
 3298|       |	 * be added.
 3299|       |	 *
 3300|       |	 * In this example, maxbits will be 2 (longest code length is 2).
 3301|       |	 */
 3302|    127|	ptn = 0;
 3303|  2.15k|	for (i = 1, w = 1 << 15; i <= 16; i++, w >>= 1) {
  ------------------
  |  Branch (3303:27): [True: 2.03k, False: 127]
  ------------------
 3304|  2.03k|		bitptn[i] = ptn;
 3305|  2.03k|		weight[i] = w;
 3306|  2.03k|		if (hf->freq[i]) {
  ------------------
  |  Branch (3306:7): [True: 131, False: 1.90k]
  ------------------
 3307|    131|			ptn += hf->freq[i] * w;
 3308|    131|			maxbits = i;
 3309|    131|		}
 3310|  2.03k|	}
 3311|       |	/* Verify Kraft's inequality. */
 3312|    127|	if (ptn != 0 && ptn != 0x10000)
  ------------------
  |  Branch (3312:6): [True: 74, False: 53]
  |  Branch (3312:18): [True: 35, False: 39]
  ------------------
 3313|     35|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     35|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3314|       |
 3315|       |	/*
 3316|       |	 * Shrink codes to smallest size by removing extra bits after
 3317|       |	 * the actual code sequences as good as possible.
 3318|       |	 *
 3319|       |	 * Continuing the example above:
 3320|       |	 *
 3321|       |	 * idx | bitptn[idx] | weight[idx]
 3322|       |	 * ----+-------------+-------------
 3323|       |	 *   1 |      0x0000 |       32768
 3324|       |	 *   2 |      0x8000 |       16384
 3325|       |	 *
 3326|       |	 * As can be seen, a total of 65536 entries must be created even
 3327|       |	 * though 4 would be sufficient (indices 0b00 to 0b11). Right shift
 3328|       |	 * the pattern and divide weight as much as possible:
 3329|       |	 *
 3330|       |	 * idx | bitptn[idx] | weight[idx]
 3331|       |	 * ----+-------------+-------------
 3332|       |	 *   1 |      0x0000 |           2
 3333|       |	 *   2 |      0x0002 |           1
 3334|       |	 *
 3335|       |	 * Thus, the direct, expanded lookup table only needs 4 entries.
 3336|       |	 */
 3337|     92|	if (maxbits < 16) {
  ------------------
  |  Branch (3337:6): [True: 92, False: 0]
  ------------------
 3338|     92|		uint8_t ebits = 16 - maxbits;
 3339|    145|		for (i = 1; i <= maxbits; i++) {
  ------------------
  |  Branch (3339:15): [True: 53, False: 92]
  ------------------
 3340|     53|			bitptn[i] >>= ebits;
 3341|     53|			weight[i] >>= ebits;
 3342|     53|		}
 3343|     92|	}
 3344|       |
 3345|       |	/* Grow table if necessary. */
 3346|     92|	if (maxbits > hf->tbl_bits) {
  ------------------
  |  Branch (3346:6): [True: 0, False: 92]
  ------------------
 3347|      0|		size_t tbl_size;
 3348|       |
 3349|      0|		hf->tbl_bits = 16;
 3350|      0|		tbl_size = (size_t)1 << hf->tbl_bits;
 3351|       |
 3352|      0|		free(hf->tbl);
 3353|      0|		hf->tbl = calloc(tbl_size, sizeof(hf->tbl[0]));
 3354|      0|		if (hf->tbl == NULL)
  ------------------
  |  Branch (3354:7): [True: 0, False: 0]
  ------------------
 3355|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3356|      0|	}
 3357|     92|	hf->lookup_bits = maxbits;
 3358|       |
 3359|       |	/*
 3360|       |	 * Construct the direct, expanded lookup table.
 3361|       |	 *
 3362|       |	 * Store each symbol in table for every possible bit patterns starting
 3363|       |	 * with their code.
 3364|       |	 *
 3365|       |	 * Following the example with len_avail being 4:
 3366|       |	 *
 3367|       |	 * idx | bitlen[idx]
 3368|       |	 * ----+------------
 3369|       |	 *   0 |           0
 3370|       |	 *   1 |           1
 3371|       |	 *   2 |           0
 3372|       |	 *   3 |           2
 3373|       |	 *   4 |           2
 3374|       |	 *
 3375|       |	 * The resulting table contains all used symbols (1, 3, 4) for up to
 3376|       |	 * max_len bit patterns:
 3377|       |	 *
 3378|       |	 *       idx | tbl[idx]
 3379|       |	 * ----------+---------
 3380|       |	 *  0 (0b00) |        1
 3381|       |	 *  1 (0b01) |        1
 3382|       |	 *  2 (0b10) |        3
 3383|       |	 *  3 (0b11) |        4
 3384|       |	 */
 3385|     92|	tbl = hf->tbl;
 3386|     92|	bitlen = hf->bitlen;
 3387|     92|	symbol_count = hf->symbol_count;
 3388|  5.87k|	for (i = 0; i < symbol_count; i++) {
  ------------------
  |  Branch (3388:14): [True: 5.78k, False: 92]
  ------------------
 3389|  5.78k|		uint16_t *p;
 3390|  5.78k|		uint16_t cnt;
 3391|  5.78k|		uint8_t len;
 3392|       |
 3393|  5.78k|		if (bitlen[i] == 0)
  ------------------
  |  Branch (3393:7): [True: 5.19k, False: 586]
  ------------------
 3394|  5.19k|			continue;
 3395|       |		/* Get a bit pattern */
 3396|    586|		len = bitlen[i];
 3397|    586|		if (len > maxbits)
  ------------------
  |  Branch (3397:7): [True: 0, False: 586]
  ------------------
 3398|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3399|    586|		ptn = bitptn[len];
 3400|    586|		cnt = weight[len];
 3401|       |		/* Calculate next bit pattern */
 3402|    586|		bitptn[len] = ptn + cnt;
 3403|       |		/* Update the table */
 3404|    586|		p = tbl + ptn;
 3405|  1.17k|		while (cnt-- > 0)
  ------------------
  |  Branch (3405:10): [True: 586, False: 586]
  ------------------
 3406|    586|			*p++ = i;
 3407|    586|	}
 3408|     92|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     92|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3409|     92|}
archive_read_support_format_cab.c:lzx_read_pre_tree:
 3128|     78|{
 3129|     78|	struct lzx_dec *ds = strm->ds;
 3130|     78|	struct lzx_br *br = &(ds->br);
 3131|     78|	uint16_t i;
 3132|       |
 3133|     78|	if (ds->loop == 0)
  ------------------
  |  Branch (3133:6): [True: 78, False: 0]
  ------------------
 3134|     78|		memset(ds->pt.freq, 0, sizeof(ds->pt.freq));
 3135|  1.63k|	for (i = ds->loop; i < ds->pt.symbol_count; i++) {
  ------------------
  |  Branch (3135:21): [True: 1.56k, False: 78]
  ------------------
 3136|  1.56k|		if (!lzx_br_read_ahead(strm, br, 4)) {
  ------------------
  |  | 2366|  1.56k|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2361|  3.12k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2347|  3.12k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2347:27): [True: 1.47k, False: 85]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|     85|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2361:28): [True: 85, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2347:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3137|      0|			ds->loop = i;
 3138|      0|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3139|      0|		}
 3140|  1.56k|		ds->pt.bitlen[i] = lzx_br_bits(br, 4);
  ------------------
  |  | 2350|  1.56k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2351|  1.56k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3141|  1.56k|		ds->pt.freq[ds->pt.bitlen[i]]++;
 3142|  1.56k|		lzx_br_consume(br, 4);
  ------------------
  |  | 2369|  1.56k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3143|  1.56k|	}
 3144|     78|	ds->loop = i;
 3145|     78|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     78|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3146|     78|}
archive_read_support_format_cab.c:lzx_read_bitlen:
 3153|     76|{
 3154|     76|	struct lzx_dec *ds = strm->ds;
 3155|     76|	struct lzx_br *br = &(ds->br);
 3156|     76|	int ret;
 3157|     76|	uint16_t c, i, j, rbits, same;
 3158|       |
 3159|     76|	i = ds->loop;
 3160|     76|	if (i == 0)
  ------------------
  |  Branch (3160:6): [True: 41, False: 35]
  ------------------
 3161|     41|		memset(d->freq, 0, sizeof(d->freq));
 3162|     76|	ret = ARCHIVE_EOF;
  ------------------
  |  |  232|     76|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3163|     76|	if (end == 0)
  ------------------
  |  Branch (3163:6): [True: 41, False: 35]
  ------------------
 3164|     41|		end = d->symbol_count;
 3165|  23.0k|	while (i < end) {
  ------------------
  |  Branch (3165:9): [True: 22.9k, False: 76]
  ------------------
 3166|  22.9k|		ds->loop = i;
 3167|  22.9k|		if (!lzx_br_read_ahead(strm, br, (unsigned)ds->pt.lookup_bits))
  ------------------
  |  | 2366|  22.9k|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2361|  45.9k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2347|  45.9k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2347:27): [True: 22.7k, False: 217]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|    217|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2361:28): [True: 217, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2347:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3168|      0|			goto getdata;
 3169|  22.9k|		rbits = lzx_br_bits(br, ds->pt.lookup_bits);
  ------------------
  |  | 2350|  22.9k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2351|  22.9k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3170|  22.9k|		c = lzx_decode_huffman(&(ds->pt), rbits);
 3171|  22.9k|		switch (c) {
 3172|      0|		case 17:/* several zero lengths, from 4 to 19. */
  ------------------
  |  Branch (3172:3): [True: 0, False: 22.9k]
  ------------------
 3173|      0|			if (!lzx_br_read_ahead(strm, br, ds->pt.bitlen[c] + 4U))
  ------------------
  |  | 2366|      0|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2361|      0|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2347:27): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2361:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2347:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3174|      0|				goto getdata;
 3175|      0|			lzx_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 2369|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3176|      0|			same = lzx_br_bits(br, 4) + 4;
  ------------------
  |  | 2350|      0|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2351|      0|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3177|      0|			if (same > end - i)
  ------------------
  |  Branch (3177:8): [True: 0, False: 0]
  ------------------
 3178|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3179|      0|			lzx_br_consume(br, 4);
  ------------------
  |  | 2369|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3180|      0|			for (j = 0; j < same; j++)
  ------------------
  |  Branch (3180:16): [True: 0, False: 0]
  ------------------
 3181|      0|				d->bitlen[i++] = 0;
 3182|      0|			break;
 3183|     31|		case 18:/* many zero lengths, from 20 to 51. */
  ------------------
  |  Branch (3183:3): [True: 31, False: 22.9k]
  ------------------
 3184|     31|			if (!lzx_br_read_ahead(strm, br, ds->pt.bitlen[c] + 5U))
  ------------------
  |  | 2366|     31|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2361|     62|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2347|     62|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2347:27): [True: 29, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2361:28): [True: 2, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2347:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3185|      0|				goto getdata;
 3186|     31|			lzx_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 2369|     31|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3187|     31|			same = lzx_br_bits(br, 5) + 20;
  ------------------
  |  | 2350|     31|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2351|     31|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3188|     31|			if (same > end - i)
  ------------------
  |  Branch (3188:8): [True: 0, False: 31]
  ------------------
 3189|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3190|     31|			lzx_br_consume(br, 5);
  ------------------
  |  | 2369|     31|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3191|     31|			memset(d->bitlen + i, 0, same);
 3192|     31|			i += same;
 3193|     31|			break;
 3194|      0|		case 19:/* a few same lengths. */
  ------------------
  |  Branch (3194:3): [True: 0, False: 22.9k]
  ------------------
 3195|      0|			if (!lzx_br_read_ahead(strm, br,
  ------------------
  |  | 2366|      0|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2361|      0|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2347:27): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2361:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2347:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3196|      0|			    ds->pt.bitlen[c] + 1U + ds->pt.lookup_bits))
 3197|      0|				goto getdata;
 3198|      0|			lzx_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 2369|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3199|      0|			same = lzx_br_bits(br, 1) + 4;
  ------------------
  |  | 2350|      0|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2351|      0|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3200|      0|			if (same > end - i)
  ------------------
  |  Branch (3200:8): [True: 0, False: 0]
  ------------------
 3201|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3202|      0|			lzx_br_consume(br, 1);
  ------------------
  |  | 2369|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3203|      0|			rbits = lzx_br_bits(br, ds->pt.lookup_bits);
  ------------------
  |  | 2350|      0|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2351|      0|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3204|      0|			c = lzx_decode_huffman(&(ds->pt), rbits);
 3205|      0|			lzx_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 2369|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3206|      0|			if (c > d->bitlen[i] + 17)
  ------------------
  |  Branch (3206:8): [True: 0, False: 0]
  ------------------
 3207|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3208|      0|			c = (d->bitlen[i] + 17 - c) % 17;
 3209|      0|			for (j = 0; j < same; j++)
  ------------------
  |  Branch (3209:16): [True: 0, False: 0]
  ------------------
 3210|      0|				d->bitlen[i++] = c;
 3211|      0|			d->freq[c] += same;
 3212|      0|			break;
 3213|  22.9k|		default:
  ------------------
  |  Branch (3213:3): [True: 22.9k, False: 31]
  ------------------
 3214|  22.9k|			lzx_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 2369|  22.9k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3215|  22.9k|			if (c > d->bitlen[i] + 17)
  ------------------
  |  Branch (3215:8): [True: 0, False: 22.9k]
  ------------------
 3216|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3217|  22.9k|			c = (d->bitlen[i] + 17 - c) % 17;
 3218|  22.9k|			d->freq[c]++;
 3219|  22.9k|			d->bitlen[i++] = c;
 3220|  22.9k|			break;
 3221|  22.9k|		}
 3222|  22.9k|	}
 3223|     76|	ret = ARCHIVE_OK;
  ------------------
  |  |  233|     76|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3224|     76|getdata:
 3225|     76|	ds->loop = i;
 3226|     76|	return (ret);
 3227|     76|}
archive_read_support_format_cab.c:lzx_decode_huffman:
 3413|  98.7k|{
 3414|  98.7k|	return hf->tbl[rbits];
 3415|  98.7k|}
archive_read_support_format_cab.c:lzx_decode_blocks:
 2853|      5|{
 2854|      5|	struct lzx_dec *ds = strm->ds;
 2855|      5|	struct lzx_br bre = ds->br;
 2856|      5|	struct huffman *at = &(ds->at), *lt = &(ds->lt), *mt = &(ds->mt);
 2857|      5|	const struct lzx_pos_tbl *pos_tbl = ds->pos_tbl;
 2858|      5|	unsigned char *noutp = strm->next_out;
 2859|      5|	unsigned char *endp = noutp + strm->avail_out;
 2860|      5|	uint8_t *w_buff = ds->w_buff;
 2861|      5|	uint8_t *at_bitlen = at->bitlen;
 2862|      5|	uint8_t *lt_bitlen = lt->bitlen;
 2863|      5|	uint8_t *mt_bitlen = mt->bitlen;
 2864|      5|	size_t block_bytes_avail = ds->block_bytes_avail;
 2865|      5|	uint8_t at_lookup_bits = at->lookup_bits;
 2866|      5|	uint8_t lt_lookup_bits = lt->lookup_bits;
 2867|      5|	uint8_t mt_lookup_bits = mt->lookup_bits;
 2868|      5|	size_t copy_len = ds->copy_len, copy_pos = ds->copy_pos;
 2869|      5|	size_t w_pos = ds->w_pos, w_mask = ds->w_mask, w_size = ds->w_size;
 2870|      5|	uint8_t length_header = ds->length_header;
 2871|      5|	uint8_t offset_bits = ds->offset_bits;
 2872|      5|	uint16_t position_slot = ds->position_slot;
 2873|      5|	size_t r0 = ds->r0, r1 = ds->r1, r2 = ds->r2;
 2874|      5|	int state = ds->state;
 2875|      5|	uint16_t c;
 2876|      5|	uint8_t block_type = ds->block_type;
 2877|       |
 2878|      5|	for (;;) {
 2879|      5|		switch (state) {
  ------------------
  |  Branch (2879:11): [True: 5, False: 0]
  ------------------
 2880|      5|		case ST_MAIN:
  ------------------
  |  |  175|      5|#define ST_MAIN			18
  ------------------
  |  Branch (2880:3): [True: 5, False: 0]
  ------------------
 2881|  75.8k|			for (;;) {
 2882|  75.8k|				if (block_bytes_avail == 0) {
  ------------------
  |  Branch (2882:9): [True: 0, False: 75.8k]
  ------------------
 2883|       |					/* This block ended. */
 2884|      0|					ds->state = ST_RD_BLOCK_TYPE;
  ------------------
  |  |  159|      0|#define ST_RD_BLOCK_TYPE	2
  ------------------
 2885|      0|					ds->br = bre;
 2886|      0|					ds->block_bytes_avail =
 2887|      0|					    block_bytes_avail;
 2888|      0|					ds->copy_len = copy_len;
 2889|      0|					ds->copy_pos = copy_pos;
 2890|      0|					ds->length_header = length_header;
 2891|      0|					ds->position_slot = position_slot;
 2892|      0|					ds->r0 = r0; ds->r1 = r1; ds->r2 = r2;
 2893|      0|					ds->w_pos = w_pos;
 2894|      0|					strm->avail_out = endp - noutp;
 2895|      0|					return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2896|      0|				}
 2897|  75.8k|				if (noutp >= endp)
  ------------------
  |  Branch (2897:9): [True: 5, False: 75.8k]
  ------------------
 2898|       |					/* Output buffer is empty. */
 2899|      5|					goto next_data;
 2900|       |
 2901|  75.8k|				if (!lzx_br_read_ahead(strm, &bre,
  ------------------
  |  | 2366|  75.8k|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2361|   151k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2347|   151k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2347:27): [True: 75.8k, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2361:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2347:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2902|  75.8k|				    mt_lookup_bits)) {
 2903|      0|					if (!last)
  ------------------
  |  Branch (2903:10): [True: 0, False: 0]
  ------------------
 2904|      0|						goto next_data;
 2905|       |					/* Remaining bits are less than
 2906|       |					 * maximum bits (mt.lookup_bits) but
 2907|       |					 * maybe it still remains as much as we
 2908|       |					 * need, so we should try to use it
 2909|       |					 * with dummy bits. */
 2910|      0|					c = lzx_decode_huffman(mt,
 2911|      0|					      lzx_br_bits_forced(
  ------------------
  |  | 2353|      0|	(((uint32_t)((br)->cache_buffer <<		\
  |  | 2354|      0|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 2912|      0|					        &bre, mt_lookup_bits));
 2913|      0|					if (!lzx_br_has(&bre, mt_bitlen[c]))
  ------------------
  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (2913:10): [True: 0, False: 0]
  ------------------
 2914|      0|						goto failed;/* Over read. */
 2915|      0|					lzx_br_consume(&bre, mt_bitlen[c]);
  ------------------
  |  | 2369|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2916|  75.8k|				} else {
 2917|  75.8k|					c = lzx_decode_huffman(mt,
 2918|  75.8k|					      lzx_br_bits(&bre, mt_lookup_bits));
  ------------------
  |  | 2350|  75.8k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2351|  75.8k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2919|  75.8k|					lzx_br_consume(&bre, mt_bitlen[c]);
  ------------------
  |  | 2369|  75.8k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2920|  75.8k|				}
 2921|  75.8k|				if (c > UCHAR_MAX)
  ------------------
  |  Branch (2921:9): [True: 0, False: 75.8k]
  ------------------
 2922|      0|					break;
 2923|       |				/*
 2924|       |				 * 'c' is exactly literal code.
 2925|       |				 */
 2926|       |				/* Save a decoded code to reference it
 2927|       |				 * afterward. */
 2928|  75.8k|				w_buff[w_pos] = c;
 2929|  75.8k|				w_pos = (w_pos + 1) & w_mask;
 2930|       |				/* Store the decoded code to output buffer. */
 2931|  75.8k|				*noutp++ = c;
 2932|  75.8k|				block_bytes_avail--;
 2933|  75.8k|			}
 2934|       |			/*
 2935|       |			 * Get a match code, its length and offset.
 2936|       |			 */
 2937|      0|			c -= UCHAR_MAX + 1;
 2938|      0|			length_header = c & 7;
 2939|      0|			position_slot = c >> 3;
 2940|       |			/* FALL THROUGH */
 2941|      0|		case ST_LENGTH:
  ------------------
  |  |  176|      0|#define ST_LENGTH		19
  ------------------
  |  Branch (2941:3): [True: 0, False: 5]
  ------------------
 2942|       |			/*
 2943|       |			 * Get a length.
 2944|       |			 */
 2945|      0|			if (length_header == 7) {
  ------------------
  |  Branch (2945:8): [True: 0, False: 0]
  ------------------
 2946|      0|				if (!lzx_br_read_ahead(strm, &bre,
  ------------------
  |  | 2366|      0|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2361|      0|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2347:27): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2361:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2347:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2947|      0|				    lt_lookup_bits)) {
 2948|      0|					if (!last) {
  ------------------
  |  Branch (2948:10): [True: 0, False: 0]
  ------------------
 2949|      0|						state = ST_LENGTH;
  ------------------
  |  |  176|      0|#define ST_LENGTH		19
  ------------------
 2950|      0|						goto next_data;
 2951|      0|					}
 2952|      0|					c = lzx_decode_huffman(lt,
 2953|      0|					      lzx_br_bits_forced(
  ------------------
  |  | 2353|      0|	(((uint32_t)((br)->cache_buffer <<		\
  |  | 2354|      0|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 2954|      0|					        &bre, lt_lookup_bits));
 2955|      0|					if (!lzx_br_has(&bre, lt_bitlen[c]))
  ------------------
  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (2955:10): [True: 0, False: 0]
  ------------------
 2956|      0|						goto failed;/* Over read. */
 2957|      0|					lzx_br_consume(&bre, lt_bitlen[c]);
  ------------------
  |  | 2369|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2958|      0|				} else {
 2959|      0|					c = lzx_decode_huffman(lt,
 2960|      0|					    lzx_br_bits(&bre, lt_lookup_bits));
  ------------------
  |  | 2350|      0|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2351|      0|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2961|      0|					lzx_br_consume(&bre, lt_bitlen[c]);
  ------------------
  |  | 2369|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2962|      0|				}
 2963|      0|				copy_len = c + 7 + 2;
 2964|      0|			} else
 2965|      0|				copy_len = length_header + 2;
 2966|      0|			if (copy_len > block_bytes_avail)
  ------------------
  |  Branch (2966:8): [True: 0, False: 0]
  ------------------
 2967|      0|				goto failed;
 2968|       |			/*
 2969|       |			 * Get an offset.
 2970|       |			 */
 2971|      0|			switch (position_slot) {
 2972|      0|			case 0: /* Use repeated offset 0. */
  ------------------
  |  Branch (2972:4): [True: 0, False: 0]
  ------------------
 2973|      0|				copy_pos = r0;
 2974|      0|				state = ST_REAL_POS;
  ------------------
  |  |  178|      0|#define ST_REAL_POS		21
  ------------------
 2975|      0|				continue;
 2976|      0|			case 1: /* Use repeated offset 1. */
  ------------------
  |  Branch (2976:4): [True: 0, False: 0]
  ------------------
 2977|      0|				copy_pos = r1;
 2978|       |				/* Swap repeated offset. */
 2979|      0|				r1 = r0;
 2980|      0|				r0 = copy_pos;
 2981|      0|				state = ST_REAL_POS;
  ------------------
  |  |  178|      0|#define ST_REAL_POS		21
  ------------------
 2982|      0|				continue;
 2983|      0|			case 2: /* Use repeated offset 2. */
  ------------------
  |  Branch (2983:4): [True: 0, False: 0]
  ------------------
 2984|      0|				copy_pos = r2;
 2985|       |				/* Swap repeated offset. */
 2986|      0|				r2 = r0;
 2987|      0|				r0 = copy_pos;
 2988|      0|				state = ST_REAL_POS;
  ------------------
  |  |  178|      0|#define ST_REAL_POS		21
  ------------------
 2989|      0|				continue;
 2990|      0|			default:
  ------------------
  |  Branch (2990:4): [True: 0, False: 0]
  ------------------
 2991|      0|				offset_bits =
 2992|      0|				    pos_tbl[position_slot].footer_bits;
 2993|      0|				break;
 2994|      0|			}
 2995|       |			/* FALL THROUGH */
 2996|      0|		case ST_OFFSET:
  ------------------
  |  |  177|      0|#define ST_OFFSET		20
  ------------------
  |  Branch (2996:3): [True: 0, False: 5]
  ------------------
 2997|       |			/*
 2998|       |			 * Get the offset, which is a distance from
 2999|       |			 * current window position.
 3000|       |			 */
 3001|      0|			if (block_type == ALIGNED_OFFSET_BLOCK &&
  ------------------
  |  |  201|      0|#define ALIGNED_OFFSET_BLOCK	2
  ------------------
  |  Branch (3001:8): [True: 0, False: 0]
  ------------------
 3002|      0|			    offset_bits >= 3) {
  ------------------
  |  Branch (3002:8): [True: 0, False: 0]
  ------------------
 3003|      0|				unsigned offbits = offset_bits - 3;
 3004|       |
 3005|      0|				if (!lzx_br_read_ahead(strm, &bre, offbits)) {
  ------------------
  |  | 2366|      0|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2361|      0|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2347:27): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2361:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2347:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3006|      0|					state = ST_OFFSET;
  ------------------
  |  |  177|      0|#define ST_OFFSET		20
  ------------------
 3007|      0|					if (last)
  ------------------
  |  Branch (3007:10): [True: 0, False: 0]
  ------------------
 3008|      0|						goto failed;
 3009|      0|					goto next_data;
 3010|      0|				}
 3011|      0|				copy_pos = lzx_br_bits(&bre, offbits) << 3;
  ------------------
  |  | 2350|      0|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2351|      0|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3012|       |
 3013|       |				/* Get an aligned number. */
 3014|      0|				if (!lzx_br_read_ahead(strm, &bre,
  ------------------
  |  | 2366|      0|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2361|      0|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2347:27): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2361:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2347:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3015|      0|				    offbits + at_lookup_bits)) {
 3016|      0|					if (!last) {
  ------------------
  |  Branch (3016:10): [True: 0, False: 0]
  ------------------
 3017|      0|						state = ST_OFFSET;
  ------------------
  |  |  177|      0|#define ST_OFFSET		20
  ------------------
 3018|      0|						goto next_data;
 3019|      0|					}
 3020|      0|					lzx_br_consume(&bre, offbits);
  ------------------
  |  | 2369|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3021|      0|					c = lzx_decode_huffman(at,
 3022|      0|					      lzx_br_bits_forced(&bre,
  ------------------
  |  | 2353|      0|	(((uint32_t)((br)->cache_buffer <<		\
  |  | 2354|      0|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 3023|      0|					        at_lookup_bits));
 3024|      0|					if (!lzx_br_has(&bre, at_bitlen[c]))
  ------------------
  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (3024:10): [True: 0, False: 0]
  ------------------
 3025|      0|						goto failed;/* Over read. */
 3026|      0|					lzx_br_consume(&bre, at_bitlen[c]);
  ------------------
  |  | 2369|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3027|      0|				} else {
 3028|      0|					lzx_br_consume(&bre, offbits);
  ------------------
  |  | 2369|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3029|      0|					c = lzx_decode_huffman(at,
 3030|      0|					      lzx_br_bits(&bre, at_lookup_bits));
  ------------------
  |  | 2350|      0|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2351|      0|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3031|      0|					lzx_br_consume(&bre, at_bitlen[c]);
  ------------------
  |  | 2369|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3032|      0|				}
 3033|       |				/* Add an aligned number. */
 3034|      0|				copy_pos += c;
 3035|      0|			} else {
 3036|      0|				if (!lzx_br_read_ahead(strm, &bre,
  ------------------
  |  | 2366|      0|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2361|      0|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2347:27): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2361:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2347|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2347:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3037|      0|				    offset_bits)) {
 3038|      0|					state = ST_OFFSET;
  ------------------
  |  |  177|      0|#define ST_OFFSET		20
  ------------------
 3039|      0|					if (last)
  ------------------
  |  Branch (3039:10): [True: 0, False: 0]
  ------------------
 3040|      0|						goto failed;
 3041|      0|					goto next_data;
 3042|      0|				}
 3043|      0|				copy_pos = lzx_br_bits(&bre, offset_bits);
  ------------------
  |  | 2350|      0|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2351|      0|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3044|      0|				lzx_br_consume(&bre, offset_bits);
  ------------------
  |  | 2369|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3045|      0|			}
 3046|      0|			copy_pos += pos_tbl[position_slot].base - 2;
 3047|       |
 3048|       |			/* Update repeated offset LRU queue. */
 3049|      0|			r2 = r1;
 3050|      0|			r1 = r0;
 3051|      0|			r0 = copy_pos;
 3052|       |			/* FALL THROUGH */
 3053|      0|		case ST_REAL_POS:
  ------------------
  |  |  178|      0|#define ST_REAL_POS		21
  ------------------
  |  Branch (3053:3): [True: 0, False: 5]
  ------------------
 3054|       |			/*
 3055|       |			 * Compute a real position in window.
 3056|       |			 */
 3057|      0|			copy_pos = (w_pos - copy_pos) & w_mask;
 3058|       |			/* FALL THROUGH */
 3059|      0|		case ST_COPY:
  ------------------
  |  |  179|      0|#define ST_COPY			22
  ------------------
  |  Branch (3059:3): [True: 0, False: 5]
  ------------------
 3060|       |			/*
 3061|       |			 * Copy several bytes as extracted data from the window
 3062|       |			 * into the output buffer.
 3063|       |			 */
 3064|      0|			for (;;) {
 3065|      0|				const uint8_t *s;
 3066|      0|				size_t l;
 3067|       |
 3068|      0|				l = copy_len;
 3069|      0|				if (copy_pos > w_pos) {
  ------------------
  |  Branch (3069:9): [True: 0, False: 0]
  ------------------
 3070|      0|					if (l > w_size - copy_pos)
  ------------------
  |  Branch (3070:10): [True: 0, False: 0]
  ------------------
 3071|      0|						l = w_size - copy_pos;
 3072|      0|				} else {
 3073|      0|					if (l > w_size - w_pos)
  ------------------
  |  Branch (3073:10): [True: 0, False: 0]
  ------------------
 3074|      0|						l = w_size - w_pos;
 3075|      0|				}
 3076|      0|				if (noutp + l >= endp)
  ------------------
  |  Branch (3076:9): [True: 0, False: 0]
  ------------------
 3077|      0|					l = endp - noutp;
 3078|      0|				s = w_buff + copy_pos;
 3079|      0|				if (l >= 8 && ((copy_pos + l < w_pos)
  ------------------
  |  Branch (3079:9): [True: 0, False: 0]
  |  Branch (3079:20): [True: 0, False: 0]
  ------------------
 3080|      0|				  || (w_pos + l < copy_pos))) {
  ------------------
  |  Branch (3080:10): [True: 0, False: 0]
  ------------------
 3081|      0|					memcpy(w_buff + w_pos, s, l);
 3082|      0|					memcpy(noutp, s, l);
 3083|      0|				} else {
 3084|      0|					uint8_t *d;
 3085|      0|					size_t li;
 3086|       |
 3087|      0|					d = w_buff + w_pos;
 3088|      0|					for (li = 0; li < l; li++)
  ------------------
  |  Branch (3088:19): [True: 0, False: 0]
  ------------------
 3089|      0|						noutp[li] = d[li] = s[li];
 3090|      0|				}
 3091|      0|				noutp += l;
 3092|      0|				copy_pos = (copy_pos + l) & w_mask;
 3093|      0|				w_pos = (w_pos + l) & w_mask;
 3094|      0|				block_bytes_avail -= l;
 3095|      0|				if (copy_len <= l)
  ------------------
  |  Branch (3095:9): [True: 0, False: 0]
  ------------------
 3096|       |					/* A copy of current pattern ended. */
 3097|      0|					break;
 3098|      0|				copy_len -= l;
 3099|      0|				if (noutp >= endp) {
  ------------------
  |  Branch (3099:9): [True: 0, False: 0]
  ------------------
 3100|       |					/* Output buffer is empty. */
 3101|      0|					state = ST_COPY;
  ------------------
  |  |  179|      0|#define ST_COPY			22
  ------------------
 3102|      0|					goto next_data;
 3103|      0|				}
 3104|      0|			}
 3105|      0|			state = ST_MAIN;
  ------------------
  |  |  175|      0|#define ST_MAIN			18
  ------------------
 3106|      0|			break;
 3107|      5|		}
 3108|      5|	}
 3109|      0|failed:
 3110|      0|	return (ds->error = ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3111|      5|next_data:
 3112|      5|	ds->br = bre;
 3113|      5|	ds->block_bytes_avail = block_bytes_avail;
 3114|      5|	ds->copy_len = copy_len;
 3115|      5|	ds->copy_pos = copy_pos;
 3116|      5|	ds->length_header = length_header;
 3117|      5|	ds->offset_bits = offset_bits;
 3118|      5|	ds->position_slot = position_slot;
 3119|      5|	ds->r0 = r0; ds->r1 = r1; ds->r2 = r2;
 3120|      5|	ds->state = state;
 3121|      5|	ds->w_pos = w_pos;
 3122|      5|	strm->avail_out = endp - noutp;
 3123|      5|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      5|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3124|      5|}
archive_read_support_format_cab.c:lzx_translation:
 2312|      6|{
 2313|      6|	struct lzx_dec *ds = strm->ds;
 2314|      6|	unsigned char *p, *end;
 2315|       |
 2316|      6|	if (!ds->translation || offset >= MAX_E8_TRANSLATION || size <= 10)
  ------------------
  |  |  286|      9|#define MAX_E8_TRANSLATION	(0x8000 * MAX_UNCOMPRESS_SIZE)
  |  |  ------------------
  |  |  |  |  284|      3|#define MAX_UNCOMPRESS_SIZE	0x8000
  |  |  ------------------
  ------------------
  |  Branch (2316:6): [True: 3, False: 3]
  |  Branch (2316:26): [True: 0, False: 3]
  |  Branch (2316:58): [True: 1, False: 2]
  ------------------
 2317|      4|		return;
 2318|       |
 2319|      2|	p = buffer;
 2320|      2|	end = buffer + size - 10;
 2321|       |
 2322|      2|	while (p < end && (p = memchr(p, 0xE8, end - p)) != NULL) {
  ------------------
  |  Branch (2322:9): [True: 2, False: 0]
  |  Branch (2322:20): [True: 0, False: 2]
  ------------------
 2323|      0|		int32_t address, position;
 2324|       |
 2325|      0|		address = archive_le32dec(p + 1);
 2326|      0|		position = offset + (p - buffer);
 2327|       |
 2328|      0|		if (address >= -position && address < ds->translation_size) {
  ------------------
  |  Branch (2328:7): [True: 0, False: 0]
  |  Branch (2328:31): [True: 0, False: 0]
  ------------------
 2329|      0|			uint32_t relative;
 2330|       |
 2331|      0|			if (address >= 0)
  ------------------
  |  Branch (2331:8): [True: 0, False: 0]
  ------------------
 2332|      0|				relative = address - position;
 2333|      0|			else
 2334|      0|				relative = address + ds->translation_size;
 2335|       |
 2336|      0|			archive_le32enc(p + 1, relative);
 2337|      0|		}
 2338|       |
 2339|      0|		p += 5;
 2340|      0|	}
 2341|      2|}
archive_read_support_format_cab.c:cab_read_data:
 2033|     76|{
 2034|     76|	struct cab *cab = (struct cab *)(a->format->data);
 2035|     76|	ssize_t bytes_avail;
 2036|       |
 2037|     76|	if (cab->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (2037:6): [True: 0, False: 76]
  ------------------
 2038|      0|		*buff = NULL;
 2039|      0|		*size = 0;
 2040|      0|		*offset = cab->entry_offset;
 2041|      0|		cab->end_of_entry = 1;
 2042|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2043|      0|	}
 2044|       |
 2045|     76|	*buff = cab_read_ahead_cfdata(a, &bytes_avail);
 2046|     76|	if (bytes_avail <= 0) {
  ------------------
  |  Branch (2046:6): [True: 55, False: 21]
  ------------------
 2047|     55|		*buff = NULL;
 2048|     55|		*size = 0;
 2049|     55|		*offset = 0;
 2050|     55|		if (bytes_avail == 0 &&
  ------------------
  |  Branch (2050:7): [True: 2, False: 53]
  ------------------
 2051|      2|		    cab->entry_cfdata->uncompressed_size == 0) {
  ------------------
  |  Branch (2051:7): [True: 2, False: 0]
  ------------------
 2052|       |			/* All of CFDATA in a folder has been handled. */
 2053|      2|			archive_set_error(&a->archive,
 2054|      2|			    ARCHIVE_ERRNO_FILE_FORMAT, "Invalid CFDATA");
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2055|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2056|      2|		} else
 2057|     53|			return ((int)bytes_avail);
 2058|     55|	}
 2059|     21|	if (bytes_avail > cab->entry_bytes_remaining)
  ------------------
  |  Branch (2059:6): [True: 16, False: 5]
  ------------------
 2060|     16|		bytes_avail = (ssize_t)cab->entry_bytes_remaining;
 2061|       |
 2062|     21|	*size = bytes_avail;
 2063|     21|	*offset = cab->entry_offset;
 2064|     21|	cab->entry_offset += bytes_avail;
 2065|     21|	cab->entry_bytes_remaining -= bytes_avail;
 2066|     21|	if (cab->entry_bytes_remaining == 0)
  ------------------
  |  Branch (2066:6): [True: 16, False: 5]
  ------------------
 2067|     16|		cab->end_of_entry = 1;
 2068|     21|	cab->entry_unconsumed = bytes_avail;
 2069|     21|	if (cab->entry_cffolder->comptype == COMPTYPE_NONE) {
  ------------------
  |  |  321|     21|#define COMPTYPE_NONE		0x0000
  ------------------
  |  Branch (2069:6): [True: 3, False: 18]
  ------------------
 2070|       |		/* Don't consume more than current entry used. */
 2071|      3|		if (cab->entry_cfdata->unconsumed > cab->entry_unconsumed)
  ------------------
  |  Branch (2071:7): [True: 2, False: 1]
  ------------------
 2072|      2|			cab->entry_cfdata->unconsumed = cab->entry_unconsumed;
 2073|      3|	}
 2074|     21|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     21|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2075|     76|}
archive_read_support_format_cab.c:archive_read_format_cab_read_data_skip:
 2079|     25|{
 2080|     25|	struct cab *cab;
 2081|     25|	int64_t bytes_skipped;
 2082|     25|	int r;
 2083|       |
 2084|     25|	cab = (struct cab *)(a->format->data);
 2085|       |
 2086|     25|	if (cab->end_of_archive)
  ------------------
  |  Branch (2086:6): [True: 0, False: 25]
  ------------------
 2087|      0|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2088|       |
 2089|     25|	if (!cab->read_data_invoked) {
  ------------------
  |  Branch (2089:6): [True: 3, False: 22]
  ------------------
 2090|      3|		cab->bytes_skipped += cab->entry_bytes_remaining;
 2091|      3|		cab->entry_bytes_remaining = 0;
 2092|       |		/* This entry is finished and done. */
 2093|      3|		cab->end_of_entry_cleanup = cab->end_of_entry = 1;
 2094|      3|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2095|      3|	}
 2096|       |
 2097|     22|	if (cab->entry_unconsumed) {
  ------------------
  |  Branch (2097:6): [True: 0, False: 22]
  ------------------
 2098|       |		/* Consume as much as the compressor actually used. */
 2099|      0|		r = (int)cab_consume_cfdata(a, cab->entry_unconsumed);
 2100|      0|		cab->entry_unconsumed = 0;
 2101|      0|		if (r < 0)
  ------------------
  |  Branch (2101:7): [True: 0, False: 0]
  ------------------
 2102|      0|			return (r);
 2103|     22|	} else if (cab->entry_cfdata == NULL) {
  ------------------
  |  Branch (2103:13): [True: 0, False: 22]
  ------------------
 2104|      0|		r = cab_next_cfdata(a);
 2105|      0|		if (r < 0)
  ------------------
  |  Branch (2105:7): [True: 0, False: 0]
  ------------------
 2106|      0|			return (r);
 2107|      0|	}
 2108|       |
 2109|       |	/* if we've already read to end of data, we're done. */
 2110|     22|	if (cab->end_of_entry_cleanup)
  ------------------
  |  Branch (2110:6): [True: 16, False: 6]
  ------------------
 2111|     16|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     16|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2112|       |
 2113|       |	/*
 2114|       |	 * If the length is at the beginning, we can skip the
 2115|       |	 * compressed data much more quickly.
 2116|       |	 */
 2117|      6|	bytes_skipped = cab_consume_cfdata(a, cab->entry_bytes_remaining);
 2118|      6|	if (bytes_skipped < 0)
  ------------------
  |  Branch (2118:6): [True: 5, False: 1]
  ------------------
 2119|      5|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2120|       |
 2121|       |	/* If the compression type is none(uncompressed), we've already
 2122|       |	 * consumed data as much as the current entry size. */
 2123|      1|	if (cab->entry_cffolder->comptype == COMPTYPE_NONE &&
  ------------------
  |  |  321|      2|#define COMPTYPE_NONE		0x0000
  ------------------
  |  Branch (2123:6): [True: 0, False: 1]
  ------------------
 2124|      0|	    cab->entry_cfdata != NULL)
  ------------------
  |  Branch (2124:6): [True: 0, False: 0]
  ------------------
 2125|      0|		cab->entry_cfdata->unconsumed = 0;
 2126|       |
 2127|       |	/* This entry is finished and done. */
 2128|      1|	cab->end_of_entry_cleanup = cab->end_of_entry = 1;
 2129|      1|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2130|      6|}
archive_read_support_format_cab.c:archive_read_format_cab_cleanup:
 2134|  2.49k|{
 2135|  2.49k|	struct cab *cab = (struct cab *)(a->format->data);
 2136|  2.49k|	struct cfheader *hd = &cab->cfheader;
 2137|  2.49k|	uint16_t i;
 2138|       |
 2139|  2.49k|	if (hd->folder_array != NULL) {
  ------------------
  |  Branch (2139:6): [True: 72, False: 2.42k]
  ------------------
 2140|  5.34k|		for (i = 0; i < hd->folder_count; i++)
  ------------------
  |  Branch (2140:15): [True: 5.27k, False: 72]
  ------------------
 2141|  5.27k|			free(hd->folder_array[i].cfdata.memimage);
 2142|     72|		free(hd->folder_array);
 2143|     72|	}
 2144|  2.49k|	if (hd->file_array != NULL) {
  ------------------
  |  Branch (2144:6): [True: 70, False: 2.42k]
  ------------------
 2145|    160|		for (i = 0; i < cab->cfheader.file_count; i++)
  ------------------
  |  Branch (2145:15): [True: 90, False: 70]
  ------------------
 2146|     90|			archive_string_free(&(hd->file_array[i].pathname));
 2147|     70|		free(hd->file_array);
 2148|     70|	}
 2149|  2.49k|#ifdef HAVE_ZLIB_H
 2150|  2.49k|	if (cab->stream_valid)
  ------------------
  |  Branch (2150:6): [True: 18, False: 2.48k]
  ------------------
 2151|     18|		inflateEnd(&cab->stream);
 2152|  2.49k|#endif
 2153|  2.49k|	lzx_decode_free(&cab->xstrm);
 2154|  2.49k|	archive_wstring_free(&cab->ws);
 2155|  2.49k|	free(cab->uncompressed_buffer);
 2156|  2.49k|	free(cab);
 2157|  2.49k|	(a->format->data) = NULL;
 2158|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2159|  2.49k|}
archive_read_support_format_cab.c:lzx_decode_free:
 2292|  2.49k|{
 2293|       |
 2294|  2.49k|	if (strm->ds == NULL)
  ------------------
  |  Branch (2294:6): [True: 2.45k, False: 47]
  ------------------
 2295|  2.45k|		return;
 2296|     47|	free(strm->ds->w_buff);
 2297|     47|	free(strm->ds->pos_tbl);
 2298|     47|	lzx_huffman_free(&(strm->ds->at));
 2299|     47|	lzx_huffman_free(&(strm->ds->pt));
 2300|     47|	lzx_huffman_free(&(strm->ds->mt));
 2301|     47|	lzx_huffman_free(&(strm->ds->lt));
 2302|     47|	free(strm->ds);
 2303|       |	strm->ds = NULL;
 2304|     47|}
archive_read_support_format_cab.c:lzx_huffman_free:
 3254|    188|{
 3255|    188|	free(hf->bitlen);
 3256|    188|	free(hf->tbl);
 3257|    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,
  ------------------
  |  |  177|  2.49k|	do { \
  |  |  178|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  2.49k|			(allowed_states), (function_name)); \
  |  |  180|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  181|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182: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:
  796|    751|{
  797|    751|	const void *h;
  798|    751|	int r;
  799|    751|	const char *header;
  800|       |
  801|    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
  |  |  ------------------
  ------------------
  802|    751|	a->archive.archive_format_name = "POSIX octet-oriented cpio";
  803|       |
  804|       |	/* Find the start of the next header. */
  805|    751|	r = find_odc_header(a);
  806|    751|	if (r < ARCHIVE_WARN)
  ------------------
  |  |  235|    751|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (806:6): [True: 45, False: 706]
  ------------------
  807|     45|		return (r);
  808|       |
  809|    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 (809:6): [True: 22, False: 684]
  ------------------
  810|     22|		int r2 = (header_afiol(a, cpio, entry, namelength, name_pad));
  811|     22|		if (r2 == ARCHIVE_OK)
  ------------------
  |  |  233|     22|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (811:7): [True: 16, False: 6]
  ------------------
  812|     16|			return (r);
  813|      6|		else
  814|      6|			return (r2);
  815|     22|	}
  816|       |
  817|       |	/* Read fixed-size portion of header. */
  818|    684|	h = __archive_read_ahead(a, odc_header_size, NULL);
  ------------------
  |  |   93|    684|#define	odc_header_size 76
  ------------------
  819|    684|	if (h == NULL)
  ------------------
  |  Branch (819:6): [True: 0, False: 684]
  ------------------
  820|      0|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  821|       |
  822|       |	/* Parse out octal fields. */
  823|    684|	header = (const char *)h;
  824|       |
  825|    684|	archive_entry_set_dev(entry, 
  826|    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
  ------------------
  827|    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
  ------------------
  828|    684|	archive_entry_set_mode(entry, 
  829|    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
  ------------------
  830|    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
  ------------------
  831|    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
  ------------------
  832|    684|	archive_entry_set_nlink(entry, 
  833|    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
  ------------------
  834|    684|	archive_entry_set_rdev(entry,
  835|    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
  ------------------
  836|    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
  ------------------
  837|    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
  ------------------
  838|    684|	*name_pad = 0; /* No padding of filename. */
  839|       |
  840|       |	/*
  841|       |	 * Note: entry_bytes_remaining is at least 64 bits and
  842|       |	 * therefore guaranteed to be big enough for a 33-bit file
  843|       |	 * size.
  844|       |	 */
  845|    684|	cpio->entry_bytes_remaining =
  846|    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
  ------------------
  847|    684|	archive_entry_set_size(entry, cpio->entry_bytes_remaining);
  848|    684|	cpio->entry_padding = 0;
  849|    684|	__archive_read_consume(a, odc_header_size);
  ------------------
  |  |   93|    684|#define	odc_header_size 76
  ------------------
  850|    684|	return (r);
  851|    684|}
archive_read_support_format_cpio.c:find_odc_header:
  718|    751|{
  719|    751|	const void *h;
  720|    751|	const char *p, *q;
  721|    751|	int64_t skip;
  722|    751|	uintmax_t skipped = 0;
  723|    751|	ssize_t bytes;
  724|       |
  725|  3.40k|	for (;;) {
  726|  3.40k|		size_t header_size;
  727|       |
  728|  3.40k|		header_size = afiol_header_size;
  ------------------
  |  |  162|  3.40k|#define afiol_header_size 116
  ------------------
  729|  3.40k|		h = __archive_read_ahead(a, afiol_header_size, &bytes);
  ------------------
  |  |  162|  3.40k|#define afiol_header_size 116
  ------------------
  730|  3.40k|		if (h == NULL) {
  ------------------
  |  Branch (730:7): [True: 87, False: 3.31k]
  ------------------
  731|     87|			if (bytes >= odc_header_size) {
  ------------------
  |  |   93|     87|#define	odc_header_size 76
  ------------------
  |  Branch (731:8): [True: 42, False: 45]
  ------------------
  732|     42|				header_size = odc_header_size;
  ------------------
  |  |   93|     42|#define	odc_header_size 76
  ------------------
  733|     42|				h = __archive_read_ahead(a, odc_header_size,
  ------------------
  |  |   93|     42|#define	odc_header_size 76
  ------------------
  734|     42|				    &bytes);
  735|     42|			}
  736|     87|			if (h == NULL)
  ------------------
  |  Branch (736:8): [True: 45, False: 42]
  ------------------
  737|     45|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     45|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  738|     87|		}
  739|  3.35k|		p = h;
  740|  3.35k|		q = p + bytes;
  741|       |
  742|       |		/* Try the typical case first, then go into the slow search.*/
  743|  3.35k|		if (memcmp("070707", p, 6) == 0 && is_octal(p, odc_header_size))
  ------------------
  |  |   93|    741|#define	odc_header_size 76
  ------------------
  |  Branch (743:7): [True: 741, False: 2.61k]
  |  Branch (743:38): [True: 186, False: 555]
  ------------------
  744|    186|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    186|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  745|  3.17k|		if (memcmp("070727", p, 6) == 0 && is_afio_large(p, bytes)) {
  ------------------
  |  Branch (745:7): [True: 361, False: 2.81k]
  |  Branch (745:38): [True: 0, False: 361]
  ------------------
  746|      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
  |  |  ------------------
  ------------------
  747|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  748|      0|		}
  749|       |
  750|       |		/*
  751|       |		 * Scan ahead until we find something that looks
  752|       |		 * like an odc header.
  753|       |		 */
  754|  2.04M|		while (p + header_size <= q) {
  ------------------
  |  Branch (754:10): [True: 2.04M, False: 2.65k]
  ------------------
  755|  2.04M|			switch (p[5]) {
  756|  1.04M|			case '7':
  ------------------
  |  Branch (756:4): [True: 1.04M, False: 1.00M]
  ------------------
  757|  1.04M|				if ((memcmp("070707", p, 6) == 0
  ------------------
  |  Branch (757:10): [True: 158k, False: 884k]
  ------------------
  758|   158k|				    && is_octal(p, odc_header_size))
  ------------------
  |  |   93|   158k|#define	odc_header_size 76
  ------------------
  |  Branch (758:12): [True: 498, False: 158k]
  ------------------
  759|  1.04M|				    || (memcmp("070727", p, 6) == 0
  ------------------
  |  Branch (759:13): [True: 229k, False: 813k]
  ------------------
  760|   229k|				        && is_afio_large(p, q - p))) {
  ------------------
  |  Branch (760:16): [True: 22, False: 229k]
  ------------------
  761|    520|					skip = p - (const char *)h;
  762|    520|					__archive_read_consume(a, skip);
  763|    520|					skipped += skip;
  764|    520|					if (p[4] == '2')
  ------------------
  |  Branch (764:10): [True: 22, False: 498]
  ------------------
  765|     22|						a->archive.archive_format =
  766|     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
  |  |  ------------------
  ------------------
  767|    520|					if (skipped > 0) {
  ------------------
  |  Branch (767:10): [True: 520, False: 0]
  ------------------
  768|    520|						archive_set_error(&a->archive,
  769|    520|						    0,
  770|    520|						    "Skipped %ju bytes before "
  771|    520|						    "finding valid header",
  772|    520|						    skipped);
  773|    520|						return (ARCHIVE_WARN);
  ------------------
  |  |  235|    520|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  774|    520|					}
  775|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  776|    520|				}
  777|  1.04M|				p += 2;
  778|  1.04M|				break;
  779|   421k|			case '0':
  ------------------
  |  Branch (779:4): [True: 421k, False: 1.62M]
  ------------------
  780|   421k|				p++;
  781|   421k|				break;
  782|   582k|			default:
  ------------------
  |  Branch (782:4): [True: 582k, False: 1.46M]
  ------------------
  783|   582k|				p += 6;
  784|   582k|				break;
  785|  2.04M|			}
  786|  2.04M|		}
  787|  2.65k|		skip = p - (const char *)h;
  788|  2.65k|		__archive_read_consume(a, skip);
  789|  2.65k|		skipped += skip;
  790|  2.65k|	}
  791|    751|}
archive_read_support_format_cpio.c:is_octal:
  686|   159k|{
  687|  4.91M|	while (len-- > 0) {
  ------------------
  |  Branch (687:9): [True: 4.91M, False: 684]
  ------------------
  688|  4.91M|		if (*p < '0' || *p > '7')
  ------------------
  |  Branch (688:7): [True: 157k, False: 4.75M]
  |  Branch (688:19): [True: 923, False: 4.75M]
  ------------------
  689|   158k|			return (0);
  690|  4.75M|	        ++p;
  691|  4.75M|	}
  692|    684|	return (1);
  693|   159k|}
archive_read_support_format_cpio.c:is_afio_large:
  697|   229k|{
  698|   229k|	if (len < afiol_header_size)
  ------------------
  |  |  162|   229k|#define afiol_header_size 116
  ------------------
  |  Branch (698:6): [True: 10, False: 229k]
  ------------------
  699|     10|		return (0);
  700|   229k|	if (h[afiol_ino_m_offset] != 'm'
  ------------------
  |  |  138|   229k|#define	afiol_ino_m_offset 30	/* 'm' */
  ------------------
  |  Branch (700:6): [True: 223k, False: 6.00k]
  ------------------
  701|  6.00k|	    || h[afiol_mtime_n_offset] != 'n'
  ------------------
  |  |  151|  6.00k|#define	afiol_mtime_n_offset 85	/* 'n' */
  ------------------
  |  Branch (701:9): [True: 1.38k, False: 4.62k]
  ------------------
  702|  4.62k|	    || h[afiol_xsize_s_offset] != 's'
  ------------------
  |  |  158|  4.62k|#define	afiol_xsize_s_offset 98	/* 's' */
  ------------------
  |  Branch (702:9): [True: 475, False: 4.14k]
  ------------------
  703|  4.14k|	    || h[afiol_filesize_c_offset] != ':')
  ------------------
  |  |  161|  4.14k|#define	afiol_filesize_c_offset 115	/* ':' */
  ------------------
  |  Branch (703:9): [True: 476, False: 3.67k]
  ------------------
  704|   226k|		return (0);
  705|  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 (705:6): [True: 727, False: 2.94k]
  ------------------
  706|    727|		return (0);
  707|  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 (707:6): [True: 1.03k, False: 1.91k]
  ------------------
  708|  1.03k|		return (0);
  709|  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 (709:6): [True: 912, False: 999]
  ------------------
  710|    912|		return (0);
  711|    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 (711:6): [True: 977, False: 22]
  ------------------
  712|    977|		return (0);
  713|     22|	return (1);
  714|    999|}
archive_read_support_format_cpio.c:is_hex:
  534|  19.4k|{
  535|   923k|	while (len-- > 0) {
  ------------------
  |  Branch (535:9): [True: 913k, False: 10.2k]
  ------------------
  536|   913k|		if ((*p >= '0' && *p <= '9')
  ------------------
  |  Branch (536:8): [True: 907k, False: 6.05k]
  |  Branch (536:21): [True: 552k, False: 354k]
  ------------------
  537|   360k|		    || (*p >= 'a' && *p <= 'f')
  ------------------
  |  Branch (537:11): [True: 161k, False: 198k]
  |  Branch (537:24): [True: 159k, False: 1.75k]
  ------------------
  538|   200k|		    || (*p >= 'A' && *p <= 'F'))
  ------------------
  |  Branch (538:11): [True: 194k, False: 6.23k]
  |  Branch (538:24): [True: 191k, False: 3.02k]
  ------------------
  539|   904k|			++p;
  540|  9.26k|		else
  541|  9.26k|			return (0);
  542|   913k|	}
  543|  10.2k|	return (1);
  544|  19.4k|}
archive_read_support_format_cpio.c:header_afiol:
  863|     22|{
  864|     22|	int64_t t;
  865|     22|	uint64_t u;
  866|     22|	const void *h;
  867|     22|	const char *header;
  868|       |
  869|     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
  |  |  ------------------
  ------------------
  870|     22|	a->archive.archive_format_name = "afio large ASCII";
  871|       |
  872|       |	/* Read fixed-size portion of header. */
  873|     22|	h = __archive_read_ahead(a, afiol_header_size, NULL);
  ------------------
  |  |  162|     22|#define afiol_header_size 116
  ------------------
  874|     22|	if (h == NULL)
  ------------------
  |  Branch (874:6): [True: 0, False: 22]
  ------------------
  875|      0|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  876|       |
  877|       |	/* Parse out octal fields. */
  878|     22|	header = (const char *)h;
  879|       |
  880|     22|	archive_entry_set_dev(entry, 
  881|     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 */
  ------------------
  882|     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 */
  ------------------
  883|     22|#if ARCHIVE_VERSION_NUMBER < 4000000
  884|     22|	archive_entry_set_ino(entry, (int64_t)(u & INT64_MAX));
  885|       |#else
  886|       |	archive_entry_set_ino(entry, u);
  887|       |#endif
  888|     22|	archive_entry_set_mode(entry,
  889|     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 */
  ------------------
  890|     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 */
  ------------------
  891|     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 */
  ------------------
  892|     22|	archive_entry_set_nlink(entry,
  893|     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 */
  ------------------
  894|     22|	archive_entry_set_rdev(entry,
  895|     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 */
  ------------------
  896|     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 */
  ------------------
  897|     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 */
  ------------------
  898|     22|	*name_pad = 0; /* No padding of filename. */
  899|       |
  900|     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 */
  ------------------
  901|     22|	if (t < 0) {
  ------------------
  |  Branch (901:6): [True: 6, False: 16]
  ------------------
  902|      6|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      6|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  903|      6|		    "Nonsensical file size");
  904|      6|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  905|      6|	}
  906|     16|	cpio->entry_bytes_remaining = t;
  907|     16|	archive_entry_set_size(entry, cpio->entry_bytes_remaining);
  908|     16|	cpio->entry_padding = 0;
  909|     16|	__archive_read_consume(a, afiol_header_size);
  ------------------
  |  |  162|     16|#define afiol_header_size 116
  ------------------
  910|     16|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     16|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  911|     22|}
archive_read_support_format_cpio.c:atol16:
 1061|  52.2k|{
 1062|  52.2k|	return ((int64_t)atol16u(p, char_cnt));
 1063|  52.2k|}
archive_read_support_format_cpio.c:atol16u:
 1067|  52.2k|{
 1068|  52.2k|	uint64_t l;
 1069|  52.2k|	int digit;
 1070|       |
 1071|  52.2k|	l = 0;
 1072|   470k|	while (char_cnt-- > 0) {
  ------------------
  |  Branch (1072:9): [True: 418k, False: 52.2k]
  ------------------
 1073|   418k|		if (*p >= 'a' && *p <= 'f')
  ------------------
  |  Branch (1073:7): [True: 41.3k, False: 377k]
  |  Branch (1073:20): [True: 41.3k, False: 0]
  ------------------
 1074|  41.3k|			digit = *p - 'a' + 10;
 1075|   377k|		else if (*p >= 'A' && *p <= 'F')
  ------------------
  |  Branch (1075:12): [True: 74.1k, False: 302k]
  |  Branch (1075:25): [True: 74.1k, False: 0]
  ------------------
 1076|  74.1k|			digit = *p - 'A' + 10;
 1077|   302k|		else if (*p >= '0' && *p <= '9')
  ------------------
  |  Branch (1077:12): [True: 302k, False: 0]
  |  Branch (1077:25): [True: 302k, False: 0]
  ------------------
 1078|   302k|			digit = *p - '0';
 1079|      0|		else
 1080|      0|			return (l);
 1081|   418k|		p++;
 1082|   418k|		l <<= 4;
 1083|   418k|		l |= digit;
 1084|   418k|	}
 1085|  52.2k|	return (l);
 1086|  52.2k|}
archive_read_support_format_cpio.c:atol8:
 1042|  6.86k|{
 1043|  6.86k|	uint64_t l;
 1044|  6.86k|	int digit;
 1045|       |
 1046|  6.86k|	l = 0;
 1047|  54.7k|	while (char_cnt-- > 0) {
  ------------------
  |  Branch (1047:9): [True: 47.9k, False: 6.84k]
  ------------------
 1048|  47.9k|		if (*p >= '0' && *p <= '7')
  ------------------
  |  Branch (1048:7): [True: 47.9k, False: 0]
  |  Branch (1048:20): [True: 47.9k, False: 22]
  ------------------
 1049|  47.9k|			digit = *p - '0';
 1050|     22|		else
 1051|     22|			return ((int64_t)l);
 1052|  47.9k|		p++;
 1053|  47.9k|		l <<= 3;
 1054|  47.9k|		l |= digit;
 1055|  47.9k|	}
 1056|  6.84k|	return ((int64_t)l);
 1057|  6.86k|}
archive_read_support_format_cpio.c:header_newc:
  610|  4.38k|{
  611|  4.38k|	const void *h;
  612|  4.38k|	const char *header;
  613|  4.38k|	int r;
  614|       |
  615|  4.38k|	r = find_newc_header(a);
  616|  4.38k|	if (r < ARCHIVE_WARN)
  ------------------
  |  |  235|  4.38k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (616:6): [True: 43, False: 4.33k]
  ------------------
  617|     43|		return (r);
  618|       |
  619|       |	/* Read fixed-size portion of header. */
  620|  4.33k|	h = __archive_read_ahead(a, newc_header_size, NULL);
  ------------------
  |  |  123|  4.33k|#define	newc_header_size 110
  ------------------
  621|  4.33k|	if (h == NULL)
  ------------------
  |  Branch (621:6): [True: 0, False: 4.33k]
  ------------------
  622|      0|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  623|       |
  624|       |	/* Parse out hex fields. */
  625|  4.33k|	header = (const char *)h;
  626|       |
  627|  4.33k|	if (memcmp(header + newc_magic_offset, "070701", 6) == 0) {
  ------------------
  |  |   95|  4.33k|#define	newc_magic_offset 0
  ------------------
  |  Branch (627:6): [True: 3.50k, False: 829]
  ------------------
  628|  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
  |  |  ------------------
  ------------------
  629|  3.50k|		a->archive.archive_format_name = "ASCII cpio (SVR4 with no CRC)";
  630|  3.50k|	} else if (memcmp(header + newc_magic_offset, "070702", 6) == 0) {
  ------------------
  |  |   95|    829|#define	newc_magic_offset 0
  ------------------
  |  Branch (630:13): [True: 829, False: 0]
  ------------------
  631|    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
  |  |  ------------------
  ------------------
  632|    829|		a->archive.archive_format_name = "ASCII cpio (SVR4 with CRC)";
  633|    829|	} else {
  634|       |		/* TODO: Abort here? */
  635|      0|	}
  636|       |
  637|  4.33k|	archive_entry_set_devmajor(entry,
  638|  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
  ------------------
  639|  4.33k|	archive_entry_set_devminor(entry, 
  640|  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
  ------------------
  641|  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
  ------------------
  642|  4.33k|	archive_entry_set_mode(entry, 
  643|  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
  ------------------
  644|  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
  ------------------
  645|  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
  ------------------
  646|  4.33k|	archive_entry_set_nlink(entry,
  647|  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
  ------------------
  648|  4.33k|	archive_entry_set_rdevmajor(entry,
  649|  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
  ------------------
  650|  4.33k|	archive_entry_set_rdevminor(entry,
  651|  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
  ------------------
  652|  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
  ------------------
  653|  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
  ------------------
  654|       |	/* Pad name to 2 more than a multiple of 4. */
  655|  4.33k|	*name_pad = (2 - *namelength) & 3;
  656|       |
  657|       |	/* Make sure that the padded name length fits into size_t. */
  658|  4.33k|	if (*name_pad > SIZE_MAX - *namelength) {
  ------------------
  |  Branch (658:6): [True: 0, False: 4.33k]
  ------------------
  659|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  660|      0|		    "cpio archive has invalid namelength");
  661|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  662|      0|	}
  663|       |
  664|       |	/*
  665|       |	 * Note: entry_bytes_remaining is at least 64 bits and
  666|       |	 * therefore guaranteed to be big enough for a 33-bit file
  667|       |	 * size.
  668|       |	 */
  669|  4.33k|	cpio->entry_bytes_remaining =
  670|  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
  ------------------
  671|  4.33k|	archive_entry_set_size(entry, cpio->entry_bytes_remaining);
  672|       |	/* Pad file contents to a multiple of 4. */
  673|  4.33k|	cpio->entry_padding = 3 & -cpio->entry_bytes_remaining;
  674|  4.33k|	__archive_read_consume(a, newc_header_size);
  ------------------
  |  |  123|  4.33k|#define	newc_header_size 110
  ------------------
  675|  4.33k|	return (r);
  676|  4.33k|}
archive_read_support_format_cpio.c:find_newc_header:
  548|  4.38k|{
  549|  4.38k|	const void *h;
  550|  4.38k|	const char *p, *q;
  551|  4.38k|	int64_t skip;
  552|  4.38k|	uintmax_t skipped = 0;
  553|  4.38k|	ssize_t bytes;
  554|       |
  555|  4.51k|	for (;;) {
  556|  4.51k|		h = __archive_read_ahead(a, newc_header_size, &bytes);
  ------------------
  |  |  123|  4.51k|#define	newc_header_size 110
  ------------------
  557|  4.51k|		if (h == NULL)
  ------------------
  |  Branch (557:7): [True: 43, False: 4.47k]
  ------------------
  558|     43|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     43|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  559|  4.47k|		p = h;
  560|  4.47k|		q = p + bytes;
  561|       |
  562|       |		/* Try the typical case first, then go into the slow search.*/
  563|  4.47k|		if (memcmp("07070", p, 5) == 0
  ------------------
  |  Branch (563:7): [True: 1.49k, False: 2.98k]
  ------------------
  564|  1.49k|		    && (p[5] == '1' || p[5] == '2')
  ------------------
  |  Branch (564:11): [True: 1.08k, False: 404]
  |  Branch (564:26): [True: 272, False: 132]
  ------------------
  565|  1.35k|		    && is_hex(p, newc_header_size))
  ------------------
  |  |  123|  1.35k|#define	newc_header_size 110
  ------------------
  |  Branch (565:10): [True: 783, False: 575]
  ------------------
  566|    783|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    783|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  567|       |
  568|       |		/*
  569|       |		 * Scan ahead until we find something that looks
  570|       |		 * like a newc header.
  571|       |		 */
  572|   397k|		while (p + newc_header_size <= q) {
  ------------------
  |  |  123|   397k|#define	newc_header_size 110
  ------------------
  |  Branch (572:10): [True: 397k, False: 134]
  ------------------
  573|   397k|			switch (p[5]) {
  574|  7.01k|			case '1':
  ------------------
  |  Branch (574:4): [True: 7.01k, False: 390k]
  ------------------
  575|  18.2k|			case '2':
  ------------------
  |  Branch (575:4): [True: 11.2k, False: 386k]
  ------------------
  576|  18.2k|				if (memcmp("07070", p, 5) == 0
  ------------------
  |  Branch (576:9): [True: 8.59k, False: 9.64k]
  ------------------
  577|  8.59k|				    && is_hex(p, newc_header_size)) {
  ------------------
  |  |  123|  8.59k|#define	newc_header_size 110
  ------------------
  |  Branch (577:12): [True: 3.55k, False: 5.04k]
  ------------------
  578|  3.55k|					skip = p - (const char *)h;
  579|  3.55k|					__archive_read_consume(a, skip);
  580|  3.55k|					skipped += skip;
  581|  3.55k|					if (skipped > 0) {
  ------------------
  |  Branch (581:10): [True: 3.55k, False: 0]
  ------------------
  582|  3.55k|						archive_set_error(&a->archive,
  583|  3.55k|						    0,
  584|  3.55k|						    "Skipped %ju bytes before "
  585|  3.55k|						    "finding valid header",
  586|  3.55k|						    skipped);
  587|  3.55k|						return (ARCHIVE_WARN);
  ------------------
  |  |  235|  3.55k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  588|  3.55k|					}
  589|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  590|  3.55k|				}
  591|  14.6k|				p += 2;
  592|  14.6k|				break;
  593|   207k|			case '0':
  ------------------
  |  Branch (593:4): [True: 207k, False: 190k]
  ------------------
  594|   207k|				p++;
  595|   207k|				break;
  596|   172k|			default:
  ------------------
  |  Branch (596:4): [True: 172k, False: 225k]
  ------------------
  597|   172k|				p += 6;
  598|   172k|				break;
  599|   397k|			}
  600|   397k|		}
  601|    134|		skip = p - (const char *)h;
  602|    134|		__archive_read_consume(a, skip);
  603|    134|		skipped += skip;
  604|    134|	}
  605|  4.38k|}
archive_read_support_format_cpio.c:header_bin_be:
  962|    196|{
  963|    196|	const void *h;
  964|    196|	const unsigned char *header;
  965|       |
  966|    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
  |  |  ------------------
  ------------------
  967|    196|	a->archive.archive_format_name = "cpio (big-endian binary)";
  968|       |
  969|       |	/* Read fixed-size portion of header. */
  970|    196|	h = __archive_read_ahead(a, bin_header_size, NULL);
  ------------------
  |  |   69|    196|#define	bin_header_size 26
  ------------------
  971|    196|	if (h == NULL) {
  ------------------
  |  Branch (971:6): [True: 1, False: 195]
  ------------------
  972|      1|	    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  973|      1|		"End of file trying to read next cpio header");
  974|      1|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  975|      1|	}
  976|       |
  977|       |	/* Parse out binary fields. */
  978|    195|	header = (const unsigned char *)h;
  979|       |
  980|    195|	archive_entry_set_dev(entry, archive_be16dec(header + bin_dev_offset));
  ------------------
  |  |   49|    195|#define	bin_dev_offset 2
  ------------------
  981|    195|	archive_entry_set_ino(entry, archive_be16dec(header + bin_ino_offset));
  ------------------
  |  |   51|    195|#define	bin_ino_offset 4
  ------------------
  982|    195|	archive_entry_set_mode(entry, archive_be16dec(header + bin_mode_offset));
  ------------------
  |  |   53|    195|#define	bin_mode_offset 6
  ------------------
  983|    195|	if (cpio->option_pwb) {
  ------------------
  |  Branch (983:6): [True: 0, False: 195]
  ------------------
  984|       |		/* turn off random bits left over from V6 inode */
  985|      0|		archive_entry_set_mode(entry, archive_entry_mode(entry) & 067777);
  986|      0|		if ((archive_entry_mode(entry) & AE_IFMT) == 0)
  ------------------
  |  |  215|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  |  Branch (986:7): [True: 0, False: 0]
  ------------------
  987|      0|			archive_entry_set_mode(entry, archive_entry_mode(entry) | AE_IFREG);
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  988|      0|	}
  989|    195|	archive_entry_set_uid(entry, archive_be16dec(header + bin_uid_offset));
  ------------------
  |  |   55|    195|#define	bin_uid_offset 8
  ------------------
  990|    195|	archive_entry_set_gid(entry, archive_be16dec(header + bin_gid_offset));
  ------------------
  |  |   57|    195|#define	bin_gid_offset 10
  ------------------
  991|    195|	archive_entry_set_nlink(entry, archive_be16dec(header + bin_nlink_offset));
  ------------------
  |  |   59|    195|#define	bin_nlink_offset 12
  ------------------
  992|    195|	archive_entry_set_rdev(entry, archive_be16dec(header + bin_rdev_offset));
  ------------------
  |  |   61|    195|#define	bin_rdev_offset 14
  ------------------
  993|    195|	archive_entry_set_mtime(entry, cpio_be32dec(header + bin_mtime_offset), 0);
  ------------------
  |  |   63|    195|#define	bin_mtime_offset 16
  ------------------
  994|    195|	*namelength = archive_be16dec(header + bin_namesize_offset);
  ------------------
  |  |   65|    195|#define	bin_namesize_offset 20
  ------------------
  995|    195|	*name_pad = *namelength & 1; /* Pad to even. */
  996|       |
  997|    195|	cpio->entry_bytes_remaining = cpio_be32dec(header + bin_filesize_offset);
  ------------------
  |  |   67|    195|#define	bin_filesize_offset 22
  ------------------
  998|    195|	archive_entry_set_size(entry, cpio->entry_bytes_remaining);
  999|    195|	cpio->entry_padding = cpio->entry_bytes_remaining & 1; /* Pad to even. */
 1000|    195|	    __archive_read_consume(a, bin_header_size);
  ------------------
  |  |   69|    195|#define	bin_header_size 26
  ------------------
 1001|    195|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    195|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1002|    196|}
archive_read_support_format_cpio.c:cpio_be32dec:
 1031|    390|{
 1032|    390|	return ((int64_t)archive_be16dec(p) << 16) | archive_be16dec(p + 2);
 1033|    390|}
archive_read_support_format_cpio.c:header_bin_le:
  917|    736|{
  918|    736|	const void *h;
  919|    736|	const unsigned char *header;
  920|       |
  921|    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
  |  |  ------------------
  ------------------
  922|    736|	a->archive.archive_format_name = "cpio (little-endian binary)";
  923|       |
  924|       |	/* Read fixed-size portion of header. */
  925|    736|	h = __archive_read_ahead(a, bin_header_size, NULL);
  ------------------
  |  |   69|    736|#define	bin_header_size 26
  ------------------
  926|    736|	if (h == NULL) {
  ------------------
  |  Branch (926:6): [True: 0, False: 736]
  ------------------
  927|      0|	    archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  928|      0|		"End of file trying to read next cpio header");
  929|      0|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  930|      0|	}
  931|       |
  932|       |	/* Parse out binary fields. */
  933|    736|	header = (const unsigned char *)h;
  934|       |
  935|    736|	archive_entry_set_dev(entry, archive_le16dec(header + bin_dev_offset));
  ------------------
  |  |   49|    736|#define	bin_dev_offset 2
  ------------------
  936|    736|	archive_entry_set_ino(entry, archive_le16dec(header + bin_ino_offset));
  ------------------
  |  |   51|    736|#define	bin_ino_offset 4
  ------------------
  937|    736|	archive_entry_set_mode(entry, archive_le16dec(header + bin_mode_offset));
  ------------------
  |  |   53|    736|#define	bin_mode_offset 6
  ------------------
  938|    736|	if (cpio->option_pwb) {
  ------------------
  |  Branch (938:6): [True: 0, False: 736]
  ------------------
  939|       |		/* turn off random bits left over from V6 inode */
  940|      0|		archive_entry_set_mode(entry, archive_entry_mode(entry) & 067777);
  941|      0|		if ((archive_entry_mode(entry) & AE_IFMT) == 0)
  ------------------
  |  |  215|      0|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  |  Branch (941:7): [True: 0, False: 0]
  ------------------
  942|      0|			archive_entry_set_mode(entry, archive_entry_mode(entry) | AE_IFREG);
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  943|      0|	}
  944|    736|	archive_entry_set_uid(entry, archive_le16dec(header + bin_uid_offset));
  ------------------
  |  |   55|    736|#define	bin_uid_offset 8
  ------------------
  945|    736|	archive_entry_set_gid(entry, archive_le16dec(header + bin_gid_offset));
  ------------------
  |  |   57|    736|#define	bin_gid_offset 10
  ------------------
  946|    736|	archive_entry_set_nlink(entry, archive_le16dec(header + bin_nlink_offset));
  ------------------
  |  |   59|    736|#define	bin_nlink_offset 12
  ------------------
  947|    736|	archive_entry_set_rdev(entry, archive_le16dec(header + bin_rdev_offset));
  ------------------
  |  |   61|    736|#define	bin_rdev_offset 14
  ------------------
  948|    736|	archive_entry_set_mtime(entry, cpio_le32dec(header + bin_mtime_offset), 0);
  ------------------
  |  |   63|    736|#define	bin_mtime_offset 16
  ------------------
  949|    736|	*namelength = archive_le16dec(header + bin_namesize_offset);
  ------------------
  |  |   65|    736|#define	bin_namesize_offset 20
  ------------------
  950|    736|	*name_pad = *namelength & 1; /* Pad to even. */
  951|       |
  952|    736|	cpio->entry_bytes_remaining = cpio_le32dec(header + bin_filesize_offset);
  ------------------
  |  |   67|    736|#define	bin_filesize_offset 22
  ------------------
  953|    736|	archive_entry_set_size(entry, cpio->entry_bytes_remaining);
  954|    736|	cpio->entry_padding = cpio->entry_bytes_remaining & 1; /* Pad to even. */
  955|    736|	__archive_read_consume(a, bin_header_size);
  ------------------
  |  |   69|    736|#define	bin_header_size 26
  ------------------
  956|    736|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    736|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  957|    736|}
archive_read_support_format_cpio.c:cpio_le32dec:
 1025|  1.47k|{
 1026|  1.47k|	return ((int64_t)archive_le16dec(p) << 16) | archive_le16dec(p + 2);
 1027|  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 is_trailer;
  373|  6.06k|	int r;
  374|       |
  375|  6.06k|	cpio = (struct cpio *)(a->format->data);
  376|  6.06k|	sconv = cpio->opt_sconv;
  377|  6.06k|	if (sconv == NULL) {
  ------------------
  |  Branch (377:6): [True: 6.06k, False: 0]
  ------------------
  378|  6.06k|		if (!cpio->init_default_conversion) {
  ------------------
  |  Branch (378:7): [True: 134, False: 5.93k]
  ------------------
  379|    134|			cpio->sconv_default =
  380|    134|			    archive_string_default_conversion_for_read(
  381|    134|			      &(a->archive));
  382|    134|			cpio->init_default_conversion = 1;
  383|    134|		}
  384|  6.06k|		sconv = cpio->sconv_default;
  385|  6.06k|	}
  386|       |	
  387|  6.06k|	r = (cpio->read_header(a, cpio, entry, &namelength, &name_pad));
  388|       |
  389|  6.06k|	if (r < ARCHIVE_WARN)
  ------------------
  |  |  235|  6.06k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (389:6): [True: 95, False: 5.96k]
  ------------------
  390|     95|		return (r);
  391|       |
  392|  5.96k|	if (namelength > CPIO_PATHNAME_MAX) {
  ------------------
  |  |  165|  5.96k|#define	CPIO_PATHNAME_MAX	(1024 * 1024)
  ------------------
  |  Branch (392:6): [True: 14, False: 5.95k]
  ------------------
  393|     14|		archive_set_error(&a->archive, ENOMEM,
  394|     14|		    "Rejecting malformed cpio archive: "
  395|     14|		    "pathname exceeds 1 megabyte");
  396|     14|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     14|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  397|     14|	}
  398|       |
  399|       |	/* Read name from buffer. */
  400|  5.95k|	h = __archive_read_ahead(a, namelength, NULL);
  401|  5.95k|	if (h == NULL)
  ------------------
  |  Branch (401:6): [True: 2, False: 5.95k]
  ------------------
  402|      2|	    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  403|  5.95k|	if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|  5.95k|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (403:6): [True: 0, False: 5.95k]
  ------------------
  404|  5.95k|	    (const char *)h, namelength, sconv) != 0) {
  405|      0|		if (errno == ENOMEM) {
  ------------------
  |  Branch (405:7): [True: 0, False: 0]
  ------------------
  406|      0|			archive_set_error(&a->archive, ENOMEM,
  407|      0|			    "Can't allocate memory for Pathname");
  408|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  409|      0|		}
  410|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  411|      0|		    "Pathname can't be converted from %s to current locale",
  412|      0|		    archive_string_conversion_charset_name(sconv));
  413|      0|		r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  414|      0|	}
  415|       |	/* Save this before consuming the name buffer below. */
  416|  5.95k|	is_trailer = (namelength == 11 &&
  ------------------
  |  Branch (416:16): [True: 2.51k, False: 3.44k]
  ------------------
  417|  2.51k|	    memcmp((const char *)h, "TRAILER!!!", 10) == 0);
  ------------------
  |  Branch (417:6): [True: 0, False: 2.51k]
  ------------------
  418|  5.95k|	cpio->entry_offset = 0;
  419|       |
  420|  5.95k|	__archive_read_consume(a, namelength);
  421|  5.95k|	__archive_read_consume(a, name_pad);
  422|       |
  423|       |	/* If this is a symlink, read the link contents. */
  424|  5.95k|	if (archive_entry_filetype(entry) == AE_IFLNK) {
  ------------------
  |  |  217|  5.95k|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (424:6): [True: 386, False: 5.56k]
  ------------------
  425|    386|		if (cpio->entry_bytes_remaining > 1024 * 1024) {
  ------------------
  |  Branch (425:7): [True: 0, False: 386]
  ------------------
  426|      0|			archive_set_error(&a->archive, ENOMEM,
  427|      0|			    "Rejecting malformed cpio archive: symlink contents exceed 1 megabyte");
  428|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  429|      0|		}
  430|    386|		hl = __archive_read_ahead(a,
  431|    386|			(size_t)cpio->entry_bytes_remaining, NULL);
  432|    386|		if (hl == NULL)
  ------------------
  |  Branch (432:7): [True: 0, False: 386]
  ------------------
  433|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  434|    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 (434:7): [True: 0, False: 386]
  ------------------
  435|    386|		    (size_t)cpio->entry_bytes_remaining, sconv) != 0) {
  436|      0|			if (errno == ENOMEM) {
  ------------------
  |  Branch (436:8): [True: 0, False: 0]
  ------------------
  437|      0|				archive_set_error(&a->archive, ENOMEM,
  438|      0|				    "Can't allocate memory for Linkname");
  439|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  440|      0|			}
  441|      0|			archive_set_error(&a->archive,
  442|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  443|      0|			    "Linkname can't be converted from %s to "
  444|      0|			    "current locale",
  445|      0|			    archive_string_conversion_charset_name(sconv));
  446|      0|			r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  447|      0|		}
  448|    386|		__archive_read_consume(a, cpio->entry_bytes_remaining);
  449|    386|		cpio->entry_bytes_remaining = 0;
  450|    386|	}
  451|       |
  452|       |	/* XXX TODO: If the full mode is 0160200, then this is a Solaris
  453|       |	 * ACL description for the following entry.  Read this body
  454|       |	 * and parse it as a Solaris-style ACL, then read the next
  455|       |	 * header.  XXX */
  456|       |
  457|       |	/* Compare name to "TRAILER!!!" to test for end-of-archive. */
  458|  5.95k|	if (is_trailer) {
  ------------------
  |  Branch (458:6): [True: 0, False: 5.95k]
  ------------------
  459|       |		/* TODO: Store file location of start of block. */
  460|      0|		archive_clear_error(&a->archive);
  461|      0|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  462|      0|	}
  463|       |
  464|       |	/* Detect and record hardlinks to previously-extracted entries. */
  465|  5.95k|	if (record_hardlink(a, cpio, entry) != ARCHIVE_OK) {
  ------------------
  |  |  233|  5.95k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (465:6): [True: 0, False: 5.95k]
  ------------------
  466|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  467|      0|	}
  468|       |
  469|  5.95k|	return (r);
  470|  5.95k|}
archive_read_support_format_cpio.c:record_hardlink:
 1091|  5.95k|{
 1092|  5.95k|	struct links_entry      *le;
 1093|  5.95k|	dev_t dev;
 1094|  5.95k|	int64_t ino;
 1095|       |
 1096|  5.95k|	if (archive_entry_nlink(entry) <= 1)
  ------------------
  |  Branch (1096:6): [True: 1.40k, False: 4.54k]
  ------------------
 1097|  1.40k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.40k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1098|       |
 1099|  4.54k|	dev = archive_entry_dev(entry);
 1100|  4.54k|	ino = archive_entry_ino64(entry);
 1101|       |
 1102|       |	/*
 1103|       |	 * First look in the list of multiply-linked files.  If we've
 1104|       |	 * already dumped it, convert this entry to a hard link entry.
 1105|       |	 */
 1106|  12.6k|	for (le = cpio->links_head; le; le = le->next) {
  ------------------
  |  Branch (1106:30): [True: 11.6k, False: 981]
  ------------------
 1107|  11.6k|		if (le->dev == dev && le->ino == ino) {
  ------------------
  |  Branch (1107:7): [True: 4.89k, False: 6.77k]
  |  Branch (1107:25): [True: 3.56k, False: 1.32k]
  ------------------
 1108|  3.56k|			archive_entry_copy_hardlink(entry, le->name);
 1109|       |
 1110|  3.56k|			if (--le->links <= 0) {
  ------------------
  |  Branch (1110:8): [True: 721, False: 2.84k]
  ------------------
 1111|    721|				if (le->previous != NULL)
  ------------------
  |  Branch (1111:9): [True: 71, False: 650]
  ------------------
 1112|     71|					le->previous->next = le->next;
 1113|    721|				if (le->next != NULL)
  ------------------
  |  Branch (1113:9): [True: 331, False: 390]
  ------------------
 1114|    331|					le->next->previous = le->previous;
 1115|    721|				if (cpio->links_head == le)
  ------------------
  |  Branch (1115:9): [True: 650, False: 71]
  ------------------
 1116|    650|					cpio->links_head = le->next;
 1117|    721|				free(le->name);
 1118|    721|				free(le);
 1119|    721|			}
 1120|       |
 1121|  3.56k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.56k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1122|  3.56k|		}
 1123|  11.6k|	}
 1124|       |
 1125|    981|	le = malloc(sizeof(struct links_entry));
 1126|    981|	if (le == NULL) {
  ------------------
  |  Branch (1126:6): [True: 0, False: 981]
  ------------------
 1127|      0|		archive_set_error(&a->archive,
 1128|      0|		    ENOMEM, "Out of memory adding file to list");
 1129|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1130|      0|	}
 1131|       |
 1132|    981|	const char *pathname = archive_entry_pathname(entry);
 1133|    981|	if (pathname == NULL) {
  ------------------
  |  Branch (1133:6): [True: 0, False: 981]
  ------------------
 1134|      0|		archive_set_error(&a->archive,
 1135|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1136|      0|		    "Invalid hardlink entry with no pathname");
 1137|      0|		free(le);
 1138|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1139|      0|	}
 1140|       |
 1141|    981|	le->dev = dev;
 1142|    981|	le->ino = ino;
 1143|    981|	le->links = archive_entry_nlink(entry) - 1;
 1144|    981|	le->name = strdup(pathname);
 1145|    981|	if (le->name == NULL) {
  ------------------
  |  Branch (1145:6): [True: 0, False: 981]
  ------------------
 1146|      0|		archive_set_error(&a->archive,
 1147|      0|		    ENOMEM, "Out of memory adding file to list");
 1148|      0|		free(le);
 1149|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1150|      0|	}
 1151|       |
 1152|    981|	if (cpio->links_head != NULL)
  ------------------
  |  Branch (1152:6): [True: 562, False: 419]
  ------------------
 1153|    562|		cpio->links_head->previous = le;
 1154|    981|	le->next = cpio->links_head;
 1155|    981|	le->previous = NULL;
 1156|    981|	cpio->links_head = le;
 1157|       |
 1158|    981|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    981|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1159|    981|}
archive_read_support_format_cpio.c:archive_read_format_cpio_read_data:
  475|  12.3k|{
  476|  12.3k|	ssize_t bytes_read;
  477|  12.3k|	struct cpio *cpio;
  478|       |
  479|  12.3k|	cpio = (struct cpio *)(a->format->data);
  480|       |
  481|  12.3k|	if (cpio->entry_bytes_unconsumed) {
  ------------------
  |  Branch (481:6): [True: 3.21k, False: 9.14k]
  ------------------
  482|  3.21k|		__archive_read_consume(a, cpio->entry_bytes_unconsumed);
  483|  3.21k|		cpio->entry_bytes_unconsumed = 0;
  484|  3.21k|	}
  485|       |
  486|  12.3k|	if (cpio->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (486:6): [True: 3.24k, False: 9.12k]
  ------------------
  487|  3.24k|		*buff = __archive_read_ahead(a, 1, &bytes_read);
  488|  3.24k|		if (bytes_read <= 0)
  ------------------
  |  Branch (488:7): [True: 23, False: 3.21k]
  ------------------
  489|     23|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     23|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  490|  3.21k|		if (bytes_read > cpio->entry_bytes_remaining)
  ------------------
  |  Branch (490:7): [True: 3.19k, False: 24]
  ------------------
  491|  3.19k|			bytes_read = (ssize_t)cpio->entry_bytes_remaining;
  492|  3.21k|		*size = bytes_read;
  493|  3.21k|		cpio->entry_bytes_unconsumed = bytes_read;
  494|  3.21k|		*offset = cpio->entry_offset;
  495|  3.21k|		cpio->entry_offset += bytes_read;
  496|  3.21k|		cpio->entry_bytes_remaining -= bytes_read;
  497|  3.21k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.21k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  498|  9.12k|	} else {
  499|  9.12k|		if (cpio->entry_padding !=
  ------------------
  |  Branch (499:7): [True: 0, False: 9.12k]
  ------------------
  500|  9.12k|			__archive_read_consume(a, cpio->entry_padding)) {
  501|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  502|      0|		}
  503|  9.12k|		cpio->entry_padding = 0;
  504|  9.12k|		*buff = NULL;
  505|  9.12k|		*size = 0;
  506|  9.12k|		*offset = cpio->entry_offset;
  507|  9.12k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  9.12k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  508|  9.12k|	}
  509|  12.3k|}
archive_read_support_format_cpio.c:archive_read_format_cpio_skip:
  513|  5.93k|{
  514|  5.93k|	struct cpio *cpio = (struct cpio *)(a->format->data);
  515|  5.93k|	int64_t to_skip = cpio->entry_bytes_remaining + cpio->entry_padding +
  516|  5.93k|		cpio->entry_bytes_unconsumed;
  517|       |
  518|  5.93k|	if (to_skip != __archive_read_consume(a, to_skip)) {
  ------------------
  |  Branch (518:6): [True: 0, False: 5.93k]
  ------------------
  519|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  520|      0|	}
  521|  5.93k|	cpio->entry_bytes_remaining = 0;
  522|  5.93k|	cpio->entry_padding = 0;
  523|  5.93k|	cpio->entry_bytes_unconsumed = 0;
  524|  5.93k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  5.93k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  525|  5.93k|}
archive_read_support_format_cpio.c:archive_read_format_cpio_cleanup:
 1006|  2.49k|{
 1007|  2.49k|	struct cpio *cpio;
 1008|       |
 1009|  2.49k|	cpio = (struct cpio *)(a->format->data);
 1010|       |        /* Free inode->name map */
 1011|  2.75k|        while (cpio->links_head != NULL) {
  ------------------
  |  Branch (1011:16): [True: 260, False: 2.49k]
  ------------------
 1012|    260|                struct links_entry *lp = cpio->links_head->next;
 1013|       |
 1014|    260|                free(cpio->links_head->name);
 1015|    260|                free(cpio->links_head);
 1016|    260|                cpio->links_head = lp;
 1017|    260|        }
 1018|  2.49k|	free(cpio);
 1019|  2.49k|	(a->format->data) = NULL;
 1020|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1021|  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,
  ------------------
  |  |  177|  4.99k|	do { \
  |  |  178|  4.99k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  4.99k|			(allowed_states), (function_name)); \
  |  |  180|  4.99k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  4.99k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 4.99k]
  |  |  ------------------
  |  |  181|  4.99k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  4.99k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182: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:
  459|  2.49k|{
  460|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  461|  2.49k|	struct iso9660 *iso9660;
  462|  2.49k|	int r;
  463|       |
  464|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|  2.49k|	do { \
  |  |  178|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  2.49k|			(allowed_states), (function_name)); \
  |  |  180|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  181|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  465|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_iso9660");
  466|       |
  467|  2.49k|	iso9660 = calloc(1, sizeof(*iso9660));
  468|  2.49k|	if (iso9660 == NULL) {
  ------------------
  |  Branch (468:6): [True: 0, False: 2.49k]
  ------------------
  469|      0|		archive_set_error(&a->archive, ENOMEM,
  470|      0|		    "Can't allocate iso9660 data");
  471|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  472|      0|	}
  473|  2.49k|	iso9660->magic = ISO9660_MAGIC;
  ------------------
  |  |  324|  2.49k|#define ISO9660_MAGIC   0x96609660
  ------------------
  474|  2.49k|	iso9660->cache_files.first = NULL;
  475|  2.49k|	iso9660->cache_files.last = &(iso9660->cache_files.first);
  476|  2.49k|	iso9660->re_files.first = NULL;
  477|  2.49k|	iso9660->re_files.last = &(iso9660->re_files.first);
  478|       |	/* Enable to support Joliet extensions by default.	*/
  479|  2.49k|	iso9660->opt_support_joliet = 1;
  480|       |	/* Enable to support Rock Ridge extensions by default.	*/
  481|  2.49k|	iso9660->opt_support_rockridge = 1;
  482|       |
  483|  2.49k|	r = __archive_read_register_format(a,
  484|  2.49k|	    iso9660,
  485|  2.49k|	    "iso9660",
  486|  2.49k|	    archive_read_format_iso9660_bid,
  487|  2.49k|	    archive_read_format_iso9660_options,
  488|  2.49k|	    archive_read_format_iso9660_read_header,
  489|  2.49k|	    archive_read_format_iso9660_read_data,
  490|  2.49k|	    archive_read_format_iso9660_read_data_skip,
  491|  2.49k|	    NULL,
  492|  2.49k|	    archive_read_format_iso9660_cleanup,
  493|  2.49k|	    NULL,
  494|  2.49k|	    NULL);
  495|       |
  496|  2.49k|	if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (496:6): [True: 0, False: 2.49k]
  ------------------
  497|      0|		free(iso9660);
  498|      0|		return (r);
  499|      0|	}
  500|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  501|  2.49k|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_bid:
  506|  2.45k|{
  507|  2.45k|	struct iso9660 *iso9660;
  508|  2.45k|	ssize_t bytes_read;
  509|  2.45k|	const unsigned char *p;
  510|  2.45k|	int seenTerminator;
  511|       |
  512|       |	/* If there's already a better bid than we can ever
  513|       |	   make, don't bother testing. */
  514|  2.45k|	if (best_bid > 48)
  ------------------
  |  Branch (514:6): [True: 704, False: 1.75k]
  ------------------
  515|    704|		return (-1);
  516|       |
  517|  1.75k|	iso9660 = (struct iso9660 *)(a->format->data);
  518|       |
  519|       |	/*
  520|       |	 * Skip the first 32k (reserved area) and get the first
  521|       |	 * 8 sectors of the volume descriptor table.  Of course,
  522|       |	 * if the I/O layer gives us more, we'll take it.
  523|       |	 */
  524|  1.75k|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  525|  1.75k|	p = __archive_read_ahead(a,
  526|  1.75k|	    RESERVED_AREA + 8 * LOGICAL_BLOCK_SIZE,
  ------------------
  |  |  524|  1.75k|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   83|  1.75k|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|  1.75k|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
              	    RESERVED_AREA + 8 * LOGICAL_BLOCK_SIZE,
  ------------------
  |  |   82|  1.75k|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  527|  1.75k|	    &bytes_read);
  528|  1.75k|	if (p == NULL)
  ------------------
  |  Branch (528:6): [True: 1.18k, False: 572]
  ------------------
  529|  1.18k|	    return (-1);
  530|       |
  531|       |	/* Skip the reserved area. */
  532|    572|	bytes_read -= RESERVED_AREA;
  ------------------
  |  |  524|    572|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   83|    572|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|    572|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
  533|    572|	p += RESERVED_AREA;
  ------------------
  |  |  524|    572|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   83|    572|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|    572|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
  534|       |
  535|       |	/* Check each volume descriptor. */
  536|    572|	seenTerminator = 0;
  537|    896|	for (; bytes_read > LOGICAL_BLOCK_SIZE;
  ------------------
  |  |   82|    896|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  |  Branch (537:9): [True: 896, False: 0]
  ------------------
  538|    896|	    bytes_read -= LOGICAL_BLOCK_SIZE, p += LOGICAL_BLOCK_SIZE) {
  ------------------
  |  |   82|    324|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
              	    bytes_read -= LOGICAL_BLOCK_SIZE, p += LOGICAL_BLOCK_SIZE) {
  ------------------
  |  |   82|    324|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  539|       |		/* Do not handle undefined Volume Descriptor Type. */
  540|    896|		if (p[0] >= 4 && p[0] <= 254)
  ------------------
  |  Branch (540:7): [True: 446, False: 450]
  |  Branch (540:20): [True: 235, False: 211]
  ------------------
  541|    235|			return (0);
  542|       |		/* Standard Identifier must be "CD001" */
  543|    661|		if (memcmp(p + 1, "CD001", 5) != 0)
  ------------------
  |  Branch (543:7): [True: 85, False: 576]
  ------------------
  544|     85|			return (0);
  545|    576|		if (isPVD(iso9660, p))
  ------------------
  |  Branch (545:7): [True: 214, False: 362]
  ------------------
  546|    214|			continue;
  547|    362|		if (!iso9660->joliet.location) {
  ------------------
  |  Branch (547:7): [True: 338, False: 24]
  ------------------
  548|    338|			if (isJolietSVD(iso9660, p))
  ------------------
  |  Branch (548:8): [True: 25, False: 313]
  ------------------
  549|     25|				continue;
  550|    338|		}
  551|    337|		if (isBootRecord(iso9660, p))
  ------------------
  |  Branch (551:7): [True: 7, False: 330]
  ------------------
  552|      7|			continue;
  553|    330|		if (isEVD(iso9660, p))
  ------------------
  |  Branch (553:7): [True: 0, False: 330]
  ------------------
  554|      0|			continue;
  555|    330|		if (isSVD(iso9660, p))
  ------------------
  |  Branch (555:7): [True: 78, False: 252]
  ------------------
  556|     78|			continue;
  557|    252|		if (isVolumePartition(iso9660, p))
  ------------------
  |  Branch (557:7): [True: 0, False: 252]
  ------------------
  558|      0|			continue;
  559|    252|		if (isVDSetTerminator(iso9660, p)) {
  ------------------
  |  Branch (559:7): [True: 193, False: 59]
  ------------------
  560|    193|			seenTerminator = 1;
  561|    193|			break;
  562|    193|		}
  563|     59|		return (0);
  564|    252|	}
  565|       |	/*
  566|       |	 * ISO 9660 format must have Primary Volume Descriptor and
  567|       |	 * Volume Descriptor Set Terminator.
  568|       |	 */
  569|    193|	if (seenTerminator && iso9660->primary.location > 16)
  ------------------
  |  Branch (569:6): [True: 193, False: 0]
  |  Branch (569:24): [True: 192, False: 1]
  ------------------
  570|    192|		return (48);
  571|       |
  572|       |	/* We didn't find a valid PVD; return a bid of zero. */
  573|      1|	return (0);
  574|    193|}
archive_read_support_format_iso9660.c:isPVD:
  875|    576|{
  876|    576|	const unsigned char *p;
  877|    576|	ssize_t logical_block_size;
  878|    576|	int32_t volume_block;
  879|    576|	int32_t location;
  880|    576|	int i;
  881|       |
  882|       |	/* Type of the Primary Volume Descriptor must be 1. */
  883|    576|	if (h[PVD_type_offset] != 1)
  ------------------
  |  |   86|    576|#define PVD_type_offset 0
  ------------------
  |  Branch (883:6): [True: 326, False: 250]
  ------------------
  884|    326|		return (0);
  885|       |
  886|       |	/* PVD version must be 1. */
  887|    250|	if (h[PVD_version_offset] != 1)
  ------------------
  |  |   90|    250|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   88|    250|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   86|    250|#define PVD_type_offset 0
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|    250|#define PVD_type_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   89|    250|#define PVD_id_size 5
  |  |  ------------------
  ------------------
  |  Branch (887:6): [True: 0, False: 250]
  ------------------
  888|      0|		return (0);
  889|       |
  890|       |	/* Reserved field must be 0. */
  891|    250|	if (h[PVD_reserved1_offset] != 0)
  ------------------
  |  |   92|    250|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   90|    250|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|    250|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   86|    250|#define PVD_type_offset 0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   87|    250|#define PVD_type_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|    250|#define PVD_id_size 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   91|    250|#define PVD_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (891:6): [True: 0, False: 250]
  ------------------
  892|      0|		return (0);
  893|       |
  894|       |	/* Reserved field must be 0. */
  895|    250|	if (!isNull(iso9660, h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   98|    250|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   96|    250|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|    250|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|    250|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   90|    250|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   88|    250|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    250|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    250|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   89|    250|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|    250|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|    250|#define PVD_reserved1_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    250|#define PVD_system_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   97|    250|#define PVD_volume_id_size 32
  |  |  ------------------
  ------------------
              	if (!isNull(iso9660, h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   99|    250|#define PVD_reserved2_size 8
  ------------------
  |  Branch (895:6): [True: 0, False: 250]
  ------------------
  896|      0|		return (0);
  897|       |
  898|       |	/* Volume space size must be encoded according to 7.3.3 */
  899|    250|	if (!isValid733Integer(h + PVD_volume_space_size_offset)) {
  ------------------
  |  |  100|    250|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|    250|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|    250|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|    250|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|    250|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|    250|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    250|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    250|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    250|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    250|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|    250|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|    250|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|    250|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|    250|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   99|    250|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  |  Branch (899:6): [True: 3, False: 247]
  ------------------
  900|      3|		return (0);
  901|      3|	}
  902|    247|	volume_block = archive_le32dec(h + PVD_volume_space_size_offset);
  ------------------
  |  |  100|    247|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|    247|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|    247|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|    247|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|    247|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|    247|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    247|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    247|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    247|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    247|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|    247|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|    247|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|    247|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|    247|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   99|    247|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  903|    247|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   83|    247|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (903:6): [True: 1, False: 246]
  ------------------
  904|      1|		return (0);
  905|       |
  906|       |	/* Reserved field must be 0. */
  907|    246|	if (!isNull(iso9660, h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  102|    246|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  100|    246|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|    246|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|    246|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|    246|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   92|    246|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    246|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    246|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    246|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    246|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    246|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    246|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   93|    246|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|    246|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   97|    246|#define PVD_volume_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|    246|#define PVD_reserved2_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  101|    246|#define PVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
              	if (!isNull(iso9660, h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  103|    246|#define PVD_reserved3_size 32
  ------------------
  |  Branch (907:6): [True: 2, False: 244]
  ------------------
  908|      2|		return (0);
  909|       |
  910|       |	/* Volume set size must be encoded according to 7.2.3 */
  911|    244|	if (!isValid723Integer(h + PVD_volume_set_size_offset)) {
  ------------------
  |  |  104|    244|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  ------------------
  |  |  |  |  102|    244|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|    244|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   98|    244|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|    244|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   94|    244|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    244|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    244|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    244|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    244|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    244|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    244|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    244|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    244|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   95|    244|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|    244|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   99|    244|#define PVD_reserved2_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  101|    244|#define PVD_volume_space_size_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  ------------------
  |  |  |  |  103|    244|#define PVD_reserved3_size 32
  |  |  ------------------
  ------------------
  |  Branch (911:6): [True: 2, False: 242]
  ------------------
  912|      2|		return (0);
  913|      2|	}
  914|       |
  915|       |	/* Volume sequence number must be encoded according to 7.2.3 */
  916|    242|	if (!isValid723Integer(h + PVD_volume_sequence_number_offset)) {
  ------------------
  |  |  106|    242|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  ------------------
  |  |  |  |  104|    242|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    242|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  100|    242|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|    242|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   96|    242|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    242|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    242|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    242|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    242|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    242|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    242|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    242|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    242|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    242|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    242|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   97|    242|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|    242|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  101|    242|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|    242|#define PVD_reserved3_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  ------------------
  |  |  |  |  105|    242|#define PVD_volume_set_size_size 4
  |  |  ------------------
  ------------------
  |  Branch (916:6): [True: 1, False: 241]
  ------------------
  917|      1|		return (0);
  918|      1|	}
  919|       |
  920|       |	/* Logical block size must be > 0. */
  921|       |	/* I've looked at Ecma 119 and can't find any stronger
  922|       |	 * restriction on this field. */
  923|    241|	if (!isValid723Integer(h + PVD_logical_block_size_offset)) {
  ------------------
  |  |  108|    241|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|    241|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|    241|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|    241|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|    241|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|    241|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    241|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    241|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    241|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    241|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    241|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    241|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    241|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    241|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    241|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    241|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    241|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    241|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   99|    241|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  101|    241|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    241|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    241|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  107|    241|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  |  Branch (923:6): [True: 1, False: 240]
  ------------------
  924|      1|		return (0);
  925|      1|	}
  926|    240|	logical_block_size =
  927|    240|	    archive_le16dec(h + PVD_logical_block_size_offset);
  ------------------
  |  |  108|    240|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|    240|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|    240|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|    240|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|    240|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|    240|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    240|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    240|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    240|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    240|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    240|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    240|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    240|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    240|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    240|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    240|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    240|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    240|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   99|    240|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  101|    240|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    240|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    240|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  107|    240|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  928|    240|	if (logical_block_size <= 0)
  ------------------
  |  Branch (928:6): [True: 1, False: 239]
  ------------------
  929|      1|		return (0);
  930|       |
  931|       |	/* Path Table size must be encoded according to 7.3.3 */
  932|    239|	if (!isValid733Integer(h + PVD_path_table_size_offset)) {
  ------------------
  |  |  110|    239|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  ------------------
  |  |  |  |  108|    239|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    239|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  104|    239|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|    239|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  100|    239|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    239|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    239|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    239|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    239|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    239|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    239|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    239|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    239|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    239|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    239|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    239|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    239|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    239|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    239|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  101|    239|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  103|    239|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  105|    239|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    239|#define PVD_volume_sequence_number_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  ------------------
  |  |  |  |  109|    239|#define PVD_logical_block_size_size 4
  |  |  ------------------
  ------------------
  |  Branch (932:6): [True: 3, False: 236]
  ------------------
  933|      3|		return (0);
  934|      3|	}
  935|       |
  936|       |	/* File structure version must be 1 for ISO9660/ECMA119. */
  937|    236|	if (h[PVD_file_structure_version_offset] != 1)
  ------------------
  |  |  144|    236|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  142|    236|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|    236|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  138|    236|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|    236|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  134|    236|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    236|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    236|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    236|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    236|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    236|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    236|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    236|#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_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    236|#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_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    236|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    236|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    236|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    236|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    236|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    236|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    236|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    236|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    236|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    236|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    236|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    236|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    236|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    236|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    236|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    236|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    236|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    236|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    236|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    236|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    236|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    236|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    236|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    236|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    236|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|    236|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    236|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    236|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    236|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    236|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    236|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    236|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  135|    236|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  137|    236|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|    236|#define PVD_modification_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|    236|#define PVD_expiration_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  143|    236|#define PVD_effective_date_size 17
  |  |  ------------------
  ------------------
  |  Branch (937:6): [True: 1, False: 235]
  ------------------
  938|      1|		return (0);
  939|       |
  940|       |	/* Location of Occurrence of Type L Path Table must be
  941|       |	 * available location,
  942|       |	 * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  943|    235|	location = archive_le32dec(h+PVD_type_1_path_table_offset);
  ------------------
  |  |  112|    235|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  110|    235|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|    235|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|    235|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  104|    235|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  102|    235|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    235|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    235|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    235|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    235|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    235|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    235|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    235|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    235|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    235|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    235|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    235|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    235|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    235|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    235|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    235|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    235|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  103|    235|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  105|    235|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|    235|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|    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)
  |  |  ------------------
  |  |  |  |  111|    235|#define PVD_path_table_size_size 8
  |  |  ------------------
  ------------------
  944|    235|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   83|    235|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (944:6): [True: 1, False: 234]
  |  Branch (944:40): [True: 1, False: 233]
  ------------------
  945|      2|		return (0);
  946|       |
  947|       |	/* The Type M Path Table must also be at a valid location
  948|       |	 * (although ECMA 119 requires a Type M Path Table, WinISO and
  949|       |	 * probably other programs omit it, so we permit a zero here)
  950|       |	 *
  951|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  952|    233|	location = archive_be32dec(h+PVD_type_m_path_table_offset);
  ------------------
  |  |  116|    233|#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_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  112|    233|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|    233|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  108|    233|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  106|    233|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    233|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    233|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    233|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    233|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    233|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    233|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    233|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    233|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    233|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    233|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    233|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    233|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    233|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    233|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    233|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    233|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    233|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    233|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    233|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    233|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  107|    233|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|    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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|    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)
  |  |  |  |  ------------------
  |  |  |  |  |  |  113|    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)
  |  |  ------------------
  |  |  |  |  115|    233|#define PVD_opt_type_1_path_table_size 4
  |  |  ------------------
  ------------------
  953|    233|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   83|    230|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (953:7): [True: 230, False: 3]
  |  Branch (953:23): [True: 1, False: 229]
  ------------------
  954|    232|	    || location >= volume_block)
  ------------------
  |  Branch (954:9): [True: 1, False: 231]
  ------------------
  955|      2|		return (0);
  956|       |
  957|       |	/* Reserved field must be 0. */
  958|       |	/* But accept NetBSD/FreeBSD "makefs" images with 0x20 here. */
  959|    461|	for (i = 0; i < PVD_reserved4_size; ++i)
  ------------------
  |  |  147|    461|#define PVD_reserved4_size 1
  ------------------
  |  Branch (959:14): [True: 231, False: 230]
  ------------------
  960|    231|		if (h[PVD_reserved4_offset + i] != 0
  ------------------
  |  |  146|    231|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|    231|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|    231|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|    231|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|    231|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|    231|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    231|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    231|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    231|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    231|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    231|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    231|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    231|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    231|#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_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    231|#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_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    231|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    231|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    231|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    231|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    231|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    231|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    231|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    231|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    231|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    231|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    231|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    231|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    231|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    231|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    231|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    231|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    231|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    231|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    231|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    231|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    231|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    231|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    231|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    231|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    231|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|    231|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    231|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    231|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    231|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    231|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    231|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    231|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|    231|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  137|    231|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|    231|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  141|    231|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|    231|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  145|    231|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (960:7): [True: 64, False: 167]
  ------------------
  961|     64|		    && h[PVD_reserved4_offset + i] != 0x20)
  ------------------
  |  |  146|     64|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|     64|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|     64|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|     64|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|     64|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|     64|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|     64|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|     64|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|     64|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|     64|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|     64|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|     64|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|     64|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|     64|#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_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|     64|#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_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|     64|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|     64|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|     64|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|     64|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     64|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     64|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     64|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     64|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     64|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     64|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     64|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     64|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     64|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     64|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     64|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     64|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     64|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     64|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     64|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     64|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     64|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     64|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     64|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     64|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|     64|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|     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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|     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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|     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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|     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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|     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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|     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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|     64|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|     64|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|     64|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|     64|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|     64|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|     64|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|     64|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|     64|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  137|     64|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|     64|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  141|     64|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|     64|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  145|     64|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (961:10): [True: 1, False: 63]
  ------------------
  962|      1|			return (0);
  963|       |
  964|       |	/* Reserved field must be 0. */
  965|    230|	if (!isNull(iso9660, h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  150|    230|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  148|    230|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|    230|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|    230|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  142|    230|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  140|    230|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|    230|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|    230|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    230|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    230|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    230|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    230|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    230|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    230|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    230|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    230|#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_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    230|#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_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    230|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    230|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    230|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    230|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    230|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    230|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    230|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    230|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    230|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    230|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    230|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    230|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    230|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    230|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    230|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    230|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    230|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    230|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    230|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    230|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    230|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    230|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    230|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    230|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    230|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|    230|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    230|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    230|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    230|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    230|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    230|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    230|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|    230|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|    230|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|    230|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  141|    230|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  143|    230|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  145|    230|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|    230|#define PVD_reserved4_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  149|    230|#define PVD_application_data_size 512
  |  |  ------------------
  ------------------
              	if (!isNull(iso9660, h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  151|    230|#define PVD_reserved5_size (2048 - PVD_reserved5_offset)
  |  |  ------------------
  |  |  |  |  150|    230|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  148|    230|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  146|    230|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  144|    230|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  142|    230|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  140|    230|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|    230|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|    230|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    230|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    230|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    230|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    230|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    230|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    230|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    230|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    230|#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_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    230|#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_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    230|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    230|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    230|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    230|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    230|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    230|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    230|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    230|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    230|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    230|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    230|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    230|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    230|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    230|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    230|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    230|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    230|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    230|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    230|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    230|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    230|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    230|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    230|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    230|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    230|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|    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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|    230|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    230|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    230|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    230|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    230|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    230|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    230|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|    230|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|    230|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|    230|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  141|    230|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  143|    230|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  145|    230|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|    230|#define PVD_reserved4_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  149|    230|#define PVD_application_data_size 512
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (965:6): [True: 5, False: 225]
  ------------------
  966|      5|		return (0);
  967|       |
  968|       |	/* XXX TODO: Check other values for sanity; reject more
  969|       |	 * malformed PVDs. XXX */
  970|       |
  971|       |	/* Read Root Directory Record in Volume Descriptor. */
  972|    225|	p = h + PVD_root_directory_record_offset;
  ------------------
  |  |  120|    225|#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_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|    225|#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_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  112|    225|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  110|    225|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    225|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    225|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    225|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    225|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    225|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    225|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    225|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    225|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    225|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    225|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    225|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    225|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    225|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    225|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    225|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    225|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    225|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    225|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    225|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    225|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    225|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    225|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    225|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    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)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  111|    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)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  113|    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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|    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)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|    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)
  |  |  ------------------
  |  |  |  |  119|    225|#define PVD_opt_type_m_path_table_size 4
  |  |  ------------------
  ------------------
  973|    225|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (973:6): [True: 11, False: 214]
  ------------------
  974|     11|		return (0);
  975|     11|	}
  976|       |
  977|    214|	if (!iso9660->primary.location) {
  ------------------
  |  Branch (977:6): [True: 213, False: 1]
  ------------------
  978|    213|		iso9660->logical_block_size = logical_block_size;
  979|    213|		iso9660->volume_block = volume_block;
  980|    213|		iso9660->volume_size =
  981|    213|		    logical_block_size * (uint64_t)volume_block;
  982|    213|		iso9660->primary.location =
  983|    213|		    archive_le32dec(p + DR_extent_offset);
  ------------------
  |  |  200|    213|#define DR_extent_offset 2
  ------------------
  984|    213|		iso9660->primary.size = archive_le32dec(p + DR_size_offset);
  ------------------
  |  |  202|    213|#define DR_size_offset 10
  ------------------
  985|    213|	}
  986|       |
  987|    214|	return (48);
  988|    225|}
archive_read_support_format_iso9660.c:isNull:
  609|  1.54k|{
  610|       |
  611|  1.54k|	while (bytes >= sizeof(iso9660->null)) {
  ------------------
  |  Branch (611:9): [True: 0, False: 1.54k]
  ------------------
  612|      0|		if (!memcmp(iso9660->null, h + offset, sizeof(iso9660->null)))
  ------------------
  |  Branch (612:7): [True: 0, False: 0]
  ------------------
  613|      0|			return (0);
  614|      0|		offset += sizeof(iso9660->null);
  615|      0|		bytes -= sizeof(iso9660->null);
  616|      0|	}
  617|  1.54k|	if (bytes)
  ------------------
  |  Branch (617:6): [True: 1.54k, False: 0]
  ------------------
  618|  1.54k|		return memcmp(iso9660->null, h + offset, bytes) == 0;
  619|      0|	else
  620|      0|		return (1);
  621|  1.54k|}
archive_read_support_format_iso9660.c:isValid733Integer:
 3269|  1.31k|{
 3270|  1.31k|	return (p[0] == p[7]
  ------------------
  |  Branch (3270:10): [True: 1.31k, False: 8]
  ------------------
 3271|  1.31k|		&& p[1] == p[6]
  ------------------
  |  Branch (3271:6): [True: 1.30k, False: 6]
  ------------------
 3272|  1.30k|		&& p[2] == p[5]
  ------------------
  |  Branch (3272:6): [True: 1.29k, False: 6]
  ------------------
 3273|  1.29k|		&& p[3] == p[4]);
  ------------------
  |  Branch (3273:6): [True: 1.29k, False: 4]
  ------------------
 3274|  1.31k|}
archive_read_support_format_iso9660.c:isValid723Integer:
 3263|  1.12k|isValid723Integer(const unsigned char *p) {
 3264|  1.12k|	return (p[0] == p[3] && p[1] == p[2]);
  ------------------
  |  Branch (3264:10): [True: 1.12k, False: 4]
  |  Branch (3264:26): [True: 1.12k, False: 2]
  ------------------
 3265|  1.12k|}
archive_read_support_format_iso9660.c:isRootDirectoryRecord:
  991|    419|isRootDirectoryRecord(const unsigned char *p) {
  992|    419|	int flags;
  993|       |
  994|       |	/* ECMA119/ISO9660 requires that the root directory record be _exactly_ 34 bytes.
  995|       |	 * However, we've seen images that have root directory records up to 68 bytes. */
  996|    419|	if (p[DR_length_offset] < 34 || p[DR_length_offset] > 68) {
  ------------------
  |  |  196|    419|#define DR_length_offset 0
  ------------------
              	if (p[DR_length_offset] < 34 || p[DR_length_offset] > 68) {
  ------------------
  |  |  196|    418|#define DR_length_offset 0
  ------------------
  |  Branch (996:6): [True: 1, False: 418]
  |  Branch (996:34): [True: 0, False: 418]
  ------------------
  997|      1|		return (0);
  998|      1|	}
  999|       |
 1000|       |	/* The root directory location must be a 7.3.3 32-bit integer. */
 1001|    418|	if (!isValid733Integer(p + DR_extent_offset)) {
  ------------------
  |  |  200|    418|#define DR_extent_offset 2
  ------------------
  |  Branch (1001:6): [True: 7, False: 411]
  ------------------
 1002|      7|		return (0);
 1003|      7|	}
 1004|       |
 1005|       |	/* The root directory size must be a 7.3.3 integer. */
 1006|    411|	if (!isValid733Integer(p + DR_size_offset)) {
  ------------------
  |  |  202|    411|#define DR_size_offset 10
  ------------------
  |  Branch (1006:6): [True: 11, False: 400]
  ------------------
 1007|     11|		return (0);
 1008|     11|	}
 1009|       |
 1010|       |	/* According to the standard, certain bits must be one or zero:
 1011|       |	 * Bit 1: must be 1 (this is a directory)
 1012|       |	 * Bit 2: must be 0 (not an associated file)
 1013|       |	 * Bit 3: must be 0 (doesn't use extended attribute record)
 1014|       |	 * Bit 7: must be 0 (final directory record for this file)
 1015|       |	 */
 1016|    400|	flags = p[DR_flags_offset];
  ------------------
  |  |  206|    400|#define DR_flags_offset 25
  ------------------
 1017|    400|	if ((flags & 0x8E) != 0x02) {
  ------------------
  |  Branch (1017:6): [True: 0, False: 400]
  ------------------
 1018|      0|		return (0);
 1019|      0|	}
 1020|       |
 1021|       |	/* Volume sequence number must be a 7.2.3 integer. */
 1022|    400|	if (!isValid723Integer(p + DR_volume_sequence_number_offset)) {
  ------------------
  |  |  212|    400|#define DR_volume_sequence_number_offset 28
  ------------------
  |  Branch (1022:6): [True: 2, False: 398]
  ------------------
 1023|      2|		return (0);
 1024|      2|	}
 1025|       |
 1026|       |	/* Root directory name is a single zero byte... */
 1027|    398|	if (p[DR_name_len_offset] != 1 || p[DR_name_offset] != 0) {
  ------------------
  |  |  214|    398|#define DR_name_len_offset 32
  ------------------
              	if (p[DR_name_len_offset] != 1 || p[DR_name_offset] != 0) {
  ------------------
  |  |  216|    398|#define DR_name_offset 33
  ------------------
  |  Branch (1027:6): [True: 0, False: 398]
  |  Branch (1027:36): [True: 3, False: 395]
  ------------------
 1028|      3|		return (0);
 1029|      3|	}
 1030|       |
 1031|       |	/* Nothing looked wrong, so let's accept it. */
 1032|    395|	return (1);
 1033|    398|}
archive_read_support_format_iso9660.c:isJolietSVD:
  687|    338|{
  688|    338|	const unsigned char *p;
  689|    338|	ssize_t logical_block_size;
  690|    338|	int32_t volume_block;
  691|       |
  692|       |	/* Check if current sector is a kind of Supplementary Volume
  693|       |	 * Descriptor. */
  694|    338|	if (!isSVD(iso9660, h))
  ------------------
  |  Branch (694:6): [True: 235, False: 103]
  ------------------
  695|    235|		return (0);
  696|       |
  697|       |	/* FIXME: do more validations according to joliet spec. */
  698|       |
  699|       |	/* check if this SVD contains joliet extension! */
  700|    103|	p = h + SVD_escape_sequences_offset;
  ------------------
  |  |  173|    103|#define SVD_escape_sequences_offset (SVD_volume_space_size_offset + SVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  171|    103|#define SVD_volume_space_size_offset 80
  |  |  ------------------
  |  |               #define SVD_escape_sequences_offset (SVD_volume_space_size_offset + SVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  172|    103|#define SVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
  701|       |	/* N.B. Joliet spec says p[1] == '\\', but.... */
  702|    103|	if (p[0] == '%' && p[1] == '/') {
  ------------------
  |  Branch (702:6): [True: 96, False: 7]
  |  Branch (702:21): [True: 41, False: 55]
  ------------------
  703|     41|		int level = 0;
  704|       |
  705|     41|		if (p[2] == '@')
  ------------------
  |  Branch (705:7): [True: 8, False: 33]
  ------------------
  706|      8|			level = 1;
  707|     33|		else if (p[2] == 'C')
  ------------------
  |  Branch (707:12): [True: 0, False: 33]
  ------------------
  708|      0|			level = 2;
  709|     33|		else if (p[2] == 'E')
  ------------------
  |  Branch (709:12): [True: 17, False: 16]
  ------------------
  710|     17|			level = 3;
  711|     16|		else /* not joliet */
  712|     16|			return (0);
  713|       |
  714|     25|		iso9660->seenJoliet = level;
  715|       |
  716|     25|	} else /* not joliet */
  717|     62|		return (0);
  718|       |
  719|     25|	logical_block_size =
  720|     25|	    archive_le16dec(h + SVD_logical_block_size_offset);
  ------------------
  |  |  176|     25|#define SVD_logical_block_size_offset 128
  ------------------
  721|     25|	volume_block = archive_le32dec(h + SVD_volume_space_size_offset);
  ------------------
  |  |  171|     25|#define SVD_volume_space_size_offset 80
  ------------------
  722|       |
  723|     25|	iso9660->logical_block_size = logical_block_size;
  724|     25|	iso9660->volume_block = volume_block;
  725|     25|	iso9660->volume_size = logical_block_size * (uint64_t)volume_block;
  726|       |	/* Read Root Directory Record in Volume Descriptor. */
  727|     25|	p = h + SVD_root_directory_record_offset;
  ------------------
  |  |  181|     25|#define SVD_root_directory_record_offset 156
  ------------------
  728|     25|	iso9660->joliet.location = archive_le32dec(p + DR_extent_offset);
  ------------------
  |  |  200|     25|#define DR_extent_offset 2
  ------------------
  729|     25|	iso9660->joliet.size = archive_le32dec(p + DR_size_offset);
  ------------------
  |  |  202|     25|#define DR_size_offset 10
  ------------------
  730|       |
  731|     25|	return (48);
  732|    103|}
archive_read_support_format_iso9660.c:isBootRecord:
  625|    337|{
  626|    337|	(void)iso9660; /* UNUSED */
  627|       |
  628|       |	/* Type of the Volume Descriptor Boot Record must be 0. */
  629|    337|	if (h[0] != 0)
  ------------------
  |  Branch (629:6): [True: 330, False: 7]
  ------------------
  630|    330|		return (0);
  631|       |
  632|       |	/* Volume Descriptor Version must be 1. */
  633|      7|	if (h[6] != 1)
  ------------------
  |  Branch (633:6): [True: 0, False: 7]
  ------------------
  634|      0|		return (0);
  635|       |
  636|      7|	return (1);
  637|      7|}
archive_read_support_format_iso9660.c:isEVD:
  796|    330|{
  797|    330|	const unsigned char *p;
  798|    330|	ssize_t logical_block_size;
  799|    330|	int32_t volume_block;
  800|    330|	int32_t location;
  801|       |
  802|    330|	(void)iso9660; /* UNUSED */
  803|       |
  804|       |	/* Type of the Enhanced Volume Descriptor must be 2. */
  805|    330|	if (h[PVD_type_offset] != 2)
  ------------------
  |  |   86|    330|#define PVD_type_offset 0
  ------------------
  |  Branch (805:6): [True: 234, False: 96]
  ------------------
  806|    234|		return (0);
  807|       |
  808|       |	/* EVD version must be 2. */
  809|     96|	if (h[PVD_version_offset] != 2)
  ------------------
  |  |   90|     96|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   88|     96|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   86|     96|#define PVD_type_offset 0
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|     96|#define PVD_type_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   89|     96|#define PVD_id_size 5
  |  |  ------------------
  ------------------
  |  Branch (809:6): [True: 96, False: 0]
  ------------------
  810|     96|		return (0);
  811|       |
  812|       |	/* Reserved field must be 0. */
  813|      0|	if (h[PVD_reserved1_offset] != 0)
  ------------------
  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (813:6): [True: 0, False: 0]
  ------------------
  814|      0|		return (0);
  815|       |
  816|       |	/* Reserved field must be 0. */
  817|      0|	if (!isNull(iso9660, h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  ------------------
  ------------------
              	if (!isNull(iso9660, h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   99|      0|#define PVD_reserved2_size 8
  ------------------
  |  Branch (817:6): [True: 0, False: 0]
  ------------------
  818|      0|		return (0);
  819|       |
  820|       |	/* Reserved field must be 0. */
  821|      0|	if (!isNull(iso9660, h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
              	if (!isNull(iso9660, h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  103|      0|#define PVD_reserved3_size 32
  ------------------
  |  Branch (821:6): [True: 0, False: 0]
  ------------------
  822|      0|		return (0);
  823|       |
  824|       |	/* Logical block size must be > 0. */
  825|       |	/* I've looked at Ecma 119 and can't find any stronger
  826|       |	 * restriction on this field. */
  827|      0|	logical_block_size =
  828|      0|	    archive_le16dec(h + PVD_logical_block_size_offset);
  ------------------
  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  829|      0|	if (logical_block_size <= 0)
  ------------------
  |  Branch (829:6): [True: 0, False: 0]
  ------------------
  830|      0|		return (0);
  831|       |
  832|      0|	volume_block =
  833|      0|	    archive_le32dec(h + PVD_volume_space_size_offset);
  ------------------
  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  834|      0|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   83|      0|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (834:6): [True: 0, False: 0]
  ------------------
  835|      0|		return (0);
  836|       |
  837|       |	/* File structure version must be 2 for ISO9660:1999. */
  838|      0|	if (h[PVD_file_structure_version_offset] != 2)
  ------------------
  |  |  144|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  142|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#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_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      0|#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_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  137|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|      0|#define PVD_expiration_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  143|      0|#define PVD_effective_date_size 17
  |  |  ------------------
  ------------------
  |  Branch (838:6): [True: 0, False: 0]
  ------------------
  839|      0|		return (0);
  840|       |
  841|       |	/* Location of Occurrence of Type L Path Table must be
  842|       |	 * available location,
  843|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  844|      0|	location = archive_le32dec(h+PVD_type_1_path_table_offset);
  ------------------
  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|      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)
  |  |  ------------------
  |  |  |  |  111|      0|#define PVD_path_table_size_size 8
  |  |  ------------------
  ------------------
  845|      0|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   83|      0|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (845:6): [True: 0, False: 0]
  |  Branch (845:40): [True: 0, False: 0]
  ------------------
  846|      0|		return (0);
  847|       |
  848|       |	/* Location of Occurrence of Type M Path Table must be
  849|       |	 * available location,
  850|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  851|      0|	location = archive_be32dec(h+PVD_type_m_path_table_offset);
  ------------------
  |  |  116|      0|#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_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  111|      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)
  |  |  |  |  ------------------
  |  |  |  |  |  |  113|      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)
  |  |  ------------------
  |  |  |  |  115|      0|#define PVD_opt_type_1_path_table_size 4
  |  |  ------------------
  ------------------
  852|      0|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   83|      0|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (852:7): [True: 0, False: 0]
  |  Branch (852:23): [True: 0, False: 0]
  ------------------
  853|      0|	    || location >= volume_block)
  ------------------
  |  Branch (853:9): [True: 0, False: 0]
  ------------------
  854|      0|		return (0);
  855|       |
  856|       |	/* Reserved field must be 0. */
  857|      0|	if (!isNull(iso9660, h, PVD_reserved4_offset, PVD_reserved4_size))
  ------------------
  |  |  146|      0|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#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_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      0|#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_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  137|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  141|      0|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|      0|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  145|      0|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
              	if (!isNull(iso9660, h, PVD_reserved4_offset, PVD_reserved4_size))
  ------------------
  |  |  147|      0|#define PVD_reserved4_size 1
  ------------------
  |  Branch (857:6): [True: 0, False: 0]
  ------------------
  858|      0|		return (0);
  859|       |
  860|       |	/* Reserved field must be 0. */
  861|      0|	if (!isNull(iso9660, h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  150|      0|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  148|      0|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|      0|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  142|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#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_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      0|#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_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  141|      0|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  143|      0|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  145|      0|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|      0|#define PVD_reserved4_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  149|      0|#define PVD_application_data_size 512
  |  |  ------------------
  ------------------
              	if (!isNull(iso9660, h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  151|      0|#define PVD_reserved5_size (2048 - PVD_reserved5_offset)
  |  |  ------------------
  |  |  |  |  150|      0|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  148|      0|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  146|      0|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  144|      0|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  142|      0|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  140|      0|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|      0|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|      0|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|      0|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|      0|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|      0|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|      0|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|      0|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|      0|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|      0|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|      0|#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_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|      0|#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_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  111|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  113|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  115|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  117|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  119|      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)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  121|      0|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|      0|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|      0|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|      0|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|      0|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|      0|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|      0|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|      0|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|      0|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|      0|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  141|      0|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  143|      0|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  145|      0|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|      0|#define PVD_reserved4_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  149|      0|#define PVD_application_data_size 512
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (861:6): [True: 0, False: 0]
  ------------------
  862|      0|		return (0);
  863|       |
  864|       |	/* Read Root Directory Record in Volume Descriptor. */
  865|      0|	p = h + PVD_root_directory_record_offset;
  ------------------
  |  |  120|      0|#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_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|      0|#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_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  112|      0|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  110|      0|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      0|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      0|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      0|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      0|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      0|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      0|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      0|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      0|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      0|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      0|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      0|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      0|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      0|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      0|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      0|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      0|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      0|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      0|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      0|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      0|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      0|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      0|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      0|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      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)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  111|      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)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  113|      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)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  115|      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)
  |  |  |  |  ------------------
  |  |  |  |  |  |  117|      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)
  |  |  ------------------
  |  |  |  |  119|      0|#define PVD_opt_type_m_path_table_size 4
  |  |  ------------------
  ------------------
  866|      0|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (866:6): [True: 0, False: 0]
  ------------------
  867|      0|		return (0);
  868|      0|	}
  869|       |
  870|      0|	return (48);
  871|      0|}
archive_read_support_format_iso9660.c:isSVD:
  736|    668|{
  737|    668|	const unsigned char *p;
  738|    668|	ssize_t logical_block_size;
  739|    668|	int32_t volume_block;
  740|    668|	int32_t location;
  741|       |
  742|    668|	(void)iso9660; /* UNUSED */
  743|       |
  744|       |	/* Type 2 means it's a SVD. */
  745|    668|	if (h[SVD_type_offset] != 2)
  ------------------
  |  |  162|    668|#define SVD_type_offset 0
  ------------------
  |  Branch (745:6): [True: 461, False: 207]
  ------------------
  746|    461|		return (0);
  747|       |
  748|       |	/* Reserved field must be 0. */
  749|    207|	if (!isNull(iso9660, h, SVD_reserved1_offset, SVD_reserved1_size))
  ------------------
  |  |  169|    207|#define SVD_reserved1_offset	72
  ------------------
              	if (!isNull(iso9660, h, SVD_reserved1_offset, SVD_reserved1_size))
  ------------------
  |  |  170|    207|#define SVD_reserved1_size	8
  ------------------
  |  Branch (749:6): [True: 1, False: 206]
  ------------------
  750|      1|		return (0);
  751|    206|	if (!isNull(iso9660, h, SVD_reserved2_offset, SVD_reserved2_size))
  ------------------
  |  |  184|    206|#define SVD_reserved2_offset	882
  ------------------
              	if (!isNull(iso9660, h, SVD_reserved2_offset, SVD_reserved2_size))
  ------------------
  |  |  185|    206|#define SVD_reserved2_size	1
  ------------------
  |  Branch (751:6): [True: 1, False: 205]
  ------------------
  752|      1|		return (0);
  753|    205|	if (!isNull(iso9660, h, SVD_reserved3_offset, SVD_reserved3_size))
  ------------------
  |  |  186|    205|#define SVD_reserved3_offset	1395
  ------------------
              	if (!isNull(iso9660, h, SVD_reserved3_offset, SVD_reserved3_size))
  ------------------
  |  |  187|    205|#define SVD_reserved3_size	653
  ------------------
  |  Branch (753:6): [True: 5, False: 200]
  ------------------
  754|      5|		return (0);
  755|       |
  756|       |	/* File structure version must be 1 for ISO9660/ECMA119. */
  757|    200|	if (h[SVD_file_structure_version_offset] != 1)
  ------------------
  |  |  183|    200|#define SVD_file_structure_version_offset 881
  ------------------
  |  Branch (757:6): [True: 1, False: 199]
  ------------------
  758|      1|		return (0);
  759|       |
  760|    199|	logical_block_size =
  761|    199|	    archive_le16dec(h + SVD_logical_block_size_offset);
  ------------------
  |  |  176|    199|#define SVD_logical_block_size_offset 128
  ------------------
  762|    199|	if (logical_block_size <= 0)
  ------------------
  |  Branch (762:6): [True: 1, False: 198]
  ------------------
  763|      1|		return (0);
  764|       |
  765|    198|	volume_block = archive_le32dec(h + SVD_volume_space_size_offset);
  ------------------
  |  |  171|    198|#define SVD_volume_space_size_offset 80
  ------------------
  766|    198|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   83|    198|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (766:6): [True: 1, False: 197]
  ------------------
  767|      1|		return (0);
  768|       |
  769|       |	/* Location of Occurrence of Type L Path Table must be
  770|       |	 * available location,
  771|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  772|    197|	location = archive_le32dec(h+SVD_type_L_path_table_offset);
  ------------------
  |  |  178|    197|#define SVD_type_L_path_table_offset 140
  ------------------
  773|    197|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   83|    197|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (773:6): [True: 1, False: 196]
  |  Branch (773:40): [True: 1, False: 195]
  ------------------
  774|      2|		return (0);
  775|       |
  776|       |	/* The Type M Path Table must be at a valid location (WinISO
  777|       |	 * and probably other programs omit this, so we allow zero)
  778|       |	 *
  779|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  780|    195|	location = archive_be32dec(h+SVD_type_M_path_table_offset);
  ------------------
  |  |  179|    195|#define SVD_type_M_path_table_offset 148
  ------------------
  781|    195|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   83|    195|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (781:7): [True: 195, False: 0]
  |  Branch (781:23): [True: 0, False: 195]
  ------------------
  782|    195|	    || location >= volume_block)
  ------------------
  |  Branch (782:9): [True: 1, False: 194]
  ------------------
  783|      1|		return (0);
  784|       |
  785|       |	/* Read Root Directory Record in Volume Descriptor. */
  786|    194|	p = h + SVD_root_directory_record_offset;
  ------------------
  |  |  181|    194|#define SVD_root_directory_record_offset 156
  ------------------
  787|    194|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (787:6): [True: 13, False: 181]
  ------------------
  788|     13|		return (0);
  789|     13|	}
  790|       |
  791|    181|	return (48);
  792|    194|}
archive_read_support_format_iso9660.c:isVolumePartition:
  641|    252|{
  642|    252|	int32_t location;
  643|       |
  644|       |	/* Type of the Volume Partition Descriptor must be 3. */
  645|    252|	if (h[0] != 3)
  ------------------
  |  Branch (645:6): [True: 252, False: 0]
  ------------------
  646|    252|		return (0);
  647|       |
  648|       |	/* Volume Descriptor Version must be 1. */
  649|      0|	if (h[6] != 1)
  ------------------
  |  Branch (649:6): [True: 0, False: 0]
  ------------------
  650|      0|		return (0);
  651|       |	/* Unused Field */
  652|      0|	if (h[7] != 0)
  ------------------
  |  Branch (652:6): [True: 0, False: 0]
  ------------------
  653|      0|		return (0);
  654|       |
  655|      0|	location = archive_le32dec(h + 72);
  656|      0|	if (location <= SYSTEM_AREA_BLOCK ||
  ------------------
  |  |   83|      0|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (656:6): [True: 0, False: 0]
  ------------------
  657|      0|	    location >= iso9660->volume_block)
  ------------------
  |  Branch (657:6): [True: 0, False: 0]
  ------------------
  658|      0|		return (0);
  659|      0|	if ((uint32_t)location != archive_be32dec(h + 76))
  ------------------
  |  Branch (659:6): [True: 0, False: 0]
  ------------------
  660|      0|		return (0);
  661|       |
  662|      0|	return (1);
  663|      0|}
archive_read_support_format_iso9660.c:isVDSetTerminator:
  667|    252|{
  668|    252|	(void)iso9660; /* UNUSED */
  669|       |
  670|       |	/* Type of the Volume Descriptor Set Terminator must be 255. */
  671|    252|	if (h[0] != 255)
  ------------------
  |  Branch (671:6): [True: 54, False: 198]
  ------------------
  672|     54|		return (0);
  673|       |
  674|       |	/* Volume Descriptor Version must be 1. */
  675|    198|	if (h[6] != 1)
  ------------------
  |  Branch (675:6): [True: 1, False: 197]
  ------------------
  676|      1|		return (0);
  677|       |
  678|       |	/* Reserved field must be 0. */
  679|    197|	if (!isNull(iso9660, h, 7, 2048-7))
  ------------------
  |  Branch (679:6): [True: 4, False: 193]
  ------------------
  680|      4|		return (0);
  681|       |
  682|    193|	return (1);
  683|    197|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_header:
 1250|    872|{
 1251|    872|	struct iso9660 *iso9660;
 1252|    872|	struct file_info *file;
 1253|    872|	int r, rd_r = ARCHIVE_OK;
  ------------------
  |  |  233|    872|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1254|       |
 1255|    872|	iso9660 = (struct iso9660 *)(a->format->data);
 1256|       |
 1257|    872|	if (!a->archive.archive_format) {
  ------------------
  |  Branch (1257:6): [True: 192, False: 680]
  ------------------
 1258|    192|		a->archive.archive_format = ARCHIVE_FORMAT_ISO9660;
  ------------------
  |  |  372|    192|#define	ARCHIVE_FORMAT_ISO9660			0x40000
  ------------------
 1259|    192|		a->archive.archive_format_name = "ISO9660";
 1260|    192|	}
 1261|       |
 1262|    872|	if (iso9660->current_position == 0) {
  ------------------
  |  Branch (1262:6): [True: 192, False: 680]
  ------------------
 1263|    192|		r = choose_volume(a, iso9660);
 1264|    192|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    192|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1264:7): [True: 19, False: 173]
  ------------------
 1265|     19|			return (r);
 1266|    192|	}
 1267|       |
 1268|    853|	file = NULL;/* Eliminate a warning. */
 1269|       |	/* Get the next entry that appears after the current offset. */
 1270|    853|	r = next_entry_seek(a, iso9660, &file);
 1271|    853|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    853|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1271:6): [True: 231, False: 622]
  ------------------
 1272|    231|		return (r);
 1273|       |
 1274|    622|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1274:6): [True: 12, False: 610]
  ------------------
 1275|       |		/*
 1276|       |		 * Convert UTF-16BE of a filename to local locale MBS
 1277|       |		 * and store the result into a filename field.
 1278|       |		 */
 1279|     12|		if (iso9660->sconv_utf16be == NULL) {
  ------------------
  |  Branch (1279:7): [True: 6, False: 6]
  ------------------
 1280|      6|			iso9660->sconv_utf16be =
 1281|      6|			    archive_string_conversion_from_charset(
 1282|      6|				&(a->archive), "UTF-16BE", 1);
 1283|      6|			if (iso9660->sconv_utf16be == NULL)
  ------------------
  |  Branch (1283:8): [True: 0, False: 6]
  ------------------
 1284|       |				/* Couldn't allocate memory */
 1285|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1286|      6|		}
 1287|     12|		if (iso9660->utf16be_path == NULL) {
  ------------------
  |  Branch (1287:7): [True: 6, False: 6]
  ------------------
 1288|      6|			iso9660->utf16be_path = malloc(UTF16_NAME_MAX);
  ------------------
  |  |  378|      6|#define UTF16_NAME_MAX	1024
  ------------------
 1289|      6|			if (iso9660->utf16be_path == NULL) {
  ------------------
  |  Branch (1289:8): [True: 0, False: 6]
  ------------------
 1290|      0|				archive_set_error(&a->archive, ENOMEM,
 1291|      0|				    "No memory");
 1292|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1293|      0|			}
 1294|      6|		}
 1295|     12|		if (iso9660->utf16be_previous_path == NULL) {
  ------------------
  |  Branch (1295:7): [True: 6, False: 6]
  ------------------
 1296|      6|			iso9660->utf16be_previous_path = calloc(1, UTF16_NAME_MAX);
  ------------------
  |  |  378|      6|#define UTF16_NAME_MAX	1024
  ------------------
 1297|      6|			if (iso9660->utf16be_previous_path == NULL) {
  ------------------
  |  Branch (1297:8): [True: 0, False: 6]
  ------------------
 1298|      0|				archive_set_error(&a->archive, ENOMEM,
 1299|      0|				    "No memory");
 1300|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1301|      0|			}
 1302|      6|		}
 1303|       |
 1304|     12|		iso9660->utf16be_path_len = 0;
 1305|     12|		if (build_pathname_utf16be(iso9660->utf16be_path,
  ------------------
  |  Branch (1305:7): [True: 0, False: 12]
  ------------------
 1306|     12|		    UTF16_NAME_MAX, &(iso9660->utf16be_path_len), file) != 0) {
  ------------------
  |  |  378|     12|#define UTF16_NAME_MAX	1024
  ------------------
 1307|      0|			archive_set_error(&a->archive,
 1308|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1309|      0|			    "Pathname is too long");
 1310|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1311|      0|		}
 1312|       |
 1313|     12|		r = archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|     12|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
 1314|     12|		    (const char *)iso9660->utf16be_path,
 1315|     12|		    iso9660->utf16be_path_len,
 1316|     12|		    iso9660->sconv_utf16be);
 1317|     12|		if (r != 0) {
  ------------------
  |  Branch (1317:7): [True: 4, False: 8]
  ------------------
 1318|      4|			if (errno == ENOMEM) {
  ------------------
  |  Branch (1318:8): [True: 0, False: 4]
  ------------------
 1319|      0|				archive_set_error(&a->archive, ENOMEM,
 1320|      0|				    "No memory for Pathname");
 1321|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1322|      0|			}
 1323|      4|			archive_set_error(&a->archive,
 1324|      4|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1325|      4|			    "Pathname cannot be converted "
 1326|      4|			    "from %s to current locale",
 1327|      4|			    archive_string_conversion_charset_name(
 1328|      4|			      iso9660->sconv_utf16be));
 1329|       |
 1330|      4|			rd_r = ARCHIVE_WARN;
  ------------------
  |  |  235|      4|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1331|      4|		}
 1332|    610|	} else {
 1333|    610|		const char *path = build_pathname(&iso9660->pathname, file, 0);
 1334|    610|		if (path == NULL) {
  ------------------
  |  Branch (1334:7): [True: 0, False: 610]
  ------------------
 1335|      0|			archive_set_error(&a->archive,
 1336|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1337|      0|			    "Pathname is too long");
 1338|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1339|    610|		} else {
 1340|    610|			archive_string_empty(&iso9660->pathname);
  ------------------
  |  |  181|    610|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1341|    610|			archive_entry_set_pathname(entry, path);
 1342|    610|		}
 1343|    610|	}
 1344|       |
 1345|    622|	iso9660->entry_bytes_remaining = file->size;
 1346|       |	/* Offset for sparse-file-aware clients. */
 1347|    622|	iso9660->entry_sparse_offset = 0;
 1348|       |
 1349|    622|	if (file->offset + file->size > iso9660->volume_size) {
  ------------------
  |  Branch (1349:6): [True: 105, False: 517]
  ------------------
 1350|    105|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    105|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1351|    105|		    "File is beyond end-of-media: %s",
 1352|    105|		    archive_entry_pathname(entry));
 1353|    105|		iso9660->entry_bytes_remaining = 0;
 1354|    105|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|    105|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1355|    105|	}
 1356|       |
 1357|       |	/* Set up the entry structure with information about this entry. */
 1358|    517|	archive_entry_set_mode(entry, file->mode);
 1359|    517|	archive_entry_set_uid(entry, file->uid);
 1360|    517|	archive_entry_set_gid(entry, file->gid);
 1361|    517|	archive_entry_set_nlink(entry, file->nlinks);
 1362|    517|	if ((file->time_is_set & BIRTHTIME_IS_SET))
  ------------------
  |  |  311|    517|#define BIRTHTIME_IS_SET 1
  ------------------
  |  Branch (1362:6): [True: 2, False: 515]
  ------------------
 1363|      2|		archive_entry_set_birthtime(entry, file->birthtime, 0);
 1364|    515|	else
 1365|    515|		archive_entry_unset_birthtime(entry);
 1366|    517|	if ((file->time_is_set & MTIME_IS_SET))
  ------------------
  |  |  312|    517|#define MTIME_IS_SET 2
  ------------------
  |  Branch (1366:6): [True: 193, False: 324]
  ------------------
 1367|    193|		archive_entry_set_mtime(entry, file->mtime, 0);
 1368|    324|	else
 1369|    324|		archive_entry_unset_mtime(entry);
 1370|    517|	if ((file->time_is_set & CTIME_IS_SET))
  ------------------
  |  |  314|    517|#define CTIME_IS_SET 8
  ------------------
  |  Branch (1370:6): [True: 192, False: 325]
  ------------------
 1371|    192|		archive_entry_set_ctime(entry, file->ctime, 0);
 1372|    325|	else
 1373|    325|		archive_entry_unset_ctime(entry);
 1374|    517|	if ((file->time_is_set & ATIME_IS_SET))
  ------------------
  |  |  313|    517|#define ATIME_IS_SET 4
  ------------------
  |  Branch (1374:6): [True: 194, False: 323]
  ------------------
 1375|    194|		archive_entry_set_atime(entry, file->atime, 0);
 1376|    323|	else
 1377|    323|		archive_entry_unset_atime(entry);
 1378|       |	/* N.B.: Rock Ridge supports 64-bit device numbers. */
 1379|    517|	archive_entry_set_rdev(entry, (dev_t)file->rdev);
 1380|    517|	archive_entry_set_size(entry, iso9660->entry_bytes_remaining);
 1381|    517|	if (file->symlink.s != NULL)
  ------------------
  |  Branch (1381:6): [True: 20, False: 497]
  ------------------
 1382|     20|		archive_entry_copy_symlink(entry, file->symlink.s);
 1383|       |
 1384|       |	/* Note: If the input isn't seekable, we can't rewind to
 1385|       |	 * return the same body again, so if the next entry refers to
 1386|       |	 * the same data, we have to return it as a hardlink to the
 1387|       |	 * original entry. */
 1388|    517|	if (file->number != -1 &&
  ------------------
  |  Branch (1388:6): [True: 386, False: 131]
  ------------------
 1389|    386|	    file->number == iso9660->previous_number) {
  ------------------
  |  Branch (1389:6): [True: 67, False: 319]
  ------------------
 1390|     67|		if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1390:7): [True: 0, False: 67]
  ------------------
 1391|      0|			r = archive_entry_copy_hardlink_l(entry,
  ------------------
  |  |   74|      0|#define archive_entry_copy_hardlink_l	_archive_entry_copy_hardlink_l
  ------------------
 1392|      0|			    (const char *)iso9660->utf16be_previous_path,
 1393|      0|			    iso9660->utf16be_previous_path_len,
 1394|      0|			    iso9660->sconv_utf16be);
 1395|      0|			if (r != 0) {
  ------------------
  |  Branch (1395:8): [True: 0, False: 0]
  ------------------
 1396|      0|				if (errno == ENOMEM) {
  ------------------
  |  Branch (1396:9): [True: 0, False: 0]
  ------------------
 1397|      0|					archive_set_error(&a->archive, ENOMEM,
 1398|      0|					    "No memory for Linkname");
 1399|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1400|      0|				}
 1401|      0|				archive_set_error(&a->archive,
 1402|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1403|      0|				    "Linkname cannot be converted "
 1404|      0|				    "from %s to current locale",
 1405|      0|				    archive_string_conversion_charset_name(
 1406|      0|				      iso9660->sconv_utf16be));
 1407|      0|				rd_r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1408|      0|			}
 1409|      0|		} else
 1410|     67|			archive_entry_set_hardlink(entry,
 1411|     67|			    iso9660->previous_pathname.s);
 1412|     67|		archive_entry_unset_size(entry);
 1413|     67|		iso9660->entry_bytes_remaining = 0;
 1414|     67|		return (rd_r);
 1415|     67|	}
 1416|       |
 1417|    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 (1417:6): [True: 311, False: 139]
  ------------------
 1418|    311|	    file->offset < iso9660->current_position) {
  ------------------
  |  Branch (1418:6): [True: 75, False: 236]
  ------------------
 1419|     75|		int64_t r64;
 1420|       |
 1421|     75|		r64 = __archive_read_seek(a, file->offset, SEEK_SET);
 1422|     75|		if (r64 != (int64_t)file->offset) {
  ------------------
  |  Branch (1422:7): [True: 0, False: 75]
  ------------------
 1423|       |			/* We can't seek backwards to extract it, so issue
 1424|       |			 * a warning.  Note that this can only happen if
 1425|       |			 * this entry was added to the heap after we passed
 1426|       |			 * this offset, that is, only if the directory
 1427|       |			 * mentioning this entry is later than the body of
 1428|       |			 * the entry. Such layouts are very unusual; most
 1429|       |			 * ISO9660 writers lay out and record all directory
 1430|       |			 * information first, then store all file bodies. */
 1431|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1432|      0|			    "Ignoring out-of-order file @%jx (%s) %jd < %jd",
 1433|      0|			    (uintmax_t)file->number,
 1434|      0|			    iso9660->pathname.s,
 1435|      0|			    (intmax_t)file->offset,
 1436|      0|			    (intmax_t)iso9660->current_position);
 1437|      0|			iso9660->entry_bytes_remaining = 0;
 1438|      0|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1439|      0|		}
 1440|     75|		iso9660->current_position = (uint64_t)r64;
 1441|     75|	}
 1442|       |
 1443|       |	/* Initialize zisofs variables. */
 1444|    450|	iso9660->entry_zisofs.pz = file->pz;
 1445|    450|	if (file->pz) {
  ------------------
  |  Branch (1445:6): [True: 0, False: 450]
  ------------------
 1446|      0|#ifdef HAVE_ZLIB_H
 1447|      0|		struct zisofs  *zisofs;
 1448|       |
 1449|      0|		zisofs = &iso9660->entry_zisofs;
 1450|      0|		zisofs->initialized = 0;
 1451|      0|		zisofs->pz_log2_bs = file->pz_log2_bs;
 1452|      0|		zisofs->pz_uncompressed_size = file->pz_uncompressed_size;
 1453|      0|		zisofs->pz_offset = 0;
 1454|      0|		zisofs->header_avail = 0;
 1455|      0|		zisofs->header_passed = 0;
 1456|      0|		zisofs->block_pointers_avail = 0;
 1457|      0|#endif
 1458|      0|		archive_entry_set_size(entry, file->pz_uncompressed_size);
 1459|      0|	}
 1460|       |
 1461|    450|	iso9660->previous_number = file->number;
 1462|    450|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1462:6): [True: 12, False: 438]
  ------------------
 1463|     12|		memcpy(iso9660->utf16be_previous_path, iso9660->utf16be_path,
 1464|     12|		    iso9660->utf16be_path_len);
 1465|     12|		iso9660->utf16be_previous_path_len = iso9660->utf16be_path_len;
 1466|     12|	} else
 1467|    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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1468|    450|		    &iso9660->previous_pathname, iso9660->pathname.s);
 1469|       |
 1470|       |	/* Reset entry_bytes_remaining if the file is multi extent. */
 1471|    450|	iso9660->entry_content = file->contents.first;
 1472|    450|	if (iso9660->entry_content != NULL)
  ------------------
  |  Branch (1472:6): [True: 14, False: 436]
  ------------------
 1473|     14|		iso9660->entry_bytes_remaining = iso9660->entry_content->size;
 1474|       |
 1475|    450|	if (archive_entry_filetype(entry) == AE_IFDIR) {
  ------------------
  |  |  221|    450|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1475:6): [True: 139, False: 311]
  ------------------
 1476|       |		/* Overwrite nlinks by proper link number which is
 1477|       |		 * calculated from number of sub directories. */
 1478|    139|		archive_entry_set_nlink(entry, 2 + file->subdirs);
 1479|       |		/* Directory data has been read completely. */
 1480|    139|		iso9660->entry_bytes_remaining = 0;
 1481|    139|	}
 1482|       |
 1483|    450|	if (rd_r != ARCHIVE_OK)
  ------------------
  |  |  233|    450|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1483:6): [True: 4, False: 446]
  ------------------
 1484|      4|		return (rd_r);
 1485|    446|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    446|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1486|    450|}
archive_read_support_format_iso9660.c:choose_volume:
 1161|    192|{
 1162|    192|	struct file_info *file;
 1163|    192|	int64_t skipsize;
 1164|    192|	struct vd *vd;
 1165|    192|	const void *block;
 1166|    192|	char seenJoliet;
 1167|       |
 1168|    192|	vd = &(iso9660->primary);
 1169|    192|	if (!iso9660->opt_support_joliet)
  ------------------
  |  Branch (1169:6): [True: 0, False: 192]
  ------------------
 1170|      0|		iso9660->seenJoliet = 0;
 1171|    192|	if (iso9660->seenJoliet &&
  ------------------
  |  Branch (1171:6): [True: 14, False: 178]
  ------------------
 1172|     14|		vd->location > iso9660->joliet.location)
  ------------------
  |  Branch (1172:3): [True: 1, False: 13]
  ------------------
 1173|       |		/* This condition is unlikely; by way of caution. */
 1174|      1|		vd = &(iso9660->joliet);
 1175|       |
 1176|    192|	skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location;
  ------------------
  |  |   82|    192|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
 1177|    192|	skipsize = __archive_read_consume(a, skipsize);
 1178|    192|	if (skipsize < 0)
  ------------------
  |  Branch (1178:6): [True: 3, False: 189]
  ------------------
 1179|      3|		return ((int)skipsize);
 1180|    189|	iso9660->current_position = skipsize;
 1181|       |
 1182|    189|	block = __archive_read_ahead(a, vd->size, NULL);
 1183|    189|	if (block == NULL) {
  ------------------
  |  Branch (1183:6): [True: 1, False: 188]
  ------------------
 1184|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1185|      1|		    "Failed to read full block when scanning "
 1186|      1|		    "ISO9660 directory list");
 1187|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1188|      1|	}
 1189|       |
 1190|       |	/*
 1191|       |	 * While reading Root Directory, flag seenJoliet must be zero to
 1192|       |	 * avoid converting special name 0x00(Current Directory) and
 1193|       |	 * next byte to UCS2.
 1194|       |	 */
 1195|    188|	seenJoliet = iso9660->seenJoliet;/* Save flag. */
 1196|    188|	iso9660->seenJoliet = 0;
 1197|    188|	file = parse_file_info(a, NULL, block, vd->size);
 1198|    188|	if (file == NULL)
  ------------------
  |  Branch (1198:6): [True: 12, False: 176]
  ------------------
 1199|     12|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1200|    176|	iso9660->seenJoliet = seenJoliet;
 1201|       |
 1202|       |	/*
 1203|       |	 * If the iso image has both RockRidge and Joliet, we preferentially
 1204|       |	 * use RockRidge Extensions rather than Joliet ones.
 1205|       |	 */
 1206|    176|	if (vd == &(iso9660->primary) && iso9660->seenRockridge
  ------------------
  |  Branch (1206:6): [True: 176, False: 0]
  |  Branch (1206:35): [True: 71, False: 105]
  ------------------
 1207|     71|	    && iso9660->seenJoliet)
  ------------------
  |  Branch (1207:9): [True: 0, False: 71]
  ------------------
 1208|      0|		iso9660->seenJoliet = 0;
 1209|       |
 1210|    176|	if (vd == &(iso9660->primary) && !iso9660->seenRockridge
  ------------------
  |  Branch (1210:6): [True: 176, False: 0]
  |  Branch (1210:35): [True: 105, False: 71]
  ------------------
 1211|    105|	    && iso9660->seenJoliet) {
  ------------------
  |  Branch (1211:9): [True: 13, False: 92]
  ------------------
 1212|       |		/* Switch reading data from primary to joliet. */
 1213|     13|		vd = &(iso9660->joliet);
 1214|     13|		skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location;
  ------------------
  |  |   82|     13|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
 1215|     13|		skipsize -= iso9660->current_position;
 1216|     13|		skipsize = __archive_read_consume(a, skipsize);
 1217|     13|		if (skipsize < 0)
  ------------------
  |  Branch (1217:7): [True: 1, False: 12]
  ------------------
 1218|      1|			return ((int)skipsize);
 1219|     12|		iso9660->current_position += skipsize;
 1220|       |
 1221|     12|		block = __archive_read_ahead(a, vd->size, NULL);
 1222|     12|		if (block == NULL) {
  ------------------
  |  Branch (1222:7): [True: 1, False: 11]
  ------------------
 1223|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1224|      1|			    "Failed to read full block when scanning "
 1225|      1|			    "ISO9660 directory list");
 1226|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1227|      1|		}
 1228|     11|		iso9660->seenJoliet = 0;
 1229|     11|		file = parse_file_info(a, NULL, block, vd->size);
 1230|     11|		if (file == NULL)
  ------------------
  |  Branch (1230:7): [True: 1, False: 10]
  ------------------
 1231|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1232|     10|		iso9660->seenJoliet = seenJoliet;
 1233|     10|	}
 1234|       |
 1235|       |	/* Store the root directory in the pending list. */
 1236|    173|	if (add_entry(a, iso9660, file) != ARCHIVE_OK)
  ------------------
  |  |  453|    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 (1236:6): [True: 0, False: 173]
  ------------------
 1237|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1238|    173|	if (iso9660->seenRockridge) {
  ------------------
  |  Branch (1238:6): [True: 71, False: 102]
  ------------------
 1239|     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
  |  |  ------------------
  ------------------
 1240|     71|		a->archive.archive_format_name =
 1241|     71|		    "ISO9660 with Rockridge extensions";
 1242|     71|	}
 1243|       |
 1244|    173|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    173|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1245|    173|}
archive_read_support_format_iso9660.c:parse_file_info:
 1843|    982|{
 1844|    982|	struct iso9660 *iso9660;
 1845|    982|	struct file_info *file, *filep;
 1846|    982|	size_t name_len;
 1847|    982|	const unsigned char *rr_start, *rr_end;
 1848|    982|	const unsigned char *p;
 1849|    982|	size_t dr_len = 0;
 1850|    982|	uint64_t fsize, offset;
 1851|    982|	int32_t location;
 1852|    982|	int flags;
 1853|       |
 1854|    982|	iso9660 = (struct iso9660 *)(a->format->data);
 1855|       |
 1856|    982|	if (reclen != 0)
  ------------------
  |  Branch (1856:6): [True: 981, False: 1]
  ------------------
 1857|    981|		dr_len = (size_t)isodirrec[DR_length_offset];
  ------------------
  |  |  196|    981|#define DR_length_offset 0
  ------------------
 1858|       |	/*
 1859|       |	 * Sanity check that reclen is not zero and dr_len is greater than
 1860|       |	 * reclen but at least 34
 1861|       |	 */
 1862|    982|	if (reclen == 0 || reclen < dr_len || dr_len < 34) {
  ------------------
  |  Branch (1862:6): [True: 1, False: 981]
  |  Branch (1862:21): [True: 0, False: 981]
  |  Branch (1862:40): [True: 9, False: 972]
  ------------------
 1863|     10|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     10|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1864|     10|			"Invalid length of directory record");
 1865|     10|		return (NULL);
 1866|     10|	}
 1867|    972|	name_len = (size_t)isodirrec[DR_name_len_offset];
  ------------------
  |  |  214|    972|#define DR_name_len_offset 32
  ------------------
 1868|    972|	location = archive_le32dec(isodirrec + DR_extent_offset);
  ------------------
  |  |  200|    972|#define DR_extent_offset 2
  ------------------
 1869|    972|	fsize = archive_le32dec(isodirrec + DR_size_offset);
  ------------------
  |  |  202|    972|#define DR_size_offset 10
  ------------------
 1870|       |	/* Sanity check that name_len doesn't exceed dr_len. */
 1871|    972|	if (dr_len - 33 < name_len || name_len == 0) {
  ------------------
  |  Branch (1871:6): [True: 4, False: 968]
  |  Branch (1871:32): [True: 3, False: 965]
  ------------------
 1872|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      7|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1873|      7|		    "Invalid length of file identifier");
 1874|      7|		return (NULL);
 1875|      7|	}
 1876|       |	/* Sanity check that location doesn't exceed volume block.
 1877|       |	 * Don't check lower limit of location; it's possibility
 1878|       |	 * the location has negative value when file type is symbolic
 1879|       |	 * link or file size is zero. As far as I know latest mkisofs
 1880|       |	 * do that.
 1881|       |	 */
 1882|    965|	if (location > 0 &&
  ------------------
  |  Branch (1882:6): [True: 436, False: 529]
  ------------------
 1883|    436|	    (location + ((fsize + iso9660->logical_block_size -1)
  ------------------
  |  Branch (1883:6): [True: 5, False: 431]
  ------------------
 1884|    436|	       / iso9660->logical_block_size))
 1885|    436|			> (uint32_t)iso9660->volume_block) {
 1886|      5|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      5|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1887|      5|		    "Invalid location of extent of file");
 1888|      5|		return (NULL);
 1889|      5|	}
 1890|       |	/* Sanity check that location doesn't have a negative value
 1891|       |	 * when the file is not empty. it's too large. */
 1892|    960|	if (fsize != 0 && location < 0) {
  ------------------
  |  Branch (1892:6): [True: 576, False: 384]
  |  Branch (1892:20): [True: 2, False: 574]
  ------------------
 1893|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1894|      2|		    "Invalid location of extent of file");
 1895|      2|		return (NULL);
 1896|      2|	}
 1897|       |
 1898|       |	/* Sanity check that this entry does not create a cycle. */
 1899|    958|	offset = iso9660->logical_block_size * (uint64_t)location;
 1900|  1.91k|	for (filep = parent; filep != NULL; filep = filep->parent) {
  ------------------
  |  Branch (1900:23): [True: 957, False: 954]
  ------------------
 1901|    957|		if (filep->offset == offset) {
  ------------------
  |  Branch (1901:7): [True: 4, False: 953]
  ------------------
 1902|      4|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1903|      4|			    "Directory structure contains loop");
 1904|      4|			return (NULL);
 1905|      4|		}
 1906|    957|	}
 1907|       |
 1908|       |	/* Create a new file entry and copy data from the ISO dir record. */
 1909|    954|	file = calloc(1, sizeof(*file));
 1910|    954|	if (file == NULL) {
  ------------------
  |  Branch (1910:6): [True: 0, False: 954]
  ------------------
 1911|      0|		archive_set_error(&a->archive, ENOMEM,
 1912|      0|		    "No memory for file entry");
 1913|      0|		return (NULL);
 1914|      0|	}
 1915|    954|	file->parent = parent;
 1916|    954|	file->offset = offset;
 1917|    954|	file->size = fsize;
 1918|    954|	if (isodate7_valid(isodirrec + DR_date_offset)) {
  ------------------
  |  |  204|    954|#define DR_date_offset 18
  ------------------
  |  Branch (1918:6): [True: 347, False: 607]
  ------------------
 1919|    347|		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  312|    347|#define MTIME_IS_SET 2
  ------------------
              		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  313|    347|#define ATIME_IS_SET 4
  ------------------
              		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  314|    347|#define CTIME_IS_SET 8
  ------------------
 1920|    347|		file->mtime = isodate7(isodirrec + DR_date_offset);
  ------------------
  |  |  204|    347|#define DR_date_offset 18
  ------------------
 1921|    347|		file->ctime = file->atime = file->mtime;
 1922|    347|	}
 1923|    954|	file->rede_files.first = NULL;
 1924|    954|	file->rede_files.last = &(file->rede_files.first);
 1925|       |
 1926|    954|	p = isodirrec + DR_name_offset;
  ------------------
  |  |  216|    954|#define DR_name_offset 33
  ------------------
 1927|       |	/* Rockridge extensions (if any) follow name.  Compute this
 1928|       |	 * before fidgeting the name_len below. */
 1929|    954|	rr_start = p + name_len + (name_len & 1 ? 0 : 1);
  ------------------
  |  Branch (1929:29): [True: 248, False: 706]
  ------------------
 1930|    954|	rr_end = isodirrec + dr_len;
 1931|       |
 1932|    954|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1932:6): [True: 18, False: 936]
  ------------------
 1933|       |		/* Joliet names are max 64 chars (128 bytes) according to spec,
 1934|       |		 * but genisoimage/mkisofs allows recording longer Joliet
 1935|       |		 * names which are 103 UCS2 characters(206 bytes) by their
 1936|       |		 * option '-joliet-long'.
 1937|       |		 */
 1938|     18|		if (name_len > 206)
  ------------------
  |  Branch (1938:7): [True: 0, False: 18]
  ------------------
 1939|      0|			name_len = 206;
 1940|     18|		name_len &= ~1;
 1941|       |
 1942|       |		/* trim trailing first version and dot from filename.
 1943|       |		 *
 1944|       |		 * Remember we were in UTF-16BE land!
 1945|       |		 * SEPARATOR 1 (.) and SEPARATOR 2 (;) are both
 1946|       |		 * 16 bits big endian characters on Joliet.
 1947|       |		 *
 1948|       |		 * TODO: sanitize filename?
 1949|       |		 *       Joliet allows any UCS-2 char except:
 1950|       |		 *       *, /, :, ;, ? and \.
 1951|       |		 */
 1952|       |		/* Chop off trailing ';1' from files. */
 1953|     18|		if (name_len > 4 && p[name_len-4] == 0 && p[name_len-3] == ';'
  ------------------
  |  Branch (1953:7): [True: 17, False: 1]
  |  Branch (1953:23): [True: 8, False: 9]
  |  Branch (1953:45): [True: 1, False: 7]
  ------------------
 1954|      1|		    && p[name_len-2] == 0 && p[name_len-1] == '1')
  ------------------
  |  Branch (1954:10): [True: 1, False: 0]
  |  Branch (1954:32): [True: 0, False: 1]
  ------------------
 1955|      0|			name_len -= 4;
 1956|       |#if 0 /* XXX: this somehow manages to strip of single-character file extensions, like '.c'. */
 1957|       |		/* Chop off trailing '.' from filenames. */
 1958|       |		if (name_len > 2 && p[name_len-2] == 0 && p[name_len-1] == '.')
 1959|       |			name_len -= 2;
 1960|       |#endif
 1961|     18|		if ((file->utf16be_name = malloc(name_len)) == NULL) {
  ------------------
  |  Branch (1961:7): [True: 0, False: 18]
  ------------------
 1962|      0|			archive_set_error(&a->archive, ENOMEM,
 1963|      0|			    "No memory for file name");
 1964|      0|			goto fail;
 1965|      0|		}
 1966|     18|		memcpy(file->utf16be_name, p, name_len);
 1967|     18|		file->utf16be_bytes = name_len;
 1968|    936|	} else {
 1969|       |		/* Chop off trailing ';1' from files. */
 1970|    936|		if (name_len > 2 && p[name_len - 2] == ';' &&
  ------------------
  |  Branch (1970:7): [True: 752, False: 184]
  |  Branch (1970:23): [True: 348, False: 404]
  ------------------
 1971|    348|				p[name_len - 1] == '1')
  ------------------
  |  Branch (1971:5): [True: 316, False: 32]
  ------------------
 1972|    316|			name_len -= 2;
 1973|       |		/* Chop off trailing '.' from filenames. */
 1974|    936|		if (name_len > 1 && p[name_len - 1] == '.')
  ------------------
  |  Branch (1974:7): [True: 752, False: 184]
  |  Branch (1974:23): [True: 9, False: 743]
  ------------------
 1975|      9|			--name_len;
 1976|       |
 1977|    936|		archive_strncpy(&file->name, (const char *)p, name_len);
  ------------------
  |  |  173|    936|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1978|    936|	}
 1979|       |
 1980|    954|	flags = isodirrec[DR_flags_offset];
  ------------------
  |  |  206|    954|#define DR_flags_offset 25
  ------------------
 1981|    954|	if (flags & 0x02)
  ------------------
  |  Branch (1981:6): [True: 380, False: 574]
  ------------------
 1982|    380|		file->mode = AE_IFDIR | 0700;
  ------------------
  |  |  221|    380|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1983|    574|	else
 1984|    574|		file->mode = AE_IFREG | 0400;
  ------------------
  |  |  216|    574|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1985|    954|	if (flags & 0x80)
  ------------------
  |  Branch (1985:6): [True: 91, False: 863]
  ------------------
 1986|     91|		file->multi_extent = 1;
 1987|    863|	else
 1988|    863|		file->multi_extent = 0;
 1989|       |	/*
 1990|       |	 * Use a location for the file number, which is treated as an inode
 1991|       |	 * number to find out hardlink target. If Rockridge extensions is
 1992|       |	 * being used, the file number will be overwritten by FILE SERIAL
 1993|       |	 * NUMBER of RRIP "PX" extension.
 1994|       |	 * Note: Old mkisofs did not record that FILE SERIAL NUMBER
 1995|       |	 * in ISO images.
 1996|       |	 * Note2: xorriso set 0 to the location of a symlink file.
 1997|       |	 */
 1998|    954|	if (file->size == 0 && location >= 0) {
  ------------------
  |  Branch (1998:6): [True: 384, False: 570]
  |  Branch (1998:25): [True: 240, False: 144]
  ------------------
 1999|       |		/* If file->size is zero, its location points wrong place,
 2000|       |		 * and so we should not use it for the file number.
 2001|       |		 * When the location has negative value, it can be used
 2002|       |		 * for the file number.
 2003|       |		 */
 2004|    240|		file->number = -1;
 2005|       |		/* Do not appear before any directory entries. */
 2006|    240|		file->offset = -1;
 2007|    240|	} else
 2008|    714|		file->number = (int64_t)(uint32_t)location;
 2009|       |
 2010|       |	/* Rockridge extensions overwrite information from above. */
 2011|    954|	if (iso9660->opt_support_rockridge) {
  ------------------
  |  Branch (2011:6): [True: 178, False: 776]
  ------------------
 2012|    178|		if (parent == NULL && rr_end - rr_start >= 7) {
  ------------------
  |  Branch (2012:7): [True: 178, False: 0]
  |  Branch (2012:25): [True: 93, False: 85]
  ------------------
 2013|     93|			p = rr_start;
 2014|     93|			if (memcmp(p, "SP\x07\x01\xbe\xef", 6) == 0) {
  ------------------
  |  Branch (2014:8): [True: 87, False: 6]
  ------------------
 2015|       |				/*
 2016|       |				 * SP extension stores the suspOffset
 2017|       |				 * (Number of bytes to skip between
 2018|       |				 * filename and SUSP records.)
 2019|       |				 * It is mandatory by the SUSP standard
 2020|       |				 * (IEEE 1281).
 2021|       |				 *
 2022|       |				 * It allows SUSP to coexist with
 2023|       |				 * non-SUSP uses of the System
 2024|       |				 * Use Area by placing non-SUSP data
 2025|       |				 * before SUSP data.
 2026|       |				 *
 2027|       |				 * SP extension must be in the root
 2028|       |				 * directory entry, disable all SUSP
 2029|       |				 * processing if not found.
 2030|       |				 */
 2031|     87|				iso9660->suspOffset = p[6];
 2032|     87|				iso9660->seenSUSP = 1;
 2033|     87|				rr_start += 7;
 2034|     87|			}
 2035|     93|		}
 2036|    178|		if (iso9660->seenSUSP) {
  ------------------
  |  Branch (2036:7): [True: 87, False: 91]
  ------------------
 2037|     87|			int r;
 2038|       |
 2039|     87|			file->name_continues = 0;
 2040|     87|			file->symlink_continues = 0;
 2041|     87|			rr_start += iso9660->suspOffset;
 2042|     87|			r = parse_rockridge(a, file, rr_start, rr_end);
 2043|     87|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|     87|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2043:8): [True: 1, False: 86]
  ------------------
 2044|      1|				goto fail;
 2045|       |			/*
 2046|       |			 * A file size of symbolic link files in ISO images
 2047|       |			 * made by makefs is not zero and its location is
 2048|       |			 * the same as those of next regular file. That is
 2049|       |			 * the same as hard like file and it causes unexpected
 2050|       |			 * error.
 2051|       |			 */
 2052|     86|			if (file->size > 0 &&
  ------------------
  |  Branch (2052:8): [True: 3, False: 83]
  ------------------
 2053|      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 (2053:8): [True: 0, False: 3]
  ------------------
 2054|      0|				file->size = 0;
 2055|      0|				file->number = -1;
 2056|      0|				file->offset = -1;
 2057|      0|			}
 2058|     86|		} else
 2059|       |			/* If there isn't SUSP, disable parsing
 2060|       |			 * rock ridge extensions. */
 2061|     91|			iso9660->opt_support_rockridge = 0;
 2062|    178|	}
 2063|       |
 2064|    953|	file->nlinks = 1;/* Reset nlink. we'll calculate it later. */
 2065|       |	/* Tell file's parent how many children that parent has. */
 2066|    953|	if (parent != NULL && (flags & 0x02))
  ------------------
  |  Branch (2066:6): [True: 766, False: 187]
  |  Branch (2066:24): [True: 284, False: 482]
  ------------------
 2067|    284|		parent->subdirs++;
 2068|       |
 2069|    953|	if (iso9660->seenRockridge) {
  ------------------
  |  Branch (2069:6): [True: 72, False: 881]
  ------------------
 2070|     72|		if (parent != NULL && parent->parent == NULL &&
  ------------------
  |  Branch (2070:7): [True: 0, False: 72]
  |  Branch (2070:25): [True: 0, False: 0]
  ------------------
 2071|      0|		    (flags & 0x02) && iso9660->rr_moved == NULL &&
  ------------------
  |  Branch (2071:7): [True: 0, False: 0]
  |  Branch (2071:25): [True: 0, False: 0]
  ------------------
 2072|      0|		    file->name.s &&
  ------------------
  |  Branch (2072:7): [True: 0, False: 0]
  ------------------
 2073|      0|		    (strcmp(file->name.s, "rr_moved") == 0 ||
  ------------------
  |  Branch (2073:8): [True: 0, False: 0]
  ------------------
 2074|      0|		     strcmp(file->name.s, ".rr_moved") == 0)) {
  ------------------
  |  Branch (2074:8): [True: 0, False: 0]
  ------------------
 2075|      0|			iso9660->rr_moved = file;
 2076|      0|			file->rr_moved = 1;
 2077|      0|			file->rr_moved_has_re_only = 1;
 2078|      0|			file->re = 0;
 2079|      0|			parent->subdirs--;
 2080|     72|		} else if (file->re) {
  ------------------
  |  Branch (2080:14): [True: 1, False: 71]
  ------------------
 2081|       |			/*
 2082|       |			 * Sanity check: file's parent is rr_moved.
 2083|       |			 */
 2084|      1|			if (parent == NULL || parent->rr_moved == 0) {
  ------------------
  |  Branch (2084:8): [True: 1, False: 0]
  |  Branch (2084:26): [True: 0, False: 0]
  ------------------
 2085|      1|				archive_set_error(&a->archive,
 2086|      1|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2087|      1|				    "Invalid Rockridge RE");
 2088|      1|				goto fail;
 2089|      1|			}
 2090|       |			/*
 2091|       |			 * Sanity check: file does not have "CL" extension.
 2092|       |			 */
 2093|      0|			if (file->cl_offset) {
  ------------------
  |  Branch (2093:8): [True: 0, False: 0]
  ------------------
 2094|      0|				archive_set_error(&a->archive,
 2095|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2096|      0|				    "Invalid Rockridge RE and CL");
 2097|      0|				goto fail;
 2098|      0|			}
 2099|       |			/*
 2100|       |			 * Sanity check: The file type must be a directory.
 2101|       |			 */
 2102|      0|			if ((flags & 0x02) == 0) {
  ------------------
  |  Branch (2102:8): [True: 0, False: 0]
  ------------------
 2103|      0|				archive_set_error(&a->archive,
 2104|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2105|      0|				    "Invalid Rockridge RE");
 2106|      0|				goto fail;
 2107|      0|			}
 2108|     71|		} else if (parent != NULL && parent->rr_moved)
  ------------------
  |  Branch (2108:14): [True: 0, False: 71]
  |  Branch (2108:32): [True: 0, False: 0]
  ------------------
 2109|      0|			file->rr_moved_has_re_only = 0;
 2110|     71|		else if (parent != NULL && (flags & 0x02) &&
  ------------------
  |  Branch (2110:12): [True: 0, False: 71]
  |  Branch (2110:30): [True: 0, False: 0]
  ------------------
 2111|      0|		    (parent->re || parent->re_descendant))
  ------------------
  |  Branch (2111:8): [True: 0, False: 0]
  |  Branch (2111:22): [True: 0, False: 0]
  ------------------
 2112|      0|			file->re_descendant = 1;
 2113|     71|		if (file->cl_offset) {
  ------------------
  |  Branch (2113:7): [True: 0, False: 71]
  ------------------
 2114|      0|			struct file_info *r;
 2115|       |
 2116|      0|			if (parent == NULL || parent->parent == NULL) {
  ------------------
  |  Branch (2116:8): [True: 0, False: 0]
  |  Branch (2116:26): [True: 0, False: 0]
  ------------------
 2117|      0|				archive_set_error(&a->archive,
 2118|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2119|      0|				    "Invalid Rockridge CL");
 2120|      0|				goto fail;
 2121|      0|			}
 2122|       |			/*
 2123|       |			 * Sanity check: The file type must be a regular file.
 2124|       |			 */
 2125|      0|			if ((flags & 0x02) != 0) {
  ------------------
  |  Branch (2125:8): [True: 0, False: 0]
  ------------------
 2126|      0|				archive_set_error(&a->archive,
 2127|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2128|      0|				    "Invalid Rockridge CL");
 2129|      0|				goto fail;
 2130|      0|			}
 2131|      0|			parent->subdirs++;
 2132|       |			/* Overwrite an offset and a number of this "CL" entry
 2133|       |			 * to appear before other dirs. "+1" to those is to
 2134|       |			 * make sure to appear after "RE" entry which this
 2135|       |			 * "CL" entry should be connected with. */
 2136|      0|			file->offset = file->number = file->cl_offset + 1;
 2137|       |
 2138|       |			/*
 2139|       |			 * Sanity check: cl_offset does not point at its
 2140|       |			 * the parents or itself.
 2141|       |			 */
 2142|      0|			for (r = parent; r; r = r->parent) {
  ------------------
  |  Branch (2142:21): [True: 0, False: 0]
  ------------------
 2143|      0|				if (r->offset == file->cl_offset) {
  ------------------
  |  Branch (2143:9): [True: 0, False: 0]
  ------------------
 2144|      0|					archive_set_error(&a->archive,
 2145|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2146|      0|					    "Invalid Rockridge CL");
 2147|      0|					goto fail;
 2148|      0|				}
 2149|      0|			}
 2150|      0|			if (file->cl_offset == file->offset ||
  ------------------
  |  Branch (2150:8): [True: 0, False: 0]
  ------------------
 2151|      0|			    parent->rr_moved) {
  ------------------
  |  Branch (2151:8): [True: 0, False: 0]
  ------------------
 2152|      0|				archive_set_error(&a->archive,
 2153|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2154|      0|				    "Invalid Rockridge CL");
 2155|      0|				goto fail;
 2156|      0|			}
 2157|      0|		}
 2158|     71|	}
 2159|       |
 2160|       |#if DEBUG
 2161|       |	/* DEBUGGING: Warn about attributes I don't yet fully support. */
 2162|       |	if ((flags & ~0x02) != 0) {
 2163|       |		fprintf(stderr, "\n ** Unrecognized flag: ");
 2164|       |		dump_isodirrec(stderr, isodirrec);
 2165|       |		fprintf(stderr, "\n");
 2166|       |	} else if (archive_le16dec(isodirrec + DR_volume_sequence_number_offset) != 1) {
 2167|       |		fprintf(stderr, "\n ** Unrecognized sequence number: ");
 2168|       |		dump_isodirrec(stderr, isodirrec);
 2169|       |		fprintf(stderr, "\n");
 2170|       |	} else if (*(isodirrec + DR_file_unit_size_offset) != 0) {
 2171|       |		fprintf(stderr, "\n ** Unexpected file unit size: ");
 2172|       |		dump_isodirrec(stderr, isodirrec);
 2173|       |		fprintf(stderr, "\n");
 2174|       |	} else if (*(isodirrec + DR_interleave_offset) != 0) {
 2175|       |		fprintf(stderr, "\n ** Unexpected interleave: ");
 2176|       |		dump_isodirrec(stderr, isodirrec);
 2177|       |		fprintf(stderr, "\n");
 2178|       |	} else if (*(isodirrec + DR_ext_attr_length_offset) != 0) {
 2179|       |		fprintf(stderr, "\n ** Unexpected extended attribute length: ");
 2180|       |		dump_isodirrec(stderr, isodirrec);
 2181|       |		fprintf(stderr, "\n");
 2182|       |	}
 2183|       |#endif
 2184|    952|	register_file(iso9660, file);
 2185|    952|	return (file);
 2186|      2|fail:
 2187|      2|	archive_string_free(&file->name);
 2188|      2|	free(file);
 2189|       |	return (NULL);
 2190|    953|}
archive_read_support_format_iso9660.c:isodate7_valid:
 3278|  1.00k|{
 3279|  1.00k|	int year = v[0];
 3280|  1.00k|	int month = v[1];
 3281|  1.00k|	int day = v[2];
 3282|  1.00k|	int hour = v[3];
 3283|  1.00k|	int minute = v[4];
 3284|  1.00k|	int second = v[5];
 3285|  1.00k|	int gmt_off = (signed char)v[6];
 3286|       |
 3287|       |	/* ECMA-119 9.1.5 "If all seven values are zero, it shall mean
 3288|       |	 * that the date is unspecified" */
 3289|  1.00k|	if (year == 0
  ------------------
  |  Branch (3289:6): [True: 423, False: 583]
  ------------------
 3290|    423|	    && month == 0
  ------------------
  |  Branch (3290:9): [True: 381, False: 42]
  ------------------
 3291|    381|	    && day == 0
  ------------------
  |  Branch (3291:9): [True: 369, False: 12]
  ------------------
 3292|    369|	    && hour == 0
  ------------------
  |  Branch (3292:9): [True: 363, False: 6]
  ------------------
 3293|    363|	    && minute == 0
  ------------------
  |  Branch (3293:9): [True: 355, False: 8]
  ------------------
 3294|    355|	    && second == 0
  ------------------
  |  Branch (3294:9): [True: 338, False: 17]
  ------------------
 3295|    338|	    && gmt_off == 0)
  ------------------
  |  Branch (3295:9): [True: 283, False: 55]
  ------------------
 3296|    283|		return 0;
 3297|       |	/*
 3298|       |	 * Sanity-test each individual field
 3299|       |	 */
 3300|       |	/* Year can have any value */
 3301|       |	/* Month must be 1-12 */
 3302|    723|	if (month < 1 || month > 12)
  ------------------
  |  Branch (3302:6): [True: 103, False: 620]
  |  Branch (3302:19): [True: 82, False: 538]
  ------------------
 3303|    185|		return 0;
 3304|       |	/* Day must be 1-31 */
 3305|    538|	if (day < 1 || day > 31)
  ------------------
  |  Branch (3305:6): [True: 66, False: 472]
  |  Branch (3305:17): [True: 50, False: 422]
  ------------------
 3306|    116|		return 0;
 3307|       |	/* Hour must be 0-23 */
 3308|    422|	if (hour > 23)
  ------------------
  |  Branch (3308:6): [True: 22, False: 400]
  ------------------
 3309|     22|		return 0;
 3310|       |	/* Minute must be 0-59 */
 3311|    400|	if (minute > 59)
  ------------------
  |  Branch (3311:6): [True: 17, False: 383]
  ------------------
 3312|     17|		return 0;
 3313|       |	/* second must be 0-59 according to ECMA-119 9.1.5 */
 3314|       |	/* BUT: we should probably allow for the time being in UTC, which
 3315|       |	   allows up to 61 seconds in a minute in certain cases */
 3316|    383|	if (second > 61)
  ------------------
  |  Branch (3316:6): [True: 13, False: 370]
  ------------------
 3317|     13|		return 0;
 3318|       |	/* Offset from GMT must be -48 to +52 */
 3319|    370|	if (gmt_off < -48 || gmt_off > +52)
  ------------------
  |  Branch (3319:6): [True: 4, False: 366]
  |  Branch (3319:23): [True: 9, False: 357]
  ------------------
 3320|     13|		return 0;
 3321|       |
 3322|       |	/* All tests pass, this is OK */
 3323|    357|	return 1;
 3324|    370|}
archive_read_support_format_iso9660.c:isodate7:
 3328|    357|{
 3329|    357|	struct tm tm;
 3330|    357|	int offset;
 3331|    357|	time_t t;
 3332|       |
 3333|    357|	memset(&tm, 0, sizeof(tm));
 3334|    357|	tm.tm_year = v[0];
 3335|    357|	tm.tm_mon = v[1] - 1;
 3336|    357|	tm.tm_mday = v[2];
 3337|    357|	tm.tm_hour = v[3];
 3338|    357|	tm.tm_min = v[4];
 3339|    357|	tm.tm_sec = v[5];
 3340|       |	/* v[6] is the signed timezone offset, in 1/4-hour increments. */
 3341|    357|	offset = ((const signed char *)v)[6];
 3342|    357|	if (offset > -48 && offset < 52) {
  ------------------
  |  Branch (3342:6): [True: 353, False: 4]
  |  Branch (3342:22): [True: 348, False: 5]
  ------------------
 3343|    348|		tm.tm_hour -= offset / 4;
 3344|    348|		tm.tm_min -= (offset % 4) * 15;
 3345|    348|	}
 3346|    357|	t = time_from_tm(&tm);
 3347|    357|	if (t == (time_t)-1)
  ------------------
  |  Branch (3347:6): [True: 0, False: 357]
  ------------------
 3348|      0|		return ((time_t)0);
 3349|    357|	return (t);
 3350|    357|}
archive_read_support_format_iso9660.c:time_from_tm:
 3443|    364|{
 3444|       |#if HAVE__MKGMTIME
 3445|       |        return _mkgmtime(t);
 3446|       |#elif HAVE_TIMEGM
 3447|       |        /* Use platform timegm() if available. */
 3448|    364|        return (timegm(t));
 3449|       |#else
 3450|       |        /* Else use direct calculation using POSIX assumptions. */
 3451|       |        /* First, fix up tm_yday based on the year/month/day. */
 3452|       |        if (mktime(t) == (time_t)-1)
 3453|       |                return ((time_t)-1);
 3454|       |        /* Then we can compute timegm() from first principles. */
 3455|       |        return (t->tm_sec
 3456|       |            + t->tm_min * 60
 3457|       |            + t->tm_hour * 3600
 3458|       |            + t->tm_yday * 86400
 3459|       |            + (t->tm_year - 70) * 31536000
 3460|       |            + ((t->tm_year - 69) / 4) * 86400
 3461|       |            - ((t->tm_year - 1) / 100) * 86400
 3462|       |            + ((t->tm_year + 299) / 400) * 86400);
 3463|       |#endif
 3464|    364|}
archive_read_support_format_iso9660.c:parse_rockridge:
 2195|     87|{
 2196|     87|	struct iso9660 *iso9660;
 2197|     87|	int entry_seen = 0;
 2198|       |
 2199|     87|	iso9660 = (struct iso9660 *)(a->format->data);
 2200|       |
 2201|    206|	while (p + 4 <= end  /* Enough space for another entry. */
  ------------------
  |  Branch (2201:9): [True: 196, False: 10]
  ------------------
 2202|    196|	    && p[0] >= 'A' && p[0] <= 'Z' /* Sanity-check 1st char of name. */
  ------------------
  |  Branch (2202:9): [True: 143, False: 53]
  |  Branch (2202:24): [True: 124, False: 19]
  ------------------
 2203|    124|	    && p[1] >= 'A' && p[1] <= 'Z' /* Sanity-check 2nd char of name. */
  ------------------
  |  Branch (2203:9): [True: 123, False: 1]
  |  Branch (2203:24): [True: 120, False: 3]
  ------------------
 2204|    120|	    && p[2] >= 4 /* Sanity-check length. */
  ------------------
  |  Branch (2204:9): [True: 120, False: 0]
  ------------------
 2205|    120|	    && p + p[2] <= end) { /* Sanity-check length. */
  ------------------
  |  Branch (2205:9): [True: 120, False: 0]
  ------------------
 2206|    120|		const unsigned char *data = p + 4;
 2207|    120|		int data_length = p[2] - 4;
 2208|    120|		int version = p[3];
 2209|       |
 2210|    120|		switch(p[0]) {
 2211|      3|		case 'C':
  ------------------
  |  Branch (2211:3): [True: 3, False: 117]
  ------------------
 2212|      3|			if (p[1] == 'E') {
  ------------------
  |  Branch (2212:8): [True: 1, False: 2]
  ------------------
 2213|      1|				if (version == 1 && data_length == 24) {
  ------------------
  |  Branch (2213:9): [True: 0, False: 1]
  |  Branch (2213:25): [True: 0, False: 0]
  ------------------
 2214|       |					/*
 2215|       |					 * CE extension comprises:
 2216|       |					 *   8 byte sector containing extension
 2217|       |					 *   8 byte offset w/in above sector
 2218|       |					 *   8 byte length of continuation
 2219|       |					 */
 2220|      0|					int32_t location =
 2221|      0|					    archive_le32dec(data);
 2222|      0|					file->ce_offset =
 2223|      0|					    archive_le32dec(data+8);
 2224|      0|					file->ce_size =
 2225|      0|					    archive_le32dec(data+16);
 2226|      0|					if (register_CE(a, location, file)
  ------------------
  |  Branch (2226:10): [True: 0, False: 0]
  ------------------
 2227|      0|					    != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2228|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2229|      0|				}
 2230|      1|			}
 2231|      2|			else if (p[1] == 'L') {
  ------------------
  |  Branch (2231:13): [True: 1, False: 1]
  ------------------
 2232|      1|				if (version == 1 && data_length == 8) {
  ------------------
  |  Branch (2232:9): [True: 0, False: 1]
  |  Branch (2232:25): [True: 0, False: 0]
  ------------------
 2233|      0|					file->cl_offset = (uint64_t)
 2234|      0|					    iso9660->logical_block_size *
 2235|      0|					    (uint64_t)archive_le32dec(data);
 2236|      0|					iso9660->seenRockridge = 1;
 2237|      0|				}
 2238|      1|			}
 2239|      3|			break;
 2240|      3|		case 'N':
  ------------------
  |  Branch (2240:3): [True: 1, False: 119]
  ------------------
 2241|      1|			if (p[1] == 'M') {
  ------------------
  |  Branch (2241:8): [True: 0, False: 1]
  ------------------
 2242|      0|				if (version == 1) {
  ------------------
  |  Branch (2242:9): [True: 0, False: 0]
  ------------------
 2243|      0|					parse_rockridge_NM1(file,
 2244|      0|					    data, data_length);
 2245|      0|					iso9660->seenRockridge = 1;
 2246|      0|				}
 2247|      0|			}
 2248|      1|			break;
 2249|      5|		case 'P':
  ------------------
  |  Branch (2249:3): [True: 5, False: 115]
  ------------------
 2250|       |			/*
 2251|       |			 * PD extension is padding;
 2252|       |			 * contents are always ignored.
 2253|       |			 *
 2254|       |			 * PL extension won't appear;
 2255|       |			 * contents are always ignored.
 2256|       |			 */
 2257|      5|			if (p[1] == 'N') {
  ------------------
  |  Branch (2257:8): [True: 2, False: 3]
  ------------------
 2258|      2|				if (version == 1 && data_length == 16) {
  ------------------
  |  Branch (2258:9): [True: 0, False: 2]
  |  Branch (2258:25): [True: 0, False: 0]
  ------------------
 2259|      0|					file->rdev = archive_le32dec(data);
 2260|      0|					file->rdev <<= 32;
 2261|      0|					file->rdev |=
 2262|      0|					    archive_le32dec(data + 8);
 2263|      0|					iso9660->seenRockridge = 1;
 2264|      0|				}
 2265|      2|			}
 2266|      3|			else if (p[1] == 'X') {
  ------------------
  |  Branch (2266:13): [True: 1, False: 2]
  ------------------
 2267|       |				/*
 2268|       |				 * PX extension comprises:
 2269|       |				 *   8 bytes for mode,
 2270|       |				 *   8 bytes for nlinks,
 2271|       |				 *   8 bytes for uid,
 2272|       |				 *   8 bytes for gid,
 2273|       |				 *   8 bytes for inode.
 2274|       |				 */
 2275|      1|				if (version == 1) {
  ------------------
  |  Branch (2275:9): [True: 0, False: 1]
  ------------------
 2276|      0|					if (data_length >= 8)
  ------------------
  |  Branch (2276:10): [True: 0, False: 0]
  ------------------
 2277|      0|						file->mode = (__LA_MODE_T)
 2278|      0|						    archive_le32dec(data);
 2279|      0|					if (data_length >= 16)
  ------------------
  |  Branch (2279:10): [True: 0, False: 0]
  ------------------
 2280|      0|						file->nlinks =
 2281|      0|						    archive_le32dec(data + 8);
 2282|      0|					if (data_length >= 24)
  ------------------
  |  Branch (2282:10): [True: 0, False: 0]
  ------------------
 2283|      0|						file->uid =
 2284|      0|						    archive_le32dec(data + 16);
 2285|      0|					if (data_length >= 32)
  ------------------
  |  Branch (2285:10): [True: 0, False: 0]
  ------------------
 2286|      0|						file->gid =
 2287|      0|						    archive_le32dec(data + 24);
 2288|      0|					if (data_length >= 40)
  ------------------
  |  Branch (2288:10): [True: 0, False: 0]
  ------------------
 2289|      0|						file->number =
 2290|      0|						    archive_le32dec(data + 32);
 2291|      0|					iso9660->seenRockridge = 1;
 2292|      0|				}
 2293|      1|			}
 2294|      5|			break;
 2295|      4|		case 'R':
  ------------------
  |  Branch (2295:3): [True: 4, False: 116]
  ------------------
 2296|      4|			if (p[1] == 'E' && version == 1) {
  ------------------
  |  Branch (2296:8): [True: 1, False: 3]
  |  Branch (2296:23): [True: 1, False: 0]
  ------------------
 2297|      1|				file->re = 1;
 2298|      1|				iso9660->seenRockridge = 1;
 2299|      1|			}
 2300|      3|			else if (p[1] == 'R' && version == 1) {
  ------------------
  |  Branch (2300:13): [True: 0, False: 3]
  |  Branch (2300:28): [True: 0, False: 0]
  ------------------
 2301|       |				/*
 2302|       |				 * RR extension comprises:
 2303|       |				 *    one byte flag value
 2304|       |				 * This extension is obsolete,
 2305|       |				 * so contents are always ignored.
 2306|       |				 */
 2307|      0|			}
 2308|      4|			break;
 2309|     50|		case 'S':
  ------------------
  |  Branch (2309:3): [True: 50, False: 70]
  ------------------
 2310|     50|			if (p[1] == 'L') {
  ------------------
  |  Branch (2310:8): [True: 23, False: 27]
  ------------------
 2311|     23|				if (version == 1) {
  ------------------
  |  Branch (2311:9): [True: 22, False: 1]
  ------------------
 2312|     22|					parse_rockridge_SL1(file,
 2313|     22|					    data, data_length);
 2314|     22|					iso9660->seenRockridge = 1;
 2315|     22|				}
 2316|     23|			}
 2317|     27|			else if (p[1] == 'T'
  ------------------
  |  Branch (2317:13): [True: 2, False: 25]
  ------------------
 2318|      2|			    && data_length == 0 && version == 1) {
  ------------------
  |  Branch (2318:11): [True: 1, False: 1]
  |  Branch (2318:31): [True: 1, False: 0]
  ------------------
 2319|       |				/*
 2320|       |				 * ST extension marks end of this
 2321|       |				 * block of SUSP entries.
 2322|       |				 *
 2323|       |				 * It allows SUSP to coexist with
 2324|       |				 * non-SUSP uses of the System
 2325|       |				 * Use Area by placing non-SUSP data
 2326|       |				 * after SUSP data.
 2327|       |				 */
 2328|      1|				iso9660->seenSUSP = 0;
 2329|      1|				iso9660->seenRockridge = 0;
 2330|      1|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2331|      1|			}
 2332|     49|			break;
 2333|     51|		case 'T':
  ------------------
  |  Branch (2333:3): [True: 51, False: 69]
  ------------------
 2334|     51|			if (p[1] == 'F') {
  ------------------
  |  Branch (2334:8): [True: 50, False: 1]
  ------------------
 2335|     50|				if (version == 1) {
  ------------------
  |  Branch (2335:9): [True: 49, False: 1]
  ------------------
 2336|     49|					parse_rockridge_TF1(file,
 2337|     49|					    data, data_length);
 2338|     49|					iso9660->seenRockridge = 1;
 2339|     49|				}
 2340|     50|			}
 2341|     51|			break;
 2342|      2|		case 'Z':
  ------------------
  |  Branch (2342:3): [True: 2, False: 118]
  ------------------
 2343|      2|			if (p[1] == 'F') {
  ------------------
  |  Branch (2343:8): [True: 2, False: 0]
  ------------------
 2344|      2|				if (version == 1)
  ------------------
  |  Branch (2344:9): [True: 1, False: 1]
  ------------------
 2345|      1|					parse_rockridge_ZF1(file,
 2346|      1|					    data, data_length);
 2347|      2|			}
 2348|      2|			break;
 2349|      4|		default:
  ------------------
  |  Branch (2349:3): [True: 4, False: 116]
  ------------------
 2350|      4|			break;
 2351|    120|		}
 2352|       |
 2353|    119|		p += p[2];
 2354|    119|		entry_seen = 1;
 2355|    119|	}
 2356|       |
 2357|     86|	if (entry_seen)
  ------------------
  |  Branch (2357:6): [True: 85, False: 1]
  ------------------
 2358|     85|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     85|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2359|      1|	else {
 2360|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2361|      1|				  "Tried to parse Rockridge extensions, but none found");
 2362|      1|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      1|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2363|      1|	}
 2364|     86|}
archive_read_support_format_iso9660.c:parse_rockridge_SL1:
 2678|     22|{
 2679|     22|	const char *separator = "";
 2680|       |
 2681|     22|	if (!file->symlink_continues || file->symlink.length < 1)
  ------------------
  |  Branch (2681:6): [True: 22, False: 0]
  |  Branch (2681:34): [True: 0, False: 0]
  ------------------
 2682|     22|		archive_string_empty(&file->symlink);
  ------------------
  |  |  181|     22|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 2683|     22|	file->symlink_continues = 0;
 2684|       |
 2685|       |	/*
 2686|       |	 * Defined flag values:
 2687|       |	 *  0: This is the last SL record for this symbolic link
 2688|       |	 *  1: this symbolic link field continues in next SL entry
 2689|       |	 *  All other values are reserved.
 2690|       |	 */
 2691|     22|	if (data_length < 1)
  ------------------
  |  Branch (2691:6): [True: 1, False: 21]
  ------------------
 2692|      1|		return;
 2693|     21|	switch(*data) {
 2694|     18|	case 0:
  ------------------
  |  Branch (2694:2): [True: 18, False: 3]
  ------------------
 2695|     18|		break;
 2696|      2|	case 1:
  ------------------
  |  Branch (2696:2): [True: 2, False: 19]
  ------------------
 2697|      2|		file->symlink_continues = 1;
 2698|      2|		break;
 2699|      1|	default:
  ------------------
  |  Branch (2699:2): [True: 1, False: 20]
  ------------------
 2700|      1|		return;
 2701|     21|	}
 2702|     20|	++data;  /* Skip flag byte. */
 2703|     20|	--data_length;
 2704|       |
 2705|       |	/*
 2706|       |	 * SL extension body stores "components".
 2707|       |	 * Basically, this is a complicated way of storing
 2708|       |	 * a POSIX path.  It also interferes with using
 2709|       |	 * symlinks for storing non-path data. <sigh>
 2710|       |	 *
 2711|       |	 * Each component is 2 bytes (flag and length)
 2712|       |	 * possibly followed by name data.
 2713|       |	 */
 2714|    110|	while (data_length >= 2) {
  ------------------
  |  Branch (2714:9): [True: 97, False: 13]
  ------------------
 2715|     97|		unsigned char flag = *data++;
 2716|     97|		unsigned char nlen = *data++;
 2717|     97|		data_length -= 2;
 2718|       |
 2719|     97|		archive_strcat(&file->symlink, separator);
 2720|     97|		separator = "/";
 2721|       |
 2722|     97|		switch(flag) {
 2723|     38|		case 0: /* Usual case, this is text. */
  ------------------
  |  Branch (2723:3): [True: 38, False: 59]
  ------------------
 2724|     38|			if (data_length < nlen)
  ------------------
  |  Branch (2724:8): [True: 1, False: 37]
  ------------------
 2725|      1|				return;
 2726|     37|			archive_strncat(&file->symlink,
 2727|     37|			    (const char *)data, nlen);
 2728|     37|			break;
 2729|     24|		case 0x01: /* Text continues in next component. */
  ------------------
  |  Branch (2729:3): [True: 24, False: 73]
  ------------------
 2730|     24|			if (data_length < nlen)
  ------------------
  |  Branch (2730:8): [True: 2, False: 22]
  ------------------
 2731|      2|				return;
 2732|     22|			archive_strncat(&file->symlink,
 2733|     22|			    (const char *)data, nlen);
 2734|     22|			separator = "";
 2735|     22|			break;
 2736|     13|		case 0x02: /* Current dir. */
  ------------------
  |  Branch (2736:3): [True: 13, False: 84]
  ------------------
 2737|     13|			archive_strcat(&file->symlink, ".");
 2738|     13|			break;
 2739|      6|		case 0x04: /* Parent dir. */
  ------------------
  |  Branch (2739:3): [True: 6, False: 91]
  ------------------
 2740|      6|			archive_strcat(&file->symlink, "..");
 2741|      6|			break;
 2742|      1|		case 0x08: /* Root of filesystem. */
  ------------------
  |  Branch (2742:3): [True: 1, False: 96]
  ------------------
 2743|      1|			archive_strcat(&file->symlink, "/");
 2744|      1|			separator = "";
 2745|      1|			break;
 2746|      5|		case 0x10: /* Undefined (historically "volume root" */
  ------------------
  |  Branch (2746:3): [True: 5, False: 92]
  ------------------
 2747|      5|			archive_string_empty(&file->symlink);
  ------------------
  |  |  181|      5|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 2748|      5|			archive_strcat(&file->symlink, "ROOT");
 2749|      5|			break;
 2750|      6|		case 0x20: /* Undefined (historically "hostname") */
  ------------------
  |  Branch (2750:3): [True: 6, False: 91]
  ------------------
 2751|      6|			archive_strcat(&file->symlink, "hostname");
 2752|      6|			break;
 2753|      4|		default:
  ------------------
  |  Branch (2753:3): [True: 4, False: 93]
  ------------------
 2754|       |			/* TODO: issue a warning ? */
 2755|      4|			return;
 2756|     97|		}
 2757|     90|		data += nlen;
 2758|     90|		data_length -= nlen;
 2759|     90|	}
 2760|     20|}
archive_read_support_format_iso9660.c:parse_rockridge_TF1:
 2583|     49|{
 2584|     49|	char flag;
 2585|       |	/*
 2586|       |	 * TF extension comprises:
 2587|       |	 *   one byte flag
 2588|       |	 *   create time (optional)
 2589|       |	 *   modify time (optional)
 2590|       |	 *   access time (optional)
 2591|       |	 *   attribute time (optional)
 2592|       |	 *  Time format and presence of fields
 2593|       |	 *  is controlled by flag bits.
 2594|       |	 */
 2595|     49|	if (data_length < 1)
  ------------------
  |  Branch (2595:6): [True: 1, False: 48]
  ------------------
 2596|      1|		return;
 2597|     48|	flag = data[0];
 2598|     48|	++data;
 2599|     48|	--data_length;
 2600|     48|	if (flag & 0x80) {
  ------------------
  |  Branch (2600:6): [True: 31, False: 17]
  ------------------
 2601|       |		/* Use 17-byte time format. */
 2602|     31|		if ((flag & 1) && data_length >= 17) {
  ------------------
  |  Branch (2602:7): [True: 28, False: 3]
  |  Branch (2602:21): [True: 28, False: 0]
  ------------------
 2603|       |			/* Create time. */
 2604|     28|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2604:8): [True: 0, False: 28]
  ------------------
 2605|      0|				file->time_is_set |= BIRTHTIME_IS_SET;
  ------------------
  |  |  311|      0|#define BIRTHTIME_IS_SET 1
  ------------------
 2606|      0|				file->birthtime = isodate17(data);
 2607|      0|			}
 2608|     28|			data += 17;
 2609|     28|			data_length -= 17;
 2610|     28|		}
 2611|     31|		if ((flag & 2) && data_length >= 17) {
  ------------------
  |  Branch (2611:7): [True: 28, False: 3]
  |  Branch (2611:21): [True: 27, False: 1]
  ------------------
 2612|       |			/* Modify time. */
 2613|     27|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2613:8): [True: 1, False: 26]
  ------------------
 2614|      1|				file->time_is_set |= MTIME_IS_SET;
  ------------------
  |  |  312|      1|#define MTIME_IS_SET 2
  ------------------
 2615|      1|				file->mtime = isodate17(data);
 2616|      1|			}
 2617|     27|			data += 17;
 2618|     27|			data_length -= 17;
 2619|     27|		}
 2620|     31|		if ((flag & 4) && data_length >= 17) {
  ------------------
  |  Branch (2620:7): [True: 28, False: 3]
  |  Branch (2620:21): [True: 26, False: 2]
  ------------------
 2621|       |			/* Access time. */
 2622|     26|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2622:8): [True: 4, False: 22]
  ------------------
 2623|      4|				file->time_is_set |= ATIME_IS_SET;
  ------------------
  |  |  313|      4|#define ATIME_IS_SET 4
  ------------------
 2624|      4|				file->atime = isodate17(data);
 2625|      4|			}
 2626|     26|			data += 17;
 2627|     26|			data_length -= 17;
 2628|     26|		}
 2629|     31|		if ((flag & 8) && data_length >= 17) {
  ------------------
  |  Branch (2629:7): [True: 28, False: 3]
  |  Branch (2629:21): [True: 24, False: 4]
  ------------------
 2630|       |			/* Attribute change time. */
 2631|     24|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2631:8): [True: 2, False: 22]
  ------------------
 2632|      2|				file->time_is_set |= CTIME_IS_SET;
  ------------------
  |  |  314|      2|#define CTIME_IS_SET 8
  ------------------
 2633|      2|				file->ctime = isodate17(data);
 2634|      2|			}
 2635|     24|		}
 2636|     31|	} else {
 2637|       |		/* Use 7-byte time format. */
 2638|     17|		if ((flag & 1) && data_length >= 7) {
  ------------------
  |  Branch (2638:7): [True: 12, False: 5]
  |  Branch (2638:21): [True: 11, False: 1]
  ------------------
 2639|       |			/* Create time. */
 2640|     11|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2640:8): [True: 2, False: 9]
  ------------------
 2641|      2|				file->time_is_set |= BIRTHTIME_IS_SET;
  ------------------
  |  |  311|      2|#define BIRTHTIME_IS_SET 1
  ------------------
 2642|      2|				file->birthtime = isodate7(data);
 2643|      2|			}
 2644|     11|			data += 7;
 2645|     11|			data_length -= 7;
 2646|     11|		}
 2647|     17|		if ((flag & 2) && data_length >= 7) {
  ------------------
  |  Branch (2647:7): [True: 13, False: 4]
  |  Branch (2647:21): [True: 12, False: 1]
  ------------------
 2648|       |			/* Modify time. */
 2649|     12|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2649:8): [True: 4, False: 8]
  ------------------
 2650|      4|				file->time_is_set |= MTIME_IS_SET;
  ------------------
  |  |  312|      4|#define MTIME_IS_SET 2
  ------------------
 2651|      4|				file->mtime = isodate7(data);
 2652|      4|			}
 2653|     12|			data += 7;
 2654|     12|			data_length -= 7;
 2655|     12|		}
 2656|     17|		if ((flag & 4) && data_length >= 7) {
  ------------------
  |  Branch (2656:7): [True: 15, False: 2]
  |  Branch (2656:21): [True: 14, False: 1]
  ------------------
 2657|       |			/* Access time. */
 2658|     14|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2658:8): [True: 2, False: 12]
  ------------------
 2659|      2|				file->time_is_set |= ATIME_IS_SET;
  ------------------
  |  |  313|      2|#define ATIME_IS_SET 4
  ------------------
 2660|      2|				file->atime = isodate7(data);
 2661|      2|			}
 2662|     14|			data += 7;
 2663|     14|			data_length -= 7;
 2664|     14|		}
 2665|     17|		if ((flag & 8) && data_length >= 7) {
  ------------------
  |  Branch (2665:7): [True: 16, False: 1]
  |  Branch (2665:21): [True: 15, False: 1]
  ------------------
 2666|       |			/* Attribute change time. */
 2667|     15|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2667:8): [True: 2, False: 13]
  ------------------
 2668|      2|				file->time_is_set |= CTIME_IS_SET;
  ------------------
  |  |  314|      2|#define CTIME_IS_SET 8
  ------------------
 2669|      2|				file->ctime = isodate7(data);
 2670|      2|			}
 2671|     15|		}
 2672|     17|	}
 2673|     48|}
archive_read_support_format_iso9660.c:isodate17_valid:
 3354|    105|{
 3355|       |	/* First 16 bytes are all ASCII digits */
 3356|    935|	for (int i = 0; i < 16; i++) {
  ------------------
  |  Branch (3356:18): [True: 898, False: 37]
  ------------------
 3357|    898|		if (v[i] < '0' || v[i] > '9')
  ------------------
  |  Branch (3357:7): [True: 22, False: 876]
  |  Branch (3357:21): [True: 46, False: 830]
  ------------------
 3358|     68|			return 0;
 3359|    898|	}
 3360|       |
 3361|     37|	int year = (v[0] - '0') * 1000 + (v[1] - '0') * 100
 3362|     37|		+ (v[2] - '0') * 10 + (v[3] - '0');
 3363|     37|	int month = (v[4] - '0') * 10 + (v[5] - '0');
 3364|     37|	int day = (v[6] - '0') * 10 + (v[7] - '0');
 3365|     37|	int hour = (v[8] - '0') * 10 + (v[9] - '0');
 3366|     37|	int minute = (v[10] - '0') * 10 + (v[11] - '0');
 3367|     37|	int second = (v[12] - '0') * 10 + (v[13] - '0');
 3368|     37|	int hundredths = (v[14] - '0') * 10 + (v[15] - '0');
 3369|     37|	int gmt_off = (signed char)v[16];
 3370|       |
 3371|     37|	if (year == 0 && month == 0 && day == 0
  ------------------
  |  Branch (3371:6): [True: 10, False: 27]
  |  Branch (3371:19): [True: 8, False: 2]
  |  Branch (3371:33): [True: 8, False: 0]
  ------------------
 3372|      8|	    && hour == 0 && minute == 0 && second == 0
  ------------------
  |  Branch (3372:9): [True: 8, False: 0]
  |  Branch (3372:22): [True: 6, False: 2]
  |  Branch (3372:37): [True: 5, False: 1]
  ------------------
 3373|      5|	    && hundredths == 0 && gmt_off == 0)
  ------------------
  |  Branch (3373:9): [True: 4, False: 1]
  |  Branch (3373:28): [True: 1, False: 3]
  ------------------
 3374|      1|		return 0;
 3375|       |	/*
 3376|       |	 * Sanity-test each individual field
 3377|       |	 */
 3378|       |
 3379|       |	/* Year must be 1900-2300 */
 3380|       |	/* (Not specified in ECMA-119, but these seem
 3381|       |	   like reasonable limits. */
 3382|     36|	if (year < 1900 || year > 2300)
  ------------------
  |  Branch (3382:6): [True: 9, False: 27]
  |  Branch (3382:21): [True: 11, False: 16]
  ------------------
 3383|     20|		return 0;
 3384|       |	/* Month must be 1-12 */
 3385|     16|	if (month < 1 || month > 12)
  ------------------
  |  Branch (3385:6): [True: 0, False: 16]
  |  Branch (3385:19): [True: 1, False: 15]
  ------------------
 3386|      1|		return 0;
 3387|       |	/* Day must be 1-31 */
 3388|     15|	if (day < 1 || day > 31)
  ------------------
  |  Branch (3388:6): [True: 1, False: 14]
  |  Branch (3388:17): [True: 1, False: 13]
  ------------------
 3389|      2|		return 0;
 3390|       |	/* Hour must be 0-23 */
 3391|     13|	if (hour > 23)
  ------------------
  |  Branch (3391:6): [True: 4, False: 9]
  ------------------
 3392|      4|		return 0;
 3393|       |	/* Minute must be 0-59 */
 3394|      9|	if (minute > 59)
  ------------------
  |  Branch (3394:6): [True: 0, False: 9]
  ------------------
 3395|      0|		return 0;
 3396|       |	/* second must be 0-59 according to ECMA-119 9.1.5 */
 3397|       |	/* BUT: we should probably allow for the time being in UTC, which
 3398|       |	   allows up to 61 seconds in a minute in certain cases */
 3399|      9|	if (second > 61)
  ------------------
  |  Branch (3399:6): [True: 1, False: 8]
  ------------------
 3400|      1|		return 0;
 3401|       |	/* Hundredths must be 0-99 */
 3402|      8|	if (hundredths > 99)
  ------------------
  |  Branch (3402:6): [True: 0, False: 8]
  ------------------
 3403|      0|		return 0;
 3404|       |	/* Offset from GMT must be -48 to +52 */
 3405|      8|	if (gmt_off < -48 || gmt_off > +52)
  ------------------
  |  Branch (3405:6): [True: 0, False: 8]
  |  Branch (3405:23): [True: 1, False: 7]
  ------------------
 3406|      1|		return 0;
 3407|       |
 3408|       |	/* All tests pass, this is OK */
 3409|      7|	return 1;
 3410|       |
 3411|      8|}
archive_read_support_format_iso9660.c:isodate17:
 3415|      7|{
 3416|      7|	struct tm tm;
 3417|      7|	int offset;
 3418|      7|	time_t t;
 3419|       |
 3420|      7|	memset(&tm, 0, sizeof(tm));
 3421|      7|	tm.tm_year = (v[0] - '0') * 1000 + (v[1] - '0') * 100
 3422|      7|	    + (v[2] - '0') * 10 + (v[3] - '0')
 3423|      7|	    - 1900;
 3424|      7|	tm.tm_mon = (v[4] - '0') * 10 + (v[5] - '0') - 1;
 3425|      7|	tm.tm_mday = (v[6] - '0') * 10 + (v[7] - '0');
 3426|      7|	tm.tm_hour = (v[8] - '0') * 10 + (v[9] - '0');
 3427|      7|	tm.tm_min = (v[10] - '0') * 10 + (v[11] - '0');
 3428|      7|	tm.tm_sec = (v[12] - '0') * 10 + (v[13] - '0');
 3429|       |	/* v[16] is the signed timezone offset, in 1/4-hour increments. */
 3430|      7|	offset = ((const signed char *)v)[16];
 3431|      7|	if (offset > -48 && offset < 52) {
  ------------------
  |  Branch (3431:6): [True: 7, False: 0]
  |  Branch (3431:22): [True: 4, False: 3]
  ------------------
 3432|      4|		tm.tm_hour -= offset / 4;
 3433|      4|		tm.tm_min -= (offset % 4) * 15;
 3434|      4|	}
 3435|      7|	t = time_from_tm(&tm);
 3436|      7|	if (t == (time_t)-1)
  ------------------
  |  Branch (3436:6): [True: 0, False: 7]
  ------------------
 3437|      0|		return ((time_t)0);
 3438|      7|	return (t);
 3439|      7|}
archive_read_support_format_iso9660.c:parse_rockridge_ZF1:
 2765|      1|{
 2766|       |
 2767|      1|	if (data_length == 12 && data[0] == 0x70 && data[1] == 0x7a) {
  ------------------
  |  Branch (2767:6): [True: 0, False: 1]
  |  Branch (2767:27): [True: 0, False: 0]
  |  Branch (2767:46): [True: 0, False: 0]
  ------------------
 2768|       |        /* paged zlib */
 2769|      0|        file->pz = 1;
 2770|      0|        file->pz_log2_bs = data[3];
 2771|      0|        if (file->pz_log2_bs < 15 || file->pz_log2_bs > 17) {
  ------------------
  |  Branch (2771:13): [True: 0, False: 0]
  |  Branch (2771:38): [True: 0, False: 0]
  ------------------
 2772|       |            /* TODO: Return an error here instead of silently
 2773|       |             * disabling zisofs. That requires propagating an
 2774|       |             * error return through parse_rockridge() and its
 2775|       |             * callers. */
 2776|      0|            file->pz = 0;
 2777|      0|            return;
 2778|      0|        }
 2779|      0|        file->pz_uncompressed_size = archive_le32dec(&data[4]);
 2780|      0|    }
 2781|      1|}
archive_read_support_format_iso9660.c:register_file:
 2785|    952|{
 2786|       |
 2787|    952|	file->use_next = iso9660->use_files;
 2788|    952|	iso9660->use_files = file;
 2789|    952|}
archive_read_support_format_iso9660.c:heap_add_entry:
 3144|    871|{
 3145|    871|	uint64_t file_key, parent_key;
 3146|    871|	size_t hole, parent;
 3147|       |
 3148|       |	/* Reserve 16 bits for possible key collisions (needed for linked items) */
 3149|       |	/* For ISO files with more than 65535 entries, reordering will still occur */
 3150|    871|	key <<= 16;
 3151|    871|	key += heap->used & 0xFFFF;
 3152|       |
 3153|       |	/* Expand our pending files list as necessary. */
 3154|    871|	if (heap->used >= heap->allocated) {
  ------------------
  |  Branch (3154:6): [True: 173, False: 698]
  ------------------
 3155|    173|		struct file_info **new_pending_files;
 3156|    173|		size_t new_size;
 3157|       |
 3158|    173|		if (heap->allocated < 1024)
  ------------------
  |  Branch (3158:7): [True: 173, False: 0]
  ------------------
 3159|    173|			new_size = 1024;
 3160|      0|		else if (archive_ckd_mul_size(&new_size, heap->allocated, 2)) {
  ------------------
  |  Branch (3160:12): [True: 0, False: 0]
  ------------------
 3161|       |			/* Overflow keeps us from growing the list. */
 3162|      0|			archive_set_error(&a->archive,
 3163|      0|			    ENOMEM, "Out of memory");
 3164|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3165|      0|		}
 3166|    173|		new_pending_files = (struct file_info **)
 3167|    173|		    calloc(new_size, sizeof(new_pending_files[0]));
 3168|    173|		if (new_pending_files == NULL) {
  ------------------
  |  Branch (3168:7): [True: 0, False: 173]
  ------------------
 3169|      0|			archive_set_error(&a->archive,
 3170|      0|			    ENOMEM, "Out of memory");
 3171|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3172|      0|		}
 3173|    173|		if (heap->allocated)
  ------------------
  |  Branch (3173:7): [True: 0, False: 173]
  ------------------
 3174|      0|			memcpy(new_pending_files, heap->files,
 3175|      0|			    heap->allocated * sizeof(new_pending_files[0]));
 3176|    173|		free(heap->files);
 3177|    173|		heap->files = new_pending_files;
 3178|    173|		heap->allocated = new_size;
 3179|    173|	}
 3180|       |
 3181|    871|	file_key = file->key = key;
 3182|       |
 3183|       |	/*
 3184|       |	 * Start with hole at end, walk it up tree to find insertion point.
 3185|       |	 */
 3186|    871|	hole = heap->used++;
 3187|  1.26k|	while (hole > 0) {
  ------------------
  |  Branch (3187:9): [True: 914, False: 354]
  ------------------
 3188|    914|		parent = (hole - 1) / 2;
 3189|    914|		parent_key = heap->files[parent]->key;
 3190|    914|		if (file_key >= parent_key) {
  ------------------
  |  Branch (3190:7): [True: 517, False: 397]
  ------------------
 3191|    517|			heap->files[hole] = file;
 3192|    517|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    517|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3193|    517|		}
 3194|       |		/* Move parent into hole <==> move hole up tree. */
 3195|    397|		heap->files[hole] = heap->files[parent];
 3196|    397|		hole = parent;
 3197|    397|	}
 3198|    354|	heap->files[0] = file;
 3199|       |
 3200|    354|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    354|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3201|    871|}
archive_read_support_format_iso9660.c:next_entry_seek:
 2818|    853|{
 2819|    853|	struct file_info *file;
 2820|    853|	int r;
 2821|       |
 2822|    853|	r = next_cache_entry(a, iso9660, pfile);
 2823|    853|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    853|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2823:6): [True: 214, False: 639]
  ------------------
 2824|    214|		return (r);
 2825|    639|	file = *pfile;
 2826|       |
 2827|       |	/* Don't waste time seeking for zero-length bodies. */
 2828|    639|	if (file->size == 0)
  ------------------
  |  Branch (2828:6): [True: 240, False: 399]
  ------------------
 2829|    240|		file->offset = iso9660->current_position;
 2830|       |
 2831|       |	/* flush any remaining bytes from the last round to ensure
 2832|       |	 * we're positioned */
 2833|    639|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (2833:6): [True: 0, False: 639]
  ------------------
 2834|      0|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 2835|      0|		iso9660->entry_bytes_unconsumed = 0;
 2836|      0|	}
 2837|       |
 2838|       |	/* Seek forward to the start of the entry. */
 2839|    639|	if (iso9660->current_position < file->offset) {
  ------------------
  |  Branch (2839:6): [True: 29, False: 610]
  ------------------
 2840|     29|		int64_t step;
 2841|       |
 2842|     29|		step = file->offset - iso9660->current_position;
 2843|     29|		step = __archive_read_consume(a, step);
 2844|     29|		if (step < 0)
  ------------------
  |  Branch (2844:7): [True: 17, False: 12]
  ------------------
 2845|     17|			return ((int)step);
 2846|     12|		iso9660->current_position = file->offset;
 2847|     12|	}
 2848|       |
 2849|       |	/* We found body of file; handle it now. */
 2850|    622|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    622|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2851|    639|}
archive_read_support_format_iso9660.c:next_cache_entry:
 2856|    853|{
 2857|    853|	struct file_info *file;
 2858|    853|	struct {
 2859|    853|		struct file_info	*first;
 2860|    853|		struct file_info	**last;
 2861|    853|	}	empty_files;
 2862|    853|	int64_t number;
 2863|    853|	int count;
 2864|       |
 2865|    853|	file = cache_get_entry(iso9660);
 2866|    853|	if (file != NULL) {
  ------------------
  |  Branch (2866:6): [True: 251, False: 602]
  ------------------
 2867|    251|		*pfile = file;
 2868|    251|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    251|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2869|    251|	}
 2870|       |
 2871|    602|	for (;;) {
 2872|    602|		struct file_info *re, *d;
 2873|       |
 2874|    602|		*pfile = file = next_entry(iso9660);
  ------------------
  |  |  455|    602|	heap_get_entry(&((iso9660)->pending_files))
  ------------------
 2875|    602|		if (file == NULL) {
  ------------------
  |  Branch (2875:7): [True: 125, False: 477]
  ------------------
 2876|       |			/*
 2877|       |			 * If directory entries all which are descendant of
 2878|       |			 * rr_moved are still remaining, expose their.
 2879|       |			 */
 2880|    125|			if (iso9660->re_files.first != NULL &&
  ------------------
  |  Branch (2880:8): [True: 0, False: 125]
  ------------------
 2881|      0|			    iso9660->rr_moved != NULL &&
  ------------------
  |  Branch (2881:8): [True: 0, False: 0]
  ------------------
 2882|      0|			    iso9660->rr_moved->rr_moved_has_re_only)
  ------------------
  |  Branch (2882:8): [True: 0, False: 0]
  ------------------
 2883|       |				/* Expose "rr_moved" entry. */
 2884|      0|				cache_add_entry(iso9660, iso9660->rr_moved);
 2885|    125|			while ((re = re_get_entry(iso9660)) != NULL) {
  ------------------
  |  Branch (2885:11): [True: 0, False: 125]
  ------------------
 2886|       |				/* Expose its descendant dirs. */
 2887|      0|				while ((d = rede_get_entry(re)) != NULL)
  ------------------
  |  Branch (2887:12): [True: 0, False: 0]
  ------------------
 2888|      0|					cache_add_entry(iso9660, d);
 2889|      0|			}
 2890|    125|			if (iso9660->cache_files.first != NULL)
  ------------------
  |  Branch (2890:8): [True: 0, False: 125]
  ------------------
 2891|      0|				return (next_cache_entry(a, iso9660, pfile));
 2892|    125|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|    125|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2893|    125|		}
 2894|       |
 2895|    477|		if (file->cl_offset) {
  ------------------
  |  Branch (2895:7): [True: 0, False: 477]
  ------------------
 2896|      0|			struct file_info *first_re = NULL;
 2897|      0|			int nexted_re = 0;
 2898|       |
 2899|       |			/*
 2900|       |			 * Find "RE" dir for the current file, which
 2901|       |			 * has "CL" flag.
 2902|       |			 */
 2903|      0|			while ((re = re_get_entry(iso9660))
  ------------------
  |  Branch (2903:11): [True: 0, False: 0]
  ------------------
 2904|      0|			    != first_re) {
 2905|      0|				if (first_re == NULL)
  ------------------
  |  Branch (2905:9): [True: 0, False: 0]
  ------------------
 2906|      0|					first_re = re;
 2907|      0|				if (re->offset == file->cl_offset) {
  ------------------
  |  Branch (2907:9): [True: 0, False: 0]
  ------------------
 2908|      0|					re->parent->subdirs--;
 2909|      0|					re->parent = file->parent;
 2910|      0|					re->re = 0;
 2911|      0|					if (re->parent->re_descendant) {
  ------------------
  |  Branch (2911:10): [True: 0, False: 0]
  ------------------
 2912|      0|						nexted_re = 1;
 2913|      0|						re->re_descendant = 1;
 2914|      0|						if (rede_add_entry(re) < 0)
  ------------------
  |  Branch (2914:11): [True: 0, False: 0]
  ------------------
 2915|      0|							goto fatal_rr;
 2916|       |						/* Move a list of descendants
 2917|       |						 * to a new ancestor. */
 2918|      0|						while ((d = rede_get_entry(
  ------------------
  |  Branch (2918:14): [True: 0, False: 0]
  ------------------
 2919|      0|						    re)) != NULL)
 2920|      0|							if (rede_add_entry(d)
  ------------------
  |  Branch (2920:12): [True: 0, False: 0]
  ------------------
 2921|      0|							    < 0)
 2922|      0|								goto fatal_rr;
 2923|      0|						break;
 2924|      0|					}
 2925|       |					/* Replace the current file
 2926|       |					 * with "RE" dir */
 2927|      0|					*pfile = file = re;
 2928|       |					/* Expose its descendant */
 2929|      0|					while ((d = rede_get_entry(
  ------------------
  |  Branch (2929:13): [True: 0, False: 0]
  ------------------
 2930|      0|					    file)) != NULL)
 2931|      0|						cache_add_entry(
 2932|      0|						    iso9660, d);
 2933|      0|					break;
 2934|      0|				} else
 2935|      0|					re_add_entry(iso9660, re);
 2936|      0|			}
 2937|      0|			if (nexted_re) {
  ------------------
  |  Branch (2937:8): [True: 0, False: 0]
  ------------------
 2938|       |				/*
 2939|       |				 * Do not expose this at this time
 2940|       |				 * because we have not gotten its full-path
 2941|       |				 * name yet.
 2942|       |				 */
 2943|      0|				continue;
 2944|      0|			}
 2945|    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 (2945:14): [True: 215, False: 262]
  ------------------
 2946|    215|			int r;
 2947|       |
 2948|       |			/* Read file entries in this dir. */
 2949|    215|			r = read_children(a, file);
 2950|    215|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    215|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2950:8): [True: 89, False: 126]
  ------------------
 2951|     89|				return (r);
 2952|       |
 2953|       |			/*
 2954|       |			 * Handle a special dir of Rockridge extensions,
 2955|       |			 * "rr_moved".
 2956|       |			 */
 2957|    126|			if (file->rr_moved) {
  ------------------
  |  Branch (2957:8): [True: 0, False: 126]
  ------------------
 2958|       |				/*
 2959|       |				 * If this has only the subdirectories which
 2960|       |				 * have "RE" flags, do not expose at this time.
 2961|       |				 */
 2962|      0|				if (file->rr_moved_has_re_only)
  ------------------
  |  Branch (2962:9): [True: 0, False: 0]
  ------------------
 2963|      0|					continue;
 2964|       |				/* Otherwise expose "rr_moved" entry. */
 2965|    126|			} else if (file->re) {
  ------------------
  |  Branch (2965:15): [True: 0, False: 126]
  ------------------
 2966|       |				/*
 2967|       |				 * Do not expose this at this time
 2968|       |				 * because we have not gotten its full-path
 2969|       |				 * name yet.
 2970|       |				 */
 2971|      0|				re_add_entry(iso9660, file);
 2972|      0|				continue;
 2973|    126|			} else if (file->re_descendant) {
  ------------------
  |  Branch (2973:15): [True: 0, False: 126]
  ------------------
 2974|       |				/*
 2975|       |				 * If the top level "RE" entry of this entry
 2976|       |				 * is not exposed, we, accordingly, should not
 2977|       |				 * expose this entry at this time because
 2978|       |				 * we cannot make its proper full-path name.
 2979|       |				 */
 2980|      0|				if (rede_add_entry(file) == 0)
  ------------------
  |  Branch (2980:9): [True: 0, False: 0]
  ------------------
 2981|      0|					continue;
 2982|       |				/* Otherwise we can expose this entry because
 2983|       |				 * it seems its top level "RE" has already been
 2984|       |				 * exposed. */
 2985|      0|			}
 2986|    126|		}
 2987|    388|		break;
 2988|    477|	}
 2989|       |
 2990|    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 (2990:6): [True: 126, False: 262]
  |  Branch (2990:44): [True: 33, False: 229]
  ------------------
 2991|    159|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    159|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2992|       |
 2993|    229|	count = 0;
 2994|    229|	number = file->number;
 2995|    229|	iso9660->cache_files.first = NULL;
 2996|    229|	iso9660->cache_files.last = &(iso9660->cache_files.first);
 2997|    229|	empty_files.first = NULL;
 2998|    229|	empty_files.last = &empty_files.first;
 2999|       |	/* Collect files which has the same file serial number.
 3000|       |	 * Peek pending_files so that file which number is different
 3001|       |	 * is not put back. */
 3002|    510|	while (iso9660->pending_files.used > 0 &&
  ------------------
  |  Branch (3002:9): [True: 385, False: 125]
  ------------------
 3003|    385|	    (iso9660->pending_files.files[0]->number == -1 ||
  ------------------
  |  Branch (3003:7): [True: 116, False: 269]
  ------------------
 3004|    281|	     iso9660->pending_files.files[0]->number == number)) {
  ------------------
  |  Branch (3004:7): [True: 165, False: 104]
  ------------------
 3005|    281|		if (file->number == -1) {
  ------------------
  |  Branch (3005:7): [True: 84, False: 197]
  ------------------
 3006|       |			/* This file has the same offset
 3007|       |			 * but it's wrong offset which empty files
 3008|       |			 * and symlink files have.
 3009|       |			 * NOTE: This wrong offset was recorded by
 3010|       |			 * old mkisofs utility. If ISO images is
 3011|       |			 * created by latest mkisofs, this does not
 3012|       |			 * happen.
 3013|       |			 */
 3014|     84|			file->next = NULL;
 3015|     84|			*empty_files.last = file;
 3016|     84|			empty_files.last = &(file->next);
 3017|    197|		} else {
 3018|    197|			count++;
 3019|    197|			cache_add_entry(iso9660, file);
 3020|    197|		}
 3021|    281|		file = next_entry(iso9660);
  ------------------
  |  |  455|    281|	heap_get_entry(&((iso9660)->pending_files))
  ------------------
 3022|    281|	}
 3023|       |
 3024|    229|	if (count == 0) {
  ------------------
  |  Branch (3024:6): [True: 132, False: 97]
  ------------------
 3025|    132|		*pfile = file;
 3026|    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 (3026:11): [True: 0, False: 132]
  ------------------
 3027|    132|	}
 3028|     97|	if (file->number == -1) {
  ------------------
  |  Branch (3028:6): [True: 32, False: 65]
  ------------------
 3029|     32|		file->next = NULL;
 3030|     32|		*empty_files.last = file;
 3031|     32|		empty_files.last = &(file->next);
 3032|     65|	} else {
 3033|     65|		count++;
 3034|     65|		cache_add_entry(iso9660, file);
 3035|     65|	}
 3036|       |
 3037|     97|	if (count > 1) {
  ------------------
  |  Branch (3037:6): [True: 75, False: 22]
  ------------------
 3038|       |		/* The count is the same as number of hardlink,
 3039|       |		 * so much so that each nlinks of files in cache_file
 3040|       |		 * is overwritten by value of the count.
 3041|       |		 */
 3042|     75|		for (file = iso9660->cache_files.first;
 3043|    315|		    file != NULL; file = file->next)
  ------------------
  |  Branch (3043:7): [True: 240, False: 75]
  ------------------
 3044|    240|			file->nlinks = count;
 3045|     75|	}
 3046|       |	/* If there are empty files, that files are added
 3047|       |	 * to the tail of the cache_files. */
 3048|     97|	if (empty_files.first != NULL) {
  ------------------
  |  Branch (3048:6): [True: 32, False: 65]
  ------------------
 3049|     32|		*iso9660->cache_files.last = empty_files.first;
 3050|     32|		iso9660->cache_files.last = empty_files.last;
 3051|     32|	}
 3052|     97|	*pfile = cache_get_entry(iso9660);
 3053|     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 (3053:10): [True: 0, False: 97]
  ------------------
 3054|       |
 3055|      0|fatal_rr:
 3056|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3057|      0|	    "Failed to connect 'CL' pointer to 'RE' rr_moved pointer of "
 3058|      0|	    "Rockridge extensions: current position = %jd, CL offset = %jd",
 3059|      0|	    (intmax_t)iso9660->current_position, (intmax_t)file->cl_offset);
 3060|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3061|    229|}
archive_read_support_format_iso9660.c:cache_get_entry:
 3129|    950|{
 3130|    950|	struct file_info *file;
 3131|       |
 3132|    950|	if ((file = iso9660->cache_files.first) != NULL) {
  ------------------
  |  Branch (3132:6): [True: 348, False: 602]
  ------------------
 3133|    348|		iso9660->cache_files.first = file->next;
 3134|    348|		if (iso9660->cache_files.first == NULL)
  ------------------
  |  Branch (3134:7): [True: 81, False: 267]
  ------------------
 3135|     81|			iso9660->cache_files.last =
 3136|     81|			    &(iso9660->cache_files.first);
 3137|    348|	}
 3138|    950|	return (file);
 3139|    950|}
archive_read_support_format_iso9660.c:heap_get_entry:
 3205|    883|{
 3206|    883|	uint64_t a_key, b_key, c_key;
 3207|    883|	size_t a, b, c;
 3208|    883|	struct file_info *r, *tmp;
 3209|       |
 3210|    883|	if (heap->used < 1)
  ------------------
  |  Branch (3210:6): [True: 125, False: 758]
  ------------------
 3211|    125|		return (NULL);
 3212|       |
 3213|       |	/*
 3214|       |	 * The first file in the list is the earliest; we'll return this.
 3215|       |	 */
 3216|    758|	r = heap->files[0];
 3217|       |
 3218|       |	/*
 3219|       |	 * Move the last item in the heap to the root of the tree
 3220|       |	 */
 3221|    758|	heap->files[0] = heap->files[--(heap->used)];
 3222|       |
 3223|       |	/*
 3224|       |	 * Rebalance the heap.
 3225|       |	 */
 3226|    758|	a = 0; /* Starting element and its heap key */
 3227|    758|	a_key = heap->files[a]->key;
 3228|  1.53k|	for (;;) {
 3229|  1.53k|		b = a + a + 1; /* First child */
 3230|  1.53k|		if (b >= heap->used)
  ------------------
  |  Branch (3230:7): [True: 648, False: 888]
  ------------------
 3231|    648|			return (r);
 3232|    888|		b_key = heap->files[b]->key;
 3233|    888|		c = b + 1; /* Use second child if it is smaller. */
 3234|    888|		if (c < heap->used) {
  ------------------
  |  Branch (3234:7): [True: 736, False: 152]
  ------------------
 3235|    736|			c_key = heap->files[c]->key;
 3236|    736|			if (c_key < b_key) {
  ------------------
  |  Branch (3236:8): [True: 297, False: 439]
  ------------------
 3237|    297|				b = c;
 3238|    297|				b_key = c_key;
 3239|    297|			}
 3240|    736|		}
 3241|    888|		if (a_key <= b_key)
  ------------------
  |  Branch (3241:7): [True: 110, False: 778]
  ------------------
 3242|    110|			return (r);
 3243|    778|		tmp = heap->files[a];
 3244|    778|		heap->files[a] = heap->files[b];
 3245|    778|		heap->files[b] = tmp;
 3246|    778|		a = b;
 3247|    778|	}
 3248|    758|}
archive_read_support_format_iso9660.c:cache_add_entry:
 3121|    262|{
 3122|       |	file->next = NULL;
 3123|    262|	*iso9660->cache_files.last = file;
 3124|    262|	iso9660->cache_files.last = &(file->next);
 3125|    262|}
archive_read_support_format_iso9660.c:re_get_entry:
 3073|    125|{
 3074|    125|	struct file_info *file;
 3075|       |
 3076|    125|	if ((file = iso9660->re_files.first) != NULL) {
  ------------------
  |  Branch (3076:6): [True: 0, False: 125]
  ------------------
 3077|      0|		iso9660->re_files.first = file->re_next;
 3078|      0|		if (iso9660->re_files.first == NULL)
  ------------------
  |  Branch (3078:7): [True: 0, False: 0]
  ------------------
 3079|      0|			iso9660->re_files.last =
 3080|      0|			    &(iso9660->re_files.first);
 3081|      0|	}
 3082|    125|	return (file);
 3083|    125|}
archive_read_support_format_iso9660.c:read_children:
 1037|    215|{
 1038|    215|	struct iso9660 *iso9660;
 1039|    215|	const unsigned char *b, *p;
 1040|    215|	struct file_info *multi;
 1041|    215|	size_t step, skip_size;
 1042|       |
 1043|    215|	iso9660 = (struct iso9660 *)(a->format->data);
 1044|       |	/* flush any remaining bytes from the last round to ensure
 1045|       |	 * we're positioned */
 1046|    215|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (1046:6): [True: 0, False: 215]
  ------------------
 1047|      0|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 1048|      0|		iso9660->entry_bytes_unconsumed = 0;
 1049|      0|	}
 1050|    215|	if (iso9660->current_position > parent->offset) {
  ------------------
  |  Branch (1050:6): [True: 31, False: 184]
  ------------------
 1051|     31|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     31|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1052|     31|		    "Ignoring out-of-order directory (%s) %jd > %jd",
 1053|     31|		    parent->name.s,
 1054|     31|		    (intmax_t)iso9660->current_position,
 1055|     31|		    (intmax_t)parent->offset);
 1056|     31|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|     31|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1057|     31|	}
 1058|    184|	if (parent->offset + parent->size > iso9660->volume_size) {
  ------------------
  |  Branch (1058:6): [True: 36, False: 148]
  ------------------
 1059|     36|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     36|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1060|     36|		    "Directory is beyond end-of-media: %s",
 1061|     36|		    parent->name.s);
 1062|     36|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|     36|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1063|     36|	}
 1064|    148|	if (iso9660->current_position < parent->offset) {
  ------------------
  |  Branch (1064:6): [True: 61, False: 87]
  ------------------
 1065|     61|		int64_t skipsize;
 1066|       |
 1067|     61|		skipsize = parent->offset - iso9660->current_position;
 1068|     61|		skipsize = __archive_read_consume(a, skipsize);
 1069|     61|		if (skipsize < 0)
  ------------------
  |  Branch (1069:7): [True: 2, False: 59]
  ------------------
 1070|      2|			return ((int)skipsize);
 1071|     59|		iso9660->current_position = parent->offset;
 1072|     59|	}
 1073|       |
 1074|    146|	step = (size_t)(((parent->size + iso9660->logical_block_size -1) /
 1075|    146|	    iso9660->logical_block_size) * iso9660->logical_block_size);
 1076|    146|	b = __archive_read_ahead(a, step, NULL);
 1077|    146|	if (b == NULL) {
  ------------------
  |  Branch (1077:6): [True: 3, False: 143]
  ------------------
 1078|      3|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1079|      3|		    "Failed to read full block when scanning "
 1080|      3|		    "ISO9660 directory list");
 1081|      3|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1082|      3|	}
 1083|    143|	iso9660->current_position += step;
 1084|    143|	multi = NULL;
 1085|    143|	skip_size = step;
 1086|    520|	while (step) {
  ------------------
  |  Branch (1086:9): [True: 394, False: 126]
  ------------------
 1087|    394|		p = b;
 1088|    394|		b += iso9660->logical_block_size;
 1089|    394|		step -= iso9660->logical_block_size;
 1090|   292k|		for (; p < b && b - p > DR_name_offset && *p != 0 && *p <= b - p;
  ------------------
  |  |  216|   584k|#define DR_name_offset 33
  ------------------
  |  Branch (1090:10): [True: 292k, False: 0]
  |  Branch (1090:19): [True: 292k, False: 144]
  |  Branch (1090:45): [True: 291k, False: 233]
  |  Branch (1090:56): [True: 291k, False: 0]
  ------------------
 1091|   291k|			p += *p) {
 1092|   291k|			struct file_info *child;
 1093|       |
 1094|       |			/* N.B.: these special directory identifiers
 1095|       |			 * are 8 bit "values" even on a
 1096|       |			 * Joliet CD with UCS-2 (16bit) encoding.
 1097|       |			 */
 1098|       |
 1099|       |			/* Skip '.' entry. */
 1100|   291k|			if (*(p + DR_name_len_offset) == 1
  ------------------
  |  |  214|   291k|#define DR_name_len_offset 32
  ------------------
  |  Branch (1100:8): [True: 291k, False: 686]
  ------------------
 1101|   291k|			    && *(p + DR_name_offset) == '\0')
  ------------------
  |  |  216|   291k|#define DR_name_offset 33
  ------------------
  |  Branch (1101:11): [True: 90, False: 291k]
  ------------------
 1102|     90|				continue;
 1103|       |			/* Skip '..' entry. */
 1104|   291k|			if (*(p + DR_name_len_offset) == 1
  ------------------
  |  |  214|   291k|#define DR_name_len_offset 32
  ------------------
  |  Branch (1104:8): [True: 291k, False: 686]
  ------------------
 1105|   291k|			    && *(p + DR_name_offset) == '\001')
  ------------------
  |  |  216|   291k|#define DR_name_offset 33
  ------------------
  |  Branch (1105:11): [True: 291k, False: 97]
  ------------------
 1106|   291k|				continue;
 1107|    783|			child = parse_file_info(a, parent, p, b - p);
 1108|    783|			if (child == NULL) {
  ------------------
  |  Branch (1108:8): [True: 17, False: 766]
  ------------------
 1109|     17|				__archive_read_consume(a, skip_size);
 1110|     17|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     17|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1111|     17|			}
 1112|    766|			if (child->cl_offset == 0 &&
  ------------------
  |  Branch (1112:8): [True: 766, False: 0]
  ------------------
 1113|    766|			    (child->multi_extent || multi != NULL)) {
  ------------------
  |  Branch (1113:9): [True: 90, False: 676]
  |  Branch (1113:32): [True: 37, False: 639]
  ------------------
 1114|    127|				struct content *con;
 1115|       |
 1116|    127|				if (multi == NULL) {
  ------------------
  |  Branch (1116:9): [True: 59, False: 68]
  ------------------
 1117|     59|					multi = child;
 1118|     59|					multi->contents.first = NULL;
 1119|     59|					multi->contents.last =
 1120|     59|					    &(multi->contents.first);
 1121|     59|				}
 1122|    127|				con = malloc(sizeof(struct content));
 1123|    127|				if (con == NULL) {
  ------------------
  |  Branch (1123:9): [True: 0, False: 127]
  ------------------
 1124|      0|					archive_set_error(
 1125|      0|					    &a->archive, ENOMEM,
 1126|      0|					    "No memory for multi extent");
 1127|      0|					__archive_read_consume(a, skip_size);
 1128|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1129|      0|				}
 1130|    127|				con->offset = child->offset;
 1131|    127|				con->size = child->size;
 1132|    127|				con->next = NULL;
 1133|    127|				*multi->contents.last = con;
 1134|    127|				multi->contents.last = &(con->next);
 1135|    127|				if (multi == child) {
  ------------------
  |  Branch (1135:9): [True: 59, False: 68]
  ------------------
 1136|     59|					if (add_entry(a, iso9660, child)
  ------------------
  |  |  453|     59|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
  |  Branch (1136:10): [True: 0, False: 59]
  ------------------
 1137|     59|					    != ARCHIVE_OK)
  ------------------
  |  |  233|     59|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1138|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1139|     68|				} else {
 1140|     68|					multi->size += child->size;
 1141|     68|					if (!child->multi_extent)
  ------------------
  |  Branch (1141:10): [True: 37, False: 31]
  ------------------
 1142|     37|						multi = NULL;
 1143|     68|				}
 1144|    127|			} else
 1145|    639|				if (add_entry(a, iso9660, child) != ARCHIVE_OK)
  ------------------
  |  |  453|    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 (1145:9): [True: 0, False: 639]
  ------------------
 1146|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1147|    766|		}
 1148|    394|	}
 1149|       |
 1150|    126|	__archive_read_consume(a, skip_size);
 1151|       |
 1152|       |	/* Read data which recorded by RRIP "CE" extension. */
 1153|    126|	if (read_CE(a, iso9660) != ARCHIVE_OK)
  ------------------
  |  |  233|    126|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1153:6): [True: 0, False: 126]
  ------------------
 1154|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1155|       |
 1156|    126|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    126|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1157|    126|}
archive_read_support_format_iso9660.c:read_CE:
 2481|    126|{
 2482|    126|	struct read_ce_queue *heap;
 2483|    126|	const unsigned char *b, *p, *end;
 2484|    126|	struct file_info *file;
 2485|    126|	size_t step;
 2486|    126|	uint64_t ce_start, ce_end;
 2487|    126|	int r;
 2488|       |
 2489|       |	/* Read data which RRIP "CE" extension points. */
 2490|    126|	heap = &(iso9660->read_ce_req);
 2491|    126|	step = iso9660->logical_block_size;
 2492|    126|	while (heap->cnt &&
  ------------------
  |  Branch (2492:9): [True: 0, False: 126]
  ------------------
 2493|      0|	    heap->reqs[0].offset == iso9660->current_position) {
  ------------------
  |  Branch (2493:6): [True: 0, False: 0]
  ------------------
 2494|      0|		b = __archive_read_ahead(a, step, NULL);
 2495|      0|		if (b == NULL) {
  ------------------
  |  Branch (2495:7): [True: 0, False: 0]
  ------------------
 2496|      0|			archive_set_error(&a->archive,
 2497|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2498|      0|			    "Failed to read full block when scanning "
 2499|      0|			    "ISO9660 directory list");
 2500|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2501|      0|		}
 2502|      0|		do {
 2503|      0|			file = heap->reqs[0].file;
 2504|      0|			if (file->ce_offset + file->ce_size > step) {
  ------------------
  |  Branch (2504:8): [True: 0, False: 0]
  ------------------
 2505|      0|				archive_set_error(&a->archive,
 2506|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2507|      0|				    "Malformed CE information");
 2508|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2509|      0|			}
 2510|      0|			ce_start = heap->reqs[0].offset + file->ce_offset;
 2511|      0|			ce_end = ce_start + file->ce_size;
 2512|      0|			if (ce_start < file->ce_processed_end) {
  ------------------
  |  Branch (2512:8): [True: 0, False: 0]
  ------------------
 2513|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2514|      0|				    "Invalid parameter in SUSP \"CE\" extension");
 2515|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2516|      0|			}
 2517|      0|			p = b + file->ce_offset;
 2518|      0|			end = p + file->ce_size;
 2519|      0|			file->ce_processed_end = ce_end;
 2520|      0|			next_CE(heap);
 2521|      0|			r = parse_rockridge(a, file, p, end);
 2522|      0|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2522:8): [True: 0, False: 0]
  ------------------
 2523|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2524|      0|		} while (heap->cnt &&
  ------------------
  |  Branch (2524:12): [True: 0, False: 0]
  ------------------
 2525|      0|		    heap->reqs[0].offset == iso9660->current_position);
  ------------------
  |  Branch (2525:7): [True: 0, False: 0]
  ------------------
 2526|       |		/* NOTE: Do not move this consume's code to front of
 2527|       |		 * do-while loop. Registration of nested CE extension
 2528|       |		 * might cause error because of current position. */
 2529|      0|		__archive_read_consume(a, step);
 2530|      0|		iso9660->current_position += step;
 2531|      0|	}
 2532|    126|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    126|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2533|    126|}
archive_read_support_format_iso9660.c:build_pathname_utf16be:
 3490|     12|{
 3491|     12|	if (file->parent != NULL && file->parent->utf16be_bytes > 0) {
  ------------------
  |  Branch (3491:6): [True: 6, False: 6]
  |  Branch (3491:30): [True: 0, False: 6]
  ------------------
 3492|      0|		if (build_pathname_utf16be(p, max, len, file->parent) != 0)
  ------------------
  |  Branch (3492:7): [True: 0, False: 0]
  ------------------
 3493|      0|			return (-1);
 3494|      0|		if (*len + 2 > max)
  ------------------
  |  Branch (3494:7): [True: 0, False: 0]
  ------------------
 3495|      0|			return (-1);/* Path is too long! */
 3496|      0|		p[*len] = 0;
 3497|      0|		p[*len + 1] = '/';
 3498|      0|		*len += 2;
 3499|      0|	}
 3500|     12|	if (file->utf16be_bytes == 0) {
  ------------------
  |  Branch (3500:6): [True: 7, False: 5]
  ------------------
 3501|      7|		if (*len + 2 > max)
  ------------------
  |  Branch (3501:7): [True: 0, False: 7]
  ------------------
 3502|      0|			return (-1);/* Path is too long! */
 3503|      7|		p[*len] = 0;
 3504|      7|		p[*len + 1] = '.';
 3505|      7|		*len += 2;
 3506|      7|	} else {
 3507|      5|		if (*len + file->utf16be_bytes > max)
  ------------------
  |  Branch (3507:7): [True: 0, False: 5]
  ------------------
 3508|      0|			return (-1);/* Path is too long! */
 3509|      5|		memcpy(p + *len, file->utf16be_name, file->utf16be_bytes);
 3510|      5|		*len += file->utf16be_bytes;
 3511|      5|	}
 3512|     12|	return (0);
 3513|     12|}
archive_read_support_format_iso9660.c:build_pathname:
 3468|    752|{
 3469|       |	// Plain ISO9660 only allows 8 dir levels; if we get
 3470|       |	// to 1000, then something is very, very wrong.
 3471|    752|	if (depth > 1000) {
  ------------------
  |  Branch (3471:6): [True: 0, False: 752]
  ------------------
 3472|      0|		return NULL;
 3473|      0|	}
 3474|    752|	if (file->parent != NULL && archive_strlen(&file->parent->name) > 0) {
  ------------------
  |  |  178|    571|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (3474:6): [True: 571, False: 181]
  |  Branch (3474:30): [True: 142, False: 429]
  ------------------
 3475|    142|		if (build_pathname(as, file->parent, depth + 1) == NULL) {
  ------------------
  |  Branch (3475:7): [True: 0, False: 142]
  ------------------
 3476|      0|			return NULL;
 3477|      0|		}
 3478|    142|		archive_strcat(as, "/");
 3479|    142|	}
 3480|    752|	if (archive_strlen(&file->name) == 0)
  ------------------
  |  |  178|    752|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (3480:6): [True: 70, False: 682]
  ------------------
 3481|     70|		archive_strcat(as, ".");
 3482|    682|	else
 3483|    682|		archive_string_concat(as, &file->name);
 3484|    752|	return (as->s);
 3485|    752|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_data_skip:
 1490|    680|{
 1491|       |	/* Because read_next_header always does an explicit skip
 1492|       |	 * to the next entry, we don't need to do anything here. */
 1493|    680|	(void)a; /* UNUSED */
 1494|    680|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    680|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1495|    680|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_data:
 1741|    877|{
 1742|    877|	ssize_t bytes_read;
 1743|    877|	struct iso9660 *iso9660;
 1744|       |
 1745|    877|	iso9660 = (struct iso9660 *)(a->format->data);
 1746|       |
 1747|    877|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (1747:6): [True: 91, False: 786]
  ------------------
 1748|     91|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 1749|     91|		iso9660->entry_bytes_unconsumed = 0;
 1750|     91|	}
 1751|       |
 1752|    877|	if (iso9660->entry_bytes_remaining <= 0) {
  ------------------
  |  Branch (1752:6): [True: 782, False: 95]
  ------------------
 1753|    782|		if (iso9660->entry_content != NULL)
  ------------------
  |  Branch (1753:7): [True: 15, False: 767]
  ------------------
 1754|     15|			iso9660->entry_content = iso9660->entry_content->next;
 1755|    782|		if (iso9660->entry_content == NULL) {
  ------------------
  |  Branch (1755:7): [True: 773, False: 9]
  ------------------
 1756|    773|			*buff = NULL;
 1757|    773|			*size = 0;
 1758|    773|			*offset = iso9660->entry_sparse_offset;
 1759|    773|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|    773|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1760|    773|		}
 1761|       |		/* Seek forward to the start of the entry. */
 1762|      9|		if (iso9660->current_position < iso9660->entry_content->offset) {
  ------------------
  |  Branch (1762:7): [True: 5, False: 4]
  ------------------
 1763|      5|			int64_t step;
 1764|       |
 1765|      5|			step = iso9660->entry_content->offset -
 1766|      5|			    iso9660->current_position;
 1767|      5|			step = __archive_read_consume(a, step);
 1768|      5|			if (step < 0)
  ------------------
  |  Branch (1768:8): [True: 2, False: 3]
  ------------------
 1769|      2|				return ((int)step);
 1770|      3|			iso9660->current_position =
 1771|      3|			    iso9660->entry_content->offset;
 1772|      3|		}
 1773|      7|		if (iso9660->entry_content->offset < iso9660->current_position) {
  ------------------
  |  Branch (1773:7): [True: 4, False: 3]
  ------------------
 1774|      4|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1775|      4|			    "Ignoring out-of-order file (%s) %jd < %jd",
 1776|      4|			    iso9660->pathname.s,
 1777|      4|			    (intmax_t)iso9660->entry_content->offset,
 1778|      4|			    (intmax_t)iso9660->current_position);
 1779|      4|			*buff = NULL;
 1780|      4|			*size = 0;
 1781|      4|			*offset = iso9660->entry_sparse_offset;
 1782|      4|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      4|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1783|      4|		}
 1784|      3|		iso9660->entry_bytes_remaining = iso9660->entry_content->size;
 1785|      3|	}
 1786|     98|	if (iso9660->entry_zisofs.pz)
  ------------------
  |  Branch (1786:6): [True: 0, False: 98]
  ------------------
 1787|      0|		return (zisofs_read_data(a, buff, size, offset));
 1788|       |
 1789|     98|	*buff = __archive_read_ahead(a, 1, &bytes_read);
 1790|     98|	if (bytes_read == 0)
  ------------------
  |  Branch (1790:6): [True: 7, False: 91]
  ------------------
 1791|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      7|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1792|      7|		    "Truncated input file");
 1793|     98|	if (*buff == NULL)
  ------------------
  |  Branch (1793:6): [True: 7, False: 91]
  ------------------
 1794|      7|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1795|     91|	if (bytes_read > iso9660->entry_bytes_remaining)
  ------------------
  |  Branch (1795:6): [True: 84, False: 7]
  ------------------
 1796|     84|		bytes_read = (ssize_t)iso9660->entry_bytes_remaining;
 1797|     91|	*size = bytes_read;
 1798|     91|	*offset = iso9660->entry_sparse_offset;
 1799|     91|	iso9660->entry_sparse_offset += bytes_read;
 1800|     91|	iso9660->entry_bytes_remaining -= bytes_read;
 1801|     91|	iso9660->entry_bytes_unconsumed = bytes_read;
 1802|     91|	iso9660->current_position += bytes_read;
 1803|     91|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     91|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1804|     98|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_cleanup:
 1808|  2.49k|{
 1809|  2.49k|	struct iso9660 *iso9660;
 1810|  2.49k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1811|       |
 1812|  2.49k|	iso9660 = (struct iso9660 *)(a->format->data);
 1813|  2.49k|	release_files(iso9660);
 1814|  2.49k|	free(iso9660->read_ce_req.reqs);
 1815|  2.49k|	archive_string_free(&iso9660->pathname);
 1816|  2.49k|	archive_string_free(&iso9660->previous_pathname);
 1817|  2.49k|	free(iso9660->pending_files.files);
 1818|  2.49k|#ifdef HAVE_ZLIB_H
 1819|  2.49k|	free(iso9660->entry_zisofs.uncompressed_buffer);
 1820|  2.49k|	free(iso9660->entry_zisofs.block_pointers);
 1821|  2.49k|	if (iso9660->entry_zisofs.stream_valid) {
  ------------------
  |  Branch (1821:6): [True: 0, False: 2.49k]
  ------------------
 1822|      0|		if (inflateEnd(&iso9660->entry_zisofs.stream) != Z_OK) {
  ------------------
  |  Branch (1822:7): [True: 0, False: 0]
  ------------------
 1823|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1824|      0|			    "Failed to clean up zlib decompressor");
 1825|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1826|      0|		}
 1827|      0|	}
 1828|  2.49k|#endif
 1829|  2.49k|	free(iso9660->utf16be_path);
 1830|  2.49k|	free(iso9660->utf16be_previous_path);
 1831|  2.49k|	free(iso9660);
 1832|       |	(a->format->data) = NULL;
 1833|  2.49k|	return (r);
 1834|  2.49k|}
archive_read_support_format_iso9660.c:release_files:
 2793|  2.49k|{
 2794|  2.49k|	struct content *con, *connext;
 2795|  2.49k|	struct file_info *file;
 2796|       |
 2797|  2.49k|	file = iso9660->use_files;
 2798|  3.45k|	while (file != NULL) {
  ------------------
  |  Branch (2798:9): [True: 952, False: 2.49k]
  ------------------
 2799|    952|		struct file_info *next = file->use_next;
 2800|       |
 2801|    952|		archive_string_free(&file->name);
 2802|    952|		archive_string_free(&file->symlink);
 2803|    952|		free(file->utf16be_name);
 2804|    952|		con = file->contents.first;
 2805|  1.07k|		while (con != NULL) {
  ------------------
  |  Branch (2805:10): [True: 127, False: 952]
  ------------------
 2806|    127|			connext = con->next;
 2807|    127|			free(con);
 2808|    127|			con = connext;
 2809|    127|		}
 2810|    952|		free(file);
 2811|    952|		file = next;
 2812|    952|	}
 2813|  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,
  ------------------
  |  |  177|  2.49k|	do { \
  |  |  178|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  2.49k|			(allowed_states), (function_name)); \
  |  |  180|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  181|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182: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:
  215|  2.49k|{
  216|  2.49k|	static const struct archive_rb_tree_ops rb_ops = {
  217|  2.49k|		mtree_cmp_node, mtree_cmp_key,
  218|  2.49k|	};
  219|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  220|  2.49k|	struct mtree *mtree;
  221|  2.49k|	int r;
  222|       |
  223|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|  2.49k|	do { \
  |  |  178|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  2.49k|			(allowed_states), (function_name)); \
  |  |  180|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  181|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  224|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_mtree");
  225|       |
  226|  2.49k|	mtree = calloc(1, sizeof(*mtree));
  227|  2.49k|	if (mtree == NULL) {
  ------------------
  |  Branch (227:6): [True: 0, False: 2.49k]
  ------------------
  228|      0|		archive_set_error(&a->archive, ENOMEM,
  229|      0|		    "Can't allocate mtree data");
  230|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  231|      0|	}
  232|  2.49k|	mtree->checkfs = 0;
  233|  2.49k|	mtree->fd = -1;
  234|       |
  235|  2.49k|	__archive_rb_tree_init(&mtree->rbtree, &rb_ops);
  236|       |
  237|  2.49k|	r = __archive_read_register_format(a, mtree, "mtree",
  238|  2.49k|           mtree_bid, archive_read_format_mtree_options, read_header, read_data, skip, NULL, cleanup, NULL, NULL);
  239|       |
  240|  2.49k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (240:6): [True: 0, False: 2.49k]
  ------------------
  241|      0|		free(mtree);
  242|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  243|  2.49k|}
archive_read_support_format_mtree.c:mtree_cmp_node:
  198|  1.44k|{
  199|  1.44k|	const struct mtree_entry *e1 = (const struct mtree_entry *)n1;
  200|  1.44k|	const struct mtree_entry *e2 = (const struct mtree_entry *)n2;
  201|       |
  202|  1.44k|	return (strcmp(e1->name, e2->name));
  203|  1.44k|}
archive_read_support_format_mtree.c:mtree_cmp_key:
  207|  1.46k|{
  208|  1.46k|	const struct mtree_entry *e = (const struct mtree_entry *)n;
  209|       |
  210|  1.46k|	return (strcmp(e->name, key));
  211|  1.46k|}
archive_read_support_format_mtree.c:cleanup:
  247|  2.49k|{
  248|  2.49k|	struct mtree *mtree;
  249|  2.49k|	struct mtree_entry *p, *q;
  250|       |
  251|  2.49k|	mtree = (struct mtree *)(a->format->data);
  252|       |	
  253|       |	/* Close any dangling file descriptor before freeing */
  254|  2.49k|    if (mtree->fd >= 0) {
  ------------------
  |  Branch (254:9): [True: 0, False: 2.49k]
  ------------------
  255|      0|        close(mtree->fd);
  256|      0|        mtree->fd = -1;
  257|      0|    }
  258|  2.49k|	p = mtree->entries;
  259|  11.7k|	while (p != NULL) {
  ------------------
  |  Branch (259:9): [True: 9.21k, False: 2.49k]
  ------------------
  260|  9.21k|		q = p->next;
  261|  9.21k|		free(p->name);
  262|  9.21k|		free_options(p->options);
  263|  9.21k|		free(p);
  264|  9.21k|		p = q;
  265|  9.21k|	}
  266|  2.49k|	archive_string_free(&mtree->line);
  267|  2.49k|	archive_string_free(&mtree->current_dir);
  268|  2.49k|	archive_string_free(&mtree->contents_name);
  269|  2.49k|	archive_entry_linkresolver_free(mtree->resolver);
  270|       |
  271|  2.49k|	free(mtree->buff);
  272|  2.49k|	free(mtree);
  273|  2.49k|	(a->format->data) = NULL;
  274|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  275|  2.49k|}
archive_read_support_format_mtree.c:free_options:
  185|  9.73k|{
  186|  9.73k|	struct mtree_option *next;
  187|       |
  188|  25.3k|	for (; head != NULL; head = next) {
  ------------------
  |  Branch (188:9): [True: 15.6k, False: 9.73k]
  ------------------
  189|  15.6k|		next = head->next;
  190|  15.6k|		free(head->value);
  191|  15.6k|		free(head);
  192|  15.6k|	}
  193|  9.73k|}
archive_read_support_format_mtree.c:mtree_bid:
  624|  2.45k|{
  625|  2.45k|	const char *signature = "#mtree";
  626|  2.45k|	const char *p;
  627|       |
  628|  2.45k|	(void)best_bid; /* UNUSED */
  629|       |
  630|       |	/* Now let's look at the actual header and see if it matches. */
  631|  2.45k|	p = __archive_read_ahead(a, strlen(signature), NULL);
  632|  2.45k|	if (p == NULL)
  ------------------
  |  Branch (632:6): [True: 19, False: 2.43k]
  ------------------
  633|     19|		return (-1);
  634|       |
  635|  2.43k|	if (memcmp(p, signature, strlen(signature)) == 0)
  ------------------
  |  Branch (635:6): [True: 5, False: 2.43k]
  ------------------
  636|      5|		return (8 * (int)strlen(signature));
  637|       |
  638|       |	/*
  639|       |	 * There is not a mtree signature. Let's try to detect mtree format.
  640|       |	 */
  641|  2.43k|	return (detect_form(a, NULL));
  642|  2.43k|}
archive_read_support_format_mtree.c:detect_form:
  646|  2.46k|{
  647|  2.46k|	const char *p;
  648|  2.46k|	ssize_t avail, ravail;
  649|  2.46k|	ssize_t len, nl;
  650|  2.46k|	int entry_cnt = 0, multiline = 0;
  651|  2.46k|	int form_D = 0;/* The archive is generated by `NetBSD mtree -D'
  652|       |			* (In this source we call it `form D') . */
  653|       |
  654|  2.46k|	if (is_form_d != NULL)
  ------------------
  |  Branch (654:6): [True: 33, False: 2.43k]
  ------------------
  655|     33|		*is_form_d = 0;
  656|  2.46k|	p = __archive_read_ahead(a, 1, &avail);
  657|  2.46k|	if (p == NULL)
  ------------------
  |  Branch (657:6): [True: 0, False: 2.46k]
  ------------------
  658|      0|		return (-1);
  659|  2.46k|	ravail = avail;
  660|  33.5M|	for (;;) {
  661|  33.5M|		len = next_line(a, &p, &avail, &ravail, &nl);
  662|       |		/* The terminal character of the line should be
  663|       |		 * a new line character, '\r\n' or '\n'. */
  664|  33.5M|		if (len <= 0 || nl == 0)
  ------------------
  |  Branch (664:7): [True: 2.20k, False: 33.5M]
  |  Branch (664:19): [True: 0, False: 33.5M]
  ------------------
  665|  2.20k|			break;
  666|  33.5M|		if (!multiline) {
  ------------------
  |  Branch (666:7): [True: 33.5M, False: 464]
  ------------------
  667|       |			/* Leading whitespace is never significant,
  668|       |			 * ignore it. */
  669|  33.5M|			while (len > 0 && (*p == ' ' || *p == '\t')) {
  ------------------
  |  Branch (669:11): [True: 33.5M, False: 0]
  |  Branch (669:23): [True: 6, False: 33.5M]
  |  Branch (669:36): [True: 3, False: 33.5M]
  ------------------
  670|      9|				++p;
  671|      9|				--avail;
  672|      9|				--len;
  673|      9|			}
  674|       |			/* Skip comment or empty line. */ 
  675|  33.5M|			if (p[0] == '#' || p[0] == '\n' || p[0] == '\r') {
  ------------------
  |  Branch (675:8): [True: 991, False: 33.5M]
  |  Branch (675:23): [True: 2, False: 33.5M]
  |  Branch (675:39): [True: 33.5M, False: 1.65k]
  ------------------
  676|  33.5M|				p += len;
  677|  33.5M|				avail -= len;
  678|  33.5M|				continue;
  679|  33.5M|			}
  680|  33.5M|		} else {
  681|       |			/* A continuance line; the terminal
  682|       |			 * character of previous line was '\' character. */
  683|    464|			if (bid_keyword_list(p, len, 0, 0) <= 0)
  ------------------
  |  Branch (683:8): [True: 0, False: 464]
  ------------------
  684|      0|				break;
  685|    464|			if (p[len-nl-1] != '\\') {
  ------------------
  |  Branch (685:8): [True: 464, False: 0]
  ------------------
  686|    464|				if (multiline == 1 &&
  ------------------
  |  Branch (686:9): [True: 8, False: 456]
  ------------------
  687|      8|				    ++entry_cnt >= MAX_BID_ENTRY)
  ------------------
  |  |  620|      8|#define MAX_BID_ENTRY	3
  ------------------
  |  Branch (687:9): [True: 0, False: 8]
  ------------------
  688|      0|					break;
  689|    464|				multiline = 0;
  690|    464|			}
  691|    464|			p += len;
  692|    464|			avail -= len;
  693|    464|			continue;
  694|    464|		}
  695|  1.65k|		if (p[0] != '/') {
  ------------------
  |  Branch (695:7): [True: 588, False: 1.06k]
  ------------------
  696|    588|			int last_is_path, keywords;
  697|       |
  698|    588|			keywords = bid_entry(p, len, nl, &last_is_path);
  699|    588|			if (keywords >= 0) {
  ------------------
  |  Branch (699:8): [True: 422, False: 166]
  ------------------
  700|    422|				if (form_D == 0) {
  ------------------
  |  Branch (700:9): [True: 408, False: 14]
  ------------------
  701|    408|					if (last_is_path)
  ------------------
  |  Branch (701:10): [True: 0, False: 408]
  ------------------
  702|      0|						form_D = 1;
  703|    408|					else if (keywords > 0)
  ------------------
  |  Branch (703:15): [True: 14, False: 394]
  ------------------
  704|       |						/* This line is not `form D'. */
  705|     14|						form_D = -1;
  706|    408|				} else if (form_D == 1) {
  ------------------
  |  Branch (706:16): [True: 0, False: 14]
  ------------------
  707|      0|					if (!last_is_path && keywords > 0)
  ------------------
  |  Branch (707:10): [True: 0, False: 0]
  |  Branch (707:27): [True: 0, False: 0]
  ------------------
  708|       |						/* This this is not `form D'
  709|       |						 * and we cannot accept mixed
  710|       |						 * format. */
  711|      0|						break;
  712|      0|				}
  713|    422|				if (!last_is_path && p[len-nl-1] == '\\')
  ------------------
  |  Branch (713:9): [True: 422, False: 0]
  |  Branch (713:26): [True: 8, False: 414]
  ------------------
  714|       |					/* This line continues. */
  715|      8|					multiline = 1;
  716|    414|				else {
  717|       |					/* We've got plenty of correct lines
  718|       |					 * to assume that this file is an mtree
  719|       |					 * format. */
  720|    414|					if (++entry_cnt >= MAX_BID_ENTRY)
  ------------------
  |  |  620|    414|#define MAX_BID_ENTRY	3
  ------------------
  |  Branch (720:10): [True: 49, False: 365]
  ------------------
  721|     49|						break;
  722|    414|				}
  723|    422|			} else
  724|    166|				break;
  725|  1.06k|		} else if (len > 4 && strncmp(p, "/set", 4) == 0) {
  ------------------
  |  Branch (725:14): [True: 1.04k, False: 21]
  |  Branch (725:25): [True: 18, False: 1.03k]
  ------------------
  726|     18|			if (bid_keyword_list(p+4, len-4, 0, 0) <= 0)
  ------------------
  |  Branch (726:8): [True: 4, False: 14]
  ------------------
  727|      4|				break;
  728|       |			/* This line continues. */
  729|     14|			if (p[len-nl-1] == '\\')
  ------------------
  |  Branch (729:8): [True: 0, False: 14]
  ------------------
  730|      0|				multiline = 2;
  731|  1.05k|		} else if (len > 6 && strncmp(p, "/unset", 6) == 0) {
  ------------------
  |  Branch (731:14): [True: 1.02k, False: 23]
  |  Branch (731:25): [True: 1.00k, False: 24]
  ------------------
  732|  1.00k|			if (bid_keyword_list(p+6, len-6, 1, 0) <= 0)
  ------------------
  |  Branch (732:8): [True: 0, False: 1.00k]
  ------------------
  733|      0|				break;
  734|       |			/* This line continues. */
  735|  1.00k|			if (p[len-nl-1] == '\\')
  ------------------
  |  Branch (735:8): [True: 456, False: 548]
  ------------------
  736|    456|				multiline = 2;
  737|  1.00k|		} else
  738|     47|			break;
  739|       |
  740|       |		/* Test next line. */
  741|  1.39k|		p += len;
  742|  1.39k|		avail -= len;
  743|  1.39k|	}
  744|  2.46k|	if (entry_cnt >= MAX_BID_ENTRY || (entry_cnt > 0 && len == 0)) {
  ------------------
  |  |  620|  4.93k|#define MAX_BID_ENTRY	3
  ------------------
  |  Branch (744:6): [True: 49, False: 2.41k]
  |  Branch (744:37): [True: 231, False: 2.18k]
  |  Branch (744:54): [True: 10, False: 221]
  ------------------
  745|     59|		if (is_form_d != NULL) {
  ------------------
  |  Branch (745:7): [True: 28, False: 31]
  ------------------
  746|     28|			if (form_D == 1)
  ------------------
  |  Branch (746:8): [True: 0, False: 28]
  ------------------
  747|      0|				*is_form_d = 1;
  748|     28|		}
  749|     59|		return (32);
  750|     59|	}
  751|       |
  752|  2.40k|	return (0);
  753|  2.46k|}
archive_read_support_format_mtree.c:next_line:
  323|  33.5M|{
  324|  33.5M|	ssize_t len;
  325|  33.5M|	int quit;
  326|       |	
  327|  33.5M|	quit = 0;
  328|  33.5M|	if (*avail == 0) {
  ------------------
  |  Branch (328:6): [True: 9, False: 33.5M]
  ------------------
  329|      9|		*nl = 0;
  330|      9|		len = 0;
  331|      9|	} else
  332|  33.5M|		len = get_line_size(*b, *avail, nl);
  333|       |	/*
  334|       |	 * Read bytes more while it does not reach the end of line.
  335|       |	 */
  336|  33.5M|	while (*nl == 0 && len == *avail && !quit) {
  ------------------
  |  Branch (336:9): [True: 2.21k, False: 33.5M]
  |  Branch (336:21): [True: 43, False: 2.17k]
  |  Branch (336:38): [True: 43, False: 0]
  ------------------
  337|     43|		ssize_t diff = *ravail - *avail;
  338|     43|		size_t nbytes_req = ((size_t)*ravail + 1023) & ~1023U;
  339|     43|		ssize_t tested;
  340|       |
  341|       |		/*
  342|       |		 * Place an arbitrary limit on the line length.
  343|       |		 * mtree is almost free-form input and without line length limits,
  344|       |		 * it can consume a lot of memory.
  345|       |		 */
  346|     43|		if (len >= MAX_LINE_LEN)
  ------------------
  |  |   84|     43|#define	MAX_LINE_LEN		(1024 * 1024)
  ------------------
  |  Branch (346:7): [True: 1, False: 42]
  ------------------
  347|      1|			return (-1);
  348|       |
  349|       |		/* Increase reading bytes if it is not enough for at least
  350|       |		 * two new lines. */
  351|     42|		if (nbytes_req < (size_t)*ravail + 160)
  ------------------
  |  Branch (351:7): [True: 20, False: 22]
  ------------------
  352|     20|			nbytes_req <<= 1;
  353|       |
  354|     42|		*b = __archive_read_ahead(a, nbytes_req, avail);
  355|     42|		if (*b == NULL) {
  ------------------
  |  Branch (355:7): [True: 24, False: 18]
  ------------------
  356|     24|			if (*ravail >= *avail)
  ------------------
  |  Branch (356:8): [True: 24, False: 0]
  ------------------
  357|     24|				return (0);
  358|       |			/* Reading bytes reaches the end of file. */
  359|      0|			*b = __archive_read_ahead(a, *avail, avail);
  360|      0|			quit = 1;
  361|      0|		}
  362|     18|		*ravail = *avail;
  363|     18|		*b += diff;
  364|     18|		*avail -= diff;
  365|     18|		tested = len;/* Skip some bytes we already determined. */
  366|     18|		len = get_line_size(*b + len, *avail - len, nl);
  367|     18|		if (len >= 0)
  ------------------
  |  Branch (367:7): [True: 12, False: 6]
  ------------------
  368|     12|			len += tested;
  369|     18|	}
  370|  33.5M|	return (len);
  371|  33.5M|}
archive_read_support_format_mtree.c:get_line_size:
  279|  33.5M|{
  280|  33.5M|	ssize_t len;
  281|       |
  282|  33.5M|	len = 0;
  283|  36.8M|	while (len < avail) {
  ------------------
  |  Branch (283:9): [True: 36.8M, False: 34]
  ------------------
  284|  36.8M|		switch (*b) {
  285|  2.17k|		case '\0':/* Non-ascii character or control character. */
  ------------------
  |  Branch (285:3): [True: 2.17k, False: 36.8M]
  ------------------
  286|  2.17k|			if (nlsize != NULL)
  ------------------
  |  Branch (286:8): [True: 2.17k, False: 0]
  ------------------
  287|  2.17k|				*nlsize = 0;
  288|  2.17k|			return (-1);
  289|  33.5M|		case '\r':
  ------------------
  |  Branch (289:3): [True: 33.5M, False: 3.28M]
  ------------------
  290|  33.5M|			if (avail-len > 1 && b[1] == '\n') {
  ------------------
  |  Branch (290:8): [True: 33.5M, False: 9]
  |  Branch (290:25): [True: 718, False: 33.5M]
  ------------------
  291|    718|				if (nlsize != NULL)
  ------------------
  |  Branch (291:9): [True: 718, False: 0]
  ------------------
  292|    718|					*nlsize = 2;
  293|    718|				return (len+2);
  294|    718|			}
  295|       |			/* FALL THROUGH */
  296|  33.5M|		case '\n':
  ------------------
  |  Branch (296:3): [True: 1.35k, False: 36.8M]
  ------------------
  297|  33.5M|			if (nlsize != NULL)
  ------------------
  |  Branch (297:8): [True: 33.5M, False: 0]
  ------------------
  298|  33.5M|				*nlsize = 1;
  299|  33.5M|			return (len+1);
  300|  3.28M|		default:
  ------------------
  |  Branch (300:3): [True: 3.28M, False: 33.5M]
  ------------------
  301|  3.28M|			b++;
  302|  3.28M|			len++;
  303|  3.28M|			break;
  304|  36.8M|		}
  305|  36.8M|	}
  306|     34|	if (nlsize != NULL)
  ------------------
  |  Branch (306:6): [True: 34, False: 0]
  ------------------
  307|     34|		*nlsize = 0;
  308|     34|	return (avail);
  309|  33.5M|}
archive_read_support_format_mtree.c:bid_keyword_list:
  480|  1.92k|{
  481|  1.92k|	int l;
  482|  1.92k|	int keycnt = 0;
  483|       |
  484|  2.47k|	while (len > 0 && *p) {
  ------------------
  |  Branch (484:9): [True: 2.39k, False: 72]
  |  Branch (484:20): [True: 2.39k, False: 0]
  ------------------
  485|  2.39k|		int blank = 0;
  486|       |
  487|       |		/* Test whether there are blank characters in the line. */
  488|  3.94k|		while (len >0 && (*p == ' ' || *p == '\t')) {
  ------------------
  |  Branch (488:10): [True: 3.94k, False: 0]
  |  Branch (488:21): [True: 1.51k, False: 2.43k]
  |  Branch (488:34): [True: 34, False: 2.39k]
  ------------------
  489|  1.54k|			++p;
  490|  1.54k|			--len;
  491|  1.54k|			blank = 1;
  492|  1.54k|		}
  493|  2.39k|		if (*p == '\n' || *p == '\r')
  ------------------
  |  Branch (493:7): [True: 159, False: 2.24k]
  |  Branch (493:21): [True: 705, False: 1.53k]
  ------------------
  494|    864|			break;
  495|  1.53k|		if (p[0] == '\\' && (p[1] == '\n' || p[1] == '\r'))
  ------------------
  |  Branch (495:7): [True: 0, False: 1.53k]
  |  Branch (495:24): [True: 0, False: 0]
  |  Branch (495:40): [True: 0, False: 0]
  ------------------
  496|      0|			break;
  497|  1.53k|		if (!blank && !last_is_path) /* No blank character. */
  ------------------
  |  Branch (497:7): [True: 0, False: 1.53k]
  |  Branch (497:17): [True: 0, False: 0]
  ------------------
  498|      0|			return (-1);
  499|  1.53k|		if (last_is_path && len == 0)
  ------------------
  |  Branch (499:7): [True: 0, False: 1.53k]
  |  Branch (499:23): [True: 0, False: 0]
  ------------------
  500|      0|				return (keycnt);
  501|       |
  502|  1.53k|		if (unset) {
  ------------------
  |  Branch (502:7): [True: 1.00k, False: 531]
  ------------------
  503|  1.00k|			l = bid_keycmp(p, "all", len);
  504|  1.00k|			if (l > 0)
  ------------------
  |  Branch (504:8): [True: 968, False: 36]
  ------------------
  505|    968|				return (1);
  506|  1.00k|		}
  507|       |		/* Test whether there is a correct key in the line. */
  508|    567|		l = bid_keyword(p, len);
  509|    567|		if (l == 0)
  ------------------
  |  Branch (509:7): [True: 21, False: 546]
  ------------------
  510|     21|			return (-1);/* Unknown keyword was found. */
  511|    546|		p += l;
  512|    546|		len -= l;
  513|    546|		keycnt++;
  514|       |
  515|       |		/* Skip value */
  516|    546|		if (*p == '=') {
  ------------------
  |  Branch (516:7): [True: 80, False: 466]
  ------------------
  517|     80|			int value = 0;
  518|     80|			++p;
  519|     80|			--len;
  520|  32.7k|			while (len > 0 && *p != ' ' && *p != '\t') {
  ------------------
  |  Branch (520:11): [True: 32.6k, False: 72]
  |  Branch (520:22): [True: 32.6k, False: 2]
  |  Branch (520:35): [True: 32.6k, False: 6]
  ------------------
  521|  32.6k|				++p;
  522|  32.6k|				--len;
  523|  32.6k|				value = 1;
  524|  32.6k|			}
  525|       |			/* A keyword should have a value unless this is
  526|       |			 * an "/unset" operation. */ 
  527|     80|			if (!unset && value == 0)
  ------------------
  |  Branch (527:8): [True: 44, False: 36]
  |  Branch (527:18): [True: 0, False: 44]
  ------------------
  528|      0|				return (-1);
  529|     80|		}
  530|    546|	}
  531|    936|	return (keycnt);
  532|  1.92k|}
archive_read_support_format_mtree.c:bid_keycmp:
  380|  1.69k|{
  381|  1.69k|	int match_len = 0;
  382|       |
  383|  6.78k|	while (len > 0 && *p && *key) {
  ------------------
  |  Branch (383:9): [True: 6.78k, False: 0]
  |  Branch (383:20): [True: 6.78k, False: 0]
  |  Branch (383:26): [True: 5.25k, False: 1.52k]
  ------------------
  384|  5.25k|		if (*p == *key) {
  ------------------
  |  Branch (384:7): [True: 5.08k, False: 173]
  ------------------
  385|  5.08k|			--len;
  386|  5.08k|			++p;
  387|  5.08k|			++key;
  388|  5.08k|			++match_len;
  389|  5.08k|			continue;
  390|  5.08k|		}
  391|    173|		return (0);/* Not match */
  392|  5.25k|	}
  393|  1.52k|	if (*key != '\0')
  ------------------
  |  Branch (393:6): [True: 0, False: 1.52k]
  ------------------
  394|      0|		return (0);/* Not match */
  395|       |
  396|       |	/* A following character should be specified characters */
  397|  1.52k|	if (p[0] == '=' || p[0] == ' ' || p[0] == '\t' ||
  ------------------
  |  Branch (397:6): [True: 136, False: 1.39k]
  |  Branch (397:21): [True: 0, False: 1.39k]
  |  Branch (397:36): [True: 456, False: 934]
  ------------------
  398|    934|	    p[0] == '\n' || p[0] == '\r' ||
  ------------------
  |  Branch (398:6): [True: 2, False: 932]
  |  Branch (398:22): [True: 464, False: 468]
  ------------------
  399|    468|	   (p[0] == '\\' && (p[1] == '\n' || p[1] == '\r')))
  ------------------
  |  Branch (399:6): [True: 456, False: 12]
  |  Branch (399:23): [True: 456, False: 0]
  |  Branch (399:39): [True: 0, False: 0]
  ------------------
  400|  1.51k|		return (match_len);
  401|     12|	return (0);/* Not match */
  402|  1.52k|}
archive_read_support_format_mtree.c:bid_keyword:
  411|    567|{
  412|    567|	static const char * const keys_c[] = {
  413|    567|		"content", "contents", "cksum", NULL
  414|    567|	};
  415|    567|	static const char * const keys_df[] = {
  416|    567|		"device", "flags", NULL
  417|    567|	};
  418|    567|	static const char * const keys_g[] = {
  419|    567|		"gid", "gname", NULL
  420|    567|	};
  421|    567|	static const char * const keys_il[] = {
  422|    567|		"ignore", "inode", "link", NULL
  423|    567|	};
  424|    567|	static const char * const keys_m[] = {
  425|    567|		"md5", "md5digest", "mode", NULL
  426|    567|	};
  427|    567|	static const char * const keys_no[] = {
  428|    567|		"nlink", "nochange", "optional", NULL
  429|    567|	};
  430|    567|	static const char * const keys_r[] = {
  431|    567|		"resdevice", "rmd160", "rmd160digest", NULL
  432|    567|	};
  433|    567|	static const char * const keys_s[] = {
  434|    567|		"sha1", "sha1digest",
  435|    567|		"sha256", "sha256digest",
  436|    567|		"sha384", "sha384digest",
  437|    567|		"sha512", "sha512digest",
  438|    567|		"size", NULL
  439|    567|	};
  440|    567|	static const char * const keys_t[] = {
  441|    567|		"tags", "time", "type", NULL
  442|    567|	};
  443|    567|	static const char * const keys_u[] = {
  444|    567|		"uid", "uname",	NULL
  445|    567|	};
  446|    567|	const char * const *keys;
  447|    567|	int i;
  448|       |
  449|    567|	switch (*p) {
  450|      1|	case 'c': keys = keys_c; break;
  ------------------
  |  Branch (450:2): [True: 1, False: 566]
  ------------------
  451|      4|	case 'd': case 'f': keys = keys_df; break;
  ------------------
  |  Branch (451:2): [True: 4, False: 563]
  |  Branch (451:12): [True: 0, False: 567]
  ------------------
  452|    500|	case 'g': keys = keys_g; break;
  ------------------
  |  Branch (452:2): [True: 500, False: 67]
  ------------------
  453|      0|	case 'i': case 'l': keys = keys_il; break;
  ------------------
  |  Branch (453:2): [True: 0, False: 567]
  |  Branch (453:12): [True: 0, False: 567]
  ------------------
  454|      6|	case 'm': keys = keys_m; break;
  ------------------
  |  Branch (454:2): [True: 6, False: 561]
  ------------------
  455|      2|	case 'n': case 'o': keys = keys_no; break;
  ------------------
  |  Branch (455:2): [True: 2, False: 565]
  |  Branch (455:12): [True: 0, False: 567]
  ------------------
  456|      3|	case 'r': keys = keys_r; break;
  ------------------
  |  Branch (456:2): [True: 3, False: 564]
  ------------------
  457|     16|	case 's': keys = keys_s; break;
  ------------------
  |  Branch (457:2): [True: 16, False: 551]
  ------------------
  458|     19|	case 't': keys = keys_t; break;
  ------------------
  |  Branch (458:2): [True: 19, False: 548]
  ------------------
  459|      0|	case 'u': keys = keys_u; break;
  ------------------
  |  Branch (459:2): [True: 0, False: 567]
  ------------------
  460|     16|	default: return (0);/* Unknown key */
  ------------------
  |  Branch (460:2): [True: 16, False: 551]
  ------------------
  461|    567|	}
  462|       |
  463|    700|	for (i = 0; keys[i] != NULL; i++) {
  ------------------
  |  Branch (463:14): [True: 695, False: 5]
  ------------------
  464|    695|		int l = bid_keycmp(p, keys[i], len);
  465|    695|		if (l > 0)
  ------------------
  |  Branch (465:7): [True: 546, False: 149]
  ------------------
  466|    546|			return (l);
  467|    695|	}
  468|      5|	return (0);/* Unknown key */
  469|    551|}
archive_read_support_format_mtree.c:bid_entry:
  536|    588|{
  537|    588|	int f = 0;
  538|    588|	static const unsigned char safe_char[256] = {
  539|    588|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 00 - 0F */
  540|    588|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 10 - 1F */
  541|       |		/* !"$%&'()*+,-./  EXCLUSION:( )(#) */
  542|    588|		0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 20 - 2F */
  543|       |		/* 0123456789:;<>?  EXCLUSION:(=) */
  544|    588|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, /* 30 - 3F */
  545|       |		/* @ABCDEFGHIJKLMNO */
  546|    588|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 40 - 4F */
  547|       |		/* PQRSTUVWXYZ[\]^_  */
  548|    588|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 50 - 5F */
  549|       |		/* `abcdefghijklmno */
  550|    588|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 60 - 6F */
  551|       |		/* pqrstuvwxyz{|}~ */
  552|    588|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, /* 70 - 7F */
  553|    588|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 80 - 8F */
  554|    588|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 90 - 9F */
  555|    588|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A0 - AF */
  556|    588|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* B0 - BF */
  557|    588|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* C0 - CF */
  558|    588|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* D0 - DF */
  559|    588|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* E0 - EF */
  560|    588|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* F0 - FF */
  561|    588|	};
  562|    588|	ssize_t ll;
  563|    588|	const char *pp = p;
  564|    588|	const char * const pp_end = pp + len;
  565|       |
  566|    588|	*last_is_path = 0;
  567|       |	/*
  568|       |	 * Skip the path-name which is quoted.
  569|       |	 */
  570|  38.0k|	for (;pp < pp_end; ++pp) {
  ------------------
  |  Branch (570:8): [True: 38.0k, False: 0]
  ------------------
  571|  38.0k|		if (!safe_char[*(const unsigned char *)pp]) {
  ------------------
  |  Branch (571:7): [True: 588, False: 37.4k]
  ------------------
  572|    588|			if (*pp != ' ' && *pp != '\t' && *pp != '\r'
  ------------------
  |  Branch (572:8): [True: 562, False: 26]
  |  Branch (572:22): [True: 543, False: 19]
  |  Branch (572:37): [True: 302, False: 241]
  ------------------
  573|    302|			    && *pp != '\n')
  ------------------
  |  Branch (573:11): [True: 149, False: 153]
  ------------------
  574|    149|				f = 0;
  575|    588|			break;
  576|    588|		}
  577|  37.4k|		f = 1;
  578|  37.4k|	}
  579|    588|	ll = pp_end - pp;
  580|       |
  581|       |	/* If a path-name was not found at the first, try to check
  582|       |	 * a mtree format(a.k.a form D) ``NetBSD's mtree -D'' creates,
  583|       |	 * which places the path-name at the last. */
  584|    588|	if (f == 0) {
  ------------------
  |  Branch (584:6): [True: 149, False: 439]
  ------------------
  585|    149|		const char *pb = p + len - nl;
  586|    149|		int name_len = 0;
  587|    149|		int slash;
  588|       |
  589|       |		/* The form D accepts only a single line for an entry. */
  590|    149|		if (pb-2 >= p &&
  ------------------
  |  Branch (590:7): [True: 147, False: 2]
  ------------------
  591|    147|		    pb[-1] == '\\' && (pb[-2] == ' ' || pb[-2] == '\t'))
  ------------------
  |  Branch (591:7): [True: 1, False: 146]
  |  Branch (591:26): [True: 0, False: 1]
  |  Branch (591:43): [True: 0, False: 1]
  ------------------
  592|      0|			return (-1);
  593|    149|		if (pb-1 >= p && pb[-1] == '\\')
  ------------------
  |  Branch (593:7): [True: 149, False: 0]
  |  Branch (593:20): [True: 1, False: 148]
  ------------------
  594|      1|			return (-1);
  595|       |
  596|    148|		slash = 0;
  597|  1.27k|		while (p <= --pb && *pb != ' ' && *pb != '\t') {
  ------------------
  |  Branch (597:10): [True: 1.27k, False: 0]
  |  Branch (597:23): [True: 1.27k, False: 1]
  |  Branch (597:37): [True: 1.27k, False: 2]
  ------------------
  598|  1.27k|			if (!safe_char[*(const unsigned char *)pb])
  ------------------
  |  Branch (598:8): [True: 145, False: 1.12k]
  ------------------
  599|    145|				return (-1);
  600|  1.12k|			name_len++;
  601|       |			/* The pathname should have a slash in this
  602|       |			 * format. */
  603|  1.12k|			if (*pb == '/')
  ------------------
  |  Branch (603:8): [True: 16, False: 1.11k]
  ------------------
  604|     16|				slash = 1;
  605|  1.12k|		}
  606|      3|		if (name_len == 0 || slash == 0)
  ------------------
  |  Branch (606:7): [True: 1, False: 2]
  |  Branch (606:24): [True: 2, False: 0]
  ------------------
  607|      3|			return (-1);
  608|       |		/* If '/' is placed at the first in this field, this is not
  609|       |		 * a valid filename. */
  610|      0|		if (pb[1] == '/')
  ------------------
  |  Branch (610:7): [True: 0, False: 0]
  ------------------
  611|      0|			return (-1);
  612|      0|		ll = len - nl - name_len;
  613|      0|		pp = p;
  614|      0|		*last_is_path = 1;
  615|      0|	}
  616|       |
  617|    439|	return (bid_keyword_list(pp, ll, 0, *last_is_path));
  618|    588|}
archive_read_support_format_mtree.c:read_header:
 1071|  7.71k|{
 1072|  7.71k|	struct mtree *mtree;
 1073|  7.71k|	char *p;
 1074|  7.71k|	int r, use_next;
 1075|       |
 1076|  7.71k|	mtree = (struct mtree *)(a->format->data);
 1077|       |
 1078|  7.71k|	if (mtree->fd >= 0) {
  ------------------
  |  Branch (1078:6): [True: 0, False: 7.71k]
  ------------------
 1079|      0|		close(mtree->fd);
 1080|      0|		mtree->fd = -1;
 1081|      0|	}
 1082|       |
 1083|  7.71k|	if (mtree->entries == NULL) {
  ------------------
  |  Branch (1083:6): [True: 33, False: 7.68k]
  ------------------
 1084|     33|		mtree->resolver = archive_entry_linkresolver_new();
 1085|     33|		if (mtree->resolver == NULL)
  ------------------
  |  Branch (1085:7): [True: 0, False: 33]
  ------------------
 1086|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1087|     33|		archive_entry_linkresolver_set_strategy(mtree->resolver,
 1088|     33|		    ARCHIVE_FORMAT_MTREE);
  ------------------
  |  |  379|     33|#define	ARCHIVE_FORMAT_MTREE			0x80000
  ------------------
 1089|     33|		r = read_mtree(a, mtree);
 1090|     33|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|     33|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1090:7): [True: 9, False: 24]
  ------------------
 1091|      9|			return (r);
 1092|     33|	}
 1093|       |
 1094|  7.70k|	a->archive.archive_format = mtree->archive_format;
 1095|  7.70k|	a->archive.archive_format_name = mtree->archive_format_name;
 1096|       |
 1097|  16.2k|	for (;;) {
 1098|  16.2k|		if (mtree->this_entry == NULL)
  ------------------
  |  Branch (1098:7): [True: 24, False: 16.2k]
  ------------------
 1099|     24|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|     24|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1100|  16.2k|		if (strcmp(mtree->this_entry->name, "..") == 0) {
  ------------------
  |  Branch (1100:7): [True: 561, False: 15.6k]
  ------------------
 1101|    561|			mtree->this_entry->used = 1;
 1102|    561|			if (archive_strlen(&mtree->current_dir) > 0) {
  ------------------
  |  |  178|    561|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1102:8): [True: 496, False: 65]
  ------------------
 1103|       |				/* Roll back current path. */
 1104|    496|				p = mtree->current_dir.s
 1105|    496|				    + mtree->current_dir.length - 1;
 1106|  1.99k|				while (p >= mtree->current_dir.s && *p != '/')
  ------------------
  |  Branch (1106:12): [True: 1.73k, False: 252]
  |  Branch (1106:41): [True: 1.49k, False: 244]
  ------------------
 1107|  1.49k|					--p;
 1108|    496|				if (p >= mtree->current_dir.s)
  ------------------
  |  Branch (1108:9): [True: 244, False: 252]
  ------------------
 1109|    244|					--p;
 1110|    496|				mtree->current_dir.length
 1111|    496|				    = p - mtree->current_dir.s + 1;
 1112|    496|			}
 1113|    561|		}
 1114|  16.2k|		if (!mtree->this_entry->used) {
  ------------------
  |  Branch (1114:7): [True: 7.68k, False: 8.52k]
  ------------------
 1115|  7.68k|			use_next = 0;
 1116|  7.68k|			r = parse_file(a, entry, mtree, mtree->this_entry,
 1117|  7.68k|				&use_next);
 1118|  7.68k|			if (use_next == 0)
  ------------------
  |  Branch (1118:8): [True: 7.68k, False: 0]
  ------------------
 1119|  7.68k|				return (r);
 1120|  7.68k|		}
 1121|  8.52k|		mtree->this_entry = mtree->this_entry->next;
 1122|  8.52k|	}
 1123|  7.70k|}
archive_read_support_format_mtree.c:read_mtree:
  990|     33|{
  991|     33|	ssize_t len;
  992|     33|	uintmax_t counter;
  993|     33|	char *p, *s;
  994|     33|	struct mtree_option *global;
  995|     33|	struct mtree_entry *last_entry;
  996|     33|	int r, is_form_d;
  997|       |
  998|     33|	mtree->archive_format = ARCHIVE_FORMAT_MTREE;
  ------------------
  |  |  379|     33|#define	ARCHIVE_FORMAT_MTREE			0x80000
  ------------------
  999|     33|	mtree->archive_format_name = "mtree";
 1000|       |
 1001|     33|	global = NULL;
 1002|     33|	last_entry = NULL;
 1003|       |
 1004|     33|	(void)detect_form(a, &is_form_d);
 1005|       |
 1006|  11.7k|	for (counter = 1; ; ++counter) {
 1007|  11.7k|		r = ARCHIVE_OK;
  ------------------
  |  |  233|  11.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1008|  11.7k|		len = readline(a, mtree, &p, 65536);
 1009|  11.7k|		if (len == 0) {
  ------------------
  |  Branch (1009:7): [True: 24, False: 11.7k]
  ------------------
 1010|     24|			mtree->this_entry = mtree->entries;
 1011|     24|			free_options(global);
 1012|     24|			return (ARCHIVE_OK);
  ------------------
  |  |  233|     24|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1013|     24|		}
 1014|  11.7k|		if (len < 0) {
  ------------------
  |  Branch (1014:7): [True: 8, False: 11.7k]
  ------------------
 1015|      8|			free_options(global);
 1016|      8|			return ((int)len);
 1017|      8|		}
 1018|       |		/* Leading whitespace is never significant, ignore it. */
 1019|  11.7k|		while (*p == ' ' || *p == '\t') {
  ------------------
  |  Branch (1019:10): [True: 3, False: 11.7k]
  |  Branch (1019:23): [True: 7, False: 11.7k]
  ------------------
 1020|     10|			++p;
 1021|     10|			--len;
 1022|     10|		}
 1023|       |		/* Skip content lines and blank lines. */
 1024|  11.7k|		if (*p == '#')
  ------------------
  |  Branch (1024:7): [True: 831, False: 10.9k]
  ------------------
 1025|    831|			continue;
 1026|  10.9k|		if (*p == '\r' || *p == '\n' || *p == '\0')
  ------------------
  |  Branch (1026:7): [True: 0, False: 10.9k]
  |  Branch (1026:21): [True: 411, False: 10.4k]
  |  Branch (1026:35): [True: 0, False: 10.4k]
  ------------------
 1027|    411|			continue;
 1028|       |		/* Non-printable characters are not allowed */
 1029|   166k|		for (s = p;s < p + len - 1; s++) {
  ------------------
  |  Branch (1029:14): [True: 156k, False: 10.4k]
  ------------------
 1030|   156k|			if (!isprint((unsigned char)*s) && *s != '\t') {
  ------------------
  |  Branch (1030:8): [True: 2.33k, False: 153k]
  |  Branch (1030:39): [True: 0, False: 2.33k]
  ------------------
 1031|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1032|      0|					"Non-printable character 0x%02X", (unsigned char)(*s));
 1033|      0|				r = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1034|      0|				break;
 1035|      0|			}
 1036|   156k|		}
 1037|  10.4k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  10.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1037:7): [True: 0, False: 10.4k]
  ------------------
 1038|      0|			break;
 1039|  10.4k|		if (*p != '/') {
  ------------------
  |  Branch (1039:7): [True: 9.21k, False: 1.27k]
  ------------------
 1040|  9.21k|			r = process_add_entry(a, mtree, &global, p, len,
 1041|  9.21k|			    &last_entry, is_form_d);
 1042|  9.21k|		} else if (len > 4 && strncmp(p, "/set", 4) == 0) {
  ------------------
  |  Branch (1042:14): [True: 1.27k, False: 0]
  |  Branch (1042:25): [True: 660, False: 617]
  ------------------
 1043|    660|			if (p[4] != ' ' && p[4] != '\t')
  ------------------
  |  Branch (1043:8): [True: 488, False: 172]
  |  Branch (1043:23): [True: 0, False: 488]
  ------------------
 1044|      0|				break;
 1045|    660|			r = process_global_set(a, &global, p);
 1046|    660|		} else if (len > 6 && strncmp(p, "/unset", 6) == 0) {
  ------------------
  |  Branch (1046:14): [True: 617, False: 0]
  |  Branch (1046:25): [True: 616, False: 1]
  ------------------
 1047|    616|			if (p[6] != ' ' && p[6] != '\t')
  ------------------
  |  Branch (1047:8): [True: 0, False: 616]
  |  Branch (1047:23): [True: 0, False: 0]
  ------------------
 1048|      0|				break;
 1049|    616|			r = process_global_unset(a, &global, p);
 1050|    616|		} else
 1051|      1|			break;
 1052|       |
 1053|  10.4k|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|  10.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1053:7): [True: 0, False: 10.4k]
  ------------------
 1054|      0|			free_options(global);
 1055|      0|			return r;
 1056|      0|		}
 1057|  10.4k|	}
 1058|       |
 1059|      1|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1060|      1|	    "Can't parse line %ju", counter);
 1061|      1|	free_options(global);
 1062|      1|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1063|     33|}
archive_read_support_format_mtree.c:readline:
 2045|  11.7k|{
 2046|  11.7k|	ssize_t bytes_read;
 2047|  11.7k|	ssize_t total_size = 0;
 2048|  11.7k|	ssize_t find_off = 0;
 2049|  11.7k|	const void *nl, *t;
 2050|  11.7k|	char *u;
 2051|       |
 2052|       |	/* Accumulate line in a line buffer. */
 2053|  16.9k|	for (;;) {
 2054|       |		/* Read some more. */
 2055|  16.9k|		t = __archive_read_ahead(a, 1, &bytes_read);
 2056|  16.9k|		if (t == NULL)
  ------------------
  |  Branch (2056:7): [True: 24, False: 16.8k]
  ------------------
 2057|     24|			return (0);
 2058|  16.8k|		if (bytes_read < 0)
  ------------------
  |  Branch (2058:7): [True: 0, False: 16.8k]
  ------------------
 2059|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2060|  16.8k|		nl = memchr(t, '\n', bytes_read);
 2061|       |		/* If we found '\n', trim the read to end exactly there. */
 2062|  16.8k|		if (nl != NULL) {
  ------------------
  |  Branch (2062:7): [True: 16.8k, False: 32]
  ------------------
 2063|  16.8k|			bytes_read = ((const char *)nl) - ((const char *)t) + 1;
 2064|  16.8k|		}
 2065|  16.8k|		if (total_size + bytes_read + 1 > limit) {
  ------------------
  |  Branch (2065:7): [True: 8, False: 16.8k]
  ------------------
 2066|      8|			archive_set_error(&a->archive,
 2067|      8|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      8|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2068|      8|			    "Line too long");
 2069|      8|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2070|      8|		}
 2071|  16.8k|		if (archive_string_ensure(&mtree->line,
  ------------------
  |  Branch (2071:7): [True: 0, False: 16.8k]
  ------------------
 2072|  16.8k|			total_size + bytes_read + 1) == NULL) {
 2073|      0|			archive_set_error(&a->archive, ENOMEM,
 2074|      0|			    "Can't allocate working buffer");
 2075|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2076|      0|		}
 2077|       |		/* Append new bytes to string. */
 2078|  16.8k|		memcpy(mtree->line.s + total_size, t, bytes_read);
 2079|  16.8k|		__archive_read_consume(a, bytes_read);
 2080|  16.8k|		total_size += bytes_read;
 2081|  16.8k|		mtree->line.s[total_size] = '\0';
 2082|       |
 2083|  1.17M|		for (u = mtree->line.s + find_off; *u; ++u) {
  ------------------
  |  Branch (2083:38): [True: 1.16M, False: 4.88k]
  ------------------
 2084|  1.16M|			if (u[0] == '\n') {
  ------------------
  |  Branch (2084:8): [True: 11.7k, False: 1.15M]
  ------------------
 2085|       |				/* Ends with unescaped newline. */
 2086|       |				/* Check if preceded by '\r' for CRLF handling */
 2087|  11.7k|				if (u > mtree->line.s && u[-1] == '\r') {
  ------------------
  |  Branch (2087:9): [True: 11.3k, False: 411]
  |  Branch (2087:30): [True: 217, False: 11.1k]
  ------------------
 2088|       |					/* CRLF ending - remove the '\r' */
 2089|    217|					u[-1] = '\n';
 2090|    217|					u[0] = '\0';
 2091|    217|					total_size--;
 2092|    217|				}
 2093|  11.7k|				*start = mtree->line.s;
 2094|  11.7k|				return total_size;
 2095|  1.15M|			} else if (u[0] == '#') {
  ------------------
  |  Branch (2095:15): [True: 989k, False: 167k]
  ------------------
 2096|       |				/* Ends with comment sequence #...\n */
 2097|   989k|				if (nl == NULL) {
  ------------------
  |  Branch (2097:9): [True: 14, False: 989k]
  ------------------
 2098|       |					/* But we've not found the \n yet */
 2099|     14|					break;
 2100|     14|				}
 2101|   989k|			} else if (u[0] == '\\') {
  ------------------
  |  Branch (2101:15): [True: 10.4k, False: 156k]
  ------------------
 2102|  10.4k|				if (u[1] == '\n') {
  ------------------
  |  Branch (2102:9): [True: 232, False: 10.2k]
  ------------------
 2103|       |					/* Trim escaped newline. */
 2104|    232|					total_size -= 2;
 2105|    232|					mtree->line.s[total_size] = '\0';
 2106|    232|					break;
 2107|  10.2k|				} else if (u[1] == '\r' && u[2] == '\n') {
  ------------------
  |  Branch (2107:16): [True: 0, False: 10.2k]
  |  Branch (2107:32): [True: 0, False: 0]
  ------------------
 2108|       |					/* Trim escaped CRLF. */
 2109|      0|					total_size -= 3;
 2110|      0|					mtree->line.s[total_size] = '\0';
 2111|      0|					break;
 2112|  10.2k|				} else if (u[1] != '\0') {
  ------------------
  |  Branch (2112:16): [True: 10.2k, False: 0]
  ------------------
 2113|       |					/* Skip the two-char escape sequence */
 2114|  10.2k|					++u;
 2115|  10.2k|				}
 2116|  10.4k|			}
 2117|  1.16M|		}
 2118|  5.13k|		find_off = u - mtree->line.s;
 2119|  5.13k|	}
 2120|  11.7k|}
archive_read_support_format_mtree.c:process_add_entry:
  876|  9.21k|{
  877|  9.21k|	struct mtree_entry *entry;
  878|  9.21k|	struct mtree_option *iter;
  879|  9.21k|	const char *next, *eq, *name, *end;
  880|  9.21k|	size_t name_len, len;
  881|  9.21k|	int r, i;
  882|       |
  883|  9.21k|	if ((entry = malloc(sizeof(*entry))) == NULL) {
  ------------------
  |  Branch (883:6): [True: 0, False: 9.21k]
  ------------------
  884|      0|		archive_set_error(&a->archive, errno, "Can't allocate memory");
  885|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  886|      0|	}
  887|  9.21k|	entry->next = NULL;
  888|  9.21k|	entry->options = NULL;
  889|  9.21k|	entry->name = NULL;
  890|  9.21k|	entry->used = 0;
  891|  9.21k|	entry->full = 0;
  892|       |
  893|       |	/* Add this entry to list. */
  894|  9.21k|	if (*last_entry == NULL)
  ------------------
  |  Branch (894:6): [True: 29, False: 9.18k]
  ------------------
  895|     29|		mtree->entries = entry;
  896|  9.18k|	else
  897|  9.18k|		(*last_entry)->next = entry;
  898|  9.21k|	*last_entry = entry;
  899|       |
  900|  9.21k|	if (is_form_d) {
  ------------------
  |  Branch (900:6): [True: 0, False: 9.21k]
  ------------------
  901|       |		/* Filename is last item on line. */
  902|       |		/* Adjust line_len to trim trailing whitespace */
  903|      0|		while (line_len > 0) {
  ------------------
  |  Branch (903:10): [True: 0, False: 0]
  ------------------
  904|      0|			char last_character = line[line_len - 1];
  905|      0|			if (last_character == '\r'
  ------------------
  |  Branch (905:8): [True: 0, False: 0]
  ------------------
  906|      0|			    || last_character == '\n'
  ------------------
  |  Branch (906:11): [True: 0, False: 0]
  ------------------
  907|      0|			    || last_character == '\t'
  ------------------
  |  Branch (907:11): [True: 0, False: 0]
  ------------------
  908|      0|			    || last_character == ' ') {
  ------------------
  |  Branch (908:11): [True: 0, False: 0]
  ------------------
  909|      0|				line_len--;
  910|      0|			} else {
  911|      0|				break;
  912|      0|			}
  913|      0|		}
  914|       |		/* Name starts after the last whitespace separator */
  915|      0|		name = line;
  916|      0|		for (i = 0; i < line_len; i++) {
  ------------------
  |  Branch (916:15): [True: 0, False: 0]
  ------------------
  917|      0|			if (line[i] == '\r'
  ------------------
  |  Branch (917:8): [True: 0, False: 0]
  ------------------
  918|      0|			    || line[i] == '\n'
  ------------------
  |  Branch (918:11): [True: 0, False: 0]
  ------------------
  919|      0|			    || line[i] == '\t'
  ------------------
  |  Branch (919:11): [True: 0, False: 0]
  ------------------
  920|      0|			    || line[i] == ' ') {
  ------------------
  |  Branch (920:11): [True: 0, False: 0]
  ------------------
  921|      0|				name = line + i + 1;
  922|      0|			}
  923|      0|		}
  924|      0|		name_len = line + line_len - name;
  925|      0|		end = name;
  926|  9.21k|	} else {
  927|       |		/* Filename is first item on line */
  928|  9.21k|		name_len = strcspn(line, " \t\r\n");
  929|  9.21k|		name = line;
  930|  9.21k|		line += name_len;
  931|  9.21k|		end = line + line_len;
  932|  9.21k|	}
  933|       |	/* name/name_len is the name within the line. */
  934|       |	/* line..end brackets the entire line except the name */
  935|       |
  936|  9.21k|	if ((entry->name = malloc(name_len + 1)) == NULL) {
  ------------------
  |  Branch (936:6): [True: 0, False: 9.21k]
  ------------------
  937|      0|		archive_set_error(&a->archive, errno, "Can't allocate memory");
  938|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  939|      0|	}
  940|       |
  941|  9.21k|	memcpy(entry->name, name, name_len);
  942|  9.21k|	entry->name[name_len] = '\0';
  943|  9.21k|	parse_escapes(entry->name, entry);
  944|       |
  945|  9.21k|	entry->next_dup = NULL;
  946|  9.21k|	if (entry->full) {
  ------------------
  |  Branch (946:6): [True: 438, False: 8.77k]
  ------------------
  947|    438|		if (!__archive_rb_tree_insert_node(&mtree->rbtree, &entry->rbnode)) {
  ------------------
  |  Branch (947:7): [True: 322, False: 116]
  ------------------
  948|    322|			struct mtree_entry *alt;
  949|    322|			alt = (struct mtree_entry *)__archive_rb_tree_find_node(
  950|    322|			    &mtree->rbtree, entry->name);
  951|    322|			if (alt != NULL) {
  ------------------
  |  Branch (951:8): [True: 322, False: 0]
  ------------------
  952|  8.37k|				while (alt->next_dup)
  ------------------
  |  Branch (952:12): [True: 8.05k, False: 322]
  ------------------
  953|  8.05k|					alt = alt->next_dup;
  954|    322|				alt->next_dup = entry;
  955|    322|			}
  956|    322|		}
  957|    438|	}
  958|       |
  959|  20.7k|	for (iter = *global; iter != NULL; iter = iter->next) {
  ------------------
  |  Branch (959:23): [True: 11.4k, False: 9.21k]
  ------------------
  960|  11.4k|		r = add_option(a, &entry->options, iter->value,
  961|  11.4k|		    strlen(iter->value));
  962|  11.4k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  11.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (962:7): [True: 0, False: 11.4k]
  ------------------
  963|      0|			return (r);
  964|  11.4k|	}
  965|       |
  966|  12.5k|	for (;;) {
  967|  12.5k|		next = line + strspn(line, " \t\r\n");
  968|  12.5k|		if (*next == '\0')
  ------------------
  |  Branch (968:7): [True: 9.21k, False: 3.28k]
  ------------------
  969|  9.21k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  9.21k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  970|  3.28k|		if (next >= end)
  ------------------
  |  Branch (970:7): [True: 0, False: 3.28k]
  ------------------
  971|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  972|  3.28k|		line = next;
  973|  3.28k|		next = line + strcspn(line, " \t\r\n");
  974|  3.28k|		eq = strchr(line, '=');
  975|  3.28k|		if (eq == NULL || eq > next)
  ------------------
  |  Branch (975:7): [True: 1.39k, False: 1.89k]
  |  Branch (975:21): [True: 82, False: 1.81k]
  ------------------
  976|  1.47k|			len = next - line;
  977|  1.81k|		else
  978|  1.81k|			len = eq - line;
  979|       |
  980|  3.28k|		remove_option(&entry->options, line, len);
  981|  3.28k|		r = add_option(a, &entry->options, line, next - line);
  982|  3.28k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  3.28k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (982:7): [True: 0, False: 3.28k]
  ------------------
  983|      0|			return (r);
  984|  3.28k|		line = next;
  985|  3.28k|	}
  986|  9.21k|}
archive_read_support_format_mtree.c:parse_escapes:
 1902|  9.21k|{
 1903|  9.21k|	char *dest = src;
 1904|  9.21k|	char c;
 1905|       |
 1906|  9.21k|	if (mentry != NULL && strcmp(src, ".") == 0)
  ------------------
  |  Branch (1906:6): [True: 9.21k, False: 0]
  |  Branch (1906:24): [True: 136, False: 9.08k]
  ------------------
 1907|    136|		mentry->full = 1;
 1908|       |
 1909|  60.4k|	while (*src != '\0') {
  ------------------
  |  Branch (1909:9): [True: 51.2k, False: 9.21k]
  ------------------
 1910|  51.2k|		c = *src++;
 1911|  51.2k|		if (c == '/' && mentry != NULL)
  ------------------
  |  Branch (1911:7): [True: 384, False: 50.8k]
  |  Branch (1911:19): [True: 384, False: 0]
  ------------------
 1912|    384|			mentry->full = 1;
 1913|  51.2k|		if (c == '\\') {
  ------------------
  |  Branch (1913:7): [True: 9.65k, False: 41.5k]
  ------------------
 1914|  9.65k|			switch (src[0]) {
  ------------------
  |  Branch (1914:12): [True: 9.38k, False: 273]
  ------------------
 1915|    128|			case '0':
  ------------------
  |  Branch (1915:4): [True: 128, False: 9.52k]
  ------------------
 1916|    128|				if (src[1] < '0' || src[1] > '7') {
  ------------------
  |  Branch (1916:9): [True: 0, False: 128]
  |  Branch (1916:25): [True: 128, False: 0]
  ------------------
 1917|    128|					c = 0;
 1918|    128|					++src;
 1919|    128|					break;
 1920|    128|				}
 1921|       |				/* FALLTHROUGH */
 1922|    644|			case '1':
  ------------------
  |  Branch (1922:4): [True: 644, False: 9.01k]
  ------------------
 1923|    779|			case '2':
  ------------------
  |  Branch (1923:4): [True: 135, False: 9.52k]
  ------------------
 1924|  9.12k|			case '3':
  ------------------
  |  Branch (1924:4): [True: 8.34k, False: 1.31k]
  ------------------
 1925|  9.12k|				if (src[1] >= '0' && src[1] <= '7' &&
  ------------------
  |  Branch (1925:9): [True: 6.38k, False: 2.73k]
  |  Branch (1925:26): [True: 905, False: 5.48k]
  ------------------
 1926|    905|				    src[2] >= '0' && src[2] <= '7') {
  ------------------
  |  Branch (1926:9): [True: 900, False: 5]
  |  Branch (1926:26): [True: 771, False: 129]
  ------------------
 1927|    771|					c = (src[0] - '0') << 6;
 1928|    771|					c |= (src[1] - '0') << 3;
 1929|    771|					c |= (src[2] - '0');
 1930|    771|					src += 3;
 1931|    771|				}
 1932|  9.12k|				break;
 1933|      0|			case 'a':
  ------------------
  |  Branch (1933:4): [True: 0, False: 9.65k]
  ------------------
 1934|      0|				c = '\a';
 1935|      0|				++src;
 1936|      0|				break;
 1937|      0|			case 'b':
  ------------------
  |  Branch (1937:4): [True: 0, False: 9.65k]
  ------------------
 1938|      0|				c = '\b';
 1939|      0|				++src;
 1940|      0|				break;
 1941|      0|			case 'f':
  ------------------
  |  Branch (1941:4): [True: 0, False: 9.65k]
  ------------------
 1942|      0|				c = '\f';
 1943|      0|				++src;
 1944|      0|				break;
 1945|      0|			case 'n':
  ------------------
  |  Branch (1945:4): [True: 0, False: 9.65k]
  ------------------
 1946|      0|				c = '\n';
 1947|      0|				++src;
 1948|      0|				break;
 1949|      0|			case 'r':
  ------------------
  |  Branch (1949:4): [True: 0, False: 9.65k]
  ------------------
 1950|      0|				c = '\r';
 1951|      0|				++src;
 1952|      0|				break;
 1953|      0|			case 's':
  ------------------
  |  Branch (1953:4): [True: 0, False: 9.65k]
  ------------------
 1954|      0|				c = ' ';
 1955|      0|				++src;
 1956|      0|				break;
 1957|      0|			case 't':
  ------------------
  |  Branch (1957:4): [True: 0, False: 9.65k]
  ------------------
 1958|      0|				c = '\t';
 1959|      0|				++src;
 1960|      0|				break;
 1961|      0|			case 'v':
  ------------------
  |  Branch (1961:4): [True: 0, False: 9.65k]
  ------------------
 1962|      0|				c = '\v';
 1963|      0|				++src;
 1964|      0|				break;
 1965|    131|			case '\\':
  ------------------
  |  Branch (1965:4): [True: 131, False: 9.52k]
  ------------------
 1966|    131|				c = '\\';
 1967|    131|				++src;
 1968|    131|				break;
 1969|  9.65k|			}
 1970|  9.65k|		}
 1971|  51.2k|		*dest++ = c;
 1972|  51.2k|	}
 1973|  9.21k|	*dest = '\0';
 1974|  9.21k|}
archive_read_support_format_mtree.c:add_option:
  769|  18.9k|{
  770|  18.9k|	struct mtree_option *opt;
  771|       |
  772|  18.9k|	if ((opt = malloc(sizeof(*opt))) == NULL) {
  ------------------
  |  Branch (772:6): [True: 0, False: 18.9k]
  ------------------
  773|      0|		archive_set_error(&a->archive, errno, "Can't allocate memory");
  774|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  775|      0|	}
  776|  18.9k|	if ((opt->value = malloc(len + 1)) == NULL) {
  ------------------
  |  Branch (776:6): [True: 0, False: 18.9k]
  ------------------
  777|      0|		free(opt);
  778|      0|		archive_set_error(&a->archive, errno, "Can't allocate memory");
  779|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  780|      0|	}
  781|  18.9k|	memcpy(opt->value, value, len);
  782|  18.9k|	opt->value[len] = '\0';
  783|  18.9k|	opt->next = *global;
  784|  18.9k|	*global = opt;
  785|  18.9k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  18.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  786|  18.9k|}
archive_read_support_format_mtree.c:remove_option:
  790|  10.2k|{
  791|  10.2k|	struct mtree_option *iter, *last;
  792|       |
  793|  10.2k|	last = NULL;
  794|  56.3k|	for (iter = *global; iter != NULL; last = iter, iter = iter->next) {
  ------------------
  |  Branch (794:23): [True: 49.3k, False: 6.95k]
  ------------------
  795|  49.3k|		if (strncmp(iter->value, value, len) == 0 &&
  ------------------
  |  Branch (795:7): [True: 6.12k, False: 43.2k]
  ------------------
  796|  6.12k|		    (iter->value[len] == '\0' ||
  ------------------
  |  Branch (796:8): [True: 3.16k, False: 2.96k]
  ------------------
  797|  2.96k|		     iter->value[len] == '='))
  ------------------
  |  Branch (797:8): [True: 137, False: 2.82k]
  ------------------
  798|  3.29k|			break;
  799|  49.3k|	}
  800|  10.2k|	if (iter == NULL)
  ------------------
  |  Branch (800:6): [True: 6.95k, False: 3.29k]
  ------------------
  801|  6.95k|		return;
  802|  3.29k|	if (last == NULL)
  ------------------
  |  Branch (802:6): [True: 270, False: 3.02k]
  ------------------
  803|    270|		*global = iter->next;
  804|  3.02k|	else
  805|  3.02k|		last->next = iter->next;
  806|       |
  807|  3.29k|	free(iter->value);
  808|  3.29k|	free(iter);
  809|  3.29k|}
archive_read_support_format_mtree.c:process_global_set:
  814|    660|{
  815|    660|	const char *next, *eq;
  816|    660|	size_t len;
  817|    660|	int r;
  818|       |
  819|    660|	line += 4;
  820|  4.82k|	for (;;) {
  821|  4.82k|		next = line + strspn(line, " \t\r\n");
  822|  4.82k|		if (*next == '\0')
  ------------------
  |  Branch (822:7): [True: 660, False: 4.16k]
  ------------------
  823|    660|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    660|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  824|  4.16k|		line = next;
  825|  4.16k|		next = line + strcspn(line, " \t\r\n");
  826|  4.16k|		eq = strchr(line, '=');
  827|  4.16k|		if (eq == NULL || eq > next)
  ------------------
  |  Branch (827:7): [True: 4.06k, False: 104]
  |  Branch (827:21): [True: 54, False: 50]
  ------------------
  828|  4.11k|			len = next - line;
  829|     50|		else
  830|     50|			len = eq - line;
  831|       |
  832|  4.16k|		remove_option(global, line, len);
  833|  4.16k|		r = add_option(a, global, line, next - line);
  834|  4.16k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  4.16k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (834:7): [True: 0, False: 4.16k]
  ------------------
  835|      0|			return (r);
  836|  4.16k|		line = next;
  837|  4.16k|	}
  838|    660|}
archive_read_support_format_mtree.c:process_global_unset:
  843|    616|{
  844|    616|	const char *next;
  845|    616|	size_t len;
  846|       |
  847|    616|	line += 6;
  848|    616|	if (strchr(line, '=') != NULL) {
  ------------------
  |  Branch (848:6): [True: 0, False: 616]
  ------------------
  849|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  850|      0|		    "/unset shall not contain `='");
  851|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  852|      0|	}
  853|       |
  854|  3.89k|	for (;;) {
  855|  3.89k|		next = line + strspn(line, " \t\r\n");
  856|  3.89k|		if (*next == '\0')
  ------------------
  |  Branch (856:7): [True: 616, False: 3.27k]
  ------------------
  857|    616|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    616|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  858|  3.27k|		line = next;
  859|  3.27k|		len = strcspn(line, " \t\r\n");
  860|       |
  861|  3.27k|		if (len == 3 && strncmp(line, "all", 3) == 0) {
  ------------------
  |  Branch (861:7): [True: 724, False: 2.55k]
  |  Branch (861:19): [True: 483, False: 241]
  ------------------
  862|    483|			free_options(*global);
  863|    483|			*global = NULL;
  864|  2.79k|		} else {
  865|  2.79k|			remove_option(global, line, len);
  866|  2.79k|		}
  867|       |
  868|  3.27k|		line += len;
  869|  3.27k|	}
  870|    616|}
archive_read_support_format_mtree.c:parse_file:
 1133|  7.68k|{
 1134|  7.68k|	const char *path;
 1135|  7.68k|	la_seek_stat_t st_storage, *st;
 1136|  7.68k|	struct mtree_entry *mp;
 1137|  7.68k|	struct archive_entry *sparse_entry;
 1138|  7.68k|	int r = ARCHIVE_OK, r1, parsed_kws;
  ------------------
  |  |  233|  7.68k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1139|       |
 1140|  7.68k|	mentry->used = 1;
 1141|       |
 1142|       |	/* Initialize reasonable defaults. */
 1143|  7.68k|	archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  7.68k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1144|  7.68k|	archive_entry_set_size(entry, 0);
 1145|  7.68k|	archive_string_empty(&mtree->contents_name);
  ------------------
  |  |  181|  7.68k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1146|       |
 1147|       |	/* Parse options from this line. */
 1148|  7.68k|	parsed_kws = 0;
 1149|  7.68k|	r = parse_line(a, entry, mtree, mentry, &parsed_kws);
 1150|       |
 1151|  7.68k|	if (mentry->full) {
  ------------------
  |  Branch (1151:6): [True: 97, False: 7.58k]
  ------------------
 1152|     97|		archive_entry_copy_pathname(entry, mentry->name);
 1153|       |		/*
 1154|       |		 * "Full" entries are allowed to have multiple lines
 1155|       |		 * and those lines aren't required to be adjacent.  We
 1156|       |		 * don't support multiple lines for "relative" entries
 1157|       |		 * nor do we make any attempt to merge data from
 1158|       |		 * separate "relative" and "full" entries.  (Merging
 1159|       |		 * "relative" and "full" entries would require dealing
 1160|       |		 * with pathname canonicalization, which is a very
 1161|       |		 * tricky subject.)
 1162|       |		 */
 1163|     97|		mp = (struct mtree_entry *)__archive_rb_tree_find_node(
 1164|     97|		    &mtree->rbtree, mentry->name);
 1165|    476|		for (; mp; mp = mp->next_dup) {
  ------------------
  |  Branch (1165:10): [True: 379, False: 97]
  ------------------
 1166|    379|			if (mp->full && !mp->used) {
  ------------------
  |  Branch (1166:8): [True: 379, False: 0]
  |  Branch (1166:20): [True: 282, False: 97]
  ------------------
 1167|       |				/* Later lines override earlier ones. */
 1168|    282|				mp->used = 1;
 1169|    282|				r1 = parse_line(a, entry, mtree, mp, &parsed_kws);
 1170|    282|				if (r1 < r)
  ------------------
  |  Branch (1170:9): [True: 2, False: 280]
  ------------------
 1171|      2|					r = r1;
 1172|    282|			}
 1173|    379|		}
 1174|  7.58k|	} else {
 1175|       |		/*
 1176|       |		 * Relative entries require us to construct
 1177|       |		 * the full path and possibly update the
 1178|       |		 * current directory.
 1179|       |		 */
 1180|  7.58k|		size_t n = archive_strlen(&mtree->current_dir);
  ------------------
  |  |  178|  7.58k|#define	archive_strlen(a) ((a)->length)
  ------------------
 1181|  7.58k|		if (n > 0)
  ------------------
  |  Branch (1181:7): [True: 270, False: 7.31k]
  ------------------
 1182|    270|			archive_strcat(&mtree->current_dir, "/");
 1183|  7.58k|		archive_strcat(&mtree->current_dir, mentry->name);
 1184|  7.58k|		archive_entry_copy_pathname(entry, mtree->current_dir.s);
 1185|  7.58k|		if (archive_entry_filetype(entry) != AE_IFDIR)
  ------------------
  |  |  221|  7.58k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1185:7): [True: 7.08k, False: 498]
  ------------------
 1186|  7.08k|			mtree->current_dir.length = n;
 1187|  7.58k|	}
 1188|       |
 1189|  7.68k|	if (mtree->checkfs) {
  ------------------
  |  Branch (1189:6): [True: 0, False: 7.68k]
  ------------------
 1190|       |		/*
 1191|       |		 * Try to open and stat the file to get the real size
 1192|       |		 * and other file info.  It would be nice to avoid
 1193|       |		 * this here so that getting a listing of an mtree
 1194|       |		 * wouldn't require opening every referenced contents
 1195|       |		 * file.  But then we wouldn't know the actual
 1196|       |		 * contents size, so I don't see a really viable way
 1197|       |		 * around this.  (Also, we may want to someday pull
 1198|       |		 * other unspecified info from the contents file on
 1199|       |		 * disk.)
 1200|       |		 */
 1201|      0|		mtree->fd = -1;
 1202|      0|		if (archive_strlen(&mtree->contents_name) > 0)
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1202:7): [True: 0, False: 0]
  ------------------
 1203|      0|			path = mtree->contents_name.s;
 1204|      0|		else
 1205|      0|			path = archive_entry_pathname(entry);
 1206|       |
 1207|      0|		if (archive_entry_filetype(entry) == AE_IFREG ||
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (1207:7): [True: 0, False: 0]
  ------------------
 1208|      0|				archive_entry_filetype(entry) == AE_IFDIR) {
  ------------------
  |  |  221|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1208:5): [True: 0, False: 0]
  ------------------
 1209|      0|			mtree->fd = open(path, O_RDONLY | O_BINARY | O_CLOEXEC);
  ------------------
  |  |   63|      0|#define	O_BINARY 0
  ------------------
 1210|      0|			__archive_ensure_cloexec_flag(mtree->fd);
 1211|      0|			if (mtree->fd == -1 && (
  ------------------
  |  Branch (1211:8): [True: 0, False: 0]
  ------------------
 1212|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1213|       |        /*
 1214|       |         * On Windows, attempting to open a file with an
 1215|       |         * invalid name result in EINVAL (Error 22)
 1216|       |         */
 1217|       |				(errno != ENOENT && errno != EINVAL)
 1218|       |#else
 1219|      0|				errno != ENOENT
  ------------------
  |  Branch (1219:5): [True: 0, False: 0]
  ------------------
 1220|      0|#endif
 1221|      0|        || archive_strlen(&mtree->contents_name) > 0)) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1221:12): [True: 0, False: 0]
  ------------------
 1222|      0|				archive_set_error(&a->archive, errno,
 1223|      0|						"Can't open %s", path);
 1224|      0|				r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1225|      0|			}
 1226|      0|		}
 1227|       |
 1228|      0|		st = &st_storage;
 1229|      0|		if (mtree->fd >= 0) {
  ------------------
  |  Branch (1229:7): [True: 0, False: 0]
  ------------------
 1230|      0|			if (la_seek_fstat(mtree->fd, st) == -1) {
  ------------------
  |  |   41|      0|#define la_seek_fstat(fd, st)	fstat((fd), (st))
  ------------------
  |  Branch (1230:8): [True: 0, False: 0]
  ------------------
 1231|      0|				archive_set_error(&a->archive, errno,
 1232|      0|						"Could not fstat %s", path);
 1233|      0|				r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1234|       |				/* If we can't stat it, don't keep it open. */
 1235|      0|				close(mtree->fd);
 1236|      0|				mtree->fd = -1;
 1237|      0|				st = NULL;
 1238|      0|			}
 1239|      0|		}
 1240|      0|#ifdef HAVE_LSTAT
 1241|      0|		else if (lstat(path, st) == -1)
  ------------------
  |  Branch (1241:12): [True: 0, False: 0]
  ------------------
 1242|       |#else
 1243|       |		else if (la_seek_stat(path, st) == -1)
 1244|       |#endif
 1245|      0|		{
 1246|      0|			st = NULL;
 1247|      0|		}
 1248|       |
 1249|       |		/*
 1250|       |		 * Check for a mismatch between the type in the specification
 1251|       |		 * and the type of the contents object on disk.
 1252|       |		 */
 1253|      0|		if (st != NULL) {
  ------------------
  |  Branch (1253:7): [True: 0, False: 0]
  ------------------
 1254|      0|			if (((st->st_mode & S_IFMT) == S_IFREG &&
  ------------------
  |  Branch (1254:9): [True: 0, False: 0]
  ------------------
 1255|      0|			      archive_entry_filetype(entry) == AE_IFREG)
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (1255:10): [True: 0, False: 0]
  ------------------
 1256|      0|#ifdef S_IFLNK
 1257|      0|			  ||((st->st_mode & S_IFMT) == S_IFLNK &&
  ------------------
  |  Branch (1257:9): [True: 0, False: 0]
  ------------------
 1258|      0|			      archive_entry_filetype(entry) == AE_IFLNK)
  ------------------
  |  |  217|      0|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (1258:10): [True: 0, False: 0]
  ------------------
 1259|      0|#endif
 1260|      0|#ifdef S_IFSOCK
 1261|      0|			  ||((st->st_mode & S_IFSOCK) == S_IFSOCK &&
  ------------------
  |  Branch (1261:9): [True: 0, False: 0]
  ------------------
 1262|      0|			      archive_entry_filetype(entry) == AE_IFSOCK)
  ------------------
  |  |  218|      0|#define AE_IFSOCK	((__LA_MODE_T)0140000)
  ------------------
  |  Branch (1262:10): [True: 0, False: 0]
  ------------------
 1263|      0|#endif
 1264|      0|#ifdef S_IFCHR
 1265|      0|			  ||((st->st_mode & S_IFMT) == S_IFCHR &&
  ------------------
  |  Branch (1265:9): [True: 0, False: 0]
  ------------------
 1266|      0|			      archive_entry_filetype(entry) == AE_IFCHR)
  ------------------
  |  |  219|      0|#define AE_IFCHR	((__LA_MODE_T)0020000)
  ------------------
  |  Branch (1266:10): [True: 0, False: 0]
  ------------------
 1267|      0|#endif
 1268|      0|#ifdef S_IFBLK
 1269|      0|			  ||((st->st_mode & S_IFMT) == S_IFBLK &&
  ------------------
  |  Branch (1269:9): [True: 0, False: 0]
  ------------------
 1270|      0|			      archive_entry_filetype(entry) == AE_IFBLK)
  ------------------
  |  |  220|      0|#define AE_IFBLK	((__LA_MODE_T)0060000)
  ------------------
  |  Branch (1270:10): [True: 0, False: 0]
  ------------------
 1271|      0|#endif
 1272|      0|			  ||((st->st_mode & S_IFMT) == S_IFDIR &&
  ------------------
  |  Branch (1272:9): [True: 0, False: 0]
  ------------------
 1273|      0|			      archive_entry_filetype(entry) == AE_IFDIR)
  ------------------
  |  |  221|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1273:10): [True: 0, False: 0]
  ------------------
 1274|      0|#ifdef S_IFIFO
 1275|      0|			  ||((st->st_mode & S_IFMT) == S_IFIFO &&
  ------------------
  |  Branch (1275:9): [True: 0, False: 0]
  ------------------
 1276|      0|			      archive_entry_filetype(entry) == AE_IFIFO)
  ------------------
  |  |  222|      0|#define AE_IFIFO	((__LA_MODE_T)0010000)
  ------------------
  |  Branch (1276:10): [True: 0, False: 0]
  ------------------
 1277|      0|#endif
 1278|      0|			) {
 1279|       |				/* Types match. */
 1280|      0|			} else {
 1281|       |				/* Types don't match; bail out gracefully. */
 1282|      0|				if (mtree->fd >= 0)
  ------------------
  |  Branch (1282:9): [True: 0, False: 0]
  ------------------
 1283|      0|					close(mtree->fd);
 1284|      0|				mtree->fd = -1;
 1285|      0|				if (parsed_kws & MTREE_HAS_OPTIONAL) {
  ------------------
  |  |   81|      0|#define	MTREE_HAS_OPTIONAL	0x0800
  ------------------
  |  Branch (1285:9): [True: 0, False: 0]
  ------------------
 1286|       |					/* It's not an error for an optional
 1287|       |					 * entry to not match disk. */
 1288|      0|					*use_next = 1;
 1289|      0|				} else if (r == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1289:16): [True: 0, False: 0]
  ------------------
 1290|      0|					archive_set_error(&a->archive,
 1291|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1292|      0|					    "mtree specification has different"
 1293|      0|					    " type for %s",
 1294|      0|					    archive_entry_pathname(entry));
 1295|      0|					r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1296|      0|				}
 1297|      0|				return (r);
 1298|      0|			}
 1299|      0|		}
 1300|       |
 1301|       |		/*
 1302|       |		 * If there is a contents file on disk, pick some of the
 1303|       |		 * metadata from that file.  For most of these, we only
 1304|       |		 * set it from the contents if it wasn't already parsed
 1305|       |		 * from the specification.
 1306|       |		 */
 1307|      0|		if (st != NULL) {
  ------------------
  |  Branch (1307:7): [True: 0, False: 0]
  ------------------
 1308|      0|			if (((parsed_kws & MTREE_HAS_DEVICE) == 0 ||
  ------------------
  |  |   69|      0|#define	MTREE_HAS_DEVICE	0x0001
  ------------------
  |  Branch (1308:9): [True: 0, False: 0]
  ------------------
 1309|      0|				(parsed_kws & MTREE_HAS_NOCHANGE) != 0) &&
  ------------------
  |  |   82|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1309:5): [True: 0, False: 0]
  ------------------
 1310|      0|				(archive_entry_filetype(entry) == AE_IFCHR ||
  ------------------
  |  |  219|      0|#define AE_IFCHR	((__LA_MODE_T)0020000)
  ------------------
  |  Branch (1310:6): [True: 0, False: 0]
  ------------------
 1311|      0|				 archive_entry_filetype(entry) == AE_IFBLK))
  ------------------
  |  |  220|      0|#define AE_IFBLK	((__LA_MODE_T)0060000)
  ------------------
  |  Branch (1311:6): [True: 0, False: 0]
  ------------------
 1312|      0|				archive_entry_set_rdev(entry, st->st_rdev);
 1313|      0|			if ((parsed_kws & (MTREE_HAS_GID | MTREE_HAS_GNAME))
  ------------------
  |  |   71|      0|#define	MTREE_HAS_GID		0x0004
  ------------------
              			if ((parsed_kws & (MTREE_HAS_GID | MTREE_HAS_GNAME))
  ------------------
  |  |   72|      0|#define	MTREE_HAS_GNAME		0x0008
  ------------------
  |  Branch (1313:8): [True: 0, False: 0]
  ------------------
 1314|      0|				== 0 ||
 1315|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0)
  ------------------
  |  |   82|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1315:8): [True: 0, False: 0]
  ------------------
 1316|      0|				archive_entry_set_gid(entry, st->st_gid);
 1317|      0|			if ((parsed_kws & (MTREE_HAS_UID | MTREE_HAS_UNAME))
  ------------------
  |  |   78|      0|#define	MTREE_HAS_UID		0x0200
  ------------------
              			if ((parsed_kws & (MTREE_HAS_UID | MTREE_HAS_UNAME))
  ------------------
  |  |   79|      0|#define	MTREE_HAS_UNAME		0x0400
  ------------------
  |  Branch (1317:8): [True: 0, False: 0]
  ------------------
 1318|      0|				== 0 ||
 1319|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0)
  ------------------
  |  |   82|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1319:8): [True: 0, False: 0]
  ------------------
 1320|      0|				archive_entry_set_uid(entry, st->st_uid);
 1321|      0|			if ((parsed_kws & MTREE_HAS_MTIME) == 0 ||
  ------------------
  |  |   73|      0|#define	MTREE_HAS_MTIME		0x0010
  ------------------
  |  Branch (1321:8): [True: 0, False: 0]
  ------------------
 1322|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0) {
  ------------------
  |  |   82|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1322:8): [True: 0, False: 0]
  ------------------
 1323|       |#if HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
 1324|       |				archive_entry_set_mtime(entry, st->st_mtime,
 1325|       |						st->st_mtimespec.tv_nsec);
 1326|       |#elif HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
 1327|      0|				archive_entry_set_mtime(entry, st->st_mtime,
 1328|      0|						st->st_mtim.tv_nsec);
 1329|       |#elif HAVE_STRUCT_STAT_ST_MTIME_N
 1330|       |				archive_entry_set_mtime(entry, st->st_mtime,
 1331|       |						st->st_mtime_n);
 1332|       |#elif HAVE_STRUCT_STAT_ST_UMTIME
 1333|       |				archive_entry_set_mtime(entry, st->st_mtime,
 1334|       |						st->st_umtime*1000);
 1335|       |#elif HAVE_STRUCT_STAT_ST_MTIME_USEC
 1336|       |				archive_entry_set_mtime(entry, st->st_mtime,
 1337|       |						st->st_mtime_usec*1000);
 1338|       |#else
 1339|       |				archive_entry_set_mtime(entry, st->st_mtime, 0);
 1340|       |#endif
 1341|      0|			}
 1342|      0|			if ((parsed_kws & MTREE_HAS_NLINK) == 0 ||
  ------------------
  |  |   74|      0|#define	MTREE_HAS_NLINK		0x0020
  ------------------
  |  Branch (1342:8): [True: 0, False: 0]
  ------------------
 1343|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0)
  ------------------
  |  |   82|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1343:8): [True: 0, False: 0]
  ------------------
 1344|      0|				archive_entry_set_nlink(entry, st->st_nlink);
 1345|      0|			if ((parsed_kws & MTREE_HAS_PERM) == 0 ||
  ------------------
  |  |   75|      0|#define	MTREE_HAS_PERM		0x0040
  ------------------
  |  Branch (1345:8): [True: 0, False: 0]
  ------------------
 1346|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0)
  ------------------
  |  |   82|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1346:8): [True: 0, False: 0]
  ------------------
 1347|      0|				archive_entry_set_perm(entry, st->st_mode);
 1348|      0|			if ((parsed_kws & MTREE_HAS_SIZE) == 0 ||
  ------------------
  |  |   76|      0|#define	MTREE_HAS_SIZE		0x0080
  ------------------
  |  Branch (1348:8): [True: 0, False: 0]
  ------------------
 1349|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0)
  ------------------
  |  |   82|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1349:8): [True: 0, False: 0]
  ------------------
 1350|      0|				archive_entry_set_size(entry, st->st_size);
 1351|      0|			archive_entry_set_ino(entry, st->st_ino);
 1352|      0|			archive_entry_set_dev(entry, st->st_dev);
 1353|       |
 1354|      0|			archive_entry_linkify(mtree->resolver, &entry,
 1355|      0|				&sparse_entry);
 1356|      0|		} else if (parsed_kws & MTREE_HAS_OPTIONAL) {
  ------------------
  |  |   81|      0|#define	MTREE_HAS_OPTIONAL	0x0800
  ------------------
  |  Branch (1356:14): [True: 0, False: 0]
  ------------------
 1357|       |			/*
 1358|       |			 * Couldn't open the entry, stat it or the on-disk type
 1359|       |			 * didn't match.  If this entry is optional, just
 1360|       |			 * ignore it and read the next header entry.
 1361|       |			 */
 1362|      0|			*use_next = 1;
 1363|      0|			return ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1364|      0|		}
 1365|      0|	}
 1366|       |
 1367|  7.68k|	mtree->cur_size = archive_entry_size(entry);
 1368|  7.68k|	mtree->offset = 0;
 1369|       |
 1370|  7.68k|	return r;
 1371|  7.68k|}
archive_read_support_format_mtree.c:parse_line:
 1379|  7.96k|{
 1380|  7.96k|	struct mtree_option *iter;
 1381|  7.96k|	int r = ARCHIVE_OK, r1;
  ------------------
  |  |  233|  7.96k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1382|       |
 1383|  18.2k|	for (iter = mp->options; iter != NULL; iter = iter->next) {
  ------------------
  |  Branch (1383:27): [True: 10.3k, False: 7.96k]
  ------------------
 1384|  10.3k|		r1 = parse_keyword(a, mtree, entry, iter, parsed_kws);
 1385|  10.3k|		if (r1 < r)
  ------------------
  |  Branch (1385:7): [True: 2.90k, False: 7.42k]
  ------------------
 1386|  2.90k|			r = r1;
 1387|  10.3k|	}
 1388|  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) {
  ------------------
  |  |   77|  5.05k|#define	MTREE_HAS_TYPE		0x0100
  ------------------
  |  Branch (1388:6): [True: 5.05k, False: 2.90k]
  |  Branch (1388:25): [True: 4.54k, False: 508]
  ------------------
 1389|  4.54k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  4.54k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1390|  4.54k|		    "Missing type keyword in mtree specification");
 1391|  4.54k|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|  4.54k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1392|  4.54k|	}
 1393|  3.41k|	return (r);
 1394|  7.96k|}
archive_read_support_format_mtree.c:parse_keyword:
 1560|  10.3k|{
 1561|  10.3k|	char *val, *key;
 1562|       |
 1563|  10.3k|	key = opt->value;
 1564|       |
 1565|  10.3k|	if (*key == '\0')
  ------------------
  |  Branch (1565:6): [True: 0, False: 10.3k]
  ------------------
 1566|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1567|       |
 1568|  10.3k|	if (strcmp(key, "nochange") == 0) {
  ------------------
  |  Branch (1568:6): [True: 0, False: 10.3k]
  ------------------
 1569|      0|		*parsed_kws |= MTREE_HAS_NOCHANGE;
  ------------------
  |  |   82|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
 1570|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1571|      0|	}
 1572|  10.3k|	if (strcmp(key, "optional") == 0) {
  ------------------
  |  Branch (1572:6): [True: 22, False: 10.3k]
  ------------------
 1573|     22|		*parsed_kws |= MTREE_HAS_OPTIONAL;
  ------------------
  |  |   81|     22|#define	MTREE_HAS_OPTIONAL	0x0800
  ------------------
 1574|     22|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     22|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1575|     22|	}
 1576|  10.3k|	if (strcmp(key, "ignore") == 0) {
  ------------------
  |  Branch (1576:6): [True: 0, False: 10.3k]
  ------------------
 1577|       |		/*
 1578|       |		 * The mtree processing is not recursive, so
 1579|       |		 * recursion will only happen for explicitly listed
 1580|       |		 * entries.
 1581|       |		 */
 1582|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1583|      0|	}
 1584|       |
 1585|  10.3k|	val = strchr(key, '=');
 1586|  10.3k|	if (val == NULL) {
  ------------------
  |  Branch (1586:6): [True: 5.25k, False: 5.04k]
  ------------------
 1587|  5.25k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  5.25k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1588|  5.25k|		    "Malformed attribute \"%s\" (%d)", key, key[0]);
 1589|  5.25k|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|  5.25k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1590|  5.25k|	}
 1591|       |
 1592|  5.04k|	*val = '\0';
 1593|  5.04k|	++val;
 1594|       |
 1595|  5.04k|	switch (key[0]) {
 1596|      0|	case 'c':
  ------------------
  |  Branch (1596:2): [True: 0, False: 5.04k]
  ------------------
 1597|      0|		if (strcmp(key, "content") == 0
  ------------------
  |  Branch (1597:7): [True: 0, False: 0]
  ------------------
 1598|      0|		    || strcmp(key, "contents") == 0) {
  ------------------
  |  Branch (1598:10): [True: 0, False: 0]
  ------------------
 1599|      0|			parse_escapes(val, NULL);
 1600|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1601|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1602|      0|		}
 1603|      0|		if (strcmp(key, "cksum") == 0)
  ------------------
  |  Branch (1603:7): [True: 0, False: 0]
  ------------------
 1604|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1605|      0|		break;
 1606|  1.56k|	case 'd':
  ------------------
  |  Branch (1606:2): [True: 1.56k, False: 3.48k]
  ------------------
 1607|  1.56k|		if (strcmp(key, "device") == 0) {
  ------------------
  |  Branch (1607:7): [True: 856, False: 705]
  ------------------
 1608|       |			/* stat(2) st_rdev field, e.g. the major/minor IDs
 1609|       |			 * of a char/block special file */
 1610|    856|			int r;
 1611|    856|			dev_t dev;
 1612|       |
 1613|    856|			*parsed_kws |= MTREE_HAS_DEVICE;
  ------------------
  |  |   69|    856|#define	MTREE_HAS_DEVICE	0x0001
  ------------------
 1614|    856|			r = parse_device(&dev, &a->archive, val);
 1615|    856|			if (r == ARCHIVE_OK)
  ------------------
  |  |  233|    856|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1615:8): [True: 9, False: 847]
  ------------------
 1616|      9|				archive_entry_set_rdev(entry, dev);
 1617|    856|			return r;
 1618|    856|		}
 1619|    705|		break;
 1620|    705|	case 'f':
  ------------------
  |  Branch (1620:2): [True: 0, False: 5.04k]
  ------------------
 1621|      0|		if (strcmp(key, "flags") == 0) {
  ------------------
  |  Branch (1621:7): [True: 0, False: 0]
  ------------------
 1622|      0|			*parsed_kws |= MTREE_HAS_FFLAGS;
  ------------------
  |  |   70|      0|#define	MTREE_HAS_FFLAGS	0x0002
  ------------------
 1623|      0|			archive_entry_copy_fflags_text(entry, val);
 1624|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1625|      0|		}
 1626|      0|		break;
 1627|      0|	case 'g':
  ------------------
  |  Branch (1627:2): [True: 0, False: 5.04k]
  ------------------
 1628|      0|		if (strcmp(key, "gid") == 0) {
  ------------------
  |  Branch (1628:7): [True: 0, False: 0]
  ------------------
 1629|      0|			*parsed_kws |= MTREE_HAS_GID;
  ------------------
  |  |   71|      0|#define	MTREE_HAS_GID		0x0004
  ------------------
 1630|      0|			archive_entry_set_gid(entry, mtree_atol(&val, 10));
 1631|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1632|      0|		}
 1633|      0|		if (strcmp(key, "gname") == 0) {
  ------------------
  |  Branch (1633:7): [True: 0, False: 0]
  ------------------
 1634|      0|			*parsed_kws |= MTREE_HAS_GNAME;
  ------------------
  |  |   72|      0|#define	MTREE_HAS_GNAME		0x0008
  ------------------
 1635|      0|			archive_entry_copy_gname(entry, val);
 1636|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1637|      0|		}
 1638|      0|		break;
 1639|    518|	case 'i':
  ------------------
  |  Branch (1639:2): [True: 518, False: 4.53k]
  ------------------
 1640|    518|		if (strcmp(key, "inode") == 0) {
  ------------------
  |  Branch (1640:7): [True: 0, False: 518]
  ------------------
 1641|      0|			archive_entry_set_ino(entry, mtree_atol(&val, 10));
 1642|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1643|      0|		}
 1644|    518|		break;
 1645|    518|	case 'l':
  ------------------
  |  Branch (1645:2): [True: 0, False: 5.04k]
  ------------------
 1646|      0|		if (strcmp(key, "link") == 0) {
  ------------------
  |  Branch (1646:7): [True: 0, False: 0]
  ------------------
 1647|      0|			parse_escapes(val, NULL);
 1648|      0|			archive_entry_copy_symlink(entry, val);
 1649|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1650|      0|		}
 1651|      0|		break;
 1652|      8|	case 'm':
  ------------------
  |  Branch (1652:2): [True: 8, False: 5.04k]
  ------------------
 1653|      8|		if (strcmp(key, "md5") == 0 || strcmp(key, "md5digest") == 0) {
  ------------------
  |  Branch (1653:7): [True: 0, False: 8]
  |  Branch (1653:34): [True: 0, False: 8]
  ------------------
 1654|      0|			return parse_digest(a, entry, val,
 1655|      0|			    ARCHIVE_ENTRY_DIGEST_MD5);
  ------------------
  |  |  444|      0|#define ARCHIVE_ENTRY_DIGEST_MD5              0x00000001
  ------------------
 1656|      0|		}
 1657|      8|		if (strcmp(key, "mode") == 0) {
  ------------------
  |  Branch (1657:7): [True: 4, False: 4]
  ------------------
 1658|      4|			if (val[0] < '0' || val[0] > '7') {
  ------------------
  |  Branch (1658:8): [True: 0, False: 4]
  |  Branch (1658:24): [True: 4, False: 0]
  ------------------
 1659|      4|				archive_set_error(&a->archive,
 1660|      4|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1661|      4|				    "Symbolic or non-octal mode \"%s\" unsupported", val);
 1662|      4|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|      4|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1663|      4|			}
 1664|      0|			*parsed_kws |= MTREE_HAS_PERM;
  ------------------
  |  |   75|      0|#define	MTREE_HAS_PERM		0x0040
  ------------------
 1665|      0|			archive_entry_set_perm(entry, (mode_t)mtree_atol(&val, 8));
 1666|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1667|      4|		}
 1668|      4|		break;
 1669|    413|	case 'n':
  ------------------
  |  Branch (1669:2): [True: 413, False: 4.63k]
  ------------------
 1670|    413|		if (strcmp(key, "nlink") == 0) {
  ------------------
  |  Branch (1670:7): [True: 0, False: 413]
  ------------------
 1671|      0|			*parsed_kws |= MTREE_HAS_NLINK;
  ------------------
  |  |   74|      0|#define	MTREE_HAS_NLINK		0x0020
  ------------------
 1672|      0|			archive_entry_set_nlink(entry,
 1673|      0|				(unsigned int)mtree_atol(&val, 10));
 1674|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1675|      0|		}
 1676|    413|		break;
 1677|    413|	case 'r':
  ------------------
  |  Branch (1677:2): [True: 42, False: 5.00k]
  ------------------
 1678|     42|		if (strcmp(key, "resdevice") == 0) {
  ------------------
  |  Branch (1678:7): [True: 0, False: 42]
  ------------------
 1679|       |			/* stat(2) st_dev field, e.g. the device ID where the
 1680|       |			 * inode resides */
 1681|      0|			int r;
 1682|      0|			dev_t dev;
 1683|       |
 1684|      0|			r = parse_device(&dev, &a->archive, val);
 1685|      0|			if (r == ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1685:8): [True: 0, False: 0]
  ------------------
 1686|      0|				archive_entry_set_dev(entry, dev);
 1687|      0|			return r;
 1688|      0|		}
 1689|     42|		if (strcmp(key, "rmd160") == 0 ||
  ------------------
  |  Branch (1689:7): [True: 0, False: 42]
  ------------------
 1690|     42|		    strcmp(key, "rmd160digest") == 0) {
  ------------------
  |  Branch (1690:7): [True: 0, False: 42]
  ------------------
 1691|      0|			return parse_digest(a, entry, val,
 1692|      0|			    ARCHIVE_ENTRY_DIGEST_RMD160);
  ------------------
  |  |  445|      0|#define ARCHIVE_ENTRY_DIGEST_RMD160           0x00000002
  ------------------
 1693|      0|		}
 1694|     42|		break;
 1695|    528|	case 's':
  ------------------
  |  Branch (1695:2): [True: 528, False: 4.52k]
  ------------------
 1696|    528|		if (strcmp(key, "sha1") == 0 ||
  ------------------
  |  Branch (1696:7): [True: 0, False: 528]
  ------------------
 1697|    528|		    strcmp(key, "sha1digest") == 0) {
  ------------------
  |  Branch (1697:7): [True: 0, False: 528]
  ------------------
 1698|      0|			return parse_digest(a, entry, val,
 1699|      0|			    ARCHIVE_ENTRY_DIGEST_SHA1);
  ------------------
  |  |  446|      0|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
 1700|      0|		}
 1701|    528|		if (strcmp(key, "sha256") == 0 ||
  ------------------
  |  Branch (1701:7): [True: 0, False: 528]
  ------------------
 1702|    528|		    strcmp(key, "sha256digest") == 0) {
  ------------------
  |  Branch (1702:7): [True: 0, False: 528]
  ------------------
 1703|      0|			return parse_digest(a, entry, val,
 1704|      0|			    ARCHIVE_ENTRY_DIGEST_SHA256);
  ------------------
  |  |  447|      0|#define ARCHIVE_ENTRY_DIGEST_SHA256           0x00000004
  ------------------
 1705|      0|		}
 1706|    528|		if (strcmp(key, "sha384") == 0 ||
  ------------------
  |  Branch (1706:7): [True: 2, False: 526]
  ------------------
 1707|    526|		    strcmp(key, "sha384digest") == 0) {
  ------------------
  |  Branch (1707:7): [True: 0, False: 526]
  ------------------
 1708|      2|			return parse_digest(a, entry, val,
 1709|      2|			    ARCHIVE_ENTRY_DIGEST_SHA384);
  ------------------
  |  |  448|      2|#define ARCHIVE_ENTRY_DIGEST_SHA384           0x00000005
  ------------------
 1710|      2|		}
 1711|    526|		if (strcmp(key, "sha512") == 0 ||
  ------------------
  |  Branch (1711:7): [True: 0, False: 526]
  ------------------
 1712|    526|		    strcmp(key, "sha512digest") == 0) {
  ------------------
  |  Branch (1712:7): [True: 521, False: 5]
  ------------------
 1713|    521|			return parse_digest(a, entry, val,
 1714|    521|			    ARCHIVE_ENTRY_DIGEST_SHA512);
  ------------------
  |  |  449|    521|#define ARCHIVE_ENTRY_DIGEST_SHA512           0x00000006
  ------------------
 1715|    521|		}
 1716|      5|		if (strcmp(key, "size") == 0) {
  ------------------
  |  Branch (1716:7): [True: 0, False: 5]
  ------------------
 1717|      0|			archive_entry_set_size(entry, mtree_atol(&val, 10));
 1718|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1719|      0|		}
 1720|      5|		break;
 1721|  1.92k|	case 't':
  ------------------
  |  Branch (1721:2): [True: 1.92k, False: 3.12k]
  ------------------
 1722|  1.92k|		if (strcmp(key, "tags") == 0) {
  ------------------
  |  Branch (1722:7): [True: 0, False: 1.92k]
  ------------------
 1723|       |			/*
 1724|       |			 * Comma delimited list of tags.
 1725|       |			 * Ignore the tags for now, but the interface
 1726|       |			 * should be extended to allow inclusion/exclusion.
 1727|       |			 */
 1728|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1729|      0|		}
 1730|  1.92k|		if (strcmp(key, "time") == 0) {
  ------------------
  |  Branch (1730:7): [True: 1.35k, False: 569]
  ------------------
 1731|  1.35k|			int64_t m;
 1732|  1.35k|			long ns = 0;
 1733|       |
 1734|  1.35k|			*parsed_kws |= MTREE_HAS_MTIME;
  ------------------
  |  |   73|  1.35k|#define	MTREE_HAS_MTIME		0x0010
  ------------------
 1735|  1.35k|			m = mtree_atol(&val, 10);
 1736|       |			/* Replicate an old mtree bug:
 1737|       |			 * 123456789.1 represents 123456789
 1738|       |			 * seconds and 1 nanosecond. */
 1739|  1.35k|			if (*val == '.') {
  ------------------
  |  Branch (1739:8): [True: 1.35k, False: 1]
  ------------------
 1740|  1.35k|				int64_t v;
 1741|       |
 1742|  1.35k|				++val;
 1743|  1.35k|				v = mtree_atol(&val, 10);
 1744|  1.35k|				if (v < 0)
  ------------------
  |  Branch (1744:9): [True: 1.35k, False: 1]
  ------------------
 1745|  1.35k|					ns = 0;
 1746|      1|				else if (v > 999999999)
  ------------------
  |  Branch (1746:14): [True: 0, False: 1]
  ------------------
 1747|      0|					ns = 999999999;
 1748|      1|				else
 1749|      1|					ns = (long)v;
 1750|  1.35k|			}
 1751|  1.35k|			if (m > TIME_MAX)
  ------------------
  |  |  251|  1.35k|#define TIME_MAX (((time_t)0 < (time_t)-1) ? (time_t)~0 :		\
  |  |  ------------------
  |  |  |  Branch (251:19): [Folded, False: 1.35k]
  |  |  ------------------
  |  |  252|  1.35k|	    sizeof(time_t) == sizeof(long long) ? (time_t)LLONG_MAX :	\
  |  |  ------------------
  |  |  |  Branch (252:6): [True: 1.35k, Folded]
  |  |  ------------------
  |  |  253|  1.35k|	    sizeof(time_t) == sizeof(long) ? (time_t)LONG_MAX :		\
  |  |  ------------------
  |  |  |  Branch (253:6): [True: 0, Folded]
  |  |  ------------------
  |  |  254|      0|	    sizeof(time_t) == sizeof(int) ? (time_t)INT_MAX :		\
  |  |  ------------------
  |  |  |  Branch (254:6): [Folded, False: 0]
  |  |  ------------------
  |  |  255|      0|	    sizeof(time_t) == sizeof(short) ? (time_t)SHRT_MAX :	\
  |  |  ------------------
  |  |  |  Branch (255:6): [Folded, False: 0]
  |  |  ------------------
  |  |  256|      0|	    1 /* I give up */)
  ------------------
  |  Branch (1751:8): [True: 0, False: 1.35k]
  ------------------
 1752|      0|				m = TIME_MAX;
  ------------------
  |  |  251|      0|#define TIME_MAX (((time_t)0 < (time_t)-1) ? (time_t)~0 :		\
  |  |  ------------------
  |  |  |  Branch (251:19): [Folded, False: 0]
  |  |  ------------------
  |  |  252|      0|	    sizeof(time_t) == sizeof(long long) ? (time_t)LLONG_MAX :	\
  |  |  ------------------
  |  |  |  Branch (252:6): [True: 0, Folded]
  |  |  ------------------
  |  |  253|      0|	    sizeof(time_t) == sizeof(long) ? (time_t)LONG_MAX :		\
  |  |  ------------------
  |  |  |  Branch (253:6): [True: 0, Folded]
  |  |  ------------------
  |  |  254|      0|	    sizeof(time_t) == sizeof(int) ? (time_t)INT_MAX :		\
  |  |  ------------------
  |  |  |  Branch (254:6): [Folded, False: 0]
  |  |  ------------------
  |  |  255|      0|	    sizeof(time_t) == sizeof(short) ? (time_t)SHRT_MAX :	\
  |  |  ------------------
  |  |  |  Branch (255:6): [Folded, False: 0]
  |  |  ------------------
  |  |  256|      0|	    1 /* I give up */)
  ------------------
 1753|  1.35k|			else if (m < TIME_MIN)
  ------------------
  |  |  259|  1.35k|#define TIME_MIN (((time_t)0 < (time_t)-1) ? (time_t)0 :		\
  |  |  ------------------
  |  |  |  Branch (259:19): [Folded, False: 1.35k]
  |  |  ------------------
  |  |  260|  1.35k|	    sizeof(time_t) == sizeof(long long) ? (time_t)LLONG_MIN :	\
  |  |  ------------------
  |  |  |  Branch (260:6): [True: 1.35k, Folded]
  |  |  ------------------
  |  |  261|  1.35k|	    sizeof(time_t) == sizeof(long) ? (time_t)LONG_MIN :		\
  |  |  ------------------
  |  |  |  Branch (261:6): [True: 0, Folded]
  |  |  ------------------
  |  |  262|      0|	    sizeof(time_t) == sizeof(int) ? (time_t)INT_MIN :		\
  |  |  ------------------
  |  |  |  Branch (262:6): [Folded, False: 0]
  |  |  ------------------
  |  |  263|      0|	    sizeof(time_t) == sizeof(short) ? (time_t)SHRT_MIN :	\
  |  |  ------------------
  |  |  |  Branch (263:6): [Folded, False: 0]
  |  |  ------------------
  |  |  264|      0|	    -1 /* I give up */)
  ------------------
  |  Branch (1753:13): [True: 0, False: 1.35k]
  ------------------
 1754|      0|				m = TIME_MIN;
  ------------------
  |  |  259|      0|#define TIME_MIN (((time_t)0 < (time_t)-1) ? (time_t)0 :		\
  |  |  ------------------
  |  |  |  Branch (259:19): [Folded, False: 0]
  |  |  ------------------
  |  |  260|      0|	    sizeof(time_t) == sizeof(long long) ? (time_t)LLONG_MIN :	\
  |  |  ------------------
  |  |  |  Branch (260:6): [True: 0, Folded]
  |  |  ------------------
  |  |  261|      0|	    sizeof(time_t) == sizeof(long) ? (time_t)LONG_MIN :		\
  |  |  ------------------
  |  |  |  Branch (261:6): [True: 0, Folded]
  |  |  ------------------
  |  |  262|      0|	    sizeof(time_t) == sizeof(int) ? (time_t)INT_MIN :		\
  |  |  ------------------
  |  |  |  Branch (262:6): [Folded, False: 0]
  |  |  ------------------
  |  |  263|      0|	    sizeof(time_t) == sizeof(short) ? (time_t)SHRT_MIN :	\
  |  |  ------------------
  |  |  |  Branch (263:6): [Folded, False: 0]
  |  |  ------------------
  |  |  264|      0|	    -1 /* I give up */)
  ------------------
 1755|  1.35k|			archive_entry_set_mtime(entry, (time_t)m, ns);
 1756|  1.35k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.35k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1757|  1.35k|		}
 1758|    569|		if (strcmp(key, "type") == 0) {
  ------------------
  |  Branch (1758:7): [True: 565, False: 4]
  ------------------
 1759|    565|			switch (val[0]) {
 1760|      0|			case 'b':
  ------------------
  |  Branch (1760:4): [True: 0, False: 565]
  ------------------
 1761|      0|				if (strcmp(val, "block") == 0) {
  ------------------
  |  Branch (1761:9): [True: 0, False: 0]
  ------------------
 1762|      0|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   77|      0|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1763|      0|					archive_entry_set_filetype(entry,
 1764|      0|						AE_IFBLK);
  ------------------
  |  |  220|      0|#define AE_IFBLK	((__LA_MODE_T)0060000)
  ------------------
 1765|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1766|      0|				}
 1767|      0|				break;
 1768|     30|			case 'c':
  ------------------
  |  Branch (1768:4): [True: 30, False: 535]
  ------------------
 1769|     30|				if (strcmp(val, "char") == 0) {
  ------------------
  |  Branch (1769:9): [True: 29, False: 1]
  ------------------
 1770|     29|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   77|     29|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1771|     29|					archive_entry_set_filetype(entry,
 1772|     29|						AE_IFCHR);
  ------------------
  |  |  219|     29|#define AE_IFCHR	((__LA_MODE_T)0020000)
  ------------------
 1773|     29|					return (ARCHIVE_OK);
  ------------------
  |  |  233|     29|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1774|     29|				}
 1775|      1|				break;
 1776|    500|			case 'd':
  ------------------
  |  Branch (1776:4): [True: 500, False: 65]
  ------------------
 1777|    500|				if (strcmp(val, "dir") == 0) {
  ------------------
  |  Branch (1777:9): [True: 498, False: 2]
  ------------------
 1778|    498|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   77|    498|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1779|    498|					archive_entry_set_filetype(entry,
 1780|    498|						AE_IFDIR);
  ------------------
  |  |  221|    498|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1781|    498|					return (ARCHIVE_OK);
  ------------------
  |  |  233|    498|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1782|    498|				}
 1783|      2|				break;
 1784|     33|			case 'f':
  ------------------
  |  Branch (1784:4): [True: 33, False: 532]
  ------------------
 1785|     33|				if (strcmp(val, "fifo") == 0) {
  ------------------
  |  Branch (1785:9): [True: 33, False: 0]
  ------------------
 1786|     33|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   77|     33|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1787|     33|					archive_entry_set_filetype(entry,
 1788|     33|						AE_IFIFO);
  ------------------
  |  |  222|     33|#define AE_IFIFO	((__LA_MODE_T)0010000)
  ------------------
 1789|     33|					return (ARCHIVE_OK);
  ------------------
  |  |  233|     33|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1790|     33|				}
 1791|      0|				if (strcmp(val, "file") == 0) {
  ------------------
  |  Branch (1791:9): [True: 0, False: 0]
  ------------------
 1792|      0|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   77|      0|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1793|      0|					archive_entry_set_filetype(entry,
 1794|      0|						AE_IFREG);
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1795|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1796|      0|				}
 1797|      0|				break;
 1798|      0|			case 'l':
  ------------------
  |  Branch (1798:4): [True: 0, False: 565]
  ------------------
 1799|      0|				if (strcmp(val, "link") == 0) {
  ------------------
  |  Branch (1799:9): [True: 0, False: 0]
  ------------------
 1800|      0|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   77|      0|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1801|      0|					archive_entry_set_filetype(entry,
 1802|      0|						AE_IFLNK);
  ------------------
  |  |  217|      0|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
 1803|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1804|      0|				}
 1805|      0|				break;
 1806|      2|			default:
  ------------------
  |  Branch (1806:4): [True: 2, False: 563]
  ------------------
 1807|      2|				break;
 1808|    565|			}
 1809|      5|			archive_set_error(&a->archive,
 1810|      5|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      5|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1811|      5|			    "Unrecognized file type \"%s\"; "
 1812|      5|			    "assuming \"file\"", val);
 1813|      5|			archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|      5|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1814|      5|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      5|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1815|    565|		}
 1816|      4|		break;
 1817|      4|	case 'u':
  ------------------
  |  Branch (1817:2): [True: 0, False: 5.04k]
  ------------------
 1818|      0|		if (strcmp(key, "uid") == 0) {
  ------------------
  |  Branch (1818:7): [True: 0, False: 0]
  ------------------
 1819|      0|			*parsed_kws |= MTREE_HAS_UID;
  ------------------
  |  |   78|      0|#define	MTREE_HAS_UID		0x0200
  ------------------
 1820|      0|			archive_entry_set_uid(entry, mtree_atol(&val, 10));
 1821|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1822|      0|		}
 1823|      0|		if (strcmp(key, "uname") == 0) {
  ------------------
  |  Branch (1823:7): [True: 0, False: 0]
  ------------------
 1824|      0|			*parsed_kws |= MTREE_HAS_UNAME;
  ------------------
  |  |   79|      0|#define	MTREE_HAS_UNAME		0x0400
  ------------------
 1825|      0|			archive_entry_copy_uname(entry, val);
 1826|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1827|      0|		}
 1828|      0|		break;
 1829|     57|	default:
  ------------------
  |  Branch (1829:2): [True: 57, False: 4.99k]
  ------------------
 1830|     57|		break;
 1831|  5.04k|	}
 1832|  1.74k|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.74k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1833|  1.74k|	    "Unrecognized key %s=%s", key, val);
 1834|  1.74k|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|  1.74k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1835|  5.04k|}
archive_read_support_format_mtree.c:parse_device:
 1421|    856|{
 1422|    856|#define MAX_PACK_ARGS 3
 1423|    856|	unsigned long numbers[MAX_PACK_ARGS];
 1424|    856|	char *p, *dev;
 1425|    856|	int argc;
 1426|    856|	pack_t *pack;
 1427|    856|	dev_t result;
 1428|    856|	const char *error = NULL;
 1429|       |
 1430|    856|	memset(pdev, 0, sizeof(*pdev));
 1431|    856|	if ((dev = strchr(val, ',')) != NULL) {
  ------------------
  |  Branch (1431:6): [True: 854, False: 2]
  ------------------
 1432|       |		/*
 1433|       |		 * Device's major/minor are given in a specified format.
 1434|       |		 * Decode and pack it accordingly.
 1435|       |		 */
 1436|    854|		*dev++ = '\0';
 1437|    854|		if ((pack = pack_find(val)) == NULL) {
  ------------------
  |  Branch (1437:7): [True: 12, False: 842]
  ------------------
 1438|     12|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     12|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1439|     12|			    "Unknown format `%s'", val);
 1440|     12|			return ARCHIVE_WARN;
  ------------------
  |  |  235|     12|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1441|     12|		}
 1442|    842|		argc = 0;
 1443|  1.84k|		while ((p = la_strsep(&dev, ",")) != NULL) {
  ------------------
  |  Branch (1443:10): [True: 1.00k, False: 842]
  ------------------
 1444|  1.00k|			if (*p == '\0') {
  ------------------
  |  Branch (1444:8): [True: 0, False: 1.00k]
  ------------------
 1445|      0|				archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1446|      0|				    "Missing number");
 1447|      0|				return ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1448|      0|			}
 1449|  1.00k|			if (argc >= MAX_PACK_ARGS) {
  ------------------
  |  | 1422|  1.00k|#define MAX_PACK_ARGS 3
  ------------------
  |  Branch (1449:8): [True: 0, False: 1.00k]
  ------------------
 1450|      0|				archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1451|      0|				    "Too many arguments");
 1452|      0|				return ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1453|      0|			}
 1454|  1.00k|			numbers[argc++] = (unsigned long)mtree_atol(&p, 0);
 1455|  1.00k|		}
 1456|    842|		if (argc < 2) {
  ------------------
  |  Branch (1456:7): [True: 756, False: 86]
  ------------------
 1457|    756|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    756|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1458|    756|			    "Not enough arguments");
 1459|    756|			return ARCHIVE_WARN;
  ------------------
  |  |  235|    756|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1460|    756|		}
 1461|     86|		result = (*pack)(argc, numbers, &error);
 1462|     86|		if (error != NULL) {
  ------------------
  |  Branch (1462:7): [True: 79, False: 7]
  ------------------
 1463|     79|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     79|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1464|     79|			    "%s", error);
 1465|     79|			return ARCHIVE_WARN;
  ------------------
  |  |  235|     79|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1466|     79|		}
 1467|     86|	} else {
 1468|       |		/* file system raw value. */
 1469|      2|		result = (dev_t)mtree_atol(&val, 0);
 1470|      2|	}
 1471|      9|	*pdev = result;
 1472|      9|	return ARCHIVE_OK;
  ------------------
  |  |  233|      9|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1473|    856|#undef MAX_PACK_ARGS
 1474|    856|}
archive_read_support_format_mtree.c:la_strsep:
 1407|  1.84k|{
 1408|  1.84k|	char *p, *s;
 1409|  1.84k|	if (sp == NULL || *sp == NULL || **sp == '\0')
  ------------------
  |  Branch (1409:6): [True: 0, False: 1.84k]
  |  Branch (1409:20): [True: 0, False: 1.84k]
  |  Branch (1409:35): [True: 842, False: 1.00k]
  ------------------
 1410|    842|		return(NULL);
 1411|  1.00k|	s = *sp;
 1412|  1.00k|	p = s + strcspn(s, sep);
 1413|  1.00k|	if (*p != '\0')
  ------------------
  |  Branch (1413:6): [True: 165, False: 842]
  ------------------
 1414|    165|		*p++ = '\0';
 1415|  1.00k|	*sp = p;
 1416|  1.00k|	return(s);
 1417|  1.84k|}
archive_read_support_format_mtree.c:mtree_atol:
 1997|  3.71k|{
 1998|  3.71k|	int64_t l;
 1999|  3.71k|	int digit;
 2000|       |
 2001|  3.71k|	if (base == 0) {
  ------------------
  |  Branch (2001:6): [True: 1.00k, False: 2.70k]
  ------------------
 2002|  1.00k|		if (**p != '0')
  ------------------
  |  Branch (2002:7): [True: 1.00k, False: 0]
  ------------------
 2003|  1.00k|			base = 10;
 2004|      0|		else if ((*p)[1] == 'x' || (*p)[1] == 'X') {
  ------------------
  |  Branch (2004:12): [True: 0, False: 0]
  |  Branch (2004:30): [True: 0, False: 0]
  ------------------
 2005|      0|			*p += 2;
 2006|      0|			base = 16;
 2007|      0|		} else {
 2008|      0|			base = 8;
 2009|      0|		}
 2010|  1.00k|	}
 2011|       |
 2012|  3.71k|	if (**p == '-') {
  ------------------
  |  Branch (2012:6): [True: 2.60k, False: 1.10k]
  ------------------
 2013|  2.60k|		++(*p);
 2014|       |
 2015|  2.60k|		l = 0;
 2016|  2.60k|		digit = parsedigit(**p);
 2017|  26.8k|		while (digit >= 0 && digit < base) {
  ------------------
  |  Branch (2017:10): [True: 25.5k, False: 1.25k]
  |  Branch (2017:24): [True: 25.4k, False: 91]
  ------------------
 2018|  25.4k|			if (archive_ckd_mul_i64(&l, l, base) ||
  ------------------
  |  Branch (2018:8): [True: 0, False: 25.4k]
  ------------------
 2019|  25.4k|			    archive_ckd_sub_i64(&l, l, digit))
  ------------------
  |  Branch (2019:8): [True: 1.25k, False: 24.1k]
  ------------------
 2020|  1.25k|				return INT64_MIN;
 2021|  24.1k|			digit = parsedigit(*++(*p));
 2022|  24.1k|		}
 2023|  1.35k|		return l;
 2024|  2.60k|	} else {
 2025|  1.10k|		l = 0;
 2026|  1.10k|		digit = parsedigit(**p);
 2027|  1.94k|		while (digit >= 0 && digit < base) {
  ------------------
  |  Branch (2027:10): [True: 1.85k, False: 95]
  |  Branch (2027:24): [True: 843, False: 1.00k]
  ------------------
 2028|    843|			if (archive_ckd_mul_i64(&l, l, base) ||
  ------------------
  |  Branch (2028:8): [True: 0, False: 843]
  ------------------
 2029|    843|			    archive_ckd_add_i64(&l, l, digit))
  ------------------
  |  Branch (2029:8): [True: 0, False: 843]
  ------------------
 2030|      0|				return INT64_MAX;
 2031|    843|			digit = parsedigit(*++(*p));
 2032|    843|		}
 2033|  1.10k|		return l;
 2034|  1.10k|	}
 2035|  3.71k|}
archive_read_support_format_mtree.c:parsedigit:
 1979|  28.7k|{
 1980|  28.7k|	if (c >= '0' && c <= '9')
  ------------------
  |  Branch (1980:6): [True: 27.3k, False: 1.35k]
  |  Branch (1980:18): [True: 26.2k, False: 1.09k]
  ------------------
 1981|  26.2k|		return c - '0';
 1982|  2.45k|	else if (c >= 'a' && c <= 'f')
  ------------------
  |  Branch (1982:11): [True: 0, False: 2.45k]
  |  Branch (1982:23): [True: 0, False: 0]
  ------------------
 1983|      0|		return 10 + c - 'a';
 1984|  2.45k|	else if (c >= 'A' && c <= 'F')
  ------------------
  |  Branch (1984:11): [True: 1.09k, False: 1.35k]
  |  Branch (1984:23): [True: 1.09k, False: 0]
  ------------------
 1985|  1.09k|		return 10 + c - 'A';
 1986|  1.35k|	else
 1987|  1.35k|		return -1;
 1988|  28.7k|}
archive_read_support_format_mtree.c:parse_digest:
 1495|    523|{
 1496|    523|	unsigned char digest_buf[64];
 1497|    523|	int high, low;
 1498|    523|	size_t i, j, len;
 1499|       |
 1500|    523|	switch (type) {
 1501|      0|	case ARCHIVE_ENTRY_DIGEST_MD5:
  ------------------
  |  |  444|      0|#define ARCHIVE_ENTRY_DIGEST_MD5              0x00000001
  ------------------
  |  Branch (1501:2): [True: 0, False: 523]
  ------------------
 1502|      0|		len = sizeof(entry->digest.md5);
 1503|      0|		break;
 1504|      0|	case ARCHIVE_ENTRY_DIGEST_RMD160:
  ------------------
  |  |  445|      0|#define ARCHIVE_ENTRY_DIGEST_RMD160           0x00000002
  ------------------
  |  Branch (1504:2): [True: 0, False: 523]
  ------------------
 1505|      0|		len = sizeof(entry->digest.rmd160);
 1506|      0|		break;
 1507|      0|	case ARCHIVE_ENTRY_DIGEST_SHA1:
  ------------------
  |  |  446|      0|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
  |  Branch (1507:2): [True: 0, False: 523]
  ------------------
 1508|      0|		len = sizeof(entry->digest.sha1);
 1509|      0|		break;
 1510|      0|	case ARCHIVE_ENTRY_DIGEST_SHA256:
  ------------------
  |  |  447|      0|#define ARCHIVE_ENTRY_DIGEST_SHA256           0x00000004
  ------------------
  |  Branch (1510:2): [True: 0, False: 523]
  ------------------
 1511|      0|		len = sizeof(entry->digest.sha256);
 1512|      0|		break;
 1513|      2|	case ARCHIVE_ENTRY_DIGEST_SHA384:
  ------------------
  |  |  448|      2|#define ARCHIVE_ENTRY_DIGEST_SHA384           0x00000005
  ------------------
  |  Branch (1513:2): [True: 2, False: 521]
  ------------------
 1514|      2|		len = sizeof(entry->digest.sha384);
 1515|      2|		break;
 1516|    521|	case ARCHIVE_ENTRY_DIGEST_SHA512:
  ------------------
  |  |  449|    521|#define ARCHIVE_ENTRY_DIGEST_SHA512           0x00000006
  ------------------
  |  Branch (1516:2): [True: 521, False: 2]
  ------------------
 1517|    521|		len = sizeof(entry->digest.sha512);
 1518|    521|		break;
 1519|      0|	default:
  ------------------
  |  Branch (1519:2): [True: 0, False: 523]
  ------------------
 1520|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1521|      0|			"Internal error: Unknown digest type");
 1522|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1523|    523|	}
 1524|       |
 1525|    523|	if (len > sizeof(digest_buf)) {
  ------------------
  |  Branch (1525:6): [True: 0, False: 523]
  ------------------
 1526|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1527|      0|			"Internal error: Digest storage too large");
 1528|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1529|      0|	}
 1530|       |
 1531|    523|	len *= 2;
 1532|       |
 1533|    523|	if (mtree_strnlen(digest, len+1) != len) {
  ------------------
  |  |  145|    523|#define mtree_strnlen(a,b) strnlen(a,b)
  ------------------
  |  Branch (1533:6): [True: 523, False: 0]
  ------------------
 1534|    523|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    523|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1535|    523|				  "incorrect digest length, ignoring");
 1536|    523|		return ARCHIVE_WARN;
  ------------------
  |  |  235|    523|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1537|    523|	}
 1538|       |
 1539|      0|	for (i = 0, j = 0; i < len; i += 2, j++) {
  ------------------
  |  Branch (1539:21): [True: 0, False: 0]
  ------------------
 1540|      0|		high = parse_hex_nibble(digest[i]);
 1541|      0|		low = parse_hex_nibble(digest[i+1]);
 1542|      0|		if (high == -1 || low == -1) {
  ------------------
  |  Branch (1542:7): [True: 0, False: 0]
  |  Branch (1542:21): [True: 0, False: 0]
  ------------------
 1543|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1544|      0|					  "invalid digest data, ignoring");
 1545|      0|			return ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1546|      0|		}
 1547|       |
 1548|      0|		digest_buf[j] = high << 4 | low;
 1549|      0|	}
 1550|       |
 1551|      0|	return archive_entry_set_digest(entry, type, digest_buf);
 1552|      0|}
archive_read_support_format_mtree.c:read_data:
 1840|  7.68k|{
 1841|  7.68k|	size_t bytes_to_read;
 1842|  7.68k|	ssize_t bytes_read;
 1843|  7.68k|	struct mtree *mtree;
 1844|       |
 1845|  7.68k|	mtree = (struct mtree *)(a->format->data);
 1846|  7.68k|	if (mtree->fd < 0) {
  ------------------
  |  Branch (1846:6): [True: 7.68k, False: 0]
  ------------------
 1847|  7.68k|		*buff = NULL;
 1848|  7.68k|		*offset = 0;
 1849|  7.68k|		*size = 0;
 1850|  7.68k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  7.68k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1851|  7.68k|	}
 1852|      0|	if (mtree->buff == NULL) {
  ------------------
  |  Branch (1852:6): [True: 0, False: 0]
  ------------------
 1853|      0|		mtree->buffsize = 64 * 1024;
 1854|      0|		mtree->buff = malloc(mtree->buffsize);
 1855|      0|		if (mtree->buff == NULL) {
  ------------------
  |  Branch (1855:7): [True: 0, False: 0]
  ------------------
 1856|      0|			archive_set_error(&a->archive, ENOMEM,
 1857|      0|			    "Can't allocate memory");
 1858|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1859|      0|		}
 1860|      0|	}
 1861|       |
 1862|      0|	*buff = mtree->buff;
 1863|      0|	*offset = mtree->offset;
 1864|      0|	if ((int64_t)mtree->buffsize > mtree->cur_size - mtree->offset)
  ------------------
  |  Branch (1864:6): [True: 0, False: 0]
  ------------------
 1865|      0|		bytes_to_read = (size_t)(mtree->cur_size - mtree->offset);
 1866|      0|	else
 1867|      0|		bytes_to_read = mtree->buffsize;
 1868|      0|	bytes_read = read(mtree->fd, mtree->buff, bytes_to_read);
 1869|      0|	if (bytes_read < 0) {
  ------------------
  |  Branch (1869:6): [True: 0, False: 0]
  ------------------
 1870|      0|		archive_set_error(&a->archive, errno, "Can't read");
 1871|      0|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1872|      0|	}
 1873|      0|	if (bytes_read == 0) {
  ------------------
  |  Branch (1873:6): [True: 0, False: 0]
  ------------------
 1874|      0|		*size = 0;
 1875|      0|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1876|      0|	}
 1877|      0|	mtree->offset += bytes_read;
 1878|      0|	*size = bytes_read;
 1879|      0|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1880|      0|}
archive_read_support_format_mtree.c:skip:
 1885|  7.68k|{
 1886|  7.68k|	struct mtree *mtree;
 1887|       |
 1888|  7.68k|	mtree = (struct mtree *)(a->format->data);
 1889|  7.68k|	if (mtree->fd >= 0) {
  ------------------
  |  Branch (1889:6): [True: 0, False: 7.68k]
  ------------------
 1890|      0|		close(mtree->fd);
 1891|      0|		mtree->fd = -1;
 1892|      0|	}
 1893|  7.68k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  7.68k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1894|  7.68k|}

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

archive_read_support_format_rar5:
 4465|  2.49k|int archive_read_support_format_rar5(struct archive *_a) {
 4466|  2.49k|	struct archive_read* ar;
 4467|  2.49k|	int ret;
 4468|  2.49k|	struct rar5* rar;
 4469|       |
 4470|  2.49k|	if(ARCHIVE_OK != (ret = get_archive_read(_a, &ar)))
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4470:5): [True: 0, False: 2.49k]
  ------------------
 4471|      0|		return ret;
 4472|       |
 4473|  2.49k|	rar = malloc(sizeof(*rar));
 4474|  2.49k|	if(rar == NULL) {
  ------------------
  |  Branch (4474:5): [True: 0, False: 2.49k]
  ------------------
 4475|      0|		archive_set_error(&ar->archive, ENOMEM,
 4476|      0|		    "Can't allocate rar5 data");
 4477|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4478|      0|	}
 4479|       |
 4480|  2.49k|	if(ARCHIVE_OK != rar5_init(rar)) {
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4480:5): [True: 0, False: 2.49k]
  ------------------
 4481|      0|		archive_set_error(&ar->archive, ENOMEM,
 4482|      0|		    "Can't allocate rar5 filter buffer");
 4483|      0|		free(rar);
 4484|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4485|      0|	}
 4486|       |
 4487|  2.49k|	ret = __archive_read_register_format(ar,
 4488|  2.49k|	    rar,
 4489|  2.49k|	    "rar5",
 4490|  2.49k|	    rar5_bid,
 4491|  2.49k|	    rar5_options,
 4492|  2.49k|	    rar5_read_header,
 4493|  2.49k|	    rar5_read_data,
 4494|  2.49k|	    rar5_read_data_skip,
 4495|  2.49k|	    rar5_seek_data,
 4496|  2.49k|	    rar5_cleanup,
 4497|  2.49k|	    rar5_capabilities,
 4498|  2.49k|	    rar5_has_encrypted_entries);
 4499|       |
 4500|  2.49k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4500:5): [True: 0, False: 2.49k]
  ------------------
 4501|      0|		rar5_deinit(rar);
 4502|      0|		free(rar);
 4503|      0|	}
 4504|       |
 4505|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4506|  2.49k|}
archive_read_support_format_rar5.c:get_archive_read:
  897|  2.49k|{
  898|  2.49k|	*ar = (struct archive_read*) a;
  899|  2.49k|	archive_check_magic(a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  177|  2.49k|	do { \
  |  |  178|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  2.49k|			(allowed_states), (function_name)); \
  |  |  180|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  181|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  900|  2.49k|	    "archive_read_support_format_rar5");
  901|       |
  902|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  903|  2.49k|}
archive_read_support_format_rar5.c:rar5_init:
 4445|  2.49k|static int rar5_init(struct rar5* rar) {
 4446|  2.49k|	memset(rar, 0, sizeof(struct rar5));
 4447|       |
 4448|  2.49k|	if(CDE_OK != cdeque_init(&rar->cstate.filters, 8192))
  ------------------
  |  Branch (4448:5): [True: 0, False: 2.49k]
  ------------------
 4449|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4450|       |
 4451|       |	/*
 4452|       |	 * Until enough data has been read, we cannot tell about
 4453|       |	 * any encrypted entries yet.
 4454|       |	 */
 4455|  2.49k|	rar->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|  2.49k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4456|       |
 4457|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4458|  2.49k|}
archive_read_support_format_rar5.c:cdeque_init:
  395|  2.49k|static int cdeque_init(struct cdeque* d, int max_capacity_power_of_2) {
  396|  2.49k|	if(d == NULL || max_capacity_power_of_2 == 0)
  ------------------
  |  Branch (396:5): [True: 0, False: 2.49k]
  |  Branch (396:18): [True: 0, False: 2.49k]
  ------------------
  397|      0|		return CDE_PARAM;
  398|       |
  399|  2.49k|	d->cap_mask = max_capacity_power_of_2 - 1;
  400|  2.49k|	d->arr = NULL;
  401|       |
  402|  2.49k|	if((max_capacity_power_of_2 & d->cap_mask) != 0)
  ------------------
  |  Branch (402:5): [True: 0, False: 2.49k]
  ------------------
  403|      0|		return CDE_PARAM;
  404|       |
  405|  2.49k|	cdeque_clear(d);
  406|  2.49k|	d->arr = malloc(sizeof(void*) * max_capacity_power_of_2);
  407|       |
  408|  2.49k|	return d->arr ? CDE_OK : CDE_ALLOC;
  ------------------
  |  Branch (408:9): [True: 2.49k, False: 0]
  ------------------
  409|  2.49k|}
archive_read_support_format_rar5.c:cdeque_clear:
  386|  5.52k|static void cdeque_clear(struct cdeque* d) {
  387|  5.52k|	d->size = 0;
  388|  5.52k|	d->beg_pos = 0;
  389|  5.52k|	d->end_pos = 0;
  390|  5.52k|}
archive_read_support_format_rar5.c:rar5_bid:
 1176|  2.45k|static int rar5_bid(struct archive_read* a, int best_bid) {
 1177|  2.45k|	int my_bid;
 1178|       |
 1179|  2.45k|	if(best_bid > 30)
  ------------------
  |  Branch (1179:5): [True: 975, False: 1.48k]
  ------------------
 1180|    975|		return -1;
 1181|       |
 1182|  1.48k|	my_bid = bid_standard(a);
 1183|  1.48k|	if(my_bid > -1) {
  ------------------
  |  Branch (1183:5): [True: 359, False: 1.12k]
  ------------------
 1184|    359|		return my_bid;
 1185|    359|	}
 1186|  1.12k|	my_bid = bid_sfx(a);
 1187|  1.12k|	if (my_bid > -1) {
  ------------------
  |  Branch (1187:6): [True: 1.10k, False: 24]
  ------------------
 1188|  1.10k|		return my_bid;
 1189|  1.10k|	}
 1190|       |
 1191|     24|	return -1;
 1192|  1.12k|}
archive_read_support_format_rar5.c:bid_standard:
 1123|  1.48k|static int bid_standard(struct archive_read* a) {
 1124|  1.48k|	const uint8_t* p;
 1125|  1.48k|	char signature[sizeof(rar5_signature_xor)];
 1126|       |
 1127|  1.48k|	rar5_signature(signature);
 1128|       |
 1129|  1.48k|	if(!read_ahead(a, sizeof(rar5_signature_xor), &p))
  ------------------
  |  Branch (1129:5): [True: 24, False: 1.45k]
  ------------------
 1130|     24|		return -1;
 1131|       |
 1132|  1.45k|	if(!memcmp(signature, p, sizeof(rar5_signature_xor)))
  ------------------
  |  Branch (1132:5): [True: 359, False: 1.10k]
  ------------------
 1133|    359|		return 30;
 1134|       |
 1135|  1.10k|	return -1;
 1136|  1.45k|}
archive_read_support_format_rar5.c:rar5_signature:
 4269|  4.69k|static void rar5_signature(char *buf) {
 4270|  4.69k|		size_t i;
 4271|       |
 4272|  42.2k|		for(i = 0; i < sizeof(rar5_signature_xor); i++) {
  ------------------
  |  Branch (4272:14): [True: 37.5k, False: 4.69k]
  ------------------
 4273|  37.5k|			buf[i] = rar5_signature_xor[i] ^ 0xA1;
 4274|  37.5k|		}
 4275|  4.69k|}
archive_read_support_format_rar5.c:read_ahead:
  907|   123k|{
  908|   123k|	if(!ptr)
  ------------------
  |  Branch (908:5): [True: 0, False: 123k]
  ------------------
  909|      0|		return 0;
  910|       |
  911|   123k|	*ptr = __archive_read_ahead(a, how_many, NULL);
  912|   123k|	if(*ptr == NULL) {
  ------------------
  |  Branch (912:5): [True: 310, False: 123k]
  ------------------
  913|    310|		return 0;
  914|    310|	}
  915|       |
  916|   123k|	return 1;
  917|   123k|}
archive_read_support_format_rar5.c:bid_sfx:
 1139|  1.12k|{
 1140|  1.12k|	const char *p;
 1141|       |
 1142|  1.12k|	if ((p = __archive_read_ahead(a, 7, NULL)) == NULL)
  ------------------
  |  Branch (1142:6): [True: 24, False: 1.10k]
  ------------------
 1143|     24|		return -1;
 1144|       |
 1145|  1.10k|	if ((p[0] == 'M' && p[1] == 'Z') || memcmp(p, "\x7F\x45LF", 4) == 0) {
  ------------------
  |  Branch (1145:7): [True: 60, False: 1.04k]
  |  Branch (1145:22): [True: 60, False: 0]
  |  Branch (1145:38): [True: 15, False: 1.02k]
  ------------------
 1146|       |		/* This is a PE file */
 1147|     75|		char signature[sizeof(rar5_signature_xor)];
 1148|     75|		ssize_t offset = 0x10000;
 1149|     75|		ssize_t window = 4096;
 1150|     75|		ssize_t bytes_avail;
 1151|       |
 1152|     75|		rar5_signature(signature);
 1153|       |
 1154|    564|		while (offset + window <= (1024 * 512)) {
  ------------------
  |  Branch (1154:10): [True: 556, False: 8]
  ------------------
 1155|    556|			const char *buff = __archive_read_ahead(a, offset + window, &bytes_avail);
 1156|    556|			if (buff == NULL) {
  ------------------
  |  Branch (1156:8): [True: 438, False: 118]
  ------------------
 1157|       |				/* Remaining bytes are less than window. */
 1158|    438|				window >>= 1;
 1159|    438|				if (window < 0x40)
  ------------------
  |  Branch (1159:9): [True: 62, False: 376]
  ------------------
 1160|     62|					return 0;
 1161|    376|				continue;
 1162|    438|			}
 1163|    118|			p = buff + offset;
 1164|   427k|			while (p + 8 < buff + bytes_avail) {
  ------------------
  |  Branch (1164:11): [True: 427k, False: 113]
  ------------------
 1165|   427k|				if (memcmp(p, signature, sizeof(signature)) == 0)
  ------------------
  |  Branch (1165:9): [True: 5, False: 427k]
  ------------------
 1166|      5|					return 30;
 1167|   427k|				p += 0x10;
 1168|   427k|			}
 1169|    113|			offset = p - buff;
 1170|    113|		}
 1171|     75|	}
 1172|       |
 1173|  1.03k|	return 0;
 1174|  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:
  517|  83.8k|static inline struct rar5* get_context(struct archive_read* a) {
  518|  83.8k|	return (struct rar5*) a->format->data;
  519|  83.8k|}
archive_read_support_format_rar5.c:init_header:
 1207|    262|static void init_header(struct archive_read* a) {
 1208|    262|	a->archive.archive_format = ARCHIVE_FORMAT_RAR_V5;
  ------------------
  |  |  387|    262|#define	ARCHIVE_FORMAT_RAR_V5			0x100000
  ------------------
 1209|    262|	a->archive.archive_format_name = "RAR5";
 1210|    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:
  919|   117k|static int consume(struct archive_read* a, int64_t how_many) {
  920|   117k|	int ret;
  921|       |
  922|   117k|	ret = how_many == __archive_read_consume(a, how_many)
  ------------------
  |  Branch (922:8): [True: 117k, False: 62]
  ------------------
  923|   117k|		? ARCHIVE_OK
  ------------------
  |  |  233|   117k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  924|   117k|		: ARCHIVE_FATAL;
  ------------------
  |  |  239|   117k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  925|       |
  926|   117k|	return ret;
  927|   117k|}
archive_read_support_format_rar5.c:process_base_block:
 2298|  7.39k|{
 2299|  7.39k|	const size_t SMALLEST_RAR5_BLOCK_SIZE = 3;
 2300|       |
 2301|  7.39k|	struct rar5* rar = get_context(a);
 2302|  7.39k|	uint32_t hdr_crc, computed_crc;
 2303|  7.39k|	size_t raw_hdr_size = 0, hdr_size_len, hdr_size;
 2304|  7.39k|	size_t header_id = 0;
 2305|  7.39k|	size_t header_flags = 0;
 2306|  7.39k|	const uint8_t* p;
 2307|  7.39k|	const uint8_t* body_start;
 2308|  7.39k|	int ret;
 2309|       |
 2310|  7.39k|	enum HEADER_TYPE {
 2311|  7.39k|		HEAD_MARK    = 0x00, HEAD_MAIN  = 0x01, HEAD_FILE   = 0x02,
 2312|  7.39k|		HEAD_SERVICE = 0x03, HEAD_CRYPT = 0x04, HEAD_ENDARC = 0x05,
 2313|  7.39k|		HEAD_UNKNOWN = 0xff,
 2314|  7.39k|	};
 2315|       |
 2316|       |	/* Skip any unprocessed data for this file. */
 2317|  7.39k|	ret = skip_unprocessed_bytes(a);
 2318|  7.39k|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  7.39k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2318:5): [True: 20, False: 7.37k]
  ------------------
 2319|     20|		return ret;
 2320|       |
 2321|       |	/* Read the expected CRC32 checksum. */
 2322|  7.37k|	if(!read_u32(a, &hdr_crc)) {
  ------------------
  |  Branch (2322:5): [True: 0, False: 7.37k]
  ------------------
 2323|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2324|      0|	}
 2325|       |
 2326|       |	/* Read header size. */
 2327|  7.37k|	if(!read_var_sized(a, &raw_hdr_size, &hdr_size_len)) {
  ------------------
  |  Branch (2327:5): [True: 2, False: 7.36k]
  ------------------
 2328|      2|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2329|      2|	}
 2330|       |
 2331|  7.36k|	hdr_size = raw_hdr_size + hdr_size_len;
 2332|       |
 2333|       |	/* Sanity check, maximum header size for RAR5 is 2MB. */
 2334|  7.36k|	if(hdr_size > (2 * 1024 * 1024)) {
  ------------------
  |  Branch (2334:5): [True: 14, False: 7.35k]
  ------------------
 2335|     14|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     14|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2336|     14|		    "Base block header is too large");
 2337|       |
 2338|     14|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     14|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2339|     14|	}
 2340|       |
 2341|       |	/* Additional sanity checks to weed out invalid files. */
 2342|  7.35k|	if(raw_hdr_size == 0 || hdr_size_len == 0 ||
  ------------------
  |  Branch (2342:5): [True: 32, False: 7.32k]
  |  Branch (2342:26): [True: 0, False: 7.32k]
  ------------------
 2343|  7.32k|		hdr_size < SMALLEST_RAR5_BLOCK_SIZE)
  ------------------
  |  Branch (2343:3): [True: 17, False: 7.30k]
  ------------------
 2344|     49|	{
 2345|     49|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     49|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2346|     49|		    "Too small block encountered (%zu bytes)",
 2347|     49|		    raw_hdr_size);
 2348|       |
 2349|     49|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     49|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2350|     49|	}
 2351|       |
 2352|       |	/* Read the whole header data into memory, maximum memory use here is
 2353|       |	 * 2MB. */
 2354|  7.30k|	if(!read_ahead(a, hdr_size, &p)) {
  ------------------
  |  Branch (2354:5): [True: 21, False: 7.28k]
  ------------------
 2355|     21|		return ARCHIVE_EOF;
  ------------------
  |  |  232|     21|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2356|     21|	}
 2357|       |
 2358|       |	/* Verify the CRC32 of the header data. */
 2359|  7.28k|	computed_crc = (uint32_t) crc32(0, p, (int) hdr_size);
 2360|  7.28k|	if(computed_crc != hdr_crc) {
  ------------------
  |  Branch (2360:5): [True: 7.18k, False: 99]
  ------------------
 2361|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 2362|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 2363|       |		    "Header CRC error");
 2364|       |
 2365|       |		return ARCHIVE_FATAL;
 2366|       |#endif
 2367|  7.18k|	}
 2368|       |
 2369|       |	/* Remember the first byte of the block body so we can later skip
 2370|       |	 * any bytes the sub-parser leaves unconsumed. */
 2371|  7.28k|	body_start = p + hdr_size_len;
 2372|       |
 2373|       |	/* If the checksum is OK, we proceed with parsing. */
 2374|  7.28k|	if(ARCHIVE_OK != consume(a, hdr_size_len)) {
  ------------------
  |  |  233|  7.28k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2374:5): [True: 0, False: 7.28k]
  ------------------
 2375|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2376|      0|	}
 2377|       |
 2378|  7.28k|	if(!read_var_sized(a, &header_id, NULL))
  ------------------
  |  Branch (2378:5): [True: 0, False: 7.28k]
  ------------------
 2379|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2380|       |
 2381|  7.28k|	if(!read_var_sized(a, &header_flags, 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|	rar->generic.split_after = (header_flags & HFL_SPLIT_AFTER) > 0;
 2385|  7.28k|	rar->generic.split_before = (header_flags & HFL_SPLIT_BEFORE) > 0;
 2386|  7.28k|	rar->generic.size = (int)hdr_size;
 2387|  7.28k|	rar->generic.last_header_id = (int)header_id;
 2388|  7.28k|	rar->main.endarc = 0;
 2389|       |
 2390|       |	/* Those are possible header ids in RARv5. */
 2391|  7.28k|	switch(header_id) {
 2392|    304|		case HEAD_MAIN:
  ------------------
  |  Branch (2392:3): [True: 304, False: 6.98k]
  ------------------
 2393|    304|			ret = process_head_main(a, rar, entry, header_flags);
 2394|       |
 2395|       |			/* Main header doesn't have any files in it, so it's
 2396|       |			 * pointless to return to the caller. Retry to next
 2397|       |			 * header, which should be HEAD_FILE/HEAD_SERVICE. */
 2398|    304|			if(ret == ARCHIVE_OK) {
  ------------------
  |  |  233|    304|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2398:7): [True: 256, False: 48]
  ------------------
 2399|    256|				rar5_skip_remaining_block(a, body_start,
 2400|    256|				    raw_hdr_size);
 2401|    256|				return ARCHIVE_RETRY;
  ------------------
  |  |  234|    256|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2402|    256|			}
 2403|       |
 2404|     48|			return ret;
 2405|    156|		case HEAD_SERVICE:
  ------------------
  |  Branch (2405:3): [True: 156, False: 7.12k]
  ------------------
 2406|    156|			ret = process_head_service(a, rar, entry, header_flags);
 2407|    156|			return ret;
 2408|  3.44k|		case HEAD_FILE:
  ------------------
  |  Branch (2408:3): [True: 3.44k, False: 3.84k]
  ------------------
 2409|  3.44k|			ret = process_head_file(a, rar, entry, header_flags);
 2410|  3.44k|			return ret;
 2411|     20|		case HEAD_CRYPT:
  ------------------
  |  Branch (2411:3): [True: 20, False: 7.26k]
  ------------------
 2412|     20|			archive_entry_set_is_metadata_encrypted(entry, 1);
 2413|     20|			archive_entry_set_is_data_encrypted(entry, 1);
 2414|     20|			rar->has_encrypted_entries = 1;
 2415|     20|			rar->headers_are_encrypted = 1;
 2416|     20|			archive_set_error(&a->archive,
 2417|     20|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     20|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2418|     20|			    "Encryption is not supported");
 2419|     20|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|     20|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2420|  3.16k|		case HEAD_ENDARC:
  ------------------
  |  Branch (2420:3): [True: 3.16k, False: 4.12k]
  ------------------
 2421|  3.16k|			rar->main.endarc = 1;
 2422|       |
 2423|       |			/* After encountering an end of file marker, we need
 2424|       |			 * to take into consideration if this archive is
 2425|       |			 * continued in another file (i.e. is it part01.rar:
 2426|       |			 * is there a part02.rar?) */
 2427|  3.16k|			if(rar->main.volume) {
  ------------------
  |  Branch (2427:7): [True: 3.12k, False: 36]
  ------------------
 2428|       |				/* In case there is part02.rar, position the
 2429|       |				 * read pointer in a proper place, so we can
 2430|       |				 * resume parsing. */
 2431|  3.12k|				ret = scan_for_signature(a);
 2432|  3.12k|				if(ret == ARCHIVE_FATAL) {
  ------------------
  |  |  239|  3.12k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2432:8): [True: 0, False: 3.12k]
  ------------------
 2433|      0|					return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2434|  3.12k|				} else {
 2435|  3.12k|					if(rar->vol.expected_vol_no ==
  ------------------
  |  Branch (2435:9): [True: 0, False: 3.12k]
  ------------------
 2436|  3.12k|					    UINT_MAX) {
 2437|      0|						archive_set_error(&a->archive,
 2438|      0|						    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2439|      0|						    "Header error");
 2440|      0|							return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2441|      0|					}
 2442|       |
 2443|  3.12k|					rar->vol.expected_vol_no =
 2444|  3.12k|					    rar->main.vol_no + 1;
 2445|  3.12k|					return ARCHIVE_OK;
  ------------------
  |  |  233|  3.12k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2446|  3.12k|				}
 2447|  3.12k|			} else {
 2448|     36|				return ARCHIVE_EOF;
  ------------------
  |  |  232|     36|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2449|     36|			}
 2450|     52|		case HEAD_MARK:
  ------------------
  |  Branch (2450:3): [True: 52, False: 7.23k]
  ------------------
 2451|     52|			return ARCHIVE_EOF;
  ------------------
  |  |  232|     52|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2452|    144|		default:
  ------------------
  |  Branch (2452:3): [True: 144, False: 7.14k]
  ------------------
 2453|    144|			if((header_flags & HFL_SKIP_IF_UNKNOWN) == 0) {
  ------------------
  |  Branch (2453:7): [True: 79, False: 65]
  ------------------
 2454|     79|				archive_set_error(&a->archive,
 2455|     79|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     79|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2456|     79|				    "Header type error");
 2457|     79|				return ARCHIVE_FATAL;
  ------------------
  |  |  239|     79|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2458|     79|			} else {
 2459|       |				/* If the block is marked as 'skip if unknown',
 2460|       |				 * do as the flag says: skip the block
 2461|       |				 * instead on failing on it. */
 2462|     65|				rar5_skip_remaining_block(a, body_start,
 2463|     65|				    raw_hdr_size);
 2464|     65|				return ARCHIVE_RETRY;
  ------------------
  |  |  234|     65|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2465|     65|			}
 2466|  7.28k|	}
 2467|       |
 2468|      0|#if !defined WIN32
 2469|       |	// Not reached.
 2470|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 2471|      0|	    "Internal unpacker error");
 2472|      0|	return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2473|  7.28k|#endif
 2474|  7.28k|}
archive_read_support_format_rar5.c:skip_unprocessed_bytes:
 2188|  7.39k|static int skip_unprocessed_bytes(struct archive_read* a) {
 2189|  7.39k|	struct rar5* rar = get_context(a);
 2190|  7.39k|	int ret;
 2191|       |
 2192|  7.39k|	if(rar->file.bytes_remaining) {
  ------------------
  |  Branch (2192:5): [True: 2.95k, False: 4.43k]
  ------------------
 2193|       |		/* Use different skipping method in block merging mode than in
 2194|       |		 * normal mode. If merge mode is active, rar5_read_data_skip
 2195|       |		 * can't be used, because it could allow recursive use of
 2196|       |		 * merge_block() * function, and this function doesn't support
 2197|       |		 * recursive use. */
 2198|  2.95k|		if(rar->merge_mode) {
  ------------------
  |  Branch (2198:6): [True: 2.87k, False: 80]
  ------------------
 2199|       |			/* Discard whole merged block. This is valid in solid
 2200|       |			 * mode as well, because the code will discard blocks
 2201|       |			 * only if those blocks are safe to discard (i.e.
 2202|       |			 * they're not FILE blocks).  */
 2203|  2.87k|			ret = consume(a, rar->file.bytes_remaining);
 2204|  2.87k|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  2.87k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2204:7): [True: 0, False: 2.87k]
  ------------------
 2205|      0|				return ret;
 2206|      0|			}
 2207|  2.87k|			rar->file.bytes_remaining = 0;
 2208|  2.87k|		} else {
 2209|       |			/* If we're not in merge mode, use safe skipping code.
 2210|       |			 * This will ensure we'll handle solid archives
 2211|       |			 * properly. */
 2212|     80|			ret = rar5_read_data_skip(a);
 2213|     80|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|     80|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2213:7): [True: 20, False: 60]
  ------------------
 2214|     20|				return ret;
 2215|     20|			}
 2216|     80|		}
 2217|  2.95k|	}
 2218|       |
 2219|  7.37k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  7.37k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2220|  7.39k|}
archive_read_support_format_rar5.c:read_u32:
 1105|  11.4k|static char read_u32(struct archive_read* a, uint32_t* pvalue) {
 1106|  11.4k|	const uint8_t* p;
 1107|  11.4k|	if(!read_ahead(a, 4, &p))
  ------------------
  |  Branch (1107:5): [True: 1, False: 11.4k]
  ------------------
 1108|      1|		return 0;
 1109|       |
 1110|  11.4k|	*pvalue = archive_le32dec(p);
 1111|  11.4k|	return ARCHIVE_OK == consume(a, 4);
  ------------------
  |  |  233|  11.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1112|  11.4k|}
archive_read_support_format_rar5.c:read_var_sized:
 1019|  60.6k|{
 1020|  60.6k|	uint64_t v;
 1021|  60.6k|	uint64_t v_size = 0;
 1022|       |
 1023|  60.6k|	const int ret = pvalue_len ? read_var(a, &v, &v_size)
  ------------------
  |  Branch (1023:18): [True: 21.3k, False: 39.3k]
  ------------------
 1024|  60.6k|				   : read_var(a, &v, NULL);
 1025|       |
 1026|  60.6k|	if(ret == 1 && pvalue) {
  ------------------
  |  Branch (1026:5): [True: 60.6k, False: 3]
  |  Branch (1026:17): [True: 60.6k, False: 0]
  ------------------
 1027|  60.6k|		*pvalue = (size_t) v;
 1028|  60.6k|	}
 1029|       |
 1030|  60.6k|	if(pvalue_len) {
  ------------------
  |  Branch (1030:5): [True: 21.3k, False: 39.3k]
  ------------------
 1031|       |		/* Possible data truncation should be safe. */
 1032|  21.3k|		*pvalue_len = (size_t) v_size;
 1033|  21.3k|	}
 1034|       |
 1035|  60.6k|	return ret;
 1036|  60.6k|}
archive_read_support_format_rar5.c:read_var:
  948|  90.1k|{
  949|  90.1k|	uint64_t result = 0;
  950|  90.1k|	size_t shift, i;
  951|  90.1k|	const uint8_t* p;
  952|  90.1k|	uint8_t b;
  953|       |
  954|       |	/* We will read maximum of 8 bytes. We don't have to handle the
  955|       |	 * situation to read the RAR5 variable-sized value stored at the end of
  956|       |	 * the file, because such situation will never happen. */
  957|  90.1k|	if(!read_ahead(a, 8, &p))
  ------------------
  |  Branch (957:5): [True: 10, False: 90.1k]
  ------------------
  958|     10|		return 0;
  959|       |
  960|   162k|	for(shift = 0, i = 0; i < 8; i++, shift += 7) {
  ------------------
  |  Branch (960:24): [True: 157k, False: 5.21k]
  ------------------
  961|   157k|		b = p[i];
  962|       |
  963|       |		/* Strip the MSB from the input byte and add the resulting
  964|       |		 * number to the `result`. */
  965|   157k|		result += (b & (uint64_t)0x7F) << shift;
  966|       |
  967|       |		/* MSB set to 1 means we need to continue decoding process.
  968|       |		 * MSB set to 0 means we're done.
  969|       |		 *
  970|       |		 * This conditional checks for the second case. */
  971|   157k|		if((b & 0x80) == 0) {
  ------------------
  |  Branch (971:6): [True: 84.9k, False: 72.3k]
  ------------------
  972|  84.9k|			if(pvalue) {
  ------------------
  |  Branch (972:7): [True: 84.9k, False: 0]
  ------------------
  973|  84.9k|				*pvalue = result;
  974|  84.9k|			}
  975|       |
  976|       |			/* If the caller has passed the `pvalue_len` pointer,
  977|       |			 * store the number of consumed bytes in it and do NOT
  978|       |			 * consume those bytes, since the caller has all the
  979|       |			 * information it needs to perform */
  980|  84.9k|			if(pvalue_len) {
  ------------------
  |  Branch (980:7): [True: 41.1k, False: 43.8k]
  ------------------
  981|  41.1k|				*pvalue_len = 1 + i;
  982|  43.8k|			} else {
  983|       |				/* If the caller did not provide the
  984|       |				 * `pvalue_len` pointer, it will not have the
  985|       |				 * possibility to advance the file pointer,
  986|       |				 * because it will not know how many bytes it
  987|       |				 * needs to consume. This is why we handle
  988|       |				 * such situation here automatically. */
  989|  43.8k|				if(ARCHIVE_OK != consume(a, 1 + i)) {
  ------------------
  |  |  233|  43.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (989:8): [True: 0, False: 43.8k]
  ------------------
  990|      0|					return 0;
  991|      0|				}
  992|  43.8k|			}
  993|       |
  994|       |			/* End of decoding process, return success. */
  995|  84.9k|			return 1;
  996|  84.9k|		}
  997|   157k|	}
  998|       |
  999|       |	/* The decoded value takes the maximum number of 8 bytes.
 1000|       |	 * It's a maximum number of bytes, so end decoding process here
 1001|       |	 * even if the first bit of last byte is 1. */
 1002|  5.21k|	if(pvalue) {
  ------------------
  |  Branch (1002:5): [True: 5.21k, False: 0]
  ------------------
 1003|  5.21k|		*pvalue = result;
 1004|  5.21k|	}
 1005|       |
 1006|  5.21k|	if(pvalue_len) {
  ------------------
  |  Branch (1006:5): [True: 5.18k, False: 33]
  ------------------
 1007|  5.18k|		*pvalue_len = 9;
 1008|  5.18k|	} else {
 1009|     33|		if(ARCHIVE_OK != consume(a, 9)) {
  ------------------
  |  |  233|     33|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1009:6): [True: 0, False: 33]
  ------------------
 1010|      0|			return 0;
 1011|      0|		}
 1012|     33|	}
 1013|       |
 1014|  5.21k|	return 1;
 1015|  5.21k|}
archive_read_support_format_rar5.c:process_head_main:
 2082|    304|{
 2083|    304|	int ret;
 2084|    304|	uint64_t extra_data_size = 0;
 2085|    304|	size_t extra_field_size = 0;
 2086|    304|	size_t extra_field_id = 0;
 2087|    304|	size_t archive_flags = 0;
 2088|       |
 2089|    304|	enum MAIN_FLAGS {
 2090|    304|		VOLUME = 0x0001,         /* multi-volume archive */
 2091|    304|		VOLUME_NUMBER = 0x0002,  /* volume number, first vol doesn't
 2092|       |					  * have it */
 2093|    304|		SOLID = 0x0004,          /* solid archive */
 2094|    304|		PROTECT = 0x0008,        /* contains Recovery info */
 2095|    304|		LOCK = 0x0010,           /* readonly flag, not used */
 2096|    304|	};
 2097|       |
 2098|    304|	enum MAIN_EXTRA {
 2099|       |		// Just one attribute here.
 2100|    304|		LOCATOR = 0x01,
 2101|    304|	};
 2102|       |
 2103|    304|	(void) entry;
 2104|       |
 2105|    304|	if(block_flags & HFL_EXTRA_DATA) {
  ------------------
  |  Branch (2105:5): [True: 129, False: 175]
  ------------------
 2106|    129|		if(!read_var(a, &extra_data_size, NULL))
  ------------------
  |  Branch (2106:6): [True: 0, False: 129]
  ------------------
 2107|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2108|    175|	} else {
 2109|    175|		extra_data_size = 0;
 2110|    175|	}
 2111|       |
 2112|    304|	if(!read_var_sized(a, &archive_flags, NULL)) {
  ------------------
  |  Branch (2112:5): [True: 0, False: 304]
  ------------------
 2113|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2114|      0|	}
 2115|       |
 2116|    304|	rar->main.volume = (archive_flags & VOLUME) > 0;
 2117|    304|	rar->main.solid = (archive_flags & SOLID) > 0;
 2118|       |
 2119|    304|	if(archive_flags & VOLUME_NUMBER) {
  ------------------
  |  Branch (2119:5): [True: 143, False: 161]
  ------------------
 2120|    143|		size_t v = 0;
 2121|    143|		if(!read_var_sized(a, &v, NULL)) {
  ------------------
  |  Branch (2121:6): [True: 0, False: 143]
  ------------------
 2122|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2123|      0|		}
 2124|       |
 2125|    143|		if (v > UINT_MAX) {
  ------------------
  |  Branch (2125:7): [True: 0, False: 143]
  ------------------
 2126|      0|			archive_set_error(&a->archive,
 2127|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2128|      0|			    "Invalid volume number");
 2129|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2130|      0|		}
 2131|       |
 2132|    143|		rar->main.vol_no = (unsigned int) v;
 2133|    161|	} else {
 2134|    161|		rar->main.vol_no = 0;
 2135|    161|	}
 2136|       |
 2137|    304|	if(rar->vol.expected_vol_no > 0 &&
  ------------------
  |  Branch (2137:5): [True: 48, False: 256]
  ------------------
 2138|     48|		rar->main.vol_no != rar->vol.expected_vol_no)
  ------------------
  |  Branch (2138:3): [True: 48, False: 0]
  ------------------
 2139|     48|	{
 2140|       |		/* Returning EOF instead of FATAL because of strange
 2141|       |		 * libarchive behavior. When opening multiple files via
 2142|       |		 * archive_read_open_filenames(), after reading up the whole
 2143|       |		 * last file, the __archive_read_ahead function wraps up to
 2144|       |		 * the first archive instead of returning EOF. */
 2145|     48|		return ARCHIVE_EOF;
  ------------------
  |  |  232|     48|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2146|     48|	}
 2147|       |
 2148|    256|	if(extra_data_size == 0) {
  ------------------
  |  Branch (2148:5): [True: 127, False: 129]
  ------------------
 2149|       |		/* Early return. */
 2150|    127|		return ARCHIVE_OK;
  ------------------
  |  |  233|    127|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2151|    127|	}
 2152|       |
 2153|    129|	if(!read_var_sized(a, &extra_field_size, NULL)) {
  ------------------
  |  Branch (2153:5): [True: 0, False: 129]
  ------------------
 2154|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2155|      0|	}
 2156|       |
 2157|    129|	if(!read_var_sized(a, &extra_field_id, NULL)) {
  ------------------
  |  Branch (2157:5): [True: 0, False: 129]
  ------------------
 2158|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2159|      0|	}
 2160|       |
 2161|    129|	if(extra_field_size == 0) {
  ------------------
  |  Branch (2161:5): [True: 0, False: 129]
  ------------------
 2162|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2163|      0|		    "Invalid extra field size");
 2164|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2165|      0|	}
 2166|       |
 2167|    129|	switch(extra_field_id) {
 2168|    129|		case LOCATOR:
  ------------------
  |  Branch (2168:3): [True: 129, False: 0]
  ------------------
 2169|    129|			ret = process_main_locator_extra_block(a, rar);
 2170|    129|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|    129|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2170:7): [True: 0, False: 129]
  ------------------
 2171|       |				/* Error while parsing main locator extra
 2172|       |				 * block. */
 2173|      0|				return ret;
 2174|      0|			}
 2175|       |
 2176|    129|			break;
 2177|    129|		default:
  ------------------
  |  Branch (2177:3): [True: 0, False: 129]
  ------------------
 2178|      0|			archive_set_error(&a->archive,
 2179|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2180|      0|			    "Unsupported extra type (0x%jx)",
 2181|      0|			    (uintmax_t)extra_field_id);
 2182|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2183|    129|	}
 2184|       |
 2185|    129|	return ARCHIVE_OK;
  ------------------
  |  |  233|    129|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2186|    129|}
archive_read_support_format_rar5.c:process_main_locator_extra_block:
 1231|    129|{
 1232|    129|	uint64_t locator_flags;
 1233|       |
 1234|    129|	enum LOCATOR_FLAGS {
 1235|    129|		QLIST = 0x01, RECOVERY = 0x02,
 1236|    129|	};
 1237|       |
 1238|    129|	if(!read_var(a, &locator_flags, NULL)) {
  ------------------
  |  Branch (1238:5): [True: 0, False: 129]
  ------------------
 1239|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1240|      0|	}
 1241|       |
 1242|    129|	if(locator_flags & QLIST) {
  ------------------
  |  Branch (1242:5): [True: 29, False: 100]
  ------------------
 1243|     29|		if(!read_var(a, &rar->qlist_offset, NULL)) {
  ------------------
  |  Branch (1243:6): [True: 0, False: 29]
  ------------------
 1244|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1245|      0|		}
 1246|       |
 1247|       |		/* qlist is not used */
 1248|     29|	}
 1249|       |
 1250|    129|	if(locator_flags & RECOVERY) {
  ------------------
  |  Branch (1250:5): [True: 3, False: 126]
  ------------------
 1251|      3|		if(!read_var(a, &rar->rr_offset, NULL)) {
  ------------------
  |  Branch (1251:6): [True: 0, False: 3]
  ------------------
 1252|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1253|      0|		}
 1254|       |
 1255|       |		/* rr is not used */
 1256|      3|	}
 1257|       |
 1258|    129|	return ARCHIVE_OK;
  ------------------
  |  |  233|    129|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1259|    129|}
archive_read_support_format_rar5.c:rar5_skip_remaining_block:
 2285|    321|{
 2286|    321|	const uint8_t* cur;
 2287|       |
 2288|    321|	if(read_ahead(a, 1, &cur)) {
  ------------------
  |  Branch (2288:5): [True: 321, False: 0]
  ------------------
 2289|    321|		size_t body_used = (size_t)(cur - body_start);
 2290|       |
 2291|    321|		if(body_used < raw_hdr_size)
  ------------------
  |  Branch (2291:6): [True: 161, False: 160]
  ------------------
 2292|    161|			(void)consume(a, raw_hdr_size - body_used);
 2293|    321|	}
 2294|    321|}
archive_read_support_format_rar5.c:process_head_service:
 2061|    156|{
 2062|       |	/* Process this SERVICE block the same way as FILE blocks. */
 2063|    156|	int ret = process_head_file(a, rar, entry, block_flags);
 2064|    156|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|    156|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2064:5): [True: 21, False: 135]
  ------------------
 2065|     21|		return ret;
 2066|       |
 2067|    135|	rar->file.service = 1;
 2068|       |
 2069|       |	/* But skip the data part automatically. It's no use for the user
 2070|       |	 * anyway.  It contains only service data, not even needed to
 2071|       |	 * properly unpack the file. */
 2072|    135|	ret = rar5_read_data_skip(a);
 2073|    135|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|    135|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2073:5): [True: 0, False: 135]
  ------------------
 2074|      0|		return ret;
 2075|       |
 2076|       |	/* After skipping, try parsing another block automatically. */
 2077|    135|	return ARCHIVE_RETRY;
  ------------------
  |  |  234|    135|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2078|    135|}
archive_read_support_format_rar5.c:process_head_file:
 1733|  3.60k|{
 1734|  3.60k|	int64_t extra_data_size = 0;
 1735|  3.60k|	size_t data_size = 0;
 1736|  3.60k|	size_t file_flags = 0;
 1737|  3.60k|	size_t file_attr = 0;
 1738|  3.60k|	size_t compression_info = 0;
 1739|  3.60k|	size_t host_os = 0;
 1740|  3.60k|	size_t name_size = 0;
 1741|  3.60k|	uint64_t unpacked_size, window_size;
 1742|  3.60k|	uint32_t mtime = 0, crc = 0;
 1743|  3.60k|	int c_method = 0, c_version = 0;
 1744|  3.60k|	char name_utf8_buf[MAX_NAME_IN_BYTES];
 1745|  3.60k|	const uint8_t* p;
 1746|  3.60k|	int sanity_ret;
 1747|       |
 1748|  3.60k|	enum FILE_FLAGS {
 1749|  3.60k|		DIRECTORY = 0x0001, UTIME = 0x0002, CRC32 = 0x0004,
 1750|  3.60k|		UNKNOWN_UNPACKED_SIZE = 0x0008,
 1751|  3.60k|	};
 1752|       |
 1753|  3.60k|	enum FILE_ATTRS {
 1754|  3.60k|		ATTR_READONLY = 0x1, ATTR_HIDDEN = 0x2, ATTR_SYSTEM = 0x4,
 1755|  3.60k|		ATTR_DIRECTORY = 0x10,
 1756|  3.60k|	};
 1757|       |
 1758|  3.60k|	enum COMP_INFO_FLAGS {
 1759|  3.60k|		SOLID = 0x0040,
 1760|  3.60k|	};
 1761|       |
 1762|  3.60k|	enum HOST_OS {
 1763|  3.60k|		HOST_WINDOWS = 0,
 1764|  3.60k|		HOST_UNIX = 1,
 1765|  3.60k|	};
 1766|       |
 1767|  3.60k|	archive_entry_clear(entry);
 1768|       |
 1769|       |	/* Do not reset file context if we're switching archives. */
 1770|  3.60k|	if(!rar->cstate.switch_multivolume) {
  ------------------
  |  Branch (1770:5): [True: 523, False: 3.07k]
  ------------------
 1771|    523|		reset_file_context(rar);
 1772|    523|	}
 1773|       |
 1774|  3.60k|	if(block_flags & HFL_EXTRA_DATA) {
  ------------------
  |  Branch (1774:5): [True: 642, False: 2.95k]
  ------------------
 1775|    642|		uint64_t edata_size = 0;
 1776|    642|		if(!read_var(a, &edata_size, NULL))
  ------------------
  |  Branch (1776:6): [True: 0, False: 642]
  ------------------
 1777|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1778|       |
 1779|       |		/* Intentional type cast from unsigned to signed. */
 1780|    642|		extra_data_size = (int64_t) edata_size;
 1781|    642|	}
 1782|       |
 1783|  3.60k|	if(block_flags & HFL_DATA) {
  ------------------
  |  Branch (1783:5): [True: 3.59k, False: 1]
  ------------------
 1784|  3.59k|		if(!read_var_sized(a, &data_size, NULL))
  ------------------
  |  Branch (1784:6): [True: 0, False: 3.59k]
  ------------------
 1785|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1786|       |
 1787|  3.59k|		if(data_size > SSIZE_MAX) {
  ------------------
  |  Branch (1787:6): [True: 0, False: 3.59k]
  ------------------
 1788|      0|			archive_set_error(&a->archive,
 1789|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1790|      0|			    "File data size is too large");
 1791|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1792|      0|		}
 1793|       |
 1794|  3.59k|		rar->file.bytes_remaining = data_size;
 1795|  3.59k|	} else {
 1796|      1|		rar->file.bytes_remaining = 0;
 1797|      1|	}
 1798|       |
 1799|  3.60k|	if(!read_var_sized(a, &file_flags, NULL))
  ------------------
  |  Branch (1799:5): [True: 0, False: 3.60k]
  ------------------
 1800|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1801|       |
 1802|  3.60k|	if(!read_var(a, &unpacked_size, 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(file_flags & UNKNOWN_UNPACKED_SIZE) {
  ------------------
  |  Branch (1805:5): [True: 1, False: 3.59k]
  ------------------
 1806|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      1|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1807|      1|		    "Files with unknown unpacked size are not supported");
 1808|      1|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1809|      1|	}
 1810|       |
 1811|  3.59k|	rar->file.dir = (uint8_t) ((file_flags & DIRECTORY) > 0);
 1812|       |
 1813|  3.59k|	sanity_ret = file_entry_sanity_checks(a, block_flags, rar->file.dir,
 1814|  3.59k|		unpacked_size, data_size);
 1815|       |
 1816|  3.59k|	if (sanity_ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  3.59k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1816:6): [True: 2, False: 3.59k]
  ------------------
 1817|      2|		return sanity_ret;
 1818|      2|	}
 1819|       |
 1820|  3.59k|	if(!read_var_sized(a, &file_attr, NULL))
  ------------------
  |  Branch (1820:5): [True: 0, False: 3.59k]
  ------------------
 1821|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1822|       |
 1823|  3.59k|	if(file_flags & UTIME) {
  ------------------
  |  Branch (1823:5): [True: 2.93k, False: 660]
  ------------------
 1824|  2.93k|		if(!read_u32(a, &mtime))
  ------------------
  |  Branch (1824:6): [True: 0, False: 2.93k]
  ------------------
 1825|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1826|  2.93k|	}
 1827|       |
 1828|  3.59k|	if(file_flags & CRC32) {
  ------------------
  |  Branch (1828:5): [True: 135, False: 3.46k]
  ------------------
 1829|    135|		if(!read_u32(a, &crc))
  ------------------
  |  Branch (1829:6): [True: 0, False: 135]
  ------------------
 1830|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1831|    135|	}
 1832|       |
 1833|  3.59k|	if(!read_var_sized(a, &compression_info, NULL))
  ------------------
  |  Branch (1833:5): [True: 0, False: 3.59k]
  ------------------
 1834|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1835|       |
 1836|  3.59k|	c_method = (int) (compression_info >> 7) & 0x7;
 1837|  3.59k|	c_version = (int) (compression_info & 0x3f);
 1838|       |
 1839|       |	/* RAR5 seems to limit the dictionary size to 64MB. */
 1840|  3.59k|	window_size = (rar->file.dir > 0) ?
  ------------------
  |  Branch (1840:16): [True: 1, False: 3.59k]
  ------------------
 1841|      1|		0 :
 1842|  3.59k|		g_unpack_window_size << ((compression_info >> 10) & 15);
 1843|  3.59k|	rar->cstate.method = c_method;
 1844|  3.59k|	rar->cstate.version = c_version + 50;
 1845|  3.59k|	rar->file.solid = (compression_info & SOLID) > 0;
 1846|       |
 1847|       |	/* Archives which declare solid files without initializing the window
 1848|       |	 * buffer first are invalid, unless previous data was encrypted, in
 1849|       |	 * which case we may never have had the chance */
 1850|       |
 1851|  3.59k|	if(rar->file.solid > 0 && rar->cstate.data_encrypted == 0 &&
  ------------------
  |  Branch (1851:5): [True: 67, False: 3.53k]
  |  Branch (1851:28): [True: 1, False: 66]
  ------------------
 1852|      1|	    rar->cstate.window_buf == NULL) {
  ------------------
  |  Branch (1852:6): [True: 1, False: 0]
  ------------------
 1853|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1854|      1|				  "Declared solid file, but no window buffer "
 1855|      1|				  "initialized yet");
 1856|      1|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1857|      1|	}
 1858|       |
 1859|       |	/* Check if window_size is a sane value. Also, if the file is not
 1860|       |	 * declared as a directory, disallow window_size == 0. */
 1861|  3.59k|	if(window_size > (64 * 1024 * 1024) ||
  ------------------
  |  Branch (1861:5): [True: 0, False: 3.59k]
  ------------------
 1862|  3.59k|	    (rar->file.dir == 0 && window_size == 0))
  ------------------
  |  Branch (1862:7): [True: 3.59k, False: 1]
  |  Branch (1862:29): [True: 0, False: 3.59k]
  ------------------
 1863|      0|	{
 1864|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1865|      0|		    "Declared dictionary size is not supported");
 1866|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1867|      0|	}
 1868|       |
 1869|  3.59k|	if(rar->file.solid > 0) {
  ------------------
  |  Branch (1869:5): [True: 66, False: 3.53k]
  ------------------
 1870|       |		/* Re-check if current window size is the same as previous
 1871|       |		 * window size (for solid files only). */
 1872|     66|		if(rar->file.solid_window_size > 0 &&
  ------------------
  |  Branch (1872:6): [True: 0, False: 66]
  ------------------
 1873|      0|		    rar->file.solid_window_size != (ssize_t) window_size)
  ------------------
  |  Branch (1873:7): [True: 0, False: 0]
  ------------------
 1874|      0|		{
 1875|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1876|      0|			    "Window size for this solid file doesn't match "
 1877|      0|			    "the window size used in previous solid file");
 1878|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1879|      0|		}
 1880|     66|	}
 1881|  3.53k|	else
 1882|  3.53k|		rar->cstate.data_encrypted = 0; /* Reset for new buffer */
 1883|       |
 1884|  3.59k|	if(rar->cstate.window_size < (ssize_t) window_size &&
  ------------------
  |  Branch (1884:5): [True: 239, False: 3.35k]
  ------------------
 1885|    239|	    rar->cstate.window_buf)
  ------------------
  |  Branch (1885:6): [True: 0, False: 239]
  ------------------
 1886|      0|	{
 1887|       |		/* The `data_ready` stack contains pointers to the `window_buf` or
 1888|       |		 * `filtered_buf` buffers.  Since we're about to reallocate the first
 1889|       |		 * buffer, some of those pointers could become invalid. Therefore, we
 1890|       |		 * need to dispose of all entries from the stack before attempting the
 1891|       |		 * realloc. */
 1892|      0|		clear_data_ready_stack(rar);
 1893|       |
 1894|       |		/* If window_buf has been allocated before, reallocate it, so
 1895|       |		 * that its size will match new window_size. */
 1896|       |
 1897|      0|		uint8_t* new_window_buf =
 1898|      0|			realloc(rar->cstate.window_buf, (size_t) window_size);
 1899|       |
 1900|      0|		if(!new_window_buf) {
  ------------------
  |  Branch (1900:6): [True: 0, False: 0]
  ------------------
 1901|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1902|      0|				"Not enough memory when trying to realloc the window "
 1903|      0|				"buffer");
 1904|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1905|      0|		}
 1906|       |
 1907|      0|		rar->cstate.window_buf = new_window_buf;
 1908|      0|	}
 1909|       |
 1910|       |	/* Values up to 64M should fit into ssize_t on every
 1911|       |	 * architecture. */
 1912|  3.59k|	rar->cstate.window_size = (ssize_t) window_size;
 1913|       |
 1914|  3.59k|	if(rar->file.solid > 0 && rar->file.solid_window_size == 0) {
  ------------------
  |  Branch (1914:5): [True: 66, False: 3.53k]
  |  Branch (1914:28): [True: 66, False: 0]
  ------------------
 1915|       |		/* Solid files have to have the same window_size across
 1916|       |		   whole archive. Remember the window_size parameter
 1917|       |		   for first solid file found. */
 1918|     66|		rar->file.solid_window_size = rar->cstate.window_size;
 1919|     66|	}
 1920|       |
 1921|  3.59k|	init_window_mask(rar);
 1922|       |
 1923|  3.59k|	rar->file.service = 0;
 1924|       |
 1925|  3.59k|	if(!read_var_sized(a, &host_os, NULL))
  ------------------
  |  Branch (1925:5): [True: 0, False: 3.59k]
  ------------------
 1926|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1927|       |
 1928|  3.59k|	if(host_os == HOST_WINDOWS) {
  ------------------
  |  Branch (1928:5): [True: 3.43k, False: 162]
  ------------------
 1929|       |		/* Host OS is Windows */
 1930|       |
 1931|  3.43k|		__LA_MODE_T mode;
  ------------------
  |  |  102|  3.43k|# define	__LA_MODE_T	mode_t
  ------------------
 1932|       |
 1933|  3.43k|		if(file_attr & ATTR_DIRECTORY) {
  ------------------
  |  Branch (1933:6): [True: 2.95k, False: 483]
  ------------------
 1934|  2.95k|			if (file_attr & ATTR_READONLY) {
  ------------------
  |  Branch (1934:8): [True: 2.95k, False: 1]
  ------------------
 1935|  2.95k|				mode = 0555 | AE_IFDIR;
  ------------------
  |  |  221|  2.95k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1936|  2.95k|			} else {
 1937|      1|				mode = 0755 | AE_IFDIR;
  ------------------
  |  |  221|      1|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1938|      1|			}
 1939|  2.95k|		} else {
 1940|    483|			if (file_attr & ATTR_READONLY) {
  ------------------
  |  Branch (1940:8): [True: 306, False: 177]
  ------------------
 1941|    306|				mode = 0444 | AE_IFREG;
  ------------------
  |  |  216|    306|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1942|    306|			} else {
 1943|    177|				mode = 0644 | AE_IFREG;
  ------------------
  |  |  216|    177|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1944|    177|			}
 1945|    483|		}
 1946|       |
 1947|  3.43k|		archive_entry_set_mode(entry, mode);
 1948|       |
 1949|  3.43k|		if (file_attr & (ATTR_READONLY | ATTR_HIDDEN | ATTR_SYSTEM)) {
  ------------------
  |  Branch (1949:7): [True: 3.27k, False: 158]
  ------------------
 1950|  3.27k|			char buf[sizeof(",rdonly,hidden,system")];
 1951|  3.27k|			const char *fflags[3] = { "", "", "" };
 1952|  3.27k|			const char **flag = fflags;
 1953|       |
 1954|  3.27k|			if (file_attr & ATTR_READONLY)
  ------------------
  |  Branch (1954:8): [True: 3.25k, False: 20]
  ------------------
 1955|  3.25k|				*flag++ = ",rdonly";
 1956|  3.27k|			if (file_attr & ATTR_HIDDEN)
  ------------------
  |  Branch (1956:8): [True: 2.97k, False: 304]
  ------------------
 1957|  2.97k|				*flag++ = ",hidden";
 1958|  3.27k|			if (file_attr & ATTR_SYSTEM)
  ------------------
  |  Branch (1958:8): [True: 3.02k, False: 253]
  ------------------
 1959|  3.02k|				*flag++ = ",system";
 1960|       |
 1961|  3.27k|			snprintf(buf, sizeof(buf), "%s%s%s",
 1962|  3.27k|			    fflags[0], fflags[1], fflags[2]);
 1963|  3.27k|			archive_entry_copy_fflags_text(entry, buf + 1);
 1964|  3.27k|		}
 1965|  3.43k|	} else if(host_os == HOST_UNIX) {
  ------------------
  |  Branch (1965:12): [True: 162, False: 0]
  ------------------
 1966|       |		/* Host OS is Unix */
 1967|    162|		archive_entry_set_mode(entry, (__LA_MODE_T) file_attr);
 1968|    162|	} else {
 1969|       |		/* Unknown host OS */
 1970|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1971|      0|				"Unsupported Host OS: 0x%jx",
 1972|      0|				(uintmax_t)host_os);
 1973|       |
 1974|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1975|      0|	}
 1976|       |
 1977|  3.59k|	if(!read_var_sized(a, &name_size, NULL))
  ------------------
  |  Branch (1977:5): [True: 0, False: 3.59k]
  ------------------
 1978|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1979|       |
 1980|  3.59k|	if(name_size > (MAX_NAME_IN_CHARS - 1)) {
  ------------------
  |  |   91|  3.59k|#define MAX_NAME_IN_CHARS 2048
  ------------------
  |  Branch (1980:5): [True: 0, False: 3.59k]
  ------------------
 1981|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1982|      0|				"Filename is too long");
 1983|       |
 1984|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1985|      0|	}
 1986|       |
 1987|  3.59k|	if(name_size == 0) {
  ------------------
  |  Branch (1987:5): [True: 0, False: 3.59k]
  ------------------
 1988|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1989|      0|				"No filename specified");
 1990|       |
 1991|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1992|      0|	}
 1993|       |
 1994|  3.59k|	if(!read_ahead(a, name_size, &p))
  ------------------
  |  Branch (1994:5): [True: 1, False: 3.59k]
  ------------------
 1995|      1|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1996|       |
 1997|  3.59k|	memcpy(name_utf8_buf, p, name_size);
 1998|  3.59k|	name_utf8_buf[name_size] = 0;
 1999|  3.59k|	if(ARCHIVE_OK != consume(a, name_size)) {
  ------------------
  |  |  233|  3.59k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1999:5): [True: 0, False: 3.59k]
  ------------------
 2000|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2001|      0|	}
 2002|       |
 2003|  3.59k|	archive_entry_update_pathname_utf8(entry, name_utf8_buf);
 2004|       |
 2005|  3.59k|	if(extra_data_size > 0) {
  ------------------
  |  Branch (2005:5): [True: 314, False: 3.28k]
  ------------------
 2006|    314|		int ret = process_head_file_extra(a, entry, rar,
 2007|    314|		    extra_data_size);
 2008|       |
 2009|       |		/*
 2010|       |		 * TODO: rewrite or remove useless sanity check
 2011|       |		 *       as extra_data_size is not passed as a pointer
 2012|       |		 *
 2013|       |		if(extra_data_size < 0) {
 2014|       |			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
 2015|       |			    "File extra data size is not zero");
 2016|       |			return ARCHIVE_FATAL;
 2017|       |		}
 2018|       |		 */
 2019|       |
 2020|    314|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|    314|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2020:6): [True: 24, False: 290]
  ------------------
 2021|     24|			return ret;
 2022|    314|	}
 2023|       |
 2024|  3.57k|	if((file_flags & UNKNOWN_UNPACKED_SIZE) == 0) {
  ------------------
  |  Branch (2024:5): [True: 3.57k, False: 0]
  ------------------
 2025|  3.57k|		rar->file.unpacked_size = (ssize_t) unpacked_size;
 2026|  3.57k|		if(rar->file.redir_type == REDIR_TYPE_NONE)
  ------------------
  |  Branch (2026:6): [True: 3.44k, False: 131]
  ------------------
 2027|  3.44k|			archive_entry_set_size(entry, unpacked_size);
 2028|  3.57k|	}
 2029|       |
 2030|  3.57k|	if(file_flags & UTIME) {
  ------------------
  |  Branch (2030:5): [True: 2.93k, False: 636]
  ------------------
 2031|  2.93k|		archive_entry_set_mtime(entry, (time_t) mtime, 0);
 2032|  2.93k|	}
 2033|       |
 2034|  3.57k|	if(file_flags & CRC32) {
  ------------------
  |  Branch (2034:5): [True: 133, False: 3.43k]
  ------------------
 2035|    133|		rar->file.stored_crc32 = crc;
 2036|    133|	}
 2037|       |
 2038|  3.57k|	if(!rar->cstate.switch_multivolume) {
  ------------------
  |  Branch (2038:5): [True: 497, False: 3.07k]
  ------------------
 2039|       |		/* Do not reinitialize unpacking state if we're switching
 2040|       |		 * archives. */
 2041|    497|		rar->cstate.block_parsing_finished = 1;
 2042|    497|		rar->cstate.all_filters_applied = 1;
 2043|    497|		rar->cstate.initialized = 0;
 2044|    497|	}
 2045|       |
 2046|  3.57k|	if(rar->generic.split_before > 0) {
  ------------------
  |  Branch (2046:5): [True: 4, False: 3.56k]
  ------------------
 2047|       |		/* If now we're standing on a header that has a 'split before'
 2048|       |		 * mark, it means we're standing on a 'continuation' file
 2049|       |		 * header. Signal the caller that if it wants to move to
 2050|       |		 * another file, it must call rar5_read_header() function
 2051|       |		 * again. */
 2052|       |
 2053|      4|		return ARCHIVE_RETRY;
  ------------------
  |  |  234|      4|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2054|  3.56k|	} else {
 2055|  3.56k|		return ARCHIVE_OK;
  ------------------
  |  |  233|  3.56k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2056|  3.56k|	}
 2057|  3.57k|}
archive_read_support_format_rar5.c:reset_file_context:
  875|    523|static void reset_file_context(struct rar5* rar) {
  876|    523|	memset(&rar->file, 0, sizeof(rar->file));
  877|    523|	blake2sp_init(&rar->file.b2state, 32);
  878|       |
  879|    523|	if(rar->main.solid) {
  ------------------
  |  Branch (879:5): [True: 361, False: 162]
  ------------------
  880|    361|		rar->cstate.solid_offset += rar->cstate.write_ptr;
  881|    361|	} else {
  882|    162|		rar->cstate.solid_offset = 0;
  883|    162|	}
  884|       |
  885|    523|	rar->cstate.write_ptr = 0;
  886|    523|	rar->cstate.last_write_ptr = 0;
  887|    523|	rar->cstate.last_unstore_ptr = 0;
  888|       |
  889|    523|	rar->file.redir_type = REDIR_TYPE_NONE;
  890|    523|	rar->file.redir_flags = 0;
  891|       |
  892|    523|	free_filters(rar);
  893|    523|}
archive_read_support_format_rar5.c:free_filters:
  850|  3.02k|static void free_filters(struct rar5* rar) {
  851|  3.02k|	struct cdeque* d = &rar->cstate.filters;
  852|       |
  853|       |	/* Free any remaining filters. All filters should be naturally
  854|       |	 * consumed by the unpacking function, so remaining filters after
  855|       |	 * unpacking normally mean that unpacking wasn't successful.
  856|       |	 * But still of course we shouldn't leak memory in such case. */
  857|       |
  858|       |	/* cdeque_size() is a fast operation, so we can use it as a loop
  859|       |	 * expression. */
  860|  3.02k|	while(cdeque_size(d) > 0) {
  ------------------
  |  Branch (860:8): [True: 0, False: 3.02k]
  ------------------
  861|      0|		struct filter_info* f = NULL;
  862|       |
  863|       |		/* Pop_front will also decrease the collection's size. */
  864|      0|		if (CDE_OK == cdeque_pop_front(d, cdeque_filter_p(&f)))
  ------------------
  |  Branch (864:7): [True: 0, False: 0]
  ------------------
  865|      0|			free(f);
  866|      0|	}
  867|       |
  868|  3.02k|	cdeque_clear(d);
  869|       |
  870|       |	/* Also clear out the variables needed for sanity checking. */
  871|  3.02k|	rar->cstate.last_block_start = 0;
  872|  3.02k|	rar->cstate.last_block_length = 0;
  873|  3.02k|}
archive_read_support_format_rar5.c:cdeque_size:
  412|  4.18k|static size_t cdeque_size(struct cdeque* d) {
  413|  4.18k|	return d->size;
  414|  4.18k|}
archive_read_support_format_rar5.c:cdeque_filter_p:
  470|  1.16k|static void** cdeque_filter_p(struct filter_info** f) {
  471|  1.16k|	return (void**) (size_t) f;
  472|  1.16k|}
archive_read_support_format_rar5.c:file_entry_sanity_checks:
 1707|  3.59k|{
 1708|  3.59k|	if (is_dir) {
  ------------------
  |  Branch (1708:6): [True: 3, False: 3.59k]
  ------------------
 1709|      3|		const int declares_data_size =
 1710|      3|			(int) (unpacked_size != 0 || packed_size != 0);
  ------------------
  |  Branch (1710:11): [True: 2, False: 1]
  |  Branch (1710:33): [True: 0, False: 1]
  ------------------
 1711|       |
 1712|       |		/* FILE entries for directories still declare HFL_DATA in block flags,
 1713|       |		   even though attaching data to such blocks doesn't make much sense. */
 1714|      3|		if (declares_data_size) {
  ------------------
  |  Branch (1714:7): [True: 2, False: 1]
  ------------------
 1715|      2|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1716|      2|				"directory entries cannot have any data");
 1717|      2|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1718|      2|		}
 1719|  3.59k|	} else {
 1720|  3.59k|		const int declares_hfl_data = (int) ((block_flags & HFL_DATA) != 0);
 1721|  3.59k|		if (!declares_hfl_data) {
  ------------------
  |  Branch (1721:7): [True: 0, False: 3.59k]
  ------------------
 1722|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1723|      0|					"no data found in file/service block");
 1724|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1725|      0|		}
 1726|  3.59k|	}
 1727|       |
 1728|  3.59k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  3.59k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1729|  3.59k|}
archive_read_support_format_rar5.c:clear_data_ready_stack:
 3840|  2.64k|static void clear_data_ready_stack(struct rar5* rar) {
 3841|  2.64k|	memset(&rar->cstate.dready, 0, sizeof(rar->cstate.dready));
 3842|  2.64k|}
archive_read_support_format_rar5.c:init_window_mask:
 1212|  3.73k|static void init_window_mask(struct rar5* rar) {
 1213|  3.73k|	if (rar->cstate.window_size)
  ------------------
  |  Branch (1213:6): [True: 3.73k, False: 1]
  ------------------
 1214|  3.73k|		rar->cstate.window_mask = rar->cstate.window_size - 1;
 1215|      1|	else
 1216|      1|		rar->cstate.window_mask = 0;
 1217|  3.73k|}
archive_read_support_format_rar5.c:process_head_file_extra:
 1617|    314|{
 1618|    314|	uint64_t extra_field_size;
 1619|    314|	uint64_t extra_field_id = 0;
 1620|    314|	uint64_t var_size;
 1621|       |
 1622|  10.3k|	while(extra_data_size > 0) {
  ------------------
  |  Branch (1622:8): [True: 10.0k, False: 297]
  ------------------
 1623|       |		/* Make sure we won't fail if the file declares only unsupported
 1624|       |		attributes. */
 1625|  10.0k|		int ret = ARCHIVE_OK;
  ------------------
  |  |  233|  10.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1626|       |
 1627|  10.0k|		if(!read_var(a, &extra_field_size, &var_size))
  ------------------
  |  Branch (1627:6): [True: 1, False: 10.0k]
  ------------------
 1628|      1|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1629|       |
 1630|  10.0k|		extra_data_size -= var_size;
 1631|  10.0k|		if(ARCHIVE_OK != consume(a, var_size)) {
  ------------------
  |  |  233|  10.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1631:6): [True: 0, False: 10.0k]
  ------------------
 1632|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1633|      0|		}
 1634|       |
 1635|  10.0k|		if(!read_var(a, &extra_field_id, &var_size))
  ------------------
  |  Branch (1635:6): [True: 5, False: 10.0k]
  ------------------
 1636|      5|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      5|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1637|       |
 1638|  10.0k|		extra_field_size -= var_size;
 1639|  10.0k|		extra_data_size -= var_size;
 1640|  10.0k|		if(ARCHIVE_OK != consume(a, var_size)) {
  ------------------
  |  |  233|  10.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1640:6): [True: 0, False: 10.0k]
  ------------------
 1641|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1642|      0|		}
 1643|       |
 1644|  10.0k|		switch(extra_field_id) {
 1645|     32|			case EX_HASH:
  ------------------
  |  Branch (1645:4): [True: 32, False: 10.0k]
  ------------------
 1646|     32|				ret = parse_file_extra_hash(a, rar,
 1647|     32|				    &extra_data_size);
 1648|     32|				break;
 1649|    603|			case EX_HTIME:
  ------------------
  |  Branch (1649:4): [True: 603, False: 9.43k]
  ------------------
 1650|    603|				ret = parse_file_extra_htime(a, e, rar,
 1651|    603|				    &extra_data_size);
 1652|    603|				break;
 1653|  1.45k|			case EX_REDIR:
  ------------------
  |  Branch (1653:4): [True: 1.45k, False: 8.58k]
  ------------------
 1654|  1.45k|				ret = parse_file_extra_redir(a, e, rar,
 1655|  1.45k|				    &extra_data_size);
 1656|  1.45k|				break;
 1657|    912|			case EX_UOWNER:
  ------------------
  |  Branch (1657:4): [True: 912, False: 9.12k]
  ------------------
 1658|    912|				ret = parse_file_extra_owner(a, e,
 1659|    912|				    &extra_data_size);
 1660|    912|				break;
 1661|  6.66k|			case EX_VERSION:
  ------------------
  |  Branch (1661:4): [True: 6.66k, False: 3.37k]
  ------------------
 1662|  6.66k|				ret = parse_file_extra_version(a, e,
 1663|  6.66k|				    &extra_data_size);
 1664|  6.66k|				break;
 1665|    132|			case EX_CRYPT:
  ------------------
  |  Branch (1665:4): [True: 132, False: 9.90k]
  ------------------
 1666|       |				/* Mark the entry as encrypted */
 1667|    132|				archive_entry_set_is_data_encrypted(e, 1);
 1668|    132|				rar->has_encrypted_entries = 1;
 1669|    132|				rar->cstate.data_encrypted = 1;
 1670|       |				/* fallthrough */
 1671|    132|			case EX_SUBDATA:
  ------------------
  |  Branch (1671:4): [True: 0, False: 10.0k]
  ------------------
 1672|       |				/* fallthrough */
 1673|    378|			default:
  ------------------
  |  Branch (1673:4): [True: 246, False: 9.79k]
  ------------------
 1674|       |				/* Skip unsupported entry. */
 1675|    378|				extra_data_size -= extra_field_size;
 1676|    378|				if (ARCHIVE_OK != consume(a, extra_field_size)) {
  ------------------
  |  |  233|    378|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1676:9): [True: 8, False: 370]
  ------------------
 1677|      8|					return ARCHIVE_EOF;
  ------------------
  |  |  232|      8|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1678|      8|				}
 1679|       |
 1680|       |				/* Don't fail on unsupported attribute -- we've handled it
 1681|       |				   by skipping over it. */
 1682|    370|				ret = ARCHIVE_OK;
  ------------------
  |  |  233|    370|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1683|  10.0k|		}
 1684|       |
 1685|  10.0k|		if (ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  10.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1685:7): [True: 3, False: 10.0k]
  ------------------
 1686|       |			/* Forward any errors signalled by the attribute parsing
 1687|       |			   functions. */
 1688|      3|			return ret;
 1689|      3|		}
 1690|  10.0k|	}
 1691|       |
 1692|    297|	if (extra_data_size != 0) {
  ------------------
  |  Branch (1692:6): [True: 7, False: 290]
  ------------------
 1693|       |		/* We didn't skip everything, or we skipped too much; either way,
 1694|       |		   there's an error in this parsing function. */
 1695|       |
 1696|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      7|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1697|      7|				"unsupported structure of file header extra data");
 1698|      7|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1699|      7|	}
 1700|       |
 1701|    290|	return ARCHIVE_OK;
  ------------------
  |  |  233|    290|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1702|    297|}
archive_read_support_format_rar5.c:parse_file_extra_hash:
 1263|     32|{
 1264|     32|	size_t hash_type = 0;
 1265|     32|	size_t value_len;
 1266|       |
 1267|     32|	enum HASH_TYPE {
 1268|     32|		BLAKE2sp = 0x00
 1269|     32|	};
 1270|       |
 1271|     32|	if(!read_var_sized(a, &hash_type, &value_len))
  ------------------
  |  Branch (1271:5): [True: 0, False: 32]
  ------------------
 1272|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1273|       |
 1274|     32|	*extra_data_size -= value_len;
 1275|     32|	if(ARCHIVE_OK != consume(a, value_len)) {
  ------------------
  |  |  233|     32|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1275:5): [True: 0, False: 32]
  ------------------
 1276|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1277|      0|	}
 1278|       |
 1279|       |	/* The file uses BLAKE2sp checksum algorithm instead of plain old
 1280|       |	 * CRC32. */
 1281|     32|	if(hash_type == BLAKE2sp) {
  ------------------
  |  Branch (1281:5): [True: 32, False: 0]
  ------------------
 1282|     32|		const uint8_t* p;
 1283|     32|		const int hash_size = sizeof(rar->file.blake2sp);
 1284|       |
 1285|     32|		if(!read_ahead(a, hash_size, &p))
  ------------------
  |  Branch (1285:6): [True: 0, False: 32]
  ------------------
 1286|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1287|       |
 1288|     32|		rar->file.has_blake2 = 1;
 1289|     32|		memcpy(&rar->file.blake2sp, p, hash_size);
 1290|       |
 1291|     32|		if(ARCHIVE_OK != consume(a, hash_size)) {
  ------------------
  |  |  233|     32|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1291:6): [True: 0, False: 32]
  ------------------
 1292|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1293|      0|		}
 1294|       |
 1295|     32|		*extra_data_size -= hash_size;
 1296|     32|	} else {
 1297|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1298|      0|		    "Unsupported hash type (0x%jx)", (uintmax_t)hash_type);
 1299|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1300|      0|	}
 1301|       |
 1302|     32|	return ARCHIVE_OK;
  ------------------
  |  |  233|     32|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1303|     32|}
archive_read_support_format_rar5.c:parse_file_extra_htime:
 1383|    603|{
 1384|    603|	char unix_time, has_unix_ns, has_mtime, has_ctime, has_atime;
 1385|    603|	size_t flags = 0;
 1386|    603|	size_t value_len;
 1387|       |
 1388|    603|	enum HTIME_FLAGS {
 1389|    603|		IS_UNIX       = 0x01,
 1390|    603|		HAS_MTIME     = 0x02,
 1391|    603|		HAS_CTIME     = 0x04,
 1392|    603|		HAS_ATIME     = 0x08,
 1393|    603|		HAS_UNIX_NS   = 0x10,
 1394|    603|	};
 1395|       |
 1396|    603|	if(!read_var_sized(a, &flags, &value_len))
  ------------------
  |  Branch (1396:5): [True: 0, False: 603]
  ------------------
 1397|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1398|       |
 1399|    603|	*extra_data_size -= value_len;
 1400|    603|	if(ARCHIVE_OK != consume(a, value_len)) {
  ------------------
  |  |  233|    603|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1400:5): [True: 0, False: 603]
  ------------------
 1401|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1402|      0|	}
 1403|       |
 1404|    603|	unix_time = flags & IS_UNIX;
 1405|    603|	has_unix_ns = unix_time && (flags & HAS_UNIX_NS);
  ------------------
  |  Branch (1405:16): [True: 448, False: 155]
  |  Branch (1405:29): [True: 236, False: 212]
  ------------------
 1406|    603|	has_mtime = flags & HAS_MTIME;
 1407|    603|	has_atime = flags & HAS_ATIME;
 1408|    603|	has_ctime = flags & HAS_CTIME;
 1409|    603|	rar->file.e_atime_ns = rar->file.e_ctime_ns = rar->file.e_mtime_ns = 0;
 1410|       |
 1411|    603|	if(has_mtime) {
  ------------------
  |  Branch (1411:5): [True: 373, False: 230]
  ------------------
 1412|    373|		parse_htime_item(a, unix_time, &rar->file.e_mtime,
 1413|    373|		    &rar->file.e_mtime_ns, extra_data_size);
 1414|    373|	}
 1415|       |
 1416|    603|	if(has_ctime) {
  ------------------
  |  Branch (1416:5): [True: 222, False: 381]
  ------------------
 1417|    222|		parse_htime_item(a, unix_time, &rar->file.e_ctime,
 1418|    222|		    &rar->file.e_ctime_ns, extra_data_size);
 1419|    222|	}
 1420|       |
 1421|    603|	if(has_atime) {
  ------------------
  |  Branch (1421:5): [True: 320, False: 283]
  ------------------
 1422|    320|		parse_htime_item(a, unix_time, &rar->file.e_atime,
 1423|    320|		    &rar->file.e_atime_ns, extra_data_size);
 1424|    320|	}
 1425|       |
 1426|    603|	if(has_mtime && has_unix_ns) {
  ------------------
  |  Branch (1426:5): [True: 373, False: 230]
  |  Branch (1426:18): [True: 105, False: 268]
  ------------------
 1427|    105|		if(!read_u32(a, &rar->file.e_mtime_ns))
  ------------------
  |  Branch (1427:6): [True: 0, False: 105]
  ------------------
 1428|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1429|       |
 1430|    105|		*extra_data_size -= 4;
 1431|    105|	}
 1432|       |
 1433|    603|	if(has_ctime && has_unix_ns) {
  ------------------
  |  Branch (1433:5): [True: 222, False: 381]
  |  Branch (1433:18): [True: 133, False: 89]
  ------------------
 1434|    133|		if(!read_u32(a, &rar->file.e_ctime_ns))
  ------------------
  |  Branch (1434:6): [True: 1, False: 132]
  ------------------
 1435|      1|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1436|       |
 1437|    132|		*extra_data_size -= 4;
 1438|    132|	}
 1439|       |
 1440|    602|	if(has_atime && has_unix_ns) {
  ------------------
  |  Branch (1440:5): [True: 319, False: 283]
  |  Branch (1440:18): [True: 132, False: 187]
  ------------------
 1441|    132|		if(!read_u32(a, &rar->file.e_atime_ns))
  ------------------
  |  Branch (1441:6): [True: 0, False: 132]
  ------------------
 1442|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1443|       |
 1444|    132|		*extra_data_size -= 4;
 1445|    132|	}
 1446|       |
 1447|       |	/* The seconds and nanoseconds are either together, or separated in two
 1448|       |	 * fields so we parse them, then set the archive_entry's times. */
 1449|    602|	if(has_mtime) {
  ------------------
  |  Branch (1449:5): [True: 373, False: 229]
  ------------------
 1450|    373|		archive_entry_set_mtime(e, rar->file.e_mtime, rar->file.e_mtime_ns);
 1451|    373|	}
 1452|       |
 1453|    602|	if(has_ctime) {
  ------------------
  |  Branch (1453:5): [True: 221, False: 381]
  ------------------
 1454|    221|		archive_entry_set_ctime(e, rar->file.e_ctime, rar->file.e_ctime_ns);
 1455|    221|	}
 1456|       |
 1457|    602|	if(has_atime) {
  ------------------
  |  Branch (1457:5): [True: 319, False: 283]
  ------------------
 1458|    319|		archive_entry_set_atime(e, rar->file.e_atime, rar->file.e_atime_ns);
 1459|    319|	}
 1460|       |
 1461|    602|	return ARCHIVE_OK;
  ------------------
  |  |  233|    602|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1462|    602|}
archive_read_support_format_rar5.c:parse_htime_item:
 1307|    915|{
 1308|    915|	if(unix_time) {
  ------------------
  |  Branch (1308:5): [True: 651, False: 264]
  ------------------
 1309|    651|		uint32_t time_val;
 1310|    651|		if(!read_u32(a, &time_val))
  ------------------
  |  Branch (1310:6): [True: 0, False: 651]
  ------------------
 1311|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1312|       |
 1313|    651|		*extra_data_size -= 4;
 1314|    651|		*sec = (int64_t) time_val;
 1315|    651|	} else {
 1316|    264|		uint64_t windows_time;
 1317|    264|		if(!read_u64(a, &windows_time))
  ------------------
  |  Branch (1317:6): [True: 0, False: 264]
  ------------------
 1318|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1319|       |
 1320|    264|		ntfs_to_unix(windows_time, sec, nsec);
 1321|    264|		*extra_data_size -= 8;
 1322|    264|	}
 1323|       |
 1324|    915|	return ARCHIVE_OK;
  ------------------
  |  |  233|    915|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1325|    915|}
archive_read_support_format_rar5.c:read_u64:
 1114|    264|static char read_u64(struct archive_read* a, uint64_t* pvalue) {
 1115|    264|	const uint8_t* p;
 1116|    264|	if(!read_ahead(a, 8, &p))
  ------------------
  |  Branch (1116:5): [True: 0, False: 264]
  ------------------
 1117|      0|		return 0;
 1118|       |
 1119|    264|	*pvalue = archive_le64dec(p);
 1120|    264|	return ARCHIVE_OK == consume(a, 8);
  ------------------
  |  |  233|    264|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1121|    264|}
archive_read_support_format_rar5.c:parse_file_extra_redir:
 1466|  1.45k|{
 1467|  1.45k|	uint64_t value_size = 0;
 1468|  1.45k|	size_t target_size = 0;
 1469|  1.45k|	char target_utf8_buf[MAX_NAME_IN_BYTES];
 1470|  1.45k|	const uint8_t* p;
 1471|       |
 1472|  1.45k|	if(!read_var(a, &rar->file.redir_type, &value_size))
  ------------------
  |  Branch (1472:5): [True: 0, False: 1.45k]
  ------------------
 1473|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1474|  1.45k|	if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|  1.45k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1474:5): [True: 0, False: 1.45k]
  ------------------
 1475|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1476|  1.45k|	*extra_data_size -= value_size;
 1477|       |
 1478|  1.45k|	if(!read_var(a, &rar->file.redir_flags, &value_size))
  ------------------
  |  Branch (1478:5): [True: 0, False: 1.45k]
  ------------------
 1479|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1480|  1.45k|	if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|  1.45k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1480:5): [True: 0, False: 1.45k]
  ------------------
 1481|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1482|  1.45k|	*extra_data_size -= value_size;
 1483|       |
 1484|  1.45k|	if(!read_var_sized(a, &target_size, NULL))
  ------------------
  |  Branch (1484:5): [True: 0, False: 1.45k]
  ------------------
 1485|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1486|  1.45k|	*extra_data_size -= target_size + 1;
 1487|       |
 1488|  1.45k|	if(target_size > (MAX_NAME_IN_CHARS - 1)) {
  ------------------
  |  |   91|  1.45k|#define MAX_NAME_IN_CHARS 2048
  ------------------
  |  Branch (1488:5): [True: 0, False: 1.45k]
  ------------------
 1489|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1490|      0|		    "Link target is too long");
 1491|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1492|      0|	}
 1493|       |
 1494|  1.45k|	if(target_size == 0) {
  ------------------
  |  Branch (1494:5): [True: 0, False: 1.45k]
  ------------------
 1495|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1496|      0|		    "No link target specified");
 1497|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1498|      0|	}
 1499|       |
 1500|  1.45k|	if(!read_ahead(a, target_size, &p))
  ------------------
  |  Branch (1500:5): [True: 0, False: 1.45k]
  ------------------
 1501|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1502|       |
 1503|  1.45k|	memcpy(target_utf8_buf, p, target_size);
 1504|  1.45k|	target_utf8_buf[target_size] = 0;
 1505|       |
 1506|  1.45k|	if(ARCHIVE_OK != consume(a, (int64_t)target_size))
  ------------------
  |  |  233|  1.45k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1506:5): [True: 0, False: 1.45k]
  ------------------
 1507|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1508|       |
 1509|  1.45k|	switch(rar->file.redir_type) {
 1510|      0|		case REDIR_TYPE_UNIXSYMLINK:
  ------------------
  |  Branch (1510:3): [True: 0, False: 1.45k]
  ------------------
 1511|      0|		case REDIR_TYPE_WINSYMLINK:
  ------------------
  |  Branch (1511:3): [True: 0, False: 1.45k]
  ------------------
 1512|      0|			archive_entry_set_filetype(e, AE_IFLNK);
  ------------------
  |  |  217|      0|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
 1513|      0|			archive_entry_update_symlink_utf8(e, target_utf8_buf);
 1514|      0|			if (rar->file.redir_flags & REDIR_SYMLINK_IS_DIR) {
  ------------------
  |  |  137|      0|#define REDIR_SYMLINK_IS_DIR	1
  ------------------
  |  Branch (1514:8): [True: 0, False: 0]
  ------------------
 1515|      0|				archive_entry_set_symlink_type(e,
 1516|      0|					AE_SYMLINK_TYPE_DIRECTORY);
  ------------------
  |  |  229|      0|#define AE_SYMLINK_TYPE_DIRECTORY	2
  ------------------
 1517|      0|			} else {
 1518|      0|				archive_entry_set_symlink_type(e,
 1519|      0|				AE_SYMLINK_TYPE_FILE);
  ------------------
  |  |  228|      0|#define AE_SYMLINK_TYPE_FILE		1
  ------------------
 1520|      0|			}
 1521|      0|			break;
 1522|       |
 1523|    164|		case REDIR_TYPE_HARDLINK:
  ------------------
  |  Branch (1523:3): [True: 164, False: 1.28k]
  ------------------
 1524|    164|			archive_entry_set_filetype(e, AE_IFREG);
  ------------------
  |  |  216|    164|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1525|    164|			archive_entry_update_hardlink_utf8(e, target_utf8_buf);
 1526|    164|			break;
 1527|       |
 1528|  1.28k|		default:
  ------------------
  |  Branch (1528:3): [True: 1.28k, False: 164]
  ------------------
 1529|       |			/* Unknown redir type, skip it. */
 1530|  1.28k|			break;
 1531|  1.45k|	}
 1532|  1.45k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.45k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1533|  1.45k|}
archive_read_support_format_rar5.c:parse_file_extra_owner:
 1537|    912|{
 1538|    912|	uint64_t flags = 0;
 1539|    912|	uint64_t value_size = 0;
 1540|    912|	uint64_t id = 0;
 1541|    912|	size_t name_len = 0;
 1542|    912|	size_t name_size = 0;
 1543|    912|	char namebuf[OWNER_MAXNAMELEN];
 1544|    912|	const uint8_t* p;
 1545|       |
 1546|    912|	if(!read_var(a, &flags, &value_size))
  ------------------
  |  Branch (1546:5): [True: 0, False: 912]
  ------------------
 1547|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1548|    912|	if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|    912|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1548:5): [True: 0, False: 912]
  ------------------
 1549|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1550|    912|	*extra_data_size -= value_size;
 1551|       |
 1552|    912|	if ((flags & OWNER_USER_NAME) != 0) {
  ------------------
  |  |  148|    912|#define	OWNER_USER_NAME		0x01
  ------------------
  |  Branch (1552:6): [True: 220, False: 692]
  ------------------
 1553|    220|		if(!read_var_sized(a, &name_size, NULL))
  ------------------
  |  Branch (1553:6): [True: 0, False: 220]
  ------------------
 1554|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1555|    220|		*extra_data_size -= name_size + 1;
 1556|       |
 1557|    220|		if(!read_ahead(a, name_size, &p))
  ------------------
  |  Branch (1557:6): [True: 0, False: 220]
  ------------------
 1558|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1559|       |
 1560|    220|		if (name_size >= OWNER_MAXNAMELEN) {
  ------------------
  |  |  152|    220|#define	OWNER_MAXNAMELEN	256
  ------------------
  |  Branch (1560:7): [True: 3, False: 217]
  ------------------
 1561|      3|			name_len = OWNER_MAXNAMELEN - 1;
  ------------------
  |  |  152|      3|#define	OWNER_MAXNAMELEN	256
  ------------------
 1562|    217|		} else {
 1563|    217|			name_len = name_size;
 1564|    217|		}
 1565|       |
 1566|    220|		memcpy(namebuf, p, name_len);
 1567|    220|		namebuf[name_len] = 0;
 1568|    220|		if(ARCHIVE_OK != consume(a, (int64_t)name_size))
  ------------------
  |  |  233|    220|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1568:6): [True: 0, False: 220]
  ------------------
 1569|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1570|       |
 1571|    220|		archive_entry_set_uname(e, namebuf);
 1572|    220|	}
 1573|    912|	if ((flags & OWNER_GROUP_NAME) != 0) {
  ------------------
  |  |  149|    912|#define	OWNER_GROUP_NAME	0x02
  ------------------
  |  Branch (1573:6): [True: 784, False: 128]
  ------------------
 1574|    784|		if(!read_var_sized(a, &name_size, NULL))
  ------------------
  |  Branch (1574:6): [True: 0, False: 784]
  ------------------
 1575|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1576|    784|		*extra_data_size -= name_size + 1;
 1577|       |
 1578|    784|		if(!read_ahead(a, name_size, &p))
  ------------------
  |  Branch (1578:6): [True: 0, False: 784]
  ------------------
 1579|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1580|       |
 1581|    784|		if (name_size >= OWNER_MAXNAMELEN) {
  ------------------
  |  |  152|    784|#define	OWNER_MAXNAMELEN	256
  ------------------
  |  Branch (1581:7): [True: 7, False: 777]
  ------------------
 1582|      7|			name_len = OWNER_MAXNAMELEN - 1;
  ------------------
  |  |  152|      7|#define	OWNER_MAXNAMELEN	256
  ------------------
 1583|    777|		} else {
 1584|    777|			name_len = name_size;
 1585|    777|		}
 1586|       |
 1587|    784|		memcpy(namebuf, p, name_len);
 1588|    784|		namebuf[name_len] = 0;
 1589|    784|		if(ARCHIVE_OK != consume(a, (int64_t)name_size))
  ------------------
  |  |  233|    784|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1589:6): [True: 0, False: 784]
  ------------------
 1590|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1591|       |
 1592|    784|		archive_entry_set_gname(e, namebuf);
 1593|    784|	}
 1594|    912|	if ((flags & OWNER_USER_UID) != 0) {
  ------------------
  |  |  150|    912|#define	OWNER_USER_UID		0x04
  ------------------
  |  Branch (1594:6): [True: 899, False: 13]
  ------------------
 1595|    899|		if(!read_var(a, &id, &value_size))
  ------------------
  |  Branch (1595:6): [True: 1, False: 898]
  ------------------
 1596|      1|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1597|    898|		if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|    898|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1597:6): [True: 0, False: 898]
  ------------------
 1598|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1599|    898|		*extra_data_size -= value_size;
 1600|       |
 1601|    898|		archive_entry_set_uid(e, (la_int64_t)id);
 1602|    898|	}
 1603|    911|	if ((flags & OWNER_GROUP_GID) != 0) {
  ------------------
  |  |  151|    911|#define	OWNER_GROUP_GID		0x08
  ------------------
  |  Branch (1603:6): [True: 224, False: 687]
  ------------------
 1604|    224|		if(!read_var(a, &id, &value_size))
  ------------------
  |  Branch (1604:6): [True: 0, False: 224]
  ------------------
 1605|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1606|    224|		if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|    224|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1606:6): [True: 0, False: 224]
  ------------------
 1607|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1608|    224|		*extra_data_size -= value_size;
 1609|       |
 1610|    224|		archive_entry_set_gid(e, (la_int64_t)id);
 1611|    224|	}
 1612|    911|	return ARCHIVE_OK;
  ------------------
  |  |  233|    911|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1613|    911|}
archive_read_support_format_rar5.c:parse_file_extra_version:
 1329|  6.66k|{
 1330|  6.66k|	size_t flags = 0;
 1331|  6.66k|	size_t version = 0;
 1332|  6.66k|	size_t value_len = 0;
 1333|  6.66k|	struct archive_string version_string;
 1334|  6.66k|	struct archive_string name_utf8_string;
 1335|  6.66k|	const char* cur_filename;
 1336|       |
 1337|       |	/* Flags are ignored. */
 1338|  6.66k|	if(!read_var_sized(a, &flags, &value_len))
  ------------------
  |  Branch (1338:5): [True: 1, False: 6.66k]
  ------------------
 1339|      1|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1340|       |
 1341|  6.66k|	*extra_data_size -= value_len;
 1342|  6.66k|	if(ARCHIVE_OK != consume(a, value_len))
  ------------------
  |  |  233|  6.66k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1342:5): [True: 0, False: 6.66k]
  ------------------
 1343|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1344|       |
 1345|  6.66k|	if(!read_var_sized(a, &version, &value_len))
  ------------------
  |  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|	*extra_data_size -= value_len;
 1349|  6.66k|	if(ARCHIVE_OK != consume(a, value_len))
  ------------------
  |  |  233|  6.66k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1349:5): [True: 0, False: 6.66k]
  ------------------
 1350|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1351|       |
 1352|       |	/* extra_data_size should be zero here. */
 1353|       |
 1354|  6.66k|	cur_filename = archive_entry_pathname_utf8(e);
 1355|  6.66k|	if(cur_filename == NULL) {
  ------------------
  |  Branch (1355:5): [True: 0, False: 6.66k]
  ------------------
 1356|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1357|      0|		    "Version entry without file name");
 1358|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1359|      0|	}
 1360|       |
 1361|  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]
  |  |  ------------------
  ------------------
 1362|  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]
  |  |  ------------------
  ------------------
 1363|       |
 1364|       |	/* Prepare a ;123 suffix for the filename, where '123' is the version
 1365|       |	 * value of this file. */
 1366|  6.66k|	archive_string_sprintf(&version_string, ";%zu", version);
 1367|       |
 1368|       |	/* Build the new filename. */
 1369|  6.66k|	archive_strcat(&name_utf8_string, cur_filename);
 1370|  6.66k|	archive_strcat(&name_utf8_string, version_string.s);
 1371|       |
 1372|       |	/* Apply the new filename into this file's context. */
 1373|  6.66k|	archive_entry_update_pathname_utf8(e, name_utf8_string.s);
 1374|       |
 1375|       |	/* Free buffers. */
 1376|  6.66k|	archive_string_free(&version_string);
 1377|  6.66k|	archive_string_free(&name_utf8_string);
 1378|  6.66k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  6.66k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1379|  6.66k|}
archive_read_support_format_rar5.c:scan_for_signature:
 3419|  3.12k|static int scan_for_signature(struct archive_read* a) {
 3420|  3.12k|	const uint8_t* p;
 3421|  3.12k|	const int chunk_size = 512;
 3422|  3.12k|	ssize_t i;
 3423|  3.12k|	char signature[sizeof(rar5_signature_xor)];
 3424|       |
 3425|       |	/* If we're here, it means we're on an 'unknown territory' data.
 3426|       |	 * There's no indication what kind of data we're reading here.
 3427|       |	 * It could be some text comment, any kind of binary data,
 3428|       |	 * digital sign, dragons, etc.
 3429|       |	 *
 3430|       |	 * We want to find a valid RARv5 magic header inside this unknown
 3431|       |	 * data. */
 3432|       |
 3433|       |	/* Is it possible in libarchive to just skip everything until the
 3434|       |	 * end of the file? If so, it would be a better approach than the
 3435|       |	 * current implementation of this function. */
 3436|       |
 3437|  3.12k|	rar5_signature(signature);
 3438|       |
 3439|  3.39k|	while(1) {
  ------------------
  |  Branch (3439:8): [True: 3.39k, Folded]
  ------------------
 3440|  3.39k|		if(!read_ahead(a, chunk_size, &p))
  ------------------
  |  Branch (3440:6): [True: 21, False: 3.37k]
  ------------------
 3441|     21|			return ARCHIVE_EOF;
  ------------------
  |  |  232|     21|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3442|       |
 3443|  1.40M|		for(i = 0; i < chunk_size - (int)sizeof(rar5_signature_xor);
  ------------------
  |  Branch (3443:14): [True: 1.40M, False: 267]
  ------------------
 3444|  1.40M|		    i++) {
 3445|  1.40M|			if(memcmp(&p[i], signature,
  ------------------
  |  Branch (3445:7): [True: 3.10k, False: 1.40M]
  ------------------
 3446|  1.40M|			    sizeof(rar5_signature_xor)) == 0) {
 3447|       |				/* Consume the number of bytes we've used to
 3448|       |				 * search for the signature, as well as the
 3449|       |				 * number of bytes used by the signature
 3450|       |				 * itself. After this we should be standing
 3451|       |				 * on a valid base block header. */
 3452|  3.10k|				(void) consume(a,
 3453|  3.10k|				    i + sizeof(rar5_signature_xor));
 3454|  3.10k|				return ARCHIVE_OK;
  ------------------
  |  |  233|  3.10k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3455|  3.10k|			}
 3456|  1.40M|		}
 3457|       |
 3458|    267|		consume(a, chunk_size);
 3459|    267|	}
 3460|       |
 3461|      0|	return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3462|  3.12k|}
archive_read_support_format_rar5.c:rar5_read_data:
 4278|  2.96k|    size_t *size, int64_t *offset) {
 4279|  2.96k|	int ret;
 4280|  2.96k|	struct rar5* rar = get_context(a);
 4281|       |
 4282|  2.96k|	if (size)
  ------------------
  |  Branch (4282:6): [True: 2.86k, False: 106]
  ------------------
 4283|  2.86k|		*size = 0;
 4284|       |
 4285|  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 (4285:6): [True: 0, False: 2.96k]
  ------------------
 4286|      0|		rar->has_encrypted_entries = 0;
 4287|      0|	}
 4288|       |
 4289|  2.96k|	if (rar->headers_are_encrypted || rar->cstate.data_encrypted) {
  ------------------
  |  Branch (4289:6): [True: 0, False: 2.96k]
  |  Branch (4289:36): [True: 0, False: 2.96k]
  ------------------
 4290|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4291|      0|		    "Reading encrypted data is not currently supported");
 4292|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 4293|      0|	}
 4294|       |
 4295|  2.96k|	if(rar->file.dir > 0) {
  ------------------
  |  Branch (4295:5): [True: 0, False: 2.96k]
  ------------------
 4296|       |		/* Don't process any data if this file entry was declared
 4297|       |		 * as a directory. This is needed, because entries marked as
 4298|       |		 * directory doesn't have any dictionary buffer allocated, so
 4299|       |		 * it's impossible to perform any decompression. */
 4300|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4301|      0|		    "Can't decompress an entry marked as a directory");
 4302|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4303|      0|	}
 4304|       |
 4305|  2.96k|	if(!rar->skip_mode && (rar->cstate.last_write_ptr > rar->file.unpacked_size)) {
  ------------------
  |  Branch (4305:5): [True: 2.86k, False: 106]
  |  Branch (4305:24): [True: 0, False: 2.86k]
  ------------------
 4306|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 4307|      0|		    "Unpacker has written too many bytes");
 4308|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4309|      0|	}
 4310|       |
 4311|  2.96k|	ret = use_data(rar, buff, size, offset);
 4312|  2.96k|	if(ret == ARCHIVE_OK) {
  ------------------
  |  |  233|  2.96k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4312:5): [True: 1.25k, False: 1.71k]
  ------------------
 4313|  1.25k|		return ret;
 4314|  1.25k|	}
 4315|       |
 4316|  1.71k|	if(rar->file.eof == 1) {
  ------------------
  |  Branch (4316:5): [True: 4, False: 1.71k]
  ------------------
 4317|      4|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      4|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4318|      4|	}
 4319|       |
 4320|  1.71k|	ret = do_unpack(a, rar, buff, size, offset);
 4321|  1.71k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.71k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4321:5): [True: 528, False: 1.18k]
  ------------------
 4322|    528|		return ret;
 4323|    528|	}
 4324|       |
 4325|  1.18k|	if(rar->file.bytes_remaining == 0 &&
  ------------------
  |  Branch (4325:5): [True: 109, False: 1.07k]
  ------------------
 4326|    109|			rar->cstate.last_write_ptr == rar->file.unpacked_size)
  ------------------
  |  Branch (4326:4): [True: 6, False: 103]
  ------------------
 4327|      6|	{
 4328|       |		/* If all bytes of current file were processed, run
 4329|       |		 * finalization.
 4330|       |		 *
 4331|       |		 * Finalization will check checksum against proper values. If
 4332|       |		 * some of the checksums will not match, we'll return an error
 4333|       |		 * value in the last `archive_read_data` call to signal an error
 4334|       |		 * to the user. */
 4335|       |
 4336|      6|		rar->file.eof = 1;
 4337|      6|		return verify_global_checksums(a);
 4338|      6|	}
 4339|       |
 4340|  1.17k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.17k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4341|  1.18k|}
archive_read_support_format_rar5.c:use_data:
 3821|  2.96k|{
 3822|  2.96k|	int i;
 3823|       |
 3824|  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 (3824:13): [True: 4.85k, False: 1.71k]
  ------------------
 3825|  4.85k|		struct data_ready *d = &rar->cstate.dready[i];
 3826|       |
 3827|  4.85k|		if(d->used) {
  ------------------
  |  Branch (3827:6): [True: 1.25k, False: 3.59k]
  ------------------
 3828|  1.25k|			if(buf)    *buf = d->buf;
  ------------------
  |  Branch (3828:7): [True: 1.25k, False: 0]
  ------------------
 3829|  1.25k|			if(size)   *size = d->size;
  ------------------
  |  Branch (3829:7): [True: 1.25k, False: 0]
  ------------------
 3830|  1.25k|			if(offset) *offset = d->offset;
  ------------------
  |  Branch (3830:7): [True: 1.25k, False: 0]
  ------------------
 3831|       |
 3832|  1.25k|			d->used = 0;
 3833|  1.25k|			return ARCHIVE_OK;
  ------------------
  |  |  233|  1.25k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3834|  1.25k|		}
 3835|  4.85k|	}
 3836|       |
 3837|  1.71k|	return ARCHIVE_RETRY;
  ------------------
  |  |  234|  1.71k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 3838|  2.96k|}
archive_read_support_format_rar5.c:do_unpack:
 4117|  1.71k|{
 4118|  1.71k|	enum COMPRESSION_METHOD {
 4119|  1.71k|		STORE = 0, FASTEST = 1, FAST = 2, NORMAL = 3, GOOD = 4,
 4120|  1.71k|		BEST = 5
 4121|  1.71k|	};
 4122|       |
 4123|  1.71k|	if(rar->file.service > 0) {
  ------------------
  |  Branch (4123:5): [True: 0, False: 1.71k]
  ------------------
 4124|      0|		return do_unstore_file(a, rar, buf, size, offset);
 4125|  1.71k|	} else {
 4126|  1.71k|		switch(rar->cstate.method) {
 4127|    135|			case STORE:
  ------------------
  |  Branch (4127:4): [True: 135, False: 1.57k]
  ------------------
 4128|    135|				return do_unstore_file(a, rar, buf, size,
 4129|    135|				    offset);
 4130|    610|			case FASTEST:
  ------------------
  |  Branch (4130:4): [True: 610, False: 1.10k]
  ------------------
 4131|       |				/* fallthrough */
 4132|  1.37k|			case FAST:
  ------------------
  |  Branch (4132:4): [True: 765, False: 946]
  ------------------
 4133|       |				/* fallthrough */
 4134|  1.55k|			case NORMAL:
  ------------------
  |  Branch (4134:4): [True: 184, False: 1.52k]
  ------------------
 4135|       |				/* fallthrough */
 4136|  1.56k|			case GOOD:
  ------------------
  |  Branch (4136:4): [True: 3, False: 1.70k]
  ------------------
 4137|       |				/* fallthrough */
 4138|  1.57k|			case BEST:
  ------------------
  |  Branch (4138:4): [True: 14, False: 1.69k]
  ------------------
 4139|       |				/* No data is returned here. But because a sparse-file aware
 4140|       |				 * caller (like archive_read_data_into_fd) may treat zero-size
 4141|       |				 * as a sparse file block, we need to update the offset
 4142|       |				 * accordingly. At this point the decoder doesn't have any
 4143|       |				 * pending uncompressed data blocks, so the current position in
 4144|       |				 * the output file should be last_write_ptr. */
 4145|  1.57k|				if (offset) *offset = rar->cstate.last_write_ptr;
  ------------------
  |  Branch (4145:9): [True: 1.47k, False: 101]
  ------------------
 4146|  1.57k|				return uncompress_file(a);
 4147|      0|			default:
  ------------------
  |  Branch (4147:4): [True: 0, False: 1.71k]
  ------------------
 4148|      0|				archive_set_error(&a->archive,
 4149|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4150|      0|				    "Compression method not supported: 0x%x",
 4151|      0|				    (unsigned int)rar->cstate.method);
 4152|       |
 4153|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4154|  1.71k|		}
 4155|  1.71k|	}
 4156|       |
 4157|      0|#if !defined WIN32
 4158|       |	/* Not reached. */
 4159|      0|	return ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4160|  1.71k|#endif
 4161|  1.71k|}
archive_read_support_format_rar5.c:do_unstore_file:
 4069|    135|{
 4070|    135|	size_t to_read;
 4071|    135|	const uint8_t* p;
 4072|       |
 4073|    135|	if(rar->file.bytes_remaining == 0 && rar->main.volume > 0 &&
  ------------------
  |  Branch (4073:5): [True: 109, False: 26]
  |  Branch (4073:39): [True: 109, False: 0]
  ------------------
 4074|    109|	    rar->generic.split_after > 0)
  ------------------
  |  Branch (4074:6): [True: 98, False: 11]
  ------------------
 4075|     98|	{
 4076|     98|		int ret;
 4077|       |
 4078|     98|		rar->cstate.switch_multivolume = 1;
 4079|     98|		ret = advance_multivolume(a);
 4080|     98|		rar->cstate.switch_multivolume = 0;
 4081|       |
 4082|     98|		if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|     98|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4082:6): [True: 98, False: 0]
  ------------------
 4083|       |			/* Failed to advance to next multivolume archive
 4084|       |			 * file. */
 4085|     98|			return ret;
 4086|     98|		}
 4087|     98|	}
 4088|       |
 4089|     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]
  |  |  ------------------
  ------------------
 4090|     37|	if(to_read == 0) {
  ------------------
  |  Branch (4090:5): [True: 11, False: 26]
  ------------------
 4091|     11|		return ARCHIVE_EOF;
  ------------------
  |  |  232|     11|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4092|     11|	}
 4093|       |
 4094|     26|	if(!read_ahead(a, to_read, &p)) {
  ------------------
  |  Branch (4094:5): [True: 3, False: 23]
  ------------------
 4095|      3|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4096|      3|		    "I/O error when unstoring file");
 4097|      3|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4098|      3|	}
 4099|       |
 4100|     23|	if(ARCHIVE_OK != consume(a, to_read)) {
  ------------------
  |  |  233|     23|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4100:5): [True: 0, False: 23]
  ------------------
 4101|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4102|      0|	}
 4103|       |
 4104|     23|	if(buf)    *buf = p;
  ------------------
  |  Branch (4104:5): [True: 18, False: 5]
  ------------------
 4105|     23|	if(size)   *size = to_read;
  ------------------
  |  Branch (4105:5): [True: 18, False: 5]
  ------------------
 4106|     23|	if(offset) *offset = rar->cstate.last_unstore_ptr;
  ------------------
  |  Branch (4106:5): [True: 18, False: 5]
  ------------------
 4107|       |
 4108|     23|	rar->file.bytes_remaining -= to_read;
 4109|     23|	rar->cstate.last_unstore_ptr += to_read;
 4110|       |
 4111|     23|	update_crc(rar, p, to_read);
 4112|     23|	return ARCHIVE_OK;
  ------------------
  |  |  233|     23|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4113|     23|}
archive_read_support_format_rar5.c:advance_multivolume:
 3466|    178|static int advance_multivolume(struct archive_read* a) {
 3467|    178|	int lret;
 3468|    178|	struct rar5* rar = get_context(a);
 3469|       |
 3470|       |	/* A small state machine that will skip unnecessary data, needed to
 3471|       |	 * switch from one multivolume to another. Such skipping is needed if
 3472|       |	 * we want to be an stream-oriented (instead of file-oriented)
 3473|       |	 * unpacker.
 3474|       |	 *
 3475|       |	 * The state machine starts with `rar->main.endarc` == 0. It also
 3476|       |	 * assumes that current stream pointer points to some base block
 3477|       |	 * header.
 3478|       |	 *
 3479|       |	 * The `endarc` field is being set when the base block parsing
 3480|       |	 * function encounters the 'end of archive' marker.
 3481|       |	 */
 3482|       |
 3483|    651|	while(1) {
  ------------------
  |  Branch (3483:8): [True: 651, Folded]
  ------------------
 3484|    651|		if(rar->main.endarc == 1) {
  ------------------
  |  Branch (3484:6): [True: 86, False: 565]
  ------------------
 3485|     86|			int looping = 1;
 3486|       |
 3487|     86|			rar->main.endarc = 0;
 3488|       |
 3489|  5.90k|			while(looping) {
  ------------------
  |  Branch (3489:10): [True: 5.90k, False: 0]
  ------------------
 3490|  5.90k|				lret = skip_base_block(a);
 3491|  5.90k|				switch(lret) {
 3492|  5.81k|					case ARCHIVE_RETRY:
  ------------------
  |  |  234|  5.81k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (3492:6): [True: 5.81k, False: 86]
  ------------------
 3493|       |						/* Continue looping. */
 3494|  5.81k|						break;
 3495|      0|					case ARCHIVE_OK:
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3495:6): [True: 0, False: 5.90k]
  ------------------
 3496|       |						/* Break loop. */
 3497|      0|						looping = 0;
 3498|      0|						break;
 3499|     86|					default:
  ------------------
  |  Branch (3499:6): [True: 86, False: 5.81k]
  ------------------
 3500|       |						/* Forward any errors to the
 3501|       |						 * caller. */
 3502|     86|						return lret;
 3503|  5.90k|				}
 3504|  5.90k|			}
 3505|       |
 3506|      0|			break;
 3507|    565|		} else {
 3508|       |			/* Skip current base block. In order to properly skip
 3509|       |			 * it, we really need to simply parse it and discard
 3510|       |			 * the results. */
 3511|       |
 3512|    565|			lret = skip_base_block(a);
 3513|    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 (3513:7): [True: 11, False: 554]
  |  Branch (3513:32): [True: 16, False: 538]
  ------------------
 3514|     27|				return lret;
 3515|       |
 3516|       |			/* The `skip_base_block` function tells us if we
 3517|       |			 * should continue with skipping, or we should stop
 3518|       |			 * skipping. We're trying to skip everything up to
 3519|       |			 * a base FILE block. */
 3520|       |
 3521|    538|			if(lret != ARCHIVE_RETRY) {
  ------------------
  |  |  234|    538|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (3521:7): [True: 98, False: 440]
  ------------------
 3522|       |				/* If there was an error during skipping, or we
 3523|       |				 * have just skipped a FILE base block... */
 3524|       |
 3525|     98|				if(rar->main.endarc == 0) {
  ------------------
  |  Branch (3525:8): [True: 65, False: 33]
  ------------------
 3526|     65|					return lret;
 3527|     65|				} else {
 3528|     33|					continue;
 3529|     33|				}
 3530|     98|			}
 3531|    538|		}
 3532|    651|	}
 3533|       |
 3534|      0|	return ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3535|    178|}
archive_read_support_format_rar5.c:skip_base_block:
 2476|  6.46k|static int skip_base_block(struct archive_read* a) {
 2477|  6.46k|	int ret;
 2478|  6.46k|	struct rar5* rar = get_context(a);
 2479|       |
 2480|       |	/* Create a new local archive_entry structure that will be operated on
 2481|       |	 * by header reader; operations on this archive_entry will be discarded.
 2482|       |	 */
 2483|  6.46k|	struct archive_entry* entry = archive_entry_new();
 2484|  6.46k|	if (entry == NULL)
  ------------------
  |  Branch (2484:6): [True: 0, False: 6.46k]
  ------------------
 2485|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2486|       |
 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:
 4053|  1.57k|static int uncompress_file(struct archive_read* a) {
 4054|  1.57k|	int ret;
 4055|       |
 4056|  1.57k|	while(1) {
  ------------------
  |  Branch (4056:8): [True: 1.57k, Folded]
  ------------------
 4057|       |		/* Sometimes the uncompression function will return a
 4058|       |		 * 'retry' signal. If this will happen, we have to retry
 4059|       |		 * the function. */
 4060|  1.57k|		ret = do_uncompress_file(a);
 4061|  1.57k|		if(ret != ARCHIVE_RETRY)
  ------------------
  |  |  234|  1.57k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (4061:6): [True: 1.57k, False: 0]
  ------------------
 4062|  1.57k|			return ret;
 4063|  1.57k|	}
 4064|  1.57k|}
archive_read_support_format_rar5.c:do_uncompress_file:
 3940|  1.57k|static int do_uncompress_file(struct archive_read* a) {
 3941|  1.57k|	struct rar5* rar = get_context(a);
 3942|  1.57k|	int ret;
 3943|  1.57k|	int64_t max_end_pos;
 3944|       |
 3945|  1.57k|	if(!rar->cstate.initialized) {
  ------------------
  |  Branch (3945:5): [True: 234, False: 1.34k]
  ------------------
 3946|       |		/* Don't perform full context reinitialization if we're
 3947|       |		 * processing a solid archive. */
 3948|    234|		if(!rar->main.solid || !rar->cstate.window_buf) {
  ------------------
  |  Branch (3948:6): [True: 131, False: 103]
  |  Branch (3948:26): [True: 12, False: 91]
  ------------------
 3949|    143|			if((ret = init_unpack(rar)) != ARCHIVE_OK)
  ------------------
  |  |  233|    143|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3949:7): [True: 0, False: 143]
  ------------------
 3950|      0|				return ret;
 3951|    143|		}
 3952|       |
 3953|    234|		rar->cstate.initialized = 1;
 3954|    234|	}
 3955|       |
 3956|       |	/* Don't allow extraction if window_size is invalid. */
 3957|  1.57k|	if(rar->cstate.window_size == 0) {
  ------------------
  |  Branch (3957:5): [True: 0, False: 1.57k]
  ------------------
 3958|      0|		archive_set_error(&a->archive,
 3959|      0|			ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3960|      0|			"Invalid window size declaration in this file");
 3961|       |
 3962|       |		/* This should never happen in valid files. */
 3963|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3964|      0|	}
 3965|       |
 3966|  1.57k|	if(rar->cstate.all_filters_applied == 1) {
  ------------------
  |  Branch (3966:5): [True: 1.57k, False: 0]
  ------------------
 3967|       |		/* We use while(1) here, but standard case allows for just 1
 3968|       |		 * iteration. The loop will iterate if process_block() didn't
 3969|       |		 * generate any data at all. This can happen if the block
 3970|       |		 * contains only filter definitions (this is common in big
 3971|       |		 * files). */
 3972|  2.08k|		while(1) {
  ------------------
  |  Branch (3972:9): [True: 2.08k, Folded]
  ------------------
 3973|  2.08k|			ret = process_block(a);
 3974|  2.08k|			if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  2.08k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3974:7): [True: 413, False: 1.66k]
  ------------------
 3975|    413|				return ret;
 3976|       |
 3977|  1.66k|			if(rar->cstate.last_write_ptr ==
  ------------------
  |  Branch (3977:7): [True: 509, False: 1.16k]
  ------------------
 3978|  1.66k|			    rar->cstate.write_ptr) {
 3979|       |				/* The block didn't generate any new data,
 3980|       |				 * so just process a new block if this one
 3981|       |				 * wasn't the last block in the file. */
 3982|    509|				if (bf_is_last_block(&rar->last_block_hdr)) {
  ------------------
  |  Branch (3982:9): [True: 3, False: 506]
  ------------------
 3983|      3|					return ARCHIVE_EOF;
  ------------------
  |  |  232|      3|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3984|      3|				}
 3985|       |
 3986|    506|				continue;
 3987|    509|			}
 3988|       |
 3989|       |			/* The block has generated some new data, so break
 3990|       |			 * the loop. */
 3991|  1.16k|			break;
 3992|  1.66k|		}
 3993|  1.57k|	}
 3994|       |
 3995|       |	/* Try to run filters. If filters won't be applied, it means that
 3996|       |	 * insufficient data was generated. */
 3997|  1.16k|	ret = apply_filters(a);
 3998|  1.16k|	if(ret == ARCHIVE_RETRY) {
  ------------------
  |  |  234|  1.16k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (3998:5): [True: 0, False: 1.16k]
  ------------------
 3999|      0|		return ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4000|  1.16k|	} else if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.16k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4000:12): [True: 0, False: 1.16k]
  ------------------
 4001|      0|		return ret;
 4002|      0|	}
 4003|       |
 4004|  1.16k|	if(cdeque_size(&rar->cstate.filters) > 0) {
  ------------------
  |  Branch (4004:5): [True: 0, False: 1.16k]
  ------------------
 4005|       |		/* Check if we can write something before hitting first
 4006|       |		 * filter. */
 4007|      0|		struct filter_info* flt;
 4008|       |
 4009|       |		/* Get the block_start offset from the first filter. */
 4010|      0|		if(CDE_OK != cdeque_front(&rar->cstate.filters,
  ------------------
  |  Branch (4010:6): [True: 0, False: 0]
  ------------------
 4011|      0|		    cdeque_filter_p(&flt)))
 4012|      0|		{
 4013|      0|			archive_set_error(&a->archive,
 4014|      0|			    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 4015|      0|			    "Can't read first filter");
 4016|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4017|      0|		}
 4018|       |
 4019|      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]
  |  |  ------------------
  ------------------
 4020|      0|		    rar->cstate.write_ptr);
 4021|  1.16k|	} else {
 4022|       |		/* There are no filters defined, or all filters were applied.
 4023|       |		 * This means we can just store the data without any
 4024|       |		 * postprocessing. */
 4025|  1.16k|		max_end_pos = rar->cstate.write_ptr;
 4026|  1.16k|	}
 4027|       |
 4028|  1.16k|	if(max_end_pos == rar->cstate.last_write_ptr) {
  ------------------
  |  Branch (4028:5): [True: 0, False: 1.16k]
  ------------------
 4029|       |		/* We can't write anything yet. The block uncompression
 4030|       |		 * function did not generate enough data, and no filter can be
 4031|       |		 * applied. At the same time we don't have any data that can be
 4032|       |		 *  stored without filter postprocessing. This means we need to
 4033|       |		 *  wait for more data to be generated, so we can apply the
 4034|       |		 * filters.
 4035|       |		 *
 4036|       |		 * Signal the caller that we need more data to be able to do
 4037|       |		 * anything.
 4038|       |		 */
 4039|      0|		return ARCHIVE_RETRY;
  ------------------
  |  |  234|      0|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 4040|  1.16k|	} else {
 4041|       |		/* We can write the data before hitting the first filter.
 4042|       |		 * So let's do it. The push_window_data() function will
 4043|       |		 * effectively return the selected data block to the user
 4044|       |		 * application. */
 4045|  1.16k|		push_window_data(a, rar, rar->cstate.last_write_ptr,
 4046|  1.16k|		    max_end_pos);
 4047|  1.16k|		rar->cstate.last_write_ptr = max_end_pos;
 4048|  1.16k|	}
 4049|       |
 4050|  1.16k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.16k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4051|  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:
 3661|  2.08k|static int process_block(struct archive_read* a) {
 3662|  2.08k|	const uint8_t* p;
 3663|  2.08k|	struct rar5* rar = get_context(a);
 3664|  2.08k|	int ret;
 3665|       |
 3666|       |	/* If we don't have any data to be processed, this most probably means
 3667|       |	 * we need to switch to the next volume. */
 3668|  2.08k|	if(rar->main.volume && rar->file.bytes_remaining == 0) {
  ------------------
  |  Branch (3668:5): [True: 1.29k, False: 792]
  |  Branch (3668:25): [True: 24, False: 1.26k]
  ------------------
 3669|     24|		ret = advance_multivolume(a);
 3670|     24|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|     24|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3670:6): [True: 24, False: 0]
  ------------------
 3671|     24|			return ret;
 3672|     24|	}
 3673|       |
 3674|  2.05k|	if(rar->cstate.block_parsing_finished) {
  ------------------
  |  Branch (3674:5): [True: 1.70k, False: 354]
  ------------------
 3675|  1.70k|		ssize_t block_size;
 3676|  1.70k|		ssize_t to_skip;
 3677|  1.70k|		ssize_t cur_block_size;
 3678|       |
 3679|       |		/* The header size won't be bigger than 6 bytes. */
 3680|  1.70k|		if(!read_ahead(a, 6, &p)) {
  ------------------
  |  Branch (3680:6): [True: 3, False: 1.70k]
  ------------------
 3681|       |			/* Failed to prefetch data block header. */
 3682|      3|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      3|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3683|      3|		}
 3684|       |
 3685|       |		/*
 3686|       |		 * Read block_size by parsing block header. Validate the header
 3687|       |		 * by calculating CRC byte stored inside the header. Size of
 3688|       |		 * the header is not constant (block size can be stored either
 3689|       |		 * in 1 or 2 bytes), that's why block size is left out from the
 3690|       |		 * `compressed_block_header` structure and returned by
 3691|       |		 * `parse_block_header` as the second argument. */
 3692|       |
 3693|  1.70k|		ret = parse_block_header(a, p, &block_size,
 3694|  1.70k|		    &rar->last_block_hdr);
 3695|  1.70k|		if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.70k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3695:6): [True: 28, False: 1.67k]
  ------------------
 3696|     28|			return ret;
 3697|     28|		}
 3698|       |
 3699|       |		/* Skip block header. Next data is huffman tables,
 3700|       |		 * if present. */
 3701|  1.67k|		to_skip = sizeof(struct compressed_block_header) +
 3702|  1.67k|			bf_byte_count(&rar->last_block_hdr) + 1;
 3703|       |
 3704|       |		/* If the block header's to_skip value exceeds the declared
 3705|       |		 * remaining data, the archive is malformed. */
 3706|  1.67k|		if(to_skip > rar->file.bytes_remaining) {
  ------------------
  |  Branch (3706:6): [True: 3, False: 1.67k]
  ------------------
 3707|      3|			archive_set_error(&a->archive,
 3708|      3|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3709|      3|			    "Block header size exceeds remaining file data");
 3710|      3|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3711|      3|		}
 3712|       |
 3713|  1.67k|		if(ARCHIVE_OK != consume(a, to_skip))
  ------------------
  |  |  233|  1.67k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3713:6): [True: 0, False: 1.67k]
  ------------------
 3714|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3715|       |
 3716|  1.67k|		rar->file.bytes_remaining -= to_skip;
 3717|       |
 3718|       |		/* The block size gives information about the whole block size,
 3719|       |		 * but the block could be stored in split form when using
 3720|       |		 * multi-volume archives. In this case, the block size will be
 3721|       |		 * bigger than the actual data stored in this file. Remaining
 3722|       |		 * part of the data will be in another file. */
 3723|       |
 3724|  1.67k|		cur_block_size =
 3725|  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]
  |  |  ------------------
  ------------------
 3726|       |
 3727|  1.67k|		if(block_size > rar->file.bytes_remaining) {
  ------------------
  |  Branch (3727:6): [True: 56, False: 1.61k]
  ------------------
 3728|       |			/* If current blocks' size is bigger than our data
 3729|       |			 * size, this means we have a multivolume archive.
 3730|       |			 * In this case, skip all base headers until the end
 3731|       |			 * of the file, proceed to next "partXXX.rar" volume,
 3732|       |			 * find its signature, skip all headers up to the first
 3733|       |			 * FILE base header, and continue from there.
 3734|       |			 *
 3735|       |			 * Note that `merge_block` will update the `rar`
 3736|       |			 * context structure quite extensively. */
 3737|       |
 3738|     56|			ret = merge_block(a, block_size, &p);
 3739|     56|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|     56|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3739:7): [True: 56, False: 0]
  ------------------
 3740|     56|				return ret;
 3741|     56|			}
 3742|       |
 3743|      0|			cur_block_size = block_size;
 3744|       |
 3745|       |			/* Current stream pointer should be now directly
 3746|       |			 * *after* the block that spanned through multiple
 3747|       |			 * archive files. `p` pointer should have the data of
 3748|       |			 * the *whole* block (merged from partial blocks
 3749|       |			 * stored in multiple archives files). */
 3750|  1.61k|		} else {
 3751|  1.61k|			rar->cstate.switch_multivolume = 0;
 3752|       |
 3753|       |			/* Read the whole block size into memory. This can take
 3754|       |			 * up to  8 megabytes of memory in theoretical cases.
 3755|       |			 * Might be worth to optimize this and use a standard
 3756|       |			 * chunk of 4kb's. */
 3757|  1.61k|			if(!read_ahead(a, 4 + cur_block_size, &p)) {
  ------------------
  |  Branch (3757:7): [True: 226, False: 1.38k]
  ------------------
 3758|       |				/* Failed to prefetch block data. */
 3759|    226|				return ARCHIVE_EOF;
  ------------------
  |  |  232|    226|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3760|    226|			}
 3761|  1.61k|		}
 3762|       |
 3763|  1.38k|		rar->cstate.block_buf = p;
 3764|  1.38k|		rar->cstate.cur_block_size = cur_block_size;
 3765|  1.38k|		rar->cstate.block_parsing_finished = 0;
 3766|       |
 3767|  1.38k|		rar->bits.in_addr = 0;
 3768|  1.38k|		rar->bits.bit_addr = 0;
 3769|       |
 3770|  1.38k|		if(bf_is_table_present(&rar->last_block_hdr)) {
  ------------------
  |  Branch (3770:6): [True: 147, False: 1.24k]
  ------------------
 3771|       |			/* Load Huffman tables. */
 3772|    147|			ret = parse_tables(a, rar, p);
 3773|    147|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|    147|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3773:7): [True: 73, False: 74]
  ------------------
 3774|       |				/* Error during decompression of Huffman
 3775|       |				 * tables. */
 3776|     73|				return ret;
 3777|     73|			}
 3778|    147|		}
 3779|  1.38k|	} else {
 3780|       |		/* Block parsing not finished, reuse previous memory buffer. */
 3781|    354|		p = rar->cstate.block_buf;
 3782|    354|	}
 3783|       |
 3784|       |	/* Uncompress the block, or a part of it, depending on how many bytes
 3785|       |	 * will be generated by uncompressing the block.
 3786|       |	 *
 3787|       |	 * In case too many bytes will be generated, calling this function
 3788|       |	 * again will resume the uncompression operation. */
 3789|  1.66k|	ret = do_uncompress_block(a, p);
 3790|  1.66k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.66k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3790:5): [True: 0, False: 1.66k]
  ------------------
 3791|      0|		return ret;
 3792|      0|	}
 3793|       |
 3794|  1.66k|	if(rar->cstate.block_parsing_finished &&
  ------------------
  |  Branch (3794:5): [True: 1.33k, False: 331]
  ------------------
 3795|  1.33k|	    rar->cstate.switch_multivolume == 0 &&
  ------------------
  |  Branch (3795:6): [True: 1.33k, False: 0]
  ------------------
 3796|  1.33k|	    rar->cstate.cur_block_size > 0)
  ------------------
  |  Branch (3796:6): [True: 829, False: 509]
  ------------------
 3797|    829|	{
 3798|       |		/* If we're processing a normal block, consume the whole
 3799|       |		 * block. We can do this because we've already read the whole
 3800|       |		 * block to memory. */
 3801|    829|		if(ARCHIVE_OK != consume(a, rar->cstate.cur_block_size))
  ------------------
  |  |  233|    829|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3801:6): [True: 0, False: 829]
  ------------------
 3802|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3803|       |
 3804|    829|		rar->file.bytes_remaining -= rar->cstate.cur_block_size;
 3805|    840|	} else if(rar->cstate.switch_multivolume) {
  ------------------
  |  Branch (3805:12): [True: 0, False: 840]
  ------------------
 3806|       |		/* Don't consume the block if we're doing multivolume
 3807|       |		 * processing. The volume switching function will consume
 3808|       |		 * the proper count of bytes instead. */
 3809|      0|		rar->cstate.switch_multivolume = 0;
 3810|      0|	}
 3811|       |
 3812|  1.66k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.66k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3813|  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:
  503|  5.07k|uint8_t bf_byte_count(const struct compressed_block_header* hdr) {
  504|  5.07k|	return (hdr->block_flags_u8 >> 3) & 7;
  505|  5.07k|}
archive_read_support_format_rar5.c:merge_block:
 3543|     56|{
 3544|     56|	struct rar5* rar = get_context(a);
 3545|     56|	ssize_t cur_block_size, partial_offset = 0;
 3546|     56|	const uint8_t* lp;
 3547|     56|	int ret;
 3548|       |
 3549|     56|	if(rar->merge_mode) {
  ------------------
  |  Branch (3549:5): [True: 0, False: 56]
  ------------------
 3550|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3551|      0|		    "Recursive merge is not allowed");
 3552|       |
 3553|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3554|      0|	}
 3555|       |
 3556|       |	/* Set a flag that we're in the switching mode. */
 3557|     56|	rar->cstate.switch_multivolume = 1;
 3558|       |
 3559|       |	/* Reallocate the memory which will hold the whole block. */
 3560|     56|	if(rar->vol.push_buf)
  ------------------
  |  Branch (3560:5): [True: 1, False: 55]
  ------------------
 3561|      1|		free((void*) rar->vol.push_buf);
 3562|       |
 3563|       |	/* Increasing the allocation block by 8 is due to bit reading functions,
 3564|       |	 * which are using additional 2 or 4 bytes. Allocating the block size
 3565|       |	 * by exact value would make bit reader perform reads from invalid
 3566|       |	 * memory block when reading the last byte from the buffer. */
 3567|     56|	rar->vol.push_buf = malloc(block_size + 8);
 3568|     56|	if(!rar->vol.push_buf) {
  ------------------
  |  Branch (3568:5): [True: 0, False: 56]
  ------------------
 3569|      0|		archive_set_error(&a->archive, ENOMEM,
 3570|      0|		    "Can't allocate memory for a merge block buffer");
 3571|      0|		rar->cstate.switch_multivolume = 0;
 3572|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3573|      0|	}
 3574|       |
 3575|       |	/* Valgrind complains if the extension block for bit reader is not
 3576|       |	 * initialized, so initialize it. */
 3577|     56|	memset(&rar->vol.push_buf[block_size], 0, 8);
 3578|       |
 3579|       |	/* A single block can span across multiple multivolume archive files,
 3580|       |	 * so we use a loop here. This loop will consume enough multivolume
 3581|       |	 * archive files until the whole block is read. */
 3582|       |
 3583|     56|	while(1) {
  ------------------
  |  Branch (3583:8): [True: 56, Folded]
  ------------------
 3584|       |		/* Get the size of current block chunk in this multivolume
 3585|       |		 * archive file and read it. */
 3586|     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]
  |  |  ------------------
  ------------------
 3587|     56|		    block_size - partial_offset);
 3588|       |
 3589|     56|		if(cur_block_size < 1) {
  ------------------
  |  Branch (3589:6): [True: 0, False: 56]
  ------------------
 3590|       |			/* bytes_remaining is less than 1 at the wrong point in
 3591|       |			 * the merge loop, indicating corrupt volume
 3592|       |			 * accounting. */
 3593|      0|			archive_set_error(&a->archive,
 3594|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3595|      0|			    "Encountered invalid block size during block merge");
 3596|      0|			rar->cstate.switch_multivolume = 0;
 3597|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3598|      0|		}
 3599|       |
 3600|     56|		if(!read_ahead(a, cur_block_size, &lp)) {
  ------------------
  |  Branch (3600:6): [True: 0, False: 56]
  ------------------
 3601|      0|			rar->cstate.switch_multivolume = 0;
 3602|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3603|      0|		}
 3604|       |
 3605|       |		/* Sanity check; there should never be a situation where this
 3606|       |		 * function reads more data than the block's size. */
 3607|     56|		if(partial_offset + cur_block_size > block_size) {
  ------------------
  |  Branch (3607:6): [True: 0, False: 56]
  ------------------
 3608|      0|			archive_set_error(&a->archive,
 3609|      0|			    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3610|      0|			    "Consumed too much data when merging blocks");
 3611|      0|			rar->cstate.switch_multivolume = 0;
 3612|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3613|      0|		}
 3614|       |
 3615|       |		/* Merge previous block chunk with current block chunk,
 3616|       |		 * or create first block chunk if this is our first
 3617|       |		 * iteration. */
 3618|     56|		memcpy(&rar->vol.push_buf[partial_offset], lp, cur_block_size);
 3619|       |
 3620|       |		/* Advance the stream read pointer by this block chunk size. */
 3621|     56|		if(ARCHIVE_OK != consume(a, cur_block_size)) {
  ------------------
  |  |  233|     56|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3621:6): [True: 0, False: 56]
  ------------------
 3622|       |			/* Data was copied but stream pointer didn't advance;
 3623|       |			 * stream position is unrecoverable. */
 3624|      0|			rar->cstate.switch_multivolume = 0;
 3625|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3626|      0|		}
 3627|       |
 3628|       |		/* Update the pointers. `partial_offset` contains information
 3629|       |		 * about the sum of merged block chunks. */
 3630|     56|		partial_offset += cur_block_size;
 3631|     56|		rar->file.bytes_remaining -= cur_block_size;
 3632|       |
 3633|       |		/* If `partial_offset` is the same as `block_size`, this means
 3634|       |		 * we've merged all block chunks and we have a valid full
 3635|       |		 * block. */
 3636|     56|		if(partial_offset == block_size) {
  ------------------
  |  Branch (3636:6): [True: 0, False: 56]
  ------------------
 3637|      0|			break;
 3638|      0|		}
 3639|       |
 3640|       |		/* If we don't have any bytes to read, this means we should
 3641|       |		 * switch to another multivolume archive file. */
 3642|     56|		if(rar->file.bytes_remaining == 0) {
  ------------------
  |  Branch (3642:6): [True: 56, False: 0]
  ------------------
 3643|     56|			rar->merge_mode++;
 3644|     56|			ret = advance_multivolume(a);
 3645|     56|			rar->merge_mode--;
 3646|     56|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|     56|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3646:7): [True: 56, False: 0]
  ------------------
 3647|     56|				rar->cstate.switch_multivolume = 0;
 3648|     56|				return ret;
 3649|     56|			}
 3650|     56|		}
 3651|     56|	}
 3652|       |
 3653|      0|	*p = rar->vol.push_buf;
 3654|       |
 3655|       |	/* If we're here, we can resume unpacking by processing the block
 3656|       |	 * pointed to by the `*p` memory pointer. */
 3657|       |
 3658|      0|	return ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3659|     56|}
archive_read_support_format_rar5.c:bf_is_table_present:
  508|  1.38k|uint8_t bf_is_table_present(const struct compressed_block_header* hdr) {
  509|  1.38k|	return (hdr->block_flags_u8 >> 7) & 1;
  510|  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;) {
  ------------------
  |  |  248|  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);
  ------------------
  |  |  248|  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);
  ------------------
  |  |  248|    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;) {
  ------------------
  |  |  258|  7.40k|#define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  250|  7.40k|#define HUFF_NC 306
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  252|  7.40k|#define HUFF_DC 64
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  256|  7.40k|#define HUFF_RC 44
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  254|  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) {
  ------------------
  |  |  258|    170|#define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  250|    170|#define HUFF_NC 306
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  252|    170|#define HUFF_DC 64
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  256|    170|#define HUFF_RC 44
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  254|    170|#define HUFF_LDC 16
  |  |  ------------------
  ------------------
  |  Branch (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)
  ------------------
  |  |  258|  35.6k|#define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  250|  35.6k|#define HUFF_NC 306
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  252|  35.6k|#define HUFF_DC 64
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  256|  35.6k|#define HUFF_RC 44
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  254|  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);
  ------------------
  |  |  250|     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;
  ------------------
  |  |  250|     76|#define HUFF_NC 306
  ------------------
 2920|       |
 2921|     76|	ret = create_decode_tables(&table[idx], &rar->cstate.dd, HUFF_DC);
  ------------------
  |  |  252|     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;
  ------------------
  |  |  252|     74|#define HUFF_DC 64
  ------------------
 2929|       |
 2930|     74|	ret = create_decode_tables(&table[idx], &rar->cstate.ldd, HUFF_LDC);
  ------------------
  |  |  254|     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;
  ------------------
  |  |  254|     74|#define HUFF_LDC 16
  ------------------
 2938|       |
 2939|     74|	ret = create_decode_tables(&table[idx], &rar->cstate.rd, HUFF_RC);
  ------------------
  |  |  256|     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;
  ------------------
  |  |  250|    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:
 1057|  58.6k|{
 1058|  58.6k|	if(rar->bits.in_addr >= rar->cstate.cur_block_size) {
  ------------------
  |  Branch (1058:5): [True: 0, False: 58.6k]
  ------------------
 1059|      0|		archive_set_error(&a->archive,
 1060|      0|			ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1061|      0|			"Premature end of stream during extraction of data (#2)");
 1062|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1063|      0|	}
 1064|       |
 1065|  58.6k|	uint32_t bits = archive_be24dec(p + (unsigned)rar->bits.in_addr);
 1066|  58.6k|	bits >>= (8 - rar->bits.bit_addr);
 1067|  58.6k|	*value = bits & 0xffff;
 1068|  58.6k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  58.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1069|  58.6k|}
archive_read_support_format_rar5.c:skip_bits:
 1071|  58.7k|static void skip_bits(struct rar5* rar, int bits) {
 1072|  58.7k|	const int new_bits = rar->bits.bit_addr + bits;
 1073|  58.7k|	rar->bits.in_addr += new_bits >> 3;
 1074|  58.7k|	rar->bits.bit_addr = new_bits & 7;
 1075|  58.7k|}
archive_read_support_format_rar5.c:do_uncompress_block:
 3189|  1.66k|static int do_uncompress_block(struct archive_read* a, const uint8_t* p) {
 3190|  1.66k|	struct rar5* rar = get_context(a);
 3191|  1.66k|	uint16_t num;
 3192|  1.66k|	int ret;
 3193|       |
 3194|  1.66k|	const uint64_t cmask = rar->cstate.window_mask;
 3195|  1.66k|	const struct compressed_block_header* hdr = &rar->last_block_hdr;
 3196|  1.66k|	const uint8_t bit_size = 1 + bf_bit_size(hdr);
 3197|       |
 3198|  26.5k|	while(1) {
  ------------------
  |  Branch (3198:8): [True: 26.5k, Folded]
  ------------------
 3199|  26.5k|		if(rar->cstate.write_ptr - rar->cstate.last_write_ptr >
  ------------------
  |  Branch (3199:6): [True: 331, False: 26.2k]
  ------------------
 3200|  26.5k|		    (rar->cstate.window_size >> 1)) {
 3201|       |			/* Don't allow growing data by more than half of the
 3202|       |			 * window size at a time. In such case, break the loop;
 3203|       |			 *  next call to this function will continue processing
 3204|       |			 *  from this moment. */
 3205|    331|			break;
 3206|    331|		}
 3207|       |
 3208|  26.2k|		if(rar->bits.in_addr > rar->cstate.cur_block_size - 1 ||
  ------------------
  |  Branch (3208:6): [True: 928, False: 25.2k]
  ------------------
 3209|  25.2k|		    (rar->bits.in_addr == rar->cstate.cur_block_size - 1 &&
  ------------------
  |  Branch (3209:8): [True: 680, False: 24.5k]
  ------------------
 3210|    680|		    rar->bits.bit_addr >= bit_size))
  ------------------
  |  Branch (3210:7): [True: 410, False: 270]
  ------------------
 3211|  1.33k|		{
 3212|       |			/* If the program counter is here, it means the
 3213|       |			 * function has finished processing the block. */
 3214|  1.33k|			rar->cstate.block_parsing_finished = 1;
 3215|  1.33k|			break;
 3216|  1.33k|		}
 3217|       |
 3218|       |		/* Decode the next literal. */
 3219|  24.8k|		if(ARCHIVE_OK != decode_number(a, &rar->cstate.ld, p, &num)) {
  ------------------
  |  |  233|  24.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3219:6): [True: 0, False: 24.8k]
  ------------------
 3220|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3221|      0|		}
 3222|       |
 3223|       |		/* Num holds a decompression literal, or 'command code'.
 3224|       |		 *
 3225|       |		 * - Values lower than 256 are just bytes. Those codes
 3226|       |		 *   can be stored in the output buffer directly.
 3227|       |		 *
 3228|       |		 * - Code 256 defines a new filter, which is later used to
 3229|       |		 *   transform the data block accordingly to the filter type.
 3230|       |		 *   The data block needs to be fully uncompressed first.
 3231|       |		 *
 3232|       |		 * - Code bigger than 257 and smaller than 262 define
 3233|       |		 *   a repetition pattern that should be copied from
 3234|       |		 *   an already uncompressed chunk of data.
 3235|       |		 */
 3236|       |
 3237|  24.8k|		if(num < 256) {
  ------------------
  |  Branch (3237:6): [True: 16.2k, False: 8.62k]
  ------------------
 3238|       |			/* Directly store the byte. */
 3239|  16.2k|			int64_t write_idx;
 3240|       |
 3241|       |			/* A literal write emits one byte; copy_string() checks len. */
 3242|  16.2k|			if(rar->cstate.write_ptr >= rar->file.unpacked_size) {
  ------------------
  |  Branch (3242:7): [True: 0, False: 16.2k]
  ------------------
 3243|      0|				archive_set_error(&a->archive,
 3244|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3245|      0|				    "Uncompressed data exceeds declared size");
 3246|      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 (3246:12): [True: 0, False: 0]
  ------------------
 3247|      0|			}
 3248|       |
 3249|  16.2k|			write_idx = rar->cstate.solid_offset +
 3250|  16.2k|			    rar->cstate.write_ptr++;
 3251|       |
 3252|  16.2k|			rar->cstate.window_buf[write_idx & cmask] =
 3253|  16.2k|			    (uint8_t) num;
 3254|  16.2k|			continue;
 3255|  16.2k|		} else if(num >= 262) {
  ------------------
  |  Branch (3255:13): [True: 8.25k, False: 376]
  ------------------
 3256|  8.25k|			uint16_t dist_slot;
 3257|  8.25k|			int len = decode_code_length(a, rar, p, num - 262),
 3258|  8.25k|				dbits,
 3259|  8.25k|				dist = 1;
 3260|       |
 3261|  8.25k|			if(len == -1) {
  ------------------
  |  Branch (3261:7): [True: 0, False: 8.25k]
  ------------------
 3262|      0|				archive_set_error(&a->archive,
 3263|      0|				    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3264|      0|				    "Failed to decode the code length");
 3265|       |
 3266|      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 (3266:12): [True: 0, False: 0]
  ------------------
 3267|      0|			}
 3268|       |
 3269|  8.25k|			if(ARCHIVE_OK != decode_number(a, &rar->cstate.dd, p,
  ------------------
  |  |  233|  8.25k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3269:7): [True: 0, False: 8.25k]
  ------------------
 3270|  8.25k|			    &dist_slot))
 3271|      0|			{
 3272|      0|				archive_set_error(&a->archive,
 3273|      0|				    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3274|      0|				    "Failed to decode the distance slot");
 3275|       |
 3276|      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 (3276:12): [True: 0, False: 0]
  ------------------
 3277|      0|			}
 3278|       |
 3279|  8.25k|			if(dist_slot < 4) {
  ------------------
  |  Branch (3279:7): [True: 14, False: 8.23k]
  ------------------
 3280|     14|				dbits = 0;
 3281|     14|				dist += dist_slot;
 3282|  8.23k|			} else {
 3283|  8.23k|				dbits = dist_slot / 2 - 1;
 3284|       |
 3285|       |				/* Cast to uint32_t will make sure the shift
 3286|       |				 * left operation won't produce undefined
 3287|       |				 * result. Then, the uint32_t type will
 3288|       |				 * be implicitly casted to int. */
 3289|  8.23k|				dist += (uint32_t) (2 |
 3290|  8.23k|				    (dist_slot & 1)) << dbits;
 3291|  8.23k|			}
 3292|       |
 3293|  8.25k|			if(dbits > 0) {
  ------------------
  |  Branch (3293:7): [True: 8.23k, False: 14]
  ------------------
 3294|  8.23k|				if(dbits >= 4) {
  ------------------
  |  Branch (3294:8): [True: 104, False: 8.13k]
  ------------------
 3295|    104|					uint32_t add = 0;
 3296|    104|					uint16_t low_dist;
 3297|       |
 3298|    104|					if(dbits > 4) {
  ------------------
  |  Branch (3298:9): [True: 100, False: 4]
  ------------------
 3299|    100|						if(ARCHIVE_OK != (ret = read_bits_32(
  ------------------
  |  |  233|    100|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3299:10): [True: 0, False: 100]
  ------------------
 3300|    100|						    a, rar, p, &add))) {
 3301|       |							/* Return EOF if we
 3302|       |							 * can't read more
 3303|       |							 * data. */
 3304|      0|							return ret;
 3305|      0|						}
 3306|       |
 3307|    100|						skip_bits(rar, dbits - 4);
 3308|    100|						add = (add >> (
 3309|    100|						    36 - dbits)) << 4;
 3310|    100|						dist += add;
 3311|    100|					}
 3312|       |
 3313|    104|					if(ARCHIVE_OK != decode_number(a,
  ------------------
  |  |  233|    104|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3313:9): [True: 0, False: 104]
  ------------------
 3314|    104|					    &rar->cstate.ldd, p, &low_dist))
 3315|      0|					{
 3316|      0|						archive_set_error(&a->archive,
 3317|      0|						    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3318|      0|						    "Failed to decode the "
 3319|      0|						    "distance slot");
 3320|       |
 3321|      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 (3321:14): [True: 0, False: 0]
  ------------------
 3322|      0|					}
 3323|       |
 3324|    104|					if(dist >= INT_MAX - low_dist - 1) {
  ------------------
  |  Branch (3324:9): [True: 0, False: 104]
  ------------------
 3325|       |						/* This only happens in
 3326|       |						 * invalid archives. */
 3327|      0|						archive_set_error(&a->archive,
 3328|      0|						    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3329|      0|						    "Distance pointer "
 3330|      0|						    "overflow");
 3331|      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 (3331:14): [True: 0, False: 0]
  ------------------
 3332|      0|					}
 3333|       |
 3334|    104|					dist += low_dist;
 3335|  8.13k|				} else {
 3336|       |					/* dbits is one of [0,1,2,3] */
 3337|  8.13k|					int add;
 3338|       |
 3339|  8.13k|					if(ARCHIVE_OK != (ret = read_consume_bits(a, rar,
  ------------------
  |  |  233|  8.13k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3339:9): [True: 0, False: 8.13k]
  ------------------
 3340|  8.13k|					     p, dbits, &add))) {
 3341|       |						/* Return EOF if we can't read
 3342|       |						 * more data. */
 3343|      0|						return ret;
 3344|      0|					}
 3345|       |
 3346|  8.13k|					dist += add;
 3347|  8.13k|				}
 3348|  8.23k|			}
 3349|       |
 3350|  8.25k|			if(dist > 0x100) {
  ------------------
  |  Branch (3350:7): [True: 76, False: 8.17k]
  ------------------
 3351|     76|				len++;
 3352|       |
 3353|     76|				if(dist > 0x2000) {
  ------------------
  |  Branch (3353:8): [True: 43, False: 33]
  ------------------
 3354|     43|					len++;
 3355|       |
 3356|     43|					if(dist > 0x40000) {
  ------------------
  |  Branch (3356:9): [True: 30, False: 13]
  ------------------
 3357|     30|						len++;
 3358|     30|					}
 3359|     43|				}
 3360|     76|			}
 3361|       |
 3362|  8.25k|			dist_cache_push(rar, dist);
 3363|  8.25k|			rar->cstate.last_len = len;
 3364|       |
 3365|  8.25k|			ret = copy_string(a, len, dist);
 3366|  8.25k|			if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  8.25k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3366:7): [True: 0, False: 8.25k]
  ------------------
 3367|      0|				return ret;
 3368|       |
 3369|  8.25k|			continue;
 3370|  8.25k|		} else if(num == 256) {
  ------------------
  |  Branch (3370:13): [True: 0, False: 376]
  ------------------
 3371|       |			/* Create a filter. */
 3372|      0|			ret = parse_filter(a, p);
 3373|      0|			if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3373:7): [True: 0, False: 0]
  ------------------
 3374|      0|				return ret;
 3375|       |
 3376|      0|			continue;
 3377|    376|		} else if(num == 257) {
  ------------------
  |  Branch (3377:13): [True: 0, False: 376]
  ------------------
 3378|      0|			if(rar->cstate.last_len != 0) {
  ------------------
  |  Branch (3378:7): [True: 0, False: 0]
  ------------------
 3379|      0|				ret = copy_string(a,
 3380|      0|				    rar->cstate.last_len,
 3381|      0|				    rar->cstate.dist_cache[0]);
 3382|      0|				if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3382:8): [True: 0, False: 0]
  ------------------
 3383|      0|					return ret;
 3384|      0|			}
 3385|       |
 3386|      0|			continue;
 3387|    376|		} else {
 3388|       |			/* num < 262 */
 3389|    376|			const int idx = num - 258;
 3390|    376|			const int dist = dist_cache_touch(rar, idx);
 3391|       |
 3392|    376|			uint16_t len_slot;
 3393|    376|			int len;
 3394|       |
 3395|    376|			if(ARCHIVE_OK != decode_number(a, &rar->cstate.rd, p,
  ------------------
  |  |  233|    376|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3395:7): [True: 0, False: 376]
  ------------------
 3396|    376|			    &len_slot)) {
 3397|      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 (3397:12): [True: 0, False: 0]
  ------------------
 3398|      0|			}
 3399|       |
 3400|    376|			len = decode_code_length(a, rar, p, len_slot);
 3401|    376|			if (len == -1) {
  ------------------
  |  Branch (3401:8): [True: 0, False: 376]
  ------------------
 3402|      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 (3402:12): [True: 0, False: 0]
  ------------------
 3403|      0|			}
 3404|       |
 3405|    376|			rar->cstate.last_len = len;
 3406|       |
 3407|    376|			ret = copy_string(a, len, dist);
 3408|    376|			if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|    376|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3408:7): [True: 0, False: 376]
  ------------------
 3409|      0|				return ret;
 3410|       |
 3411|    376|			continue;
 3412|    376|		}
 3413|  24.8k|	}
 3414|       |
 3415|  1.66k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.66k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3416|  1.66k|}
archive_read_support_format_rar5.c:bf_bit_size:
  498|  1.66k|uint8_t bf_bit_size(const struct compressed_block_header* hdr) {
  499|  1.66k|	return hdr->block_flags_u8 & 7;
  500|  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:
 1040|    100|{
 1041|    100|	if(rar->bits.in_addr >= rar->cstate.cur_block_size) {
  ------------------
  |  Branch (1041:5): [True: 0, False: 100]
  ------------------
 1042|      0|		archive_set_error(&a->archive,
 1043|      0|			ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1044|      0|			"Premature end of stream during extraction of data (#1)");
 1045|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1046|      0|	}
 1047|       |
 1048|    100|	uint32_t bits = archive_be32dec(p + rar->bits.in_addr);
 1049|    100|	bits <<= rar->bits.bit_addr;
 1050|    100|	bits |= p[rar->bits.in_addr + 4] >> (8 - rar->bits.bit_addr);
 1051|    100|	*value = bits;
 1052|    100|	return ARCHIVE_OK;
  ------------------
  |  |  233|    100|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1053|    100|}
archive_read_support_format_rar5.c:read_consume_bits:
 1080|  16.3k|{
 1081|  16.3k|	uint16_t v;
 1082|  16.3k|	int ret, num;
 1083|       |
 1084|  16.3k|	if(n == 0 || n > 16) {
  ------------------
  |  Branch (1084:5): [True: 0, False: 16.3k]
  |  Branch (1084:15): [True: 0, False: 16.3k]
  ------------------
 1085|       |		/* This is a programmer error and should never happen
 1086|       |		 * in runtime. */
 1087|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1088|      0|	}
 1089|       |
 1090|  16.3k|	ret = read_bits_16(a, rar, p, &v);
 1091|  16.3k|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  16.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1091:5): [True: 0, False: 16.3k]
  ------------------
 1092|      0|		return ret;
 1093|       |
 1094|  16.3k|	num = (int) v;
 1095|  16.3k|	num >>= 16 - n;
 1096|       |
 1097|  16.3k|	skip_bits(rar, n);
 1098|       |
 1099|  16.3k|	if(value)
  ------------------
  |  Branch (1099:5): [True: 16.3k, False: 0]
  ------------------
 1100|  16.3k|		*value = num;
 1101|       |
 1102|  16.3k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  16.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1103|  16.3k|}
archive_read_support_format_rar5.c:dist_cache_push:
  830|  8.25k|static void dist_cache_push(struct rar5* rar, int value) {
  831|  8.25k|	int* q = rar->cstate.dist_cache;
  832|       |
  833|  8.25k|	q[3] = q[2];
  834|  8.25k|	q[2] = q[1];
  835|  8.25k|	q[1] = q[0];
  836|  8.25k|	q[0] = value;
  837|  8.25k|}
archive_read_support_format_rar5.c:copy_string:
 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|  8.62k|	if (rar->cstate.write_ptr > rar->file.unpacked_size ||
  ------------------
  |  Branch (3164:6): [True: 0, False: 8.62k]
  ------------------
 3165|  8.62k|	    len > rar->file.unpacked_size - rar->cstate.write_ptr) {
  ------------------
  |  Branch (3165:6): [True: 0, False: 8.62k]
  ------------------
 3166|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3167|      0|		    "Uncompressed data exceeds declared size");
 3168|      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 (3168:10): [True: 0, False: 0]
  ------------------
 3169|      0|	}
 3170|       |
 3171|       |	/* The unpacker spends most of the time in this function. It would be
 3172|       |	 * a good idea to introduce some optimizations here.
 3173|       |	 *
 3174|       |	 * Just remember that this loop treats buffers that overlap differently
 3175|       |	 * than buffers that do not overlap. This is why a simple memcpy(3)
 3176|       |	 * call will not be enough. */
 3177|       |
 3178|  22.1M|	for(i = 0; i < len; i++) {
  ------------------
  |  Branch (3178:13): [True: 22.1M, False: 8.62k]
  ------------------
 3179|  22.1M|		const ssize_t write_idx = (write_ptr + i) & cmask;
 3180|  22.1M|		const ssize_t read_idx = (write_ptr + i - dist) & cmask;
 3181|  22.1M|		rar->cstate.window_buf[write_idx] =
 3182|  22.1M|		    rar->cstate.window_buf[read_idx];
 3183|  22.1M|	}
 3184|       |
 3185|  8.62k|	rar->cstate.write_ptr += len;
 3186|  8.62k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  8.62k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3187|  8.62k|}
archive_read_support_format_rar5.c:dist_cache_touch:
  839|    376|static int dist_cache_touch(struct rar5* rar, int idx) {
  840|    376|	int* q = rar->cstate.dist_cache;
  841|    376|	int i, dist = q[idx];
  842|       |
  843|  1.50k|	for(i = idx; i > 0; i--)
  ------------------
  |  Branch (843:15): [True: 1.12k, False: 376]
  ------------------
  844|  1.12k|		q[i] = q[i - 1];
  845|       |
  846|    376|	q[0] = dist;
  847|    376|	return dist;
  848|    376|}
archive_read_support_format_rar5.c:bf_is_last_block:
  513|    509|uint8_t bf_is_last_block(const struct compressed_block_header* hdr) {
  514|    509|	return (hdr->block_flags_u8 >> 6) & 1;
  515|    509|}
archive_read_support_format_rar5.c:apply_filters:
  778|  1.16k|static int apply_filters(struct archive_read* a) {
  779|  1.16k|	struct filter_info* flt;
  780|  1.16k|	struct rar5* rar = get_context(a);
  781|  1.16k|	int ret;
  782|       |
  783|  1.16k|	rar->cstate.all_filters_applied = 0;
  784|       |
  785|       |	/* Get the first filter that can be applied to our data. The data
  786|       |	 * needs to be fully unpacked before the filter can be run. */
  787|  1.16k|	if(CDE_OK == cdeque_front(&rar->cstate.filters,
  ------------------
  |  Branch (787:5): [True: 0, False: 1.16k]
  ------------------
  788|  1.16k|	    cdeque_filter_p(&flt))) {
  789|       |		/* Check if our unpacked data fully covers this filter's
  790|       |		 * range. */
  791|      0|		if(rar->cstate.write_ptr > flt->block_start &&
  ------------------
  |  Branch (791:6): [True: 0, False: 0]
  ------------------
  792|      0|		    rar->cstate.write_ptr >= flt->block_start +
  ------------------
  |  Branch (792:7): [True: 0, False: 0]
  ------------------
  793|      0|		    flt->block_length) {
  794|       |			/* Check if we have some data pending to be written
  795|       |			 * right before the filter's start offset. */
  796|      0|			if(rar->cstate.last_write_ptr == flt->block_start) {
  ------------------
  |  Branch (796:7): [True: 0, False: 0]
  ------------------
  797|       |				/* Run the filter specified by descriptor
  798|       |				 * `flt`. */
  799|      0|				ret = run_filter(a, flt);
  800|      0|				if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (800:8): [True: 0, False: 0]
  ------------------
  801|       |					/* Filter failure, return error. */
  802|      0|					return ret;
  803|      0|				}
  804|       |
  805|       |				/* Filter descriptor won't be needed anymore
  806|       |				 * after it's used, * so remove it from the
  807|       |				 * filter list and free its memory. */
  808|      0|				(void) cdeque_pop_front(&rar->cstate.filters,
  809|      0|				    cdeque_filter_p(&flt));
  810|       |
  811|      0|				free(flt);
  812|      0|			} else {
  813|       |				/* We can't run filters yet, dump the memory
  814|       |				 * right before the filter. */
  815|      0|				push_window_data(a, rar,
  816|      0|				    rar->cstate.last_write_ptr,
  817|      0|				    flt->block_start);
  818|      0|			}
  819|       |
  820|       |			/* Return 'filter applied or not needed' state to the
  821|       |			 * caller. */
  822|      0|			return ARCHIVE_RETRY;
  ------------------
  |  |  234|      0|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  823|      0|		}
  824|      0|	}
  825|       |
  826|  1.16k|	rar->cstate.all_filters_applied = 1;
  827|  1.16k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.16k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  828|  1.16k|}
archive_read_support_format_rar5.c:push_data_ready:
 3849|  1.32k|{
 3850|  1.32k|	int i;
 3851|       |
 3852|       |	/* Don't push if we're in skip mode. This is needed because solid
 3853|       |	 * streams need full processing even if we're skipping data. After
 3854|       |	 * fully processing the stream, we need to discard the generated bytes,
 3855|       |	 * because we're interested only in the side effect: building up the
 3856|       |	 * internal window circular buffer. This window buffer will be used
 3857|       |	 * later during unpacking of requested data. */
 3858|  1.32k|	if(rar->skip_mode)
  ------------------
  |  Branch (3858:5): [True: 78, False: 1.25k]
  ------------------
 3859|     78|		return ARCHIVE_OK;
  ------------------
  |  |  233|     78|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3860|       |
 3861|       |	/* Sanity check. */
 3862|  1.25k|	if(offset != rar->file.last_offset + rar->file.last_size) {
  ------------------
  |  Branch (3862:5): [True: 0, False: 1.25k]
  ------------------
 3863|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3864|      0|		    "Sanity check error: output stream is not continuous");
 3865|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3866|      0|	}
 3867|       |
 3868|  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 (3868:13): [True: 1.42k, False: 0]
  ------------------
 3869|  1.42k|		struct data_ready* d = &rar->cstate.dready[i];
 3870|  1.42k|		if(!d->used) {
  ------------------
  |  Branch (3870:6): [True: 1.25k, False: 169]
  ------------------
 3871|  1.25k|			d->used = 1;
 3872|  1.25k|			d->buf = buf;
 3873|  1.25k|			d->size = size;
 3874|  1.25k|			d->offset = offset;
 3875|       |
 3876|       |			/* These fields are used only in sanity checking. */
 3877|  1.25k|			rar->file.last_offset = offset;
 3878|  1.25k|			rar->file.last_size = size;
 3879|       |
 3880|       |			/* Calculate the checksum of this new block before
 3881|       |			 * submitting data to libarchive's engine. */
 3882|  1.25k|			update_crc(rar, d->buf, d->size);
 3883|       |
 3884|  1.25k|			return ARCHIVE_OK;
  ------------------
  |  |  233|  1.25k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3885|  1.25k|		}
 3886|  1.42k|	}
 3887|       |
 3888|       |	/* Program counter will reach this code if the `rar->cstate.data_ready`
 3889|       |	 * stack will be filled up so that no new entries will be allowed. The
 3890|       |	 * code shouldn't allow such situation to occur. So we treat this case
 3891|       |	 * as an internal error. */
 3892|       |
 3893|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3894|      0|	    "Premature end of data_ready stack");
 3895|      0|	return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3896|  1.25k|}
archive_read_support_format_rar5.c:cdeque_front:
  425|  1.16k|static int cdeque_front(struct cdeque* d, void** value) {
  426|  1.16k|	if(d->size > 0) {
  ------------------
  |  Branch (426:5): [True: 0, False: 1.16k]
  ------------------
  427|      0|		cdeque_front_fast(d, value);
  428|      0|		return CDE_OK;
  429|      0|	} else
  430|  1.16k|		return CDE_OUT_OF_BOUNDS;
  431|  1.16k|}
archive_read_support_format_rar5.c:push_window_data:
  774|  1.16k|{
  775|  1.16k|	push_data(a, rar, rar->cstate.window_buf, idx_begin, idx_end);
  776|  1.16k|}
archive_read_support_format_rar5.c:push_data:
  730|  1.16k|{
  731|  1.16k|	const ssize_t wmask = rar->cstate.window_mask;
  732|  1.16k|	const ssize_t solid_write_ptr = (rar->cstate.solid_offset +
  733|  1.16k|	    rar->cstate.last_write_ptr) & wmask;
  734|       |
  735|  1.16k|	idx_begin += rar->cstate.solid_offset;
  736|  1.16k|	idx_end += rar->cstate.solid_offset;
  737|       |
  738|       |	/* Check if our unpacked data is wrapped inside the window circular
  739|       |	 * buffer.  If it's not wrapped, it can be copied out by using
  740|       |	 * a single memcpy, but when it's wrapped, we need to copy the first
  741|       |	 * part with one memcpy, and the second part with another memcpy. */
  742|       |
  743|  1.16k|	if((idx_begin & wmask) > (idx_end & wmask)) {
  ------------------
  |  Branch (743:5): [True: 169, False: 991]
  ------------------
  744|       |		/* The data is wrapped (begin offset sis bigger than end
  745|       |		 * offset). */
  746|    169|		const ssize_t frag1_size = rar->cstate.window_size -
  747|    169|		    (idx_begin & wmask);
  748|    169|		const ssize_t frag2_size = idx_end & wmask;
  749|       |
  750|       |		/* Copy the first part of the buffer first. */
  751|    169|		push_data_ready(a, rar, buf + solid_write_ptr, frag1_size,
  752|    169|		    rar->cstate.last_write_ptr);
  753|       |
  754|       |		/* Copy the second part of the buffer. */
  755|    169|		push_data_ready(a, rar, buf, frag2_size,
  756|    169|		    rar->cstate.last_write_ptr + frag1_size);
  757|       |
  758|    169|		rar->cstate.last_write_ptr += frag1_size + frag2_size;
  759|    991|	} else {
  760|       |		/* Data is not wrapped, so we can just use one call to copy the
  761|       |		 * data. */
  762|    991|		push_data_ready(a, rar,
  763|    991|		    buf + solid_write_ptr, (idx_end - idx_begin) & wmask,
  764|    991|		    rar->cstate.last_write_ptr);
  765|       |
  766|    991|		rar->cstate.last_write_ptr += idx_end - idx_begin;
  767|    991|	}
  768|  1.16k|}
archive_read_support_format_rar5.c:verify_global_checksums:
 4261|      6|static int verify_global_checksums(struct archive_read* a) {
 4262|      6|	return verify_checksums(a);
 4263|      6|}
archive_read_support_format_rar5.c:verify_checksums:
 4163|      6|static int verify_checksums(struct archive_read* a) {
 4164|      6|	int verify_crc;
 4165|      6|	struct rar5* rar = get_context(a);
 4166|       |
 4167|       |	/* Check checksums only when actually unpacking the data. There's no
 4168|       |	 * need to calculate checksum when we're skipping data in solid archives
 4169|       |	 * (skipping in solid archives is the same thing as unpacking compressed
 4170|       |	 * data and discarding the result). */
 4171|       |
 4172|      6|	if(!rar->skip_mode) {
  ------------------
  |  Branch (4172:5): [True: 2, False: 4]
  ------------------
 4173|       |		/* Always check checksums if we're not in skip mode */
 4174|      2|		verify_crc = 1;
 4175|      4|	} else {
 4176|       |		/* We can override the logic above with a compile-time option
 4177|       |		 * NO_CRC_ON_SOLID_SKIP. This option is used during debugging,
 4178|       |		 * and it will check checksums of unpacked data even when
 4179|       |		 * we're skipping it. */
 4180|       |
 4181|       |#if defined CHECK_CRC_ON_SOLID_SKIP
 4182|       |		/* Debug case */
 4183|       |		verify_crc = 1;
 4184|       |#else
 4185|       |		/* Normal case */
 4186|      4|		verify_crc = 0;
 4187|      4|#endif
 4188|      4|	}
 4189|       |
 4190|      6|	if(verify_crc) {
  ------------------
  |  Branch (4190:5): [True: 2, False: 4]
  ------------------
 4191|       |		/* During unpacking, on each unpacked block we're calling the
 4192|       |		 * update_crc() function. Since we are here, the unpacking
 4193|       |		 * process is already over and we can check if calculated
 4194|       |		 * checksum (CRC32 or BLAKE2sp) is the same as what is stored
 4195|       |		 * in the archive. */
 4196|      2|		if(rar->file.stored_crc32 > 0) {
  ------------------
  |  Branch (4196:6): [True: 2, False: 0]
  ------------------
 4197|       |			/* Check CRC32 only when the file contains a CRC32
 4198|       |			 * value for this file. */
 4199|       |
 4200|      2|			if(rar->file.calculated_crc32 !=
  ------------------
  |  Branch (4200:7): [True: 2, False: 0]
  ------------------
 4201|      2|			    rar->file.stored_crc32) {
 4202|       |				/* Checksums do not match; the unpacked file
 4203|       |				 * is corrupted. */
 4204|       |
 4205|      2|				DEBUG_CODE {
  ------------------
  |  |   69|      2|#define DEBUG_CODE if(0)
  |  |  ------------------
  |  |  |  Branch (69:23): [Folded, False: 2]
  |  |  ------------------
  ------------------
 4206|      0|					printf("Checksum error: CRC32 "
 4207|      0|					    "(was: %08" PRIx32 ", expected: %08" PRIx32 ")\n",
 4208|      0|					    rar->file.calculated_crc32,
 4209|      0|					    rar->file.stored_crc32);
 4210|      0|				}
 4211|       |
 4212|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 4213|       |				archive_set_error(&a->archive,
 4214|       |				    ARCHIVE_ERRNO_FILE_FORMAT,
 4215|       |				    "Checksum error: CRC32");
 4216|       |				return ARCHIVE_FAILED;
 4217|       |#endif
 4218|      2|			} else {
 4219|      0|				DEBUG_CODE {
  ------------------
  |  |   69|      0|#define DEBUG_CODE if(0)
  |  |  ------------------
  |  |  |  Branch (69:23): [Folded, False: 0]
  |  |  ------------------
  ------------------
 4220|      0|					printf("Checksum OK: CRC32 "
 4221|      0|					    "(%08" PRIx32 "/%08" PRIx32 ")\n",
 4222|      0|					    rar->file.stored_crc32,
 4223|      0|					    rar->file.calculated_crc32);
 4224|      0|				}
 4225|      0|			}
 4226|      2|		}
 4227|       |
 4228|      2|		if(rar->file.has_blake2 > 0) {
  ------------------
  |  Branch (4228:6): [True: 2, False: 0]
  ------------------
 4229|       |			/* BLAKE2sp is an optional checksum algorithm that is
 4230|       |			 * added to RARv5 archives when using the `-htb` switch
 4231|       |			 *  during creation of archive.
 4232|       |			 *
 4233|       |			 * We now finalize the hash calculation by calling the
 4234|       |			 * `final` function. This will generate the final hash
 4235|       |			 * value we can use to compare it with the BLAKE2sp
 4236|       |			 * checksum that is stored in the archive.
 4237|       |			 *
 4238|       |			 * The return value of this `final` function is not
 4239|       |			 * very helpful, as it guards only against improper use.
 4240|       | 			 * This is why we're explicitly ignoring it. */
 4241|       |
 4242|      2|			uint8_t b2_buf[32];
 4243|      2|			(void) blake2sp_final(&rar->file.b2state, b2_buf, 32);
 4244|       |
 4245|      2|			if(memcmp(&rar->file.blake2sp, b2_buf, 32) != 0) {
  ------------------
  |  Branch (4245:7): [True: 2, False: 0]
  ------------------
 4246|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 4247|       |				archive_set_error(&a->archive,
 4248|       |				    ARCHIVE_ERRNO_FILE_FORMAT,
 4249|       |				    "Checksum error: BLAKE2");
 4250|       |
 4251|       |				return ARCHIVE_FAILED;
 4252|       |#endif
 4253|      2|			}
 4254|      2|		}
 4255|      2|	}
 4256|       |
 4257|       |	/* Finalization for this file has been successfully completed. */
 4258|      6|	return ARCHIVE_OK;
  ------------------
  |  |  233|      6|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4259|      6|}
archive_read_support_format_rar5.c:rar5_read_data_skip:
 4343|    436|static int rar5_read_data_skip(struct archive_read *a) {
 4344|    436|	struct rar5* rar = get_context(a);
 4345|       |
 4346|    436|	if(rar->main.solid && (rar->cstate.data_encrypted == 0)) {
  ------------------
  |  Branch (4346:5): [True: 338, False: 98]
  |  Branch (4346:24): [True: 207, False: 131]
  ------------------
 4347|       |		/* In solid archives, instead of skipping the data, we need to
 4348|       |		 * extract it, and dispose the result. The side effect of this
 4349|       |		 * operation will be setting up the initial window buffer state
 4350|       |		 * needed to be able to extract the selected file. Note that
 4351|       |		 * this is only possible when data withing this solid block is
 4352|       |		 * not encrypted, in which case we'll skip and fail if the user
 4353|       |		 * tries to read data. */
 4354|       |
 4355|    207|		int ret;
 4356|       |
 4357|       |		/* Make sure to process all blocks in the compressed stream. */
 4358|    290|		while(rar->file.bytes_remaining > 0) {
  ------------------
  |  Branch (4358:9): [True: 106, False: 184]
  ------------------
 4359|       |			/* Setting the "skip mode" will allow us to skip
 4360|       |			 * checksum checks during data skipping. Checking the
 4361|       |			 * checksum of skipped data isn't really necessary and
 4362|       |			 * it's only slowing things down.
 4363|       |			 *
 4364|       |			 * This is incremented instead of setting to 1 because
 4365|       |			 * this data skipping function can be called
 4366|       |			 * recursively. */
 4367|    106|			rar->skip_mode++;
 4368|       |
 4369|       |			/* We're disposing 1 block of data, so we use triple
 4370|       |			 * NULLs in arguments. */
 4371|    106|			ret = rar5_read_data(a, NULL, NULL, NULL);
 4372|       |
 4373|       |			/* Turn off "skip mode". */
 4374|    106|			rar->skip_mode--;
 4375|       |
 4376|    106|			if(ret < 0 || ret == ARCHIVE_EOF) {
  ------------------
  |  |  232|     88|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (4376:7): [True: 18, False: 88]
  |  Branch (4376:18): [True: 5, False: 83]
  ------------------
 4377|       |				/* Propagate any potential error conditions
 4378|       |				 * to the caller. */
 4379|     23|				return ret;
 4380|     23|			}
 4381|    106|		}
 4382|    229|	} else {
 4383|       |		/* In standard archives, we can just jump over the compressed
 4384|       |		 * stream. Each file in non-solid archives starts from an empty
 4385|       |		 * window buffer. */
 4386|       |
 4387|    229|		if(ARCHIVE_OK != consume(a, rar->file.bytes_remaining)) {
  ------------------
  |  |  233|    229|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4387:6): [True: 54, False: 175]
  ------------------
 4388|     54|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|     54|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4389|     54|		}
 4390|       |
 4391|    175|		rar->file.bytes_remaining = 0;
 4392|    175|	}
 4393|       |
 4394|    359|	return ARCHIVE_OK;
  ------------------
  |  |  233|    359|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4395|    436|}
archive_read_support_format_rar5.c:rar5_cleanup:
 4409|  2.49k|static int rar5_cleanup(struct archive_read *a) {
 4410|  2.49k|	struct rar5* rar = get_context(a);
 4411|       |
 4412|  2.49k|	free(rar->cstate.window_buf);
 4413|  2.49k|	free(rar->cstate.filtered_buf);
 4414|  2.49k|	clear_data_ready_stack(rar);
 4415|       |
 4416|  2.49k|	free(rar->vol.push_buf);
 4417|       |
 4418|  2.49k|	free_filters(rar);
 4419|  2.49k|	rar5_deinit(rar);
 4420|       |
 4421|  2.49k|	free(rar);
 4422|  2.49k|	a->format->data = NULL;
 4423|       |
 4424|  2.49k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4425|  2.49k|}
archive_read_support_format_rar5.c:rar5_capabilities:
 4427|    524|static int rar5_capabilities(struct archive_read * a) {
 4428|    524|	(void) a;
 4429|    524|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA
  ------------------
  |  |  398|    524|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
 4430|    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.) */
  ------------------
 4431|    524|}
archive_read_support_format_rar5.c:rar5_has_encrypted_entries:
 4433|    262|static int rar5_has_encrypted_entries(struct archive_read *_a) {
 4434|    262|	if (_a && _a->format) {
  ------------------
  |  Branch (4434:6): [True: 262, False: 0]
  |  Branch (4434:12): [True: 262, False: 0]
  ------------------
 4435|    262|		struct rar5 *rar = (struct rar5 *)_a->format->data;
 4436|    262|		if (rar) {
  ------------------
  |  Branch (4436:7): [True: 262, False: 0]
  ------------------
 4437|    262|			return rar->has_encrypted_entries;
 4438|    262|		}
 4439|    262|	}
 4440|       |
 4441|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4442|    262|}
archive_read_support_format_rar5.c:rar5_deinit:
 4461|  2.49k|static void rar5_deinit(struct rar5* rar) {
 4462|  2.49k|	cdeque_free(&rar->cstate.filters);
 4463|  2.49k|}
archive_read_support_format_rar5.c:cdeque_free:
  482|  2.49k|static void cdeque_free(struct cdeque* d) {
  483|  2.49k|	if(!d)
  ------------------
  |  Branch (483:5): [True: 0, False: 2.49k]
  ------------------
  484|      0|		return;
  485|       |
  486|  2.49k|	if(!d->arr)
  ------------------
  |  Branch (486:5): [True: 0, False: 2.49k]
  ------------------
  487|      0|		return;
  488|       |
  489|  2.49k|	free(d->arr);
  490|       |
  491|       |	d->arr = NULL;
  492|  2.49k|	d->beg_pos = -1;
  493|  2.49k|	d->end_pos = -1;
  494|  2.49k|	d->cap_mask = 0;
  495|  2.49k|}

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

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

archive_read_support_format_warc:
  144|  2.49k|{
  145|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
  146|  2.49k|	struct warc_s *w;
  147|  2.49k|	int r;
  148|       |
  149|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|  2.49k|	do { \
  |  |  178|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  2.49k|			(allowed_states), (function_name)); \
  |  |  180|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  181|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
  150|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_warc");
  151|       |
  152|  2.49k|	if ((w = calloc(1, sizeof(*w))) == NULL) {
  ------------------
  |  Branch (152:6): [True: 0, False: 2.49k]
  ------------------
  153|      0|		archive_set_error(&a->archive, ENOMEM,
  154|      0|		    "Can't allocate warc data");
  155|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  156|      0|	}
  157|       |
  158|  2.49k|	r = __archive_read_register_format(a,
  159|  2.49k|	    w,
  160|  2.49k|	    "warc",
  161|  2.49k|	    archive_read_format_warc_bid,
  162|  2.49k|	    NULL,
  163|  2.49k|	    archive_read_format_warc_read_header,
  164|  2.49k|	    archive_read_format_warc_read_data,
  165|  2.49k|	    archive_read_format_warc_skip,
  166|  2.49k|	    NULL,
  167|  2.49k|	    archive_read_format_warc_cleanup,
  168|  2.49k|	    NULL,
  169|  2.49k|	    NULL);
  170|       |
  171|  2.49k|	if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (171:6): [True: 0, False: 2.49k]
  ------------------
  172|      0|		free(w);
  173|      0|		return (r);
  174|      0|	}
  175|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  176|  2.49k|}
archive_read_support_format_warc.c:archive_read_format_warc_cleanup:
  180|  2.49k|{
  181|  2.49k|	struct warc_s *w = a->format->data;
  182|       |
  183|  2.49k|	if (w->pool.len > 0U) {
  ------------------
  |  Branch (183:6): [True: 138, False: 2.36k]
  ------------------
  184|    138|		free(w->pool.str);
  185|    138|	}
  186|  2.49k|	archive_string_free(&w->sver);
  187|  2.49k|	free(w);
  188|  2.49k|	a->format->data = NULL;
  189|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  190|  2.49k|}
archive_read_support_format_warc.c:archive_read_format_warc_bid:
  194|  2.45k|{
  195|  2.45k|	const char *hdr;
  196|  2.45k|	ssize_t nrd;
  197|  2.45k|	unsigned int ver;
  198|       |
  199|  2.45k|	(void)best_bid; /* UNUSED */
  200|       |
  201|       |	/* Check the first line, which should already be a record header. */
  202|  2.45k|	if ((hdr = __archive_read_ahead(a, 12, &nrd)) == NULL) {
  ------------------
  |  Branch (202:6): [True: 24, False: 2.43k]
  ------------------
  203|       |		/* Not enough data to identify this format. */
  204|     24|		return -1;
  205|     24|	}
  206|       |
  207|       |	/* Parse the record version number. */
  208|  2.43k|	ver = warc_read_version(hdr, nrd);
  209|  2.43k|	if (ver < 1200U || ver > 10000U) {
  ------------------
  |  Branch (209:6): [True: 2.23k, False: 199]
  |  Branch (209:21): [True: 0, False: 199]
  ------------------
  210|       |		/* Only WARC 0.12 through WARC 1.0 are supported. */
  211|  2.23k|		return -1;
  212|  2.23k|	}
  213|       |
  214|       |	/* WARC magic and version checks passed. */
  215|    199|	return (64);
  216|  2.43k|}
archive_read_support_format_warc.c:warc_read_version:
  626|  17.5k|{
  627|  17.5k|	static const char magic[] = "WARC/";
  628|  17.5k|	const char *c;
  629|  17.5k|	unsigned int ver = 0U;
  630|  17.5k|	unsigned int end = 0U;
  631|       |
  632|  17.5k|	if (bsz < 12 || memcmp(buf, magic, sizeof(magic) - 1U) != 0) {
  ------------------
  |  Branch (632:6): [True: 0, False: 17.5k]
  |  Branch (632:18): [True: 2.24k, False: 15.3k]
  ------------------
  633|       |		/* Buffer too small or invalid magic. */
  634|  2.24k|		return ver;
  635|  2.24k|	}
  636|       |	/* Parse the version number. */
  637|  15.3k|	buf += sizeof(magic) - 1U;
  638|       |
  639|  15.3k|	if (isdigit((unsigned char)buf[0U]) && (buf[1U] == '.') &&
  ------------------
  |  Branch (639:6): [True: 15.3k, False: 1]
  |  Branch (639:41): [True: 15.3k, False: 6]
  ------------------
  640|  15.3k|	    isdigit((unsigned char)buf[2U])) {
  ------------------
  |  Branch (640:6): [True: 15.3k, False: 0]
  ------------------
  641|       |		/* Support at most two digits in the minor version. */
  642|  15.3k|		if (isdigit((unsigned char)buf[3U]))
  ------------------
  |  Branch (642:7): [True: 479, False: 14.8k]
  ------------------
  643|    479|			end = 1U;
  644|       |		/* Set up the major version. */
  645|  15.3k|		ver = (buf[0U] - '0') * 10000U;
  646|       |		/* Set up the minor version. */
  647|  15.3k|		if (end == 1U) {
  ------------------
  |  Branch (647:7): [True: 479, False: 14.8k]
  ------------------
  648|    479|			ver += (buf[2U] - '0') * 1000U;
  649|    479|			ver += (buf[3U] - '0') * 100U;
  650|    479|		} else
  651|  14.8k|			ver += (buf[2U] - '0') * 100U;
  652|       |		/*
  653|       |		 * WARC versions before 0.12 use a space-separated header.
  654|       |		 * WARC 0.12 and later terminate the version with CRLF.
  655|       |		 */
  656|  15.3k|		c = buf + 3U + end;
  657|  15.3k|		if (ver >= 1200U) {
  ------------------
  |  Branch (657:7): [True: 15.3k, False: 0]
  ------------------
  658|  15.3k|			if (memcmp(c, "\r\n", 2U) != 0)
  ------------------
  |  Branch (658:8): [True: 8, False: 15.3k]
  ------------------
  659|      8|				ver = 0U;
  660|  15.3k|		} else {
  661|       |			/* Version is below WARC 0.12. */
  662|      0|			if (*c != ' ' && *c != '\t')
  ------------------
  |  Branch (662:8): [True: 0, False: 0]
  |  Branch (662:21): [True: 0, False: 0]
  ------------------
  663|      0|				ver = 0U;
  664|      0|		}
  665|  15.3k|	}
  666|  15.3k|	return ver;
  667|  17.5k|}
archive_read_support_format_warc.c:archive_read_format_warc_read_header:
  221|  7.89k|{
  222|  7.89k|#define HDR_PROBE_LEN		(12U)
  223|  7.89k|	struct warc_s *w = a->format->data;
  224|  7.89k|	unsigned int ver;
  225|  7.89k|	const char *buf;
  226|  7.89k|	ssize_t nrd;
  227|  7.89k|	const char *eoh;
  228|  7.89k|	char *tmp;
  229|       |	/* Reuse the header buffer while parsing the file name. */
  230|  7.89k|	warc_string_t fnam;
  231|       |	/* WARC record type */
  232|  7.89k|	warc_type_t ftyp;
  233|       |	/* Content length, or a negative error indicator */
  234|  7.89k|	int64_t cntlen;
  235|       |	/* WARC-Date is exposed as the entry ctime. */
  236|  7.89k|	time_t rtime;
  237|       |	/* A Last-Modified record header is exposed as the entry mtime. */
  238|  7.89k|	time_t mtime;
  239|       |
  240|  15.2k|start_over:
  241|       |	/* Use read_ahead(); it already tracks unconsumed bytes, so this
  242|       |	 * reader does not need a separate shift buffer. */
  243|  15.2k|	buf = __archive_read_ahead(a, HDR_PROBE_LEN, &nrd);
  ------------------
  |  |  222|  15.2k|#define HDR_PROBE_LEN		(12U)
  ------------------
  244|       |
  245|  15.2k|	if (nrd < 0) {
  ------------------
  |  Branch (245:6): [True: 0, False: 15.2k]
  ------------------
  246|       |		/* I/O or stream error. */
  247|      0|		archive_set_error(
  248|      0|			&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  249|      0|			"Bad record header");
  250|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  251|  15.2k|	} else if (buf == NULL) {
  ------------------
  |  Branch (251:13): [True: 2, False: 15.2k]
  ------------------
  252|       |		/* there should be room for at least WARC/bla\r\n
  253|       |		 * must be EOF therefore */
  254|      2|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  255|      2|	}
  256|       |	/* Locate the end of the record header. */
  257|  15.2k|	eoh = warc_find_eoh(buf, nrd);
  258|  15.2k|	if (eoh == NULL) {
  ------------------
  |  Branch (258:6): [True: 98, False: 15.1k]
  ------------------
  259|       |		/* The header terminator was not found in the probed data. */
  260|     98|		archive_set_error(
  261|     98|			&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     98|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  262|     98|			"Bad record header");
  263|     98|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     98|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  264|     98|	}
  265|  15.1k|	ver = warc_read_version(buf, eoh - buf);
  266|       |	/* Only WARC 0.12 through WARC 1.0 are supported. */
  267|  15.1k|	if (ver == 0U) {
  ------------------
  |  Branch (267:6): [True: 24, False: 15.1k]
  ------------------
  268|     24|		archive_set_error(
  269|     24|			&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     24|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  270|     24|			"Invalid record version");
  271|     24|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     24|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  272|  15.1k|	} else if (ver < 1200U || ver > 10000U) {
  ------------------
  |  Branch (272:13): [True: 0, False: 15.1k]
  |  Branch (272:28): [True: 0, False: 15.1k]
  ------------------
  273|      0|		archive_set_error(
  274|      0|			&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  275|      0|			"Unsupported record version: %u.%u",
  276|      0|			ver / 10000, (ver % 10000) / 100);
  277|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  278|      0|	}
  279|  15.1k|	cntlen = warc_read_length(buf, eoh - buf);
  280|  15.1k|	if (cntlen < 0) {
  ------------------
  |  Branch (280:6): [True: 18, False: 15.0k]
  ------------------
  281|       |		/* This reader requires Content-Length before processing a record. */
  282|     18|		archive_set_error(
  283|     18|			&a->archive, EINVAL,
  284|     18|			"Bad content length");
  285|     18|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     18|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  286|     18|	}
  287|  15.0k|	rtime = warc_read_date(buf, eoh - buf);
  288|  15.0k|	if (rtime == (time_t)-1) {
  ------------------
  |  Branch (288:6): [True: 51, False: 15.0k]
  ------------------
  289|       |		/* This reader requires WARC-Date before processing a record. */
  290|     51|		archive_set_error(
  291|     51|			&a->archive, EINVAL,
  292|     51|			"Bad record time");
  293|     51|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     51|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  294|     51|	}
  295|       |
  296|       |	/* Report this archive as WARC. */
  297|  15.0k|	a->archive.archive_format = ARCHIVE_FORMAT_WARC;
  ------------------
  |  |  386|  15.0k|#define	ARCHIVE_FORMAT_WARC			0xF0000
  ------------------
  298|  15.0k|	if (ver != w->pver) {
  ------------------
  |  Branch (298:6): [True: 1.13k, False: 13.9k]
  ------------------
  299|       |		/* Format this entry's WARC version. */
  300|  1.13k|		archive_string_sprintf(&w->sver,
  301|  1.13k|			"WARC/%u.%u", ver / 10000, (ver % 10000) / 100);
  302|       |		/* Remember the version for later entries. */
  303|  1.13k|		w->pver = ver;
  304|  1.13k|	}
  305|       |	/* Parse the record type. */
  306|  15.0k|	ftyp = warc_read_type(buf, eoh - buf);
  307|       |	/* Save content state for subsequent read calls. */
  308|  15.0k|	w->cntlen = cntlen;
  309|  15.0k|	w->cntoff = 0;
  310|  15.0k|	mtime = 0;/* Avoid compiler warnings on some platforms. */
  311|       |
  312|  15.0k|	switch (ftyp) {
  313|  1.25k|	case WT_RSRC:
  ------------------
  |  Branch (313:2): [True: 1.25k, False: 13.7k]
  ------------------
  314|  10.9k|	case WT_RSP:
  ------------------
  |  Branch (314:2): [True: 9.70k, False: 5.34k]
  ------------------
  315|       |		/* Read the filename only for record types that are expected to
  316|       |		 * have a target URI. */
  317|  10.9k|		fnam = warc_read_uri(buf, eoh - buf);
  318|       |		/* Avoid creating directory endpoints as files. */
  319|  10.9k|		if (fnam.len == 0 || fnam.str[fnam.len - 1] == '/') {
  ------------------
  |  Branch (319:7): [True: 3.18k, False: 7.77k]
  |  Branch (319:24): [True: 69, False: 7.70k]
  ------------------
  320|       |			/* Skip this record. */
  321|  3.25k|			fnam.len = 0U;
  322|  3.25k|			fnam.str = NULL;
  323|  3.25k|			break;
  324|  3.25k|		}
  325|       |		/* Copy the name into the reusable string pool to avoid a malloc/free
  326|       |		 * roundtrip for each entry. */
  327|  7.70k|		if (fnam.len + 1U > w->pool.len) {
  ------------------
  |  Branch (327:7): [True: 143, False: 7.56k]
  ------------------
  328|    143|			w->pool.len = ((fnam.len + 64U) / 64U) * 64U;
  329|    143|			tmp = realloc(w->pool.str, w->pool.len);
  330|    143|			if (tmp == NULL) {
  ------------------
  |  Branch (330:8): [True: 0, False: 143]
  ------------------
  331|      0|				archive_set_error(
  332|      0|					&a->archive, ENOMEM,
  333|      0|					"Out of memory");
  334|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  335|      0|			}
  336|    143|			w->pool.str = tmp;
  337|    143|		}
  338|  7.70k|		memcpy(w->pool.str, fnam.str, fnam.len);
  339|  7.70k|		w->pool.str[fnam.len] = '\0';
  340|       |		/* Hide the pool implementation behind the parsed string. */
  341|  7.70k|		fnam.str = w->pool.str;
  342|       |
  343|       |		/* Use a Last-Modified record header when present; otherwise fall back
  344|       |		 * to WARC-Date. */
  345|  7.70k|		if ((mtime = warc_read_last_modified(buf, eoh - buf)) == (time_t)-1) {
  ------------------
  |  Branch (345:7): [True: 7.64k, False: 63]
  ------------------
  346|  7.64k|			mtime = rtime;
  347|  7.64k|		}
  348|  7.70k|		break;
  349|  4.09k|	case WT_NONE:
  ------------------
  |  Branch (349:2): [True: 4.09k, False: 10.9k]
  ------------------
  350|  4.09k|	case WT_INFO:
  ------------------
  |  Branch (350:2): [True: 0, False: 15.0k]
  ------------------
  351|  4.09k|	case WT_META:
  ------------------
  |  Branch (351:2): [True: 0, False: 15.0k]
  ------------------
  352|  4.09k|	case WT_REQ:
  ------------------
  |  Branch (352:2): [True: 0, False: 15.0k]
  ------------------
  353|  4.09k|	case WT_RVIS:
  ------------------
  |  Branch (353:2): [True: 0, False: 15.0k]
  ------------------
  354|  4.09k|	case WT_CONV:
  ------------------
  |  Branch (354:2): [True: 0, False: 15.0k]
  ------------------
  355|  4.09k|	case WT_CONT:
  ------------------
  |  Branch (355:2): [True: 0, False: 15.0k]
  ------------------
  356|  4.09k|	case LAST_WT:
  ------------------
  |  Branch (356:2): [True: 0, False: 15.0k]
  ------------------
  357|  4.09k|	default:
  ------------------
  |  Branch (357:2): [True: 0, False: 15.0k]
  ------------------
  358|  4.09k|		fnam.len = 0U;
  359|  4.09k|		fnam.str = NULL;
  360|  4.09k|		break;
  361|  15.0k|	}
  362|       |
  363|       |	/* Consume the record header. */
  364|  15.0k|	__archive_read_consume(a, eoh - buf);
  365|       |
  366|  15.0k|	switch (ftyp) {
  367|  1.25k|	case WT_RSRC:
  ------------------
  |  Branch (367:2): [True: 1.25k, False: 13.7k]
  ------------------
  368|  10.9k|	case WT_RSP:
  ------------------
  |  Branch (368:2): [True: 9.70k, False: 5.34k]
  ------------------
  369|  10.9k|		if (fnam.len > 0U) {
  ------------------
  |  Branch (369:7): [True: 7.70k, False: 3.25k]
  ------------------
  370|       |			/* Populate the entry object. */
  371|  7.70k|			archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  7.70k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  372|  7.70k|			archive_entry_copy_pathname(entry, fnam.str);
  373|  7.70k|			archive_entry_set_size(entry, cntlen);
  374|  7.70k|			archive_entry_set_perm(entry, 0644);
  375|       |			/* WARC-Date becomes ctime; mtime comes from Last-Modified or WARC-Date. */
  376|  7.70k|			archive_entry_set_ctime(entry, rtime, 0L);
  377|  7.70k|			archive_entry_set_mtime(entry, mtime, 0L);
  378|  7.70k|			break;
  379|  7.70k|		}
  380|       |		/* FALLTHROUGH */
  381|  7.34k|	case WT_NONE:
  ------------------
  |  Branch (381:2): [True: 4.09k, False: 10.9k]
  ------------------
  382|  7.34k|	case WT_INFO:
  ------------------
  |  Branch (382:2): [True: 0, False: 15.0k]
  ------------------
  383|  7.34k|	case WT_META:
  ------------------
  |  Branch (383:2): [True: 0, False: 15.0k]
  ------------------
  384|  7.34k|	case WT_REQ:
  ------------------
  |  Branch (384:2): [True: 0, False: 15.0k]
  ------------------
  385|  7.34k|	case WT_RVIS:
  ------------------
  |  Branch (385:2): [True: 0, False: 15.0k]
  ------------------
  386|  7.34k|	case WT_CONV:
  ------------------
  |  Branch (386:2): [True: 0, False: 15.0k]
  ------------------
  387|  7.34k|	case WT_CONT:
  ------------------
  |  Branch (387:2): [True: 0, False: 15.0k]
  ------------------
  388|  7.34k|	case LAST_WT:
  ------------------
  |  Branch (388:2): [True: 0, False: 15.0k]
  ------------------
  389|  7.34k|	default:
  ------------------
  |  Branch (389:2): [True: 0, False: 15.0k]
  ------------------
  390|       |		/* Skip this record body and look for the next one. */
  391|  7.34k|		if (archive_read_format_warc_skip(a) < 0)
  ------------------
  |  Branch (391:7): [True: 0, False: 7.34k]
  ------------------
  392|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  393|  7.34k|		goto start_over;
  394|  15.0k|	}
  395|  7.70k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  7.70k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  396|  15.0k|}
archive_read_support_format_warc.c:warc_find_eoh:
  852|  15.2k|{
  853|  15.2k|	static const char _marker[] = "\r\n\r\n";
  854|  15.2k|	const char *hit = xmemmem(buf, bsz, _marker, sizeof(_marker) - 1U);
  855|       |
  856|  15.2k|	if (hit != NULL) {
  ------------------
  |  Branch (856:6): [True: 15.1k, False: 98]
  ------------------
  857|  15.1k|		hit += sizeof(_marker) - 1U;
  858|  15.1k|	}
  859|  15.2k|	return hit;
  860|  15.2k|}
archive_read_support_format_warc.c:xmemmem:
  470|   148k|{
  471|   148k|	const char *const eoh = hay + haysize;
  472|   148k|	const char *const eon = needle + needlesize;
  473|   148k|	const char *hp;
  474|   148k|	const char *np;
  475|   148k|	const char *cand;
  476|   148k|	unsigned int hsum;
  477|   148k|	unsigned int nsum;
  478|   148k|	unsigned int eqp;
  479|       |
  480|       |	/* Handle trivial cases first.  A zero-sized needle is defined to be
  481|       |	 * found anywhere in the haystack; otherwise find the first candidate
  482|       |	 * that begins with *NEEDLE. */
  483|   148k|	if (needlesize == 0UL) {
  ------------------
  |  Branch (483:6): [True: 0, False: 148k]
  ------------------
  484|      0|		return deconst(hay);
  485|   148k|	} else if ((hay = memchr(hay, *needle, haysize)) == NULL) {
  ------------------
  |  Branch (485:13): [True: 131, False: 148k]
  ------------------
  486|       |		/* No candidate match remains. */
  487|    131|		return NULL;
  488|    131|	}
  489|       |
  490|       |	/* The first characters of haystack and needle already match, and both
  491|       |	 * strings are at least one character long.  Compute the rolling XOR
  492|       |	 * values for the needle and the first NEEDLESIZE characters of haystack. */
  493|   148k|	for (hp = hay + 1U, np = needle + 1U, hsum = *hay, nsum = *hay, eqp = 1U;
  494|  1.14M|	     hp < eoh && np < eon;
  ------------------
  |  Branch (494:7): [True: 1.14M, False: 277]
  |  Branch (494:19): [True: 1.00M, False: 148k]
  ------------------
  495|  1.00M|	     hsum ^= *hp, nsum ^= *np, eqp &= *hp == *np, hp++, np++);
  496|       |
  497|       |	/* HP now references the (NEEDLESIZE + 1)-th character. */
  498|   148k|	if (np < eon) {
  ------------------
  |  Branch (498:6): [True: 206, False: 148k]
  ------------------
  499|       |		/* The haystack is smaller than the needle. */
  500|    206|		return NULL;
  501|   148k|	} else if (eqp) {
  ------------------
  |  Branch (501:13): [True: 75.1k, False: 73.2k]
  ------------------
  502|       |		/* Found a match. */
  503|  75.1k|		return deconst(hay);
  504|  75.1k|	}
  505|       |
  506|       |	/* Loop through the rest of the haystack and update the rolling XOR
  507|       |	 * iteratively. */
  508|  21.4M|	for (cand = hay; hp < eoh; hp++) {
  ------------------
  |  Branch (508:19): [True: 21.4M, False: 5.36k]
  ------------------
  509|  21.4M|		hsum ^= *cand++;
  510|  21.4M|		hsum ^= *hp;
  511|       |
  512|       |		/* When the rolling XOR values match, it is enough to check
  513|       |		 * NEEDLESIZE - 1 characters for equality.  CAND is always before
  514|       |		 * HP by design, so no range check is needed. */
  515|  21.4M|		if (hsum == nsum && memcmp(cand, needle, needlesize - 1U) == 0) {
  ------------------
  |  Branch (515:7): [True: 1.53M, False: 19.9M]
  |  Branch (515:23): [True: 67.9k, False: 1.46M]
  ------------------
  516|  67.9k|			return deconst(cand);
  517|  67.9k|		}
  518|  21.4M|	}
  519|  5.36k|	return NULL;
  520|  73.2k|}
archive_read_support_format_warc.c:deconst:
  463|   164k|{
  464|   164k|	return (void *)(uintptr_t)c;
  465|   164k|}
archive_read_support_format_warc.c:warc_read_length:
  757|  15.1k|{
  758|  15.1k|	static const char _key[] = "\r\nContent-Length:";
  759|  15.1k|	const char *val, *eol, *p;
  760|  15.1k|	int64_t len;
  761|       |
  762|  15.1k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (762:6): [True: 14, False: 15.1k]
  ------------------
  763|       |		/* Header field is absent. */
  764|     14|		return -1;
  765|     14|	}
  766|  15.1k|	val += sizeof(_key) - 1U;
  767|       |
  768|  15.1k|	if ((eol = warc_find_eol(val, buf + bsz - val)) == NULL) {
  ------------------
  |  Branch (768:6): [True: 0, False: 15.1k]
  ------------------
  769|       |		/* Malformed field with no end of line. */
  770|      0|		return -1;
  771|      0|	}
  772|       |
  773|       |	/* Skip leading whitespace. */
  774|  17.5k|	while (val < eol && (*val == ' ' || *val == '\t'))
  ------------------
  |  Branch (774:9): [True: 17.5k, False: 0]
  |  Branch (774:23): [True: 2.41k, False: 15.1k]
  |  Branch (774:38): [True: 0, False: 15.1k]
  ------------------
  775|  2.41k|		val++;
  776|       |
  777|       |	/* Require at least one digit. */
  778|  15.1k|	if (val >= eol || *val < '0' || *val > '9')
  ------------------
  |  Branch (778:6): [True: 0, False: 15.1k]
  |  Branch (778:20): [True: 0, False: 15.1k]
  |  Branch (778:34): [True: 0, False: 15.1k]
  ------------------
  779|      0|		return -1;
  780|       |
  781|  15.1k|	len = 0;
  782|  42.8k|	for (p = val; p < eol; p++) {
  ------------------
  |  Branch (782:16): [True: 27.7k, False: 15.0k]
  ------------------
  783|  27.7k|		int64_t digit;
  784|       |
  785|  27.7k|		if (*p < '0' || *p > '9')
  ------------------
  |  Branch (785:7): [True: 2, False: 27.7k]
  |  Branch (785:19): [True: 2, False: 27.7k]
  ------------------
  786|      4|			return -1;
  787|  27.7k|		digit = *p - '0';
  788|  27.7k|		if (archive_ckd_mul_i64(&len, len, 10) ||
  ------------------
  |  Branch (788:7): [True: 0, False: 27.7k]
  ------------------
  789|  27.7k|		    archive_ckd_add_i64(&len, len, digit))
  ------------------
  |  Branch (789:7): [True: 0, False: 27.7k]
  ------------------
  790|      0|			return -1;
  791|  27.7k|	}
  792|       |
  793|  15.0k|	return len;
  794|  15.1k|}
archive_read_support_format_warc.c:warc_find_eol:
  864|  59.2k|{
  865|  59.2k|	static const char _marker[] = "\r\n";
  866|  59.2k|	const char *hit = xmemmem(buf, bsz, _marker, sizeof(_marker) - 1U);
  867|       |
  868|  59.2k|	return hit;
  869|  59.2k|}
archive_read_support_format_warc.c:warc_read_date:
  798|  15.0k|{
  799|  15.0k|	static const char _key[] = "\r\nWARC-Date:";
  800|  15.0k|	const char *val, *eol;
  801|  15.0k|	char *on = NULL;
  802|  15.0k|	time_t res;
  803|       |
  804|  15.0k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (804:6): [True: 18, False: 15.0k]
  ------------------
  805|       |		/* Header field is absent. */
  806|     18|		return (time_t)-1;
  807|     18|	}
  808|  15.0k|	val += sizeof(_key) - 1U;
  809|  15.0k|	if ((eol = warc_find_eol(val, buf + bsz - val)) == NULL ) {
  ------------------
  |  Branch (809:6): [True: 0, False: 15.0k]
  ------------------
  810|       |		/* Header field has no end of line. */
  811|      0|		return -1;
  812|      0|	}
  813|       |
  814|       |	/* xstrpisotime() skips leading whitespace. */
  815|  15.0k|	res = xstrpisotime(val, &on);
  816|  15.0k|	if (on != eol) {
  ------------------
  |  Branch (816:6): [True: 33, False: 15.0k]
  ------------------
  817|       |		/* The field must end here. */
  818|     33|		return -1;
  819|     33|	}
  820|  15.0k|	return res;
  821|  15.0k|}
archive_read_support_format_warc.c:xstrpisotime:
  572|  21.2k|{
  573|       |/* Like strptime(), but only for ISO 8601 Zulu strings. */
  574|  21.2k|	struct tm tm;
  575|  21.2k|	time_t res = (time_t)-1;
  576|       |
  577|       |	/* Clear the tm structure. */
  578|  21.2k|	memset(&tm, 0, sizeof(tm));
  579|       |
  580|       |	/* This is a non-standard routine, so skip leading whitespace for
  581|       |	 * caller convenience. */
  582|  42.5k|	while (*s == ' ' || *s == '\t')
  ------------------
  |  Branch (582:9): [True: 118, False: 42.4k]
  |  Branch (582:22): [True: 21.1k, False: 21.2k]
  ------------------
  583|  21.2k|		++s;
  584|       |
  585|       |	/* Read the year. */
  586|  21.2k|	if ((tm.tm_year = strtoi_lim(s, &s, 1583, 4095)) < 0 || *s++ != '-') {
  ------------------
  |  Branch (586:6): [True: 347, False: 20.9k]
  |  Branch (586:58): [True: 248, False: 20.6k]
  ------------------
  587|    595|		goto out;
  588|    595|	}
  589|       |	/* Read the month. */
  590|  20.6k|	if ((tm.tm_mon = strtoi_lim(s, &s, 1, 12)) < 0 || *s++ != '-') {
  ------------------
  |  Branch (590:6): [True: 885, False: 19.7k]
  |  Branch (590:52): [True: 113, False: 19.6k]
  ------------------
  591|    998|		goto out;
  592|    998|	}
  593|       |	/* Read the day of the month. */
  594|  19.6k|	if ((tm.tm_mday = strtoi_lim(s, &s, 1, 31)) < 0 || *s++ != 'T') {
  ------------------
  |  Branch (594:6): [True: 1.13k, False: 18.5k]
  |  Branch (594:53): [True: 1.06k, False: 17.4k]
  ------------------
  595|  2.19k|		goto out;
  596|  2.19k|	}
  597|       |	/* Read the hour. */
  598|  17.4k|	if ((tm.tm_hour = strtoi_lim(s, &s, 0, 23)) < 0 || *s++ != ':') {
  ------------------
  |  Branch (598:6): [True: 933, False: 16.5k]
  |  Branch (598:53): [True: 530, False: 16.0k]
  ------------------
  599|  1.46k|		goto out;
  600|  1.46k|	}
  601|       |	/* Read the minute. */
  602|  16.0k|	if ((tm.tm_min = strtoi_lim(s, &s, 0, 59)) < 0 || *s++ != ':') {
  ------------------
  |  Branch (602:6): [True: 475, False: 15.5k]
  |  Branch (602:52): [True: 81, False: 15.4k]
  ------------------
  603|    556|		goto out;
  604|    556|	}
  605|       |	/* Read the second. */
  606|  15.4k|	if ((tm.tm_sec = strtoi_lim(s, &s, 0, 60)) < 0 || *s++ != 'Z') {
  ------------------
  |  Branch (606:6): [True: 307, False: 15.1k]
  |  Branch (606:52): [True: 31, False: 15.1k]
  ------------------
  607|    338|		goto out;
  608|    338|	}
  609|       |
  610|       |	/* Adjust tm fields to satisfy POSIX constraints. */
  611|  15.1k|	tm.tm_year -= 1900;
  612|  15.1k|	tm.tm_mon--;
  613|       |
  614|       |	/* Convert the tm structure to a Unix timestamp in UTC. */
  615|  15.1k|	res = time_from_tm(&tm);
  616|       |
  617|  21.2k|out:
  618|  21.2k|	if (endptr != NULL) {
  ------------------
  |  Branch (618:6): [True: 21.2k, False: 0]
  ------------------
  619|  21.2k|		*endptr = deconst(s);
  620|  21.2k|	}
  621|  21.2k|	return res;
  622|  15.1k|}
archive_read_support_format_warc.c:strtoi_lim:
  524|   110k|{
  525|   110k|	int res = 0;
  526|   110k|	const char *sp;
  527|       |	/* Track the number of digits with rulim. */
  528|   110k|	int rulim;
  529|       |
  530|   110k|	for (sp = str, rulim = ulim > 10 ? ulim : 10;
  ------------------
  |  Branch (530:25): [True: 110k, False: 0]
  ------------------
  531|   296k|	     res * 10 <= ulim && rulim && *sp >= '0' && *sp <= '9';
  ------------------
  |  Branch (531:7): [True: 225k, False: 70.8k]
  |  Branch (531:27): [True: 225k, False: 790]
  |  Branch (531:36): [True: 222k, False: 3.05k]
  |  Branch (531:50): [True: 186k, False: 35.8k]
  ------------------
  532|   186k|	     sp++, rulim /= 10) {
  533|   186k|		res *= 10;
  534|   186k|		res += *sp - '0';
  535|   186k|	}
  536|   110k|	if (sp == str) {
  ------------------
  |  Branch (536:6): [True: 3.28k, False: 107k]
  ------------------
  537|  3.28k|		res = -1;
  538|   107k|	} else if (res < llim || res > ulim) {
  ------------------
  |  Branch (538:13): [True: 360, False: 106k]
  |  Branch (538:27): [True: 430, False: 106k]
  ------------------
  539|    790|		res = -2;
  540|    790|	}
  541|   110k|	*ep = (const char*)sp;
  542|   110k|	return res;
  543|   110k|}
archive_read_support_format_warc.c:time_from_tm:
  547|  15.1k|{
  548|       |#if HAVE__MKGMTIME
  549|       |        return _mkgmtime(t);
  550|       |#elif HAVE_TIMEGM
  551|       |        /* Use platform timegm() if available. */
  552|  15.1k|        return (timegm(t));
  553|       |#else
  554|       |        /* Otherwise, calculate directly using POSIX assumptions. */
  555|       |        /* First, fix up tm_yday based on the year, month, and day. */
  556|       |        if (mktime(t) == (time_t)-1)
  557|       |                return ((time_t)-1);
  558|       |        /* Then compute timegm() from first principles. */
  559|       |        return (t->tm_sec
  560|       |            + t->tm_min * 60
  561|       |            + t->tm_hour * 3600
  562|       |            + t->tm_yday * 86400
  563|       |            + (t->tm_year - 70) * 31536000
  564|       |            + ((t->tm_year - 69) / 4) * 86400
  565|       |            - ((t->tm_year - 1) / 100) * 86400
  566|       |            + ((t->tm_year + 299) / 400) * 86400);
  567|       |#endif
  568|  15.1k|}
archive_read_support_format_warc.c:warc_read_type:
  671|  15.0k|{
  672|  15.0k|	static const char _key[] = "\r\nWARC-Type:";
  673|  15.0k|	const char *val, *eol;
  674|       |
  675|  15.0k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (675:6): [True: 2.59k, False: 12.4k]
  ------------------
  676|       |		/* Header field is absent. */
  677|  2.59k|		return WT_NONE;
  678|  2.59k|	}
  679|  12.4k|	val += sizeof(_key) - 1U;
  680|  12.4k|	if ((eol = warc_find_eol(val, buf + bsz - val)) == NULL) {
  ------------------
  |  Branch (680:6): [True: 0, False: 12.4k]
  ------------------
  681|       |		/* Header field has no end of line. */
  682|      0|		return WT_NONE;
  683|      0|	}
  684|       |
  685|       |	/* Skip leading whitespace. */
  686|  26.4k|	while (val < eol && (*val == ' ' || *val == '\t'))
  ------------------
  |  Branch (686:9): [True: 26.3k, False: 82]
  |  Branch (686:23): [True: 12.3k, False: 13.9k]
  |  Branch (686:38): [True: 1.61k, False: 12.3k]
  ------------------
  687|  13.9k|		++val;
  688|       |
  689|  12.4k|	if (val + 8U == eol) {
  ------------------
  |  Branch (689:6): [True: 11.5k, False: 884]
  ------------------
  690|  11.5k|		if (memcmp(val, "resource", 8U) == 0)
  ------------------
  |  Branch (690:7): [True: 1.25k, False: 10.3k]
  ------------------
  691|  1.25k|			return WT_RSRC;
  692|  10.3k|		else if (memcmp(val, "response", 8U) == 0)
  ------------------
  |  Branch (692:12): [True: 9.70k, False: 615]
  ------------------
  693|  9.70k|			return WT_RSP;
  694|  11.5k|	}
  695|  1.49k|	return WT_NONE;
  696|  12.4k|}
archive_read_support_format_warc.c:warc_read_uri:
  700|  10.9k|{
  701|  10.9k|	static const char _key[] = "\r\nWARC-Target-URI:";
  702|  10.9k|	const char *val, *uri, *eol, *p;
  703|  10.9k|	warc_string_t res = {0U, NULL};
  704|       |
  705|  10.9k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (705:6): [True: 554, False: 10.4k]
  ------------------
  706|       |		/* Header field is absent. */
  707|    554|		return res;
  708|    554|	}
  709|       |	/* Skip leading whitespace. */
  710|  10.4k|	val += sizeof(_key) - 1U;
  711|  10.4k|	if ((eol = warc_find_eol(val, buf + bsz - val)) == NULL) {
  ------------------
  |  Branch (711:6): [True: 0, False: 10.4k]
  ------------------
  712|       |		/* Header field has no end of line. */
  713|      0|		return res;
  714|      0|	}
  715|       |
  716|  10.6k|	while (val < eol && (*val == ' ' || *val == '\t'))
  ------------------
  |  Branch (716:9): [True: 10.5k, False: 106]
  |  Branch (716:23): [True: 62, False: 10.4k]
  |  Branch (716:38): [True: 186, False: 10.2k]
  ------------------
  717|    248|		++val;
  718|       |
  719|       |	/* Locate the :// separator. */
  720|  10.4k|	if ((uri = xmemmem(val, eol - val, "://", 3U)) == NULL) {
  ------------------
  |  Branch (720:6): [True: 900, False: 9.50k]
  ------------------
  721|       |		/* Ignore values without a :// separator. */
  722|    900|		return res;
  723|    900|	}
  724|       |
  725|       |	/* Spaces inside a URI are not allowed; CRLF should follow. */
  726|   255k|	for (p = val; p < eol; p++) {
  ------------------
  |  Branch (726:16): [True: 245k, False: 9.15k]
  ------------------
  727|   245k|		if (isspace((unsigned char)*p))
  ------------------
  |  Branch (727:7): [True: 349, False: 245k]
  ------------------
  728|    349|			return res;
  729|   245k|	}
  730|       |
  731|       |	/* Require enough room for the shortest supported scheme. */
  732|  9.15k|	if (uri < (val + 3U))
  ------------------
  |  Branch (732:6): [True: 925, False: 8.22k]
  ------------------
  733|    925|		return res;
  734|       |
  735|       |	/* Move uri past the :// separator. */
  736|  8.22k|	uri += 3U;
  737|       |
  738|       |	/* Inspect the scheme prefix. */
  739|  8.22k|	if (memcmp(val, "file", 4U) == 0) {
  ------------------
  |  Branch (739:6): [True: 6.66k, False: 1.56k]
  ------------------
  740|       |		/* Keep file:// paths as-is. */
  741|       |
  742|  6.66k|	} else if (memcmp(val, "http", 4U) == 0 ||
  ------------------
  |  Branch (742:13): [True: 1.24k, False: 322]
  ------------------
  743|  1.31k|		   memcmp(val, "ftp", 3U) == 0) {
  ------------------
  |  Branch (743:6): [True: 70, False: 252]
  ------------------
  744|       |		/* Skip the domain and the first slash. */
  745|  7.28k|		while (uri < eol && *uri++ != '/');
  ------------------
  |  Branch (745:10): [True: 7.08k, False: 201]
  |  Branch (745:23): [True: 5.97k, False: 1.11k]
  ------------------
  746|  1.31k|	} else {
  747|       |		/* Unsupported URI scheme. */
  748|    252|		return res;
  749|    252|	}
  750|  7.97k|	res.str = uri;
  751|  7.97k|	res.len = eol - uri;
  752|  7.97k|	return res;
  753|  8.22k|}
archive_read_support_format_warc.c:warc_read_last_modified:
  825|  7.70k|{
  826|  7.70k|	static const char _key[] = "\r\nLast-Modified:";
  827|  7.70k|	const char *val, *eol;
  828|  7.70k|	char *on = NULL;
  829|  7.70k|	time_t res;
  830|       |
  831|  7.70k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (831:6): [True: 1.52k, False: 6.17k]
  ------------------
  832|       |		/* Header field is absent. */
  833|  1.52k|		return (time_t)-1;
  834|  1.52k|	}
  835|  6.17k|	val += sizeof(_key) - 1U;
  836|  6.17k|	if ((eol = warc_find_eol(val, buf + bsz - val)) == NULL ) {
  ------------------
  |  Branch (836:6): [True: 0, False: 6.17k]
  ------------------
  837|       |		/* Header field has no end of line. */
  838|      0|		return -1;
  839|      0|	}
  840|       |
  841|       |	/* xstrpisotime() skips leading whitespace. */
  842|  6.17k|	res = xstrpisotime(val, &on);
  843|  6.17k|	if (on != eol) {
  ------------------
  |  Branch (843:6): [True: 5.99k, False: 187]
  ------------------
  844|       |		/* The field must end here. */
  845|  5.99k|		return -1;
  846|  5.99k|	}
  847|    187|	return res;
  848|  6.17k|}
archive_read_support_format_warc.c:archive_read_format_warc_read_data:
  401|  23.1k|{
  402|  23.1k|	struct warc_s *w = a->format->data;
  403|  23.1k|	const char *rab;
  404|  23.1k|	ssize_t nrd;
  405|       |
  406|  23.1k|	if (w->unconsumed) {
  ------------------
  |  Branch (406:6): [True: 7.70k, False: 15.4k]
  ------------------
  407|  7.70k|		__archive_read_consume(a, w->unconsumed);
  408|  7.70k|		w->unconsumed = 0;
  409|  7.70k|	}
  410|       |
  411|  23.1k|	if (w->cntoff >= w->cntlen) {
  ------------------
  |  Branch (411:6): [True: 15.3k, False: 7.71k]
  ------------------
  412|  15.4k|	eof:
  413|       |		/* No data is available to return for this entry. */
  414|  15.4k|		*buf = NULL;
  415|  15.4k|		*bsz = 0U;
  416|  15.4k|		*off = w->cntoff;
  417|  15.4k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  15.4k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  418|  15.3k|	}
  419|       |
  420|  7.71k|	rab = __archive_read_ahead(a, 1U, &nrd);
  421|  7.71k|	if (nrd < 0) {
  ------------------
  |  Branch (421:6): [True: 0, False: 7.71k]
  ------------------
  422|      0|		*bsz = 0U;
  423|       |		/* Propagate the read error. */
  424|      0|		return (int)nrd;
  425|  7.71k|	} else if (nrd == 0) {
  ------------------
  |  Branch (425:13): [True: 11, False: 7.70k]
  ------------------
  426|     11|		goto eof;
  427|  7.70k|	} else if ((int64_t)nrd > w->cntlen - w->cntoff) {
  ------------------
  |  Branch (427:13): [True: 7.69k, False: 6]
  ------------------
  428|       |		/* Clamp reads to Content-Length. */
  429|  7.69k|		nrd = w->cntlen - w->cntoff;
  430|  7.69k|	}
  431|  7.70k|	*off = w->cntoff;
  432|  7.70k|	*bsz = nrd;
  433|  7.70k|	*buf = rab;
  434|       |
  435|  7.70k|	w->cntoff += nrd;
  436|  7.70k|	w->unconsumed = nrd;
  437|  7.70k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  7.70k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  438|  7.71k|}
archive_read_support_format_warc.c:archive_read_format_warc_skip:
  442|  15.0k|{
  443|  15.0k|	struct warc_s *w = a->format->data;
  444|       |
  445|  15.0k|	if (w->cntoff > w->cntlen)
  ------------------
  |  Branch (445:6): [True: 0, False: 15.0k]
  ------------------
  446|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  447|  15.0k|	if (w->unconsumed) {
  ------------------
  |  Branch (447:6): [True: 0, False: 15.0k]
  ------------------
  448|      0|		__archive_read_consume(a, w->unconsumed);
  449|      0|		w->unconsumed = 0;
  450|      0|	}
  451|  15.0k|	if (__archive_read_consume(a, w->cntlen - w->cntoff) < 0 ||
  ------------------
  |  Branch (451:6): [True: 6, False: 15.0k]
  ------------------
  452|  15.0k|	    __archive_read_consume(a, 4U/*\r\n\r\n separator*/) < 0)
  ------------------
  |  Branch (452:6): [True: 0, False: 15.0k]
  ------------------
  453|      6|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  454|  15.0k|	w->cntlen = 0;
  455|  15.0k|	w->cntoff = 0;
  456|  15.0k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  15.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  457|  15.0k|}

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

archive_read_support_format_zip:
 3636|  2.49k|{
 3637|  2.49k|	int r;
 3638|  2.49k|	r = archive_read_support_format_zip_streamable(a);
 3639|  2.49k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3639:6): [True: 0, False: 2.49k]
  ------------------
 3640|      0|		return r;
 3641|  2.49k|	return (archive_read_support_format_zip_seekable(a));
 3642|  2.49k|}
archive_read_support_format_zip_streamable:
 3883|  2.49k|{
 3884|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
 3885|  2.49k|	struct zip *zip;
 3886|  2.49k|	int r;
 3887|       |
 3888|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|  2.49k|	do { \
  |  |  178|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  2.49k|			(allowed_states), (function_name)); \
  |  |  180|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  181|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
 3889|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_zip");
 3890|       |
 3891|  2.49k|	zip = calloc(1, sizeof(*zip));
 3892|  2.49k|	if (zip == NULL) {
  ------------------
  |  Branch (3892:6): [True: 0, False: 2.49k]
  ------------------
 3893|      0|		archive_set_error(&a->archive, ENOMEM,
 3894|      0|		    "Can't allocate zip data");
 3895|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3896|      0|	}
 3897|       |
 3898|       |	/* Streamable reader doesn't support mac extensions. */
 3899|  2.49k|	zip->process_mac_extensions = 0;
 3900|       |
 3901|       |	/*
 3902|       |	 * Until enough data has been read, we cannot tell about
 3903|       |	 * any encrypted entries yet.
 3904|       |	 */
 3905|  2.49k|	zip->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|  2.49k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 3906|  2.49k|	zip->crc32func = real_crc32;
 3907|       |
 3908|  2.49k|	r = __archive_read_register_format(a,
 3909|  2.49k|	    zip,
 3910|  2.49k|	    "zip",
 3911|  2.49k|	    archive_read_format_zip_streamable_bid,
 3912|  2.49k|	    archive_read_format_zip_options,
 3913|  2.49k|	    archive_read_format_zip_streamable_read_header,
 3914|  2.49k|	    archive_read_format_zip_read_data,
 3915|  2.49k|	    archive_read_format_zip_read_data_skip_streamable,
 3916|  2.49k|	    NULL,
 3917|  2.49k|	    archive_read_format_zip_cleanup,
 3918|  2.49k|	    archive_read_support_format_zip_capabilities_streamable,
 3919|  2.49k|	    archive_read_format_zip_has_encrypted_entries);
 3920|       |
 3921|  2.49k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3921:6): [True: 0, False: 2.49k]
  ------------------
 3922|      0|		free(zip);
 3923|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3924|  2.49k|}
archive_read_support_format_zip_seekable:
 4675|  2.49k|{
 4676|  2.49k|	struct archive_read *a = (struct archive_read *)_a;
 4677|  2.49k|	struct zip *zip;
 4678|  2.49k|	int r;
 4679|       |
 4680|  2.49k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  177|  2.49k|	do { \
  |  |  178|  2.49k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  179|  2.49k|			(allowed_states), (function_name)); \
  |  |  180|  2.49k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  2.49k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (180:7): [True: 0, False: 2.49k]
  |  |  ------------------
  |  |  181|  2.49k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  182|  2.49k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (182:11): [Folded, False: 2.49k]
  |  |  ------------------
  ------------------
 4681|  2.49k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_zip_seekable");
 4682|       |
 4683|  2.49k|	zip = calloc(1, sizeof(*zip));
 4684|  2.49k|	if (zip == NULL) {
  ------------------
  |  Branch (4684:6): [True: 0, False: 2.49k]
  ------------------
 4685|      0|		archive_set_error(&a->archive, ENOMEM,
 4686|      0|		    "Can't allocate zip data");
 4687|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4688|      0|	}
 4689|       |
 4690|       |#ifdef HAVE_COPYFILE_H
 4691|       |	/* Set this by default on Mac OS. */
 4692|       |	zip->process_mac_extensions = 1;
 4693|       |#endif
 4694|       |
 4695|       |	/*
 4696|       |	 * Until enough data has been read, we cannot tell about
 4697|       |	 * any encrypted entries yet.
 4698|       |	 */
 4699|  2.49k|	zip->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|  2.49k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4700|  2.49k|	zip->crc32func = real_crc32;
 4701|       |
 4702|  2.49k|	r = __archive_read_register_format(a,
 4703|  2.49k|	    zip,
 4704|  2.49k|	    "zip",
 4705|  2.49k|	    archive_read_format_zip_seekable_bid,
 4706|  2.49k|	    archive_read_format_zip_options,
 4707|  2.49k|	    archive_read_format_zip_seekable_read_header,
 4708|  2.49k|	    archive_read_format_zip_read_data,
 4709|  2.49k|	    archive_read_format_zip_read_data_skip_seekable,
 4710|  2.49k|	    NULL,
 4711|  2.49k|	    archive_read_format_zip_cleanup,
 4712|  2.49k|	    archive_read_support_format_zip_capabilities_seekable,
 4713|  2.49k|	    archive_read_format_zip_has_encrypted_entries);
 4714|       |
 4715|  2.49k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4715:6): [True: 0, False: 2.49k]
  ------------------
 4716|      0|		free(zip);
 4717|  2.49k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4718|  2.49k|}
archive_read_support_format_zip.c:archive_read_format_zip_streamable_bid:
 3661|  2.45k|{
 3662|  2.45k|	const char *p;
 3663|       |
 3664|  2.45k|	(void)best_bid; /* UNUSED */
 3665|       |
 3666|  2.45k|	if ((p = __archive_read_ahead(a, 4, NULL)) == NULL)
  ------------------
  |  Branch (3666:6): [True: 35, False: 2.42k]
  ------------------
 3667|     35|		return (-1);
 3668|       |
 3669|       |	/*
 3670|       |	 * Bid of 29 here comes from:
 3671|       |	 *  + 16 bits for "PK",
 3672|       |	 *  + next 16-bit field has 6 options so contributes
 3673|       |	 *    about 16 - log_2(6) ~= 16 - 2.6 ~= 13 bits
 3674|       |	 *
 3675|       |	 * So we've effectively verified ~29 total bits of check data.
 3676|       |	 */
 3677|  2.42k|	if (p[0] == 'P' && p[1] == 'K') {
  ------------------
  |  Branch (3677:6): [True: 694, False: 1.72k]
  |  Branch (3677:21): [True: 692, False: 2]
  ------------------
 3678|    692|		if ((p[2] == '\001' && p[3] == '\002')
  ------------------
  |  Branch (3678:8): [True: 0, False: 692]
  |  Branch (3678:26): [True: 0, False: 0]
  ------------------
 3679|    692|		    || (p[2] == '\003' && p[3] == '\004')
  ------------------
  |  Branch (3679:11): [True: 638, False: 54]
  |  Branch (3679:29): [True: 638, False: 0]
  ------------------
 3680|     54|		    || (p[2] == '\005' && p[3] == '\006')
  ------------------
  |  Branch (3680:11): [True: 0, False: 54]
  |  Branch (3680:29): [True: 0, False: 0]
  ------------------
 3681|     54|		    || (p[2] == '\006' && p[3] == '\006')
  ------------------
  |  Branch (3681:11): [True: 0, False: 54]
  |  Branch (3681:29): [True: 0, False: 0]
  ------------------
 3682|     54|		    || (p[2] == '\007' && p[3] == '\010')
  ------------------
  |  Branch (3682:11): [True: 51, False: 3]
  |  Branch (3682:29): [True: 51, False: 0]
  ------------------
 3683|      3|		    || (p[2] == '0' && p[3] == '0'))
  ------------------
  |  Branch (3683:11): [True: 2, False: 1]
  |  Branch (3683:26): [True: 2, False: 0]
  ------------------
 3684|    691|			return (29);
 3685|    692|	}
 3686|       |
 3687|       |	/* TODO: It's worth looking ahead a little bit for a valid
 3688|       |	 * PK signature.  In particular, that would make it possible
 3689|       |	 * to read some UUEncoded SFX files or SFX files coming from
 3690|       |	 * a network socket. */
 3691|       |
 3692|  1.73k|	return (0);
 3693|  2.42k|}
archive_read_support_format_zip.c:archive_read_format_zip_options:
 3588|  4.99k|{
 3589|  4.99k|	struct zip *zip;
 3590|  4.99k|	int ret = ARCHIVE_FAILED;
  ------------------
  |  |  237|  4.99k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3591|       |
 3592|  4.99k|	zip = (struct zip *)(a->format->data);
 3593|  4.99k|	if (strcmp(key, "compat-2x")  == 0) {
  ------------------
  |  Branch (3593:6): [True: 0, False: 4.99k]
  ------------------
 3594|       |		/* Handle filenames as libarchive 2.x */
 3595|      0|		zip->init_default_conversion = (val != NULL) ? 1 : 0;
  ------------------
  |  Branch (3595:34): [True: 0, False: 0]
  ------------------
 3596|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3597|  4.99k|	} else if (strcmp(key, "hdrcharset")  == 0) {
  ------------------
  |  Branch (3597:13): [True: 0, False: 4.99k]
  ------------------
 3598|      0|		if (val == NULL || val[0] == 0)
  ------------------
  |  Branch (3598:7): [True: 0, False: 0]
  |  Branch (3598:22): [True: 0, False: 0]
  ------------------
 3599|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3600|      0|			    "zip: hdrcharset option needs a character-set name"
 3601|      0|			);
 3602|      0|		else {
 3603|      0|			zip->sconv = archive_string_conversion_from_charset(
 3604|      0|			    &a->archive, val, 0);
 3605|      0|			if (zip->sconv != NULL) {
  ------------------
  |  Branch (3605:8): [True: 0, False: 0]
  ------------------
 3606|      0|				if (strcmp(val, "UTF-8") == 0)
  ------------------
  |  Branch (3606:9): [True: 0, False: 0]
  ------------------
 3607|      0|					zip->sconv_utf8 = zip->sconv;
 3608|      0|				ret = ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3609|      0|			} else
 3610|      0|				ret = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3611|      0|		}
 3612|      0|		return (ret);
 3613|  4.99k|	} else if (strcmp(key, "ignorecrc32") == 0) {
  ------------------
  |  Branch (3613:13): [True: 4.99k, False: 0]
  ------------------
 3614|       |		/* Mostly useful for testing. */
 3615|  4.99k|		if (val == NULL || val[0] == 0) {
  ------------------
  |  Branch (3615:7): [True: 0, False: 4.99k]
  |  Branch (3615:22): [True: 0, False: 4.99k]
  ------------------
 3616|      0|			zip->crc32func = real_crc32;
 3617|      0|			zip->ignore_crc32 = 0;
 3618|  4.99k|		} else {
 3619|  4.99k|			zip->crc32func = fake_crc32;
 3620|  4.99k|			zip->ignore_crc32 = 1;
 3621|  4.99k|		}
 3622|  4.99k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.99k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3623|  4.99k|	} else if (strcmp(key, "mac-ext") == 0) {
  ------------------
  |  Branch (3623:13): [True: 0, False: 0]
  ------------------
 3624|      0|		zip->process_mac_extensions = (val != NULL && val[0] != 0);
  ------------------
  |  Branch (3624:34): [True: 0, False: 0]
  |  Branch (3624:49): [True: 0, False: 0]
  ------------------
 3625|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3626|      0|	}
 3627|       |
 3628|       |	/* Note: The "warn" return is just to inform the options
 3629|       |	 * supervisor that we didn't handle it.  It will generate
 3630|       |	 * a suitable error if no one used this option. */
 3631|      0|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 3632|  4.99k|}
archive_read_support_format_zip.c:fake_crc32:
  595|  49.7k|{
  596|  49.7k|	(void)crc; /* UNUSED */
  597|  49.7k|	(void)buff; /* UNUSED */
  598|  49.7k|	(void)len; /* UNUSED */
  599|  49.7k|	return 0;
  600|  49.7k|}
archive_read_support_format_zip.c:archive_read_format_zip_streamable_read_header:
 3698|  34.7k|{
 3699|  34.7k|	struct zip *zip;
 3700|       |
 3701|  34.7k|	a->archive.archive_format = ARCHIVE_FORMAT_ZIP;
  ------------------
  |  |  374|  34.7k|#define	ARCHIVE_FORMAT_ZIP			0x50000
  ------------------
 3702|  34.7k|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (3702:6): [True: 662, False: 34.1k]
  ------------------
 3703|    662|		a->archive.archive_format_name = "ZIP";
 3704|       |
 3705|  34.7k|	zip = (struct zip *)(a->format->data);
 3706|       |
 3707|       |	/*
 3708|       |	 * It should be sufficient to call archive_read_next_header() for
 3709|       |	 * a reader to determine if an entry is encrypted or not. If the
 3710|       |	 * encryption of an entry is only detectable when calling
 3711|       |	 * archive_read_data(), so be it. We'll do the same check there
 3712|       |	 * as well.
 3713|       |	 */
 3714|  34.7k|	if (zip->has_encrypted_entries ==
  ------------------
  |  Branch (3714:6): [True: 662, False: 34.1k]
  ------------------
 3715|  34.7k|			ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW)
  ------------------
  |  |  411|  34.7k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 3716|    662|		zip->has_encrypted_entries = 0;
 3717|       |
 3718|       |	/* Make sure we have a zip_entry structure to use. */
 3719|  34.7k|	if (zip->zip_entries == NULL) {
  ------------------
  |  Branch (3719:6): [True: 662, False: 34.1k]
  ------------------
 3720|    662|		zip->zip_entries = malloc(sizeof(struct zip_entry));
 3721|    662|		if (zip->zip_entries == NULL) {
  ------------------
  |  Branch (3721:7): [True: 0, False: 662]
  ------------------
 3722|      0|			archive_set_error(&a->archive, ENOMEM,
 3723|      0|			    "Out  of memory");
 3724|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3725|      0|		}
 3726|    662|	}
 3727|  34.7k|	zip->entry = zip->zip_entries;
 3728|  34.7k|	memset(zip->entry, 0, sizeof(struct zip_entry));
 3729|       |
 3730|  34.7k|	if (zip->cctx_valid)
  ------------------
  |  Branch (3730:6): [True: 2.35k, False: 32.4k]
  ------------------
 3731|  2.35k|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  166|  2.35k|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 3732|  34.7k|	if (zip->hctx_valid)
  ------------------
  |  Branch (3732:6): [True: 2.35k, False: 32.4k]
  ------------------
 3733|  2.35k|		archive_hmac_sha1_cleanup(&zip->hctx);
  ------------------
  |  |  105|  2.35k|	__archive_hmac.__hmac_sha1_cleanup(ctx)
  ------------------
 3734|  34.7k|	zip->tctx_valid = zip->cctx_valid = zip->hctx_valid = 0;
 3735|  34.7k|	__archive_read_reset_passphrase(a);
 3736|       |
 3737|       |	/* Search ahead for the next local file header. */
 3738|  34.7k|	__archive_read_consume(a, zip->unconsumed);
 3739|  34.7k|	zip->unconsumed = 0;
 3740|  35.3k|	for (;;) {
 3741|  35.3k|		int64_t skipped = 0;
 3742|  35.3k|		const char *p, *end;
 3743|  35.3k|		ssize_t bytes;
 3744|       |
 3745|  35.3k|		p = __archive_read_ahead(a, 4, &bytes);
 3746|  35.3k|		if (p == NULL)
  ------------------
  |  Branch (3746:7): [True: 237, False: 35.1k]
  ------------------
 3747|    237|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    237|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3748|  35.1k|		end = p + bytes;
 3749|       |
 3750|  19.2M|		while (p + 4 <= end) {
  ------------------
  |  Branch (3750:10): [True: 19.2M, False: 583]
  ------------------
 3751|  19.2M|			if (p[0] == 'P' && p[1] == 'K') {
  ------------------
  |  Branch (3751:8): [True: 84.8k, False: 19.2M]
  |  Branch (3751:23): [True: 45.8k, False: 38.9k]
  ------------------
 3752|  45.8k|				if (p[2] == '\003' && p[3] == '\004') {
  ------------------
  |  Branch (3752:9): [True: 34.8k, False: 10.9k]
  |  Branch (3752:27): [True: 34.5k, False: 287]
  ------------------
 3753|       |					/* Regular file entry. */
 3754|  34.5k|					__archive_read_consume(a, skipped);
 3755|  34.5k|					return zip_read_local_file_header(a,
 3756|  34.5k|					    entry, zip);
 3757|  34.5k|				}
 3758|       |
 3759|       |                              /*
 3760|       |                               * TODO: We cannot restore permissions
 3761|       |                               * based only on the local file headers.
 3762|       |                               * Consider scanning the central
 3763|       |                               * directory and returning additional
 3764|       |                               * entries for at least directories.
 3765|       |                               * This would allow us to properly set
 3766|       |                               * directory permissions.
 3767|       |			       *
 3768|       |			       * This won't help us fix symlinks
 3769|       |			       * and may not help with regular file
 3770|       |			       * permissions, either.  <sigh>
 3771|       |                               */
 3772|  11.2k|                              if (p[2] == '\001' && p[3] == '\002') {
  ------------------
  |  Branch (3772:35): [True: 532, False: 10.7k]
  |  Branch (3772:53): [True: 0, False: 532]
  ------------------
 3773|      0|                                      return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3774|      0|                              }
 3775|       |
 3776|       |                              /* End of central directory?  Must be an
 3777|       |                               * empty archive. */
 3778|  11.2k|                              if ((p[2] == '\005' && p[3] == '\006')
  ------------------
  |  Branch (3778:36): [True: 10, False: 11.2k]
  |  Branch (3778:54): [True: 7, False: 3]
  ------------------
 3779|  11.2k|                                  || (p[2] == '\006' && p[3] == '\006'))
  ------------------
  |  Branch (3779:39): [True: 498, False: 10.7k]
  |  Branch (3779:57): [True: 0, False: 498]
  ------------------
 3780|      7|                                      return (ARCHIVE_EOF);
  ------------------
  |  |  232|      7|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3781|  11.2k|			}
 3782|  19.2M|			++p;
 3783|  19.2M|			++skipped;
 3784|  19.2M|		}
 3785|    583|		__archive_read_consume(a, skipped);
 3786|    583|	}
 3787|  34.7k|}
archive_read_support_format_zip.c:zip_read_local_file_header:
 1105|  34.7k|{
 1106|  34.7k|	const char *p;
 1107|  34.7k|	const void *h;
 1108|  34.7k|	const wchar_t *wp;
 1109|  34.7k|	const char *cp;
 1110|  34.7k|	size_t len, filename_length, extra_length;
 1111|  34.7k|	struct archive_string_conv *sconv;
 1112|  34.7k|	struct zip_entry *zip_entry = zip->entry;
 1113|  34.7k|	struct zip_entry zip_entry_central_dir;
 1114|  34.7k|	int ret = ARCHIVE_OK;
  ------------------
  |  |  233|  34.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1115|  34.7k|	char version;
 1116|       |
 1117|       |	/* Save a copy of the original for consistency checks. */
 1118|  34.7k|	zip_entry_central_dir = *zip_entry;
 1119|       |
 1120|  34.7k|	zip->decompress_init = 0;
 1121|  34.7k|	zip->end_of_entry = 0;
 1122|  34.7k|	zip->entry_uncompressed_bytes_read = 0;
 1123|  34.7k|	zip->entry_compressed_bytes_read = 0;
 1124|  34.7k|	zip->computed_crc32 = zip->crc32func(0, NULL, 0);
 1125|       |
 1126|       |	/* Setup default conversion. */
 1127|  34.7k|	if (zip->sconv == NULL && !zip->init_default_conversion) {
  ------------------
  |  Branch (1127:6): [True: 34.7k, False: 0]
  |  Branch (1127:28): [True: 682, False: 34.0k]
  ------------------
 1128|    682|		zip->sconv_default =
 1129|    682|		    archive_string_default_conversion_for_read(&(a->archive));
 1130|    682|		zip->init_default_conversion = 1;
 1131|    682|	}
 1132|       |
 1133|  34.7k|	if ((p = __archive_read_ahead(a, ZIP_LOCHDR_LEN, NULL)) == NULL) {
  ------------------
  |  |   82|  34.7k|#define ZIP_LOCHDR_LEN		30U
  ------------------
  |  Branch (1133:6): [True: 25, False: 34.7k]
  ------------------
 1134|     25|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     25|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1135|     25|		    "Truncated ZIP file header");
 1136|     25|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     25|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1137|     25|	}
 1138|       |
 1139|  34.7k|	if (memcmp(p, "PK\003\004", 4) != 0) {
  ------------------
  |  Branch (1139:6): [True: 10, False: 34.7k]
  ------------------
 1140|     10|		archive_set_error(&a->archive, -1, "Damaged Zip archive");
 1141|     10|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     10|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1142|     10|	}
 1143|  34.7k|	version = p[4];
 1144|  34.7k|	zip_entry->system = p[5];
 1145|  34.7k|	zip_entry->zip_flags = archive_le16dec(p + 6);
 1146|  34.7k|	if (zip_entry->zip_flags & (ZIP_ENCRYPTED | ZIP_STRONG_ENCRYPTED)) {
  ------------------
  |  |  127|  34.7k|#define ZIP_ENCRYPTED	(1 << 0)
  ------------------
              	if (zip_entry->zip_flags & (ZIP_ENCRYPTED | ZIP_STRONG_ENCRYPTED)) {
  ------------------
  |  |  129|  34.7k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
  |  Branch (1146:6): [True: 10.9k, False: 23.7k]
  ------------------
 1147|  10.9k|		zip->has_encrypted_entries = 1;
 1148|  10.9k|		archive_entry_set_is_data_encrypted(entry, 1);
 1149|  10.9k|		if (zip_entry->zip_flags & ZIP_CENTRAL_DIRECTORY_ENCRYPTED &&
  ------------------
  |  |  133|  21.9k|#define ZIP_CENTRAL_DIRECTORY_ENCRYPTED	(1 << 13)
  ------------------
  |  Branch (1149:7): [True: 4.94k, False: 6.04k]
  ------------------
 1150|  4.94k|			zip_entry->zip_flags & ZIP_ENCRYPTED &&
  ------------------
  |  |  127|  15.9k|#define ZIP_ENCRYPTED	(1 << 0)
  ------------------
  |  Branch (1150:4): [True: 1.56k, False: 3.38k]
  ------------------
 1151|  1.56k|			zip_entry->zip_flags & ZIP_STRONG_ENCRYPTED) {
  ------------------
  |  |  129|  1.56k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
  |  Branch (1151:4): [True: 4, False: 1.56k]
  ------------------
 1152|      4|			archive_entry_set_is_metadata_encrypted(entry, 1);
 1153|      4|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1154|      4|		}
 1155|  10.9k|	}
 1156|  34.7k|	zip->init_decryption = (zip_entry->zip_flags & ZIP_ENCRYPTED);
  ------------------
  |  |  127|  34.7k|#define ZIP_ENCRYPTED	(1 << 0)
  ------------------
 1157|  34.7k|	zip_entry->compression = (char)archive_le16dec(p + 8);
 1158|  34.7k|	zip_entry->mtime = dos_to_unix(archive_le32dec(p + 10));
 1159|  34.7k|	zip_entry->crc32 = archive_le32dec(p + 14);
 1160|  34.7k|	if (zip_entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  128|  34.7k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (1160:6): [True: 20.0k, False: 14.6k]
  ------------------
 1161|  20.0k|		zip_entry->decdat = p[11];
 1162|  14.6k|	else
 1163|  14.6k|		zip_entry->decdat = p[17];
 1164|  34.7k|	zip_entry->compressed_size = archive_le32dec(p + 18);
 1165|  34.7k|	zip_entry->uncompressed_size = archive_le32dec(p + 22);
 1166|  34.7k|	filename_length = archive_le16dec(p + 26);
 1167|  34.7k|	extra_length = archive_le16dec(p + 28);
 1168|       |
 1169|  34.7k|	__archive_read_consume(a, ZIP_LOCHDR_LEN);
  ------------------
  |  |   82|  34.7k|#define ZIP_LOCHDR_LEN		30U
  ------------------
 1170|       |
 1171|       |	/* Read the filename. */
 1172|  34.7k|	if ((h = __archive_read_ahead(a, filename_length, NULL)) == NULL) {
  ------------------
  |  Branch (1172:6): [True: 40, False: 34.6k]
  ------------------
 1173|     40|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     40|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1174|     40|		    "Truncated ZIP file header");
 1175|     40|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     40|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1176|     40|	}
 1177|  34.6k|	if (zip_entry->zip_flags & ZIP_UTF8_NAME) {
  ------------------
  |  |  130|  34.6k|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (1177:6): [True: 10.3k, False: 24.3k]
  ------------------
 1178|       |		/* The filename is stored to be UTF-8. */
 1179|  10.3k|		if (zip->sconv_utf8 == NULL) {
  ------------------
  |  Branch (1179:7): [True: 213, False: 10.1k]
  ------------------
 1180|    213|			zip->sconv_utf8 =
 1181|    213|			    archive_string_conversion_from_charset(
 1182|    213|				&a->archive, "UTF-8", 1);
 1183|    213|			if (zip->sconv_utf8 == NULL)
  ------------------
  |  Branch (1183:8): [True: 0, False: 213]
  ------------------
 1184|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1185|    213|		}
 1186|  10.3k|		sconv = zip->sconv_utf8;
 1187|  24.3k|	} else if (zip->sconv != NULL)
  ------------------
  |  Branch (1187:13): [True: 0, False: 24.3k]
  ------------------
 1188|      0|		sconv = zip->sconv;
 1189|  24.3k|	else
 1190|  24.3k|		sconv = zip->sconv_default;
 1191|       |
 1192|  34.6k|	if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|  34.6k|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (1192:6): [True: 1.20k, False: 33.4k]
  ------------------
 1193|  34.6k|	    h, filename_length, sconv) != 0) {
 1194|  1.20k|		if (errno == ENOMEM) {
  ------------------
  |  Branch (1194:7): [True: 0, False: 1.20k]
  ------------------
 1195|      0|			archive_set_error(&a->archive, ENOMEM,
 1196|      0|			    "Can't allocate memory for Pathname");
 1197|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1198|      0|		}
 1199|  1.20k|		archive_set_error(&a->archive,
 1200|  1.20k|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.20k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1201|  1.20k|		    "Pathname cannot be converted "
 1202|  1.20k|		    "from %s to current locale",
 1203|  1.20k|		    archive_string_conversion_charset_name(sconv));
 1204|  1.20k|		ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  1.20k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1205|  1.20k|	}
 1206|  34.6k|	__archive_read_consume(a, filename_length);
 1207|       |
 1208|       |	/* Read the extra data. */
 1209|  34.6k|	if ((h = __archive_read_ahead(a, extra_length, NULL)) == NULL) {
  ------------------
  |  Branch (1209:6): [True: 24, False: 34.6k]
  ------------------
 1210|     24|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     24|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1211|     24|		    "Truncated ZIP file header");
 1212|     24|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     24|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1213|     24|	}
 1214|       |
 1215|  34.6k|	if (ARCHIVE_OK != process_extra(a, entry, h, extra_length,
  ------------------
  |  |  233|  34.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1215:6): [True: 46, False: 34.6k]
  ------------------
 1216|  34.6k|	    zip_entry)) {
 1217|     46|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     46|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1218|     46|	}
 1219|  34.6k|	__archive_read_consume(a, extra_length);
 1220|       |
 1221|       |	/* Work around a bug in Info-Zip: When reading from a pipe, it
 1222|       |	 * stats the pipe instead of synthesizing a file entry. */
 1223|  34.6k|	if ((zip_entry->mode & AE_IFMT) == AE_IFIFO) {
  ------------------
  |  |  215|  34.6k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip_entry->mode & AE_IFMT) == AE_IFIFO) {
  ------------------
  |  |  222|  34.6k|#define AE_IFIFO	((__LA_MODE_T)0010000)
  ------------------
  |  Branch (1223:6): [True: 843, False: 33.7k]
  ------------------
 1224|    843|		zip_entry->mode &= ~ AE_IFMT;
  ------------------
  |  |  215|    843|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1225|    843|		zip_entry->mode |= AE_IFREG;
  ------------------
  |  |  216|    843|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1226|    843|	}
 1227|       |
 1228|       |	/* If the mode is totally empty, set some sane default. */
 1229|  34.6k|	if (zip_entry->mode == 0) {
  ------------------
  |  Branch (1229:6): [True: 30.4k, False: 4.15k]
  ------------------
 1230|  30.4k|		zip_entry->mode |= 0664;
 1231|  30.4k|	}
 1232|       |
 1233|       |	/* Windows archivers sometimes use backslash as the directory
 1234|       |	 * separator. Normalize to slash. */
 1235|  34.6k|	if (zip_entry->system == 0 &&
  ------------------
  |  Branch (1235:6): [True: 16.8k, False: 17.8k]
  ------------------
 1236|  16.8k|	    (wp = archive_entry_pathname_w(entry)) != NULL) {
  ------------------
  |  Branch (1236:6): [True: 10.7k, False: 6.05k]
  ------------------
 1237|  10.7k|		if (wcschr(wp, L'/') == NULL && wcschr(wp, L'\\') != NULL) {
  ------------------
  |  Branch (1237:7): [True: 10.2k, False: 548]
  |  Branch (1237:35): [True: 497, False: 9.70k]
  ------------------
 1238|    497|			size_t i;
 1239|    497|			struct archive_wstring s;
 1240|    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]
  |  |  ------------------
  ------------------
 1241|    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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1242|  13.6k|			for (i = 0; i < archive_strlen(&s); i++) {
  ------------------
  |  |  178|  13.6k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1242:16): [True: 13.1k, False: 497]
  ------------------
 1243|  13.1k|				if (s.s[i] == '\\')
  ------------------
  |  Branch (1243:9): [True: 3.03k, False: 10.1k]
  ------------------
 1244|  3.03k|					s.s[i] = '/';
 1245|  13.1k|			}
 1246|    497|			archive_entry_copy_pathname_w(entry, s.s);
 1247|    497|			archive_wstring_free(&s);
 1248|    497|		}
 1249|  10.7k|	}
 1250|       |
 1251|       |	/* Make sure that entries with a trailing '/' are marked as directories
 1252|       |	 * even if the External File Attributes contains bogus values.  If this
 1253|       |	 * is not a directory and there is no type, assume a regular file. */
 1254|  34.6k|	if ((zip_entry->mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  215|  34.6k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip_entry->mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  221|  34.6k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1254:6): [True: 33.3k, False: 1.22k]
  ------------------
 1255|  33.3k|		int has_slash;
 1256|       |
 1257|  33.3k|		wp = archive_entry_pathname_w(entry);
 1258|  33.3k|		if (wp != NULL) {
  ------------------
  |  Branch (1258:7): [True: 25.0k, False: 8.34k]
  ------------------
 1259|  25.0k|			len = wcslen(wp);
 1260|  25.0k|			has_slash = len > 0 && wp[len - 1] == L'/';
  ------------------
  |  Branch (1260:16): [True: 3.74k, False: 21.3k]
  |  Branch (1260:27): [True: 270, False: 3.47k]
  ------------------
 1261|  25.0k|		} else {
 1262|  8.34k|			cp = archive_entry_pathname(entry);
 1263|  8.34k|			len = (cp != NULL)?strlen(cp):0;
  ------------------
  |  Branch (1263:10): [True: 7.44k, False: 900]
  ------------------
 1264|  8.34k|			has_slash = len > 0 && cp[len - 1] == '/';
  ------------------
  |  Branch (1264:16): [True: 7.44k, False: 900]
  |  Branch (1264:27): [True: 261, False: 7.18k]
  ------------------
 1265|  8.34k|		}
 1266|       |		/* Correct file type as needed. */
 1267|  33.3k|		if (has_slash) {
  ------------------
  |  Branch (1267:7): [True: 531, False: 32.8k]
  ------------------
 1268|    531|			zip_entry->mode &= ~AE_IFMT;
  ------------------
  |  |  215|    531|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1269|    531|			zip_entry->mode |= AE_IFDIR;
  ------------------
  |  |  221|    531|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1270|    531|			zip_entry->mode |= 0111;
 1271|  32.8k|		} else if ((zip_entry->mode & AE_IFMT) == 0) {
  ------------------
  |  |  215|  32.8k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  |  Branch (1271:14): [True: 30.3k, False: 2.56k]
  ------------------
 1272|  30.3k|			zip_entry->mode |= AE_IFREG;
  ------------------
  |  |  216|  30.3k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1273|  30.3k|		}
 1274|  33.3k|	}
 1275|       |
 1276|       |	/* Make sure directories end in '/' */
 1277|  34.6k|	if ((zip_entry->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  215|  34.6k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip_entry->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  221|  34.6k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1277:6): [True: 1.75k, False: 32.8k]
  ------------------
 1278|  1.75k|		wp = archive_entry_pathname_w(entry);
 1279|  1.75k|		if (wp != NULL) {
  ------------------
  |  Branch (1279:7): [True: 1.14k, False: 610]
  ------------------
 1280|  1.14k|			len = wcslen(wp);
 1281|  1.14k|			if (len > 0 && wp[len - 1] != L'/') {
  ------------------
  |  Branch (1281:8): [True: 478, False: 669]
  |  Branch (1281:19): [True: 104, False: 374]
  ------------------
 1282|    104|				struct archive_wstring s;
 1283|    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]
  |  |  ------------------
  ------------------
 1284|    104|				archive_wstrcat(&s, wp);
 1285|    104|				archive_wstrappend_wchar(&s, L'/');
 1286|    104|				archive_entry_copy_pathname_w(entry, s.s);
 1287|    104|				archive_wstring_free(&s);
 1288|    104|			}
 1289|  1.14k|		} else {
 1290|    610|			cp = archive_entry_pathname(entry);
 1291|    610|			len = (cp != NULL)?strlen(cp):0;
  ------------------
  |  Branch (1291:10): [True: 305, False: 305]
  ------------------
 1292|    610|			if (len > 0 && cp[len - 1] != '/') {
  ------------------
  |  Branch (1292:8): [True: 305, False: 305]
  |  Branch (1292:19): [True: 44, False: 261]
  ------------------
 1293|     44|				struct archive_string s;
 1294|     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]
  |  |  ------------------
  ------------------
 1295|     44|				archive_strcat(&s, cp);
 1296|     44|				archive_strappend_char(&s, '/');
 1297|     44|				archive_entry_set_pathname(entry, s.s);
 1298|     44|				archive_string_free(&s);
 1299|     44|			}
 1300|    610|		}
 1301|  1.75k|	}
 1302|       |
 1303|  34.6k|	if (zip_entry->flags & LA_FROM_CENTRAL_DIRECTORY) {
  ------------------
  |  |  137|  34.6k|#define LA_FROM_CENTRAL_DIRECTORY (1 << 1)
  ------------------
  |  Branch (1303:6): [True: 212, False: 34.4k]
  ------------------
 1304|       |		/* If this came from the central dir, its size info
 1305|       |		 * is definitive, so ignore the length-at-end flag. */
 1306|    212|		zip_entry->zip_flags &= ~ZIP_LENGTH_AT_END;
  ------------------
  |  |  128|    212|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
 1307|       |		/* If local header is missing a value, use the one from
 1308|       |		   the central directory.  If both have it, warn about
 1309|       |		   mismatches. */
 1310|    212|		if (zip_entry->crc32 == 0) {
  ------------------
  |  Branch (1310:7): [True: 57, False: 155]
  ------------------
 1311|     57|			zip_entry->crc32 = zip_entry_central_dir.crc32;
 1312|    155|		} else if (!zip->ignore_crc32
  ------------------
  |  Branch (1312:14): [True: 0, False: 155]
  ------------------
 1313|      0|		    && zip_entry->crc32 != zip_entry_central_dir.crc32) {
  ------------------
  |  Branch (1313:10): [True: 0, False: 0]
  ------------------
 1314|      0|			archive_set_error(&a->archive,
 1315|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1316|      0|			    "Inconsistent CRC32 values");
 1317|      0|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1318|      0|		}
 1319|    212|		if (zip_entry->compressed_size == 0
  ------------------
  |  Branch (1319:7): [True: 51, False: 161]
  ------------------
 1320|    161|		    || zip_entry->compressed_size == 0xffffffff) {
  ------------------
  |  Branch (1320:10): [True: 11, False: 150]
  ------------------
 1321|     62|			zip_entry->compressed_size
 1322|     62|			    = zip_entry_central_dir.compressed_size;
 1323|    150|		} else if (zip_entry->compressed_size
  ------------------
  |  Branch (1323:14): [True: 26, False: 124]
  ------------------
 1324|    150|		    != zip_entry_central_dir.compressed_size) {
 1325|     26|			archive_set_error(&a->archive,
 1326|     26|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     26|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1327|     26|			    "Inconsistent compressed size: "
 1328|     26|			    "%jd in central directory, %jd in local header",
 1329|     26|			    (intmax_t)zip_entry_central_dir.compressed_size,
 1330|     26|			    (intmax_t)zip_entry->compressed_size);
 1331|     26|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     26|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1332|     26|		}
 1333|    212|		if (zip_entry->uncompressed_size == 0 ||
  ------------------
  |  Branch (1333:7): [True: 50, False: 162]
  ------------------
 1334|    162|			zip_entry->uncompressed_size == 0xffffffff) {
  ------------------
  |  Branch (1334:4): [True: 0, False: 162]
  ------------------
 1335|     50|			zip_entry->uncompressed_size
 1336|     50|			    = zip_entry_central_dir.uncompressed_size;
 1337|    162|		} else if (zip_entry->uncompressed_size
  ------------------
  |  Branch (1337:14): [True: 16, False: 146]
  ------------------
 1338|    162|		    != zip_entry_central_dir.uncompressed_size) {
 1339|     16|			archive_set_error(&a->archive,
 1340|     16|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     16|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1341|     16|			    "Inconsistent uncompressed size: "
 1342|     16|			    "%jd in central directory, %jd in local header",
 1343|     16|			    (intmax_t)zip_entry_central_dir.uncompressed_size,
 1344|     16|			    (intmax_t)zip_entry->uncompressed_size);
 1345|     16|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     16|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1346|     16|		}
 1347|    212|	}
 1348|       |
 1349|       |	/* Populate some additional entry fields: */
 1350|  34.6k|	archive_entry_set_mode(entry, zip_entry->mode);
 1351|  34.6k|	archive_entry_set_uid(entry, zip_entry->uid);
 1352|  34.6k|	archive_entry_set_gid(entry, zip_entry->gid);
 1353|  34.6k|	archive_entry_set_mtime(entry, zip_entry->mtime, 0);
 1354|  34.6k|	archive_entry_set_ctime(entry, zip_entry->ctime, 0);
 1355|  34.6k|	archive_entry_set_atime(entry, zip_entry->atime, 0);
 1356|       |
 1357|  34.6k|	if ((zip->entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  215|  34.6k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip->entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  217|  34.6k|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (1357:6): [True: 1.44k, False: 33.1k]
  ------------------
 1358|  1.44k|		size_t linkname_length;
 1359|       |
 1360|  1.44k|		if (zip_entry->compressed_size > 64 * 1024) {
  ------------------
  |  Branch (1360:7): [True: 0, False: 1.44k]
  ------------------
 1361|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1362|      0|			    "Zip file with oversized link entry");
 1363|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1364|      0|		}
 1365|       |
 1366|  1.44k|		linkname_length = (size_t)zip_entry->compressed_size;
 1367|       |
 1368|  1.44k|		archive_entry_set_size(entry, 0);
 1369|       |
 1370|       |		// take into account link compression if any
 1371|  1.44k|		size_t linkname_full_length = linkname_length;
 1372|  1.44k|		if (zip->entry->compression != 0)
  ------------------
  |  Branch (1372:7): [True: 0, False: 1.44k]
  ------------------
 1373|      0|		{
 1374|       |			// symlink target string appeared to be compressed
 1375|      0|			int status = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1376|      0|			const void *uncompressed_buffer = NULL;
 1377|       |
 1378|      0|			switch (zip->entry->compression)
 1379|      0|			{
 1380|      0|#if HAVE_ZLIB_H
 1381|      0|				case 8: /* Deflate compression. */
  ------------------
  |  Branch (1381:5): [True: 0, False: 0]
  ------------------
 1382|      0|					zip->entry_bytes_remaining = zip_entry->compressed_size;
 1383|      0|					status = zip_read_data_deflate(a, &uncompressed_buffer,
 1384|      0|						&linkname_full_length, NULL);
 1385|      0|					break;
 1386|      0|#endif
 1387|      0|#if HAVE_LZMA_H && HAVE_LIBLZMA
 1388|      0|				case 14: /* ZIPx LZMA compression. */
  ------------------
  |  Branch (1388:5): [True: 0, False: 0]
  ------------------
 1389|       |					/*(see zip file format specification, section 4.4.5)*/
 1390|      0|					zip->entry_bytes_remaining = zip_entry->compressed_size;
 1391|      0|					status = zip_read_data_zipx_lzma_alone(a, &uncompressed_buffer,
 1392|      0|						&linkname_full_length, NULL);
 1393|      0|					break;
 1394|      0|#endif
 1395|      0|				default: /* Unsupported compression. */
  ------------------
  |  Branch (1395:5): [True: 0, False: 0]
  ------------------
 1396|      0|					break;
 1397|      0|			}
 1398|      0|			if (status == ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1398:8): [True: 0, False: 0]
  ------------------
 1399|      0|			{
 1400|      0|				p = uncompressed_buffer;
 1401|      0|			}
 1402|      0|			else
 1403|      0|			{
 1404|      0|				archive_set_error(&a->archive,
 1405|      0|					ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1406|      0|					"Unsupported ZIP compression method "
 1407|      0|					"during decompression of link entry (%d: %s)",
 1408|      0|					zip->entry->compression,
 1409|      0|					compression_name(zip->entry->compression));
 1410|      0|				return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1411|      0|			}
 1412|      0|		}
 1413|  1.44k|		else
 1414|  1.44k|		{
 1415|  1.44k|			p = __archive_read_ahead(a, linkname_length, NULL);
 1416|  1.44k|		}
 1417|       |
 1418|  1.44k|		if (p == NULL) {
  ------------------
  |  Branch (1418:7): [True: 0, False: 1.44k]
  ------------------
 1419|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1420|      0|			    "Truncated Zip file");
 1421|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1422|      0|		}
 1423|       |
 1424|  1.44k|		sconv = zip->sconv;
 1425|  1.44k|		if (sconv == NULL && (zip->entry->zip_flags & ZIP_UTF8_NAME))
  ------------------
  |  |  130|  1.44k|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (1425:7): [True: 1.44k, False: 0]
  |  Branch (1425:24): [True: 599, False: 841]
  ------------------
 1426|    599|			sconv = zip->sconv_utf8;
 1427|  1.44k|		if (sconv == NULL)
  ------------------
  |  Branch (1427:7): [True: 841, False: 599]
  ------------------
 1428|    841|			sconv = zip->sconv_default;
 1429|  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 (1429:7): [True: 461, False: 979]
  ------------------
 1430|  1.44k|		    sconv) != 0) {
 1431|    461|			if (errno != ENOMEM && sconv == zip->sconv_utf8 &&
  ------------------
  |  Branch (1431:8): [True: 461, False: 0]
  |  Branch (1431:27): [True: 461, False: 0]
  ------------------
 1432|    461|			    (zip->entry->zip_flags & ZIP_UTF8_NAME))
  ------------------
  |  |  130|    461|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (1432:8): [True: 461, False: 0]
  ------------------
 1433|    461|			    archive_entry_copy_symlink_l(entry, p,
  ------------------
  |  |   83|    461|#define archive_entry_copy_symlink_l	_archive_entry_copy_symlink_l
  ------------------
 1434|    461|				linkname_full_length, NULL);
 1435|    461|			if (errno == ENOMEM) {
  ------------------
  |  Branch (1435:8): [True: 0, False: 461]
  ------------------
 1436|      0|				archive_set_error(&a->archive, ENOMEM,
 1437|      0|				    "Can't allocate memory for Symlink");
 1438|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1439|      0|			}
 1440|       |			/*
 1441|       |			 * Since there is no character-set regulation for
 1442|       |			 * symlink name, do not report the conversion error
 1443|       |			 * in an automatic conversion.
 1444|       |			 */
 1445|    461|			if (sconv != zip->sconv_utf8 ||
  ------------------
  |  Branch (1445:8): [True: 0, False: 461]
  ------------------
 1446|    461|			    (zip->entry->zip_flags & ZIP_UTF8_NAME) == 0) {
  ------------------
  |  |  130|    461|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (1446:8): [True: 0, False: 461]
  ------------------
 1447|      0|				archive_set_error(&a->archive,
 1448|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1449|      0|				    "Symlink cannot be converted "
 1450|      0|				    "from %s to current locale",
 1451|      0|				    archive_string_conversion_charset_name(
 1452|      0|					sconv));
 1453|      0|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1454|      0|			}
 1455|    461|		}
 1456|  1.44k|		zip_entry->uncompressed_size = zip_entry->compressed_size = 0;
 1457|       |
 1458|  1.44k|		if (__archive_read_consume(a, linkname_length) < 0) {
  ------------------
  |  Branch (1458:7): [True: 0, False: 1.44k]
  ------------------
 1459|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1460|      0|			    "Read error skipping symlink target name");
 1461|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1462|      0|		}
 1463|  33.1k|	} else if (zip_entry_size_is_set(zip_entry)) {
  ------------------
  |  Branch (1463:13): [True: 26.2k, False: 6.96k]
  ------------------
 1464|  26.2k|		archive_entry_set_size(entry, zip_entry->uncompressed_size);
 1465|  26.2k|	}
 1466|  34.6k|	zip->entry_bytes_remaining = zip_entry->compressed_size;
 1467|       |
 1468|       |	/* If there's no body, force read_data() to return EOF immediately. */
 1469|  34.6k|	if (0 == (zip_entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  128|  34.6k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (1469:6): [True: 14.6k, False: 20.0k]
  ------------------
 1470|  14.6k|	    && zip->entry_bytes_remaining < 1)
  ------------------
  |  Branch (1470:9): [True: 2.50k, False: 12.0k]
  ------------------
 1471|  2.50k|		zip->end_of_entry = 1;
 1472|       |
 1473|       |	/* Set up a more descriptive format name. */
 1474|  34.6k|        archive_string_empty(&zip->format_name);
  ------------------
  |  |  181|  34.6k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1475|  34.6k|	archive_string_sprintf(&zip->format_name, "ZIP %d.%d (%s)",
 1476|  34.6k|	    version / 10, version % 10,
 1477|  34.6k|	    compression_name(zip->entry->compression));
 1478|  34.6k|	a->archive.archive_format_name = zip->format_name.s;
 1479|       |
 1480|  34.6k|	return (ret);
 1481|  34.6k|}
archive_read_support_format_zip.c:process_extra:
  658|  35.7k|{
  659|  35.7k|	unsigned offset = 0;
  660|  35.7k|	struct zip *zip = (struct zip *)(a->format->data);
  661|       |
  662|  35.7k|	if (extra_length == 0) {
  ------------------
  |  Branch (662:6): [True: 22.0k, False: 13.6k]
  ------------------
  663|  22.0k|		return ARCHIVE_OK;
  ------------------
  |  |  233|  22.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  664|  22.0k|	}
  665|       |
  666|  13.6k|	if (extra_length < 4) {
  ------------------
  |  Branch (666:6): [True: 676, False: 12.9k]
  ------------------
  667|    676|		size_t i = 0;
  668|       |		/* Some ZIP files may have trailing 0 bytes. Let's check they
  669|       |		 * are all 0 and ignore them instead of returning an error.
  670|       |		 *
  671|       |		 * This is not technically correct, but some ZIP files look
  672|       |		 * like this and other tools support those files - so let's
  673|       |		 * also  support them.
  674|       |		 */
  675|  1.78k|		for (; i < extra_length; i++) {
  ------------------
  |  Branch (675:10): [True: 1.10k, False: 675]
  ------------------
  676|  1.10k|			if (p[i] != 0) {
  ------------------
  |  Branch (676:8): [True: 1, False: 1.10k]
  ------------------
  677|      1|				archive_set_error(&a->archive,
  678|      1|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  679|      1|				    "Too-small extra data: "
  680|      1|				    "Need at least 4 bytes, "
  681|      1|				    "but only found %d bytes",
  682|      1|				    (int)extra_length);
  683|      1|				return ARCHIVE_FAILED;
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  684|      1|			}
  685|  1.10k|		}
  686|       |
  687|    675|		return ARCHIVE_OK;
  ------------------
  |  |  233|    675|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  688|    676|	}
  689|       |
  690|  30.8k|	while (offset <= extra_length - 4) {
  ------------------
  |  Branch (690:9): [True: 17.9k, False: 12.9k]
  ------------------
  691|  17.9k|		unsigned short headerid = archive_le16dec(p + offset);
  692|  17.9k|		unsigned short datasize = archive_le16dec(p + offset + 2);
  693|       |
  694|  17.9k|		offset += 4;
  695|  17.9k|		if (offset + datasize > extra_length) {
  ------------------
  |  Branch (695:7): [True: 49, False: 17.8k]
  ------------------
  696|     49|			archive_set_error(&a->archive,
  697|     49|			    ARCHIVE_ERRNO_FILE_FORMAT, "Extra data overflow: "
  ------------------
  |  |  192|     49|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  698|     49|			    "Need %d bytes but only found %d bytes",
  699|     49|			    (int)datasize, (int)(extra_length - offset));
  700|     49|			return ARCHIVE_FAILED;
  ------------------
  |  |  237|     49|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  701|     49|		}
  702|       |#ifdef DEBUG
  703|       |		fprintf(stderr, "Header id 0x%04x, length %d\n",
  704|       |		    headerid, datasize);
  705|       |#endif
  706|  17.8k|		switch (headerid) {
  707|    622|		case 0x0001:
  ------------------
  |  Branch (707:3): [True: 622, False: 17.2k]
  ------------------
  708|       |			/* Zip64 extended information extra field. */
  709|    622|			zip_entry->flags |= LA_USED_ZIP64;
  ------------------
  |  |  136|    622|#define LA_USED_ZIP64	(1 << 0)
  ------------------
  710|    622|			if (zip_entry->uncompressed_size == 0xffffffff) {
  ------------------
  |  Branch (710:8): [True: 151, False: 471]
  ------------------
  711|    151|				uint64_t t = 0;
  712|    151|				if (datasize < 8
  ------------------
  |  Branch (712:9): [True: 0, False: 151]
  ------------------
  713|    151|				    || (t = archive_le64dec(p + offset)) >
  ------------------
  |  Branch (713:12): [True: 0, False: 151]
  ------------------
  714|    151|				    INT64_MAX) {
  715|      0|					archive_set_error(&a->archive,
  716|      0|					    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  717|      0|					    "Malformed 64-bit "
  718|      0|					    "uncompressed size");
  719|      0|					return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  720|      0|				}
  721|    151|				zip_entry->uncompressed_size = t;
  722|    151|				offset += 8;
  723|    151|				datasize -= 8;
  724|    151|			}
  725|    622|			if (zip_entry->compressed_size == 0xffffffff) {
  ------------------
  |  Branch (725:8): [True: 224, False: 398]
  ------------------
  726|    224|				uint64_t t = 0;
  727|    224|				if (datasize < 8
  ------------------
  |  Branch (727:9): [True: 0, False: 224]
  ------------------
  728|    224|				    || (t = archive_le64dec(p + offset)) >
  ------------------
  |  Branch (728:12): [True: 0, False: 224]
  ------------------
  729|    224|				    INT64_MAX) {
  730|      0|					archive_set_error(&a->archive,
  731|      0|					    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  732|      0|					    "Malformed 64-bit "
  733|      0|					    "compressed size");
  734|      0|					return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  735|      0|				}
  736|    224|				zip_entry->compressed_size = t;
  737|    224|				offset += 8;
  738|    224|				datasize -= 8;
  739|    224|			}
  740|    622|			if (zip_entry->local_header_offset == 0xffffffff) {
  ------------------
  |  Branch (740:8): [True: 0, False: 622]
  ------------------
  741|      0|				uint64_t t = 0;
  742|      0|				if (datasize < 8
  ------------------
  |  Branch (742:9): [True: 0, False: 0]
  ------------------
  743|      0|				    || (t = archive_le64dec(p + offset)) >
  ------------------
  |  Branch (743:12): [True: 0, False: 0]
  ------------------
  744|      0|				    INT64_MAX) {
  745|      0|					archive_set_error(&a->archive,
  746|      0|					    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  747|      0|					    "Malformed 64-bit "
  748|      0|					    "local header offset");
  749|      0|					return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  750|      0|				}
  751|      0|				zip_entry->local_header_offset = t;
  752|      0|				offset += 8;
  753|      0|				datasize -= 8;
  754|      0|			}
  755|       |			/* archive_le32dec(p + offset) gives disk
  756|       |			 * on which file starts, but we don't handle
  757|       |			 * multi-volume Zip files. */
  758|    622|			break;
  759|    622|		case 0x000d:
  ------------------
  |  Branch (759:3): [True: 0, False: 17.8k]
  ------------------
  760|       |			/* PKWARE Unix Extra Field fixed metadata. */
  761|      0|			if (datasize >= 12) {
  ------------------
  |  Branch (761:8): [True: 0, False: 0]
  ------------------
  762|      0|				zip_entry->atime = archive_le32dec(p + offset);
  763|      0|				zip_entry->mtime =
  764|      0|				    archive_le32dec(p + offset + 4);
  765|      0|				zip_entry->uid =
  766|      0|				    archive_le16dec(p + offset + 8);
  767|      0|				zip_entry->gid =
  768|      0|				    archive_le16dec(p + offset + 10);
  769|       |				/*
  770|       |				 * APPNOTE.TXT also defines additional data after
  771|       |				 * this fixed metadata, depending on file type.
  772|       |				 */
  773|      0|			}
  774|      0|			break;
  775|       |#ifdef DEBUG
  776|       |		case 0x0017:
  777|       |		{
  778|       |			/* Strong encryption field. */
  779|       |			if (archive_le16dec(p + offset) == 2) {
  780|       |				unsigned algId =
  781|       |					archive_le16dec(p + offset + 2);
  782|       |				unsigned bitLen =
  783|       |					archive_le16dec(p + offset + 4);
  784|       |				int	 flags =
  785|       |					archive_le16dec(p + offset + 6);
  786|       |				fprintf(stderr, "algId=0x%04x, bitLen=%u, "
  787|       |				    "flgas=%d\n", algId, bitLen,flags);
  788|       |			}
  789|       |			break;
  790|       |		}
  791|       |#endif
  792|  1.90k|		case 0x5455:
  ------------------
  |  Branch (792:3): [True: 1.90k, False: 15.9k]
  ------------------
  793|  1.90k|		{
  794|       |			/* Extended time field "UT". */
  795|  1.90k|			int flags;
  796|  1.90k|			if (datasize == 0) {
  ------------------
  |  Branch (796:8): [True: 0, False: 1.90k]
  ------------------
  797|      0|				archive_set_error(&a->archive,
  798|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  799|      0|				    "Incomplete extended time field");
  800|      0|				return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  801|      0|			}
  802|  1.90k|			flags = p[offset];
  803|  1.90k|			offset++;
  804|  1.90k|			datasize--;
  805|       |			/* Flag bits indicate which dates are present. */
  806|  1.90k|			if (flags & 0x01)
  ------------------
  |  Branch (806:8): [True: 1.26k, False: 646]
  ------------------
  807|  1.26k|			{
  808|       |#ifdef DEBUG
  809|       |				fprintf(stderr, "mtime: %lld -> %d\n",
  810|       |				    (long long)zip_entry->mtime,
  811|       |				    archive_le32dec(p + offset));
  812|       |#endif
  813|  1.26k|				if (datasize < 4)
  ------------------
  |  Branch (813:9): [True: 0, False: 1.26k]
  ------------------
  814|      0|					break;
  815|  1.26k|				zip_entry->mtime = archive_le32dec(p + offset);
  816|  1.26k|				offset += 4;
  817|  1.26k|				datasize -= 4;
  818|  1.26k|			}
  819|  1.90k|			if (flags & 0x02)
  ------------------
  |  Branch (819:8): [True: 1.14k, False: 760]
  ------------------
  820|  1.14k|			{
  821|  1.14k|				if (datasize < 4)
  ------------------
  |  Branch (821:9): [True: 423, False: 724]
  ------------------
  822|    423|					break;
  823|    724|				zip_entry->atime = archive_le32dec(p + offset);
  824|    724|				offset += 4;
  825|    724|				datasize -= 4;
  826|    724|			}
  827|  1.48k|			if (flags & 0x04)
  ------------------
  |  Branch (827:8): [True: 1.28k, False: 200]
  ------------------
  828|  1.28k|			{
  829|  1.28k|				if (datasize < 4)
  ------------------
  |  Branch (829:9): [True: 244, False: 1.04k]
  ------------------
  830|    244|					break;
  831|  1.04k|				zip_entry->ctime = archive_le32dec(p + offset);
  832|  1.04k|				offset += 4;
  833|  1.04k|				datasize -= 4;
  834|  1.04k|			}
  835|  1.24k|			break;
  836|  1.48k|		}
  837|  1.24k|		case 0x5855:
  ------------------
  |  Branch (837:3): [True: 101, False: 17.7k]
  ------------------
  838|    101|		{
  839|       |			/* Info-ZIP Unix Extra Field (old version) "UX". */
  840|    101|			if (datasize >= 8) {
  ------------------
  |  Branch (840:8): [True: 53, False: 48]
  ------------------
  841|     53|				zip_entry->atime = archive_le32dec(p + offset);
  842|     53|				zip_entry->mtime =
  843|     53|				    archive_le32dec(p + offset + 4);
  844|     53|			}
  845|    101|			if (datasize >= 12) {
  ------------------
  |  Branch (845:8): [True: 49, False: 52]
  ------------------
  846|     49|				zip_entry->uid =
  847|     49|				    archive_le16dec(p + offset + 8);
  848|     49|				zip_entry->gid =
  849|     49|				    archive_le16dec(p + offset + 10);
  850|     49|			}
  851|    101|			break;
  852|  1.48k|		}
  853|  6.83k|		case 0x6c78:
  ------------------
  |  Branch (853:3): [True: 6.83k, False: 11.0k]
  ------------------
  854|  6.83k|		{
  855|       |			/* Experimental 'xl' field */
  856|       |			/*
  857|       |			 * Introduced Dec 2013 to provide a way to
  858|       |			 * include external file attributes (and other
  859|       |			 * fields that ordinarily appear only in
  860|       |			 * central directory) in local file header.
  861|       |			 * This provides file type and permission
  862|       |			 * information necessary to support full
  863|       |			 * streaming extraction.  Currently being
  864|       |			 * discussed with other Zip developers
  865|       |			 * ... subject to change.
  866|       |			 *
  867|       |			 * Format:
  868|       |			 *  The field starts with a bitmap that specifies
  869|       |			 *  which additional fields are included.  The
  870|       |			 *  bitmap is variable length and can be extended in
  871|       |			 *  the future.
  872|       |			 *
  873|       |			 *  n bytes - feature bitmap: first byte has low-order
  874|       |			 *    7 bits.  If high-order bit is set, a subsequent
  875|       |			 *    byte holds the next 7 bits, etc.
  876|       |			 *
  877|       |			 *  if bitmap & 1, 2 byte "version made by"
  878|       |			 *  if bitmap & 2, 2 byte "internal file attributes"
  879|       |			 *  if bitmap & 4, 4 byte "external file attributes"
  880|       |			 *  if bitmap & 8, 2 byte comment length + n byte
  881|       |			 *  comment
  882|       |			 */
  883|  6.83k|			int bitmap, bitmap_last;
  884|       |
  885|  6.83k|			if (datasize < 1)
  ------------------
  |  Branch (885:8): [True: 167, False: 6.66k]
  ------------------
  886|    167|				break;
  887|  6.66k|			bitmap_last = bitmap = 0xff & p[offset];
  888|  6.66k|			offset += 1;
  889|  6.66k|			datasize -= 1;
  890|       |
  891|       |			/* We only support first 7 bits of bitmap; skip rest. */
  892|  29.8k|			while ((bitmap_last & 0x80) != 0
  ------------------
  |  Branch (892:11): [True: 23.9k, False: 5.91k]
  ------------------
  893|  23.9k|			    && datasize >= 1) {
  ------------------
  |  Branch (893:11): [True: 23.2k, False: 748]
  ------------------
  894|  23.2k|				bitmap_last = p[offset];
  895|  23.2k|				offset += 1;
  896|  23.2k|				datasize -= 1;
  897|  23.2k|			}
  898|       |
  899|  6.66k|			if (bitmap & 1) {
  ------------------
  |  Branch (899:8): [True: 5.78k, False: 881]
  ------------------
  900|       |				/* 2 byte "version made by" */
  901|  5.78k|				if (datasize < 2)
  ------------------
  |  Branch (901:9): [True: 752, False: 5.03k]
  ------------------
  902|    752|					break;
  903|  5.03k|				zip_entry->system
  904|  5.03k|				    = archive_le16dec(p + offset) >> 8;
  905|  5.03k|				offset += 2;
  906|  5.03k|				datasize -= 2;
  907|  5.03k|			}
  908|  5.91k|			if (bitmap & 2) {
  ------------------
  |  Branch (908:8): [True: 5.30k, False: 603]
  ------------------
  909|       |				/* 2 byte "internal file attributes" */
  910|  5.30k|				uint32_t internal_attributes;
  911|  5.30k|				if (datasize < 2)
  ------------------
  |  Branch (911:9): [True: 602, False: 4.70k]
  ------------------
  912|    602|					break;
  913|  4.70k|				internal_attributes
  914|  4.70k|				    = archive_le16dec(p + offset);
  915|       |				/* Not used by libarchive at present. */
  916|  4.70k|				(void)internal_attributes; /* UNUSED */
  917|  4.70k|				offset += 2;
  918|  4.70k|				datasize -= 2;
  919|  4.70k|			}
  920|  5.30k|			if (bitmap & 4) {
  ------------------
  |  Branch (920:8): [True: 4.99k, False: 310]
  ------------------
  921|       |				/* 4 byte "external file attributes" */
  922|  4.99k|				uint32_t external_attributes;
  923|  4.99k|				if (datasize < 4)
  ------------------
  |  Branch (923:9): [True: 208, False: 4.79k]
  ------------------
  924|    208|					break;
  925|  4.79k|				external_attributes
  926|  4.79k|				    = archive_le32dec(p + offset);
  927|  4.79k|				if (zip_entry->system == 3) {
  ------------------
  |  Branch (927:9): [True: 2.48k, False: 2.31k]
  ------------------
  928|  2.48k|					zip_entry->mode
  929|  2.48k|					    = external_attributes >> 16;
  930|  2.48k|				} else if (zip_entry->system == 0) {
  ------------------
  |  Branch (930:16): [True: 1.48k, False: 830]
  ------------------
  931|       |					// Interpret MSDOS directory bit
  932|  1.48k|					if (0x10 == (external_attributes &
  ------------------
  |  Branch (932:10): [True: 1.17k, False: 310]
  ------------------
  933|  1.48k|					    0x10)) {
  934|  1.17k|						zip_entry->mode =
  935|  1.17k|						    AE_IFDIR | 0775;
  ------------------
  |  |  221|  1.17k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  936|  1.17k|					} else {
  937|    310|						zip_entry->mode =
  938|    310|						    AE_IFREG | 0664;
  ------------------
  |  |  216|    310|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  939|    310|					}
  940|  1.48k|					if (0x01 == (external_attributes &
  ------------------
  |  Branch (940:10): [True: 257, False: 1.22k]
  ------------------
  941|  1.48k|					    0x01)) {
  942|       |						/* Read-only bit;
  943|       |						 * strip write permissions */
  944|    257|						zip_entry->mode &= 0555;
  945|    257|					}
  946|  1.48k|				} else {
  947|    830|					zip_entry->mode = 0;
  948|    830|				}
  949|  4.79k|				offset += 4;
  950|  4.79k|				datasize -= 4;
  951|  4.79k|			}
  952|  5.10k|			if (bitmap & 8) {
  ------------------
  |  Branch (952:8): [True: 4.09k, False: 1.00k]
  ------------------
  953|       |				/* 2 byte comment length + comment */
  954|  4.09k|				uint32_t comment_length;
  955|  4.09k|				if (datasize < 2)
  ------------------
  |  Branch (955:9): [True: 3.27k, False: 824]
  ------------------
  956|  3.27k|					break;
  957|    824|				comment_length
  958|    824|				    = archive_le16dec(p + offset);
  959|    824|				offset += 2;
  960|    824|				datasize -= 2;
  961|       |
  962|    824|				if (datasize < comment_length)
  ------------------
  |  Branch (962:9): [True: 783, False: 41]
  ------------------
  963|    783|					break;
  964|       |				/* Comment is not supported by libarchive */
  965|     41|				offset += comment_length;
  966|     41|				datasize -= comment_length;
  967|     41|			}
  968|  1.04k|			break;
  969|  5.10k|		}
  970|  1.04k|		case 0x7075:
  ------------------
  |  Branch (970:3): [True: 118, False: 17.7k]
  ------------------
  971|    118|		{
  972|       |			/* Info-ZIP Unicode Path Extra Field. */
  973|    118|			if (datasize < 5 || entry == NULL)
  ------------------
  |  Branch (973:8): [True: 82, False: 36]
  |  Branch (973:24): [True: 0, False: 36]
  ------------------
  974|     82|				break;
  975|     36|			offset += 5;
  976|     36|			datasize -= 5;
  977|       |
  978|       |			/* The path name in this field is always encoded
  979|       |			 * in UTF-8. */
  980|     36|			if (zip->sconv_utf8 == NULL) {
  ------------------
  |  Branch (980:8): [True: 0, False: 36]
  ------------------
  981|      0|				zip->sconv_utf8 =
  982|      0|					archive_string_conversion_from_charset(
  983|      0|					&a->archive, "UTF-8", 1);
  984|       |				/* If the converter from UTF-8 is not
  985|       |				 * available, then the path name from the main
  986|       |				 * field will more likely be correct. */
  987|      0|				if (zip->sconv_utf8 == NULL)
  ------------------
  |  Branch (987:9): [True: 0, False: 0]
  ------------------
  988|      0|					break;
  989|      0|			}
  990|       |
  991|       |			/* Make sure the CRC32 of the filename matches. */
  992|     36|			if (!zip->ignore_crc32) {
  ------------------
  |  Branch (992:8): [True: 0, False: 36]
  ------------------
  993|      0|				const char *cp = archive_entry_pathname(entry);
  994|      0|				if (cp) {
  ------------------
  |  Branch (994:9): [True: 0, False: 0]
  ------------------
  995|      0|					unsigned long file_crc =
  996|      0|					    zip->crc32func(0, cp, strlen(cp));
  997|      0|					unsigned long utf_crc =
  998|      0|					    archive_le32dec(p + offset - 4);
  999|      0|					if (file_crc != utf_crc) {
  ------------------
  |  Branch (999:10): [True: 0, False: 0]
  ------------------
 1000|       |#ifdef DEBUG
 1001|       |						fprintf(stderr,
 1002|       |						    "CRC filename mismatch; "
 1003|       |						    "CDE is %lx, but UTF8 "
 1004|       |						    "is outdated with %lx\n",
 1005|       |						    file_crc, utf_crc);
 1006|       |#endif
 1007|      0|						break;
 1008|      0|					}
 1009|      0|				}
 1010|      0|			}
 1011|       |
 1012|     36|			if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|     36|#define archive_entry_copy_pathname_l	_archive_entry_copy_pathname_l
  ------------------
  |  Branch (1012:8): [True: 1, False: 35]
  ------------------
 1013|     36|			    p + offset, datasize, zip->sconv_utf8) != 0) {
 1014|       |				/* Ignore the error, and fallback to the path
 1015|       |				 * name from the main field. */
 1016|       |#ifdef DEBUG
 1017|       |				fprintf(stderr, "Failed to read the ZIP "
 1018|       |				    "0x7075 extra field path.\n");
 1019|       |#endif
 1020|      1|			}
 1021|     36|			break;
 1022|     36|		}
 1023|    340|		case 0x7855:
  ------------------
  |  Branch (1023:3): [True: 340, False: 17.5k]
  ------------------
 1024|       |			/* Info-ZIP Unix Extra Field (type 2) "Ux". */
 1025|       |#ifdef DEBUG
 1026|       |			fprintf(stderr, "uid %d gid %d\n",
 1027|       |			    archive_le16dec(p + offset),
 1028|       |			    archive_le16dec(p + offset + 2));
 1029|       |#endif
 1030|    340|			if (datasize >= 2)
  ------------------
  |  Branch (1030:8): [True: 114, False: 226]
  ------------------
 1031|    114|				zip_entry->uid = archive_le16dec(p + offset);
 1032|    340|			if (datasize >= 4)
  ------------------
  |  Branch (1032:8): [True: 76, False: 264]
  ------------------
 1033|     76|				zip_entry->gid =
 1034|     76|				    archive_le16dec(p + offset + 2);
 1035|    340|			break;
 1036|  2.34k|		case 0x7875:
  ------------------
  |  Branch (1036:3): [True: 2.34k, False: 15.5k]
  ------------------
 1037|  2.34k|		{
 1038|       |			/* Info-Zip Unix Extra Field (type 3) "ux". */
 1039|  2.34k|			int uidsize = 0, gidsize = 0;
 1040|       |
 1041|       |			/* TODO: support arbitrary uidsize/gidsize. */
 1042|  2.34k|			if (datasize >= 1 && p[offset] == 1) {/* version=1 */
  ------------------
  |  Branch (1042:8): [True: 2.29k, False: 57]
  |  Branch (1042:25): [True: 2.07k, False: 215]
  ------------------
 1043|  2.07k|				if (datasize >= 4) {
  ------------------
  |  Branch (1043:9): [True: 1.77k, False: 306]
  ------------------
 1044|       |					/* get a uid size. */
 1045|  1.77k|					uidsize = 0xff & (int)p[offset+1];
 1046|  1.77k|					if (uidsize == 2)
  ------------------
  |  Branch (1046:10): [True: 1, False: 1.77k]
  ------------------
 1047|      1|						zip_entry->uid =
 1048|      1|						    archive_le16dec(
 1049|      1|						        p + offset + 2);
 1050|  1.77k|					else if (uidsize == 4 && datasize >= 6)
  ------------------
  |  Branch (1050:15): [True: 1.35k, False: 412]
  |  Branch (1050:31): [True: 1.35k, False: 0]
  ------------------
 1051|  1.35k|						zip_entry->uid =
 1052|  1.35k|						    archive_le32dec(
 1053|  1.35k|						        p + offset + 2);
 1054|  1.77k|				}
 1055|  2.07k|				if (datasize >= (2 + uidsize + 3)) {
  ------------------
  |  Branch (1055:9): [True: 1.59k, False: 487]
  ------------------
 1056|       |					/* get a gid size. */
 1057|  1.59k|					gidsize = 0xff &
 1058|  1.59k|					    (int)p[offset+2+uidsize];
 1059|  1.59k|					if (gidsize == 2)
  ------------------
  |  Branch (1059:10): [True: 57, False: 1.53k]
  ------------------
 1060|     57|						zip_entry->gid =
 1061|     57|						    archive_le16dec(
 1062|     57|						        p+offset+2+uidsize+1);
 1063|  1.53k|					else if (gidsize == 4 &&
  ------------------
  |  Branch (1063:15): [True: 1.07k, False: 463]
  ------------------
 1064|  1.07k|					    datasize >= (2 + uidsize + 5))
  ------------------
  |  Branch (1064:10): [True: 493, False: 577]
  ------------------
 1065|    493|						zip_entry->gid =
 1066|    493|						    archive_le32dec(
 1067|    493|						        p+offset+2+uidsize+1);
 1068|  1.59k|				}
 1069|  2.07k|			}
 1070|  2.34k|			break;
 1071|     36|		}
 1072|  2.99k|		case 0x9901:
  ------------------
  |  Branch (1072:3): [True: 2.99k, False: 14.9k]
  ------------------
 1073|       |			/* WinZip AES extra data field. */
 1074|  2.99k|			if (datasize < 6) {
  ------------------
  |  Branch (1074:8): [True: 0, False: 2.99k]
  ------------------
 1075|      0|				archive_set_error(&a->archive,
 1076|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1077|      0|				    "Incomplete AES field");
 1078|      0|				return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1079|      0|			}
 1080|  2.99k|			if (p[offset + 2] == 'A' && p[offset + 3] == 'E') {
  ------------------
  |  Branch (1080:8): [True: 2.94k, False: 46]
  |  Branch (1080:32): [True: 2.77k, False: 173]
  ------------------
 1081|       |				/* Vendor version. */
 1082|  2.77k|				zip_entry->aes_extra.vendor =
 1083|  2.77k|				    archive_le16dec(p + offset);
 1084|       |				/* AES encryption strength. */
 1085|  2.77k|				zip_entry->aes_extra.strength = p[offset + 4];
 1086|       |				/* Actual compression method. */
 1087|  2.77k|				zip_entry->aes_extra.compression =
 1088|  2.77k|				    p[offset + 5];
 1089|  2.77k|			}
 1090|  2.99k|			break;
 1091|  2.63k|		default:
  ------------------
  |  Branch (1091:3): [True: 2.63k, False: 15.2k]
  ------------------
 1092|  2.63k|			break;
 1093|  17.8k|		}
 1094|  17.8k|		offset += datasize;
 1095|  17.8k|	}
 1096|  12.9k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  12.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1097|  12.9k|}
archive_read_support_format_zip.c:zip_read_data_deflate:
 2890|  4.12k|{
 2891|  4.12k|	struct zip *zip;
 2892|  4.12k|	ssize_t bytes_avail, to_consume = 0;
 2893|  4.12k|	const void *compressed_buff;
 2894|  4.12k|	const void *sp;
 2895|  4.12k|	int r;
 2896|       |
 2897|  4.12k|	(void)offset; /* UNUSED */
 2898|       |
 2899|  4.12k|	zip = (struct zip *)(a->format->data);
 2900|       |
 2901|       |	/* If the buffer hasn't been allocated, allocate it now. */
 2902|  4.12k|	if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (2902:6): [True: 75, False: 4.05k]
  ------------------
 2903|     75|		zip->uncompressed_buffer_size = 256 * 1024;
 2904|     75|		zip->uncompressed_buffer
 2905|     75|		    = malloc(zip->uncompressed_buffer_size);
 2906|     75|		if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (2906:7): [True: 0, False: 75]
  ------------------
 2907|      0|			archive_set_error(&a->archive, ENOMEM,
 2908|      0|			    "No memory for ZIP decompression");
 2909|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2910|      0|		}
 2911|     75|	}
 2912|       |
 2913|  4.12k|	r = zip_deflate_init(a, zip);
 2914|  4.12k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  4.12k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2914:6): [True: 0, False: 4.12k]
  ------------------
 2915|      0|		return (r);
 2916|       |
 2917|       |	/*
 2918|       |	 * Note: '1' here is a performance optimization.
 2919|       |	 * Recall that the decompression layer returns a count of
 2920|       |	 * available bytes; asking for more than that forces the
 2921|       |	 * decompressor to combine reads by copying data.
 2922|       |	 */
 2923|  4.12k|	compressed_buff = sp = __archive_read_ahead(a, 1, &bytes_avail);
 2924|  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 (2924:6): [True: 1.05k, False: 3.07k]
  ------------------
 2925|  1.05k|	    && bytes_avail > zip->entry_bytes_remaining) {
  ------------------
  |  Branch (2925:9): [True: 302, False: 757]
  ------------------
 2926|    302|		bytes_avail = (ssize_t)zip->entry_bytes_remaining;
 2927|    302|	}
 2928|  4.12k|	if (bytes_avail < 0) {
  ------------------
  |  Branch (2928:6): [True: 0, False: 4.12k]
  ------------------
 2929|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2930|      0|		    "Truncated ZIP file body");
 2931|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2932|      0|	}
 2933|       |
 2934|  4.12k|	zip_read_decrypt(zip, compressed_buff, bytes_avail,
 2935|  4.12k|					 &compressed_buff, &bytes_avail, &sp);
 2936|       |
 2937|       |	/*
 2938|       |	 * A bug in zlib.h: stream.next_in should be marked 'const'
 2939|       |	 * but isn't (the library never alters data through the
 2940|       |	 * next_in pointer, only reads it).  The result: this ugly
 2941|       |	 * cast to remove 'const'.
 2942|       |	 */
 2943|  4.12k|	zip->stream.next_in = (Bytef *)(uintptr_t)(const void *)compressed_buff;
 2944|  4.12k|	zip->stream.avail_in = (uInt)bytes_avail;
 2945|  4.12k|	zip->stream.total_in = 0;
 2946|  4.12k|	zip->stream.next_out = zip->uncompressed_buffer;
 2947|  4.12k|	zip->stream.avail_out = (uInt)zip->uncompressed_buffer_size;
 2948|  4.12k|	zip->stream.total_out = 0;
 2949|       |
 2950|  4.12k|	r = inflate(&zip->stream, 0);
 2951|  4.12k|	switch (r) {
 2952|    125|	case Z_OK:
  ------------------
  |  Branch (2952:2): [True: 125, False: 4.00k]
  ------------------
 2953|    125|		break;
 2954|  3.99k|	case Z_STREAM_END:
  ------------------
  |  Branch (2954:2): [True: 3.99k, False: 132]
  ------------------
 2955|  3.99k|		zip->end_of_entry = 1;
 2956|  3.99k|		break;
 2957|      0|	case Z_MEM_ERROR:
  ------------------
  |  Branch (2957:2): [True: 0, False: 4.12k]
  ------------------
 2958|      0|		archive_set_error(&a->archive, ENOMEM,
 2959|      0|		    "Out of memory for ZIP decompression");
 2960|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2961|      7|	default:
  ------------------
  |  Branch (2961:2): [True: 7, False: 4.12k]
  ------------------
 2962|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      7|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2963|      7|		    "ZIP decompression failed (%d)", r);
 2964|      7|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2965|  4.12k|	}
 2966|       |
 2967|       |	/* Consume as much as the compressor actually used. */
 2968|  4.12k|	to_consume = zip->stream.total_in;
 2969|  4.12k|	__archive_read_consume(a, to_consume);
 2970|  4.12k|	zip->entry_bytes_remaining -= to_consume;
 2971|  4.12k|	zip->entry_compressed_bytes_read += to_consume;
 2972|  4.12k|	zip->entry_uncompressed_bytes_read += zip->stream.total_out;
 2973|       |
 2974|  4.12k|	zip_read_decrypt_update(zip, to_consume, sp);
 2975|       |
 2976|  4.12k|	if (zip->end_of_entry && zip->hctx_valid) {
  ------------------
  |  Branch (2976:6): [True: 3.99k, False: 125]
  |  Branch (2976:27): [True: 2.16k, False: 1.82k]
  ------------------
 2977|  2.16k|		r = check_authentication_code(a, NULL);
 2978|  2.16k|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|  2.16k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2978:7): [True: 875, False: 1.29k]
  ------------------
 2979|    875|			return r;
 2980|    875|		}
 2981|  2.16k|	}
 2982|       |
 2983|  3.24k|	*size = zip->stream.total_out;
 2984|  3.24k|	*buff = zip->uncompressed_buffer;
 2985|       |
 2986|  3.24k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.24k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2987|  4.12k|}
archive_read_support_format_zip.c:zip_deflate_init:
 2864|  4.12k|{
 2865|  4.12k|	int r;
 2866|       |
 2867|       |	/* If we haven't yet read any data, initialize the decompressor. */
 2868|  4.12k|	if (!zip->decompress_init) {
  ------------------
  |  Branch (2868:6): [True: 4.00k, False: 125]
  ------------------
 2869|  4.00k|		if (zip->stream_valid)
  ------------------
  |  Branch (2869:7): [True: 3.89k, False: 105]
  ------------------
 2870|  3.89k|			r = inflateReset(&zip->stream);
 2871|    105|		else
 2872|    105|			r = inflateInit2(&zip->stream,
 2873|  4.00k|			    -15 /* Don't check for zlib header */);
 2874|  4.00k|		if (r != Z_OK) {
  ------------------
  |  Branch (2874:7): [True: 0, False: 4.00k]
  ------------------
 2875|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2876|      0|			    "Can't initialize ZIP decompression");
 2877|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2878|      0|		}
 2879|       |		/* Stream structure has been set up. */
 2880|  4.00k|		zip->stream_valid = 1;
 2881|       |		/* We've initialized decompression for this stream. */
 2882|  4.00k|		zip->decompress_init = 1;
 2883|  4.00k|	}
 2884|  4.12k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.12k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2885|  4.12k|}
archive_read_support_format_zip.c:zip_read_decrypt:
  489|  4.63k|{
  490|  4.63k|	*sp = compressed_buff;
  491|       |
  492|       |	/* Safety check to prevent potential OOB reads if something went wrong
  493|       |	 * previously. We should not have a negative bytes_avail count here.
  494|       |	 * If we do, set them to zero so that reading the ZIP will fail later,
  495|       |	 * safely as corrupted instead of crashing. */
  496|  4.63k|	if (bytes_avail < 0)
  ------------------
  |  Branch (496:6): [True: 0, False: 4.63k]
  ------------------
  497|      0|		bytes_avail = 0;
  498|       |
  499|  4.63k|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (499:6): [True: 386, False: 4.24k]
  |  Branch (499:25): [True: 2.16k, False: 2.07k]
  ------------------
  500|  2.55k|		if (zip->decrypted_bytes_remaining < (size_t)bytes_avail) {
  ------------------
  |  Branch (500:7): [True: 2.55k, False: 0]
  ------------------
  501|  2.55k|			size_t buff_remaining =
  502|  2.55k|			    (zip->decrypted_buffer +
  503|  2.55k|			    zip->decrypted_buffer_size)
  504|  2.55k|			    - (zip->decrypted_ptr +
  505|  2.55k|			    zip->decrypted_bytes_remaining);
  506|       |			/* The new bytes to decrypt start after decrypted_bytes_remaining
  507|       |			 * in the raw stream: those leading bytes were already
  508|       |			 * decrypted on a previous call but have not yet been consumed. */
  509|  2.55k|			size_t new_bytes =
  510|  2.55k|			    (size_t)bytes_avail
  511|  2.55k|			    - zip->decrypted_bytes_remaining;
  512|       |
  513|  2.55k|			if (buff_remaining > new_bytes)
  ------------------
  |  Branch (513:8): [True: 2.44k, False: 109]
  ------------------
  514|  2.44k|				buff_remaining = new_bytes;
  515|       |
  516|  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 (516:8): [True: 502, False: 2.05k]
  ------------------
  517|    502|			      zip->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (517:10): [True: 502, False: 0]
  ------------------
  518|    502|				if ((int64_t)(zip->decrypted_bytes_remaining
  ------------------
  |  Branch (518:9): [True: 0, False: 502]
  ------------------
  519|    502|				    + buff_remaining)
  520|    502|				      > zip->entry_bytes_remaining) {
  521|      0|					if (zip->entry_bytes_remaining <
  ------------------
  |  Branch (521:10): [True: 0, False: 0]
  ------------------
  522|      0|					    (int64_t)zip->decrypted_bytes_remaining)
  523|      0|						buff_remaining = 0;
  524|      0|					else
  525|      0|						buff_remaining =
  526|      0|						    (size_t)zip->entry_bytes_remaining
  527|      0|						    - zip->decrypted_bytes_remaining;
  528|      0|				}
  529|    502|			}
  530|  2.55k|			if (buff_remaining > 0) {
  ------------------
  |  Branch (530:8): [True: 2.55k, False: 0]
  ------------------
  531|  2.55k|				if (zip->tctx_valid) {
  ------------------
  |  Branch (531:9): [True: 386, False: 2.16k]
  ------------------
  532|    386|					trad_enc_decrypt_update(&zip->tctx,
  533|    386|					    (const uint8_t *)compressed_buff
  534|    386|					      + zip->decrypted_bytes_remaining,
  535|    386|					    buff_remaining,
  536|    386|					    zip->decrypted_ptr
  537|    386|					      + zip->decrypted_bytes_remaining,
  538|    386|					    buff_remaining);
  539|  2.16k|				} else {
  540|  2.16k|					size_t dsize = buff_remaining;
  541|  2.16k|					archive_decrypto_aes_ctr_update(
  ------------------
  |  |  164|  2.16k|  __archive_cryptor.decrypto_aes_ctr_update(ctx, in, in_len, out, out_len)
  ------------------
  542|  2.16k|					    &zip->cctx,
  543|  2.16k|					    (const uint8_t *)compressed_buff
  544|  2.16k|					      + zip->decrypted_bytes_remaining,
  545|  2.16k|					    buff_remaining,
  546|  2.16k|					    zip->decrypted_ptr
  547|  2.16k|					      + zip->decrypted_bytes_remaining,
  548|  2.16k|					    &dsize);
  549|  2.16k|				}
  550|  2.55k|				zip->decrypted_bytes_remaining +=
  551|  2.55k|				    buff_remaining;
  552|  2.55k|			}
  553|  2.55k|		}
  554|  2.55k|		*result_avail = zip->decrypted_bytes_remaining;
  555|  2.55k|		*result_buff = (const char *)zip->decrypted_ptr;
  556|  2.55k|	} else {
  557|  2.07k|		*result_buff = compressed_buff;
  558|  2.07k|		*result_avail = bytes_avail;
  559|  2.07k|	}
  560|  4.63k|}
archive_read_support_format_zip.c:trad_enc_decrypt_update:
  359|  3.32k|{
  360|  3.32k|	unsigned i, max;
  361|       |
  362|  3.32k|	max = (unsigned)((in_len < out_len)? in_len: out_len);
  ------------------
  |  Branch (362:19): [True: 0, False: 3.32k]
  ------------------
  363|       |
  364|  4.41M|	for (i = 0; i < max; i++) {
  ------------------
  |  Branch (364:14): [True: 4.41M, False: 3.32k]
  ------------------
  365|  4.41M|		uint8_t t = in[i] ^ trad_enc_decrypt_byte(ctx);
  366|  4.41M|		out[i] = t;
  367|  4.41M|		trad_enc_update_keys(ctx, t);
  368|  4.41M|	}
  369|  3.32k|}
archive_read_support_format_zip.c:trad_enc_decrypt_byte:
  351|  4.41M|{
  352|  4.41M|	unsigned temp = ctx->keys[2] | 2;
  353|  4.41M|	return (uint8_t)((temp * (temp ^ 1)) >> 8) & 0xff;
  354|  4.41M|}
archive_read_support_format_zip.c:trad_enc_update_keys:
  338|  4.42M|{
  339|  4.42M|	uint8_t t;
  340|  4.42M|#define CRC32(c, b) (crc32(c ^ 0xffffffffUL, &b, 1) ^ 0xffffffffUL)
  341|       |
  342|  4.42M|	ctx->keys[0] = CRC32(ctx->keys[0], c);
  ------------------
  |  |  340|  4.42M|#define CRC32(c, b) (crc32(c ^ 0xffffffffUL, &b, 1) ^ 0xffffffffUL)
  ------------------
  343|  4.42M|	ctx->keys[1] = (ctx->keys[1] + (ctx->keys[0] & 0xff)) * 134775813L + 1;
  344|  4.42M|	t = (ctx->keys[1] >> 24) & 0xff;
  345|  4.42M|	ctx->keys[2] = CRC32(ctx->keys[2], t);
  ------------------
  |  |  340|  4.42M|#define CRC32(c, b) (crc32(c ^ 0xffffffffUL, &b, 1) ^ 0xffffffffUL)
  ------------------
  346|  4.42M|#undef CRC32
  347|  4.42M|}
archive_read_support_format_zip.c:zip_read_decrypt_update:
  567|  4.61k|{
  568|  4.61k|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (568:6): [True: 386, False: 4.22k]
  |  Branch (568:25): [True: 2.16k, False: 2.06k]
  ------------------
  569|  2.55k|		zip->decrypted_bytes_remaining -= to_consume;
  570|  2.55k|		if (zip->decrypted_bytes_remaining == 0)
  ------------------
  |  Branch (570:7): [True: 109, False: 2.44k]
  ------------------
  571|    109|			zip->decrypted_ptr = zip->decrypted_buffer;
  572|  2.44k|		else
  573|  2.44k|			zip->decrypted_ptr += to_consume;
  574|  2.55k|	}
  575|  4.61k|	if (zip->hctx_valid)
  ------------------
  |  Branch (575:6): [True: 2.16k, False: 2.44k]
  ------------------
  576|  2.16k|		archive_hmac_sha1_update(&zip->hctx, sp, to_consume);
  ------------------
  |  |  101|  2.16k|	__archive_hmac.__hmac_sha1_update(ctx, data, data_len)
  ------------------
  577|  4.61k|}
archive_read_support_format_zip.c:check_authentication_code:
 1485|  2.24k|{
 1486|  2.24k|	struct zip *zip = (struct zip *)(a->format->data);
 1487|       |
 1488|       |	/* Check authentication code. */
 1489|  2.24k|	if (zip->hctx_valid) {
  ------------------
  |  Branch (1489:6): [True: 2.24k, False: 0]
  ------------------
 1490|  2.24k|		const void *p;
 1491|  2.24k|		uint8_t hmac[20];
 1492|  2.24k|		size_t hmac_len = 20;
 1493|  2.24k|		int cmp;
 1494|       |
 1495|  2.24k|		archive_hmac_sha1_final(&zip->hctx, hmac, &hmac_len);
  ------------------
  |  |  103|  2.24k|  	__archive_hmac.__hmac_sha1_final(ctx, out, out_len)
  ------------------
 1496|  2.24k|		if (_p == NULL) {
  ------------------
  |  Branch (1496:7): [True: 2.16k, False: 81]
  ------------------
 1497|       |			/* Read authentication code. */
 1498|  2.16k|			p = __archive_read_ahead(a, AUTH_CODE_SIZE, NULL);
  ------------------
  |  |  146|  2.16k|#define AUTH_CODE_SIZE	10
  ------------------
 1499|  2.16k|			if (p == NULL) {
  ------------------
  |  Branch (1499:8): [True: 0, False: 2.16k]
  ------------------
 1500|      0|				archive_set_error(&a->archive,
 1501|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1502|      0|				    "Truncated ZIP file data");
 1503|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1504|      0|			}
 1505|  2.16k|		} else {
 1506|     81|			p = _p;
 1507|     81|		}
 1508|  2.24k|		cmp = memcmp(hmac, p, AUTH_CODE_SIZE);
  ------------------
  |  |  146|  2.24k|#define AUTH_CODE_SIZE	10
  ------------------
 1509|  2.24k|		__archive_read_consume(a, AUTH_CODE_SIZE);
  ------------------
  |  |  146|  2.24k|#define AUTH_CODE_SIZE	10
  ------------------
 1510|  2.24k|		if (cmp != 0) {
  ------------------
  |  Branch (1510:7): [True: 956, False: 1.29k]
  ------------------
 1511|    956|			archive_set_error(&a->archive,
 1512|    956|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    956|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1513|    956|			    "ZIP bad Authentication code");
 1514|    956|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|    956|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1515|    956|		}
 1516|  2.24k|	}
 1517|  1.29k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.29k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1518|  2.24k|}
archive_read_support_format_zip.c:zip_read_data_zipx_lzma_alone:
 2228|    502|{
 2229|    502|	struct zip* zip = (struct zip *)(a->format->data);
 2230|    502|	int ret;
 2231|    502|	lzma_ret lz_ret;
 2232|    502|	const void* compressed_buf;
 2233|    502|	const void* sp;
 2234|    502|	ssize_t bytes_avail, to_consume;
 2235|       |
 2236|    502|	(void) offset; /* UNUSED */
 2237|       |
 2238|       |	/* Initialize decompressor if not yet initialized. */
 2239|    502|	if (!zip->decompress_init) {
  ------------------
  |  Branch (2239:6): [True: 423, False: 79]
  ------------------
 2240|    423|		ret = zipx_lzma_alone_init(a, zip);
 2241|    423|		if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|    423|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2241:7): [True: 1, False: 422]
  ------------------
 2242|      1|			return (ret);
 2243|    423|	}
 2244|       |
 2245|       |	/* Fetch more compressed data. The same note as in deflate handler
 2246|       |	 * applies here as well:
 2247|       |	 *
 2248|       |	 * Note: '1' here is a performance optimization. Recall that the
 2249|       |	 * decompression layer returns a count of available bytes; asking for
 2250|       |	 * more than that forces the decompressor to combine reads by copying
 2251|       |	 * data.
 2252|       |	 */
 2253|    501|	compressed_buf = __archive_read_ahead(a, 1, &bytes_avail);
 2254|    501|	if (zip->entry_bytes_remaining > 0
  ------------------
  |  Branch (2254:6): [True: 484, False: 17]
  ------------------
 2255|    484|		&& bytes_avail > zip->entry_bytes_remaining) {
  ------------------
  |  Branch (2255:6): [True: 413, False: 71]
  ------------------
 2256|    413|		bytes_avail = (ssize_t)zip->entry_bytes_remaining;
 2257|    413|	}
 2258|    501|	if (bytes_avail < 0) {
  ------------------
  |  Branch (2258:6): [True: 0, False: 501]
  ------------------
 2259|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2260|      0|		    "Truncated lzma file body");
 2261|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2262|      0|	}
 2263|       |
 2264|    501|	zip_read_decrypt(zip, compressed_buf, bytes_avail,
 2265|    501|	    &compressed_buf, &bytes_avail, &sp);
 2266|       |
 2267|    501|	zip->zipx_lzma_stream.next_in = compressed_buf;
 2268|    501|	zip->zipx_lzma_stream.avail_in = bytes_avail;
 2269|    501|	zip->zipx_lzma_stream.total_in = 0;
 2270|    501|	zip->zipx_lzma_stream.next_out = zip->uncompressed_buffer;
 2271|       |	/* These lzma_alone streams lack an end of stream marker in some
 2272|       |	 * cases, so when the uncompressed size is known we cap avail_out to
 2273|       |	 * make sure the unpacker won't try to unpack more than it's supposed
 2274|       |	 * to.  When the compressed size is unknown (entry_bytes_remaining <= 0,
 2275|       |	 * e.g. ZIP_LENGTH_AT_END from a non-seekable source) we must use the
 2276|       |	 * full buffer and rely on the LZMA stream end marker to detect the end
 2277|       |	 * of the entry. */
 2278|    501|	if (zip->entry_bytes_remaining <= 0) {
  ------------------
  |  Branch (2278:6): [True: 17, False: 484]
  ------------------
 2279|     17|		zip->zipx_lzma_stream.avail_out = zip->uncompressed_buffer_size;
 2280|    484|	} else {
 2281|    484|		zip->zipx_lzma_stream.avail_out =
 2282|    484|			(size_t)zipmin((int64_t) zip->uncompressed_buffer_size,
  ------------------
  |  |  260|    484|#define	zipmin(a,b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (260:22): [True: 210, False: 274]
  |  |  ------------------
  ------------------
 2283|    484|			    zip->entry->uncompressed_size -
 2284|    484|			    zip->entry_uncompressed_bytes_read);
 2285|    484|	}
 2286|    501|	zip->zipx_lzma_stream.total_out = 0;
 2287|       |
 2288|       |	/* Perform the decompression. */
 2289|    501|	lz_ret = lzma_code(&zip->zipx_lzma_stream, LZMA_RUN);
 2290|    501|	switch(lz_ret) {
 2291|      0|		case LZMA_DATA_ERROR:
  ------------------
  |  Branch (2291:3): [True: 0, False: 501]
  ------------------
 2292|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2293|      0|			    "lzma data error (%d)", (int) lz_ret);
 2294|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2295|       |
 2296|       |		/* This case is optional in lzma alone format. It can happen,
 2297|       |		 * but most of the files don't have it. (GitHub #1257) */
 2298|    191|		case LZMA_STREAM_END:
  ------------------
  |  Branch (2298:3): [True: 191, False: 310]
  ------------------
 2299|       |			/* This assertion is only possible if the size of the
 2300|       |			 * compressed data stream is known. */
 2301|    191|			if((int64_t) zip->zipx_lzma_stream.total_in !=
  ------------------
  |  Branch (2301:7): [True: 0, False: 191]
  ------------------
 2302|    191|			    zip->entry_bytes_remaining
 2303|      0|			    && zip->entry_bytes_remaining > 0)
  ------------------
  |  Branch (2303:11): [True: 0, False: 0]
  ------------------
 2304|      0|			{
 2305|      0|				archive_set_error(&a->archive,
 2306|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2307|      0|				    "lzma alone premature end of stream");
 2308|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2309|      0|			}
 2310|       |
 2311|    191|			zip->end_of_entry = 1;
 2312|    191|			break;
 2313|       |
 2314|    301|		case LZMA_OK:
  ------------------
  |  Branch (2314:3): [True: 301, False: 200]
  ------------------
 2315|    301|			break;
 2316|       |
 2317|      9|		case LZMA_BUF_ERROR:
  ------------------
  |  Branch (2317:3): [True: 9, False: 492]
  ------------------
 2318|      9|			if (zip->zipx_lzma_stream.avail_out == 0) {
  ------------------
  |  Branch (2318:8): [True: 1, False: 8]
  ------------------
 2319|       |				/* The output buffer was filled exactly.  When
 2320|       |				 * the uncompressed size is known this means we
 2321|       |				 * have decompressed all expected bytes.  When
 2322|       |				 * the size is unknown a full buffer just means
 2323|       |				 * we need another iteration. */
 2324|      1|				if (zip->entry_bytes_remaining > 0)
  ------------------
  |  Branch (2324:9): [True: 1, False: 0]
  ------------------
 2325|      1|					zip->end_of_entry = 1;
 2326|      1|				break;
 2327|      1|			}
 2328|       |			/* FALL THROUGH */
 2329|      8|		default:
  ------------------
  |  Branch (2329:3): [True: 0, False: 501]
  ------------------
 2330|      8|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      8|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2331|      8|			    "lzma unknown error (%d)", (int) lz_ret);
 2332|      8|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2333|    501|	}
 2334|       |
 2335|    493|	to_consume = (ssize_t)zip->zipx_lzma_stream.total_in;
 2336|       |
 2337|       |	/* Update pointers. */
 2338|    493|	__archive_read_consume(a, to_consume);
 2339|    493|	zip->entry_compressed_bytes_read += to_consume;
 2340|    493|	zip->entry_uncompressed_bytes_read += zip->zipx_lzma_stream.total_out;
 2341|       |
 2342|    493|	zip_read_decrypt_update(zip, to_consume, sp);
 2343|       |
 2344|    493|	if(zip->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (2344:5): [True: 477, False: 16]
  ------------------
 2345|    477|		zip->entry_bytes_remaining -= to_consume;
 2346|    477|		if(zip->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (2346:6): [True: 413, False: 64]
  ------------------
 2347|    413|			zip->end_of_entry = 1;
 2348|    413|		}
 2349|    477|	}
 2350|       |
 2351|    493|	if(zip->end_of_entry && zip->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (2351:5): [True: 414, False: 79]
  |  Branch (2351:26): [True: 1, False: 413]
  ------------------
 2352|      1|		ssize_t remaining = (ssize_t)zip->entry_bytes_remaining;
 2353|      1|		const void *p = __archive_read_ahead(a, remaining, NULL);
 2354|      1|		if (p != NULL) {
  ------------------
  |  Branch (2354:7): [True: 0, False: 1]
  ------------------
 2355|      0|			if (zip->hctx_valid)
  ------------------
  |  Branch (2355:8): [True: 0, False: 0]
  ------------------
 2356|      0|				archive_hmac_sha1_update(&zip->hctx,
  ------------------
  |  |  101|      0|	__archive_hmac.__hmac_sha1_update(ctx, data, data_len)
  ------------------
 2357|      0|				    p, remaining);
 2358|      0|			__archive_read_consume(a, remaining);
 2359|      0|			zip->entry_compressed_bytes_read += remaining;
 2360|      0|			zip->entry_bytes_remaining = 0;
 2361|      0|		}
 2362|      1|	}
 2363|       |
 2364|       |	/* Free lzma decoder handle because we'll no longer need it. */
 2365|       |	/* This cannot be folded into LZMA_STREAM_END handling above
 2366|       |	 * because the stream end marker is not required in this format. */
 2367|    493|	if(zip->end_of_entry) {
  ------------------
  |  Branch (2367:5): [True: 414, False: 79]
  ------------------
 2368|    414|		lzma_end(&zip->zipx_lzma_stream);
 2369|    414|		zip->zipx_lzma_valid = 0;
 2370|       |
 2371|    414|		if (zip->hctx_valid) {
  ------------------
  |  Branch (2371:7): [True: 0, False: 414]
  ------------------
 2372|      0|			ret = check_authentication_code(a, NULL);
 2373|      0|			if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2373:8): [True: 0, False: 0]
  ------------------
 2374|      0|				return ret;
 2375|      0|		}
 2376|    414|	}
 2377|       |
 2378|       |	/* Return values. */
 2379|    493|	*size = (size_t)zip->zipx_lzma_stream.total_out;
 2380|    493|	*buff = zip->uncompressed_buffer;
 2381|       |
 2382|       |	/* If we're here, then we're good! */
 2383|    493|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    493|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2384|    493|}
archive_read_support_format_zip.c:zipx_lzma_alone_init:
 1961|    423|{
 1962|    423|	lzma_ret r;
 1963|    423|	const uint8_t* p;
 1964|       |
 1965|    423|#pragma pack(push)
 1966|    423|#pragma pack(1)
 1967|    423|	struct _alone_header {
 1968|    423|	    uint8_t bytes[5];
 1969|    423|	    uint64_t uncompressed_size;
 1970|    423|	} alone_header;
 1971|    423|#pragma pack(pop)
 1972|       |
 1973|    423|	if(zip->zipx_lzma_valid) {
  ------------------
  |  Branch (1973:5): [True: 0, False: 423]
  ------------------
 1974|      0|		lzma_end(&zip->zipx_lzma_stream);
 1975|      0|		zip->zipx_lzma_valid = 0;
 1976|      0|	}
 1977|       |
 1978|       |	/* To unpack ZIPX's "LZMA" (id 14) stream we can use standard liblzma
 1979|       |	 * that is a part of XZ Utils. The stream format stored inside ZIPX
 1980|       |	 * file is a modified "lzma alone" file format, that was used by the
 1981|       |	 * `lzma` utility which was later deprecated in favour of `xz` utility.
 1982|       | 	 * Since those formats are nearly the same, we can use a standard
 1983|       |	 * "lzma alone" decoder from XZ Utils. */
 1984|       |
 1985|    423|	memset(&zip->zipx_lzma_stream, 0, sizeof(zip->zipx_lzma_stream));
 1986|    423|	r = lzma_alone_decoder(&zip->zipx_lzma_stream, 576 * ((uint64_t)1 << 20));
 1987|    423|	if (r != LZMA_OK) {
  ------------------
  |  Branch (1987:6): [True: 0, False: 423]
  ------------------
 1988|      0|		archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1989|      0|		    "lzma initialization failed (%d)", r);
 1990|       |
 1991|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1992|      0|	}
 1993|       |
 1994|       |	/* Flag the cleanup function that we want our lzma-related structures
 1995|       |	 * to be freed later. */
 1996|    423|	zip->zipx_lzma_valid = 1;
 1997|       |
 1998|       |	/* The "lzma alone" file format and the stream format inside ZIPx are
 1999|       |	 * almost the same. Here's an example of a structure of "lzma alone"
 2000|       |	 * format:
 2001|       |	 *
 2002|       |	 * $ cat /bin/ls | lzma | xxd | head -n 1
 2003|       |	 * 00000000: 5d00 0080 00ff ffff ffff ffff ff00 2814
 2004|       |	 *
 2005|       |	 *    5 bytes        8 bytes        n bytes
 2006|       |	 * <lzma_params><uncompressed_size><data...>
 2007|       |	 *
 2008|       |	 * lzma_params is a 5-byte blob that has to be decoded to extract
 2009|       |	 * parameters of this LZMA stream. The uncompressed_size field is an
 2010|       |	 * uint64_t value that contains information about the size of the
 2011|       |	 * uncompressed file, or UINT64_MAX if this value is unknown.
 2012|       |	 * The <data...> part is the actual lzma-compressed data stream.
 2013|       |	 *
 2014|       |	 * Now here's the structure of the stream inside the ZIPX file:
 2015|       |	 *
 2016|       |	 * $ cat stream_inside_zipx | xxd | head -n 1
 2017|       |	 * 00000000: 0914 0500 5d00 8000 0000 2814 .... ....
 2018|       |	 *
 2019|       |	 *  2byte   2byte    5 bytes     n bytes
 2020|       |	 * <magic1><magic2><lzma_params><data...>
 2021|       |	 *
 2022|       |	 * This means that the ZIPX file contains an additional magic1 and
 2023|       |	 * magic2 headers, the lzma_params field contains the same parameter
 2024|       |	 * set as in the "lzma alone" format, and the <data...> field is the
 2025|       |	 * same as in the "lzma alone" format as well. Note that also the zipx
 2026|       |	 * format is missing the uncompressed_size field.
 2027|       |	 *
 2028|       |	 * So, in order to use the "lzma alone" decoder for the zipx lzma
 2029|       |	 * stream, we simply need to shuffle around some fields, prepare a new
 2030|       |	 * lzma alone header, feed it into lzma alone decoder so it will
 2031|       |	 * initialize itself properly, and then we can start feeding normal
 2032|       |	 * zipx lzma stream into the decoder.
 2033|       |	 */
 2034|       |
 2035|       |	/* Read magic1,magic2,lzma_params from the ZIPX stream. */
 2036|       |	/* When the compressed size is unknown (e.g. ZIP_LENGTH_AT_END read
 2037|       |	 * from a non-seekable source), entry_bytes_remaining is 0 or negative
 2038|       |	 * here.  We can still attempt to read the 9-byte header; if the data
 2039|       |	 * is truly truncated, the __archive_read_ahead calls below will catch
 2040|       |	 * it. */
 2041|    423|	if(zip->entry_bytes_remaining > 0
  ------------------
  |  Branch (2041:5): [True: 422, False: 1]
  ------------------
 2042|    422|		&& zip->entry_bytes_remaining < 9) {
  ------------------
  |  Branch (2042:6): [True: 0, False: 422]
  ------------------
 2043|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2044|      0|		    "Truncated lzma data");
 2045|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2046|      0|	}
 2047|       |
 2048|    423|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (2048:6): [True: 0, False: 423]
  |  Branch (2048:25): [True: 0, False: 423]
  ------------------
 2049|      0|		const void *decrypted;
 2050|      0|		size_t out_len;
 2051|      0|		size_t consumed;
 2052|      0|		int ret;
 2053|       |
 2054|      0|		ret = zipx_read_header_and_decrypt(a, &decrypted, 9, &out_len, &consumed);
 2055|      0|		if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2055:7): [True: 0, False: 0]
  ------------------
 2056|      0|			return ret;
 2057|      0|		p = decrypted;
 2058|    423|	} else {
 2059|    423|		p = __archive_read_ahead(a, 9, NULL);
 2060|    423|		if (p == NULL) {
  ------------------
  |  Branch (2060:7): [True: 0, False: 423]
  ------------------
 2061|      0|			archive_set_error(&a->archive,
 2062|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2063|      0|			    "Truncated lzma data");
 2064|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2065|      0|		}
 2066|    423|	}
 2067|       |
 2068|    423|	if(p[2] != 0x05 || p[3] != 0x00) {
  ------------------
  |  Branch (2068:5): [True: 1, False: 422]
  |  Branch (2068:21): [True: 0, False: 422]
  ------------------
 2069|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2070|      1|		    "Invalid lzma data");
 2071|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2072|      1|	}
 2073|       |
 2074|       |	/* Prepare an lzma alone header: copy the lzma_params blob into
 2075|       |	 * a proper place into the lzma alone header. */
 2076|    422|	memcpy(&alone_header.bytes[0], p + 4, 5);
 2077|       |
 2078|       |	/* Initialize the 'uncompressed size' field to unknown; we'll manually
 2079|       |	 * monitor how many bytes there are still to be uncompressed. */
 2080|    422|	alone_header.uncompressed_size = UINT64_MAX;
 2081|       |
 2082|    422|	if(!zip->uncompressed_buffer) {
  ------------------
  |  Branch (2082:5): [True: 15, False: 407]
  ------------------
 2083|     15|		zip->uncompressed_buffer_size = 256 * 1024;
 2084|     15|		zip->uncompressed_buffer = malloc(zip->uncompressed_buffer_size);
 2085|       |
 2086|     15|		if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (2086:7): [True: 0, False: 15]
  ------------------
 2087|      0|			archive_set_error(&a->archive, ENOMEM,
 2088|      0|			    "No memory for lzma decompression");
 2089|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2090|      0|		}
 2091|     15|	}
 2092|       |
 2093|    422|	zip->zipx_lzma_stream.next_in = (void*) &alone_header;
 2094|    422|	zip->zipx_lzma_stream.avail_in = sizeof(alone_header);
 2095|    422|	zip->zipx_lzma_stream.total_in = 0;
 2096|    422|	zip->zipx_lzma_stream.next_out = zip->uncompressed_buffer;
 2097|    422|	zip->zipx_lzma_stream.avail_out = zip->uncompressed_buffer_size;
 2098|    422|	zip->zipx_lzma_stream.total_out = 0;
 2099|       |
 2100|       |	/* Feed only the header into the lzma alone decoder. This will
 2101|       |	 * effectively initialize the decoder, and will not produce any
 2102|       |	 * output bytes yet. */
 2103|    422|	r = lzma_code(&zip->zipx_lzma_stream, LZMA_RUN);
 2104|    422|	if (r != LZMA_OK) {
  ------------------
  |  Branch (2104:6): [True: 0, False: 422]
  ------------------
 2105|      0|		if (r == LZMA_MEMLIMIT_ERROR)
  ------------------
  |  Branch (2105:7): [True: 0, False: 0]
  ------------------
 2106|      0|			archive_set_error(&a->archive, ENOMEM,
 2107|      0|			    "lzma stream requires too much memory");
 2108|      0|		else
 2109|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 2110|      0|			    "lzma stream initialization error");
 2111|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2112|      0|	}
 2113|       |
 2114|       |	/* We've already consumed some bytes, so take this into account. */
 2115|    422|	__archive_read_consume(a, 9);
 2116|    422|	zip->entry_compressed_bytes_read += 9;
 2117|    422|	if (zip->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (2117:6): [True: 421, False: 1]
  ------------------
 2118|    421|		zip->entry_bytes_remaining -= 9;
 2119|    421|	}
 2120|       |
 2121|    422|	zip->decompress_init = 1;
 2122|    422|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    422|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2123|    422|}
archive_read_support_format_zip.c:compression_name:
  637|  39.3k|{
  638|  39.3k|	static const int num_compression_methods =
  639|  39.3k|		sizeof(compression_methods)/sizeof(compression_methods[0]);
  640|  39.3k|	int i=0;
  641|       |
  642|   708k|	while(compression >= 0 && i < num_compression_methods) {
  ------------------
  |  Branch (642:8): [True: 708k, False: 0]
  |  Branch (642:28): [True: 705k, False: 2.40k]
  ------------------
  643|   705k|		if (compression_methods[i].id == compression)
  ------------------
  |  Branch (643:7): [True: 36.9k, False: 669k]
  ------------------
  644|  36.9k|			return compression_methods[i].name;
  645|   669k|		i++;
  646|   669k|	}
  647|  2.40k|	return "??";
  648|  39.3k|}
archive_read_support_format_zip.c:zip_entry_size_is_set:
  265|  48.2k|{
  266|  48.2k|	return (0 == (zip_entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  128|  48.2k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (266:10): [True: 20.6k, False: 27.6k]
  ------------------
  267|  27.6k|	    || (zip_entry->uncompressed_size > 0
  ------------------
  |  Branch (267:10): [True: 17.2k, False: 10.3k]
  ------------------
  268|  17.2k|		&& zip_entry->uncompressed_size != 0xffffffff));
  ------------------
  |  Branch (268:6): [True: 17.2k, False: 14]
  ------------------
  269|  48.2k|}
archive_read_support_format_zip.c:archive_read_format_zip_read_data:
 3371|  44.8k|{
 3372|  44.8k|	int r;
 3373|  44.8k|	struct zip *zip = (struct zip *)(a->format->data);
 3374|       |
 3375|  44.8k|	if (zip->has_encrypted_entries ==
  ------------------
  |  Branch (3375:6): [True: 0, False: 44.8k]
  ------------------
 3376|  44.8k|			ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|  44.8k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 3377|      0|		zip->has_encrypted_entries = 0;
 3378|      0|	}
 3379|       |
 3380|  44.8k|	*offset = zip->entry_uncompressed_bytes_read;
 3381|  44.8k|	*size = 0;
 3382|  44.8k|	*buff = NULL;
 3383|       |
 3384|       |	/* If we hit end-of-entry last time, return ARCHIVE_EOF. */
 3385|  44.8k|	if (zip->end_of_entry)
  ------------------
  |  Branch (3385:6): [True: 10.0k, False: 34.8k]
  ------------------
 3386|  10.0k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  10.0k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3387|       |
 3388|       |	/* Return EOF immediately if this is a non-regular file. */
 3389|  34.8k|	if (AE_IFREG != (zip->entry->mode & AE_IFMT))
  ------------------
  |  |  216|  34.8k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
              	if (AE_IFREG != (zip->entry->mode & AE_IFMT))
  ------------------
  |  |  215|  34.8k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  |  Branch (3389:6): [True: 2.11k, False: 32.7k]
  ------------------
 3390|  2.11k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  2.11k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3391|       |
 3392|  32.7k|	__archive_read_consume(a, zip->unconsumed);
 3393|  32.7k|	zip->unconsumed = 0;
 3394|       |
 3395|  32.7k|	if (zip->init_decryption) {
  ------------------
  |  Branch (3395:6): [True: 6.22k, False: 26.5k]
  ------------------
 3396|  6.22k|		zip->has_encrypted_entries = 1;
 3397|  6.22k|		if (zip->entry->zip_flags & ZIP_STRONG_ENCRYPTED)
  ------------------
  |  |  129|  6.22k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
  |  Branch (3397:7): [True: 1.34k, False: 4.87k]
  ------------------
 3398|  1.34k|			r = read_decryption_header(a);
 3399|  4.87k|		else if (zip->entry->compression == WINZIP_AES_ENCRYPTION)
  ------------------
  |  |  144|  4.87k|#define WINZIP_AES_ENCRYPTION	99
  ------------------
  |  Branch (3399:12): [True: 2.77k, False: 2.09k]
  ------------------
 3400|  2.77k|			r = init_WinZip_AES_decryption(a);
 3401|  2.09k|		else
 3402|  2.09k|			r = init_traditional_PKWARE_decryption(a);
 3403|  6.22k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  6.22k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3403:7): [True: 3.46k, False: 2.75k]
  ------------------
 3404|  3.46k|			return (r);
 3405|  2.75k|		zip->init_decryption = 0;
 3406|  2.75k|	}
 3407|       |
 3408|  29.2k|	switch(zip->entry->compression) {
 3409|  5.54k|	case 0:  /* No compression. */
  ------------------
  |  Branch (3409:2): [True: 5.54k, False: 23.7k]
  ------------------
 3410|  5.54k|		r =  zip_read_data_none(a, buff, size, offset);
 3411|  5.54k|		break;
 3412|      0|#ifdef HAVE_BZLIB_H
 3413|      0|	case 12: /* ZIPx bzip2 compression. */
  ------------------
  |  Branch (3413:2): [True: 0, False: 29.2k]
  ------------------
 3414|      0|		r = zip_read_data_zipx_bzip2(a, buff, size, offset);
 3415|      0|		break;
 3416|      0|#endif
 3417|      0|#if HAVE_LZMA_H && HAVE_LIBLZMA
 3418|    502|	case 14: /* ZIPx LZMA compression. */
  ------------------
  |  Branch (3418:2): [True: 502, False: 28.7k]
  ------------------
 3419|    502|		r = zip_read_data_zipx_lzma_alone(a, buff, size, offset);
 3420|    502|		break;
 3421|      0|	case 95: /* ZIPx XZ compression. */
  ------------------
  |  Branch (3421:2): [True: 0, False: 29.2k]
  ------------------
 3422|      0|		r = zip_read_data_zipx_xz(a, buff, size, offset);
 3423|      0|		break;
 3424|      0|#endif
 3425|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 3426|       |	case 93: /* ZIPx Zstd compression. */
 3427|       |		r = zip_read_data_zipx_zstd(a, buff, size, offset);
 3428|       |		break;
 3429|       |#endif
 3430|       |	/* PPMd support is built-in, so we don't need any #if guards. */
 3431|  14.3k|	case 98: /* ZIPx PPMd compression. */
  ------------------
  |  Branch (3431:2): [True: 14.3k, False: 14.9k]
  ------------------
 3432|  14.3k|		r = zip_read_data_zipx_ppmd(a, buff, size, offset);
 3433|  14.3k|		break;
 3434|       |
 3435|      0|#ifdef HAVE_ZLIB_H
 3436|  4.12k|	case 8: /* Deflate compression. */
  ------------------
  |  Branch (3436:2): [True: 4.12k, False: 25.1k]
  ------------------
 3437|  4.12k|		r =  zip_read_data_deflate(a, buff, size, offset);
 3438|  4.12k|		break;
 3439|      0|#endif
 3440|  4.74k|	default: /* Unsupported compression. */
  ------------------
  |  Branch (3440:2): [True: 4.74k, False: 24.5k]
  ------------------
 3441|       |		/* Return a warning. */
 3442|  4.74k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  4.74k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3443|  4.74k|		    "Unsupported ZIP compression method (%d: %s)",
 3444|  4.74k|		    zip->entry->compression, compression_name(zip->entry->compression));
 3445|       |		/* We can't decompress this entry, but we will
 3446|       |		 * be able to skip() it and try the next entry. */
 3447|  4.74k|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  4.74k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3448|  29.2k|	}
 3449|  24.5k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  24.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3449:6): [True: 4.27k, False: 20.2k]
  ------------------
 3450|  4.27k|		return (r);
 3451|       |
 3452|       |	/*
 3453|       |	 * FAIL if there are more uncompressed bytes than were
 3454|       |	 * initially advertised.  The end-of-entry check below also
 3455|       |	 * compares these values, but only once decoding reaches its
 3456|       |	 * own natural end. Fail the entry so a caller relying on
 3457|       |	 * archive_entry_size() as a hard boundary is never misled;
 3458|       |	 * later entries in the archive can still be read normally.
 3459|       |	 */
 3460|  20.2k|	if (*size > 0 && zip_entry_size_is_set(zip->entry) &&
  ------------------
  |  Branch (3460:6): [True: 15.0k, False: 5.20k]
  |  Branch (3460:19): [True: 11.6k, False: 3.41k]
  ------------------
 3461|  11.6k|	    zip->entry_uncompressed_bytes_read > zip->entry->uncompressed_size) {
  ------------------
  |  Branch (3461:6): [True: 85, False: 11.5k]
  ------------------
 3462|     85|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     85|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3463|     85|		    "ZIP uncompressed data is larger than the declared "
 3464|     85|		    "entry size (read at least %jd, expected %jd)",
 3465|     85|		    (intmax_t)zip->entry_uncompressed_bytes_read,
 3466|     85|		    (intmax_t)zip->entry->uncompressed_size);
 3467|     85|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     85|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3468|     85|	}
 3469|       |
 3470|  20.1k|	if (*size > 0) {
  ------------------
  |  Branch (3470:6): [True: 14.9k, False: 5.20k]
  ------------------
 3471|  14.9k|		zip->computed_crc32 = zip->crc32func(zip->computed_crc32, *buff,
 3472|  14.9k|						     (unsigned)*size);
 3473|  14.9k|	}
 3474|       |	/* If we hit the end, swallow any end-of-data marker and
 3475|       |	 * verify the final check values. */
 3476|  20.1k|	if (zip->end_of_entry) {
  ------------------
  |  Branch (3476:6): [True: 17.4k, False: 2.73k]
  ------------------
 3477|  17.4k|		consume_end_of_file_marker(a, zip);
 3478|       |
 3479|       |		/* Check computed CRC against header */
 3480|  17.4k|		if ((!zip->hctx_valid ||
  ------------------
  |  Branch (3480:8): [True: 16.1k, False: 1.29k]
  ------------------
 3481|  1.29k|		      zip->entry->aes_extra.vendor != AES_VENDOR_AE_2) &&
  ------------------
  |  |  113|  1.29k|#define AES_VENDOR_AE_2	0x0002
  ------------------
  |  Branch (3481:9): [True: 1.29k, False: 0]
  ------------------
 3482|  17.4k|		   zip->entry->crc32 != zip->computed_crc32
  ------------------
  |  Branch (3482:6): [True: 16.2k, False: 1.16k]
  ------------------
 3483|  16.2k|		    && !zip->ignore_crc32) {
  ------------------
  |  Branch (3483:10): [True: 0, False: 16.2k]
  ------------------
 3484|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3485|      0|			    "ZIP bad CRC: 0x%lx should be 0x%lx",
 3486|      0|			    (unsigned long)zip->computed_crc32,
 3487|      0|			    (unsigned long)zip->entry->crc32);
 3488|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3489|      0|		}
 3490|       |		/* Check file size against header. */
 3491|  17.4k|		if (zip->entry->compressed_size !=
  ------------------
  |  Branch (3491:7): [True: 10.7k, False: 6.71k]
  ------------------
 3492|  17.4k|		    zip->entry_compressed_bytes_read) {
 3493|  10.7k|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  10.7k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3494|  10.7k|			    "ZIP compressed data is wrong size "
 3495|  10.7k|			    "(read %jd, expected %jd)",
 3496|  10.7k|			    (intmax_t)zip->entry_compressed_bytes_read,
 3497|  10.7k|			    (intmax_t)zip->entry->compressed_size);
 3498|  10.7k|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  10.7k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3499|  10.7k|		}
 3500|  6.71k|		if (zip->entry->uncompressed_size !=
  ------------------
  |  Branch (3500:7): [True: 2.46k, False: 4.24k]
  ------------------
 3501|  6.71k|		    zip->entry_uncompressed_bytes_read) {
 3502|  2.46k|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  2.46k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3503|  2.46k|			    "ZIP uncompressed data is wrong size "
 3504|  2.46k|			    "(read %jd, expected %jd)",
 3505|  2.46k|			    (intmax_t)zip->entry_uncompressed_bytes_read,
 3506|  2.46k|			    (intmax_t)zip->entry->uncompressed_size);
 3507|  2.46k|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  2.46k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3508|  2.46k|		}
 3509|  6.71k|	}
 3510|       |
 3511|  6.97k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  6.97k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3512|  20.1k|}
archive_read_support_format_zip.c:read_decryption_header:
 2992|  1.45k|{
 2993|  1.45k|	struct zip *zip = (struct zip *)(a->format->data);
 2994|  1.45k|	const char *p;
 2995|  1.45k|	unsigned int remaining_size;
 2996|  1.45k|	unsigned int ts;
 2997|       |
 2998|       |	/*
 2999|       |	 * Read an initialization vector data field.
 3000|       |	 */
 3001|  1.45k|	p = __archive_read_ahead(a, 2, NULL);
 3002|  1.45k|	if (p == NULL)
  ------------------
  |  Branch (3002:6): [True: 0, False: 1.45k]
  ------------------
 3003|      0|		goto truncated;
 3004|  1.45k|	ts = zip->iv_size;
 3005|  1.45k|	zip->iv_size = archive_le16dec(p);
 3006|  1.45k|	__archive_read_consume(a, 2);
 3007|  1.45k|	if (ts < zip->iv_size) {
  ------------------
  |  Branch (3007:6): [True: 152, False: 1.29k]
  ------------------
 3008|    152|		free(zip->iv);
 3009|    152|		zip->iv = NULL;
 3010|    152|	}
 3011|  1.45k|	p = __archive_read_ahead(a, zip->iv_size, NULL);
 3012|  1.45k|	if (p == NULL)
  ------------------
  |  Branch (3012:6): [True: 0, False: 1.45k]
  ------------------
 3013|      0|		goto truncated;
 3014|  1.45k|	if (zip->iv == NULL) {
  ------------------
  |  Branch (3014:6): [True: 155, False: 1.29k]
  ------------------
 3015|    155|		zip->iv = malloc(zip->iv_size);
 3016|    155|		if (zip->iv == NULL)
  ------------------
  |  Branch (3016:7): [True: 0, False: 155]
  ------------------
 3017|      0|			goto nomem;
 3018|    155|	}
 3019|  1.45k|	memcpy(zip->iv, p, zip->iv_size);
 3020|  1.45k|	__archive_read_consume(a, zip->iv_size);
 3021|       |
 3022|       |	/*
 3023|       |	 * Read a size of remaining decryption header field.
 3024|       |	 */
 3025|  1.45k|	p = __archive_read_ahead(a, 14, NULL);
 3026|  1.45k|	if (p == NULL)
  ------------------
  |  Branch (3026:6): [True: 0, False: 1.45k]
  ------------------
 3027|      0|		goto truncated;
 3028|  1.45k|	remaining_size = archive_le32dec(p);
 3029|  1.45k|	if (remaining_size < 16 || remaining_size > (1 << 18))
  ------------------
  |  Branch (3029:6): [True: 3, False: 1.44k]
  |  Branch (3029:29): [True: 5, False: 1.44k]
  ------------------
 3030|      8|		goto corrupted;
 3031|       |
 3032|       |	/* Check if format version is supported. */
 3033|  1.44k|	if (archive_le16dec(p+4) != 3) {
  ------------------
  |  Branch (3033:6): [True: 207, False: 1.23k]
  ------------------
 3034|    207|		archive_set_error(&a->archive,
 3035|    207|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    207|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3036|    207|		    "Unsupported encryption format version: %u",
 3037|    207|		    archive_le16dec(p+4));
 3038|    207|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|    207|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3039|    207|	}
 3040|       |
 3041|       |	/*
 3042|       |	 * Read an encryption algorithm field.
 3043|       |	 */
 3044|  1.23k|	zip->alg_id = archive_le16dec(p+6);
 3045|  1.23k|	switch (zip->alg_id) {
 3046|     52|	case 0x6601:/* DES */
  ------------------
  |  Branch (3046:2): [True: 52, False: 1.18k]
  ------------------
 3047|    239|	case 0x6602:/* RC2 */
  ------------------
  |  Branch (3047:2): [True: 187, False: 1.04k]
  ------------------
 3048|    423|	case 0x6603:/* 3DES 168 */
  ------------------
  |  Branch (3048:2): [True: 184, False: 1.05k]
  ------------------
 3049|    498|	case 0x6609:/* 3DES 112 */
  ------------------
  |  Branch (3049:2): [True: 75, False: 1.16k]
  ------------------
 3050|    514|	case 0x660E:/* AES 128 */
  ------------------
  |  Branch (3050:2): [True: 16, False: 1.22k]
  ------------------
 3051|    580|	case 0x660F:/* AES 192 */
  ------------------
  |  Branch (3051:2): [True: 66, False: 1.17k]
  ------------------
 3052|    639|	case 0x6610:/* AES 256 */
  ------------------
  |  Branch (3052:2): [True: 59, False: 1.17k]
  ------------------
 3053|    657|	case 0x6702:/* RC2 (version >= 5.2) */
  ------------------
  |  Branch (3053:2): [True: 18, False: 1.21k]
  ------------------
 3054|    862|	case 0x6720:/* Blowfish */
  ------------------
  |  Branch (3054:2): [True: 205, False: 1.03k]
  ------------------
 3055|    920|	case 0x6721:/* Twofish */
  ------------------
  |  Branch (3055:2): [True: 58, False: 1.17k]
  ------------------
 3056|  1.18k|	case 0x6801:/* RC4 */
  ------------------
  |  Branch (3056:2): [True: 260, False: 976]
  ------------------
 3057|       |		/* Supported encryption algorithm. */
 3058|  1.18k|		break;
 3059|     56|	default:
  ------------------
  |  Branch (3059:2): [True: 56, False: 1.18k]
  ------------------
 3060|     56|		archive_set_error(&a->archive,
 3061|     56|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     56|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3062|     56|		    "Unknown encryption algorithm: %u", zip->alg_id);
 3063|     56|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     56|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3064|  1.23k|	}
 3065|       |
 3066|       |	/*
 3067|       |	 * Read a bit length field.
 3068|       |	 */
 3069|  1.18k|	zip->bit_len = archive_le16dec(p+8);
 3070|       |
 3071|       |	/*
 3072|       |	 * Read a flags field.
 3073|       |	 */
 3074|  1.18k|	zip->flags = archive_le16dec(p+10);
 3075|  1.18k|	switch (zip->flags & 0xf000) {
 3076|      0|	case 0x0001: /* Password is required to decrypt. */
  ------------------
  |  Branch (3076:2): [True: 0, False: 1.18k]
  ------------------
 3077|      0|	case 0x0002: /* Certificates only. */
  ------------------
  |  Branch (3077:2): [True: 0, False: 1.18k]
  ------------------
 3078|      0|	case 0x0003: /* Password or certificate required to decrypt. */
  ------------------
  |  Branch (3078:2): [True: 0, False: 1.18k]
  ------------------
 3079|      0|		break;
 3080|  1.18k|	default:
  ------------------
  |  Branch (3080:2): [True: 1.18k, False: 0]
  ------------------
 3081|  1.18k|		archive_set_error(&a->archive,
 3082|  1.18k|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.18k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3083|  1.18k|		    "Unknown encryption flag: %u", zip->flags);
 3084|  1.18k|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  1.18k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3085|  1.18k|	}
 3086|      0|	if ((zip->flags & 0xf000) == 0 ||
  ------------------
  |  Branch (3086:6): [True: 0, False: 0]
  ------------------
 3087|      0|	    (zip->flags & 0xf000) == 0x4000) {
  ------------------
  |  Branch (3087:6): [True: 0, False: 0]
  ------------------
 3088|      0|		archive_set_error(&a->archive,
 3089|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3090|      0|		    "Unknown encryption flag: %u", zip->flags);
 3091|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3092|      0|	}
 3093|       |
 3094|       |	/*
 3095|       |	 * Read an encrypted random data field.
 3096|       |	 */
 3097|      0|	ts = zip->erd_size;
 3098|      0|	zip->erd_size = archive_le16dec(p+12);
 3099|      0|	__archive_read_consume(a, 14);
 3100|      0|	if ((zip->erd_size & 0xf) != 0 ||
  ------------------
  |  Branch (3100:6): [True: 0, False: 0]
  ------------------
 3101|      0|	    (zip->erd_size + 16) > remaining_size ||
  ------------------
  |  Branch (3101:6): [True: 0, False: 0]
  ------------------
 3102|      0|	    (zip->erd_size + 16) < zip->erd_size)
  ------------------
  |  Branch (3102:6): [True: 0, False: 0]
  ------------------
 3103|      0|		goto corrupted;
 3104|       |
 3105|      0|	if (ts < zip->erd_size) {
  ------------------
  |  Branch (3105:6): [True: 0, False: 0]
  ------------------
 3106|      0|		free(zip->erd);
 3107|      0|		zip->erd = NULL;
 3108|      0|	}
 3109|      0|	p = __archive_read_ahead(a, zip->erd_size, NULL);
 3110|      0|	if (p == NULL)
  ------------------
  |  Branch (3110:6): [True: 0, False: 0]
  ------------------
 3111|      0|		goto truncated;
 3112|      0|	if (zip->erd == NULL) {
  ------------------
  |  Branch (3112:6): [True: 0, False: 0]
  ------------------
 3113|      0|		zip->erd = malloc(zip->erd_size);
 3114|      0|		if (zip->erd == NULL)
  ------------------
  |  Branch (3114:7): [True: 0, False: 0]
  ------------------
 3115|      0|			goto nomem;
 3116|      0|	}
 3117|      0|	memcpy(zip->erd, p, zip->erd_size);
 3118|      0|	__archive_read_consume(a, zip->erd_size);
 3119|       |
 3120|       |	/*
 3121|       |	 * Read a reserved data field.
 3122|       |	 */
 3123|      0|	p = __archive_read_ahead(a, 4, NULL);
 3124|      0|	if (p == NULL)
  ------------------
  |  Branch (3124:6): [True: 0, False: 0]
  ------------------
 3125|      0|		goto truncated;
 3126|       |	/* Reserved data size should be zero. */
 3127|      0|	if (archive_le32dec(p) != 0)
  ------------------
  |  Branch (3127:6): [True: 0, False: 0]
  ------------------
 3128|      0|		goto corrupted;
 3129|      0|	__archive_read_consume(a, 4);
 3130|       |
 3131|       |	/*
 3132|       |	 * Read a password validation data field.
 3133|       |	 */
 3134|      0|	p = __archive_read_ahead(a, 2, NULL);
 3135|      0|	if (p == NULL)
  ------------------
  |  Branch (3135:6): [True: 0, False: 0]
  ------------------
 3136|      0|		goto truncated;
 3137|      0|	ts = zip->v_size;
 3138|      0|	zip->v_size = archive_le16dec(p);
 3139|      0|	__archive_read_consume(a, 2);
 3140|      0|	if ((zip->v_size & 0x0f) != 0 ||
  ------------------
  |  Branch (3140:6): [True: 0, False: 0]
  ------------------
 3141|      0|	    (zip->erd_size + zip->v_size + 16) > remaining_size ||
  ------------------
  |  Branch (3141:6): [True: 0, False: 0]
  ------------------
 3142|      0|	    (zip->erd_size + zip->v_size + 16) < (zip->erd_size + zip->v_size))
  ------------------
  |  Branch (3142:6): [True: 0, False: 0]
  ------------------
 3143|      0|		goto corrupted;
 3144|      0|	if (ts < zip->v_size) {
  ------------------
  |  Branch (3144:6): [True: 0, False: 0]
  ------------------
 3145|      0|		free(zip->v_data);
 3146|      0|		zip->v_data = NULL;
 3147|      0|	}
 3148|      0|	p = __archive_read_ahead(a, zip->v_size, NULL);
 3149|      0|	if (p == NULL)
  ------------------
  |  Branch (3149:6): [True: 0, False: 0]
  ------------------
 3150|      0|		goto truncated;
 3151|      0|	if (zip->v_data == NULL) {
  ------------------
  |  Branch (3151:6): [True: 0, False: 0]
  ------------------
 3152|      0|		zip->v_data = malloc(zip->v_size);
 3153|      0|		if (zip->v_data == NULL)
  ------------------
  |  Branch (3153:7): [True: 0, False: 0]
  ------------------
 3154|      0|			goto nomem;
 3155|      0|	}
 3156|      0|	memcpy(zip->v_data, p, zip->v_size);
 3157|      0|	__archive_read_consume(a, zip->v_size);
 3158|       |
 3159|      0|	p = __archive_read_ahead(a, 4, NULL);
 3160|      0|	if (p == NULL)
  ------------------
  |  Branch (3160:6): [True: 0, False: 0]
  ------------------
 3161|      0|		goto truncated;
 3162|      0|	zip->v_crc32 = archive_le32dec(p);
 3163|      0|	__archive_read_consume(a, 4);
 3164|       |
 3165|       |	/*return (ARCHIVE_OK);
 3166|       |	 * This is not fully implemented yet.*/
 3167|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3168|      0|	    "Encrypted file is unsupported");
 3169|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3170|      0|truncated:
 3171|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3172|      0|	    "Truncated ZIP file data");
 3173|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3174|      8|corrupted:
 3175|      8|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      8|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3176|      8|	    "Corrupted ZIP file data");
 3177|      8|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3178|      0|nomem:
 3179|      0|	archive_set_error(&a->archive, ENOMEM,
 3180|      0|	    "No memory for ZIP decryption");
 3181|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3182|      0|}
archive_read_support_format_zip.c:init_WinZip_AES_decryption:
 3277|  2.87k|{
 3278|  2.87k|	struct zip *zip = (struct zip *)(a->format->data);
 3279|  2.87k|	const void *p;
 3280|  2.87k|	const uint8_t *pv;
 3281|  2.87k|	size_t key_len, salt_len;
 3282|  2.87k|	uint8_t derived_key[MAX_DERIVED_KEY_BUF_SIZE];
 3283|  2.87k|	int retry;
 3284|  2.87k|	int r;
 3285|       |
 3286|  2.87k|	if (zip->cctx_valid || zip->hctx_valid)
  ------------------
  |  Branch (3286:6): [True: 0, False: 2.87k]
  |  Branch (3286:25): [True: 0, False: 2.87k]
  ------------------
 3287|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3288|       |
 3289|  2.87k|	switch (zip->entry->aes_extra.strength) {
 3290|    267|	case 1: salt_len = 8;  key_len = 16; break;
  ------------------
  |  Branch (3290:2): [True: 267, False: 2.61k]
  ------------------
 3291|  2.30k|	case 2: salt_len = 12; key_len = 24; break;
  ------------------
  |  Branch (3291:2): [True: 2.30k, False: 576]
  ------------------
 3292|    303|	case 3: salt_len = 16; key_len = 32; break;
  ------------------
  |  Branch (3292:2): [True: 303, False: 2.57k]
  ------------------
 3293|      6|	default: goto corrupted;
  ------------------
  |  Branch (3293:2): [True: 6, False: 2.87k]
  ------------------
 3294|  2.87k|	}
 3295|  2.87k|	p = __archive_read_ahead(a, salt_len + 2, NULL);
 3296|  2.87k|	if (p == NULL)
  ------------------
  |  Branch (3296:6): [True: 0, False: 2.87k]
  ------------------
 3297|      0|		goto truncated;
 3298|       |
 3299|  3.28k|	for (retry = 0;; retry++) {
 3300|  3.28k|		const char *passphrase;
 3301|       |
 3302|  3.28k|		passphrase = __archive_read_next_passphrase(a);
 3303|  3.28k|		if (passphrase == NULL) {
  ------------------
  |  Branch (3303:7): [True: 509, False: 2.77k]
  ------------------
 3304|    509|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    509|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3305|    509|			    (retry > 0)?
  ------------------
  |  Branch (3305:8): [True: 411, False: 98]
  ------------------
 3306|    411|				"Incorrect passphrase":
 3307|    509|				"Passphrase required for this entry");
 3308|    509|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|    509|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3309|    509|		}
 3310|  2.77k|		memset(derived_key, 0, sizeof(derived_key));
 3311|  2.77k|		r = archive_pbkdf2_sha1(passphrase, strlen(passphrase),
  ------------------
  |  |  159|  2.77k|  __archive_cryptor.pbkdf2sha1(pw, pw_len, salt, salt_len, rounds, dk, dk_len)
  ------------------
 3312|  2.77k|		    p, salt_len, 1000, derived_key, key_len * 2 + 2);
 3313|  2.77k|		if (r != 0) {
  ------------------
  |  Branch (3313:7): [True: 0, False: 2.77k]
  ------------------
 3314|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3315|      0|			    r == CRYPTOR_STUB_FUNCTION ? "Decryption is unsupported due "
  ------------------
  |  |  176|      0|#define CRYPTOR_STUB_FUNCTION	-2
  ------------------
  |  Branch (3315:8): [True: 0, False: 0]
  ------------------
 3316|      0|				"to lack of crypto library" : "Failed to process passphrase");
 3317|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3318|      0|		}
 3319|       |
 3320|       |		/* Check password verification value. */
 3321|  2.77k|		pv = ((const uint8_t *)p) + salt_len;
 3322|  2.77k|		if (derived_key[key_len * 2] == pv[0] &&
  ------------------
  |  Branch (3322:7): [True: 2.61k, False: 154]
  ------------------
 3323|  2.61k|		    derived_key[key_len * 2 + 1] == pv[1])
  ------------------
  |  Branch (3323:7): [True: 2.36k, False: 257]
  ------------------
 3324|  2.36k|			break;/* The passphrase is OK. */
 3325|    411|		if (retry > 10000) {
  ------------------
  |  Branch (3325:7): [True: 0, False: 411]
  ------------------
 3326|       |			/* Avoid infinity loop. */
 3327|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3328|      0|			    "Too many incorrect passphrases");
 3329|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3330|      0|		}
 3331|    411|	}
 3332|       |
 3333|  2.36k|	r = archive_decrypto_aes_ctr_init(&zip->cctx, derived_key, key_len);
  ------------------
  |  |  162|  2.36k|  __archive_cryptor.decrypto_aes_ctr_init(ctx, key, key_len)
  ------------------
 3334|  2.36k|	if (r != 0) {
  ------------------
  |  Branch (3334:6): [True: 0, False: 2.36k]
  ------------------
 3335|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3336|      0|		    "Decryption is unsupported due to lack of crypto library");
 3337|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3338|      0|	}
 3339|  2.36k|	r = archive_hmac_sha1_init(&zip->hctx, derived_key + key_len, key_len);
  ------------------
  |  |   99|  2.36k|	__archive_hmac.__hmac_sha1_init(ctx, key, key_len)
  ------------------
 3340|  2.36k|	if (r != 0) {
  ------------------
  |  Branch (3340:6): [True: 0, False: 2.36k]
  ------------------
 3341|      0|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  166|      0|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 3342|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3343|      0|		    "Failed to initialize HMAC-SHA1");
 3344|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3345|      0|	}
 3346|  2.36k|	zip->cctx_valid = zip->hctx_valid = 1;
 3347|  2.36k|	__archive_read_consume(a, salt_len + 2);
 3348|  2.36k|	zip->entry_bytes_remaining -= salt_len + 2 + AUTH_CODE_SIZE;
  ------------------
  |  |  146|  2.36k|#define AUTH_CODE_SIZE	10
  ------------------
 3349|  2.36k|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  128|  2.36k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (3349:6): [True: 152, False: 2.21k]
  ------------------
 3350|    152|	    && zip->entry_bytes_remaining < 0)
  ------------------
  |  Branch (3350:9): [True: 0, False: 152]
  ------------------
 3351|      0|		goto corrupted;
 3352|  2.36k|	zip->entry_compressed_bytes_read += salt_len + 2 + AUTH_CODE_SIZE;
  ------------------
  |  |  146|  2.36k|#define AUTH_CODE_SIZE	10
  ------------------
 3353|  2.36k|	zip->decrypted_bytes_remaining = 0;
 3354|       |
 3355|  2.36k|	zip->entry->compression = zip->entry->aes_extra.compression;
 3356|  2.36k|	return (zip_alloc_decryption_buffer(a));
 3357|       |
 3358|      0|truncated:
 3359|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3360|      0|	    "Truncated ZIP file data");
 3361|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3362|      6|corrupted:
 3363|      6|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      6|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3364|      6|	    "Corrupted ZIP file data");
 3365|      6|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3366|  2.36k|}
archive_read_support_format_zip.c:zip_alloc_decryption_buffer:
 3186|  3.52k|{
 3187|  3.52k|	struct zip *zip = (struct zip *)(a->format->data);
 3188|  3.52k|	size_t bs = 256 * 1024;
 3189|       |
 3190|  3.52k|	if (zip->decrypted_buffer == NULL) {
  ------------------
  |  Branch (3190:6): [True: 97, False: 3.42k]
  ------------------
 3191|     97|		zip->decrypted_buffer_size = bs;
 3192|     97|		zip->decrypted_buffer = malloc(bs);
 3193|     97|		if (zip->decrypted_buffer == NULL) {
  ------------------
  |  Branch (3193:7): [True: 0, False: 97]
  ------------------
 3194|      0|			archive_set_error(&a->archive, ENOMEM,
 3195|      0|			    "No memory for ZIP decryption");
 3196|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3197|      0|		}
 3198|     97|	}
 3199|  3.52k|	zip->decrypted_ptr = zip->decrypted_buffer;
 3200|  3.52k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.52k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3201|  3.52k|}
archive_read_support_format_zip.c:init_traditional_PKWARE_decryption:
 3205|  4.23k|{
 3206|  4.23k|	struct zip *zip = (struct zip *)(a->format->data);
 3207|  4.23k|	const void *p;
 3208|  4.23k|	int retry;
 3209|  4.23k|	int r;
 3210|       |
 3211|  4.23k|	if (zip->tctx_valid)
  ------------------
  |  Branch (3211:6): [True: 0, False: 4.23k]
  ------------------
 3212|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3213|       |
 3214|       |	/*
 3215|       |	   Read the 12 bytes encryption header stored at
 3216|       |	   the start of the data area.
 3217|       |	 */
 3218|  4.23k|#define ENC_HEADER_SIZE	12
 3219|  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 (3219:6): [True: 617, False: 3.61k]
  ------------------
 3220|    617|	    && zip->entry_bytes_remaining < ENC_HEADER_SIZE) {
  ------------------
  |  | 3218|    617|#define ENC_HEADER_SIZE	12
  ------------------
  |  Branch (3220:9): [True: 0, False: 617]
  ------------------
 3221|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3222|      0|		    "Truncated Zip encrypted body: only %jd bytes available",
 3223|      0|		    (intmax_t)zip->entry_bytes_remaining);
 3224|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3225|      0|	}
 3226|       |
 3227|  4.23k|	p = __archive_read_ahead(a, ENC_HEADER_SIZE, NULL);
  ------------------
  |  | 3218|  4.23k|#define ENC_HEADER_SIZE	12
  ------------------
 3228|  4.23k|	if (p == NULL) {
  ------------------
  |  Branch (3228:6): [True: 1, False: 4.23k]
  ------------------
 3229|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3230|      1|		    "Truncated ZIP file data");
 3231|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3232|      1|	}
 3233|       |
 3234|  6.00k|	for (retry = 0;; retry++) {
 3235|  6.00k|		const char *passphrase;
 3236|  6.00k|		uint8_t crcchk;
 3237|       |
 3238|  6.00k|		passphrase = __archive_read_next_passphrase(a);
 3239|  6.00k|		if (passphrase == NULL) {
  ------------------
  |  Branch (3239:7): [True: 3.06k, False: 2.93k]
  ------------------
 3240|  3.06k|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  3.06k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3241|  3.06k|			    (retry > 0)?
  ------------------
  |  Branch (3241:8): [True: 1.77k, False: 1.29k]
  ------------------
 3242|  1.77k|				"Incorrect passphrase":
 3243|  3.06k|				"Passphrase required for this entry");
 3244|  3.06k|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  3.06k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3245|  3.06k|		}
 3246|       |
 3247|       |		/*
 3248|       |		 * Initialize ctx for Traditional PKWARE Decryption.
 3249|       |		 */
 3250|  2.93k|		r = trad_enc_init(&zip->tctx, passphrase, strlen(passphrase),
 3251|  2.93k|			p, ENC_HEADER_SIZE, &crcchk);
  ------------------
  |  | 3218|  2.93k|#define ENC_HEADER_SIZE	12
  ------------------
 3252|  2.93k|		if (r == 0 && crcchk == zip->entry->decdat)
  ------------------
  |  Branch (3252:7): [True: 2.93k, False: 0]
  |  Branch (3252:17): [True: 1.16k, False: 1.77k]
  ------------------
 3253|  1.16k|			break;/* The passphrase is OK. */
 3254|  1.77k|		if (retry > 10000) {
  ------------------
  |  Branch (3254:7): [True: 0, False: 1.77k]
  ------------------
 3255|       |			/* Avoid infinity loop. */
 3256|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3257|      0|			    "Too many incorrect passphrases");
 3258|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3259|      0|		}
 3260|  1.77k|	}
 3261|       |
 3262|  1.16k|	__archive_read_consume(a, ENC_HEADER_SIZE);
  ------------------
  |  | 3218|  1.16k|#define ENC_HEADER_SIZE	12
  ------------------
 3263|  1.16k|	zip->tctx_valid = 1;
 3264|  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 (3264:6): [True: 386, False: 777]
  ------------------
 3265|    386|	    zip->entry_bytes_remaining -= ENC_HEADER_SIZE;
  ------------------
  |  | 3218|    386|#define ENC_HEADER_SIZE	12
  ------------------
 3266|    386|	}
 3267|       |	/*zip->entry_uncompressed_bytes_read += ENC_HEADER_SIZE;*/
 3268|  1.16k|	zip->entry_compressed_bytes_read += ENC_HEADER_SIZE;
  ------------------
  |  | 3218|  1.16k|#define ENC_HEADER_SIZE	12
  ------------------
 3269|  1.16k|	zip->decrypted_bytes_remaining = 0;
 3270|       |
 3271|  1.16k|	return (zip_alloc_decryption_buffer(a));
 3272|  4.23k|#undef ENC_HEADER_SIZE
 3273|  4.23k|}
archive_read_support_format_zip.c:trad_enc_init:
  374|  2.93k|{
  375|  2.93k|	uint8_t header[12];
  376|       |
  377|  2.93k|	if (key_len < 12) {
  ------------------
  |  Branch (377:6): [True: 0, False: 2.93k]
  ------------------
  378|      0|		*crcchk = 0xff;
  379|      0|		return -1;
  380|      0|	}
  381|       |
  382|  2.93k|	ctx->keys[0] = 305419896L;
  383|  2.93k|	ctx->keys[1] = 591751049L;
  384|  2.93k|	ctx->keys[2] = 878082192L;
  385|       |
  386|  20.5k|	for (;pw_len; --pw_len)
  ------------------
  |  Branch (386:8): [True: 17.6k, False: 2.93k]
  ------------------
  387|  17.6k|		trad_enc_update_keys(ctx, *pw++);
  388|       |
  389|  2.93k|	trad_enc_decrypt_update(ctx, key, 12, header, 12);
  390|       |	/* Return the last byte for CRC check. */
  391|  2.93k|	*crcchk = header[11];
  392|  2.93k|	return 0;
  393|  2.93k|}
archive_read_support_format_zip.c:zip_read_data_none:
 1809|  5.54k|{
 1810|  5.54k|	struct zip *zip;
 1811|  5.54k|	const char *buff;
 1812|  5.54k|	ssize_t bytes_avail;
 1813|  5.54k|	ssize_t trailing_extra;
 1814|  5.54k|	int r;
 1815|       |
 1816|  5.54k|	(void)offset; /* UNUSED */
 1817|       |
 1818|  5.54k|	zip = (struct zip *)(a->format->data);
 1819|  5.54k|	trailing_extra = zip->hctx_valid ? AUTH_CODE_SIZE : 0;
  ------------------
  |  |  146|    204|#define AUTH_CODE_SIZE	10
  ------------------
  |  Branch (1819:19): [True: 204, False: 5.34k]
  ------------------
 1820|       |
 1821|  5.54k|	if (zip->entry->zip_flags & ZIP_LENGTH_AT_END) {
  ------------------
  |  |  128|  5.54k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (1821:6): [True: 2.73k, False: 2.81k]
  ------------------
 1822|  2.73k|		const char *p;
 1823|  2.73k|		ssize_t grabbing_bytes = 24 + trailing_extra;
 1824|       |
 1825|       |		/* Grab at least 24 bytes. */
 1826|  2.73k|		buff = __archive_read_ahead(a, grabbing_bytes, &bytes_avail);
 1827|  2.73k|		if (bytes_avail < grabbing_bytes) {
  ------------------
  |  Branch (1827:7): [True: 16, False: 2.71k]
  ------------------
 1828|       |			/* Zip archives have end-of-archive markers
 1829|       |			   that are longer than this, so a failure to get at
 1830|       |			   least 24 bytes really does indicate a truncated
 1831|       |			   file. */
 1832|     16|			archive_set_error(&a->archive,
 1833|     16|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     16|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1834|     16|			    "Truncated ZIP file data");
 1835|     16|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     16|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1836|     16|		}
 1837|       |		/* Check for a complete PK\007\010 signature, followed
 1838|       |		 * by the correct 4-byte CRC. */
 1839|  2.71k|		p = buff + trailing_extra;
 1840|  2.71k|		if (p[0] == 'P' && p[1] == 'K'
  ------------------
  |  Branch (1840:7): [True: 2.11k, False: 607]
  |  Branch (1840:22): [True: 1.91k, False: 200]
  ------------------
 1841|  1.91k|		    && p[2] == '\007' && p[3] == '\010'
  ------------------
  |  Branch (1841:10): [True: 1.63k, False: 275]
  |  Branch (1841:28): [True: 1.60k, False: 35]
  ------------------
 1842|  1.60k|		    && (archive_le32dec(p + 4) == zip->computed_crc32
  ------------------
  |  Branch (1842:11): [True: 153, False: 1.44k]
  ------------------
 1843|  1.44k|			|| zip->ignore_crc32
  ------------------
  |  Branch (1843:7): [True: 1.44k, False: 0]
  ------------------
 1844|      0|			|| (zip->hctx_valid
  ------------------
  |  Branch (1844:8): [True: 0, False: 0]
  ------------------
 1845|  1.60k|			 && zip->entry->aes_extra.vendor == AES_VENDOR_AE_2))) {
  ------------------
  |  |  113|      0|#define AES_VENDOR_AE_2	0x0002
  ------------------
  |  Branch (1845:8): [True: 0, False: 0]
  ------------------
 1846|  1.60k|			zip->end_of_entry = 1;
 1847|  1.60k|			if (zip->hctx_valid) {
  ------------------
  |  Branch (1847:8): [True: 81, False: 1.52k]
  ------------------
 1848|     81|				r = check_authentication_code(a, buff);
 1849|     81|				if (r != ARCHIVE_OK)
  ------------------
  |  |  233|     81|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1849:9): [True: 81, False: 0]
  ------------------
 1850|     81|					return (r);
 1851|     81|			}
 1852|  1.52k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.52k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1853|  1.60k|		}
 1854|       |		/* If not at EOF, ensure we consume at least one byte. */
 1855|  1.11k|		++p;
 1856|       |
 1857|       |		/* Scan forward until we see where a PK\007\010 signature
 1858|       |		 * might be. */
 1859|       |		/* Return bytes up until that point.  On the next call,
 1860|       |		 * the code above will verify the data descriptor. */
 1861|  2.45M|		while (p < buff + bytes_avail - 4) {
  ------------------
  |  Branch (1861:10): [True: 2.45M, False: 212]
  ------------------
 1862|  2.45M|			if (p[3] == 'P') { p += 3; }
  ------------------
  |  Branch (1862:8): [True: 4.80k, False: 2.45M]
  ------------------
 1863|  2.45M|			else if (p[3] == 'K') { p += 2; }
  ------------------
  |  Branch (1863:13): [True: 3.28k, False: 2.45M]
  ------------------
 1864|  2.45M|			else if (p[3] == '\007') { p += 1; }
  ------------------
  |  Branch (1864:13): [True: 17.3k, False: 2.43M]
  ------------------
 1865|  2.43M|			else if (p[3] == '\010' && p[2] == '\007'
  ------------------
  |  Branch (1865:13): [True: 22.3k, False: 2.41M]
  |  Branch (1865:31): [True: 938, False: 21.4k]
  ------------------
 1866|    938|			    && p[1] == 'K' && p[0] == 'P') {
  ------------------
  |  Branch (1866:11): [True: 908, False: 30]
  |  Branch (1866:26): [True: 905, False: 3]
  ------------------
 1867|    905|				break;
 1868|  2.43M|			} else { p += 4; }
 1869|  2.45M|		}
 1870|  1.11k|		p -= trailing_extra;
 1871|  1.11k|		bytes_avail = p - buff;
 1872|  2.81k|	} else {
 1873|  2.81k|		if (zip->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (1873:7): [True: 1.34k, False: 1.46k]
  ------------------
 1874|  1.34k|			zip->end_of_entry = 1;
 1875|  1.34k|			if (zip->hctx_valid) {
  ------------------
  |  Branch (1875:8): [True: 0, False: 1.34k]
  ------------------
 1876|      0|				r = check_authentication_code(a, NULL);
 1877|      0|				if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1877:9): [True: 0, False: 0]
  ------------------
 1878|      0|					return (r);
 1879|      0|			}
 1880|  1.34k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.34k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1881|  1.34k|		}
 1882|       |		/* Grab a bunch of bytes. */
 1883|  1.46k|		buff = __archive_read_ahead(a, 1, &bytes_avail);
 1884|  1.46k|		if (bytes_avail <= 0) {
  ------------------
  |  Branch (1884:7): [True: 3, False: 1.46k]
  ------------------
 1885|      3|			archive_set_error(&a->archive,
 1886|      3|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1887|      3|			    "Truncated ZIP file data");
 1888|      3|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1889|      3|		}
 1890|  1.46k|		if (bytes_avail > zip->entry_bytes_remaining)
  ------------------
  |  Branch (1890:7): [True: 1.39k, False: 68]
  ------------------
 1891|  1.39k|			bytes_avail = (ssize_t)zip->entry_bytes_remaining;
 1892|  1.46k|	}
 1893|  2.58k|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (1893:6): [True: 7, False: 2.57k]
  |  Branch (1893:25): [True: 123, False: 2.45k]
  ------------------
 1894|    130|		size_t dec_size = bytes_avail;
 1895|       |
 1896|    130|		if (dec_size > zip->decrypted_buffer_size)
  ------------------
  |  Branch (1896:7): [True: 4, False: 126]
  ------------------
 1897|      4|			dec_size = zip->decrypted_buffer_size;
 1898|    130|		if (zip->tctx_valid) {
  ------------------
  |  Branch (1898:7): [True: 7, False: 123]
  ------------------
 1899|      7|			trad_enc_decrypt_update(&zip->tctx,
 1900|      7|			    (const uint8_t *)buff, dec_size,
 1901|      7|			    zip->decrypted_buffer, dec_size);
 1902|    123|		} else {
 1903|    123|			size_t dsize = dec_size;
 1904|    123|			archive_hmac_sha1_update(&zip->hctx,
  ------------------
  |  |  101|    123|	__archive_hmac.__hmac_sha1_update(ctx, data, data_len)
  ------------------
 1905|    123|			    (const uint8_t *)buff, dec_size);
 1906|    123|			archive_decrypto_aes_ctr_update(&zip->cctx,
  ------------------
  |  |  164|    123|  __archive_cryptor.decrypto_aes_ctr_update(ctx, in, in_len, out, out_len)
  ------------------
 1907|    123|			    (const uint8_t *)buff, dec_size,
 1908|    123|			    zip->decrypted_buffer, &dsize);
 1909|    123|		}
 1910|    130|		bytes_avail = dec_size;
 1911|    130|		buff = (const char *)zip->decrypted_buffer;
 1912|    130|	}
 1913|  2.58k|	zip->entry_bytes_remaining -= bytes_avail;
 1914|  2.58k|	zip->entry_uncompressed_bytes_read += bytes_avail;
 1915|  2.58k|	zip->entry_compressed_bytes_read += bytes_avail;
 1916|  2.58k|	zip->unconsumed += bytes_avail;
 1917|  2.58k|	*size = bytes_avail;
 1918|  2.58k|	*_buff = buff;
 1919|  2.58k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.58k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1920|  5.54k|}
archive_read_support_format_zip.c:zip_read_data_zipx_ppmd:
 2498|  14.3k|{
 2499|  14.3k|	struct zip* zip = (struct zip *)(a->format->data);
 2500|  14.3k|	int ret;
 2501|  14.3k|	size_t consumed_bytes = 0;
 2502|       |
 2503|  14.3k|	(void) offset; /* UNUSED */
 2504|       |
 2505|       |	/* If we're here for the first time, initialize Ppmd8 decompression
 2506|       |	 * context first. */
 2507|  14.3k|	if(!zip->decompress_init) {
  ------------------
  |  Branch (2507:5): [True: 14.3k, False: 6]
  ------------------
 2508|  14.3k|		ret = zipx_ppmd8_init(a, zip);
 2509|  14.3k|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  14.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2509:6): [True: 3.11k, False: 11.2k]
  ------------------
 2510|  3.11k|			return ret;
 2511|  14.3k|	}
 2512|       |
 2513|       |	/* Fetch for more data. We're reading 1 byte here, but libarchive
 2514|       |	 * should prefetch more bytes. */
 2515|  11.2k|	if(__archive_read_ahead(a, 1, NULL) == NULL) {
  ------------------
  |  Branch (2515:5): [True: 0, False: 11.2k]
  ------------------
 2516|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2517|      0|		    "Truncated PPMd8 file body");
 2518|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2519|      0|	}
 2520|       |
 2521|       |	/* This counter will be updated inside ppmd_read(), which at one
 2522|       |	 * point will be called by Ppmd8_DecodeSymbol. */
 2523|  11.2k|	zip->zipx_ppmd_read_compressed = 0;
 2524|       |
 2525|       |	/* Decompression loop. */
 2526|  66.2M|	do {
 2527|  66.2M|		int sym = __archive_ppmd8_functions.Ppmd8_DecodeSymbol(
 2528|  66.2M|		    &zip->ppmd8);
 2529|  66.2M|		if(sym < 0) {
  ------------------
  |  Branch (2529:6): [True: 11.0k, False: 66.2M]
  ------------------
 2530|  11.0k|			zip->end_of_entry = 1;
 2531|  11.0k|			break;
 2532|  11.0k|		}
 2533|       |
 2534|       |		/* This field is set by ppmd_read() when there was no more data
 2535|       |		 * to be read. */
 2536|  66.2M|		if(zip->ppmd8_stream_failed) {
  ------------------
  |  Branch (2536:6): [True: 176, False: 66.2M]
  ------------------
 2537|    176|			archive_set_error(&a->archive,
 2538|    176|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    176|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2539|    176|			    "Truncated PPMd8 file body");
 2540|    176|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    176|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2541|    176|		}
 2542|       |
 2543|  66.2M|		zip->uncompressed_buffer[consumed_bytes] = (uint8_t) sym;
 2544|  66.2M|		++consumed_bytes;
 2545|  66.2M|	} while(consumed_bytes < zip->uncompressed_buffer_size);
  ------------------
  |  Branch (2545:10): [True: 66.2M, False: 9]
  ------------------
 2546|       |
 2547|       |	/* Update pointers so we can continue decompression in another call. */
 2548|  11.0k|	zip->entry_bytes_remaining -= zip->zipx_ppmd_read_compressed;
 2549|  11.0k|	zip->entry_compressed_bytes_read += zip->zipx_ppmd_read_compressed;
 2550|  11.0k|	zip->entry_uncompressed_bytes_read += consumed_bytes;
 2551|       |
 2552|       |	/* If we're at the end of stream, deinitialize Ppmd8 context. */
 2553|  11.0k|	if(zip->end_of_entry) {
  ------------------
  |  Branch (2553:5): [True: 11.0k, False: 9]
  ------------------
 2554|  11.0k|		__archive_ppmd8_functions.Ppmd8_Free(&zip->ppmd8);
 2555|  11.0k|		zip->ppmd8_valid = 0;
 2556|       |
 2557|  11.0k|		if (zip->hctx_valid) {
  ------------------
  |  Branch (2557:7): [True: 0, False: 11.0k]
  ------------------
 2558|      0|			int r = check_authentication_code(a, NULL);
 2559|      0|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2559:8): [True: 0, False: 0]
  ------------------
 2560|      0|				return (r);
 2561|      0|		}
 2562|  11.0k|	}
 2563|       |
 2564|       |	/* Update pointers for libarchive. */
 2565|  11.0k|	*buff = zip->uncompressed_buffer;
 2566|  11.0k|	*size = consumed_bytes;
 2567|       |
 2568|  11.0k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  11.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2569|  11.0k|}
archive_read_support_format_zip.c:zipx_ppmd8_init:
 2389|  14.3k|{
 2390|  14.3k|	const void* p;
 2391|  14.3k|	uint32_t val;
 2392|  14.3k|	uint32_t order;
 2393|  14.3k|	uint32_t mem;
 2394|  14.3k|	uint32_t restore_method;
 2395|       |
 2396|       |	/* Remove previous decompression context if it exists. */
 2397|  14.3k|	if(zip->ppmd8_valid) {
  ------------------
  |  Branch (2397:5): [True: 0, False: 14.3k]
  ------------------
 2398|      0|		__archive_ppmd8_functions.Ppmd8_Free(&zip->ppmd8);
 2399|      0|		zip->ppmd8_valid = 0;
 2400|      0|	}
 2401|       |
 2402|       |	/* Create a new decompression context. */
 2403|  14.3k|	__archive_ppmd8_functions.Ppmd8_Construct(&zip->ppmd8);
 2404|  14.3k|	zip->ppmd8_stream_failed = 0;
 2405|       |
 2406|       |	/* Setup function pointers required by Ppmd8 decompressor. The
 2407|       |	 * 'ppmd_read' function will feed new bytes to the decompressor,
 2408|       |	 * and will increment the 'zip->zipx_ppmd_read_compressed' counter. */
 2409|  14.3k|	zip->ppmd8.Stream.In = &zip->zipx_ppmd_stream;
 2410|  14.3k|	zip->zipx_ppmd_stream.a = a;
 2411|  14.3k|	zip->zipx_ppmd_stream.Read = &ppmd_read;
 2412|       |
 2413|       |	/* Reset number of read bytes to 0. */
 2414|  14.3k|	zip->zipx_ppmd_read_compressed = 0;
 2415|       |
 2416|       |	/* Read Ppmd8 header (2 bytes). */
 2417|  14.3k|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (2417:6): [True: 0, False: 14.3k]
  |  Branch (2417:25): [True: 0, False: 14.3k]
  ------------------
 2418|      0|		size_t out_len;
 2419|      0|		size_t consumed;
 2420|      0|		int ret;
 2421|       |
 2422|      0|		ret = zipx_read_header_and_decrypt(a, &p, 2, &out_len, &consumed);
 2423|      0|		if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2423:7): [True: 0, False: 0]
  ------------------
 2424|      0|			return ret;
 2425|  14.3k|	} else {
 2426|  14.3k|		p = __archive_read_ahead(a, 2, NULL);
 2427|  14.3k|		if(!p) {
  ------------------
  |  Branch (2427:6): [True: 1, False: 14.3k]
  ------------------
 2428|      1|			archive_set_error(&a->archive,
 2429|      1|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2430|      1|			    "Truncated file data in PPMd8 stream");
 2431|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2432|      1|		}
 2433|  14.3k|	}
 2434|  14.3k|	__archive_read_consume(a, 2);
 2435|       |
 2436|       |	/* Decode the stream's compression parameters. */
 2437|  14.3k|	val = archive_le16dec(p);
 2438|  14.3k|	order = (val & 15) + 1;
 2439|  14.3k|	mem = ((val >> 4) & 0xff) + 1;
 2440|  14.3k|	restore_method = (val >> 12);
 2441|       |
 2442|  14.3k|	if(order < 2 || restore_method > 2) {
  ------------------
  |  Branch (2442:5): [True: 778, False: 13.5k]
  |  Branch (2442:18): [True: 2.33k, False: 11.2k]
  ------------------
 2443|  3.11k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  3.11k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2444|  3.11k|		    "Invalid parameter set in PPMd8 stream (order=%" PRIu32 ", "
 2445|  3.11k|		    "restore=%" PRIu32 ")", order, restore_method);
 2446|  3.11k|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  3.11k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2447|  3.11k|	}
 2448|       |
 2449|       |	/* Allocate the memory needed to properly decompress the file. */
 2450|  11.2k|	if(!__archive_ppmd8_functions.Ppmd8_Alloc(&zip->ppmd8, mem << 20)) {
  ------------------
  |  Branch (2450:5): [True: 0, False: 11.2k]
  ------------------
 2451|      0|		archive_set_error(&a->archive, ENOMEM,
 2452|      0|		    "Unable to allocate memory for PPMd8 stream: %" PRIu32 " bytes",
 2453|      0|		    mem << 20);
 2454|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2455|      0|	}
 2456|       |
 2457|       |	/* Signal the cleanup function to release Ppmd8 context in the
 2458|       |	 * cleanup phase. */
 2459|  11.2k|	zip->ppmd8_valid = 1;
 2460|       |
 2461|       |	/* Perform further Ppmd8 initialization. */
 2462|  11.2k|	if(!__archive_ppmd8_functions.Ppmd8_RangeDec_Init(&zip->ppmd8)) {
  ------------------
  |  Branch (2462:5): [True: 0, False: 11.2k]
  ------------------
 2463|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 2464|      0|		    "PPMd8 stream range decoder initialization error");
 2465|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2466|      0|	}
 2467|       |
 2468|  11.2k|	__archive_ppmd8_functions.Ppmd8_Init(&zip->ppmd8, order,
 2469|  11.2k|	    restore_method);
 2470|       |
 2471|       |	/* Allocate the buffer that will hold uncompressed data. */
 2472|  11.2k|	free(zip->uncompressed_buffer);
 2473|       |
 2474|  11.2k|	zip->uncompressed_buffer_size = 256 * 1024;
 2475|  11.2k|	zip->uncompressed_buffer = malloc(zip->uncompressed_buffer_size);
 2476|       |
 2477|  11.2k|	if(zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (2477:5): [True: 0, False: 11.2k]
  ------------------
 2478|      0|		archive_set_error(&a->archive, ENOMEM,
 2479|      0|		    "No memory for PPMd8 decompression");
 2480|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2481|      0|	}
 2482|       |
 2483|       |	/* Ppmd8 initialization is done. */
 2484|  11.2k|	zip->decompress_init = 1;
 2485|       |
 2486|       |	/* We've already read 2 bytes in the output stream. Additionally,
 2487|       |	 * Ppmd8 initialization code could read some data as well. So we
 2488|       |	 * are advancing the stream by 2 bytes plus whatever number of
 2489|       |	 * bytes Ppmd8 init function used. */
 2490|  11.2k|	zip->entry_compressed_bytes_read += 2 + zip->zipx_ppmd_read_compressed;
 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:ppmd_read:
  291|  11.4M|ppmd_read(void* p) {
  292|       |	/* Get the handle to current decompression context. */
  293|  11.4M|	struct archive_read *a = ((IByteIn*)p)->a;
  294|  11.4M|	struct zip *zip = (struct zip*) a->format->data;
  295|       |
  296|       |	/* Fetch next byte. */
  297|  11.4M|	const uint8_t* data = __archive_read_ahead(a, 1, NULL);
  298|  11.4M|	if(data == NULL) {
  ------------------
  |  Branch (298:5): [True: 183, False: 11.4M]
  ------------------
  299|    183|		zip->ppmd8_stream_failed = 1;
  300|    183|		return 0;
  301|    183|	}
  302|       |
  303|  11.4M|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (303:6): [True: 0, False: 11.4M]
  |  Branch (303:25): [True: 0, False: 11.4M]
  ------------------
  304|      0|		uint8_t val;
  305|      0|		if (zip->tctx_valid) {
  ------------------
  |  Branch (305:7): [True: 0, False: 0]
  ------------------
  306|      0|			trad_enc_decrypt_update(&zip->tctx,
  307|      0|			    data, 1, &val, 1);
  308|      0|		} else {
  309|      0|			size_t dsize = 1;
  310|      0|			archive_decrypto_aes_ctr_update(&zip->cctx,
  ------------------
  |  |  164|      0|  __archive_cryptor.decrypto_aes_ctr_update(ctx, in, in_len, out, out_len)
  ------------------
  311|      0|			    data, 1, &val, &dsize);
  312|      0|		}
  313|      0|		if (zip->hctx_valid)
  ------------------
  |  Branch (313:7): [True: 0, False: 0]
  ------------------
  314|      0|			archive_hmac_sha1_update(&zip->hctx, data, 1);
  ------------------
  |  |  101|      0|	__archive_hmac.__hmac_sha1_update(ctx, data, data_len)
  ------------------
  315|       |
  316|      0|		__archive_read_consume(a, 1);
  317|      0|		++zip->zipx_ppmd_read_compressed;
  318|      0|		return val;
  319|      0|	}
  320|       |
  321|  11.4M|	__archive_read_consume(a, 1);
  322|       |
  323|       |	/* Increment the counter. */
  324|  11.4M|	++zip->zipx_ppmd_read_compressed;
  325|       |
  326|       |	/* Return the next compressed byte. */
  327|  11.4M|	return data[0];
  328|  11.4M|}
archive_read_support_format_zip.c:consume_end_of_file_marker:
 1590|  17.4k|{
 1591|  17.4k|	const char *marker;
 1592|  17.4k|	const char *p;
 1593|  17.4k|	uint64_t compressed32, uncompressed32;
 1594|  17.4k|	uint64_t compressed64, uncompressed64;
 1595|  17.4k|	uint64_t compressed_actual, uncompressed_actual;
 1596|  17.4k|	uint32_t crc32_actual;
 1597|  17.4k|	const uint32_t PK78 = 0x08074B50ULL;
 1598|  17.4k|	uint8_t crc32_ignored, crc32_may_be_zero;
 1599|       |
 1600|       |	/* If there shouldn't be a marker, don't consume it. */
 1601|  17.4k|	if ((zip->entry->zip_flags & ZIP_LENGTH_AT_END) == 0) {
  ------------------
  |  |  128|  17.4k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (1601:6): [True: 6.45k, False: 10.9k]
  ------------------
 1602|  6.45k|		return;
 1603|  6.45k|	}
 1604|       |
 1605|       |	/* The longest Zip end-of-file record is 24 bytes.  Since an
 1606|       |	 * end-of-file record can never appear at the end of the
 1607|       |	 * archive, we know 24 bytes will be available unless
 1608|       |	 * the archive is severely truncated. */
 1609|  10.9k|	if (NULL == (marker = __archive_read_ahead(a, 24, NULL))) {
  ------------------
  |  Branch (1609:6): [True: 9, False: 10.9k]
  ------------------
 1610|      9|		return;
 1611|      9|	}
 1612|  10.9k|	p = marker;
 1613|       |
 1614|       |	/* The end-of-file record comprises:
 1615|       |	 * = Optional PK\007\010 marker
 1616|       |	 * = 4-byte CRC32
 1617|       |	 * = Compressed size
 1618|       |	 * = Uncompressed size
 1619|       |	 *
 1620|       |	 * The last two fields are either both 32 bits or both 64
 1621|       |	 * bits.  We check all possible layouts and accept any one
 1622|       |	 * that gives us a complete match, else we make a best-effort
 1623|       |	 * attempt to parse out the pieces.
 1624|       |	 */
 1625|       |
 1626|       |	/* CRC32 checking can be tricky:
 1627|       |	 * * Test suites sometimes ignore the CRC32
 1628|       |	 * * AES AE-2 always writes zero for the CRC32
 1629|       |	 * * AES AE-1 sometimes writes zero for the CRC32
 1630|       |	 */
 1631|  10.9k|	crc32_ignored = zip->ignore_crc32;
 1632|  10.9k|	crc32_may_be_zero = 0;
 1633|  10.9k|	crc32_actual = zip->computed_crc32;
 1634|  10.9k|	if (zip->hctx_valid) {
  ------------------
  |  Branch (1634:6): [True: 1.29k, False: 9.67k]
  ------------------
 1635|  1.29k|	  switch (zip->entry->aes_extra.vendor) {
 1636|      0|	  case AES_VENDOR_AE_2:
  ------------------
  |  |  113|      0|#define AES_VENDOR_AE_2	0x0002
  ------------------
  |  Branch (1636:4): [True: 0, False: 1.29k]
  ------------------
 1637|      0|	    crc32_actual = 0;
 1638|      0|	    break;
 1639|      0|	  case AES_VENDOR_AE_1:
  ------------------
  |  |  112|      0|#define AES_VENDOR_AE_1	0x0001
  ------------------
  |  Branch (1639:4): [True: 0, False: 1.29k]
  ------------------
 1640|  1.29k|	  default:
  ------------------
  |  Branch (1640:4): [True: 1.29k, False: 0]
  ------------------
 1641|  1.29k|	    crc32_may_be_zero = 1;
 1642|  1.29k|	    break;
 1643|  1.29k|	  }
 1644|  1.29k|	}
 1645|       |
 1646|       |	/* Values computed from the actual data in the archive. */
 1647|  10.9k|	compressed_actual = (uint64_t)zip->entry_compressed_bytes_read;
 1648|  10.9k|	uncompressed_actual = (uint64_t)zip->entry_uncompressed_bytes_read;
 1649|       |
 1650|       |
 1651|       |	/* Longest: PK78 marker, all 64-bit fields (24 bytes total) */
 1652|  10.9k|	if (archive_le32dec(p) == PK78
  ------------------
  |  Branch (1652:6): [True: 1.99k, False: 8.97k]
  ------------------
 1653|  1.99k|	    && ((archive_le32dec(p + 4) == crc32_actual)
  ------------------
  |  Branch (1653:10): [True: 153, False: 1.84k]
  ------------------
 1654|  1.84k|		|| (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1654:7): [True: 418, False: 1.42k]
  |  Branch (1654:28): [True: 0, False: 418]
  ------------------
 1655|  1.84k|		|| crc32_ignored)
  ------------------
  |  Branch (1655:6): [True: 1.84k, False: 0]
  ------------------
 1656|  1.99k|	    && (archive_le64dec(p + 8) == compressed_actual)
  ------------------
  |  Branch (1656:9): [True: 654, False: 1.34k]
  ------------------
 1657|    654|	    && (archive_le64dec(p + 16) == uncompressed_actual)) {
  ------------------
  |  Branch (1657:9): [True: 165, False: 489]
  ------------------
 1658|    165|		if (!crc32_ignored) {
  ------------------
  |  Branch (1658:7): [True: 0, False: 165]
  ------------------
 1659|      0|			zip->entry->crc32 = crc32_actual;
 1660|      0|		}
 1661|    165|		zip->entry->compressed_size = compressed_actual;
 1662|    165|		zip->entry->uncompressed_size = uncompressed_actual;
 1663|    165|		zip->unconsumed += 24;
 1664|    165|		return;
 1665|    165|	}
 1666|       |
 1667|       |	/* No PK78 marker, 64-bit fields (20 bytes total) */
 1668|  10.8k|	if (((archive_le32dec(p) == crc32_actual)
  ------------------
  |  Branch (1668:7): [True: 833, False: 9.96k]
  ------------------
 1669|  9.96k|	     || (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1669:11): [True: 1.29k, False: 8.67k]
  |  Branch (1669:32): [True: 868, False: 425]
  ------------------
 1670|  9.10k|	     || crc32_ignored)
  ------------------
  |  Branch (1670:10): [True: 9.10k, False: 0]
  ------------------
 1671|  10.8k|	    && (archive_le64dec(p + 4) == compressed_actual)
  ------------------
  |  Branch (1671:9): [True: 1.12k, False: 9.68k]
  ------------------
 1672|  1.12k|	    && (archive_le64dec(p + 12) == uncompressed_actual)) {
  ------------------
  |  Branch (1672:9): [True: 223, False: 898]
  ------------------
 1673|    223|	        if (!crc32_ignored) {
  ------------------
  |  Branch (1673:14): [True: 0, False: 223]
  ------------------
 1674|      0|			zip->entry->crc32 = crc32_actual;
 1675|      0|		}
 1676|    223|		zip->entry->compressed_size = compressed_actual;
 1677|    223|		zip->entry->uncompressed_size = uncompressed_actual;
 1678|    223|		zip->unconsumed += 20;
 1679|    223|		return;
 1680|    223|	}
 1681|       |
 1682|       |	/* PK78 marker and 32-bit fields (16 bytes total) */
 1683|  10.5k|	if (archive_le32dec(p) == PK78
  ------------------
  |  Branch (1683:6): [True: 1.83k, False: 8.74k]
  ------------------
 1684|  1.83k|	    && ((archive_le32dec(p + 4) == crc32_actual)
  ------------------
  |  Branch (1684:10): [True: 153, False: 1.67k]
  ------------------
 1685|  1.67k|		|| (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1685:7): [True: 418, False: 1.26k]
  |  Branch (1685:28): [True: 0, False: 418]
  ------------------
 1686|  1.67k|		|| crc32_ignored)
  ------------------
  |  Branch (1686:6): [True: 1.67k, False: 0]
  ------------------
 1687|  1.83k|	    && (archive_le32dec(p + 8) == compressed_actual)
  ------------------
  |  Branch (1687:9): [True: 595, False: 1.23k]
  ------------------
 1688|    595|	    && (archive_le32dec(p + 12) == uncompressed_actual)) {
  ------------------
  |  Branch (1688:9): [True: 430, False: 165]
  ------------------
 1689|    430|		if (!crc32_ignored) {
  ------------------
  |  Branch (1689:7): [True: 0, False: 430]
  ------------------
 1690|      0|			zip->entry->crc32 = crc32_actual;
 1691|      0|		}
 1692|    430|		zip->entry->compressed_size = compressed_actual;
 1693|    430|		zip->entry->uncompressed_size = uncompressed_actual;
 1694|    430|		zip->unconsumed += 16;
 1695|    430|		return;
 1696|    430|	}
 1697|       |
 1698|       |	/* Shortest: No PK78 marker, all 32-bit fields (12 bytes total) */
 1699|  10.1k|	if (((archive_le32dec(p) == crc32_actual)
  ------------------
  |  Branch (1699:7): [True: 833, False: 9.31k]
  ------------------
 1700|  9.31k|	     || (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1700:11): [True: 1.29k, False: 8.02k]
  |  Branch (1700:32): [True: 868, False: 425]
  ------------------
 1701|  8.44k|	     || crc32_ignored)
  ------------------
  |  Branch (1701:10): [True: 8.44k, False: 0]
  ------------------
 1702|  10.1k|	    && (archive_le32dec(p + 4) == compressed_actual)
  ------------------
  |  Branch (1702:9): [True: 1.19k, False: 8.95k]
  ------------------
 1703|  1.19k|	    && (archive_le32dec(p + 8) == uncompressed_actual)) {
  ------------------
  |  Branch (1703:9): [True: 145, False: 1.04k]
  ------------------
 1704|    145|		if (!crc32_ignored) {
  ------------------
  |  Branch (1704:7): [True: 0, False: 145]
  ------------------
 1705|      0|			zip->entry->crc32 = crc32_actual;
 1706|      0|		}
 1707|    145|		zip->entry->compressed_size = compressed_actual;
 1708|    145|		zip->entry->uncompressed_size = uncompressed_actual;
 1709|    145|		zip->unconsumed += 12;
 1710|    145|		return;
 1711|    145|	}
 1712|       |
 1713|       |	/* None of the exact patterns matched. If entry size was unknown
 1714|       |	 * (ZIP_LENGTH_AT_END flag), before treating this as
 1715|       |	 * corruption, check whether the next ZIP record follows the data
 1716|       |	 * immediately: a length-at-end entry whose compression format has
 1717|       |	 * its own end-of-stream marker (e.g. PPMd) may be written with no
 1718|       |	 * data descriptor at all.  In that case the byte counts we measured
 1719|       |	 * during decompression are authoritative, so trust them and leave
 1720|       |	 * the stream untouched. */
 1721|  10.0k|	if (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  128|  10.0k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (1721:6): [True: 10.0k, False: 0]
  ------------------
 1722|  10.0k|	{
 1723|  10.0k|		const uint32_t sig = archive_le32dec(p);
 1724|  10.0k|		if (sig == 0x04034b50U     /* Local file header */
  ------------------
  |  Branch (1724:7): [True: 2.89k, False: 7.10k]
  ------------------
 1725|  7.10k|		    || sig == 0x02014b50U  /* Central directory record */
  ------------------
  |  Branch (1725:10): [True: 0, False: 7.10k]
  ------------------
 1726|  7.10k|		    || sig == 0x06054b50U) /* End of central directory */ {
  ------------------
  |  Branch (1726:10): [True: 0, False: 7.10k]
  ------------------
 1727|  2.89k|			zip->entry->compressed_size = compressed_actual;
 1728|  2.89k|			zip->entry->uncompressed_size = uncompressed_actual;
 1729|  2.89k|			return;
 1730|  2.89k|		}
 1731|  10.0k|	}
 1732|       |
 1733|       |	/* If none of the above patterns gives us a full exact match,
 1734|       |	 * then there's something definitely amiss.  The fallback code
 1735|       |	 * below will parse out some plausible values for error
 1736|       |	 * reporting purposes.  Note that this won't actually
 1737|       |	 * consume anything:
 1738|       |	 *
 1739|       |	 * = If there really is a marker here, the logic to resync to
 1740|       |	 *   the next entry will suffice to skip it.
 1741|       |	 *
 1742|       |	 * = There might not really be a marker: Corruption or bugs
 1743|       |	 *   may have set the length-at-end bit without a marker ever
 1744|       |	 *   having actually been written. In this case, we
 1745|       |	 *   explicitly should not consume any bytes, since that would
 1746|       |	 *   prevent us from correctly reading the next entry.
 1747|       |	 */
 1748|  7.10k|	if (archive_le32dec(p) == PK78) {
  ------------------
  |  Branch (1748:6): [True: 1.32k, False: 5.78k]
  ------------------
 1749|  1.32k|		p += 4; /* Ignore PK78 if it appears to be present */
 1750|  1.32k|	}
 1751|  7.10k|	zip->entry->crc32 = archive_le32dec(p);  /* Parse CRC32 */
 1752|  7.10k|	p += 4;
 1753|       |
 1754|       |	/* Consider both 32- and 64-bit interpretations */
 1755|  7.10k|	compressed32 = archive_le32dec(p);
 1756|  7.10k|	uncompressed32 = archive_le32dec(p + 4);
 1757|  7.10k|	compressed64 = archive_le64dec(p);
 1758|  7.10k|	uncompressed64 = archive_le64dec(p + 8);
 1759|       |
 1760|       |	/* The earlier patterns may have failed because of CRC32
 1761|       |	 * mismatch, so it's still possible that both sizes match.
 1762|       |	 * Try to match as many as we can...
 1763|       |	 */
 1764|  7.10k|	if (compressed32 == compressed_actual
  ------------------
  |  Branch (1764:6): [True: 1.13k, False: 5.97k]
  ------------------
 1765|  1.13k|	    && uncompressed32 == uncompressed_actual) {
  ------------------
  |  Branch (1765:9): [True: 0, False: 1.13k]
  ------------------
 1766|       |		/* Both 32-bit fields match */
 1767|      0|		zip->entry->compressed_size = compressed32;
 1768|      0|		zip->entry->uncompressed_size = uncompressed32;
 1769|  7.10k|	} else if (compressed64 == compressed_actual
  ------------------
  |  Branch (1769:13): [True: 743, False: 6.36k]
  ------------------
 1770|  6.36k|		   || uncompressed64 == uncompressed_actual) {
  ------------------
  |  Branch (1770:9): [True: 189, False: 6.17k]
  ------------------
 1771|       |		/* One or both 64-bit fields match */
 1772|    932|		zip->entry->compressed_size = compressed64;
 1773|    932|		zip->entry->uncompressed_size = uncompressed64;
 1774|  6.17k|	} else {
 1775|       |		/* Zero or one 32-bit fields match */
 1776|  6.17k|		zip->entry->compressed_size = compressed32;
 1777|  6.17k|		zip->entry->uncompressed_size = uncompressed32;
 1778|  6.17k|	}
 1779|  7.10k|}
archive_read_support_format_zip.c:archive_read_format_zip_read_data_skip_streamable:
 3791|  34.1k|{
 3792|  34.1k|	struct zip *zip;
 3793|  34.1k|	int64_t bytes_skipped;
 3794|       |
 3795|  34.1k|	zip = (struct zip *)(a->format->data);
 3796|  34.1k|	bytes_skipped = __archive_read_consume(a, zip->unconsumed);
 3797|  34.1k|	zip->unconsumed = 0;
 3798|  34.1k|	if (bytes_skipped < 0)
  ------------------
  |  Branch (3798:6): [True: 0, False: 34.1k]
  ------------------
 3799|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3800|       |
 3801|       |	/* If we've already read to end of data, we're done. */
 3802|  34.1k|	if (zip->end_of_entry)
  ------------------
  |  Branch (3802:6): [True: 20.7k, False: 13.4k]
  ------------------
 3803|  20.7k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  20.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3804|       |
 3805|       |	/* So we know we're streaming... */
 3806|  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 (3806:6): [True: 5.33k, False: 8.14k]
  ------------------
 3807|  10.4k|	    || zip->entry->compressed_size > 0) {
  ------------------
  |  Branch (3807:9): [True: 5.08k, False: 3.06k]
  ------------------
 3808|       |		/* We know the compressed length, so we can just skip. */
 3809|  10.4k|		bytes_skipped = __archive_read_consume(a,
 3810|  10.4k|					zip->entry_bytes_remaining);
 3811|  10.4k|		if (bytes_skipped < 0)
  ------------------
  |  Branch (3811:7): [True: 51, False: 10.3k]
  ------------------
 3812|     51|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     51|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3813|  10.3k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  10.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3814|  10.4k|	}
 3815|       |
 3816|  3.06k|	if (zip->init_decryption) {
  ------------------
  |  Branch (3816:6): [True: 2.33k, False: 730]
  ------------------
 3817|  2.33k|		int r;
 3818|       |
 3819|  2.33k|		zip->has_encrypted_entries = 1;
 3820|  2.33k|		if (zip->entry->zip_flags & ZIP_STRONG_ENCRYPTED)
  ------------------
  |  |  129|  2.33k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
  |  Branch (3820:7): [True: 103, False: 2.23k]
  ------------------
 3821|    103|			r = read_decryption_header(a);
 3822|  2.23k|		else if (zip->entry->compression == WINZIP_AES_ENCRYPTION)
  ------------------
  |  |  144|  2.23k|#define WINZIP_AES_ENCRYPTION	99
  ------------------
  |  Branch (3822:12): [True: 98, False: 2.13k]
  ------------------
 3823|     98|			r = init_WinZip_AES_decryption(a);
 3824|  2.13k|		else
 3825|  2.13k|			r = init_traditional_PKWARE_decryption(a);
 3826|  2.33k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.33k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3826:7): [True: 1.56k, False: 773]
  ------------------
 3827|  1.56k|			return (r);
 3828|    773|		zip->init_decryption = 0;
 3829|    773|	}
 3830|       |
 3831|       |	/* We're streaming and we don't know the length. */
 3832|       |	/* If the body is compressed and we know the format, we can
 3833|       |	 * find an exact end-of-entry by decompressing it. */
 3834|  1.50k|	switch (zip->entry->compression) {
 3835|      0|#ifdef HAVE_ZLIB_H
 3836|      0|	case 8: /* Deflate compression. */
  ------------------
  |  Branch (3836:2): [True: 0, False: 1.50k]
  ------------------
 3837|      0|		while (!zip->end_of_entry) {
  ------------------
  |  Branch (3837:10): [True: 0, False: 0]
  ------------------
 3838|      0|			int64_t offset = 0;
 3839|      0|			const void *buff = NULL;
 3840|      0|			size_t size = 0;
 3841|      0|			int r;
 3842|      0|			r =  zip_read_data_deflate(a, &buff, &size, &offset);
 3843|      0|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3843:8): [True: 0, False: 0]
  ------------------
 3844|      0|				return (r);
 3845|      0|		}
 3846|      0|		return ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3847|      0|#endif
 3848|  1.50k|	default: /* Uncompressed or unknown. */
  ------------------
  |  Branch (3848:2): [True: 1.50k, False: 0]
  ------------------
 3849|       |		/* Scan for a PK\007\010 signature. */
 3850|  1.71k|		for (;;) {
 3851|  1.71k|			const char *p, *buff;
 3852|  1.71k|			ssize_t bytes_avail;
 3853|  1.71k|			buff = __archive_read_ahead(a, 16, &bytes_avail);
 3854|  1.71k|			if (bytes_avail < 16) {
  ------------------
  |  Branch (3854:8): [True: 7, False: 1.71k]
  ------------------
 3855|      7|				archive_set_error(&a->archive,
 3856|      7|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      7|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3857|      7|				    "Truncated ZIP file data");
 3858|      7|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3859|      7|			}
 3860|  1.71k|			p = buff;
 3861|   805k|			while (p <= buff + bytes_avail - 16) {
  ------------------
  |  Branch (3861:11): [True: 805k, False: 214]
  ------------------
 3862|   805k|				if (p[3] == 'P') { p += 3; }
  ------------------
  |  Branch (3862:9): [True: 1.91k, False: 803k]
  ------------------
 3863|   803k|				else if (p[3] == 'K') { p += 2; }
  ------------------
  |  Branch (3863:14): [True: 17.1k, False: 786k]
  ------------------
 3864|   786k|				else if (p[3] == '\007') { p += 1; }
  ------------------
  |  Branch (3864:14): [True: 5.37k, False: 780k]
  ------------------
 3865|   780k|				else if (p[3] == '\010' && p[2] == '\007'
  ------------------
  |  Branch (3865:14): [True: 8.74k, False: 772k]
  |  Branch (3865:32): [True: 1.54k, False: 7.19k]
  ------------------
 3866|  1.54k|				    && p[1] == 'K' && p[0] == 'P') {
  ------------------
  |  Branch (3866:12): [True: 1.52k, False: 18]
  |  Branch (3866:27): [True: 1.49k, False: 33]
  ------------------
 3867|  1.49k|					if (zip->entry->flags & LA_USED_ZIP64)
  ------------------
  |  |  136|  1.49k|#define LA_USED_ZIP64	(1 << 0)
  ------------------
  |  Branch (3867:10): [True: 232, False: 1.26k]
  ------------------
 3868|    232|						__archive_read_consume(a,
 3869|    232|						    p - buff + 24);
 3870|  1.26k|					else
 3871|  1.26k|						__archive_read_consume(a,
 3872|  1.26k|						    p - buff + 16);
 3873|  1.49k|					return ARCHIVE_OK;
  ------------------
  |  |  233|  1.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3874|   779k|				} else { p += 4; }
 3875|   805k|			}
 3876|    214|			__archive_read_consume(a, p - buff);
 3877|    214|		}
 3878|  1.50k|	}
 3879|  1.50k|}
archive_read_support_format_zip.c:archive_read_format_zip_cleanup:
 3516|  4.99k|{
 3517|  4.99k|	struct zip *zip;
 3518|  4.99k|	struct zip_entry *zip_entry, *next_zip_entry;
 3519|       |
 3520|  4.99k|	zip = (struct zip *)(a->format->data);
 3521|       |
 3522|  4.99k|#ifdef HAVE_ZLIB_H
 3523|  4.99k|	if (zip->stream_valid)
  ------------------
  |  Branch (3523:6): [True: 105, False: 4.89k]
  ------------------
 3524|    105|		inflateEnd(&zip->stream);
 3525|  4.99k|#endif
 3526|       |
 3527|  4.99k|#if HAVE_LZMA_H && HAVE_LIBLZMA
 3528|  4.99k|    if (zip->zipx_lzma_valid) {
  ------------------
  |  Branch (3528:9): [True: 9, False: 4.98k]
  ------------------
 3529|      9|		lzma_end(&zip->zipx_lzma_stream);
 3530|      9|	}
 3531|  4.99k|#endif
 3532|       |
 3533|  4.99k|#ifdef HAVE_BZLIB_H
 3534|  4.99k|	if (zip->bzstream_valid) {
  ------------------
  |  Branch (3534:6): [True: 0, False: 4.99k]
  ------------------
 3535|      0|		BZ2_bzDecompressEnd(&zip->bzstream);
 3536|      0|	}
 3537|  4.99k|#endif
 3538|       |
 3539|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 3540|       |	if (zip->zstdstream_valid) {
 3541|       |		ZSTD_freeDStream(zip->zstdstream);
 3542|       |	}
 3543|       |#endif
 3544|       |
 3545|  4.99k|	free(zip->uncompressed_buffer);
 3546|       |
 3547|  4.99k|	if (zip->ppmd8_valid)
  ------------------
  |  Branch (3547:6): [True: 179, False: 4.81k]
  ------------------
 3548|    179|		__archive_ppmd8_functions.Ppmd8_Free(&zip->ppmd8);
 3549|       |
 3550|  4.99k|	if (zip->zip_entries) {
  ------------------
  |  Branch (3550:6): [True: 698, False: 4.30k]
  ------------------
 3551|    698|		zip_entry = zip->zip_entries;
 3552|  2.44k|		while (zip_entry != NULL) {
  ------------------
  |  Branch (3552:10): [True: 1.74k, False: 698]
  ------------------
 3553|  1.74k|			next_zip_entry = zip_entry->next;
 3554|  1.74k|			archive_string_free(&zip_entry->rsrcname);
 3555|  1.74k|			free(zip_entry);
 3556|  1.74k|			zip_entry = next_zip_entry;
 3557|  1.74k|		}
 3558|    698|	}
 3559|  4.99k|	free(zip->decrypted_buffer);
 3560|  4.99k|	if (zip->cctx_valid)
  ------------------
  |  Branch (3560:6): [True: 6, False: 4.99k]
  ------------------
 3561|      6|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  166|      6|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 3562|  4.99k|	if (zip->hctx_valid)
  ------------------
  |  Branch (3562:6): [True: 6, False: 4.99k]
  ------------------
 3563|      6|		archive_hmac_sha1_cleanup(&zip->hctx);
  ------------------
  |  |  105|      6|	__archive_hmac.__hmac_sha1_cleanup(ctx)
  ------------------
 3564|  4.99k|	free(zip->iv);
 3565|  4.99k|	free(zip->erd);
 3566|  4.99k|	free(zip->v_data);
 3567|  4.99k|	archive_string_free(&zip->format_name);
 3568|  4.99k|	free(zip);
 3569|  4.99k|	(a->format->data) = NULL;
 3570|  4.99k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.99k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3571|  4.99k|}
archive_read_support_format_zip.c:archive_read_support_format_zip_capabilities_streamable:
 3653|  1.32k|{
 3654|  1.32k|	(void)a; /* UNUSED */
 3655|  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 */
  ------------------
 3656|  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.) */
  ------------------
 3657|  1.32k|}
archive_read_support_format_zip.c:archive_read_format_zip_has_encrypted_entries:
 3575|    701|{
 3576|    701|	if (_a && _a->format) {
  ------------------
  |  Branch (3576:6): [True: 701, False: 0]
  |  Branch (3576:12): [True: 701, False: 0]
  ------------------
 3577|    701|		struct zip * zip = (struct zip *)_a->format->data;
 3578|    701|		if (zip) {
  ------------------
  |  Branch (3578:7): [True: 701, False: 0]
  ------------------
 3579|    701|			return zip->has_encrypted_entries;
 3580|    701|		}
 3581|    701|	}
 3582|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 3583|    701|}
archive_read_support_format_zip.c:archive_read_format_zip_seekable_bid:
 4036|  2.45k|{
 4037|  2.45k|	struct zip *zip = (struct zip *)a->format->data;
 4038|  2.45k|	int64_t file_size, current_offset;
 4039|  2.45k|	const char *p;
 4040|  2.45k|	int i, tail;
 4041|       |
 4042|       |	/* If someone has already bid more than 32, then avoid
 4043|       |	   trashing the look-ahead buffers with a seek. */
 4044|  2.45k|	if (best_bid > 32)
  ------------------
  |  Branch (4044:6): [True: 1.13k, False: 1.31k]
  ------------------
 4045|  1.13k|		return (-1);
 4046|       |
 4047|  1.31k|	file_size = __archive_read_seek(a, 0, SEEK_END);
 4048|  1.31k|	if (file_size <= 0)
  ------------------
  |  Branch (4048:6): [True: 75, False: 1.24k]
  ------------------
 4049|     75|		return 0;
 4050|       |
 4051|       |	/* Search last 16k of file for end-of-central-directory
 4052|       |	 * record (which starts with PK\005\006) */
 4053|  1.24k|	tail = (int)zipmin(1024 * 16, file_size);
  ------------------
  |  |  260|  1.24k|#define	zipmin(a,b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (260:22): [True: 544, False: 700]
  |  |  ------------------
  ------------------
 4054|  1.24k|	current_offset = __archive_read_seek(a, -tail, SEEK_END);
 4055|  1.24k|	if (current_offset < 0)
  ------------------
  |  Branch (4055:6): [True: 0, False: 1.24k]
  ------------------
 4056|      0|		return 0;
 4057|  1.24k|	if ((p = __archive_read_ahead(a, (size_t)tail, NULL)) == NULL)
  ------------------
  |  Branch (4057:6): [True: 0, False: 1.24k]
  ------------------
 4058|      0|		return 0;
 4059|       |	/* Boyer-Moore search backwards from the end, since we want
 4060|       |	 * to match the last EOCD in the file (there can be more than
 4061|       |	 * one if there is an uncompressed Zip archive as a member
 4062|       |	 * within this Zip archive). */
 4063|  3.37M|	for (i = tail - 22; i > 0;) {
  ------------------
  |  Branch (4063:22): [True: 3.37M, False: 1.17k]
  ------------------
 4064|  3.37M|		switch (p[i]) {
 4065|  34.6k|		case 'P':
  ------------------
  |  Branch (4065:3): [True: 34.6k, False: 3.33M]
  ------------------
 4066|  34.6k|			if (memcmp(p + i, "PK\005\006", 4) == 0) {
  ------------------
  |  Branch (4066:8): [True: 71, False: 34.5k]
  ------------------
 4067|     71|				int ret = read_eocd(zip, p + i,
 4068|     71|				    current_offset + i);
 4069|       |				/* Zip64 EOCD locator precedes
 4070|       |				 * regular EOCD if present. */
 4071|     71|				if (i >= 20 && memcmp(p + i - 20, "PK\006\007", 4) == 0) {
  ------------------
  |  Branch (4071:9): [True: 71, False: 0]
  |  Branch (4071:20): [True: 4, False: 67]
  ------------------
 4072|      4|					int ret_zip64 = read_zip64_eocd(a, zip, p + i - 20);
 4073|      4|					if (ret_zip64 > ret)
  ------------------
  |  Branch (4073:10): [True: 2, False: 2]
  ------------------
 4074|      2|						ret = ret_zip64;
 4075|      4|				}
 4076|     71|				return (ret);
 4077|     71|			}
 4078|  34.5k|			i -= 4;
 4079|  34.5k|			break;
 4080|  11.2k|		case 'K': i -= 1; break;
  ------------------
  |  Branch (4080:3): [True: 11.2k, False: 3.35M]
  ------------------
 4081|   217k|		case 005: i -= 2; break;
  ------------------
  |  Branch (4081:3): [True: 217k, False: 3.15M]
  ------------------
 4082|  12.0k|		case 006: i -= 3; break;
  ------------------
  |  Branch (4082:3): [True: 12.0k, False: 3.35M]
  ------------------
 4083|  3.09M|		default: i -= 4; break;
  ------------------
  |  Branch (4083:3): [True: 3.09M, False: 275k]
  ------------------
 4084|  3.37M|		}
 4085|  3.37M|	}
 4086|  1.17k|	return 0;
 4087|  1.24k|}
archive_read_support_format_zip.c:read_eocd:
 3951|     71|{
 3952|     71|	uint16_t disk_num;
 3953|     71|	uint32_t cd_size, cd_offset;
 3954|       |
 3955|     71|	disk_num = archive_le16dec(p + 4);
 3956|     71|	cd_size = archive_le32dec(p + 12);
 3957|     71|	cd_offset = archive_le32dec(p + 16);
 3958|       |
 3959|       |	/* Sanity-check the EOCD we've found. */
 3960|       |
 3961|       |	/* This must be the first volume. */
 3962|     71|	if (disk_num != 0)
  ------------------
  |  Branch (3962:6): [True: 23, False: 48]
  ------------------
 3963|     23|		return 0;
 3964|       |	/* Central directory must be on this volume. */
 3965|     48|	if (disk_num != archive_le16dec(p + 6))
  ------------------
  |  Branch (3965:6): [True: 9, False: 39]
  ------------------
 3966|      9|		return 0;
 3967|       |	/* All central directory entries must be on this volume. */
 3968|     39|	if (archive_le16dec(p + 10) != archive_le16dec(p + 8))
  ------------------
  |  Branch (3968:6): [True: 0, False: 39]
  ------------------
 3969|      0|		return 0;
 3970|       |	/* Central directory can't extend beyond start of EOCD record. */
 3971|     39|	if ((int64_t)cd_offset + cd_size > current_offset)
  ------------------
  |  Branch (3971:6): [True: 2, False: 37]
  ------------------
 3972|      2|		return 0;
 3973|       |
 3974|       |	/* Save the central directory location for later use. */
 3975|     37|	zip->central_directory_offset = cd_offset;
 3976|     37|	zip->central_directory_offset_adjusted = current_offset - cd_size;
 3977|       |
 3978|       |	/* This is just a tiny bit higher than the maximum
 3979|       |	   returned by the streaming Zip bidder.  This ensures
 3980|       |	   that the more accurate seeking Zip parser wins
 3981|       |	   whenever seek is available. */
 3982|     37|	return 32;
 3983|     39|}
archive_read_support_format_zip.c:read_zip64_eocd:
 3991|      4|{
 3992|      4|	int64_t eocd64_offset;
 3993|      4|	int64_t eocd64_size;
 3994|       |
 3995|       |	/* Sanity-check the locator record. */
 3996|       |
 3997|       |	/* Central dir must be on first volume. */
 3998|      4|	if (archive_le32dec(p + 4) != 0)
  ------------------
  |  Branch (3998:6): [True: 1, False: 3]
  ------------------
 3999|      1|		return 0;
 4000|       |	/* Must be only a single volume. */
 4001|      3|	if (archive_le32dec(p + 16) != 1)
  ------------------
  |  Branch (4001:6): [True: 0, False: 3]
  ------------------
 4002|      0|		return 0;
 4003|       |
 4004|       |	/* Find the Zip64 EOCD record. */
 4005|      3|	eocd64_offset = archive_le64dec(p + 8);
 4006|      3|	if (__archive_read_seek(a, eocd64_offset, SEEK_SET) < 0)
  ------------------
  |  Branch (4006:6): [True: 0, False: 3]
  ------------------
 4007|      0|		return 0;
 4008|      3|	if ((p = __archive_read_ahead(a, 56, NULL)) == NULL)
  ------------------
  |  Branch (4008:6): [True: 0, False: 3]
  ------------------
 4009|      0|		return 0;
 4010|       |	/* Make sure we can read all of it. */
 4011|      3|	eocd64_size = archive_le64dec(p + 4) + 12;
 4012|      3|	if (eocd64_size < 56 || eocd64_size > 16384)
  ------------------
  |  Branch (4012:6): [True: 0, False: 3]
  |  Branch (4012:26): [True: 1, False: 2]
  ------------------
 4013|      1|		return 0;
 4014|      2|	if ((p = __archive_read_ahead(a, (size_t)eocd64_size, NULL)) == NULL)
  ------------------
  |  Branch (4014:6): [True: 0, False: 2]
  ------------------
 4015|      0|		return 0;
 4016|       |
 4017|       |	/* Sanity-check the EOCD64 */
 4018|      2|	if (archive_le32dec(p + 16) != 0) /* Must be disk #0 */
  ------------------
  |  Branch (4018:6): [True: 0, False: 2]
  ------------------
 4019|      0|		return 0;
 4020|      2|	if (archive_le32dec(p + 20) != 0) /* CD must be on disk #0 */
  ------------------
  |  Branch (4020:6): [True: 0, False: 2]
  ------------------
 4021|      0|		return 0;
 4022|       |	/* CD can't be split. */
 4023|      2|	if (archive_le64dec(p + 24) != archive_le64dec(p + 32))
  ------------------
  |  Branch (4023:6): [True: 0, False: 2]
  ------------------
 4024|      0|		return 0;
 4025|       |
 4026|       |	/* Save the central directory offset for later use. */
 4027|      2|	zip->central_directory_offset = archive_le64dec(p + 48);
 4028|       |	/* TODO: Needs scanning backwards to find the eocd64 instead of assuming */
 4029|      2|	zip->central_directory_offset_adjusted = zip->central_directory_offset;
 4030|       |
 4031|      2|	return 32;
 4032|      2|}
archive_read_support_format_zip.c:archive_read_format_zip_seekable_read_header:
 4585|    247|{
 4586|    247|	struct zip *zip = (struct zip *)a->format->data;
 4587|    247|	struct zip_entry *rsrc;
 4588|    247|	int64_t offset;
 4589|    247|	int r, ret = ARCHIVE_OK;
  ------------------
  |  |  233|    247|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4590|       |
 4591|       |	/*
 4592|       |	 * It should be sufficient to call archive_read_next_header() for
 4593|       |	 * a reader to determine if an entry is encrypted or not. If the
 4594|       |	 * encryption of an entry is only detectable when calling
 4595|       |	 * archive_read_data(), so be it. We'll do the same check there
 4596|       |	 * as well.
 4597|       |	 */
 4598|    247|	if (zip->has_encrypted_entries ==
  ------------------
  |  Branch (4598:6): [True: 39, False: 208]
  ------------------
 4599|    247|			ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW)
  ------------------
  |  |  411|    247|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4600|     39|		zip->has_encrypted_entries = 0;
 4601|       |
 4602|    247|	a->archive.archive_format = ARCHIVE_FORMAT_ZIP;
  ------------------
  |  |  374|    247|#define	ARCHIVE_FORMAT_ZIP			0x50000
  ------------------
 4603|    247|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (4603:6): [True: 39, False: 208]
  ------------------
 4604|     39|		a->archive.archive_format_name = "ZIP";
 4605|       |
 4606|    247|	if (zip->zip_entries == NULL) {
  ------------------
  |  Branch (4606:6): [True: 39, False: 208]
  ------------------
 4607|     39|		r = slurp_central_directory(a, entry, zip);
 4608|     39|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|     39|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4608:7): [True: 16, False: 23]
  ------------------
 4609|     16|			return r;
 4610|       |		/* Get first entry whose local header offset is lower than
 4611|       |		 * other entries in the archive file. */
 4612|     23|		zip->entry =
 4613|     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
  |  |  ------------------
  ------------------
 4614|    208|	} else if (zip->entry != NULL) {
  ------------------
  |  Branch (4614:13): [True: 208, False: 0]
  ------------------
 4615|       |		/* Get next entry in local header offset order. */
 4616|    208|		zip->entry = (struct zip_entry *)__archive_rb_tree_iterate(
 4617|    208|		    &zip->tree, &zip->entry->node, ARCHIVE_RB_DIR_RIGHT);
  ------------------
  |  |   46|    208|#define	ARCHIVE_RB_DIR_RIGHT		1
  ------------------
 4618|    208|	}
 4619|       |
 4620|    231|	if (zip->entry == NULL)
  ------------------
  |  Branch (4620:6): [True: 7, False: 224]
  ------------------
 4621|      7|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      7|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4622|       |
 4623|    224|	if (zip->entry->rsrcname.s)
  ------------------
  |  Branch (4623:6): [True: 0, False: 224]
  ------------------
 4624|      0|		rsrc = (struct zip_entry *)__archive_rb_tree_find_node(
 4625|      0|		    &zip->tree_rsrc, zip->entry->rsrcname.s);
 4626|    224|	else
 4627|    224|		rsrc = NULL;
 4628|       |
 4629|    224|	if (zip->cctx_valid)
  ------------------
  |  Branch (4629:6): [True: 0, False: 224]
  ------------------
 4630|      0|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  166|      0|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 4631|    224|	if (zip->hctx_valid)
  ------------------
  |  Branch (4631:6): [True: 0, False: 224]
  ------------------
 4632|      0|		archive_hmac_sha1_cleanup(&zip->hctx);
  ------------------
  |  |  105|      0|	__archive_hmac.__hmac_sha1_cleanup(ctx)
  ------------------
 4633|    224|	zip->tctx_valid = zip->cctx_valid = zip->hctx_valid = 0;
 4634|    224|	__archive_read_reset_passphrase(a);
 4635|       |
 4636|       |	/* File entries are sorted by the header offset, we should mostly
 4637|       |	 * use __archive_read_consume to advance a read point to avoid
 4638|       |	 * redundant data reading.  */
 4639|    224|	offset = archive_filter_bytes(&a->archive, 0);
 4640|    224|	if (offset < zip->entry->local_header_offset)
  ------------------
  |  Branch (4640:6): [True: 21, False: 203]
  ------------------
 4641|     21|		__archive_read_consume(a,
 4642|     21|		    zip->entry->local_header_offset - offset);
 4643|    203|	else if (offset != zip->entry->local_header_offset) {
  ------------------
  |  Branch (4643:11): [True: 25, False: 178]
  ------------------
 4644|     25|		__archive_read_seek(a, zip->entry->local_header_offset,
 4645|     25|		    SEEK_SET);
 4646|     25|	}
 4647|    224|	zip->unconsumed = 0;
 4648|    224|	r = zip_read_local_file_header(a, entry, zip);
 4649|    224|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    224|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4649:6): [True: 54, False: 170]
  ------------------
 4650|     54|		return r;
 4651|    170|	if (rsrc) {
  ------------------
  |  Branch (4651:6): [True: 0, False: 170]
  ------------------
 4652|      0|		int ret2 = zip_read_mac_metadata(a, entry, rsrc);
 4653|      0|		if (ret2 < ret)
  ------------------
  |  Branch (4653:7): [True: 0, False: 0]
  ------------------
 4654|      0|			ret = ret2;
 4655|      0|	}
 4656|    170|	return (ret);
 4657|    224|}
archive_read_support_format_zip.c:slurp_central_directory:
 4184|     39|{
 4185|     39|	ssize_t i;
 4186|     39|	unsigned found;
 4187|     39|	int64_t correction;
 4188|     39|	ssize_t bytes_avail;
 4189|     39|	const char *p;
 4190|       |
 4191|       |	/*
 4192|       |	 * Find the start of the central directory.  The end-of-CD
 4193|       |	 * record has our starting point, but there are lots of
 4194|       |	 * Zip archives which have had other data prepended to the
 4195|       |	 * file, which makes the recorded offsets all too small.
 4196|       |	 * So we search forward from the specified offset until we
 4197|       |	 * find the real start of the central directory.  Then we
 4198|       |	 * know the correction we need to apply to account for leading
 4199|       |	 * padding.
 4200|       |	 */
 4201|     39|	if (__archive_read_seek(a, zip->central_directory_offset_adjusted, SEEK_SET)
  ------------------
  |  Branch (4201:6): [True: 0, False: 39]
  ------------------
 4202|     39|		< 0)
 4203|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4204|       |
 4205|     39|	found = 0;
 4206|     78|	while (!found) {
  ------------------
  |  Branch (4206:9): [True: 39, False: 39]
  ------------------
 4207|     39|		if ((p = __archive_read_ahead(a, 20, &bytes_avail)) == NULL)
  ------------------
  |  Branch (4207:7): [True: 0, False: 39]
  ------------------
 4208|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4209|  38.0k|		for (found = 0, i = 0; !found && i < bytes_avail - 4;) {
  ------------------
  |  Branch (4209:26): [True: 38.0k, False: 39]
  |  Branch (4209:36): [True: 38.0k, False: 0]
  ------------------
 4210|  38.0k|			switch (p[i + 3]) {
 4211|    294|			case 'P': i += 3; break;
  ------------------
  |  Branch (4211:4): [True: 294, False: 37.7k]
  ------------------
 4212|    202|			case 'K': i += 2; break;
  ------------------
  |  Branch (4212:4): [True: 202, False: 37.8k]
  ------------------
 4213|    457|			case 001: i += 1; break;
  ------------------
  |  Branch (4213:4): [True: 457, False: 37.5k]
  ------------------
 4214|    708|			case 002:
  ------------------
  |  Branch (4214:4): [True: 708, False: 37.3k]
  ------------------
 4215|    708|				if (memcmp(p + i, "PK\001\002", 4) == 0) {
  ------------------
  |  Branch (4215:9): [True: 36, False: 672]
  ------------------
 4216|     36|					p += i;
 4217|     36|					found = 1;
 4218|     36|				} else
 4219|    672|					i += 4;
 4220|    708|				break;
 4221|    227|			case 005: i += 1; break;
  ------------------
  |  Branch (4221:4): [True: 227, False: 37.8k]
  ------------------
 4222|    221|			case 006:
  ------------------
  |  Branch (4222:4): [True: 221, False: 37.8k]
  ------------------
 4223|    221|				if (memcmp(p + i, "PK\005\006", 4) == 0) {
  ------------------
  |  Branch (4223:9): [True: 3, False: 218]
  ------------------
 4224|      3|					p += i;
 4225|      3|					found = 1;
 4226|    218|				} else if (memcmp(p + i, "PK\006\006", 4) == 0) {
  ------------------
  |  Branch (4226:16): [True: 0, False: 218]
  ------------------
 4227|      0|					p += i;
 4228|      0|					found = 1;
 4229|      0|				} else
 4230|    218|					i += 1;
 4231|    221|				break;
 4232|  35.9k|			default: i += 4; break;
  ------------------
  |  Branch (4232:4): [True: 35.9k, False: 2.10k]
  ------------------
 4233|  38.0k|			}
 4234|  38.0k|		}
 4235|     39|		__archive_read_consume(a, i);
 4236|     39|	}
 4237|     39|	correction = archive_filter_bytes(&a->archive, 0)
 4238|     39|			- zip->central_directory_offset;
 4239|       |
 4240|     39|	__archive_rb_tree_init(&zip->tree, &rb_ops);
 4241|     39|	__archive_rb_tree_init(&zip->tree_rsrc, &rb_rsrc_ops);
 4242|       |
 4243|  1.12k|	while (1) {
  ------------------
  |  Branch (4243:9): [True: 1.12k, Folded]
  ------------------
 4244|  1.12k|		struct zip_entry *zip_entry;
 4245|  1.12k|		size_t filename_length, extra_length, comment_length;
 4246|  1.12k|		uint32_t external_attributes;
 4247|  1.12k|		const char *name, *r;
 4248|       |
 4249|  1.12k|		if ((p = __archive_read_ahead(a, 4, NULL)) == NULL)
  ------------------
  |  Branch (4249:7): [True: 0, False: 1.12k]
  ------------------
 4250|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4251|  1.12k|		if (memcmp(p, "PK\006\006", 4) == 0
  ------------------
  |  Branch (4251:7): [True: 0, False: 1.12k]
  ------------------
 4252|  1.12k|		    || memcmp(p, "PK\005\006", 4) == 0) {
  ------------------
  |  Branch (4252:10): [True: 23, False: 1.09k]
  ------------------
 4253|     23|			break;
 4254|  1.09k|		} else if (memcmp(p, "PK\001\002", 4) != 0) {
  ------------------
  |  Branch (4254:14): [True: 11, False: 1.08k]
  ------------------
 4255|     11|			archive_set_error(&a->archive,
 4256|     11|			    -1, "Invalid central directory signature");
 4257|     11|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|     11|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4258|     11|		}
 4259|  1.08k|		if ((p = __archive_read_ahead(a, 46, NULL)) == NULL)
  ------------------
  |  Branch (4259:7): [True: 0, False: 1.08k]
  ------------------
 4260|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4261|       |
 4262|  1.08k|		zip_entry = calloc(1, sizeof(struct zip_entry));
 4263|  1.08k|		if (zip_entry == NULL) {
  ------------------
  |  Branch (4263:7): [True: 0, False: 1.08k]
  ------------------
 4264|      0|			archive_set_error(&a->archive, ENOMEM,
 4265|      0|				"Can't allocate zip entry");
 4266|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4267|      0|		}
 4268|  1.08k|		zip_entry->next = zip->zip_entries;
 4269|  1.08k|		zip_entry->flags |= LA_FROM_CENTRAL_DIRECTORY;
  ------------------
  |  |  137|  1.08k|#define LA_FROM_CENTRAL_DIRECTORY (1 << 1)
  ------------------
 4270|  1.08k|		zip->zip_entries = zip_entry;
 4271|       |
 4272|       |		/* version = p[4]; */
 4273|  1.08k|		zip_entry->system = p[5];
 4274|       |		/* version_required = archive_le16dec(p + 6); */
 4275|  1.08k|		zip_entry->zip_flags = archive_le16dec(p + 8);
 4276|  1.08k|		if (zip_entry->zip_flags
  ------------------
  |  Branch (4276:7): [True: 2, False: 1.08k]
  ------------------
 4277|  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)
  ------------------
 4278|      2|			zip->has_encrypted_entries = 1;
 4279|      2|		}
 4280|  1.08k|		zip_entry->compression = (char)archive_le16dec(p + 10);
 4281|  1.08k|		zip_entry->mtime = dos_to_unix(archive_le32dec(p + 12));
 4282|  1.08k|		zip_entry->crc32 = archive_le32dec(p + 16);
 4283|  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 (4283:7): [True: 34, False: 1.05k]
  ------------------
 4284|     34|			zip_entry->decdat = p[13];
 4285|  1.05k|		else
 4286|  1.05k|			zip_entry->decdat = p[19];
 4287|  1.08k|		zip_entry->compressed_size = archive_le32dec(p + 20);
 4288|  1.08k|		zip_entry->uncompressed_size = archive_le32dec(p + 24);
 4289|  1.08k|		filename_length = archive_le16dec(p + 28);
 4290|  1.08k|		extra_length = archive_le16dec(p + 30);
 4291|  1.08k|		comment_length = archive_le16dec(p + 32);
 4292|       |		/* disk_start = archive_le16dec(p + 34);
 4293|       |		 *   Better be zero.
 4294|       |		 * internal_attributes = archive_le16dec(p + 36);
 4295|       |		 *   text bit */
 4296|  1.08k|		external_attributes = archive_le32dec(p + 38);
 4297|  1.08k|		zip_entry->local_header_offset =
 4298|  1.08k|		    archive_le32dec(p + 42) + correction;
 4299|       |
 4300|       |		/* If we can't guess the mode, leave it zero here;
 4301|       |		   when we read the local file header we might get
 4302|       |		   more information. */
 4303|  1.08k|		if (zip_entry->system == 3) {
  ------------------
  |  Branch (4303:7): [True: 429, False: 657]
  ------------------
 4304|    429|			zip_entry->mode = external_attributes >> 16;
 4305|    657|		} else if (zip_entry->system == 0) {
  ------------------
  |  Branch (4305:14): [True: 657, False: 0]
  ------------------
 4306|       |			// Interpret MSDOS directory bit
 4307|    657|			if (0x10 == (external_attributes & 0x10)) {
  ------------------
  |  Branch (4307:8): [True: 104, False: 553]
  ------------------
 4308|    104|				zip_entry->mode = AE_IFDIR | 0775;
  ------------------
  |  |  221|    104|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 4309|    553|			} else {
 4310|    553|				zip_entry->mode = AE_IFREG | 0664;
  ------------------
  |  |  216|    553|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 4311|    553|			}
 4312|    657|			if (0x01 == (external_attributes & 0x01)) {
  ------------------
  |  Branch (4312:8): [True: 0, False: 657]
  ------------------
 4313|       |				// Read-only bit; strip write permissions
 4314|      0|				zip_entry->mode &= 0555;
 4315|      0|			}
 4316|    657|		} else {
 4317|      0|			zip_entry->mode = 0;
 4318|      0|		}
 4319|       |
 4320|       |		/* We're done with the regular data; get the filename and
 4321|       |		 * extra data. */
 4322|  1.08k|		__archive_read_consume(a, 46);
 4323|  1.08k|		p = __archive_read_ahead(a, filename_length + extra_length,
 4324|  1.08k|			NULL);
 4325|  1.08k|		if (p == NULL) {
  ------------------
  |  Branch (4325:7): [True: 1, False: 1.08k]
  ------------------
 4326|      1|			archive_set_error(&a->archive,
 4327|      1|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4328|      1|			    "Truncated ZIP file header");
 4329|      1|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4330|      1|		}
 4331|  1.08k|		if (ARCHIVE_OK != process_extra(a, entry, p + filename_length,
  ------------------
  |  |  233|  1.08k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4331:7): [True: 4, False: 1.08k]
  ------------------
 4332|  1.08k|		    extra_length, zip_entry)) {
 4333|      4|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4334|      4|		}
 4335|       |
 4336|       |		/*
 4337|       |		 * Mac resource fork files are stored under the
 4338|       |		 * "__MACOSX/" directory, so we should check if
 4339|       |		 * it is.
 4340|       |		 */
 4341|  1.08k|		if (!zip->process_mac_extensions) {
  ------------------
  |  Branch (4341:7): [True: 1.08k, False: 0]
  ------------------
 4342|       |			/* Treat every entry as a regular entry. */
 4343|  1.08k|			__archive_rb_tree_insert_node(&zip->tree,
 4344|  1.08k|			    &zip_entry->node);
 4345|  1.08k|		} else {
 4346|      0|			name = p;
 4347|      0|			r = rsrc_basename(name, filename_length);
 4348|      0|			if (filename_length >= 9 &&
  ------------------
  |  Branch (4348:8): [True: 0, False: 0]
  ------------------
 4349|      0|			    strncmp("__MACOSX/", name, 9) == 0) {
  ------------------
  |  Branch (4349:8): [True: 0, False: 0]
  ------------------
 4350|      0|				const char *name_end;
 4351|       |
 4352|      0|				name_end = name + filename_length;
 4353|       |				/* If this file is not a resource fork nor
 4354|       |				 * a directory. We should treat it as a non
 4355|       |				 * resource fork file to expose it. */
 4356|      0|				if (name[filename_length-1] != '/' &&
  ------------------
  |  Branch (4356:9): [True: 0, False: 0]
  ------------------
 4357|      0|				    (name_end - r < 2 || r[0] != '.' || r[1] != '_')) {
  ------------------
  |  Branch (4357:10): [True: 0, False: 0]
  |  Branch (4357:30): [True: 0, False: 0]
  |  Branch (4357:45): [True: 0, False: 0]
  ------------------
 4358|      0|					__archive_rb_tree_insert_node(
 4359|      0|					    &zip->tree, &zip_entry->node);
 4360|       |					/* Expose its parent directories. */
 4361|      0|					expose_parent_dirs(zip, name,
 4362|      0|					    filename_length);
 4363|      0|				} else {
 4364|       |					/* This file is a resource fork file or
 4365|       |					 * a directory. */
 4366|      0|					archive_strncpy(&(zip_entry->rsrcname),
  ------------------
  |  |  173|      0|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 4367|      0|					     name, filename_length);
 4368|      0|					__archive_rb_tree_insert_node(
 4369|      0|					    &zip->tree_rsrc, &zip_entry->node);
 4370|      0|				}
 4371|      0|			} else {
 4372|       |				/* Generate resource fork name to find its
 4373|       |				 * resource file at zip->tree_rsrc. */
 4374|       |
 4375|       |				/* If this is an entry ending with slash,
 4376|       |				 * make the resource for name slash-less
 4377|       |				 * as the actual resource fork doesn't end with '/'.
 4378|       |				 */
 4379|      0|				size_t tmp_length = filename_length;
 4380|      0|				if (tmp_length > 0 && name[tmp_length - 1] == '/') {
  ------------------
  |  Branch (4380:9): [True: 0, False: 0]
  |  Branch (4380:27): [True: 0, False: 0]
  ------------------
 4381|      0|					tmp_length--;
 4382|      0|					r = rsrc_basename(name, tmp_length);
 4383|      0|				}
 4384|       |
 4385|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4386|      0|				    "__MACOSX/");
 4387|      0|				archive_strncat(&(zip_entry->rsrcname),
 4388|      0|				    name, r - name);
 4389|      0|				archive_strcat(&(zip_entry->rsrcname), "._");
 4390|      0|				archive_strncat(&(zip_entry->rsrcname),
 4391|      0|				    name + (r - name),
 4392|      0|				    tmp_length - (r - name));
 4393|       |				/* Register an entry to RB tree to sort it by
 4394|       |				 * file offset. */
 4395|      0|				__archive_rb_tree_insert_node(&zip->tree,
 4396|      0|				    &zip_entry->node);
 4397|      0|			}
 4398|      0|		}
 4399|       |
 4400|       |		/* Skip the comment too ... */
 4401|  1.08k|		__archive_read_consume(a,
 4402|  1.08k|		    filename_length + extra_length + comment_length);
 4403|  1.08k|	}
 4404|       |
 4405|     23|	return ARCHIVE_OK;
  ------------------
  |  |  233|     23|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4406|     39|}
archive_read_support_format_zip.c:cmp_node:
 4094|  6.83k|{
 4095|  6.83k|	const struct zip_entry *e1 = (const struct zip_entry *)n1;
 4096|  6.83k|	const struct zip_entry *e2 = (const struct zip_entry *)n2;
 4097|       |
 4098|  6.83k|	if (e1->local_header_offset > e2->local_header_offset)
  ------------------
  |  Branch (4098:6): [True: 701, False: 6.13k]
  ------------------
 4099|    701|		return -1;
 4100|  6.13k|	if (e1->local_header_offset < e2->local_header_offset)
  ------------------
  |  Branch (4100:6): [True: 6.13k, False: 0]
  ------------------
 4101|  6.13k|		return 1;
 4102|      0|	return 0;
 4103|  6.13k|}
archive_read_support_format_zip.c:archive_read_format_zip_read_data_skip_seekable:
 4665|    208|{
 4666|    208|	struct zip *zip;
 4667|    208|	zip = (struct zip *)(a->format->data);
 4668|       |
 4669|    208|	zip->unconsumed = 0;
 4670|    208|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    208|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4671|    208|}
archive_read_support_format_zip.c:archive_read_support_format_zip_capabilities_seekable:
 3934|     78|{
 3935|     78|	(void)a; /* UNUSED */
 3936|     78|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA |
  ------------------
  |  |  398|     78|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
 3937|     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.) */
  ------------------
 3938|     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.93M|{
  272|  5.93M|	as->length = 0;
  273|  5.93M|	as->buffer_length = 0;
  274|  5.93M|	free(as->s);
  275|       |	as->s = NULL;
  276|  5.93M|}
archive_wstring_free:
  280|  1.87M|{
  281|  1.87M|	as->length = 0;
  282|  1.87M|	as->buffer_length = 0;
  283|  1.87M|	free(as->s);
  284|       |	as->s = NULL;
  285|  1.87M|}
archive_wstring_ensure:
  289|   113k|{
  290|   113k|	return (struct archive_wstring *)
  291|   113k|		archive_string_ensure((struct archive_string *)as,
  292|   113k|					s * sizeof(wchar_t));
  293|   113k|}
archive_string_ensure:
  298|  12.8M|{
  299|  12.8M|	char *p;
  300|  12.8M|	size_t new_length;
  301|       |
  302|       |	/* If buffer is already big enough, don't reallocate. */
  303|  12.8M|	if (as->s && (s <= as->buffer_length))
  ------------------
  |  Branch (303:6): [True: 12.4M, False: 383k]
  |  Branch (303:15): [True: 12.4M, False: 15.0k]
  ------------------
  304|  12.4M|		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|   398k|	if (as->buffer_length < 32)
  ------------------
  |  Branch (313:6): [True: 383k, False: 15.0k]
  ------------------
  314|       |		/* Start with a minimum 32-character buffer. */
  315|   383k|		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|   398k|	if (new_length < s)
  ------------------
  |  Branch (335:6): [True: 86.7k, False: 312k]
  ------------------
  336|  86.7k|		new_length = s;
  337|       |	/* Now we can reallocate the buffer. */
  338|   398k|	p = realloc(as->s, new_length);
  339|   398k|	if (p == NULL) {
  ------------------
  |  Branch (339:6): [True: 0, False: 398k]
  ------------------
  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|   398k|	as->s = p;
  347|   398k|	as->buffer_length = new_length;
  348|   398k|	return (as);
  349|   398k|}
archive_strncat:
  360|   178k|{
  361|   178k|	size_t s;
  362|   178k|	const char *p, *pp;
  363|       |
  364|   178k|	p = (const char *)_p;
  365|       |
  366|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
  367|   178k|	s = 0;
  368|   178k|	pp = p;
  369|  62.0M|	while (s < n && *pp) {
  ------------------
  |  Branch (369:9): [True: 61.9M, False: 87.2k]
  |  Branch (369:18): [True: 61.8M, False: 91.1k]
  ------------------
  370|  61.8M|		pp++;
  371|  61.8M|		s++;
  372|  61.8M|	}
  373|   178k|	if ((as = archive_string_append(as, p, s)) == NULL)
  ------------------
  |  Branch (373:6): [True: 0, False: 178k]
  ------------------
  374|      0|		__archive_errx(1, "Out of memory");
  375|   178k|	return (as);
  376|   178k|}
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|  73.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|  73.0k|	return archive_strncat(as, p, 0x1000000);
  406|  73.0k|}
archive_wstrcat:
  410|    104|{
  411|       |	/* Ditto. */
  412|    104|	return archive_wstrncat(as, p, 0x1000000);
  413|    104|}
archive_strappend_char:
  417|  11.9M|{
  418|  11.9M|	if ((as = archive_string_append(as, &c, 1)) == NULL)
  ------------------
  |  Branch (418:6): [True: 0, False: 11.9M]
  ------------------
  419|      0|		__archive_errx(1, "Out of memory");
  420|  11.9M|	return (as);
  421|  11.9M|}
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|   101k|{
  622|   101k|	size_t r;
  623|   101k|	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|   101k|	size_t mbs_length = len;
  630|   101k|	const char *mbs = p;
  631|   101k|	wchar_t *wcs;
  632|   101k|#if HAVE_MBRTOWC
  633|   101k|	mbstate_t shift_state;
  634|       |
  635|   101k|	memset(&shift_state, 0, sizeof(shift_state));
  636|   101k|#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|   101k|	if (NULL == archive_wstring_ensure(dest, dest->length + len + 1))
  ------------------
  |  Branch (641:6): [True: 0, False: 101k]
  ------------------
  642|      0|		return (-1);
  643|   101k|	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.6M|	while (*mbs && mbs_length > 0) {
  ------------------
  |  Branch (649:9): [True: 24.5M, False: 71.9k]
  |  Branch (649:17): [True: 24.5M, 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.5M|#if HAVE_MBRTOWC
  667|  24.5M|		r = mbrtowc(wcs, mbs, mbs_length, &shift_state);
  668|       |#else
  669|       |		r = mbtowc(wcs, mbs, mbs_length);
  670|       |#endif
  671|  24.5M|		if (r == (size_t)-1 || r == (size_t)-2) {
  ------------------
  |  Branch (671:7): [True: 29.4k, False: 24.5M]
  |  Branch (671:26): [True: 0, False: 24.5M]
  ------------------
  672|  29.4k|			ret_val = -1;
  673|  29.4k|			break;
  674|  29.4k|		}
  675|  24.5M|		if (r == 0 || r > mbs_length)
  ------------------
  |  Branch (675:7): [True: 0, False: 24.5M]
  |  Branch (675:17): [True: 0, False: 24.5M]
  ------------------
  676|      0|			break;
  677|  24.5M|		wcs++;
  678|       |		// wcs_length--;
  679|  24.5M|		mbs += r;
  680|  24.5M|		mbs_length -= r;
  681|  24.5M|	}
  682|   101k|	dest->length = wcs - dest->s;
  683|   101k|	dest->s[dest->length] = L'\0';
  684|   101k|	return (ret_val);
  685|   101k|}
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|  81.2k|{
 1777|  81.2k|	int flag = SCONV_TO_CHARSET;
  ------------------
  |  |   89|  81.2k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
 1778|       |
 1779|  81.2k|	if (best_effort)
  ------------------
  |  Branch (1779:6): [True: 81.2k, False: 0]
  ------------------
 1780|  81.2k|		flag |= SCONV_BEST_EFFORT;
  ------------------
  |  |   93|  81.2k|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
 1781|  81.2k|	return (get_sconv_object(a, get_current_charset(a), charset, flag));
 1782|  81.2k|}
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: 458, False: 2.49k]
  ------------------
 1872|    458|		sc_next = sc->next;
 1873|    458|		free_sconv_object(sc);
 1874|    458|	}
 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|   183k|{
 2009|   183k|	as->length = 0;
 2010|   183k|	return (archive_strncat_l(as, _p, n, sc));
 2011|   183k|}
archive_strncat_l:
 2016|   183k|{
 2017|   183k|	const void *s;
 2018|   183k|	size_t length = 0;
 2019|   183k|	int i, r = 0, r2;
 2020|       |
 2021|   183k|	if (_p != NULL && n > 0) {
  ------------------
  |  Branch (2021:6): [True: 183k, False: 0]
  |  Branch (2021:20): [True: 119k, False: 63.7k]
  ------------------
 2022|   119k|		if (sc != NULL && (sc->flag & SCONV_FROM_UTF16))
  ------------------
  |  |  112|  59.3k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  59.3k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  59.3k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2022:7): [True: 59.3k, False: 60.4k]
  |  Branch (2022:21): [True: 670, False: 58.6k]
  ------------------
 2023|    670|			length = utf16nbytes(_p, n);
 2024|   119k|		else
 2025|   119k|			length = mbsnbytes(_p, n);
 2026|   119k|	}
 2027|       |
 2028|       |	/* We must allocate memory even if there is no data for conversion
 2029|       |	 * or copy. This simulates archive_string_append behavior. */
 2030|   183k|	if (length == 0) {
  ------------------
  |  Branch (2030:6): [True: 76.8k, False: 106k]
  ------------------
 2031|  76.8k|		size_t tn = 1;
 2032|  76.8k|		if (sc != NULL && (sc->flag & SCONV_TO_UTF16))
  ------------------
  |  |  111|  46.2k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|  46.2k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|  46.2k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2032:7): [True: 46.2k, False: 30.6k]
  |  Branch (2032:21): [True: 0, False: 46.2k]
  ------------------
 2033|      0|			tn = 2;
 2034|  76.8k|		if (archive_string_ensure(as, as->length + tn) == NULL)
  ------------------
  |  Branch (2034:7): [True: 0, False: 76.8k]
  ------------------
 2035|      0|			return (-1);
 2036|  76.8k|		as->s[as->length] = 0;
 2037|  76.8k|		if (tn == 2)
  ------------------
  |  Branch (2037:7): [True: 0, False: 76.8k]
  ------------------
 2038|      0|			as->s[as->length+1] = 0;
 2039|  76.8k|		return (0);
 2040|  76.8k|	}
 2041|       |
 2042|       |	/*
 2043|       |	 * If sc is NULL, we just make a copy.
 2044|       |	 */
 2045|   106k|	if (sc == NULL) {
  ------------------
  |  Branch (2045:6): [True: 47.5k, False: 59.1k]
  ------------------
 2046|  47.5k|		if (archive_string_append(as, _p, length) == NULL)
  ------------------
  |  Branch (2046:7): [True: 0, False: 47.5k]
  ------------------
 2047|      0|			return (-1);/* No memory */
 2048|  47.5k|		return (0);
 2049|  47.5k|	}
 2050|       |
 2051|  59.1k|	s = _p;
 2052|  59.1k|	i = 0;
 2053|  59.1k|	if (sc->nconverter > 1) {
  ------------------
  |  Branch (2053:6): [True: 12.8k, False: 46.3k]
  ------------------
 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.89k, False: 6.90k]
  |  Branch (2056:18): [True: 0, False: 5.89k]
  ------------------
 2057|      0|			return (r2);
 2058|  12.8k|		if (r > r2)
  ------------------
  |  Branch (2058:7): [True: 5.89k, False: 6.90k]
  ------------------
 2059|  5.89k|			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.1k|	r2 = sc->converter[i](as, s, length, sc);
 2065|  59.1k|	if (r > r2)
  ------------------
  |  Branch (2065:6): [True: 17.2k, False: 41.8k]
  ------------------
 2066|  17.2k|		r = r2;
 2067|  59.1k|	return (r);
 2068|  59.1k|}
archive_mstring_clean:
 3922|  1.86M|{
 3923|  1.86M|	archive_wstring_free(&(aes->aes_wcs));
 3924|  1.86M|	archive_string_free(&(aes->aes_mbs));
 3925|  1.86M|	archive_string_free(&(aes->aes_utf8));
 3926|  1.86M|	archive_string_free(&(aes->aes_mbs_in_locale));
 3927|  1.86M|	aes->aes_set = 0;
 3928|  1.86M|}
archive_mstring_get_utf8:
 3942|  90.1k|{
 3943|  90.1k|	struct archive_string_conv *sc;
 3944|  90.1k|	int r;
 3945|       |
 3946|       |	/* If we already have a UTF8 form, return that immediately. */
 3947|  90.1k|	if (aes->aes_set & AES_SET_UTF8) {
  ------------------
  |  |  221|  90.1k|#define	AES_SET_UTF8 2
  ------------------
  |  Branch (3947:6): [True: 6.93k, False: 83.2k]
  ------------------
 3948|  6.93k|		*p = aes->aes_utf8.s;
 3949|  6.93k|		return (0);
 3950|  6.93k|	}
 3951|       |
 3952|  83.2k|	*p = NULL;
 3953|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 3954|       |	/*
 3955|       |	 * On Windows, first try converting from WCS because (1) there's no
 3956|       |	 * guarantee that the conversion to MBS will succeed, e.g. when using
 3957|       |	 * CP_ACP, and (2) that's more efficient than converting to MBS, just to
 3958|       |	 * convert back to WCS again before finally converting to UTF-8
 3959|       |	 */
 3960|       |	if ((aes->aes_set & AES_SET_WCS) != 0) {
 3961|       |		sc = archive_string_conversion_to_charset(a, "UTF-8", 1);
 3962|       |		if (sc == NULL)
 3963|       |			return (-1);/* Couldn't allocate memory for sc. */
 3964|       |		archive_string_empty(&(aes->aes_utf8));
 3965|       |		r = archive_string_append_from_wcs_in_codepage(&(aes->aes_utf8),
 3966|       |			aes->aes_wcs.s, aes->aes_wcs.length, sc);
 3967|       |		if (a == NULL)
 3968|       |			free_sconv_object(sc);
 3969|       |		if (r == 0) {
 3970|       |			aes->aes_set |= AES_SET_UTF8;
 3971|       |			*p = aes->aes_utf8.s;
 3972|       |			return (0);/* success. */
 3973|       |		} else
 3974|       |			return (-1);/* failure. */
 3975|       |	}
 3976|       |#endif
 3977|       |	/* Try converting WCS to MBS first if MBS does not exist yet. */
 3978|  83.2k|	if ((aes->aes_set & AES_SET_MBS) == 0) {
  ------------------
  |  |  220|  83.2k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (3978:6): [True: 1.96k, False: 81.2k]
  ------------------
 3979|  1.96k|		const char *pm; /* unused */
 3980|  1.96k|		archive_mstring_get_mbs(a, aes, &pm); /* ignore errors, we'll handle it later */
 3981|  1.96k|	}
 3982|  83.2k|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|  83.2k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (3982:6): [True: 81.2k, False: 1.96k]
  ------------------
 3983|  81.2k|		sc = archive_string_conversion_to_charset(a, "UTF-8", 1);
 3984|  81.2k|		if (sc == NULL)
  ------------------
  |  Branch (3984:7): [True: 0, False: 81.2k]
  ------------------
 3985|      0|			return (-1);/* Couldn't allocate memory for sc. */
 3986|  81.2k|		r = archive_strncpy_l(&(aes->aes_utf8), aes->aes_mbs.s,
 3987|  81.2k|		    aes->aes_mbs.length, sc);
 3988|  81.2k|		if (a == NULL)
  ------------------
  |  Branch (3988:7): [True: 81.2k, False: 0]
  ------------------
 3989|  81.2k|			free_sconv_object(sc);
 3990|  81.2k|		if (r == 0) {
  ------------------
  |  Branch (3990:7): [True: 64.7k, False: 16.5k]
  ------------------
 3991|  64.7k|			aes->aes_set |= AES_SET_UTF8;
  ------------------
  |  |  221|  64.7k|#define	AES_SET_UTF8 2
  ------------------
 3992|  64.7k|			*p = aes->aes_utf8.s;
 3993|  64.7k|			return (0);/* success. */
 3994|  64.7k|		} else
 3995|  16.5k|			return (-1);/* failure. */
 3996|  81.2k|	}
 3997|  1.96k|	return (0);/* success. */
 3998|  83.2k|}
archive_mstring_get_mbs:
 4003|   211k|{
 4004|   211k|	struct archive_string_conv *sc;
 4005|   211k|	int r, ret = 0;
 4006|       |
 4007|       |	/* If we already have an MBS form, return that immediately. */
 4008|   211k|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|   211k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4008:6): [True: 126k, False: 85.5k]
  ------------------
 4009|   126k|		*p = aes->aes_mbs.s;
 4010|   126k|		return (ret);
 4011|   126k|	}
 4012|       |
 4013|  85.5k|	*p = NULL;
 4014|       |	/* If there's a WCS form, try converting with the native locale. */
 4015|  85.5k|	if (aes->aes_set & AES_SET_WCS) {
  ------------------
  |  |  222|  85.5k|#define	AES_SET_WCS 4
  ------------------
  |  Branch (4015:6): [True: 3.35k, False: 82.1k]
  ------------------
 4016|  3.35k|		archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  3.35k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4017|  3.35k|		r = archive_string_append_from_wcs(&(aes->aes_mbs),
 4018|  3.35k|		    aes->aes_wcs.s, aes->aes_wcs.length);
 4019|  3.35k|		*p = aes->aes_mbs.s;
 4020|  3.35k|		if (r == 0) {
  ------------------
  |  Branch (4020:7): [True: 3.35k, False: 0]
  ------------------
 4021|  3.35k|			aes->aes_set |= AES_SET_MBS;
  ------------------
  |  |  220|  3.35k|#define	AES_SET_MBS 1
  ------------------
 4022|  3.35k|			return (ret);
 4023|  3.35k|		} else
 4024|      0|			ret = -1;
 4025|  3.35k|	}
 4026|       |
 4027|       |	/* If there's a UTF-8 form, try converting with the native locale. */
 4028|  82.1k|	if (aes->aes_set & AES_SET_UTF8) {
  ------------------
  |  |  221|  82.1k|#define	AES_SET_UTF8 2
  ------------------
  |  Branch (4028:6): [True: 12, False: 82.1k]
  ------------------
 4029|     12|		archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|     12|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4030|     12|		sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 4031|     12|		if (sc == NULL)
  ------------------
  |  Branch (4031:7): [True: 0, False: 12]
  ------------------
 4032|      0|			return (-1);/* Couldn't allocate memory for sc. */
 4033|     12|		r = archive_strncpy_l(&(aes->aes_mbs),
 4034|     12|			aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4035|     12|		if (a == NULL)
  ------------------
  |  Branch (4035:7): [True: 12, False: 0]
  ------------------
 4036|     12|			free_sconv_object(sc);
 4037|     12|		*p = aes->aes_mbs.s;
 4038|     12|		if (r == 0) {
  ------------------
  |  Branch (4038:7): [True: 0, False: 12]
  ------------------
 4039|      0|			aes->aes_set |= AES_SET_MBS;
  ------------------
  |  |  220|      0|#define	AES_SET_MBS 1
  ------------------
 4040|      0|			ret = 0;/* success; overwrite previous error. */
 4041|      0|		} else
 4042|     12|			ret = -1;/* failure. */
 4043|     12|	}
 4044|  82.1k|	return (ret);
 4045|  82.1k|}
archive_mstring_get_wcs:
 4050|   168k|{
 4051|   168k|	int r, ret = 0;
 4052|       |
 4053|   168k|	(void)a;/* UNUSED */
 4054|       |	/* Return WCS form if we already have it. */
 4055|   168k|	if (aes->aes_set & AES_SET_WCS) {
  ------------------
  |  |  222|   168k|#define	AES_SET_WCS 4
  ------------------
  |  Branch (4055:6): [True: 40.0k, False: 128k]
  ------------------
 4056|  40.0k|		*wp = aes->aes_wcs.s;
 4057|  40.0k|		return (ret);
 4058|  40.0k|	}
 4059|       |
 4060|   128k|	*wp = NULL;
 4061|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 4062|       |	/*
 4063|       |	 * On Windows, prefer converting from UTF-8 directly to WCS because:
 4064|       |	 * (1) there's no guarantee that the string can be represented in MBS (e.g.
 4065|       |	 * with CP_ACP), and (2) in order to convert from UTF-8 to MBS, we're going
 4066|       |	 * to need to convert from UTF-8 to WCS anyway and its wasteful to throw
 4067|       |	 * away that intermediate result
 4068|       |	 */
 4069|       |	if (aes->aes_set & AES_SET_UTF8) {
 4070|       |		struct archive_string_conv *sc;
 4071|       |
 4072|       |		sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 4073|       |		if (sc != NULL) {
 4074|       |			archive_wstring_empty((&aes->aes_wcs));
 4075|       |			r = archive_wstring_append_from_mbs_in_codepage(&(aes->aes_wcs),
 4076|       |			    aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4077|       |			if (a == NULL)
 4078|       |				free_sconv_object(sc);
 4079|       |			if (r == 0) {
 4080|       |				aes->aes_set |= AES_SET_WCS;
 4081|       |				*wp = aes->aes_wcs.s;
 4082|       |				return (0);
 4083|       |			}
 4084|       |		}
 4085|       |	}
 4086|       |#endif
 4087|       |	/* Try converting UTF8 to MBS first if MBS does not exist yet. */
 4088|   128k|	if ((aes->aes_set & AES_SET_MBS) == 0) {
  ------------------
  |  |  220|   128k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4088:6): [True: 34.1k, False: 94.2k]
  ------------------
 4089|  34.1k|		const char *p; /* unused */
 4090|  34.1k|		archive_mstring_get_mbs(a, aes, &p); /* ignore errors, we'll handle it later */
 4091|  34.1k|	}
 4092|       |	/* Try converting MBS to WCS using native locale. */
 4093|   128k|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|   128k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4093:6): [True: 94.2k, False: 34.1k]
  ------------------
 4094|  94.2k|		archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  94.2k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4095|  94.2k|		r = archive_wstring_append_from_mbs(&(aes->aes_wcs),
 4096|  94.2k|		    aes->aes_mbs.s, aes->aes_mbs.length);
 4097|  94.2k|		if (r == 0) {
  ------------------
  |  Branch (4097:7): [True: 64.7k, False: 29.4k]
  ------------------
 4098|  64.7k|			aes->aes_set |= AES_SET_WCS;
  ------------------
  |  |  222|  64.7k|#define	AES_SET_WCS 4
  ------------------
 4099|  64.7k|			*wp = aes->aes_wcs.s;
 4100|  64.7k|		} else
 4101|  29.4k|			ret = -1;/* failure. */
 4102|  94.2k|	}
 4103|   128k|	return (ret);
 4104|   168k|}
archive_mstring_copy_mbs:
 4174|  25.5k|{
 4175|  25.5k|	if (mbs == NULL) {
  ------------------
  |  Branch (4175:6): [True: 2.85k, False: 22.6k]
  ------------------
 4176|  2.85k|		aes->aes_set = 0;
 4177|  2.85k|		return (0);
 4178|  2.85k|	}
 4179|  22.6k|	return (archive_mstring_copy_mbs_len(aes, mbs, strlen(mbs)));
 4180|  25.5k|}
archive_mstring_copy_mbs_len:
 4185|  25.9k|{
 4186|  25.9k|	if (mbs == NULL) {
  ------------------
  |  Branch (4186:6): [True: 0, False: 25.9k]
  ------------------
 4187|      0|		aes->aes_set = 0;
 4188|      0|		return (0);
 4189|      0|	}
 4190|  25.9k|	aes->aes_set = AES_SET_MBS; /* Only MBS form is set now. */
  ------------------
  |  |  220|  25.9k|#define	AES_SET_MBS 1
  ------------------
 4191|  25.9k|	archive_strncpy(&(aes->aes_mbs), mbs, len);
  ------------------
  |  |  173|  25.9k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 4192|  25.9k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|  25.9k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4193|  25.9k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  25.9k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4194|  25.9k|	return (0);
 4195|  25.9k|}
archive_mstring_copy_wcs:
 4199|  3.45k|{
 4200|  3.45k|	return archive_mstring_copy_wcs_len(aes, wcs,
 4201|  3.45k|				wcs == NULL ? 0 : wcslen(wcs));
  ------------------
  |  Branch (4201:5): [True: 0, False: 3.45k]
  ------------------
 4202|  3.45k|}
archive_mstring_copy_wcs_len:
 4221|  3.45k|{
 4222|  3.45k|	if (wcs == NULL) {
  ------------------
  |  Branch (4222:6): [True: 0, False: 3.45k]
  ------------------
 4223|      0|		aes->aes_set = 0;
 4224|      0|		return (0);
 4225|      0|	}
 4226|  3.45k|	aes->aes_set = AES_SET_WCS; /* Only WCS form set. */
  ------------------
  |  |  222|  3.45k|#define	AES_SET_WCS 4
  ------------------
 4227|  3.45k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  3.45k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4228|  3.45k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|  3.45k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4229|  3.45k|	archive_wstrncpy(&(aes->aes_wcs), wcs, len);
  ------------------
  |  |  175|  3.45k|	((as)->length = 0, archive_wstrncat((as), (p), (l)))
  ------------------
 4230|  3.45k|	return (0);
 4231|  3.45k|}
archive_mstring_copy_mbs_len_l:
 4236|  94.6k|{
 4237|  94.6k|	int r;
 4238|       |
 4239|  94.6k|	if (mbs == NULL) {
  ------------------
  |  Branch (4239:6): [True: 2.86k, False: 91.8k]
  ------------------
 4240|  2.86k|		aes->aes_set = 0;
 4241|  2.86k|		return (0);
 4242|  2.86k|	}
 4243|  91.8k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  91.8k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4244|  91.8k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  91.8k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4245|  91.8k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|  91.8k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4246|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 4247|       |	/*
 4248|       |	 * Internationalization programming on Windows must use Wide
 4249|       |	 * characters because Windows platform cannot make locale UTF-8.
 4250|       |	 */
 4251|       |	if (sc == NULL) {
 4252|       |		if (archive_string_append(&(aes->aes_mbs),
 4253|       |			mbs, mbsnbytes(mbs, len)) == NULL) {
 4254|       |			aes->aes_set = 0;
 4255|       |			r = -1;
 4256|       |		} else {
 4257|       |			aes->aes_set = AES_SET_MBS;
 4258|       |			r = 0;
 4259|       |		}
 4260|       |#if defined(HAVE_ICONV)
 4261|       |	} else if (sc != NULL && sc->cd_w != (iconv_t)-1) {
 4262|       |		/*
 4263|       |		 * This case happens only when MultiByteToWideChar() cannot
 4264|       |		 * handle sc->from_cp, and we have to iconv in order to
 4265|       |		 * translate character-set to wchar_t,UTF-16.
 4266|       |		 */
 4267|       |		iconv_t cd = sc->cd;
 4268|       |		unsigned from_cp;
 4269|       |		int flag;
 4270|       |
 4271|       |		/*
 4272|       |		 * Translate multi-bytes from some character-set to UTF-8.
 4273|       |		 */ 
 4274|       |		sc->cd = sc->cd_w;
 4275|       |		r = archive_strncpy_l(&(aes->aes_utf8), mbs, len, sc);
 4276|       |		sc->cd = cd;
 4277|       |		if (r != 0) {
 4278|       |			aes->aes_set = 0;
 4279|       |			return (r);
 4280|       |		}
 4281|       |		aes->aes_set = AES_SET_UTF8;
 4282|       |
 4283|       |		/*
 4284|       |		 * Append the UTF-8 string into wstring.
 4285|       |		 */ 
 4286|       |		flag = sc->flag;
 4287|       |		sc->flag &= ~(SCONV_NORMALIZATION_C
 4288|       |				| SCONV_TO_UTF16| SCONV_FROM_UTF16);
 4289|       |		from_cp = sc->from_cp;
 4290|       |		sc->from_cp = CP_UTF8;
 4291|       |		r = archive_wstring_append_from_mbs_in_codepage(&(aes->aes_wcs),
 4292|       |			aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4293|       |		sc->flag = flag;
 4294|       |		sc->from_cp = from_cp;
 4295|       |		if (r == 0)
 4296|       |			aes->aes_set |= AES_SET_WCS;
 4297|       |#endif
 4298|       |	} else {
 4299|       |		r = archive_wstring_append_from_mbs_in_codepage(
 4300|       |		    &(aes->aes_wcs), mbs, len, sc);
 4301|       |		if (r == 0)
 4302|       |			aes->aes_set = AES_SET_WCS;
 4303|       |		else
 4304|       |			aes->aes_set = 0;
 4305|       |	}
 4306|       |#else
 4307|  91.8k|	r = archive_strncpy_l(&(aes->aes_mbs), mbs, len, sc);
 4308|  91.8k|	if (r == 0)
  ------------------
  |  Branch (4308:6): [True: 88.3k, False: 3.43k]
  ------------------
 4309|  88.3k|		aes->aes_set = AES_SET_MBS; /* Only MBS form is set now. */
  ------------------
  |  |  220|  88.3k|#define	AES_SET_MBS 1
  ------------------
 4310|  3.43k|	else
 4311|  3.43k|		aes->aes_set = 0;
 4312|  91.8k|#endif
 4313|  91.8k|	return (r);
 4314|  94.6k|}
archive_mstring_update_utf8:
 4329|  10.4k|{
 4330|  10.4k|	struct archive_string_conv *sc;
 4331|  10.4k|	int r;
 4332|       |
 4333|  10.4k|	if (utf8 == NULL) {
  ------------------
  |  Branch (4333:6): [True: 0, False: 10.4k]
  ------------------
 4334|      0|		aes->aes_set = 0;
 4335|      0|		return (0); /* Succeeded in clearing everything. */
 4336|      0|	}
 4337|       |
 4338|       |	/* Save the UTF8 string. */
 4339|  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4340|       |
 4341|       |	/* Empty the mbs and wcs strings. */
 4342|  10.4k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  10.4k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4343|  10.4k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  10.4k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4344|       |
 4345|  10.4k|	aes->aes_set = AES_SET_UTF8;	/* Only UTF8 is set now. */
  ------------------
  |  |  221|  10.4k|#define	AES_SET_UTF8 2
  ------------------
 4346|       |
 4347|  10.4k|	sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 4348|  10.4k|	if (sc == NULL)
  ------------------
  |  Branch (4348:6): [True: 0, False: 10.4k]
  ------------------
 4349|      0|		return (-1);/* Couldn't allocate memory for sc. */
 4350|       |
 4351|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 4352|       |	/* On Windows, there's no good way to convert from UTF8 -> MBS directly, so
 4353|       |	 * prefer to first convert to WCS as (1) it's wasteful to throw away the
 4354|       |	 * intermediate result, and (2) WCS will still be set even if we fail to
 4355|       |	 * convert to MBS (e.g. with ACP that can't represent the characters) */
 4356|       |	r = archive_wstring_append_from_mbs_in_codepage(&(aes->aes_wcs),
 4357|       |		aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4358|       |
 4359|       |	if (a == NULL)
 4360|       |		free_sconv_object(sc);
 4361|       |	if (r != 0)
 4362|       |		return (-1); /* This will guarantee we can't convert to MBS */
 4363|       |	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS; /* Both UTF8 and WCS set. */
 4364|       |
 4365|       |	/* Try converting WCS to MBS, return false on failure. */
 4366|       |	if (archive_string_append_from_wcs(&(aes->aes_mbs), aes->aes_wcs.s,
 4367|       |	    aes->aes_wcs.length))
 4368|       |		return (-1);
 4369|       |#else
 4370|       |	/* Try converting UTF-8 to MBS, return false on failure. */
 4371|  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]
  |  |  ------------------
  ------------------
 4372|       |
 4373|  10.4k|	if (a == NULL)
  ------------------
  |  Branch (4373:6): [True: 10.4k, False: 0]
  ------------------
 4374|  10.4k|		free_sconv_object(sc);
 4375|  10.4k|	if (r != 0)
  ------------------
  |  Branch (4375:6): [True: 3.18k, False: 7.23k]
  ------------------
 4376|  3.18k|		return (-1);
 4377|  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
  ------------------
 4378|       |
 4379|       |	/* Try converting MBS to WCS, return false on failure. */
 4380|  7.23k|	if (archive_wstring_append_from_mbs(&(aes->aes_wcs), aes->aes_mbs.s,
  ------------------
  |  Branch (4380:6): [True: 0, False: 7.23k]
  ------------------
 4381|  7.23k|	    aes->aes_mbs.length))
 4382|      0|		return (-1);
 4383|  7.23k|#endif
 4384|       |
 4385|       |	/* All conversions succeeded. */
 4386|  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
  ------------------
 4387|       |
 4388|  7.23k|	return (0);
 4389|  7.23k|}
archive_string.c:archive_string_append:
  226|  12.2M|{
  227|  12.2M|	if (archive_string_ensure(as, as->length + s + 1) == NULL)
  ------------------
  |  Branch (227:6): [True: 0, False: 12.2M]
  ------------------
  228|      0|		return (NULL);
  229|  12.2M|	if (s)
  ------------------
  |  Branch (229:6): [True: 12.2M, False: 13.4k]
  ------------------
  230|  12.2M|		memmove(as->s + as->length, p, s);
  231|  12.2M|	as->length += s;
  232|  12.2M|	as->s[as->length] = 0;
  233|  12.2M|	return (as);
  234|  12.2M|}
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|  92.1k|{
 1695|  92.1k|	struct archive_string_conv *sc;
 1696|  92.1k|	unsigned current_codepage;
 1697|       |
 1698|       |	/* Check if we have made the sconv object. */
 1699|  92.1k|	sc = find_sconv_object(a, fc, tc);
 1700|  92.1k|	if (sc != NULL)
  ------------------
  |  Branch (1700:6): [True: 0, False: 92.1k]
  ------------------
 1701|      0|		return (sc);
 1702|       |
 1703|  92.1k|	if (a == NULL)
  ------------------
  |  Branch (1703:6): [True: 91.7k, False: 458]
  ------------------
 1704|  91.7k|		current_codepage = get_current_codepage();
 1705|    458|	else
 1706|    458|		current_codepage = a->current_codepage;
 1707|       |
 1708|  92.1k|	sc = create_sconv_object(canonical_charset_name(fc),
 1709|  92.1k|	    canonical_charset_name(tc), current_codepage, flag);
 1710|  92.1k|	if (sc == NULL) {
  ------------------
  |  Branch (1710:6): [True: 0, False: 92.1k]
  ------------------
 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|  92.1k|	if (sc->nconverter == 0) {
  ------------------
  |  Branch (1722:6): [True: 0, False: 92.1k]
  ------------------
 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|  92.1k|	if (a != NULL)
  ------------------
  |  Branch (1742:6): [True: 458, False: 91.7k]
  ------------------
 1743|    458|		add_sconv_object(a, sc);
 1744|  92.1k|	return (sc);
 1745|  92.1k|}
archive_string.c:find_sconv_object:
  906|  92.1k|{
  907|  92.1k|	struct archive_string_conv *sc; 
  908|       |
  909|  92.1k|	if (a == NULL)
  ------------------
  |  Branch (909:6): [True: 91.7k, False: 458]
  ------------------
  910|  91.7k|		return (NULL);
  911|       |
  912|    458|	for (sc = a->sconv; sc != NULL; sc = sc->next) {
  ------------------
  |  Branch (912:22): [True: 0, False: 458]
  ------------------
  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|    458|	return (sc);
  918|  92.1k|}
archive_string.c:get_current_codepage:
 1672|  92.1k|{
 1673|  92.1k|	return (-1);/* Unknown */
 1674|  92.1k|}
archive_string.c:create_sconv_object:
 1167|  92.1k|{
 1168|  92.1k|	struct archive_string_conv *sc; 
 1169|       |
 1170|  92.1k|	sc = calloc(1, sizeof(*sc));
 1171|  92.1k|	if (sc == NULL)
  ------------------
  |  Branch (1171:6): [True: 0, False: 92.1k]
  ------------------
 1172|      0|		return (NULL);
 1173|  92.1k|	sc->next = NULL;
 1174|  92.1k|	sc->from_charset = strdup(fc);
 1175|  92.1k|	if (sc->from_charset == NULL) {
  ------------------
  |  Branch (1175:6): [True: 0, False: 92.1k]
  ------------------
 1176|      0|		free(sc);
 1177|      0|		return (NULL);
 1178|      0|	}
 1179|  92.1k|	sc->to_charset = strdup(tc);
 1180|  92.1k|	if (sc->to_charset == NULL) {
  ------------------
  |  Branch (1180:6): [True: 0, False: 92.1k]
  ------------------
 1181|      0|		free(sc->from_charset);
 1182|      0|		free(sc);
 1183|      0|		return (NULL);
 1184|      0|	}
 1185|  92.1k|	archive_string_init(&sc->utftmp);
  ------------------
  |  |   71|  92.1k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 92.1k]
  |  |  ------------------
  ------------------
 1186|       |
 1187|  92.1k|	if (flag & SCONV_TO_CHARSET) {
  ------------------
  |  |   89|  92.1k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
  |  Branch (1187:6): [True: 81.2k, False: 10.8k]
  ------------------
 1188|       |		/*
 1189|       |		 * Convert characters from the current locale charset to
 1190|       |		 * a specified charset.
 1191|       |		 */
 1192|  81.2k|		sc->from_cp = current_codepage;
 1193|  81.2k|		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|  81.2k|	} 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|  92.1k|	if (strcmp(fc, tc) == 0 ||
  ------------------
  |  Branch (1214:6): [True: 0, False: 92.1k]
  ------------------
 1215|  92.1k|	    (sc->from_cp != (unsigned)-1 && sc->from_cp == sc->to_cp))
  ------------------
  |  Branch (1215:7): [True: 0, False: 92.1k]
  |  Branch (1215:38): [True: 0, False: 0]
  ------------------
 1216|      0|		sc->same = 1;
 1217|  92.1k|	else
 1218|  92.1k|		sc->same = 0;
 1219|       |
 1220|       |	/*
 1221|       |	 * Mark if "from charset" or "to charset" are UTF-8 or UTF-16BE/LE.
 1222|       |	 */
 1223|  92.1k|	if (strcmp(tc, "UTF-8") == 0)
  ------------------
  |  Branch (1223:6): [True: 81.2k, False: 10.8k]
  ------------------
 1224|  81.2k|		flag |= SCONV_TO_UTF8;
  ------------------
  |  |  105|  81.2k|#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|  92.1k|	if (strcmp(fc, "UTF-8") == 0)
  ------------------
  |  Branch (1229:6): [True: 10.8k, False: 81.3k]
  ------------------
 1230|  10.8k|		flag |= SCONV_FROM_UTF8;
  ------------------
  |  |  106|  10.8k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
 1231|  81.3k|	else if (strcmp(fc, "UTF-16BE") == 0)
  ------------------
  |  Branch (1231:11): [True: 29, False: 81.2k]
  ------------------
 1232|     29|		flag |= SCONV_FROM_UTF16BE;
  ------------------
  |  |  108|     29|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
 1233|  81.2k|	else if (strcmp(fc, "UTF-16LE") == 0)
  ------------------
  |  Branch (1233:11): [True: 18, False: 81.2k]
  ------------------
 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|  92.1k|	if ((flag & SCONV_FROM_CHARSET) &&
  ------------------
  |  |   91|  92.1k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1261:6): [True: 10.8k, False: 81.2k]
  ------------------
 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|  92.1k|#if defined(HAVE_ICONV)
 1295|  92.1k|	sc->cd_w = (iconv_t)-1;
 1296|       |	/*
 1297|       |	 * Create an iconv object.
 1298|       |	 */
 1299|  92.1k|	if (((flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) &&
  ------------------
  |  |  105|  92.1k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
              	if (((flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) &&
  ------------------
  |  |  111|  92.1k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|  92.1k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|  92.1k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1299:7): [True: 81.2k, False: 10.8k]
  ------------------
 1300|  81.2k|	    (flag & (SCONV_FROM_UTF8 | SCONV_FROM_UTF16))) ||
  ------------------
  |  |  106|  81.2k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
              	    (flag & (SCONV_FROM_UTF8 | SCONV_FROM_UTF16))) ||
  ------------------
  |  |  112|  81.2k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  81.2k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  81.2k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1300:6): [True: 0, False: 81.2k]
  ------------------
 1301|  92.1k|	    (flag & SCONV_WIN_CP)) {
  ------------------
  |  |   94|  92.1k|#define SCONV_WIN_CP	 	(1<<3)	/* Use Windows API for converting
  ------------------
  |  Branch (1301:6): [True: 0, False: 92.1k]
  ------------------
 1302|       |		/* This case we won't use iconv. */
 1303|      0|		sc->cd = (iconv_t)-1;
 1304|  92.1k|	} else {
 1305|  92.1k|		sc->cd = iconv_open(tc, fc);
 1306|  92.1k|		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: 92.1k]
  |  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|  92.1k|	}
 1344|  92.1k|#endif	/* HAVE_ICONV */
 1345|       |
 1346|  92.1k|	sc->flag = flag;
 1347|       |
 1348|       |	/*
 1349|       |	 * Set up converters.
 1350|       |	 */
 1351|  92.1k|	setup_converter(sc);
 1352|       |
 1353|  92.1k|	return (sc);
 1354|  92.1k|}
archive_string.c:make_codepage_from_charset:
 1677|  92.1k|{
 1678|  92.1k|	(void)charset; /* UNUSED */
 1679|  92.1k|	return (-1);/* Unknown */
 1680|  92.1k|}
archive_string.c:canonical_charset_name:
 1127|   184k|{
 1128|   184k|	char cs[16];
 1129|   184k|	char *p;
 1130|   184k|	const char *s;
 1131|       |
 1132|   184k|	if (charset == NULL || charset[0] == '\0'
  ------------------
  |  Branch (1132:6): [True: 0, False: 184k]
  |  Branch (1132:25): [True: 0, False: 184k]
  ------------------
 1133|   184k|	    || strlen(charset) > 15)
  ------------------
  |  Branch (1133:9): [True: 0, False: 184k]
  ------------------
 1134|      0|		return (charset);
 1135|       |
 1136|       |	/* Copy name to uppercase. */
 1137|   184k|	p = cs;
 1138|   184k|	s = charset;
 1139|  1.93M|	while (*s) {
  ------------------
  |  Branch (1139:9): [True: 1.75M, False: 184k]
  ------------------
 1140|  1.75M|		char c = *s++;
 1141|  1.75M|		if (c >= 'a' && c <= 'z')
  ------------------
  |  Branch (1141:7): [True: 0, False: 1.75M]
  |  Branch (1141:19): [True: 0, False: 0]
  ------------------
 1142|      0|			c -= 'a' - 'A';
 1143|  1.75M|		*p++ = c;
 1144|  1.75M|	}
 1145|   184k|	*p++ = '\0';
 1146|       |
 1147|   184k|	if (strcmp(cs, "UTF-8") == 0 ||
  ------------------
  |  Branch (1147:6): [True: 92.1k, False: 92.2k]
  ------------------
 1148|  92.2k|	    strcmp(cs, "UTF8") == 0)
  ------------------
  |  Branch (1148:6): [True: 0, False: 92.2k]
  ------------------
 1149|  92.1k|		return ("UTF-8");
 1150|  92.2k|	if (strcmp(cs, "UTF-16BE") == 0 ||
  ------------------
  |  Branch (1150:6): [True: 29, False: 92.1k]
  ------------------
 1151|  92.1k|	    strcmp(cs, "UTF16BE") == 0)
  ------------------
  |  Branch (1151:6): [True: 0, False: 92.1k]
  ------------------
 1152|     29|		return ("UTF-16BE");
 1153|  92.1k|	if (strcmp(cs, "UTF-16LE") == 0 ||
  ------------------
  |  Branch (1153:6): [True: 18, False: 92.1k]
  ------------------
 1154|  92.1k|	    strcmp(cs, "UTF16LE") == 0)
  ------------------
  |  Branch (1154:6): [True: 0, False: 92.1k]
  ------------------
 1155|     18|		return ("UTF-16LE");
 1156|  92.1k|	if (strcmp(cs, "CP932") == 0)
  ------------------
  |  Branch (1156:6): [True: 0, False: 92.1k]
  ------------------
 1157|      0|		return ("CP932");
 1158|  92.1k|	return (charset);
 1159|  92.1k|}
archive_string.c:add_sconv_object:
  925|    458|{
  926|    458|	struct archive_string_conv **psc; 
  927|       |
  928|       |	/* Add a new sconv to sconv list. */
  929|    458|	psc = &(a->sconv);
  930|    458|	while (*psc != NULL)
  ------------------
  |  Branch (930:9): [True: 0, False: 458]
  ------------------
  931|      0|		psc = &((*psc)->next);
  932|    458|	*psc = sc;
  933|    458|}
archive_string.c:get_current_charset:
 1749|  92.1k|{
 1750|  92.1k|	const char *cur_charset;
 1751|       |
 1752|  92.1k|	if (a == NULL)
  ------------------
  |  Branch (1752:6): [True: 91.7k, False: 458]
  ------------------
 1753|  91.7k|		cur_charset = default_iconv_charset("");
 1754|    458|	else {
 1755|    458|		cur_charset = default_iconv_charset(a->current_code);
 1756|    458|		if (a->current_code == NULL) {
  ------------------
  |  Branch (1756:7): [True: 458, False: 0]
  ------------------
 1757|    458|			a->current_code = strdup(cur_charset);
 1758|    458|			a->current_codepage = get_current_codepage();
 1759|    458|			a->current_oemcp = get_current_oemcp();
 1760|    458|		}
 1761|    458|	}
 1762|  92.1k|	return (cur_charset);
 1763|  92.1k|}
archive_string.c:default_iconv_charset:
  445|  92.1k|default_iconv_charset(const char *charset) {
  446|  92.1k|	if (charset != NULL && charset[0] != '\0')
  ------------------
  |  Branch (446:6): [True: 91.7k, False: 458]
  |  Branch (446:25): [True: 0, False: 91.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|  92.1k|	return nl_langinfo(CODESET);
  453|       |#else
  454|       |	return "";
  455|       |#endif
  456|  92.1k|}
archive_string.c:get_current_oemcp:
 1683|    458|{
 1684|    458|	return (-1);/* Unknown */
 1685|    458|}
archive_string.c:free_sconv_object:
 1361|  92.1k|{
 1362|  92.1k|	free(sc->from_charset);
 1363|  92.1k|	free(sc->to_charset);
 1364|  92.1k|	archive_string_free(&sc->utftmp);
 1365|  92.1k|#if HAVE_ICONV
 1366|  92.1k|	if (sc->cd != (iconv_t)-1)
  ------------------
  |  Branch (1366:6): [True: 92.1k, False: 0]
  ------------------
 1367|  92.1k|		iconv_close(sc->cd);
 1368|  92.1k|	if (sc->cd_w != (iconv_t)-1)
  ------------------
  |  Branch (1368:6): [True: 0, False: 92.1k]
  ------------------
 1369|      0|		iconv_close(sc->cd_w);
 1370|  92.1k|#endif
 1371|  92.1k|	free(sc);
 1372|  92.1k|}
archive_string.c:setup_converter:
  947|  92.1k|{
  948|       |
  949|       |	/* Reset. */
  950|  92.1k|	sc->nconverter = 0;
  951|       |
  952|       |	/*
  953|       |	 * Perform special sequence for the incorrect UTF-8 filenames
  954|       |	 * made by libarchive2.x.
  955|       |	 */
  956|  92.1k|	if (sc->flag & SCONV_UTF8_LIBARCHIVE_2) {
  ------------------
  |  |   96|  92.1k|#define SCONV_UTF8_LIBARCHIVE_2 (1<<4)	/* Incorrect UTF-8 made by libarchive
  ------------------
  |  Branch (956:6): [True: 0, False: 92.1k]
  ------------------
  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|  92.1k|	if (sc->flag & SCONV_TO_UTF16) {
  ------------------
  |  |  111|  92.1k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|  92.1k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|  92.1k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (964:6): [True: 0, False: 92.1k]
  ------------------
  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|  92.1k|	if (sc->flag & SCONV_FROM_UTF16) {
  ------------------
  |  |  112|  92.1k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  92.1k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  92.1k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1007:6): [True: 47, False: 92.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|  92.1k|	if (sc->flag & SCONV_FROM_UTF8) {
  ------------------
  |  |  106|  92.1k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (1057:6): [True: 10.8k, False: 81.2k]
  ------------------
 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|  92.1k|#if HAVE_ICONV
 1095|  92.1k|	if (sc->cd != (iconv_t)-1) {
  ------------------
  |  Branch (1095:6): [True: 92.1k, False: 0]
  ------------------
 1096|  92.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|  92.1k|		if ((sc->flag & SCONV_FROM_CHARSET) &&
  ------------------
  |  |   91|  92.1k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1102:7): [True: 10.8k, False: 81.2k]
  ------------------
 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|  92.1k|		return;
 1108|  92.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|   103k|{
  940|   103k|	if (sc == NULL || sc->nconverter >= 2)
  ------------------
  |  Branch (940:6): [True: 0, False: 103k]
  |  Branch (940:20): [True: 0, False: 103k]
  ------------------
  941|      0|		__archive_errx(1, "Programming error");
  942|   103k|	sc->converter[sc->nconverter++] = converter;
  943|   103k|}
archive_string.c:_utf8_to_unicode:
 2368|  30.1M|{
 2369|  30.1M|	static const char utf8_count[256] = {
 2370|  30.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 00 - 0F */
 2371|  30.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 10 - 1F */
 2372|  30.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 20 - 2F */
 2373|  30.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 30 - 3F */
 2374|  30.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 40 - 4F */
 2375|  30.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 50 - 5F */
 2376|  30.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 60 - 6F */
 2377|  30.1M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 70 - 7F */
 2378|  30.1M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 80 - 8F */
 2379|  30.1M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 90 - 9F */
 2380|  30.1M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* A0 - AF */
 2381|  30.1M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* B0 - BF */
 2382|  30.1M|		 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* C0 - CF */
 2383|  30.1M|		 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* D0 - DF */
 2384|  30.1M|		 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,/* E0 - EF */
 2385|  30.1M|		 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* F0 - FF */
 2386|  30.1M|	};
 2387|  30.1M|	int ch, i;
 2388|  30.1M|	int cnt;
 2389|  30.1M|	uint32_t wc;
 2390|       |
 2391|       |	/* Sanity check. */
 2392|  30.1M|	if (n == 0)
  ------------------
  |  Branch (2392:6): [True: 12.2k, False: 30.1M]
  ------------------
 2393|  12.2k|		return (0);
 2394|       |	/*
 2395|       |	 * Decode 1-4 bytes depending on the value of the first byte.
 2396|       |	 */
 2397|  30.1M|	ch = (unsigned char)*s;
 2398|  30.1M|	if (ch == 0)
  ------------------
  |  Branch (2398:6): [True: 0, False: 30.1M]
  ------------------
 2399|      0|		return (0); /* Standard:  return 0 for end-of-string. */
 2400|  30.1M|	cnt = utf8_count[ch];
 2401|       |
 2402|       |	/* Invalid sequence or there are not plenty bytes. */
 2403|  30.1M|	if (n < (size_t)cnt) {
  ------------------
  |  Branch (2403:6): [True: 514, False: 30.1M]
  ------------------
 2404|    514|		cnt = (int)n;
 2405|    514|		for (i = 1; i < cnt; i++) {
  ------------------
  |  Branch (2405:15): [True: 1, False: 513]
  ------------------
 2406|      1|			if ((s[i] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2406:8): [True: 1, False: 0]
  ------------------
 2407|      1|				cnt = i;
 2408|      1|				break;
 2409|      1|			}
 2410|      1|		}
 2411|    514|		goto invalid_sequence;
 2412|    514|	}
 2413|       |
 2414|       |	/* Make a Unicode code point from a single UTF-8 sequence. */
 2415|  30.1M|	switch (cnt) {
 2416|  30.0M|	case 1:	/* 1 byte sequence. */
  ------------------
  |  Branch (2416:2): [True: 30.0M, False: 60.3k]
  ------------------
 2417|  30.0M|		*pwc = ch & 0x7f;
 2418|  30.0M|		return (cnt);
 2419|  20.9k|	case 2:	/* 2 bytes sequence. */
  ------------------
  |  Branch (2419:2): [True: 20.9k, False: 30.1M]
  ------------------
 2420|  20.9k|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2420:7): [True: 8.28k, False: 12.7k]
  ------------------
 2421|  8.28k|			cnt = 1;
 2422|  8.28k|			goto invalid_sequence;
 2423|  8.28k|		}
 2424|  12.7k|		*pwc = ((ch & 0x1f) << 6) | (s[1] & 0x3f);
 2425|  12.7k|		return (cnt);
 2426|  10.9k|	case 3:	/* 3 bytes sequence. */
  ------------------
  |  Branch (2426:2): [True: 10.9k, False: 30.1M]
  ------------------
 2427|  10.9k|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2427:7): [True: 1.37k, False: 9.61k]
  ------------------
 2428|  1.37k|			cnt = 1;
 2429|  1.37k|			goto invalid_sequence;
 2430|  1.37k|		}
 2431|  9.61k|		if ((s[2] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2431:7): [True: 2.85k, False: 6.76k]
  ------------------
 2432|  2.85k|			cnt = 2;
 2433|  2.85k|			goto invalid_sequence;
 2434|  2.85k|		}
 2435|  6.76k|		wc = ((ch & 0x0f) << 12)
 2436|  6.76k|		    | ((s[1] & 0x3f) << 6)
 2437|  6.76k|		    | (s[2] & 0x3f);
 2438|  6.76k|		if (wc < 0x800)
  ------------------
  |  Branch (2438:7): [True: 4, False: 6.76k]
  ------------------
 2439|      4|			goto invalid_sequence;/* Overlong sequence. */
 2440|  6.76k|		break;
 2441|  6.76k|	case 4:	/* 4 bytes sequence. */
  ------------------
  |  Branch (2441:2): [True: 893, False: 30.1M]
  ------------------
 2442|    893|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2442:7): [True: 83, False: 810]
  ------------------
 2443|     83|			cnt = 1;
 2444|     83|			goto invalid_sequence;
 2445|     83|		}
 2446|    810|		if ((s[2] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2446:7): [True: 171, False: 639]
  ------------------
 2447|    171|			cnt = 2;
 2448|    171|			goto invalid_sequence;
 2449|    171|		}
 2450|    639|		if ((s[3] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2450:7): [True: 0, False: 639]
  ------------------
 2451|      0|			cnt = 3;
 2452|      0|			goto invalid_sequence;
 2453|      0|		}
 2454|    639|		wc = ((ch & 0x07) << 18)
 2455|    639|		    | ((s[1] & 0x3f) << 12)
 2456|    639|		    | ((s[2] & 0x3f) << 6)
 2457|    639|		    | (s[3] & 0x3f);
 2458|    639|		if (wc < 0x10000)
  ------------------
  |  Branch (2458:7): [True: 0, False: 639]
  ------------------
 2459|      0|			goto invalid_sequence;/* Overlong sequence. */
 2460|    639|		break;
 2461|  27.5k|	default: /* Others are all invalid sequence. */
  ------------------
  |  Branch (2461:2): [True: 27.5k, False: 30.1M]
  ------------------
 2462|  27.5k|		if (ch == 0xc0 || ch == 0xc1)
  ------------------
  |  Branch (2462:7): [True: 8, False: 27.5k]
  |  Branch (2462:21): [True: 1, False: 27.5k]
  ------------------
 2463|      9|			cnt = 2;
 2464|  27.5k|		else if (ch >= 0xf5 && ch <= 0xf7)
  ------------------
  |  Branch (2464:12): [True: 18.1k, False: 9.39k]
  |  Branch (2464:26): [True: 1.75k, False: 16.3k]
  ------------------
 2465|  1.75k|			cnt = 4;
 2466|  25.7k|		else if (ch >= 0xf8 && ch <= 0xfb)
  ------------------
  |  Branch (2466:12): [True: 16.3k, False: 9.39k]
  |  Branch (2466:26): [True: 815, False: 15.5k]
  ------------------
 2467|    815|			cnt = 5;
 2468|  24.9k|		else if (ch == 0xfc || ch == 0xfd)
  ------------------
  |  Branch (2468:12): [True: 303, False: 24.6k]
  |  Branch (2468:26): [True: 5.06k, False: 19.5k]
  ------------------
 2469|  5.36k|			cnt = 6;
 2470|  19.5k|		else
 2471|  19.5k|			cnt = 1;
 2472|  27.5k|		if (n < (size_t)cnt)
  ------------------
  |  Branch (2472:7): [True: 2.38k, False: 25.1k]
  ------------------
 2473|  2.38k|			cnt = (int)n;
 2474|  38.7k|		for (i = 1; i < cnt; i++) {
  ------------------
  |  Branch (2474:15): [True: 18.1k, False: 20.6k]
  ------------------
 2475|  18.1k|			if ((s[i] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2475:8): [True: 6.91k, False: 11.2k]
  ------------------
 2476|  6.91k|				cnt = i;
 2477|  6.91k|				break;
 2478|  6.91k|			}
 2479|  18.1k|		}
 2480|  27.5k|		goto invalid_sequence;
 2481|  30.1M|	}
 2482|       |
 2483|       |	/* The code point larger than 0x10FFFF is not legal
 2484|       |	 * Unicode values. */
 2485|  7.39k|	if (wc > UNICODE_MAX)
  ------------------
  |  |  133|  7.39k|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2485:6): [True: 0, False: 7.39k]
  ------------------
 2486|      0|		goto invalid_sequence;
 2487|       |	/* Correctly gets a Unicode, returns used bytes. */
 2488|  7.39k|	*pwc = wc;
 2489|  7.39k|	return (cnt);
 2490|  40.8k|invalid_sequence:
 2491|  40.8k|	*pwc = UNICODE_R_CHAR;/* set the Replacement Character instead. */
  ------------------
  |  |  134|  40.8k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2492|  40.8k|	return (cnt * -1);
 2493|  7.39k|}
archive_string.c:unicode_to_utf16le:
 2695|  5.92k|{
 2696|  5.92k|	char *utf16 = p;
 2697|       |
 2698|  5.92k|	if (uc > 0xffff) {
  ------------------
  |  Branch (2698:6): [True: 78, False: 5.85k]
  ------------------
 2699|       |		/* We have a code point that won't fit into a
 2700|       |		 * wchar_t; convert it to a surrogate pair. */
 2701|     78|		if (remaining < 4)
  ------------------
  |  Branch (2701:7): [True: 0, False: 78]
  ------------------
 2702|      0|			return (0);
 2703|     78|		uc -= 0x10000;
 2704|     78|		archive_le16enc(utf16, ((uc >> 10) & 0x3ff) + 0xD800);
 2705|     78|		archive_le16enc(utf16+2, (uc & 0x3ff) + 0xDC00);
 2706|     78|		return (4);
 2707|  5.85k|	} else {
 2708|  5.85k|		if (remaining < 2)
  ------------------
  |  Branch (2708:7): [True: 0, False: 5.85k]
  ------------------
 2709|      0|			return (0);
 2710|  5.85k|		archive_le16enc(utf16, (uint16_t)uc);
 2711|  5.85k|		return (2);
 2712|  5.85k|	}
 2713|  5.92k|}
archive_string.c:unicode_to_utf8:
 2567|  47.4k|{
 2568|  47.4k|	char *_p = p;
 2569|       |
 2570|       |	/* Invalid Unicode char maps to Replacement character */
 2571|  47.4k|	if (uc > UNICODE_MAX)
  ------------------
  |  |  133|  47.4k|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2571:6): [True: 0, False: 47.4k]
  ------------------
 2572|      0|		uc = UNICODE_R_CHAR;
  ------------------
  |  |  134|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2573|       |	/* Translate code point to UTF8 */
 2574|  47.4k|	if (uc <= 0x7f) {
  ------------------
  |  Branch (2574:6): [True: 0, False: 47.4k]
  ------------------
 2575|      0|		if (remaining == 0)
  ------------------
  |  Branch (2575:7): [True: 0, False: 0]
  ------------------
 2576|      0|			return (0);
 2577|      0|		*p++ = (char)uc;
 2578|  47.4k|	} else if (uc <= 0x7ff) {
  ------------------
  |  Branch (2578:13): [True: 6.15k, False: 41.3k]
  ------------------
 2579|  6.15k|		if (remaining < 2)
  ------------------
  |  Branch (2579:7): [True: 0, False: 6.15k]
  ------------------
 2580|      0|			return (0);
 2581|  6.15k|		*p++ = 0xc0 | ((uc >> 6) & 0x1f);
 2582|  6.15k|		*p++ = 0x80 | (uc & 0x3f);
 2583|  41.3k|	} else if (uc <= 0xffff) {
  ------------------
  |  Branch (2583:13): [True: 41.1k, False: 166]
  ------------------
 2584|  41.1k|		if (remaining < 3)
  ------------------
  |  Branch (2584:7): [True: 156, False: 40.9k]
  ------------------
 2585|    156|			return (0);
 2586|  40.9k|		*p++ = 0xe0 | ((uc >> 12) & 0x0f);
 2587|  40.9k|		*p++ = 0x80 | ((uc >> 6) & 0x3f);
 2588|  40.9k|		*p++ = 0x80 | (uc & 0x3f);
 2589|  40.9k|	} else {
 2590|    166|		if (remaining < 4)
  ------------------
  |  Branch (2590:7): [True: 2, False: 164]
  ------------------
 2591|      2|			return (0);
 2592|    164|		*p++ = 0xf0 | ((uc >> 18) & 0x07);
 2593|    164|		*p++ = 0x80 | ((uc >> 12) & 0x3f);
 2594|    164|		*p++ = 0x80 | ((uc >> 6) & 0x3f);
 2595|    164|		*p++ = 0x80 | (uc & 0x3f);
 2596|    164|	}
 2597|  47.3k|	return (p - _p);
 2598|  47.4k|}
archive_string.c:utf16be_to_unicode:
 2602|    798|{
 2603|    798|	return (utf16_to_unicode(pwc, s, n, 1));
 2604|    798|}
archive_string.c:utf16_to_unicode:
 2614|  39.7k|{
 2615|  39.7k|	const char *utf16 = s;
 2616|  39.7k|	unsigned uc;
 2617|       |
 2618|  39.7k|	if (n == 0)
  ------------------
  |  Branch (2618:6): [True: 597, False: 39.1k]
  ------------------
 2619|    597|		return (0);
 2620|  39.1k|	if (n == 1) {
  ------------------
  |  Branch (2620:6): [True: 0, False: 39.1k]
  ------------------
 2621|       |		/* set the Replacement Character instead. */
 2622|      0|		*pwc = UNICODE_R_CHAR;
  ------------------
  |  |  134|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2623|      0|		return (-1);
 2624|      0|	}
 2625|       |
 2626|  39.1k|	if (be)
  ------------------
  |  Branch (2626:6): [True: 658, False: 38.5k]
  ------------------
 2627|    658|		uc = archive_be16dec(utf16);
 2628|  38.5k|	else
 2629|  38.5k|		uc = archive_le16dec(utf16);
 2630|  39.1k|	utf16 += 2;
 2631|       |		
 2632|       |	/* If this is a surrogate pair, assemble the full code point.*/
 2633|  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]
  |  |  ------------------
  ------------------
 2634|  4.75k|		unsigned uc2;
 2635|       |
 2636|  4.75k|		if (n >= 4) {
  ------------------
  |  Branch (2636:7): [True: 4.75k, False: 0]
  ------------------
 2637|  4.75k|			if (be)
  ------------------
  |  Branch (2637:8): [True: 0, False: 4.75k]
  ------------------
 2638|      0|				uc2 = archive_be16dec(utf16);
 2639|  4.75k|			else
 2640|  4.75k|				uc2 = archive_le16dec(utf16);
 2641|  4.75k|		} else
 2642|      0|			uc2 = 0;
 2643|  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]
  |  |  ------------------
  ------------------
 2644|     78|			uc = combine_surrogate_pair(uc, uc2);
 2645|     78|			utf16 += 2;
 2646|  4.67k|		} else {
 2647|       |	 		/* Undescribed code point should be U+FFFD
 2648|       |		 	* (replacement character). */
 2649|  4.67k|			*pwc = UNICODE_R_CHAR;
  ------------------
  |  |  134|  4.67k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2650|  4.67k|			return (-2);
 2651|  4.67k|		}
 2652|  4.75k|	}
 2653|       |
 2654|       |	/*
 2655|       |	 * Surrogate pair values(0xd800 through 0xdfff) are only
 2656|       |	 * used by UTF-16, so, after above calculation, the code
 2657|       |	 * must not be surrogate values, and Unicode has no codes
 2658|       |	 * larger than 0x10ffff. Thus, those are not legal Unicode
 2659|       |	 * values.
 2660|       |	 */
 2661|  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 (2661:34): [True: 0, False: 33.7k]
  ------------------
 2662|       |	 	/* Undescribed code point should be U+FFFD
 2663|       |	 	* (replacement character). */
 2664|    770|		*pwc = UNICODE_R_CHAR;
  ------------------
  |  |  134|    770|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2665|    770|		return (((int)(utf16 - s)) * -1);
 2666|    770|	}
 2667|  33.7k|	*pwc = uc;
 2668|  33.7k|	return ((int)(utf16 - s));
 2669|  34.4k|}
archive_string.c:combine_surrogate_pair:
 2509|    406|{
 2510|    406|	uc -= 0xD800;
 2511|    406|	uc *= 0x400;
 2512|    406|	uc += uc2 - 0xDC00;
 2513|    406|	uc += 0x10000;
 2514|    406|	return (uc);
 2515|    406|}
archive_string.c:utf16le_to_unicode:
 2608|  38.9k|{
 2609|  38.9k|	return (utf16_to_unicode(pwc, s, n, 0));
 2610|  38.9k|}
archive_string.c:cesu8_to_unicode:
 2528|  30.1M|{
 2529|  30.1M|	uint32_t wc = 0;
 2530|  30.1M|	int cnt;
 2531|       |
 2532|  30.1M|	cnt = _utf8_to_unicode(&wc, s, n);
 2533|  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 (2533:6): [True: 6.30k, False: 30.1M]
  ------------------
 2534|  3.17k|		uint32_t wc2 = 0;
 2535|  3.17k|		if (n - 3 < 3) {
  ------------------
  |  Branch (2535:7): [True: 185, False: 2.99k]
  ------------------
 2536|       |			/* Invalid byte sequence. */
 2537|    185|			goto invalid_sequence;
 2538|    185|		}
 2539|  2.99k|		cnt = _utf8_to_unicode(&wc2, s+3, n-3);
 2540|  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 (2540:7): [True: 2.53k, False: 460]
  ------------------
 2541|       |			/* Invalid byte sequence. */
 2542|  2.66k|			goto invalid_sequence;
 2543|  2.66k|		}
 2544|    328|		wc = combine_surrogate_pair(wc, wc2);
 2545|    328|		cnt = 6;
 2546|  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 (2546:13): [True: 3.12k, False: 30.1M]
  ------------------
 2547|       |		/* Invalid byte sequence. */
 2548|  2.69k|		goto invalid_sequence;
 2549|  2.69k|	}
 2550|  30.1M|	*pwc = wc;
 2551|  30.1M|	return (cnt);
 2552|  5.54k|invalid_sequence:
 2553|  5.54k|	*pwc = UNICODE_R_CHAR;/* set the Replacement Character instead. */
  ------------------
  |  |  134|  5.54k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2554|  5.54k|	if (cnt > 0)
  ------------------
  |  Branch (2554:6): [True: 3.01k, False: 2.53k]
  ------------------
 2555|  3.01k|		cnt *= -1;
 2556|  5.54k|	return (cnt);
 2557|  30.1M|}
archive_string.c:iconv_strncat_in_locale:
 2098|  59.1k|{
 2099|  59.1k|	ICONV_CONST char *itp;
 2100|  59.1k|	size_t remaining;
 2101|  59.1k|	iconv_t cd;
 2102|  59.1k|	char *outp;
 2103|  59.1k|	size_t avail, bs;
 2104|  59.1k|	int return_value = 0; /* success */
 2105|  59.1k|	size_t to_size, from_size;
 2106|       |
 2107|  59.1k|	if (sc->flag & SCONV_TO_UTF16)
  ------------------
  |  |  111|  59.1k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|  59.1k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|  59.1k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2107:6): [True: 0, False: 59.1k]
  ------------------
 2108|      0|		to_size = 2;
 2109|  59.1k|	else
 2110|  59.1k|		to_size = 1;
 2111|  59.1k|	if (sc->flag & SCONV_FROM_UTF16)
  ------------------
  |  |  112|  59.1k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  59.1k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  59.1k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2111:6): [True: 597, False: 58.5k]
  ------------------
 2112|    597|		from_size = 2;
 2113|  58.5k|	else
 2114|  58.5k|		from_size = 1;
 2115|       |
 2116|  59.1k|	if (archive_string_ensure(as, as->length + length*2+to_size) == NULL)
  ------------------
  |  Branch (2116:6): [True: 0, False: 59.1k]
  ------------------
 2117|      0|		return (-1);
 2118|       |
 2119|  59.1k|	cd = sc->cd;
 2120|  59.1k|	itp = (char *)(uintptr_t)_p;
 2121|  59.1k|	remaining = length;
 2122|  59.1k|	outp = as->s + as->length;
 2123|  59.1k|	avail = as->buffer_length - as->length - to_size;
 2124|   320k|	while (remaining >= from_size) {
  ------------------
  |  Branch (2124:9): [True: 316k, False: 4.88k]
  ------------------
 2125|   316k|		size_t result = iconv(cd, &itp, &remaining, &outp, &avail);
 2126|       |
 2127|   316k|		if (result != (size_t)-1)
  ------------------
  |  Branch (2127:7): [True: 54.2k, False: 261k]
  ------------------
 2128|  54.2k|			break; /* Conversion completed. */
 2129|       |
 2130|   261k|		if (errno == EILSEQ || errno == EINVAL) {
  ------------------
  |  Branch (2130:7): [True: 261k, 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|   261k|			if (sc->flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) {
  ------------------
  |  |  105|   261k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
              			if (sc->flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) {
  ------------------
  |  |  111|   261k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|   261k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|   261k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2136:8): [True: 71.9k, False: 189k]
  ------------------
 2137|  71.9k|				size_t rbytes;
 2138|  71.9k|				if (sc->flag & SCONV_TO_UTF8)
  ------------------
  |  |  105|  71.9k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (2138:9): [True: 71.9k, False: 0]
  ------------------
 2139|  71.9k|					rbytes = sizeof(utf8_replacement_char);
 2140|      0|				else
 2141|      0|					rbytes = 2;
 2142|       |
 2143|  71.9k|				if (avail < rbytes) {
  ------------------
  |  Branch (2143:9): [True: 134, False: 71.7k]
  ------------------
 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|  71.9k|				if (sc->flag & SCONV_TO_UTF8)
  ------------------
  |  |  105|  71.9k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (2154:9): [True: 71.9k, False: 0]
  ------------------
 2155|  71.9k|					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|  71.9k|				outp += rbytes;
 2161|  71.9k|				avail -= rbytes;
 2162|   189k|			} else {
 2163|       |				/* Skip the illegal input bytes. */
 2164|   189k|				*outp++ = '?';
 2165|   189k|				avail--;
 2166|   189k|			}
 2167|   261k|			itp += from_size;
 2168|   261k|			remaining -= from_size;
 2169|   261k|			return_value = -1; /* failure */
 2170|   261k|		} 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|   261k|	}
 2181|  59.1k|	as->length = outp - as->s;
 2182|  59.1k|	as->s[as->length] = 0;
 2183|  59.1k|	if (to_size == 2)
  ------------------
  |  Branch (2183:6): [True: 0, False: 59.1k]
  ------------------
 2184|      0|		as->s[as->length+1] = 0;
 2185|  59.1k|	return (return_value);
 2186|  59.1k|}
archive_string.c:archive_string_normalize_C:
 3000|  12.8k|{
 3001|  12.8k|	const char *s = (const char *)_p;
 3002|  12.8k|	char *p, *endp;
 3003|  12.8k|	uint32_t uc, uc2;
 3004|  12.8k|	size_t w;
 3005|  12.8k|	int always_replace, n, n2, ret = 0, spair, ts, tm;
 3006|  12.8k|	int (*parse)(uint32_t *, const char *, size_t);
 3007|  12.8k|	size_t (*unparse)(char *, size_t, uint32_t);
 3008|       |
 3009|  12.8k|	always_replace = 1;
 3010|  12.8k|	ts = 1;/* text size. */
 3011|  12.8k|	if (sc->flag & SCONV_TO_UTF16BE) {
  ------------------
  |  |  107|  12.8k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
  |  Branch (3011:6): [True: 0, False: 12.8k]
  ------------------
 3012|      0|		unparse = unicode_to_utf16be;
 3013|      0|		ts = 2;
 3014|      0|		if (sc->flag & SCONV_FROM_UTF16BE)
  ------------------
  |  |  108|      0|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (3014:7): [True: 0, False: 0]
  ------------------
 3015|      0|			always_replace = 0;
 3016|  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 (3016:13): [True: 0, False: 12.8k]
  ------------------
 3017|      0|		unparse = unicode_to_utf16le;
 3018|      0|		ts = 2;
 3019|      0|		if (sc->flag & SCONV_FROM_UTF16LE)
  ------------------
  |  |  110|      0|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (3019:7): [True: 0, False: 0]
  ------------------
 3020|      0|			always_replace = 0;
 3021|  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 (3021:13): [True: 0, False: 12.8k]
  ------------------
 3022|      0|		unparse = unicode_to_utf8;
 3023|      0|		if (sc->flag & SCONV_FROM_UTF8)
  ------------------
  |  |  106|      0|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (3023:7): [True: 0, False: 0]
  ------------------
 3024|      0|			always_replace = 0;
 3025|  12.8k|	} else {
 3026|       |		/*
 3027|       |		 * This case is going to be converted to another
 3028|       |		 * character-set through iconv.
 3029|       |		 */
 3030|  12.8k|		always_replace = 0;
 3031|  12.8k|		if (sc->flag & SCONV_FROM_UTF16BE) {
  ------------------
  |  |  108|  12.8k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (3031:7): [True: 140, False: 12.6k]
  ------------------
 3032|    140|			unparse = unicode_to_utf16be;
 3033|    140|			ts = 2;
 3034|  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 (3034:14): [True: 457, False: 12.2k]
  ------------------
 3035|    457|			unparse = unicode_to_utf16le;
 3036|    457|			ts = 2;
 3037|  12.2k|		} else {
 3038|  12.2k|			unparse = unicode_to_utf8;
 3039|  12.2k|		}
 3040|  12.8k|	}
 3041|       |
 3042|  12.8k|	if (sc->flag & SCONV_FROM_UTF16BE) {
  ------------------
  |  |  108|  12.8k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (3042:6): [True: 140, False: 12.6k]
  ------------------
 3043|    140|		parse = utf16be_to_unicode;
 3044|    140|		tm = 1;
 3045|    140|		spair = 4;/* surrogate pair size in UTF-16. */
 3046|  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 (3046:13): [True: 457, False: 12.2k]
  ------------------
 3047|    457|		parse = utf16le_to_unicode;
 3048|    457|		tm = 1;
 3049|    457|		spair = 4;/* surrogate pair size in UTF-16. */
 3050|  12.2k|	} else {
 3051|  12.2k|		parse = cesu8_to_unicode;
 3052|  12.2k|		tm = ts;
 3053|  12.2k|		spair = 6;/* surrogate pair size in UTF-8. */
 3054|  12.2k|	}
 3055|       |
 3056|  12.8k|	if (archive_string_ensure(as, as->length + len * tm + ts) == NULL)
  ------------------
  |  Branch (3056:6): [True: 0, False: 12.8k]
  ------------------
 3057|      0|		return (-1);
 3058|       |
 3059|  12.8k|	p = as->s + as->length;
 3060|  12.8k|	endp = as->s + as->buffer_length - ts;
 3061|  63.0k|	while ((n = parse(&uc, s, len)) != 0) {
  ------------------
  |  Branch (3061:9): [True: 60.8k, False: 2.15k]
  ------------------
 3062|  60.8k|		const char *ucptr, *uc2ptr;
 3063|       |
 3064|  60.8k|		if (n < 0) {
  ------------------
  |  Branch (3064:7): [True: 33.0k, False: 27.7k]
  ------------------
 3065|       |			/* Use a replaced unicode character. */
 3066|  33.0k|			UNPARSE(p, endp, uc);
  ------------------
  |  | 2930|  33.0k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2931|  33.1k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2931:9): [True: 15, False: 33.0k]
  |  |  ------------------
  |  | 2932|     15|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2921|     15|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2922|     15|	as->length = p - as->s;			\
  |  |  |  | 2923|     15|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2923:6): [True: 0, False: 15]
  |  |  |  |  ------------------
  |  |  |  | 2924|     15|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2925|     15|		return (-1);			\
  |  |  |  | 2926|     15|	p = as->s + as->length;			\
  |  |  |  | 2927|     15|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2928|     15|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2928:10): [Folded, False: 15]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2933|     15|	}					\
  |  | 2934|  33.0k|	p += w;					\
  |  | 2935|  33.0k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2935:10): [Folded, False: 33.0k]
  |  |  ------------------
  ------------------
 3067|  33.0k|			s += n*-1;
 3068|  33.0k|			len -= n*-1;
 3069|  33.0k|			ret = -1;
 3070|  33.0k|			continue;
 3071|  33.0k|		} else if (n == spair || always_replace)
  ------------------
  |  Branch (3071:14): [True: 206, False: 27.5k]
  |  Branch (3071:28): [True: 0, False: 27.5k]
  ------------------
 3072|       |			/* uc is converted from a surrogate pair.
 3073|       |			 * this should be treated as a changed code. */
 3074|    206|			ucptr = NULL;
 3075|  27.5k|		else
 3076|  27.5k|			ucptr = s;
 3077|  27.7k|		s += n;
 3078|  27.7k|		len -= n;
 3079|       |
 3080|       |		/* Read second code point. */
 3081|  30.1M|		while ((n2 = parse(&uc2, s, len)) > 0) {
  ------------------
  |  Branch (3081:10): [True: 30.1M, False: 23.9k]
  ------------------
 3082|  30.1M|			uint32_t ucx[FDC_MAX];
 3083|  30.1M|			int ccx[FDC_MAX];
 3084|  30.1M|			int cl, cx, i, nx, ucx_size;
 3085|  30.1M|			int LIndex,SIndex;
 3086|  30.1M|			uint32_t nfc;
 3087|       |
 3088|  30.1M|			if (n2 == spair || always_replace)
  ------------------
  |  Branch (3088:8): [True: 36, False: 30.1M]
  |  Branch (3088:23): [True: 0, False: 30.1M]
  ------------------
 3089|       |				/* uc2 is converted from a surrogate pair.
 3090|       |			 	 * this should be treated as a changed code. */
 3091|     36|				uc2ptr = NULL;
 3092|  30.1M|			else
 3093|  30.1M|				uc2ptr = s;
 3094|  30.1M|			s += n2;
 3095|  30.1M|			len -= n2;
 3096|       |
 3097|       |			/*
 3098|       |			 * If current second code point is out of decomposable
 3099|       |			 * code points, finding compositions is unneeded.
 3100|       |			 */
 3101|  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]
  |  |  ------------------
  ------------------
 3102|  30.1M|				WRITE_UC();
  ------------------
  |  | 2943|  30.1M|#define WRITE_UC()	do {			\
  |  | 2944|  30.1M|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2944:6): [True: 30.1M, False: 23]
  |  |  ------------------
  |  | 2945|  30.1M|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2945:7): [True: 2.76k, False: 30.1M]
  |  |  ------------------
  |  | 2946|  30.1M|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2921|  2.76k|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2922|  2.76k|	as->length = p - as->s;			\
  |  |  |  | 2923|  2.76k|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2923:6): [True: 0, False: 2.76k]
  |  |  |  |  ------------------
  |  |  |  | 2924|  2.76k|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2925|  2.76k|		return (-1);			\
  |  |  |  | 2926|  2.76k|	p = as->s + as->length;			\
  |  |  |  | 2927|  2.76k|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2928|  2.76k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2928:10): [Folded, False: 2.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2947|  30.1M|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2947:11): [True: 30.1M, False: 0]
  |  |  ------------------
  |  | 2948|    189|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2948:3): [True: 189, False: 30.1M]
  |  |  ------------------
  |  | 2949|    189|			*p++ = *ucptr++;	\
  |  | 2950|    189|			/* FALL THROUGH */	\
  |  | 2951|    321|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2951:3): [True: 132, False: 30.1M]
  |  |  ------------------
  |  | 2952|    321|			*p++ = *ucptr++;	\
  |  | 2953|    321|			/* FALL THROUGH */	\
  |  | 2954|  30.1k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 29.7k, False: 30.0M]
  |  |  ------------------
  |  | 2955|  30.1k|			*p++ = *ucptr++;	\
  |  | 2956|  30.1k|			/* FALL THROUGH */	\
  |  | 2957|  30.1M|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 30.0M, False: 30.1k]
  |  |  ------------------
  |  | 2958|  30.1M|			*p++ = *ucptr;		\
  |  | 2959|  30.1M|			break;			\
  |  | 2960|  30.1M|		}				\
  |  | 2961|  30.1M|		ucptr = NULL;			\
  |  | 2962|  30.1M|	} else {				\
  |  | 2963|     23|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2930|     23|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2931|     23|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2931:9): [True: 0, False: 23]
  |  |  |  |  ------------------
  |  |  |  | 2932|      0|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2921|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2922|      0|	as->length = p - as->s;			\
  |  |  |  |  |  | 2923|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2923:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2924|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2925|      0|		return (-1);			\
  |  |  |  |  |  | 2926|      0|	p = as->s + as->length;			\
  |  |  |  |  |  | 2927|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2928|      0|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2928:10): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2933|      0|	}					\
  |  |  |  | 2934|     23|	p += w;					\
  |  |  |  | 2935|     23|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2935:10): [Folded, False: 23]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2964|     23|	}					\
  |  | 2965|  30.1M|} while (0)
  |  |  ------------------
  |  |  |  Branch (2965:10): [Folded, False: 30.1M]
  |  |  ------------------
  ------------------
 3103|  30.1M|				REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2915|  30.1M|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2916|  30.1M|	uc = uc2;				\
  |  | 2917|  30.1M|	ucptr = uc2ptr;				\
  |  | 2918|  30.1M|	n = n2;					\
  |  | 2919|  30.1M|} while (0)
  |  |  ------------------
  |  |  |  Branch (2919:10): [Folded, False: 30.1M]
  |  |  ------------------
  ------------------
 3104|  30.1M|				continue;
 3105|  30.1M|			}
 3106|       |
 3107|       |			/*
 3108|       |			 * Try to combine current code points.
 3109|       |			 */
 3110|       |			/*
 3111|       |			 * We have to combine Hangul characters according to
 3112|       |			 * http://uniicode.org/reports/tr15/#Hangul
 3113|       |			 */
 3114|  11.0k|			if (0 <= (LIndex = uc - HC_LBASE) &&
  ------------------
  |  | 2869|  11.0k|#define HC_LBASE	0x1100
  ------------------
  |  Branch (3114:8): [True: 7.04k, False: 4.05k]
  ------------------
 3115|  7.04k|			    LIndex < HC_LCOUNT) {
  ------------------
  |  | 2872|  7.04k|#define HC_LCOUNT	19
  ------------------
  |  Branch (3115:8): [True: 11, False: 7.03k]
  ------------------
 3116|       |				/*
 3117|       |				 * Hangul Composition.
 3118|       |				 * 1. Two current code points are L and V.
 3119|       |				 */
 3120|     11|				int VIndex = uc2 - HC_VBASE;
  ------------------
  |  | 2870|     11|#define HC_VBASE	0x1161
  ------------------
 3121|     11|				if (0 <= VIndex && VIndex < HC_VCOUNT) {
  ------------------
  |  | 2873|     11|#define HC_VCOUNT	21
  ------------------
  |  Branch (3121:9): [True: 11, False: 0]
  |  Branch (3121:24): [True: 0, False: 11]
  ------------------
 3122|       |					/* Make syllable of form LV. */
 3123|      0|					UPDATE_UC(HC_SBASE +
  ------------------
  |  | 2907|      0|#define UPDATE_UC(new_uc)	do {		\
  |  | 2908|      0|	uc = new_uc;				\
  |  | 2909|      0|	ucptr = NULL;				\
  |  | 2910|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (2910:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3124|      0|					    (LIndex * HC_VCOUNT + VIndex) *
 3125|      0|					     HC_TCOUNT);
 3126|     11|				} else {
 3127|     11|					WRITE_UC();
  ------------------
  |  | 2943|     11|#define WRITE_UC()	do {			\
  |  | 2944|     11|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2944:6): [True: 11, False: 0]
  |  |  ------------------
  |  | 2945|     11|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2945:7): [True: 0, False: 11]
  |  |  ------------------
  |  | 2946|     11|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2921|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2922|      0|	as->length = p - as->s;			\
  |  |  |  | 2923|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2923:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2924|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2925|      0|		return (-1);			\
  |  |  |  | 2926|      0|	p = as->s + as->length;			\
  |  |  |  | 2927|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2928|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2928:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2947|     11|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2947:11): [True: 11, False: 0]
  |  |  ------------------
  |  | 2948|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2948:3): [True: 0, False: 11]
  |  |  ------------------
  |  | 2949|      0|			*p++ = *ucptr++;	\
  |  | 2950|      0|			/* FALL THROUGH */	\
  |  | 2951|      0|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2951:3): [True: 0, False: 11]
  |  |  ------------------
  |  | 2952|      0|			*p++ = *ucptr++;	\
  |  | 2953|      0|			/* FALL THROUGH */	\
  |  | 2954|     11|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 11, False: 0]
  |  |  ------------------
  |  | 2955|     11|			*p++ = *ucptr++;	\
  |  | 2956|     11|			/* FALL THROUGH */	\
  |  | 2957|     11|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 0, False: 11]
  |  |  ------------------
  |  | 2958|     11|			*p++ = *ucptr;		\
  |  | 2959|     11|			break;			\
  |  | 2960|     11|		}				\
  |  | 2961|     11|		ucptr = NULL;			\
  |  | 2962|     11|	} else {				\
  |  | 2963|      0|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2930|      0|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2931|      0|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2931:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2932|      0|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2921|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2922|      0|	as->length = p - as->s;			\
  |  |  |  |  |  | 2923|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2923:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2924|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2925|      0|		return (-1);			\
  |  |  |  |  |  | 2926|      0|	p = as->s + as->length;			\
  |  |  |  |  |  | 2927|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2928|      0|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2928:10): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2933|      0|	}					\
  |  |  |  | 2934|      0|	p += w;					\
  |  |  |  | 2935|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2935:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2964|      0|	}					\
  |  | 2965|     11|} while (0)
  |  |  ------------------
  |  |  |  Branch (2965:10): [Folded, False: 11]
  |  |  ------------------
  ------------------
 3128|     11|					REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2915|     11|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2916|     11|	uc = uc2;				\
  |  | 2917|     11|	ucptr = uc2ptr;				\
  |  | 2918|     11|	n = n2;					\
  |  | 2919|     11|} while (0)
  |  |  ------------------
  |  |  |  Branch (2919:10): [Folded, False: 11]
  |  |  ------------------
  ------------------
 3129|     11|				}
 3130|     11|				continue;
 3131|  11.0k|			} else if (0 <= (SIndex = uc - HC_SBASE) &&
  ------------------
  |  | 2868|  11.0k|#define HC_SBASE	0xAC00
  ------------------
  |  Branch (3131:15): [True: 2.63k, False: 8.45k]
  ------------------
 3132|  2.63k|			    SIndex < HC_SCOUNT && (SIndex % HC_TCOUNT) == 0) {
  ------------------
  |  | 2876|  13.7k|#define HC_SCOUNT	(HC_LCOUNT * HC_NCOUNT)
  |  |  ------------------
  |  |  |  | 2872|  2.63k|#define HC_LCOUNT	19
  |  |  ------------------
  |  |               #define HC_SCOUNT	(HC_LCOUNT * HC_NCOUNT)
  |  |  ------------------
  |  |  |  | 2875|  2.63k|#define HC_NCOUNT	(HC_VCOUNT * HC_TCOUNT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2873|  2.63k|#define HC_VCOUNT	21
  |  |  |  |  ------------------
  |  |  |  |               #define HC_NCOUNT	(HC_VCOUNT * HC_TCOUNT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2874|  2.63k|#define HC_TCOUNT	28
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              			    SIndex < HC_SCOUNT && (SIndex % HC_TCOUNT) == 0) {
  ------------------
  |  | 2874|  1.56k|#define HC_TCOUNT	28
  ------------------
  |  Branch (3132:8): [True: 1.56k, False: 1.07k]
  |  Branch (3132:30): [True: 46, False: 1.51k]
  ------------------
 3133|       |				/*
 3134|       |				 * Hangul Composition.
 3135|       |				 * 2. Two current code points are LV and T.
 3136|       |				 */
 3137|     46|				int TIndex = uc2 - HC_TBASE;
  ------------------
  |  | 2871|     46|#define HC_TBASE	0x11A7
  ------------------
 3138|     46|				if (0 < TIndex && TIndex < HC_TCOUNT) {
  ------------------
  |  | 2874|     46|#define HC_TCOUNT	28
  ------------------
  |  Branch (3138:9): [True: 46, False: 0]
  |  Branch (3138:23): [True: 0, False: 46]
  ------------------
 3139|       |					/* Make syllable of form LVT. */
 3140|      0|					UPDATE_UC(uc + TIndex);
  ------------------
  |  | 2907|      0|#define UPDATE_UC(new_uc)	do {		\
  |  | 2908|      0|	uc = new_uc;				\
  |  | 2909|      0|	ucptr = NULL;				\
  |  | 2910|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (2910:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3141|     46|				} else {
 3142|     46|					WRITE_UC();
  ------------------
  |  | 2943|     46|#define WRITE_UC()	do {			\
  |  | 2944|     46|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2944:6): [True: 46, False: 0]
  |  |  ------------------
  |  | 2945|     46|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2945:7): [True: 0, False: 46]
  |  |  ------------------
  |  | 2946|     46|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2921|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2922|      0|	as->length = p - as->s;			\
  |  |  |  | 2923|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2923:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2924|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2925|      0|		return (-1);			\
  |  |  |  | 2926|      0|	p = as->s + as->length;			\
  |  |  |  | 2927|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2928|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2928:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2947|     46|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2947:11): [True: 46, False: 0]
  |  |  ------------------
  |  | 2948|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2948:3): [True: 0, False: 46]
  |  |  ------------------
  |  | 2949|      0|			*p++ = *ucptr++;	\
  |  | 2950|      0|			/* FALL THROUGH */	\
  |  | 2951|      0|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2951:3): [True: 0, False: 46]
  |  |  ------------------
  |  | 2952|      0|			*p++ = *ucptr++;	\
  |  | 2953|      0|			/* FALL THROUGH */	\
  |  | 2954|     46|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 46, False: 0]
  |  |  ------------------
  |  | 2955|     46|			*p++ = *ucptr++;	\
  |  | 2956|     46|			/* FALL THROUGH */	\
  |  | 2957|     46|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 0, False: 46]
  |  |  ------------------
  |  | 2958|     46|			*p++ = *ucptr;		\
  |  | 2959|     46|			break;			\
  |  | 2960|     46|		}				\
  |  | 2961|     46|		ucptr = NULL;			\
  |  | 2962|     46|	} else {				\
  |  | 2963|      0|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2930|      0|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2931|      0|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2931:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2932|      0|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2921|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2922|      0|	as->length = p - as->s;			\
  |  |  |  |  |  | 2923|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2923:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2924|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2925|      0|		return (-1);			\
  |  |  |  |  |  | 2926|      0|	p = as->s + as->length;			\
  |  |  |  |  |  | 2927|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2928|      0|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2928:10): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2933|      0|	}					\
  |  |  |  | 2934|      0|	p += w;					\
  |  |  |  | 2935|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2935:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2964|      0|	}					\
  |  | 2965|     46|} while (0)
  |  |  ------------------
  |  |  |  Branch (2965:10): [Folded, False: 46]
  |  |  ------------------
  ------------------
 3143|     46|					REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2915|     46|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2916|     46|	uc = uc2;				\
  |  | 2917|     46|	ucptr = uc2ptr;				\
  |  | 2918|     46|	n = n2;					\
  |  | 2919|     46|} while (0)
  |  |  ------------------
  |  |  |  Branch (2919:10): [Folded, False: 46]
  |  |  ------------------
  ------------------
 3144|     46|				}
 3145|     46|				continue;
 3146|  11.0k|			} else if ((nfc = get_nfc(uc, uc2)) != 0) {
  ------------------
  |  Branch (3146:15): [True: 132, False: 10.9k]
  ------------------
 3147|       |				/* A composition to current code points
 3148|       |				 * is found. */
 3149|    132|				UPDATE_UC(nfc);
  ------------------
  |  | 2907|    132|#define UPDATE_UC(new_uc)	do {		\
  |  | 2908|    132|	uc = new_uc;				\
  |  | 2909|    132|	ucptr = NULL;				\
  |  | 2910|    132|} while (0)
  |  |  ------------------
  |  |  |  Branch (2910:10): [Folded, False: 132]
  |  |  ------------------
  ------------------
 3150|    132|				continue;
 3151|  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 (3151:15): [True: 7.08k, False: 3.82k]
  ------------------
 3152|       |				/* Clearly 'uc2' the second code point is not
 3153|       |				 * a decomposable code. */
 3154|  7.08k|				WRITE_UC();
  ------------------
  |  | 2943|  7.08k|#define WRITE_UC()	do {			\
  |  | 2944|  7.08k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2944:6): [True: 7.08k, False: 2]
  |  |  ------------------
  |  | 2945|  7.08k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2945:7): [True: 0, False: 7.08k]
  |  |  ------------------
  |  | 2946|  7.08k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2921|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2922|      0|	as->length = p - as->s;			\
  |  |  |  | 2923|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2923:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2924|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2925|      0|		return (-1);			\
  |  |  |  | 2926|      0|	p = as->s + as->length;			\
  |  |  |  | 2927|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2928|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2928:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2947|  7.08k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2947:11): [True: 7.08k, False: 0]
  |  |  ------------------
  |  | 2948|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2948:3): [True: 0, False: 7.08k]
  |  |  ------------------
  |  | 2949|      0|			*p++ = *ucptr++;	\
  |  | 2950|      0|			/* FALL THROUGH */	\
  |  | 2951|      0|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2951:3): [True: 0, False: 7.08k]
  |  |  ------------------
  |  | 2952|      0|			*p++ = *ucptr++;	\
  |  | 2953|      0|			/* FALL THROUGH */	\
  |  | 2954|  7.07k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 7.07k, False: 15]
  |  |  ------------------
  |  | 2955|  7.07k|			*p++ = *ucptr++;	\
  |  | 2956|  7.07k|			/* FALL THROUGH */	\
  |  | 2957|  7.08k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 15, False: 7.07k]
  |  |  ------------------
  |  | 2958|  7.08k|			*p++ = *ucptr;		\
  |  | 2959|  7.08k|			break;			\
  |  | 2960|  7.08k|		}				\
  |  | 2961|  7.08k|		ucptr = NULL;			\
  |  | 2962|  7.08k|	} else {				\
  |  | 2963|      2|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2930|      2|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2931|      2|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2931:9): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  |  | 2932|      0|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2921|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2922|      0|	as->length = p - as->s;			\
  |  |  |  |  |  | 2923|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2923:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2924|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2925|      0|		return (-1);			\
  |  |  |  |  |  | 2926|      0|	p = as->s + as->length;			\
  |  |  |  |  |  | 2927|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2928|      0|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2928:10): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2933|      0|	}					\
  |  |  |  | 2934|      2|	p += w;					\
  |  |  |  | 2935|      2|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2935:10): [Folded, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2964|      2|	}					\
  |  | 2965|  7.08k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2965:10): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
 3155|  7.08k|				REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2915|  7.08k|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2916|  7.08k|	uc = uc2;				\
  |  | 2917|  7.08k|	ucptr = uc2ptr;				\
  |  | 2918|  7.08k|	n = n2;					\
  |  | 2919|  7.08k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2919:10): [Folded, False: 7.08k]
  |  |  ------------------
  ------------------
 3156|  7.08k|				continue;
 3157|  7.08k|			}
 3158|       |
 3159|       |			/*
 3160|       |			 * Collect following decomposable code points.
 3161|       |			 */
 3162|  3.82k|			cx = 0;
 3163|  3.82k|			ucx[0] = uc2;
 3164|  3.82k|			ccx[0] = cl;
 3165|  3.82k|			COLLECT_CPS(1);
  ------------------
  |  | 2970|  3.82k|#define COLLECT_CPS(start)	do {		\
  |  | 2971|  3.82k|	int _i;					\
  |  | 2972|  6.35k|	for (_i = start; _i < FDC_MAX ; _i++) {	\
  |  |  ------------------
  |  |  |  | 2901|  6.35k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2972:19): [True: 6.35k, False: 0]
  |  |  ------------------
  |  | 2973|  6.35k|		nx = parse(&ucx[_i], s, len);	\
  |  | 2974|  6.35k|		if (nx <= 0)			\
  |  |  ------------------
  |  |  |  Branch (2974:7): [True: 2.86k, False: 3.49k]
  |  |  ------------------
  |  | 2975|  6.35k|			break;			\
  |  | 2976|  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])
  |  |  ------------------
  |  | 2977|  3.49k|		if (cl >= cx && cl != 228 && cx != 228)\
  |  |  ------------------
  |  |  |  Branch (2977:7): [True: 960, False: 2.53k]
  |  |  |  Branch (2977:19): [True: 960, False: 0]
  |  |  |  Branch (2977:32): [True: 960, False: 0]
  |  |  ------------------
  |  | 2978|  3.49k|			break;			\
  |  | 2979|  3.49k|		s += nx;			\
  |  | 2980|  2.53k|		len -= nx;			\
  |  | 2981|  2.53k|		cl = cx;			\
  |  | 2982|  2.53k|		ccx[_i] = cx;			\
  |  | 2983|  2.53k|	}					\
  |  | 2984|  3.82k|	if (_i >= FDC_MAX) {			\
  |  |  ------------------
  |  |  |  | 2901|  3.82k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2984:6): [True: 0, False: 3.82k]
  |  |  ------------------
  |  | 2985|      0|		ret = -1;			\
  |  | 2986|      0|		ucx_size = FDC_MAX;		\
  |  |  ------------------
  |  |  |  | 2901|      0|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  | 2987|      0|	} else					\
  |  | 2988|  3.82k|		ucx_size = _i;			\
  |  | 2989|  3.82k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2989:10): [Folded, False: 3.82k]
  |  |  ------------------
  ------------------
 3166|       |
 3167|       |			/*
 3168|       |			 * Find a composed code in the collected code points.
 3169|       |			 */
 3170|  3.82k|			i = 1;
 3171|  8.88k|			while (i < ucx_size) {
  ------------------
  |  Branch (3171:11): [True: 5.06k, False: 3.82k]
  ------------------
 3172|  5.06k|				int j;
 3173|       |
 3174|  5.06k|				if ((nfc = get_nfc(uc, ucx[i])) == 0) {
  ------------------
  |  Branch (3174:9): [True: 2.53k, False: 2.53k]
  ------------------
 3175|  2.53k|					i++;
 3176|  2.53k|					continue;
 3177|  2.53k|				}
 3178|       |
 3179|       |				/*
 3180|       |				 * nfc is composed of uc and ucx[i].
 3181|       |				 */
 3182|  2.53k|				UPDATE_UC(nfc);
  ------------------
  |  | 2907|  2.53k|#define UPDATE_UC(new_uc)	do {		\
  |  | 2908|  2.53k|	uc = new_uc;				\
  |  | 2909|  2.53k|	ucptr = NULL;				\
  |  | 2910|  2.53k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2910:10): [Folded, False: 2.53k]
  |  |  ------------------
  ------------------
 3183|       |
 3184|       |				/*
 3185|       |				 * Remove ucx[i] by shifting
 3186|       |				 * following code points.
 3187|       |				 */
 3188|  2.53k|				for (j = i; j+1 < ucx_size; j++) {
  ------------------
  |  Branch (3188:17): [True: 0, False: 2.53k]
  ------------------
 3189|      0|					ucx[j] = ucx[j+1];
 3190|      0|					ccx[j] = ccx[j+1];
 3191|      0|				}
 3192|  2.53k|				ucx_size --;
 3193|       |
 3194|       |				/*
 3195|       |				 * Collect following code points blocked
 3196|       |				 * by ucx[i] the removed code point.
 3197|       |				 */
 3198|  2.53k|				if (ucx_size > 0 && i == ucx_size &&
  ------------------
  |  Branch (3198:9): [True: 2.53k, False: 0]
  |  Branch (3198:25): [True: 2.53k, False: 0]
  ------------------
 3199|  2.53k|				    nx > 0 && cx == cl) {
  ------------------
  |  Branch (3199:9): [True: 0, False: 2.53k]
  |  Branch (3199:19): [True: 0, False: 0]
  ------------------
 3200|      0|					cl =  ccx[ucx_size-1];
 3201|      0|					COLLECT_CPS(ucx_size);
  ------------------
  |  | 2970|      0|#define COLLECT_CPS(start)	do {		\
  |  | 2971|      0|	int _i;					\
  |  | 2972|      0|	for (_i = start; _i < FDC_MAX ; _i++) {	\
  |  |  ------------------
  |  |  |  | 2901|      0|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2972:19): [True: 0, False: 0]
  |  |  ------------------
  |  | 2973|      0|		nx = parse(&ucx[_i], s, len);	\
  |  | 2974|      0|		if (nx <= 0)			\
  |  |  ------------------
  |  |  |  Branch (2974:7): [True: 0, False: 0]
  |  |  ------------------
  |  | 2975|      0|			break;			\
  |  | 2976|      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])
  |  |  ------------------
  |  | 2977|      0|		if (cl >= cx && cl != 228 && cx != 228)\
  |  |  ------------------
  |  |  |  Branch (2977:7): [True: 0, False: 0]
  |  |  |  Branch (2977:19): [True: 0, False: 0]
  |  |  |  Branch (2977:32): [True: 0, False: 0]
  |  |  ------------------
  |  | 2978|      0|			break;			\
  |  | 2979|      0|		s += nx;			\
  |  | 2980|      0|		len -= nx;			\
  |  | 2981|      0|		cl = cx;			\
  |  | 2982|      0|		ccx[_i] = cx;			\
  |  | 2983|      0|	}					\
  |  | 2984|      0|	if (_i >= FDC_MAX) {			\
  |  |  ------------------
  |  |  |  | 2901|      0|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2984:6): [True: 0, False: 0]
  |  |  ------------------
  |  | 2985|      0|		ret = -1;			\
  |  | 2986|      0|		ucx_size = FDC_MAX;		\
  |  |  ------------------
  |  |  |  | 2901|      0|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  | 2987|      0|	} else					\
  |  | 2988|      0|		ucx_size = _i;			\
  |  | 2989|      0|} while (0)
  |  |  ------------------
  |  |  |  Branch (2989:10): [Folded, False: 0]
  |  |  ------------------
  ------------------
 3202|      0|				}
 3203|       |				/*
 3204|       |				 * Restart finding a composed code with
 3205|       |				 * the updated uc from the top of the
 3206|       |				 * collected code points.
 3207|       |				 */
 3208|  2.53k|				i = 0;
 3209|  2.53k|			}
 3210|       |
 3211|       |			/*
 3212|       |			 * Apparently the current code points are not
 3213|       |			 * decomposed characters or already composed.
 3214|       |			 */
 3215|  3.82k|			WRITE_UC();
  ------------------
  |  | 2943|  3.82k|#define WRITE_UC()	do {			\
  |  | 2944|  3.82k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2944:6): [True: 1.29k, False: 2.53k]
  |  |  ------------------
  |  | 2945|  1.29k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2945:7): [True: 0, False: 1.29k]
  |  |  ------------------
  |  | 2946|  1.29k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2921|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2922|      0|	as->length = p - as->s;			\
  |  |  |  | 2923|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2923:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2924|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2925|      0|		return (-1);			\
  |  |  |  | 2926|      0|	p = as->s + as->length;			\
  |  |  |  | 2927|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2928|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2928:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2947|  1.29k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2947:11): [True: 1.29k, False: 0]
  |  |  ------------------
  |  | 2948|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2948:3): [True: 0, False: 1.29k]
  |  |  ------------------
  |  | 2949|      0|			*p++ = *ucptr++;	\
  |  | 2950|      0|			/* FALL THROUGH */	\
  |  | 2951|    164|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2951:3): [True: 164, False: 1.12k]
  |  |  ------------------
  |  | 2952|    164|			*p++ = *ucptr++;	\
  |  | 2953|    164|			/* FALL THROUGH */	\
  |  | 2954|    862|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 698, False: 592]
  |  |  ------------------
  |  | 2955|    862|			*p++ = *ucptr++;	\
  |  | 2956|    862|			/* FALL THROUGH */	\
  |  | 2957|  1.29k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 428, False: 862]
  |  |  ------------------
  |  | 2958|  1.29k|			*p++ = *ucptr;		\
  |  | 2959|  1.29k|			break;			\
  |  | 2960|  1.29k|		}				\
  |  | 2961|  1.29k|		ucptr = NULL;			\
  |  | 2962|  2.53k|	} else {				\
  |  | 2963|  2.53k|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2930|  2.53k|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2931|  2.53k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2931:9): [True: 0, False: 2.53k]
  |  |  |  |  ------------------
  |  |  |  | 2932|      0|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2921|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2922|      0|	as->length = p - as->s;			\
  |  |  |  |  |  | 2923|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2923:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2924|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2925|      0|		return (-1);			\
  |  |  |  |  |  | 2926|      0|	p = as->s + as->length;			\
  |  |  |  |  |  | 2927|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2928|      0|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2928:10): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2933|      0|	}					\
  |  |  |  | 2934|  2.53k|	p += w;					\
  |  |  |  | 2935|  2.53k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2935:10): [Folded, False: 2.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2964|  2.53k|	}					\
  |  | 2965|  3.82k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2965:10): [Folded, False: 3.82k]
  |  |  ------------------
  ------------------
 3216|  7.64k|			for (i = 0; i < ucx_size; i++)
  ------------------
  |  Branch (3216:16): [True: 3.82k, False: 3.82k]
  ------------------
 3217|  3.82k|				UNPARSE(p, endp, ucx[i]);
  ------------------
  |  | 2930|  7.64k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2931|  3.82k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2931:9): [True: 0, False: 3.82k]
  |  |  ------------------
  |  | 2932|      0|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2921|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2922|      0|	as->length = p - as->s;			\
  |  |  |  | 2923|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2923:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2924|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2925|      0|		return (-1);			\
  |  |  |  | 2926|      0|	p = as->s + as->length;			\
  |  |  |  | 2927|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2928|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2928:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2933|      0|	}					\
  |  | 2934|  3.82k|	p += w;					\
  |  | 2935|  3.82k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2935:10): [Folded, False: 3.82k]
  |  |  ------------------
  ------------------
 3218|       |
 3219|       |			/*
 3220|       |			 * Flush out remaining canonical combining characters.
 3221|       |			 */
 3222|  3.82k|			if (nx > 0 && cx == cl && len > 0) {
  ------------------
  |  Branch (3222:8): [True: 960, False: 2.86k]
  |  Branch (3222:18): [True: 26, False: 934]
  |  Branch (3222:30): [True: 26, False: 0]
  ------------------
 3223|    113|				while ((nx = parse(&ucx[0], s, len))
  ------------------
  |  Branch (3223:12): [True: 113, False: 0]
  ------------------
 3224|    113|				    > 0) {
 3225|    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])
  ------------------
 3226|    113|					if (cl > cx)
  ------------------
  |  Branch (3226:10): [True: 26, False: 87]
  ------------------
 3227|     26|						break;
 3228|     87|					s += nx;
 3229|     87|					len -= nx;
 3230|     87|					cl = cx;
 3231|     87|					UNPARSE(p, endp, ucx[0]);
  ------------------
  |  | 2930|     87|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2931|     87|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2931:9): [True: 0, False: 87]
  |  |  ------------------
  |  | 2932|      0|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2921|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2922|      0|	as->length = p - as->s;			\
  |  |  |  | 2923|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2923:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2924|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2925|      0|		return (-1);			\
  |  |  |  | 2926|      0|	p = as->s + as->length;			\
  |  |  |  | 2927|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2928|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2928:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2933|      0|	}					\
  |  | 2934|     87|	p += w;					\
  |  | 2935|     87|} while (0)
  |  |  ------------------
  |  |  |  Branch (2935:10): [Folded, False: 87]
  |  |  ------------------
  ------------------
 3232|     87|				}
 3233|     26|			}
 3234|  3.82k|			break;
 3235|  3.82k|		}
 3236|  27.7k|		if (n2 < 0) {
  ------------------
  |  Branch (3236:7): [True: 13.3k, False: 14.4k]
  ------------------
 3237|  13.3k|			WRITE_UC();
  ------------------
  |  | 2943|  13.3k|#define WRITE_UC()	do {			\
  |  | 2944|  13.3k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2944:6): [True: 12.9k, False: 349]
  |  |  ------------------
  |  | 2945|  12.9k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2945:7): [True: 0, False: 12.9k]
  |  |  ------------------
  |  | 2946|  12.9k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2921|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2922|      0|	as->length = p - as->s;			\
  |  |  |  | 2923|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2923:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2924|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2925|      0|		return (-1);			\
  |  |  |  | 2926|      0|	p = as->s + as->length;			\
  |  |  |  | 2927|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2928|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2928:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2947|  12.9k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2947:11): [True: 12.9k, False: 0]
  |  |  ------------------
  |  | 2948|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2948:3): [True: 0, False: 12.9k]
  |  |  ------------------
  |  | 2949|      0|			*p++ = *ucptr++;	\
  |  | 2950|      0|			/* FALL THROUGH */	\
  |  | 2951|    133|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2951:3): [True: 133, False: 12.8k]
  |  |  ------------------
  |  | 2952|    133|			*p++ = *ucptr++;	\
  |  | 2953|    133|			/* FALL THROUGH */	\
  |  | 2954|  1.34k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 1.20k, False: 11.7k]
  |  |  ------------------
  |  | 2955|  1.34k|			*p++ = *ucptr++;	\
  |  | 2956|  1.34k|			/* FALL THROUGH */	\
  |  | 2957|  12.9k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 11.6k, False: 1.34k]
  |  |  ------------------
  |  | 2958|  12.9k|			*p++ = *ucptr;		\
  |  | 2959|  12.9k|			break;			\
  |  | 2960|  12.9k|		}				\
  |  | 2961|  12.9k|		ucptr = NULL;			\
  |  | 2962|  12.9k|	} else {				\
  |  | 2963|    349|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2930|    349|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2931|    351|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2931:9): [True: 2, False: 349]
  |  |  |  |  ------------------
  |  |  |  | 2932|      2|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2921|      2|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2922|      2|	as->length = p - as->s;			\
  |  |  |  |  |  | 2923|      2|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2923:6): [True: 0, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2924|      2|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2925|      2|		return (-1);			\
  |  |  |  |  |  | 2926|      2|	p = as->s + as->length;			\
  |  |  |  |  |  | 2927|      2|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2928|      2|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2928:10): [Folded, False: 2]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2933|      2|	}					\
  |  |  |  | 2934|    349|	p += w;					\
  |  |  |  | 2935|    349|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2935:10): [Folded, False: 349]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2964|    349|	}					\
  |  | 2965|  13.3k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2965:10): [Folded, False: 13.3k]
  |  |  ------------------
  ------------------
 3238|       |			/* Use a replaced unicode character. */
 3239|  13.3k|			UNPARSE(p, endp, uc2);
  ------------------
  |  | 2930|  13.3k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2931|  13.4k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2931:9): [True: 141, False: 13.3k]
  |  |  ------------------
  |  | 2932|    141|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2921|    141|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2922|    141|	as->length = p - as->s;			\
  |  |  |  | 2923|    141|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2923:6): [True: 0, False: 141]
  |  |  |  |  ------------------
  |  |  |  | 2924|    141|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2925|    141|		return (-1);			\
  |  |  |  | 2926|    141|	p = as->s + as->length;			\
  |  |  |  | 2927|    141|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2928|    141|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2928:10): [Folded, False: 141]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2933|    141|	}					\
  |  | 2934|  13.3k|	p += w;					\
  |  | 2935|  13.3k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2935:10): [Folded, False: 13.3k]
  |  |  ------------------
  ------------------
 3240|  13.3k|			s += n2*-1;
 3241|  13.3k|			len -= n2*-1;
 3242|  13.3k|			ret = -1;
 3243|  13.3k|			continue;
 3244|  14.4k|		} else if (n2 == 0) {
  ------------------
  |  Branch (3244:14): [True: 10.6k, False: 3.82k]
  ------------------
 3245|  10.6k|			WRITE_UC();
  ------------------
  |  | 2943|  10.6k|#define WRITE_UC()	do {			\
  |  | 2944|  10.6k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2944:6): [True: 10.6k, False: 0]
  |  |  ------------------
  |  | 2945|  10.6k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2945:7): [True: 0, False: 10.6k]
  |  |  ------------------
  |  | 2946|  10.6k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2921|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2922|      0|	as->length = p - as->s;			\
  |  |  |  | 2923|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2923:6): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2924|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2925|      0|		return (-1);			\
  |  |  |  | 2926|      0|	p = as->s + as->length;			\
  |  |  |  | 2927|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2928|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2928:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2947|  10.6k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2947:11): [True: 10.6k, False: 0]
  |  |  ------------------
  |  | 2948|    265|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2948:3): [True: 265, False: 10.3k]
  |  |  ------------------
  |  | 2949|    265|			*p++ = *ucptr++;	\
  |  | 2950|    265|			/* FALL THROUGH */	\
  |  | 2951|    265|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2951:3): [True: 0, False: 10.6k]
  |  |  ------------------
  |  | 2952|    265|			*p++ = *ucptr++;	\
  |  | 2953|    265|			/* FALL THROUGH */	\
  |  | 2954|    863|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 598, False: 10.0k]
  |  |  ------------------
  |  | 2955|    863|			*p++ = *ucptr++;	\
  |  | 2956|    863|			/* FALL THROUGH */	\
  |  | 2957|  10.6k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 9.78k, False: 863]
  |  |  ------------------
  |  | 2958|  10.6k|			*p++ = *ucptr;		\
  |  | 2959|  10.6k|			break;			\
  |  | 2960|  10.6k|		}				\
  |  | 2961|  10.6k|		ucptr = NULL;			\
  |  | 2962|  10.6k|	} else {				\
  |  | 2963|      0|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2930|      0|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2931|      0|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2931:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2932|      0|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2921|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2922|      0|	as->length = p - as->s;			\
  |  |  |  |  |  | 2923|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2923:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2924|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2925|      0|		return (-1);			\
  |  |  |  |  |  | 2926|      0|	p = as->s + as->length;			\
  |  |  |  |  |  | 2927|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2928|      0|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2928:10): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2933|      0|	}					\
  |  |  |  | 2934|      0|	p += w;					\
  |  |  |  | 2935|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2935:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2964|      0|	}					\
  |  | 2965|  10.6k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2965:10): [Folded, False: 10.6k]
  |  |  ------------------
  ------------------
 3246|  10.6k|			break;
 3247|  10.6k|		}
 3248|  27.7k|	}
 3249|  12.8k|	as->length = p - as->s;
 3250|  12.8k|	as->s[as->length] = '\0';
 3251|  12.8k|	if (ts == 2)
  ------------------
  |  Branch (3251:6): [True: 597, False: 12.2k]
  ------------------
 3252|    597|		as->s[as->length+1] = '\0';
 3253|  12.8k|	return (ret);
 3254|  12.8k|}
archive_string.c:get_nfc:
 2880|  16.1k|{
 2881|  16.1k|	int t, b;
 2882|       |
 2883|  16.1k|	t = 0;
 2884|  16.1k|	b = sizeof(u_composition_table)/sizeof(u_composition_table[0]) -1;
 2885|   166k|	while (b >= t) {
  ------------------
  |  Branch (2885:9): [True: 152k, False: 13.4k]
  ------------------
 2886|   152k|		int m = (t + b) / 2;
 2887|   152k|		if (u_composition_table[m].cp1 < uc)
  ------------------
  |  Branch (2887:7): [True: 95.5k, False: 57.1k]
  ------------------
 2888|  95.5k|			t = m + 1;
 2889|  57.1k|		else if (u_composition_table[m].cp1 > uc)
  ------------------
  |  Branch (2889:12): [True: 48.7k, False: 8.46k]
  ------------------
 2890|  48.7k|			b = m - 1;
 2891|  8.46k|		else if (u_composition_table[m].cp2 < uc2)
  ------------------
  |  Branch (2891:12): [True: 3.13k, False: 5.33k]
  ------------------
 2892|  3.13k|			t = m + 1;
 2893|  5.33k|		else if (u_composition_table[m].cp2 > uc2)
  ------------------
  |  Branch (2893:12): [True: 2.67k, False: 2.66k]
  ------------------
 2894|  2.67k|			b = m - 1;
 2895|  2.66k|		else
 2896|  2.66k|			return (u_composition_table[m].nfc);
 2897|   152k|	}
 2898|  13.4k|	return (0);
 2899|  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|   119k|{
 1967|   119k|	size_t s;
 1968|   119k|	const char *p, *pp;
 1969|       |
 1970|   119k|	if (_p == NULL)
  ------------------
  |  Branch (1970:6): [True: 0, False: 119k]
  ------------------
 1971|      0|		return (0);
 1972|   119k|	p = (const char *)_p;
 1973|       |
 1974|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
 1975|   119k|	s = 0;
 1976|   119k|	pp = p;
 1977|  33.3M|	while (s < n && *pp) {
  ------------------
  |  Branch (1977:9): [True: 33.2M, False: 89.6k]
  |  Branch (1977:18): [True: 33.2M, False: 29.4k]
  ------------------
 1978|  33.2M|		pp++;
 1979|  33.2M|		s++;
 1980|  33.2M|	}
 1981|   119k|	return (s);
 1982|   119k|}

archive_string_sprintf:
   77|  42.4k|{
   78|  42.4k|	va_list ap;
   79|       |
   80|  42.4k|	va_start(ap, fmt);
   81|  42.4k|	archive_string_vsprintf(as, fmt, ap);
   82|       |	va_end(ap);
   83|  42.4k|}
archive_string_vsprintf:
   92|   320k|{
   93|   320k|	char long_flag;
   94|   320k|	intmax_t s; /* Signed integer temp. */
   95|   320k|	uintmax_t u; /* Unsigned integer temp. */
   96|   320k|	const char *p, *p2;
   97|   320k|	const wchar_t *pw;
   98|       |
   99|   320k|	if (archive_string_ensure(as, 64) == NULL)
  ------------------
  |  Branch (99:6): [True: 0, False: 320k]
  ------------------
  100|      0|		__archive_errx(1, "Out of memory");
  101|       |
  102|   320k|	if (fmt == NULL) {
  ------------------
  |  Branch (102:6): [True: 0, False: 320k]
  ------------------
  103|      0|		as->s[0] = 0;
  104|      0|		return;
  105|      0|	}
  106|       |
  107|  12.1M|	for (p = fmt; *p != '\0'; p++) {
  ------------------
  |  Branch (107:16): [True: 11.8M, False: 320k]
  ------------------
  108|  11.8M|		const char *saved_p = p;
  109|       |
  110|  11.8M|		if (*p != '%') {
  ------------------
  |  Branch (110:7): [True: 11.6M, False: 179k]
  ------------------
  111|  11.6M|			archive_strappend_char(as, *p);
  112|  11.6M|			continue;
  113|  11.6M|		}
  114|       |
  115|   179k|		p++;
  116|       |
  117|   179k|		long_flag = '\0';
  118|   179k|		switch(*p) {
  ------------------
  |  Branch (118:10): [True: 38.3k, False: 141k]
  ------------------
  119|     12|		case 'l':
  ------------------
  |  Branch (119:3): [True: 12, False: 179k]
  ------------------
  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|  31.6k|		case 'j':
  ------------------
  |  Branch (126:3): [True: 31.6k, False: 148k]
  ------------------
  127|  38.3k|		case 'z':
  ------------------
  |  Branch (127:3): [True: 6.70k, False: 172k]
  ------------------
  128|  38.3k|			long_flag = *p;
  129|  38.3k|			p++;
  130|  38.3k|			break;
  131|   179k|		}
  132|       |
  133|   179k|		switch (*p) {
  134|      0|		case '%':
  ------------------
  |  Branch (134:3): [True: 0, False: 179k]
  ------------------
  135|      0|			archive_strappend_char(as, '%');
  136|      0|			break;
  137|    429|		case 'c':
  ------------------
  |  Branch (137:3): [True: 429, False: 179k]
  ------------------
  138|    429|			s = va_arg(ap, int);
  139|    429|			archive_strappend_char(as, (char)s);
  140|    429|			break;
  141|   106k|		case 'd':
  ------------------
  |  Branch (141:3): [True: 106k, False: 72.6k]
  ------------------
  142|   106k|			switch(long_flag) {
  143|  27.5k|			case 'j': s = va_arg(ap, intmax_t); break;
  ------------------
  |  Branch (143:4): [True: 27.5k, False: 79.4k]
  ------------------
  144|      0|			case 'l': s = va_arg(ap, long); break;
  ------------------
  |  Branch (144:4): [True: 0, False: 106k]
  ------------------
  145|      4|			case 'L': s = va_arg(ap, long long); break;
  ------------------
  |  Branch (145:4): [True: 4, False: 106k]
  ------------------
  146|      0|			case 'z': s = va_arg(ap, ssize_t); break;
  ------------------
  |  Branch (146:4): [True: 0, False: 106k]
  ------------------
  147|  79.4k|			default:  s = va_arg(ap, int); break;
  ------------------
  |  Branch (147:4): [True: 79.4k, False: 27.5k]
  ------------------
  148|   106k|			}
  149|   106k|			append_int(as, s, 10);
  150|   106k|			break;
  151|  51.5k|		case 's':
  ------------------
  |  Branch (151:3): [True: 51.5k, False: 128k]
  ------------------
  152|  51.5k|			switch(long_flag) {
  153|      0|			case 'l':
  ------------------
  |  Branch (153:4): [True: 0, False: 51.5k]
  ------------------
  154|      0|			case 'L':
  ------------------
  |  Branch (154:4): [True: 0, False: 51.5k]
  ------------------
  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|  51.5k|			default:
  ------------------
  |  Branch (162:4): [True: 51.5k, False: 0]
  ------------------
  163|  51.5k|				p2 = va_arg(ap, char *);
  164|  51.5k|				if (p2 == NULL)
  ------------------
  |  Branch (164:9): [True: 1, False: 51.5k]
  ------------------
  165|      1|					p2 = "(null)";
  166|  51.5k|				archive_strcat(as, p2);
  167|  51.5k|				break;
  168|  51.5k|			}
  169|  51.5k|			break;
  170|  51.5k|		case 'S':
  ------------------
  |  Branch (170:3): [True: 0, False: 179k]
  ------------------
  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|  20.7k|		case 'o': case 'u': case 'x': case 'X':
  ------------------
  |  Branch (178:3): [True: 0, False: 179k]
  |  Branch (178:13): [True: 20.7k, False: 158k]
  |  Branch (178:23): [True: 8, False: 179k]
  |  Branch (178:33): [True: 4, False: 179k]
  ------------------
  179|       |			/* Common handling for unsigned integer formats. */
  180|  20.7k|			switch(long_flag) {
  181|  4.07k|			case 'j': u = va_arg(ap, uintmax_t); break;
  ------------------
  |  Branch (181:4): [True: 4.07k, False: 16.6k]
  ------------------
  182|      8|			case 'l': u = va_arg(ap, unsigned long); break;
  ------------------
  |  Branch (182:4): [True: 8, False: 20.7k]
  ------------------
  183|      0|			case 'L': u = va_arg(ap, unsigned long long); break;
  ------------------
  |  Branch (183:4): [True: 0, False: 20.7k]
  ------------------
  184|  6.70k|			case 'z': u = va_arg(ap, size_t); break;
  ------------------
  |  Branch (184:4): [True: 6.70k, False: 14.0k]
  ------------------
  185|  9.93k|			default:  u = va_arg(ap, unsigned int); break;
  ------------------
  |  Branch (185:4): [True: 9.93k, False: 10.7k]
  ------------------
  186|  20.7k|			}
  187|       |			/* Format it in the correct base. */
  188|  20.7k|			switch (*p) {
  189|      0|			case 'o': append_uint(as, u, 8); break;
  ------------------
  |  Branch (189:4): [True: 0, False: 20.7k]
  ------------------
  190|  20.7k|			case 'u': append_uint(as, u, 10); break;
  ------------------
  |  Branch (190:4): [True: 20.7k, False: 12]
  ------------------
  191|     12|			default: append_uint(as, u, 16); break;
  ------------------
  |  Branch (191:4): [True: 12, False: 20.7k]
  ------------------
  192|  20.7k|			}
  193|  20.7k|			break;
  194|  20.7k|		default:
  ------------------
  |  Branch (194:3): [True: 0, False: 179k]
  ------------------
  195|       |			/* Rewind and print the initial '%' literally. */
  196|      0|			p = saved_p;
  197|      0|			archive_strappend_char(as, *p);
  198|   179k|		}
  199|   179k|	}
  200|   320k|}
archive_string_sprintf.c:append_int:
   63|   106k|{
   64|   106k|	uintmax_t ud;
   65|       |
   66|   106k|	if (d < 0) {
  ------------------
  |  Branch (66:6): [True: 9.91k, False: 97.0k]
  ------------------
   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|  97.0k|		ud = d;
   71|   106k|	append_uint(as, ud, base);
   72|   106k|}
archive_string_sprintf.c:append_uint:
   54|   296k|{
   55|   296k|	static const char digits[] = "0123456789abcdef";
   56|   296k|	if (d >= base)
  ------------------
  |  Branch (56:6): [True: 168k, False: 127k]
  ------------------
   57|   168k|		append_uint(as, d/base, base);
   58|   296k|	archive_strappend_char(as, digits[d % base]);
   59|   296k|}

dos_to_unix:
   64|  35.8k|{
   65|  35.8k|	uint16_t msTime, msDate;
   66|  35.8k|	struct tm ts;
   67|  35.8k|	time_t t;
   68|       |
   69|  35.8k|	msTime = (0xFFFF & dos_time);
   70|  35.8k|	msDate = (dos_time >> 16);
   71|       |
   72|  35.8k|	memset(&ts, 0, sizeof(ts));
   73|  35.8k|	ts.tm_year = ((msDate >> 9) & 0x7f) + 80; /* Years since 1900. */
   74|  35.8k|	ts.tm_mon = ((msDate >> 5) & 0x0f) - 1; /* Month number. */
   75|  35.8k|	ts.tm_mday = msDate & 0x1f; /* Day of month. */
   76|  35.8k|	ts.tm_hour = (msTime >> 11) & 0x1f;
   77|  35.8k|	ts.tm_min = (msTime >> 5) & 0x3f;
   78|  35.8k|	ts.tm_sec = (msTime << 1) & 0x3e;
   79|  35.8k|	ts.tm_isdst = -1;
   80|  35.8k|	t = mktime(&ts);
   81|  35.8k|	return (int64_t)(t == (time_t)-1 ? INT32_MAX : t);
  ------------------
  |  Branch (81:19): [True: 0, False: 35.8k]
  ------------------
   82|  35.8k|}
ntfs_to_unix:
  136|  2.74k|{
  137|  2.74k|	if (ntfs > INT64_MAX) {
  ------------------
  |  Branch (137:6): [True: 66, False: 2.68k]
  ------------------
  138|     66|		ntfs -= NTFS_EPOC_TICKS;
  ------------------
  |  |   44|     66|#define NTFS_EPOC_TICKS (NTFS_EPOC_TIME * NTFS_TICKS)
  |  |  ------------------
  |  |  |  |   42|     66|#define NTFS_EPOC_TIME ARCHIVE_LITERAL_ULL(11644473600)
  |  |  |  |  ------------------
  |  |  |  |  |  |  206|     66|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define NTFS_EPOC_TICKS (NTFS_EPOC_TIME * NTFS_TICKS)
  |  |  ------------------
  |  |  |  |   43|     66|#define NTFS_TICKS ARCHIVE_LITERAL_ULL(10000000)
  |  |  |  |  ------------------
  |  |  |  |  |  |  206|     66|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  139|     66|		*secs = ntfs / NTFS_TICKS;
  ------------------
  |  |   43|     66|#define NTFS_TICKS ARCHIVE_LITERAL_ULL(10000000)
  |  |  ------------------
  |  |  |  |  206|     66|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  140|     66|		*nsecs = 100 * (ntfs % NTFS_TICKS);
  ------------------
  |  |   43|     66|#define NTFS_TICKS ARCHIVE_LITERAL_ULL(10000000)
  |  |  ------------------
  |  |  |  |  206|     66|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  141|     66|	}
  142|  2.68k|	else {
  143|  2.68k|		lldiv_t tdiv;
  144|  2.68k|		int64_t value = (int64_t)ntfs - (int64_t)NTFS_EPOC_TICKS;
  ------------------
  |  |   44|  2.68k|#define NTFS_EPOC_TICKS (NTFS_EPOC_TIME * NTFS_TICKS)
  |  |  ------------------
  |  |  |  |   42|  2.68k|#define NTFS_EPOC_TIME ARCHIVE_LITERAL_ULL(11644473600)
  |  |  |  |  ------------------
  |  |  |  |  |  |  206|  2.68k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define NTFS_EPOC_TICKS (NTFS_EPOC_TIME * NTFS_TICKS)
  |  |  ------------------
  |  |  |  |   43|  2.68k|#define NTFS_TICKS ARCHIVE_LITERAL_ULL(10000000)
  |  |  |  |  ------------------
  |  |  |  |  |  |  206|  2.68k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  145|       |
  146|  2.68k|		tdiv = lldiv(value, NTFS_TICKS);
  ------------------
  |  |   43|  2.68k|#define NTFS_TICKS ARCHIVE_LITERAL_ULL(10000000)
  |  |  ------------------
  |  |  |  |  206|  2.68k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  147|  2.68k|		*secs = tdiv.quot;
  148|  2.68k|		*nsecs = (uint32_t)(tdiv.rem * 100);
  149|  2.68k|	}
  150|  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|   305k|{
  166|   305k|	archive_string_empty(&a->error_string);
  ------------------
  |  |  181|   305k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  167|       |	a->error = NULL;
  168|   305k|	a->archive_error_number = 0;
  169|   305k|}
archive_set_error:
  173|   277k|{
  174|   277k|	va_list ap;
  175|       |
  176|   277k|	a->archive_error_number = error_number;
  177|   277k|	if (fmt == NULL) {
  ------------------
  |  Branch (177:6): [True: 0, False: 277k]
  ------------------
  178|      0|		a->error = NULL;
  179|      0|		return;
  180|      0|	}
  181|       |
  182|   277k|	archive_string_empty(&(a->error_string));
  ------------------
  |  |  181|   277k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  183|   277k|	va_start(ap, fmt);
  184|   277k|	archive_string_vsprintf(&(a->error_string), fmt, ap);
  185|       |	va_end(ap);
  186|   277k|	a->error = a->error_string.s;
  187|   277k|}

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

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

