archive_acl_clear:
  129|   546k|{
  130|   546k|	struct archive_acl_entry *ap;
  131|       |
  132|   547k|	while (acl->acl_head != NULL) {
  ------------------
  |  Branch (132:9): [True: 1.14k, False: 546k]
  ------------------
  133|  1.14k|		ap = acl->acl_head->next;
  134|  1.14k|		archive_mstring_clean(&acl->acl_head->name);
  135|  1.14k|		free(acl->acl_head);
  136|  1.14k|		acl->acl_head = ap;
  137|  1.14k|	}
  138|   546k|	free(acl->acl_text_w);
  139|   546k|	acl->acl_text_w = NULL;
  140|   546k|	free(acl->acl_text);
  141|   546k|	acl->acl_text = NULL;
  142|       |	acl->acl_p = NULL;
  143|   546k|	acl->acl_types = 0;
  144|   546k|	acl->acl_state = 0; /* Not counting. */
  145|   546k|}
archive_acl_count:
  380|    621|{
  381|    621|	int count;
  382|    621|	struct archive_acl_entry *ap;
  383|       |
  384|    621|	count = 0;
  385|    621|	ap = acl->acl_head;
  386|  1.76k|	while (ap != NULL) {
  ------------------
  |  Branch (386:9): [True: 1.14k, False: 621]
  ------------------
  387|  1.14k|		if ((ap->type & want_type) != 0)
  ------------------
  |  Branch (387:7): [True: 1.14k, False: 0]
  ------------------
  388|  1.14k|			count++;
  389|  1.14k|		ap = ap->next;
  390|  1.14k|	}
  391|       |
  392|    621|	if (count > 0 && ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0))
  ------------------
  |  |  534|    188|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (392:6): [True: 188, False: 433]
  |  Branch (392:19): [True: 106, False: 82]
  ------------------
  393|    106|		count += 3;
  394|    621|	return (count);
  395|    621|}
archive_acl_reset:
  413|    621|{
  414|    621|	int count, cutoff;
  415|       |
  416|    621|	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|    621|	if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0)
  ------------------
  |  |  534|    621|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (423:6): [True: 165, False: 456]
  ------------------
  424|    165|		cutoff = 3;
  425|    456|	else
  426|    456|		cutoff = 0;
  427|       |
  428|    621|	if (count > cutoff)
  ------------------
  |  Branch (428:6): [True: 188, False: 433]
  ------------------
  429|    188|		acl->acl_state = ARCHIVE_ENTRY_ACL_USER_OBJ;
  ------------------
  |  |  549|    188|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  430|    433|	else
  431|    433|		acl->acl_state = 0;
  432|    621|	acl->acl_p = acl->acl_head;
  433|    621|	return (count);
  434|    621|}
archive_acl_from_text_l:
 1506|    583|{
 1507|    583|	return archive_acl_from_text_nl(acl, text, strlen(text), want_type, sc);
 1508|    583|}
archive_acl_from_text_nl:
 1513|    621|{
 1514|    621|	struct {
 1515|    621|		const char *start;
 1516|    621|		const char *end;
 1517|    621|	} field[6], name;
 1518|       |
 1519|    621|	const char *s, *st, *text_end;
 1520|    621|	int numfields, fields, n, r, sol, ret;
 1521|    621|	int type, types, tag, permset, id;
 1522|    621|	size_t len;
 1523|    621|	char sep;
 1524|       |
 1525|    621|	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: 621]
  ------------------
 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|    297|	case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
  ------------------
  |  |  534|    297|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (1529:2): [True: 297, False: 324]
  ------------------
 1530|    319|	case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
  ------------------
  |  |  535|    319|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
  |  Branch (1530:2): [True: 22, False: 599]
  ------------------
 1531|    319|		numfields = 5;
 1532|    319|		break;
 1533|    302|	case ARCHIVE_ENTRY_ACL_TYPE_NFS4:
  ------------------
  |  |  542|    302|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|    302|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|    302|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|    302|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|    302|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|    302|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|    302|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|    302|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (1533:2): [True: 302, False: 319]
  ------------------
 1534|    302|		numfields = 6;
 1535|    302|		break;
 1536|      0|	default:
  ------------------
  |  Branch (1536:2): [True: 0, False: 621]
  ------------------
 1537|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1538|    621|	}
 1539|       |
 1540|    621|	ret = ARCHIVE_OK;
  ------------------
  |  |  233|    621|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1541|    621|	types = 0;
 1542|    621|	text_end = (text == NULL) ? text : text + length;
  ------------------
  |  Branch (1542:13): [True: 0, False: 621]
  ------------------
 1543|       |
 1544|  27.8k|	while (text != NULL && length > 0 && *text != '\0') {
  ------------------
  |  Branch (1544:9): [True: 27.8k, False: 0]
  |  Branch (1544:25): [True: 27.2k, False: 601]
  |  Branch (1544:39): [True: 27.2k, False: 20]
  ------------------
 1545|       |		/*
 1546|       |		 * Parse the fields out of the next entry,
 1547|       |		 * advance 'text' to start of next entry.
 1548|       |		 */
 1549|  27.2k|		fields = 0;
 1550|  52.6k|		do {
 1551|  52.6k|			const char *start, *end;
 1552|  52.6k|			next_field(&text, &length, &start, &end, &sep);
 1553|  52.6k|			if (fields < numfields) {
  ------------------
  |  Branch (1553:8): [True: 50.5k, False: 2.14k]
  ------------------
 1554|  50.5k|				field[fields].start = start;
 1555|  50.5k|				field[fields].end = end;
 1556|  50.5k|			}
 1557|  52.6k|			++fields;
 1558|  52.6k|		} while (sep == ':');
  ------------------
  |  Branch (1558:12): [True: 25.4k, False: 27.2k]
  ------------------
 1559|       |
 1560|       |		/* Set remaining fields to blank. */
 1561|   120k|		for (n = fields; n < numfields; ++n)
  ------------------
  |  Branch (1561:20): [True: 93.0k, False: 27.2k]
  ------------------
 1562|  93.0k|			field[n].start = field[n].end = NULL;
 1563|       |
 1564|  27.2k|		if (field[0].start == NULL || field[0].end == NULL) {
  ------------------
  |  Branch (1564:7): [True: 0, False: 27.2k]
  |  Branch (1564:33): [True: 0, False: 27.2k]
  ------------------
 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|  27.2k|		if (field[0].start == text_end) {
  ------------------
  |  Branch (1569:7): [True: 27, False: 27.2k]
  ------------------
 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|     27|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     27|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1578|     27|			continue;
 1579|     27|		}
 1580|       |
 1581|  27.2k|		if (*(field[0].start) == '#') {
  ------------------
  |  Branch (1581:7): [True: 223, False: 27.0k]
  ------------------
 1582|       |			/* Comment, skip entry */
 1583|    223|			continue;
 1584|    223|		}
 1585|       |
 1586|  27.0k|		n = 0;
 1587|  27.0k|		sol = 0;
 1588|  27.0k|		id = -1;
 1589|  27.0k|		permset = 0;
 1590|  27.0k|		name.start = name.end = NULL;
 1591|       |
 1592|  27.0k|		if (want_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|  27.0k|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|  27.0k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|  27.0k|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|  27.0k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|  27.0k|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|  27.0k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|  27.0k|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|  27.0k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (1592:7): [True: 19.8k, False: 7.17k]
  ------------------
 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|  19.8k|			s = field[0].start;
 1603|  19.8k|			len = field[0].end - field[0].start;
 1604|  19.8k|			if (*s == 'd' && (len == 1 || (len >= 7
  ------------------
  |  Branch (1604:8): [True: 2.24k, False: 17.5k]
  |  Branch (1604:22): [True: 1.57k, False: 662]
  |  Branch (1604:35): [True: 208, False: 454]
  ------------------
 1605|  1.67k|			    && memcmp((s + 1), "efault", 6) == 0))) {
  ------------------
  |  Branch (1605:11): [True: 100, False: 108]
  ------------------
 1606|  1.67k|				type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT;
  ------------------
  |  |  535|  1.67k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
 1607|  1.67k|				if (len > 7)
  ------------------
  |  Branch (1607:9): [True: 99, False: 1.57k]
  ------------------
 1608|     99|					field[0].start += 7;
 1609|  1.57k|				else
 1610|  1.57k|					n = 1;
 1611|  1.67k|			} else
 1612|  18.1k|				type = want_type;
 1613|       |
 1614|       |			/* Check for a numeric ID in field n+1 or n+3. */
 1615|  19.8k|			if (isint(field[n + 1].start, field[n + 1].end,
  ------------------
  |  Branch (1615:8): [True: 189, False: 19.6k]
  ------------------
 1616|  19.8k|			    &id) < 0) {
 1617|    189|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    189|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1618|    189|				continue;
 1619|    189|			}
 1620|       |			/* Field n+3 is optional. */
 1621|  19.6k|			if (id == -1 && fields > (n + 3) &&
  ------------------
  |  Branch (1621:8): [True: 19.3k, False: 282]
  |  Branch (1621:20): [True: 1.83k, False: 17.5k]
  ------------------
 1622|  1.83k|			    isint(field[n + 3].start, field[n + 3].end,
  ------------------
  |  Branch (1622:8): [True: 100, False: 1.73k]
  ------------------
 1623|  1.83k|			    &id) < 0) {
 1624|    100|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    100|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1625|    100|				continue;
 1626|    100|			}
 1627|       |
 1628|  19.5k|			tag = 0;
 1629|  19.5k|			s = field[n].start;
 1630|  19.5k|			len = field[n].end - field[n].start;
 1631|       |
 1632|  19.5k|			if (len == 0) {
  ------------------
  |  Branch (1632:8): [True: 3.19k, False: 16.3k]
  ------------------
 1633|  3.19k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  3.19k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1634|  3.19k|				continue;
 1635|  3.19k|			}
 1636|       |
 1637|  16.3k|			st = s + 1; 
 1638|       |
 1639|  16.3k|			switch (*s) {
 1640|  1.44k|			case 'u':
  ------------------
  |  Branch (1640:4): [True: 1.44k, False: 14.9k]
  ------------------
 1641|  1.44k|				if (len == 1 || (len == 4
  ------------------
  |  Branch (1641:9): [True: 848, False: 597]
  |  Branch (1641:22): [True: 266, False: 331]
  ------------------
 1642|    266|				    && memcmp(st, "ser", 3) == 0))
  ------------------
  |  Branch (1642:12): [True: 180, False: 86]
  ------------------
 1643|  1.02k|					tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
  ------------------
  |  |  549|  1.02k|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
 1644|  1.44k|				break;
 1645|  2.33k|			case 'g':
  ------------------
  |  Branch (1645:4): [True: 2.33k, False: 14.0k]
  ------------------
 1646|  2.33k|				if (len == 1 || (len == 5
  ------------------
  |  Branch (1646:9): [True: 1.47k, False: 856]
  |  Branch (1646:22): [True: 363, False: 493]
  ------------------
 1647|    363|				    && memcmp(st, "roup", 4) == 0))
  ------------------
  |  Branch (1647:12): [True: 176, False: 187]
  ------------------
 1648|  1.65k|					tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
  ------------------
  |  |  551|  1.65k|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
 1649|  2.33k|				break;
 1650|  1.52k|			case 'o':
  ------------------
  |  Branch (1650:4): [True: 1.52k, False: 14.8k]
  ------------------
 1651|  1.52k|				if (len == 1 || (len == 5
  ------------------
  |  Branch (1651:9): [True: 785, False: 738]
  |  Branch (1651:22): [True: 338, False: 400]
  ------------------
 1652|    338|				    && memcmp(st, "ther", 4) == 0))
  ------------------
  |  Branch (1652:12): [True: 296, False: 42]
  ------------------
 1653|  1.08k|					tag = ARCHIVE_ENTRY_ACL_OTHER;
  ------------------
  |  |  553|  1.08k|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
 1654|  1.52k|				break;
 1655|    816|			case 'm':
  ------------------
  |  Branch (1655:4): [True: 816, False: 15.5k]
  ------------------
 1656|    816|				if (len == 1 || (len == 4
  ------------------
  |  Branch (1656:9): [True: 321, False: 495]
  |  Branch (1656:22): [True: 234, False: 261]
  ------------------
 1657|    234|				    && memcmp(st, "ask", 3) == 0))
  ------------------
  |  Branch (1657:12): [True: 49, False: 185]
  ------------------
 1658|    370|					tag = ARCHIVE_ENTRY_ACL_MASK;
  ------------------
  |  |  552|    370|#define	ARCHIVE_ENTRY_ACL_MASK		10005	/* Modify group access (POSIX.1e only) */
  ------------------
 1659|    816|				break;
 1660|  10.2k|			default:
  ------------------
  |  Branch (1660:4): [True: 10.2k, False: 6.11k]
  ------------------
 1661|  10.2k|					break;
 1662|  16.3k|			}
 1663|       |
 1664|  16.3k|			switch (tag) {
 1665|  1.08k|			case ARCHIVE_ENTRY_ACL_OTHER:
  ------------------
  |  |  553|  1.08k|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
  |  Branch (1665:4): [True: 1.08k, False: 15.2k]
  ------------------
 1666|  1.45k|			case ARCHIVE_ENTRY_ACL_MASK:
  ------------------
  |  |  552|  1.45k|#define	ARCHIVE_ENTRY_ACL_MASK		10005	/* Modify group access (POSIX.1e only) */
  ------------------
  |  Branch (1666:4): [True: 370, False: 15.9k]
  ------------------
 1667|  1.45k|				if (fields == (n + 2)
  ------------------
  |  Branch (1667:9): [True: 674, False: 777]
  ------------------
 1668|    674|				    && field[n + 1].start < field[n + 1].end
  ------------------
  |  Branch (1668:12): [True: 665, False: 9]
  ------------------
 1669|    665|				    && ismode(field[n + 1].start,
  ------------------
  |  Branch (1669:12): [True: 264, False: 401]
  ------------------
 1670|    665|				    field[n + 1].end, &permset)) {
 1671|       |					/* This is Solaris-style "other:rwx" */
 1672|    264|					sol = 1;
 1673|  1.18k|				} else if (fields == (n + 3) &&
  ------------------
  |  Branch (1673:16): [True: 276, False: 911]
  ------------------
 1674|    276|				    field[n + 1].start < field[n + 1].end) {
  ------------------
  |  Branch (1674:9): [True: 71, False: 205]
  ------------------
 1675|       |					/* Invalid mask or other field */
 1676|     71|					ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     71|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1677|     71|					continue;
 1678|     71|				}
 1679|  1.38k|				break;
 1680|  1.38k|			case ARCHIVE_ENTRY_ACL_USER_OBJ:
  ------------------
  |  |  549|  1.02k|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (1680:4): [True: 1.02k, False: 15.3k]
  ------------------
 1681|  2.68k|			case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
  ------------------
  |  |  551|  2.68k|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
  |  Branch (1681:4): [True: 1.65k, False: 14.7k]
  ------------------
 1682|  2.68k|				if (id != -1 ||
  ------------------
  |  Branch (1682:9): [True: 614, False: 2.06k]
  ------------------
 1683|  2.20k|				    field[n + 1].start < field[n + 1].end) {
  ------------------
  |  Branch (1683:9): [True: 1.59k, False: 474]
  ------------------
 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: 967, False: 1.24k]
  ------------------
 1686|    967|						tag = ARCHIVE_ENTRY_ACL_USER;
  ------------------
  |  |  548|    967|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
 1687|  1.24k|					else
 1688|  1.24k|						tag = ARCHIVE_ENTRY_ACL_GROUP;
  ------------------
  |  |  550|  1.24k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
 1689|  2.20k|				}
 1690|  2.68k|				break;
 1691|  12.2k|			default:
  ------------------
  |  Branch (1691:4): [True: 12.2k, False: 4.13k]
  ------------------
 1692|       |				/* Invalid tag, skip entry */
 1693|  12.2k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  12.2k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1694|  12.2k|				continue;
 1695|  16.3k|			}
 1696|       |
 1697|       |			/*
 1698|       |			 * Without "default:" we expect mode in field 3
 1699|       |			 * Exception: Solaris other and mask fields
 1700|       |			 */
 1701|  4.06k|			if (permset == 0 && !ismode(field[n + 2 - sol].start,
  ------------------
  |  Branch (1701:8): [True: 3.74k, False: 320]
  |  Branch (1701:24): [True: 2.14k, False: 1.59k]
  ------------------
 1702|  3.74k|			    field[n + 2 - sol].end, &permset)) {
 1703|       |				/* Invalid mode, skip entry */
 1704|  2.14k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  2.14k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1705|  2.14k|				continue;
 1706|  2.14k|			}
 1707|  7.17k|		} else {
 1708|       |			/* NFS4 ACLs */
 1709|  7.17k|			s = field[0].start;
 1710|  7.17k|			len = field[0].end - field[0].start;
 1711|  7.17k|			tag = 0;
 1712|       |
 1713|  7.17k|			switch (len) {
 1714|    641|			case 4:
  ------------------
  |  Branch (1714:4): [True: 641, False: 6.53k]
  ------------------
 1715|    641|				if (memcmp(s, "user", 4) == 0)
  ------------------
  |  Branch (1715:9): [True: 240, False: 401]
  ------------------
 1716|    240|					tag = ARCHIVE_ENTRY_ACL_USER;
  ------------------
  |  |  548|    240|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
 1717|    641|				break;
 1718|    932|			case 5:
  ------------------
  |  Branch (1718:4): [True: 932, False: 6.24k]
  ------------------
 1719|    932|				if (memcmp(s, "group", 5) == 0)
  ------------------
  |  Branch (1719:9): [True: 331, False: 601]
  ------------------
 1720|    331|					tag = ARCHIVE_ENTRY_ACL_GROUP;
  ------------------
  |  |  550|    331|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
 1721|    932|				break;
 1722|  1.47k|			case 6:
  ------------------
  |  Branch (1722:4): [True: 1.47k, False: 5.70k]
  ------------------
 1723|  1.47k|				if (memcmp(s, "owner@", 6) == 0)
  ------------------
  |  Branch (1723:9): [True: 569, False: 902]
  ------------------
 1724|    569|					tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
  ------------------
  |  |  549|    569|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
 1725|    902|				else if (memcmp(s, "group@", 6) == 0)
  ------------------
  |  Branch (1725:14): [True: 377, False: 525]
  ------------------
 1726|    377|					tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
  ------------------
  |  |  551|    377|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
 1727|  1.47k|				break;
 1728|    690|			case 9:
  ------------------
  |  Branch (1728:4): [True: 690, False: 6.48k]
  ------------------
 1729|    690|				if (memcmp(s, "everyone@", 9) == 0)
  ------------------
  |  Branch (1729:9): [True: 278, False: 412]
  ------------------
 1730|    278|					tag = ARCHIVE_ENTRY_ACL_EVERYONE;
  ------------------
  |  |  554|    278|#define	ARCHIVE_ENTRY_ACL_EVERYONE	10107   /* Everyone (NFS4 only) */
  ------------------
 1731|    690|				break;
 1732|  3.44k|			default:
  ------------------
  |  Branch (1732:4): [True: 3.44k, False: 3.73k]
  ------------------
 1733|  3.44k|				break;
 1734|  7.17k|			}
 1735|       |
 1736|  7.17k|			if (tag == 0) {
  ------------------
  |  Branch (1736:8): [True: 5.38k, False: 1.79k]
  ------------------
 1737|       |				/* Invalid tag, skip entry */
 1738|  5.38k|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  5.38k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1739|  5.38k|				continue;
 1740|  5.38k|			} else if (tag == ARCHIVE_ENTRY_ACL_USER ||
  ------------------
  |  |  548|  3.59k|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
  |  Branch (1740:15): [True: 240, False: 1.55k]
  ------------------
 1741|  1.55k|			    tag == ARCHIVE_ENTRY_ACL_GROUP) {
  ------------------
  |  |  550|  1.55k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
  |  Branch (1741:8): [True: 331, False: 1.22k]
  ------------------
 1742|    571|				n = 1;
 1743|    571|				name = field[1];
 1744|    571|				if (isint(name.start, name.end, &id) < 0) {
  ------------------
  |  Branch (1744:9): [True: 62, False: 509]
  ------------------
 1745|     62|					ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     62|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1746|     62|					continue;
 1747|     62|				}
 1748|    571|			} else
 1749|  1.22k|				n = 0;
 1750|       |
 1751|  1.73k|			if (!is_nfs4_perms(field[1 + n].start,
  ------------------
  |  Branch (1751:8): [True: 181, False: 1.55k]
  ------------------
 1752|  1.73k|			    field[1 + n].end, &permset)) {
 1753|       |				/* Invalid NFSv4 perms, skip entry */
 1754|    181|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    181|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1755|    181|				continue;
 1756|    181|			}
 1757|  1.55k|			if (!is_nfs4_flags(field[2 + n].start,
  ------------------
  |  Branch (1757:8): [True: 370, False: 1.18k]
  ------------------
 1758|  1.55k|			    field[2 + n].end, &permset)) {
 1759|       |				/* Invalid NFSv4 flags, skip entry */
 1760|    370|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    370|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1761|    370|				continue;
 1762|    370|			}
 1763|  1.18k|			s = field[3 + n].start;
 1764|  1.18k|			len = field[3 + n].end - field[3 + n].start;
 1765|  1.18k|			type = 0;
 1766|  1.18k|			if (len == 4) {
  ------------------
  |  Branch (1766:8): [True: 430, False: 752]
  ------------------
 1767|    430|				if (memcmp(s, "deny", 4) == 0)
  ------------------
  |  Branch (1767:9): [True: 143, False: 287]
  ------------------
 1768|    143|					type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
  ------------------
  |  |  537|    143|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  ------------------
 1769|    752|			} else if (len == 5) {
  ------------------
  |  Branch (1769:15): [True: 375, False: 377]
  ------------------
 1770|    375|				if (memcmp(s, "allow", 5) == 0)
  ------------------
  |  Branch (1770:9): [True: 77, False: 298]
  ------------------
 1771|     77|					type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
  ------------------
  |  |  536|     77|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  ------------------
 1772|    298|				else if (memcmp(s, "audit", 5) == 0)
  ------------------
  |  Branch (1772:14): [True: 56, False: 242]
  ------------------
 1773|     56|					type = ARCHIVE_ENTRY_ACL_TYPE_AUDIT;
  ------------------
  |  |  538|     56|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  ------------------
 1774|    242|				else if (memcmp(s, "alarm", 5) == 0)
  ------------------
  |  Branch (1774:14): [True: 193, False: 49]
  ------------------
 1775|    193|					type = ARCHIVE_ENTRY_ACL_TYPE_ALARM;
  ------------------
  |  |  539|    193|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  ------------------
 1776|    375|			}
 1777|  1.18k|			if (type == 0) {
  ------------------
  |  Branch (1777:8): [True: 713, False: 469]
  ------------------
 1778|       |				/* Invalid entry type, skip entry */
 1779|    713|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    713|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1780|    713|				continue;
 1781|    713|			}
 1782|    469|			if (isint(field[4 + n].start, field[4 + n].end,
  ------------------
  |  Branch (1782:8): [True: 89, False: 380]
  ------------------
 1783|    469|			    &id) < 0) {
 1784|     89|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     89|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1785|     89|				continue;
 1786|     89|			}
 1787|    469|		}
 1788|       |
 1789|       |		/* Add entry to the internal list. */
 1790|  2.29k|		r = archive_acl_add_entry_len_l(acl, type, permset,
 1791|  2.29k|		    tag, id, name.start, name.end - name.start, sc);
 1792|  2.29k|		if (r < ARCHIVE_WARN)
  ------------------
  |  |  235|  2.29k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1792:7): [True: 0, False: 2.29k]
  ------------------
 1793|      0|			return (r);
 1794|  2.29k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.29k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1794:7): [True: 960, False: 1.33k]
  ------------------
 1795|    960|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    960|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1796|  2.29k|		types |= type;
 1797|  2.29k|	}
 1798|       |
 1799|       |	/* Reset ACL */
 1800|    621|	archive_acl_reset(acl, types);
 1801|       |
 1802|    621|	return (ret);
 1803|    621|}
archive_acl.c:acl_special:
  240|  2.29k|{
  241|  2.29k|	if (type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS
  ------------------
  |  |  534|  4.59k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (241:6): [True: 1.76k, False: 529]
  ------------------
  242|  1.76k|	    && ((permset & ~007) == 0)) {
  ------------------
  |  Branch (242:9): [True: 1.76k, False: 0]
  ------------------
  243|  1.76k|		switch (tag) {
  ------------------
  |  Branch (243:11): [True: 509, False: 1.25k]
  ------------------
  244|     41|		case ARCHIVE_ENTRY_ACL_USER_OBJ:
  ------------------
  |  |  549|     41|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (244:3): [True: 41, False: 1.72k]
  ------------------
  245|     41|			acl->mode &= ~0700;
  246|     41|			acl->mode |= (permset & 7) << 6;
  247|     41|			return (0);
  248|     44|		case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
  ------------------
  |  |  551|     44|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
  |  Branch (248:3): [True: 44, False: 1.72k]
  ------------------
  249|     44|			acl->mode &= ~0070;
  250|     44|			acl->mode |= (permset & 7) << 3;
  251|     44|			return (0);
  252|    424|		case ARCHIVE_ENTRY_ACL_OTHER:
  ------------------
  |  |  553|    424|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
  |  Branch (252:3): [True: 424, False: 1.34k]
  ------------------
  253|    424|			acl->mode &= ~0007;
  254|    424|			acl->mode |= permset & 7;
  255|    424|			return (0);
  256|  1.76k|		}
  257|  1.76k|	}
  258|  1.78k|	return (1);
  259|  2.29k|}
archive_acl.c:acl_new_entry:
  268|  1.78k|{
  269|  1.78k|	struct archive_acl_entry *ap, *aq;
  270|       |
  271|       |	/* Reject an invalid type */
  272|  1.78k|	switch (type) {
  273|  1.25k|	case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
  ------------------
  |  |  534|  1.25k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (273:2): [True: 1.25k, False: 529]
  ------------------
  274|  1.40k|	case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
  ------------------
  |  |  535|  1.40k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
  |  Branch (274:2): [True: 149, False: 1.63k]
  ------------------
  275|  1.47k|	case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
  ------------------
  |  |  536|  1.47k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  ------------------
  |  Branch (275:2): [True: 66, False: 1.72k]
  ------------------
  276|  1.61k|	case ARCHIVE_ENTRY_ACL_TYPE_DENY:
  ------------------
  |  |  537|  1.61k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  ------------------
  |  Branch (276:2): [True: 143, False: 1.64k]
  ------------------
  277|  1.66k|	case ARCHIVE_ENTRY_ACL_TYPE_AUDIT:
  ------------------
  |  |  538|  1.66k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  ------------------
  |  Branch (277:2): [True: 47, False: 1.74k]
  ------------------
  278|  1.78k|	case ARCHIVE_ENTRY_ACL_TYPE_ALARM:
  ------------------
  |  |  539|  1.78k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  ------------------
  |  Branch (278:2): [True: 124, False: 1.66k]
  ------------------
  279|  1.78k|		break;
  280|      0|	default:
  ------------------
  |  Branch (280:2): [True: 0, False: 1.78k]
  ------------------
  281|      0|		return (NULL);
  282|  1.78k|	}
  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.78k|	if (type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|  1.78k|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|  1.78k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|  1.78k|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|  1.78k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|  1.78k|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|  1.78k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|  1.78k|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|  1.78k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (287:6): [True: 380, False: 1.40k]
  ------------------
  288|    380|		if (acl->acl_types & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|    380|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|    380|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|    380|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|    380|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|    380|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|    380|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|    380|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|    380|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (288:7): [True: 0, False: 380]
  ------------------
  289|      0|			return (NULL);
  290|      0|		}
  291|    380|		if (permset &
  ------------------
  |  Branch (291:7): [True: 0, False: 380]
  ------------------
  292|    380|		    ~(ARCHIVE_ENTRY_ACL_PERMS_NFS4
  ------------------
  |  |  495|    380|	(ARCHIVE_ENTRY_ACL_EXECUTE			\
  |  |  ------------------
  |  |  |  |  469|    380|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  |  |  ------------------
  |  |  496|    380|	    | ARCHIVE_ENTRY_ACL_READ_DATA		\
  |  |  ------------------
  |  |  |  |  472|    380|#define	ARCHIVE_ENTRY_ACL_READ_DATA           0x00000008
  |  |  ------------------
  |  |  497|    380|	    | ARCHIVE_ENTRY_ACL_LIST_DIRECTORY 		\
  |  |  ------------------
  |  |  |  |  473|    380|#define	ARCHIVE_ENTRY_ACL_LIST_DIRECTORY      0x00000008
  |  |  ------------------
  |  |  498|    380|	    | ARCHIVE_ENTRY_ACL_WRITE_DATA		\
  |  |  ------------------
  |  |  |  |  474|    380|#define	ARCHIVE_ENTRY_ACL_WRITE_DATA          0x00000010
  |  |  ------------------
  |  |  499|    380|	    | ARCHIVE_ENTRY_ACL_ADD_FILE		\
  |  |  ------------------
  |  |  |  |  475|    380|#define	ARCHIVE_ENTRY_ACL_ADD_FILE            0x00000010
  |  |  ------------------
  |  |  500|    380|	    | ARCHIVE_ENTRY_ACL_APPEND_DATA		\
  |  |  ------------------
  |  |  |  |  476|    380|#define	ARCHIVE_ENTRY_ACL_APPEND_DATA         0x00000020
  |  |  ------------------
  |  |  501|    380|	    | ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY	\
  |  |  ------------------
  |  |  |  |  477|    380|#define	ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY    0x00000020
  |  |  ------------------
  |  |  502|    380|	    | ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS	\
  |  |  ------------------
  |  |  |  |  478|    380|#define	ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS    0x00000040
  |  |  ------------------
  |  |  503|    380|	    | ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS	\
  |  |  ------------------
  |  |  |  |  479|    380|#define	ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS   0x00000080
  |  |  ------------------
  |  |  504|    380|	    | ARCHIVE_ENTRY_ACL_DELETE_CHILD		\
  |  |  ------------------
  |  |  |  |  480|    380|#define	ARCHIVE_ENTRY_ACL_DELETE_CHILD        0x00000100
  |  |  ------------------
  |  |  505|    380|	    | ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES		\
  |  |  ------------------
  |  |  |  |  481|    380|#define	ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES     0x00000200
  |  |  ------------------
  |  |  506|    380|	    | ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES	\
  |  |  ------------------
  |  |  |  |  482|    380|#define	ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES    0x00000400
  |  |  ------------------
  |  |  507|    380|	    | ARCHIVE_ENTRY_ACL_DELETE			\
  |  |  ------------------
  |  |  |  |  483|    380|#define	ARCHIVE_ENTRY_ACL_DELETE              0x00000800
  |  |  ------------------
  |  |  508|    380|	    | ARCHIVE_ENTRY_ACL_READ_ACL		\
  |  |  ------------------
  |  |  |  |  484|    380|#define	ARCHIVE_ENTRY_ACL_READ_ACL            0x00001000
  |  |  ------------------
  |  |  509|    380|	    | ARCHIVE_ENTRY_ACL_WRITE_ACL		\
  |  |  ------------------
  |  |  |  |  485|    380|#define	ARCHIVE_ENTRY_ACL_WRITE_ACL           0x00002000
  |  |  ------------------
  |  |  510|    380|	    | ARCHIVE_ENTRY_ACL_WRITE_OWNER		\
  |  |  ------------------
  |  |  |  |  486|    380|#define	ARCHIVE_ENTRY_ACL_WRITE_OWNER         0x00004000
  |  |  ------------------
  |  |  511|    380|	    | ARCHIVE_ENTRY_ACL_SYNCHRONIZE)
  |  |  ------------------
  |  |  |  |  487|    380|#define	ARCHIVE_ENTRY_ACL_SYNCHRONIZE         0x00008000
  |  |  ------------------
  ------------------
  293|    380|			| ARCHIVE_ENTRY_ACL_INHERITANCE_NFS4)) {
  ------------------
  |  |  525|    380|	(ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT			\
  |  |  ------------------
  |  |  |  |  517|    380|#define	ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT                0x02000000
  |  |  ------------------
  |  |  526|    380|	    | ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT		\
  |  |  ------------------
  |  |  |  |  518|    380|#define	ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT           0x04000000
  |  |  ------------------
  |  |  527|    380|	    | ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT	\
  |  |  ------------------
  |  |  |  |  519|    380|#define	ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT        0x08000000
  |  |  ------------------
  |  |  528|    380|	    | ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY		\
  |  |  ------------------
  |  |  |  |  520|    380|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY                0x10000000
  |  |  ------------------
  |  |  529|    380|	    | ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS		\
  |  |  ------------------
  |  |  |  |  521|    380|#define	ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS           0x20000000
  |  |  ------------------
  |  |  530|    380|	    | ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS		\
  |  |  ------------------
  |  |  |  |  522|    380|#define	ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS               0x40000000
  |  |  ------------------
  |  |  531|    380|	    | ARCHIVE_ENTRY_ACL_ENTRY_INHERITED)
  |  |  ------------------
  |  |  |  |  516|    380|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERITED                   0x01000000
  |  |  ------------------
  ------------------
  294|      0|			return (NULL);
  295|      0|		}
  296|  1.40k|	} else	if (type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) {
  ------------------
  |  |  540|  1.40k|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  534|  1.40k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  541|  1.40k|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  535|  1.40k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (296:13): [True: 1.40k, False: 0]
  ------------------
  297|  1.40k|		if (acl->acl_types & ~ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) {
  ------------------
  |  |  540|  1.40k|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  534|  1.40k|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  541|  1.40k|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  535|  1.40k|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (297:7): [True: 0, False: 1.40k]
  ------------------
  298|      0|			return (NULL);
  299|      0|		}
  300|  1.40k|		if (permset & ~ARCHIVE_ENTRY_ACL_PERMS_POSIX1E) {
  ------------------
  |  |  490|  1.40k|	(ARCHIVE_ENTRY_ACL_EXECUTE			\
  |  |  ------------------
  |  |  |  |  469|  1.40k|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  |  |  ------------------
  |  |  491|  1.40k|	    | ARCHIVE_ENTRY_ACL_WRITE			\
  |  |  ------------------
  |  |  |  |  470|  1.40k|#define	ARCHIVE_ENTRY_ACL_WRITE               0x00000002
  |  |  ------------------
  |  |  492|  1.40k|	    | ARCHIVE_ENTRY_ACL_READ)
  |  |  ------------------
  |  |  |  |  471|  1.40k|#define	ARCHIVE_ENTRY_ACL_READ                0x00000004
  |  |  ------------------
  ------------------
  |  Branch (300:7): [True: 0, False: 1.40k]
  ------------------
  301|      0|			return (NULL);
  302|      0|		}
  303|  1.40k|	} else {
  304|      0|		return (NULL);
  305|      0|	}
  306|       |
  307|       |	/* Verify the tag is valid and compatible with NFS4 or POSIX.1e. */
  308|  1.78k|	switch (tag) {
  309|    355|	case ARCHIVE_ENTRY_ACL_USER:
  ------------------
  |  |  548|    355|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
  |  Branch (309:2): [True: 355, False: 1.43k]
  ------------------
  310|    526|	case ARCHIVE_ENTRY_ACL_USER_OBJ:
  ------------------
  |  |  549|    526|#define	ARCHIVE_ENTRY_ACL_USER_OBJ 	10002	/* User who owns the file. */
  ------------------
  |  Branch (310:2): [True: 171, False: 1.61k]
  ------------------
  311|  1.46k|	case ARCHIVE_ENTRY_ACL_GROUP:
  ------------------
  |  |  550|  1.46k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
  |  Branch (311:2): [True: 940, False: 847]
  ------------------
  312|  1.53k|	case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
  ------------------
  |  |  551|  1.53k|#define	ARCHIVE_ENTRY_ACL_GROUP_OBJ	10004	/* Group who owns the file. */
  ------------------
  |  Branch (312:2): [True: 64, False: 1.72k]
  ------------------
  313|       |		/* Tags valid in both NFS4 and POSIX.1e */
  314|  1.53k|		break;
  315|    149|	case ARCHIVE_ENTRY_ACL_MASK:
  ------------------
  |  |  552|    149|#define	ARCHIVE_ENTRY_ACL_MASK		10005	/* Modify group access (POSIX.1e only) */
  ------------------
  |  Branch (315:2): [True: 149, False: 1.63k]
  ------------------
  316|    208|	case ARCHIVE_ENTRY_ACL_OTHER:
  ------------------
  |  |  553|    208|#define	ARCHIVE_ENTRY_ACL_OTHER		10006	/* Public (POSIX.1e only) */
  ------------------
  |  Branch (316:2): [True: 59, False: 1.72k]
  ------------------
  317|       |		/* Tags valid only in POSIX.1e. */
  318|    208|		if (type & ~ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) {
  ------------------
  |  |  540|    208|#define	ARCHIVE_ENTRY_ACL_TYPE_POSIX1E	(ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
  |  |  ------------------
  |  |  |  |  534|    208|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  |  |  ------------------
  |  |  541|    208|	    | ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
  |  |  ------------------
  |  |  |  |  535|    208|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  |  |  ------------------
  ------------------
  |  Branch (318:7): [True: 0, False: 208]
  ------------------
  319|      0|			return (NULL);
  320|      0|		}
  321|    208|		break;
  322|    208|	case ARCHIVE_ENTRY_ACL_EVERYONE:
  ------------------
  |  |  554|     49|#define	ARCHIVE_ENTRY_ACL_EVERYONE	10107   /* Everyone (NFS4 only) */
  ------------------
  |  Branch (322:2): [True: 49, False: 1.73k]
  ------------------
  323|       |		/* Tags valid only in NFS4. */
  324|     49|		if (type & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
  ------------------
  |  |  542|     49|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|     49|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|     49|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|     49|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|     49|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|     49|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|     49|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|     49|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (324:7): [True: 0, False: 49]
  ------------------
  325|      0|			return (NULL);
  326|      0|		}
  327|     49|		break;
  328|     49|	default:
  ------------------
  |  Branch (328:2): [True: 0, False: 1.78k]
  ------------------
  329|       |		/* No other values are valid. */
  330|      0|		return (NULL);
  331|  1.78k|	}
  332|       |
  333|  1.78k|	free(acl->acl_text_w);
  334|  1.78k|	acl->acl_text_w = NULL;
  335|  1.78k|	free(acl->acl_text);
  336|  1.78k|	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.78k|	ap = acl->acl_head;
  345|  1.78k|	aq = NULL;
  346|  13.1k|	while (ap != NULL) {
  ------------------
  |  Branch (346:9): [True: 12.0k, False: 1.14k]
  ------------------
  347|  12.0k|		if (((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0) &&
  ------------------
  |  |  542|  12.0k|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|  12.0k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|  12.0k|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|  12.0k|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|  12.0k|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|  12.0k|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|  12.0k|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|  12.0k|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (347:7): [True: 9.86k, False: 2.18k]
  ------------------
  348|  9.86k|		    ap->type == type && ap->tag == tag && ap->id == id) {
  ------------------
  |  Branch (348:7): [True: 8.76k, False: 1.10k]
  |  Branch (348:27): [True: 7.51k, False: 1.25k]
  |  Branch (348:45): [True: 6.70k, False: 814]
  ------------------
  349|  6.70k|			if (id != -1 || (tag != ARCHIVE_ENTRY_ACL_USER &&
  ------------------
  |  |  548|  12.4k|#define	ARCHIVE_ENTRY_ACL_USER		10001	/* Specified user. */
  ------------------
  |  Branch (349:8): [True: 483, False: 6.21k]
  |  Branch (349:21): [True: 4.18k, False: 2.02k]
  ------------------
  350|  4.18k|			    tag != ARCHIVE_ENTRY_ACL_GROUP)) {
  ------------------
  |  |  550|  4.18k|#define	ARCHIVE_ENTRY_ACL_GROUP		10003	/* Specified group. */
  ------------------
  |  Branch (350:8): [True: 164, False: 4.02k]
  ------------------
  351|    647|				ap->permset = permset;
  352|    647|				return (ap);
  353|    647|			}
  354|  6.70k|		}
  355|  11.3k|		aq = ap;
  356|  11.3k|		ap = ap->next;
  357|  11.3k|	}
  358|       |
  359|       |	/* Add a new entry to the end of the list. */
  360|  1.14k|	ap = calloc(1, sizeof(*ap));
  361|  1.14k|	if (ap == NULL)
  ------------------
  |  Branch (361:6): [True: 0, False: 1.14k]
  ------------------
  362|      0|		return (NULL);
  363|  1.14k|	if (aq == NULL)
  ------------------
  |  Branch (363:6): [True: 188, False: 952]
  ------------------
  364|    188|		acl->acl_head = ap;
  365|    952|	else
  366|    952|		aq->next = ap;
  367|  1.14k|	ap->type = type;
  368|  1.14k|	ap->tag = tag;
  369|  1.14k|	ap->id = id;
  370|  1.14k|	ap->permset = permset;
  371|  1.14k|	acl->acl_types |= type;
  372|  1.14k|	return (ap);
  373|  1.14k|}
archive_acl.c:archive_acl_add_entry_len_l:
  209|  2.29k|{
  210|  2.29k|	struct archive_acl_entry *ap;
  211|  2.29k|	int r;
  212|       |
  213|  2.29k|	if (acl_special(acl, type, permset, tag) == 0)
  ------------------
  |  Branch (213:6): [True: 509, False: 1.78k]
  ------------------
  214|    509|		return ARCHIVE_OK;
  ------------------
  |  |  233|    509|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  215|  1.78k|	ap = acl_new_entry(acl, type, permset, tag, id);
  216|  1.78k|	if (ap == NULL) {
  ------------------
  |  Branch (216:6): [True: 0, False: 1.78k]
  ------------------
  217|       |		/* XXX Error XXX */
  218|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  219|      0|	}
  220|  1.78k|	if (name != NULL  &&  *name != '\0' && len > 0) {
  ------------------
  |  Branch (220:6): [True: 1.29k, False: 492]
  |  Branch (220:24): [True: 1.29k, False: 0]
  |  Branch (220:41): [True: 1.15k, False: 142]
  ------------------
  221|  1.15k|		r = archive_mstring_copy_mbs_len_l(&ap->name, name, len, sc);
  222|  1.15k|	} else {
  223|    634|		r = 0;
  224|    634|		archive_mstring_clean(&ap->name);
  225|    634|	}
  226|  1.78k|	if (r == 0)
  ------------------
  |  Branch (226:6): [True: 827, False: 960]
  ------------------
  227|    827|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    827|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  228|    960|	else if (errno == ENOMEM)
  ------------------
  |  Branch (228:11): [True: 0, False: 960]
  ------------------
  229|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  230|    960|	else
  231|    960|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|    960|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  232|  1.78k|}
archive_acl.c:isint:
 1812|  22.7k|{
 1813|  22.7k|	int n = 0;
 1814|  22.7k|	if (start >= end)
  ------------------
  |  Branch (1814:6): [True: 15.0k, False: 7.70k]
  ------------------
 1815|  15.0k|		return (0);
 1816|  16.8k|	while (start < end) {
  ------------------
  |  Branch (1816:9): [True: 15.7k, False: 1.04k]
  ------------------
 1817|  15.7k|		if (*start < '0' || *start > '9')
  ------------------
  |  Branch (1817:7): [True: 4.07k, False: 11.6k]
  |  Branch (1817:23): [True: 2.14k, False: 9.55k]
  ------------------
 1818|  6.21k|			return (0);
 1819|  9.55k|		if (n > (INT_MAX / 10) ||
  ------------------
  |  Branch (1819:7): [True: 234, False: 9.32k]
  ------------------
 1820|  9.32k|		    (n == INT_MAX / 10 && (*start - '0') >= INT_MAX % 10)) {
  ------------------
  |  Branch (1820:8): [True: 218, False: 9.10k]
  |  Branch (1820:29): [True: 206, False: 12]
  ------------------
 1821|    440|			return (-1);
 1822|  9.11k|		} else {
 1823|  9.11k|			n *= 10;
 1824|  9.11k|			n += *start - '0';
 1825|  9.11k|		}
 1826|  9.11k|		start++;
 1827|  9.11k|	}
 1828|  1.04k|	*result = n;
 1829|  1.04k|	return (1);
 1830|  7.70k|}
archive_acl.c:ismode:
 1839|  4.40k|{
 1840|  4.40k|	const char *p;
 1841|       |
 1842|  4.40k|	if (start >= end)
  ------------------
  |  Branch (1842:6): [True: 1.53k, False: 2.87k]
  ------------------
 1843|  1.53k|		return (0);
 1844|  2.87k|	p = start;
 1845|  2.87k|	*permset = 0;
 1846|  12.0k|	while (p < end) {
  ------------------
  |  Branch (1846:9): [True: 10.1k, False: 1.86k]
  ------------------
 1847|  10.1k|		switch (*p++) {
 1848|  2.45k|		case 'r': case 'R':
  ------------------
  |  Branch (1848:3): [True: 1.08k, False: 9.10k]
  |  Branch (1848:13): [True: 1.37k, False: 8.81k]
  ------------------
 1849|  2.45k|			*permset |= ARCHIVE_ENTRY_ACL_READ;
  ------------------
  |  |  471|  2.45k|#define	ARCHIVE_ENTRY_ACL_READ                0x00000004
  ------------------
 1850|  2.45k|			break;
 1851|  1.24k|		case 'w': case 'W':
  ------------------
  |  Branch (1851:3): [True: 629, False: 9.56k]
  |  Branch (1851:13): [True: 612, False: 9.57k]
  ------------------
 1852|  1.24k|			*permset |= ARCHIVE_ENTRY_ACL_WRITE;
  ------------------
  |  |  470|  1.24k|#define	ARCHIVE_ENTRY_ACL_WRITE               0x00000002
  ------------------
 1853|  1.24k|			break;
 1854|  1.67k|		case 'x': case 'X':
  ------------------
  |  Branch (1854:3): [True: 663, False: 9.52k]
  |  Branch (1854:13): [True: 1.00k, False: 9.18k]
  ------------------
 1855|  1.67k|			*permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
  ------------------
  |  |  469|  1.67k|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  ------------------
 1856|  1.67k|			break;
 1857|  3.81k|		case '-':
  ------------------
  |  Branch (1857:3): [True: 3.81k, False: 6.37k]
  ------------------
 1858|  3.81k|			break;
 1859|  1.01k|		default:
  ------------------
  |  Branch (1859:3): [True: 1.01k, False: 9.17k]
  ------------------
 1860|  1.01k|			return (0);
 1861|  10.1k|		}
 1862|  10.1k|	}
 1863|  1.86k|	return (1);
 1864|  2.87k|}
archive_acl.c:is_nfs4_perms:
 1873|  1.73k|{
 1874|  1.73k|	const char *p = start;
 1875|       |
 1876|  9.15k|	while (p < end) {
  ------------------
  |  Branch (1876:9): [True: 7.60k, False: 1.55k]
  ------------------
 1877|  7.60k|		switch (*p++) {
 1878|    479|		case 'r':
  ------------------
  |  Branch (1878:3): [True: 479, False: 7.12k]
  ------------------
 1879|    479|			*permset |= ARCHIVE_ENTRY_ACL_READ_DATA;
  ------------------
  |  |  472|    479|#define	ARCHIVE_ENTRY_ACL_READ_DATA           0x00000008
  ------------------
 1880|    479|			break;
 1881|    368|		case 'w':
  ------------------
  |  Branch (1881:3): [True: 368, False: 7.23k]
  ------------------
 1882|    368|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_DATA;
  ------------------
  |  |  474|    368|#define	ARCHIVE_ENTRY_ACL_WRITE_DATA          0x00000010
  ------------------
 1883|    368|			break;
 1884|    497|		case 'x':
  ------------------
  |  Branch (1884:3): [True: 497, False: 7.11k]
  ------------------
 1885|    497|			*permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
  ------------------
  |  |  469|    497|#define	ARCHIVE_ENTRY_ACL_EXECUTE             0x00000001
  ------------------
 1886|    497|			break;
 1887|    253|		case 'p':
  ------------------
  |  Branch (1887:3): [True: 253, False: 7.35k]
  ------------------
 1888|    253|			*permset |= ARCHIVE_ENTRY_ACL_APPEND_DATA;
  ------------------
  |  |  476|    253|#define	ARCHIVE_ENTRY_ACL_APPEND_DATA         0x00000020
  ------------------
 1889|    253|			break;
 1890|    856|		case 'D':
  ------------------
  |  Branch (1890:3): [True: 856, False: 6.75k]
  ------------------
 1891|    856|			*permset |= ARCHIVE_ENTRY_ACL_DELETE_CHILD;
  ------------------
  |  |  480|    856|#define	ARCHIVE_ENTRY_ACL_DELETE_CHILD        0x00000100
  ------------------
 1892|    856|			break;
 1893|    386|		case 'd':
  ------------------
  |  Branch (1893:3): [True: 386, False: 7.22k]
  ------------------
 1894|    386|			*permset |= ARCHIVE_ENTRY_ACL_DELETE;
  ------------------
  |  |  483|    386|#define	ARCHIVE_ENTRY_ACL_DELETE              0x00000800
  ------------------
 1895|    386|			break;
 1896|    411|		case 'a':
  ------------------
  |  Branch (1896:3): [True: 411, False: 7.19k]
  ------------------
 1897|    411|			*permset |= ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES;
  ------------------
  |  |  481|    411|#define	ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES     0x00000200
  ------------------
 1898|    411|			break;
 1899|    599|		case 'A':
  ------------------
  |  Branch (1899:3): [True: 599, False: 7.00k]
  ------------------
 1900|    599|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES;
  ------------------
  |  |  482|    599|#define	ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES    0x00000400
  ------------------
 1901|    599|			break;
 1902|    248|		case 'R':
  ------------------
  |  Branch (1902:3): [True: 248, False: 7.35k]
  ------------------
 1903|    248|			*permset |= ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS;
  ------------------
  |  |  478|    248|#define	ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS    0x00000040
  ------------------
 1904|    248|			break;
 1905|    334|		case 'W':
  ------------------
  |  Branch (1905:3): [True: 334, False: 7.27k]
  ------------------
 1906|    334|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS;
  ------------------
  |  |  479|    334|#define	ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS   0x00000080
  ------------------
 1907|    334|			break;
 1908|  1.06k|		case 'c':
  ------------------
  |  Branch (1908:3): [True: 1.06k, False: 6.54k]
  ------------------
 1909|  1.06k|			*permset |= ARCHIVE_ENTRY_ACL_READ_ACL;
  ------------------
  |  |  484|  1.06k|#define	ARCHIVE_ENTRY_ACL_READ_ACL            0x00001000
  ------------------
 1910|  1.06k|			break;
 1911|    594|		case 'C':
  ------------------
  |  Branch (1911:3): [True: 594, False: 7.01k]
  ------------------
 1912|    594|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_ACL;
  ------------------
  |  |  485|    594|#define	ARCHIVE_ENTRY_ACL_WRITE_ACL           0x00002000
  ------------------
 1913|    594|			break;
 1914|    302|		case 'o':
  ------------------
  |  Branch (1914:3): [True: 302, False: 7.30k]
  ------------------
 1915|    302|			*permset |= ARCHIVE_ENTRY_ACL_WRITE_OWNER;
  ------------------
  |  |  486|    302|#define	ARCHIVE_ENTRY_ACL_WRITE_OWNER         0x00004000
  ------------------
 1916|    302|			break;
 1917|    733|		case 's':
  ------------------
  |  Branch (1917:3): [True: 733, False: 6.87k]
  ------------------
 1918|    733|			*permset |= ARCHIVE_ENTRY_ACL_SYNCHRONIZE;
  ------------------
  |  |  487|    733|#define	ARCHIVE_ENTRY_ACL_SYNCHRONIZE         0x00008000
  ------------------
 1919|    733|			break;
 1920|    302|		case '-':
  ------------------
  |  Branch (1920:3): [True: 302, False: 7.30k]
  ------------------
 1921|    302|			break;
 1922|    181|		default:
  ------------------
  |  Branch (1922:3): [True: 181, False: 7.42k]
  ------------------
 1923|    181|			return(0);
 1924|  7.60k|		}
 1925|  7.60k|	}
 1926|  1.55k|	return (1);
 1927|  1.73k|}
archive_acl.c:is_nfs4_flags:
 1936|  1.55k|{
 1937|  1.55k|	const char *p = start;
 1938|       |
 1939|  4.08k|	while (p < end) {
  ------------------
  |  Branch (1939:9): [True: 2.90k, False: 1.18k]
  ------------------
 1940|  2.90k|		switch(*p++) {
 1941|    169|		case 'f':
  ------------------
  |  Branch (1941:3): [True: 169, False: 2.73k]
  ------------------
 1942|    169|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT;
  ------------------
  |  |  517|    169|#define	ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT                0x02000000
  ------------------
 1943|    169|			break;
 1944|    670|		case 'd':
  ------------------
  |  Branch (1944:3): [True: 670, False: 2.23k]
  ------------------
 1945|    670|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT;
  ------------------
  |  |  518|    670|#define	ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT           0x04000000
  ------------------
 1946|    670|			break;
 1947|    317|		case 'i':
  ------------------
  |  Branch (1947:3): [True: 317, False: 2.58k]
  ------------------
 1948|    317|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY;
  ------------------
  |  |  520|    317|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY                0x10000000
  ------------------
 1949|    317|			break;
 1950|    300|		case 'n':
  ------------------
  |  Branch (1950:3): [True: 300, False: 2.60k]
  ------------------
 1951|    300|			*permset |=
 1952|    300|			    ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT;
  ------------------
  |  |  519|    300|#define	ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT        0x08000000
  ------------------
 1953|    300|			break;
 1954|    241|		case 'S':
  ------------------
  |  Branch (1954:3): [True: 241, False: 2.65k]
  ------------------
 1955|    241|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS;
  ------------------
  |  |  521|    241|#define	ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS           0x20000000
  ------------------
 1956|    241|			break;
 1957|    408|		case 'F':
  ------------------
  |  Branch (1957:3): [True: 408, False: 2.49k]
  ------------------
 1958|    408|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS;
  ------------------
  |  |  522|    408|#define	ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS               0x40000000
  ------------------
 1959|    408|			break;
 1960|    303|		case 'I':
  ------------------
  |  Branch (1960:3): [True: 303, False: 2.59k]
  ------------------
 1961|    303|			*permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERITED;
  ------------------
  |  |  516|    303|#define	ARCHIVE_ENTRY_ACL_ENTRY_INHERITED                   0x01000000
  ------------------
 1962|    303|			break;
 1963|    122|		case '-':
  ------------------
  |  Branch (1963:3): [True: 122, False: 2.77k]
  ------------------
 1964|    122|			break;
 1965|    370|		default:
  ------------------
  |  Branch (1965:3): [True: 370, False: 2.53k]
  ------------------
 1966|    370|			return (0);
 1967|  2.90k|		}
 1968|  2.90k|	}
 1969|  1.18k|	return (1);
 1970|  1.55k|}
archive_acl.c:next_field:
 1983|  52.6k|{
 1984|       |	/* Skip leading whitespace to find start of field. */
 1985|  96.0k|	while (*l > 0 && (**p == ' ' || **p == '\t' || **p == '\n')) {
  ------------------
  |  Branch (1985:9): [True: 96.0k, False: 61]
  |  Branch (1985:20): [True: 1.28k, False: 94.7k]
  |  Branch (1985:34): [True: 1.65k, False: 93.0k]
  |  Branch (1985:49): [True: 40.4k, False: 52.6k]
  ------------------
 1986|  43.4k|		(*p)++;
 1987|  43.4k|		(*l)--;
 1988|  43.4k|	}
 1989|  52.6k|	*start = *p;
 1990|       |
 1991|       |	/* Locate end of field, trim trailing whitespace if necessary */
 1992|   282k|	while (*l > 0 && **p != ' ' && **p != '\t' && **p != '\n' && **p != ',' && **p != ':' && **p != '#') {
  ------------------
  |  Branch (1992:9): [True: 282k, False: 517]
  |  Branch (1992:19): [True: 279k, False: 2.35k]
  |  Branch (1992:33): [True: 279k, False: 599]
  |  Branch (1992:48): [True: 256k, False: 22.7k]
  |  Branch (1992:63): [True: 254k, False: 1.57k]
  |  Branch (1992:77): [True: 230k, False: 24.2k]
  |  Branch (1992:91): [True: 229k, False: 642]
  ------------------
 1993|   229k|		(*p)++;
 1994|   229k|		(*l)--;
 1995|   229k|	}
 1996|  52.6k|	*end = *p;
 1997|       |
 1998|       |	/* Scan for the separator. */
 1999|  82.1k|	while (*l > 0 && **p != ',' && **p != ':' && **p != '\n' && **p != '#') {
  ------------------
  |  Branch (1999:9): [True: 81.5k, False: 561]
  |  Branch (1999:19): [True: 79.4k, False: 2.09k]
  |  Branch (1999:33): [True: 54.0k, False: 25.4k]
  |  Branch (1999:47): [True: 30.0k, False: 23.9k]
  |  Branch (1999:62): [True: 29.4k, False: 673]
  ------------------
 2000|  29.4k|		(*p)++;
 2001|  29.4k|		(*l)--;
 2002|  29.4k|	}
 2003|  52.6k|	if (*l > 0)
  ------------------
  |  Branch (2003:6): [True: 52.1k, False: 561]
  ------------------
 2004|  52.1k|		*sep = **p;
 2005|    561|	else
 2006|    561|		*sep = '\0';
 2007|       |
 2008|       |	/* Handle in-field comments */
 2009|  52.6k|	if (*sep == '#') {
  ------------------
  |  Branch (2009:6): [True: 673, False: 52.0k]
  ------------------
 2010|  10.9k|		while (*l > 0 && **p != ',' && **p != '\n') {
  ------------------
  |  Branch (2010:10): [True: 10.9k, False: 18]
  |  Branch (2010:20): [True: 10.8k, False: 96]
  |  Branch (2010:34): [True: 10.3k, False: 559]
  ------------------
 2011|  10.3k|			(*p)++;
 2012|  10.3k|			(*l)--;
 2013|  10.3k|		}
 2014|    673|		if (*l > 0)
  ------------------
  |  Branch (2014:7): [True: 655, False: 18]
  ------------------
 2015|    655|			*sep = **p;
 2016|     18|		else
 2017|     18|			*sep = '\0';
 2018|    673|	}
 2019|       |
 2020|       |	/* Skip separator. */
 2021|  52.6k|	if (*l > 0) {
  ------------------
  |  Branch (2021:6): [True: 52.1k, False: 579]
  ------------------
 2022|  52.1k|		(*p)++;
 2023|  52.1k|		(*l)--;
 2024|  52.1k|	}
 2025|  52.6k|}

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

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

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

__archive_check_magic:
  137|  2.50M|{
  138|  2.50M|	char states1[64];
  139|  2.50M|	char states2[64];
  140|  2.50M|	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|  2.50M|	handle_type = archive_handle_type_name(a->magic);
  148|       |
  149|  2.50M|	if (!handle_type) {
  ------------------
  |  Branch (149:6): [True: 0, False: 2.50M]
  ------------------
  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|  2.50M|	if (a->magic != magic) {
  ------------------
  |  Branch (156:6): [True: 0, False: 2.50M]
  ------------------
  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;
  ------------------
  |  |   96|      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|  2.50M|	if ((a->state & state) == 0) {
  ------------------
  |  Branch (166:6): [True: 16.3k, False: 2.48M]
  ------------------
  167|       |		/* If we're already FATAL, don't overwrite the error. */
  168|  16.3k|		if (a->state != ARCHIVE_STATE_FATAL) {
  ------------------
  |  |   96|  16.3k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  |  Branch (168:7): [True: 3.28k, False: 13.0k]
  ------------------
  169|  3.28k|			write_all_states(states1, a->state);
  170|  3.28k|			write_all_states(states2, state);
  171|  3.28k|			archive_set_error(a, -1,
  172|  3.28k|			    "INTERNAL ERROR: Function '%s' invoked with"
  173|  3.28k|			    " archive structure in state '%s',"
  174|  3.28k|			    " should be in state '%s'",
  175|  3.28k|			    function,
  176|  3.28k|			    states1,
  177|  3.28k|			    states2);
  178|  3.28k|		}
  179|  16.3k|		a->state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|  16.3k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  180|  16.3k|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|  16.3k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  181|  16.3k|	}
  182|  2.48M|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.48M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  183|  2.50M|}
archive_check_magic.c:archive_handle_type_name:
   98|  2.50M|{
   99|  2.50M|	switch (m) {
  100|      0|	case ARCHIVE_WRITE_MAGIC:	return ("archive_write");
  ------------------
  |  |   58|      0|#define	ARCHIVE_WRITE_MAGIC	(0xb0c5c0deU)
  ------------------
  |  Branch (100:2): [True: 0, False: 2.50M]
  ------------------
  101|  2.50M|	case ARCHIVE_READ_MAGIC:	return ("archive_read");
  ------------------
  |  |   59|  2.50M|#define	ARCHIVE_READ_MAGIC	(0xdeb0c5U)
  ------------------
  |  Branch (101:2): [True: 2.50M, 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: 2.50M]
  ------------------
  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: 2.50M]
  ------------------
  104|      0|	case ARCHIVE_MATCH_MAGIC:	return ("archive_match");
  ------------------
  |  |   62|      0|#define	ARCHIVE_MATCH_MAGIC	(0xcad11c9U)
  ------------------
  |  Branch (104:2): [True: 0, False: 2.50M]
  ------------------
  105|      0|	default:			return NULL;
  ------------------
  |  Branch (105:2): [True: 0, False: 2.50M]
  ------------------
  106|  2.50M|	}
  107|  2.50M|}
archive_check_magic.c:write_all_states:
  111|  6.57k|{
  112|  6.57k|	unsigned int lowbit;
  113|       |
  114|  6.57k|	*buff = '\0';
  115|       |
  116|       |	/* A trick for computing the lowest set bit. */
  117|  13.1k|	while ((lowbit = states & (1 + ~states)) != 0) {
  ------------------
  |  Branch (117:9): [True: 6.57k, False: 6.57k]
  ------------------
  118|  6.57k|		states &= ~lowbit;		/* Clear the low bit. */
  119|  6.57k|		strcat(buff, state_name(lowbit));
  120|  6.57k|		if (states != 0)
  ------------------
  |  Branch (120:7): [True: 0, False: 6.57k]
  ------------------
  121|      0|			strcat(buff, "/");
  122|  6.57k|	}
  123|  6.57k|}
archive_check_magic.c:state_name:
   83|  6.57k|{
   84|  6.57k|	switch (s) {
   85|      0|	case ARCHIVE_STATE_NEW:		return ("new");
  ------------------
  |  |   76|      0|#define	ARCHIVE_STATE_NEW	0x01U
  ------------------
  |  Branch (85:2): [True: 0, False: 6.57k]
  ------------------
   86|      0|	case ARCHIVE_STATE_HEADER:	return ("header");
  ------------------
  |  |   80|      0|#define	ARCHIVE_STATE_HEADER	0x04U
  ------------------
  |  Branch (86:2): [True: 0, False: 6.57k]
  ------------------
   87|  3.28k|	case ARCHIVE_STATE_DATA:	return ("data");
  ------------------
  |  |   84|  3.28k|#define	ARCHIVE_STATE_DATA	0x08U
  ------------------
  |  Branch (87:2): [True: 3.28k, False: 3.28k]
  ------------------
   88|     58|	case ARCHIVE_STATE_DATA_RECOVERY: return ("data_recovery");
  ------------------
  |  |   88|     58|#define	ARCHIVE_STATE_DATA_RECOVERY	0x10U
  ------------------
  |  Branch (88:2): [True: 58, False: 6.51k]
  ------------------
   89|  3.22k|	case ARCHIVE_STATE_EOF:		return ("eof");
  ------------------
  |  |   91|  3.22k|#define	ARCHIVE_STATE_EOF	0x20U
  ------------------
  |  Branch (89:2): [True: 3.22k, False: 3.34k]
  ------------------
   90|      0|	case ARCHIVE_STATE_CLOSED:	return ("closed");
  ------------------
  |  |   93|      0|#define	ARCHIVE_STATE_CLOSED	0x40U
  ------------------
  |  Branch (90:2): [True: 0, False: 6.57k]
  ------------------
   91|      0|	case ARCHIVE_STATE_FATAL:	return ("fatal");
  ------------------
  |  |   96|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  |  Branch (91:2): [True: 0, False: 6.57k]
  ------------------
   92|      0|	default:			return ("??");
  ------------------
  |  Branch (92:2): [True: 0, False: 6.57k]
  ------------------
   93|  6.57k|	}
   94|  6.57k|}

__archive_cmdline_parse:
  107|      3|{
  108|      3|	struct archive_string as;
  109|      3|	const char *p;
  110|      3|	ssize_t al;
  111|      3|	int r;
  112|       |
  113|      3|	archive_string_init(&as);
  ------------------
  |  |   71|      3|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 3]
  |  |  ------------------
  ------------------
  114|       |
  115|       |	/* Get first argument as a command path. */
  116|      3|	al = get_argument(&as, cmd);
  117|      3|	if (al < 0) {
  ------------------
  |  Branch (117:6): [True: 0, False: 3]
  ------------------
  118|      0|		r = ARCHIVE_FAILED;/* Invalid sequence. */
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  119|      0|		goto exit_function;
  120|      0|	}
  121|      3|	if (archive_strlen(&as) == 0) {
  ------------------
  |  |  178|      3|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (121:6): [True: 0, False: 3]
  ------------------
  122|      0|		r = ARCHIVE_FAILED;/* An empty command path. */
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  123|      0|		goto exit_function;
  124|      0|	}
  125|      3|	free(data->path);
  126|      3|	data->path = strdup(as.s);
  127|      3|	if (data->path == NULL) {
  ------------------
  |  Branch (127:6): [True: 0, False: 3]
  ------------------
  128|      0|		r = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  129|      0|		goto exit_function;
  130|      0|	}
  131|      3|	p = strrchr(as.s, '/');
  132|      3|	if (p == NULL)
  ------------------
  |  Branch (132:6): [True: 3, False: 0]
  ------------------
  133|      3|		p = as.s;
  134|      0|	else
  135|      0|		p++;
  136|      3|	r = cmdline_add_arg(data, p);
  137|      3|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (137:6): [True: 0, False: 3]
  ------------------
  138|      0|		goto exit_function;
  139|      3|	cmd += al;
  140|       |
  141|      8|	for (;;) {
  142|      8|		al = get_argument(&as, cmd);
  143|      8|		if (al < 0) {
  ------------------
  |  Branch (143:7): [True: 0, False: 8]
  ------------------
  144|      0|			r = ARCHIVE_FAILED;/* Invalid sequence. */
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  145|      0|			goto exit_function;
  146|      0|		}
  147|      8|		if (al == 0)
  ------------------
  |  Branch (147:7): [True: 3, False: 5]
  ------------------
  148|      3|			break;
  149|      5|		cmd += al;
  150|      5|		if (archive_strlen(&as) == 0 && *cmd == '\0')
  ------------------
  |  |  178|      5|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (150:7): [True: 0, False: 5]
  |  Branch (150:35): [True: 0, False: 0]
  ------------------
  151|      0|			break;
  152|      5|		r = cmdline_add_arg(data, as.s);
  153|      5|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      5|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (153:7): [True: 0, False: 5]
  ------------------
  154|      0|			goto exit_function;
  155|      5|	}
  156|      3|	r = ARCHIVE_OK;
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  157|      3|exit_function:
  158|      3|	archive_string_free(&as);
  159|      3|	return (r);
  160|      3|}
__archive_cmdline_allocate:
  187|      3|{
  188|      3|	return (struct archive_cmdline *)
  189|      3|		calloc(1, sizeof(struct archive_cmdline));
  190|      3|}
__archive_cmdline_free:
  197|      3|{
  198|       |
  199|      3|	if (data) {
  ------------------
  |  Branch (199:6): [True: 3, False: 0]
  ------------------
  200|      3|		free(data->path);
  201|      3|		if (data->argv != NULL) {
  ------------------
  |  Branch (201:7): [True: 3, False: 0]
  ------------------
  202|      3|			int i;
  203|     11|			for (i = 0; data->argv[i] != NULL; i++)
  ------------------
  |  Branch (203:16): [True: 8, False: 3]
  ------------------
  204|      8|				free(data->argv[i]);
  205|      3|			free(data->argv);
  206|      3|		}
  207|      3|		free(data);
  208|      3|	}
  209|      3|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  210|      3|}
archive_cmdline.c:get_argument:
   67|     11|{
   68|     11|	const char *s = p;
   69|       |
   70|     11|	archive_string_empty(as);
  ------------------
  |  |  181|     11|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
   71|       |
   72|       |	/* Skip beginning space characters. */
   73|     16|	while (*s == ' ')
  ------------------
  |  Branch (73:9): [True: 5, False: 11]
  ------------------
   74|      5|		s++;
   75|       |	/* Copy non-space characters. */
   76|     35|	while (*s != '\0' && *s != ' ') {
  ------------------
  |  Branch (76:9): [True: 29, False: 6]
  |  Branch (76:23): [True: 24, False: 5]
  ------------------
   77|     24|		if (*s == '\\') {
  ------------------
  |  Branch (77:7): [True: 0, False: 24]
  ------------------
   78|      0|			if (s[1] != '\0') {
  ------------------
  |  Branch (78:8): [True: 0, False: 0]
  ------------------
   79|      0|				archive_strappend_char(as, s[1]);
   80|      0|				s += 2;
   81|      0|			} else {
   82|      0|				s++;/* Ignore this character.*/
   83|      0|				break;
   84|      0|			}
   85|     24|		} else if (*s == '"') {
  ------------------
  |  Branch (85:14): [True: 0, False: 24]
  ------------------
   86|      0|			ssize_t q = extract_quotation(as, s);
   87|      0|			if (q < 0)
  ------------------
  |  Branch (87:8): [True: 0, False: 0]
  ------------------
   88|      0|				return (ARCHIVE_FAILED);/* Invalid sequence. */
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
   89|      0|			s += q;
   90|     24|		} else {
   91|     24|			archive_strappend_char(as, s[0]);
   92|     24|			s++;
   93|     24|		}
   94|     24|	}
   95|     11|	return ((ssize_t)(s - p));
   96|     11|}
archive_cmdline.c:cmdline_add_arg:
  167|      8|{
  168|      8|	char **newargv;
  169|       |
  170|      8|	if (data->path == NULL)
  ------------------
  |  Branch (170:6): [True: 0, False: 8]
  ------------------
  171|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  172|       |
  173|      8|	newargv = realloc(data->argv, (data->argc + 2) * sizeof(char *));
  174|      8|	if (newargv == NULL)
  ------------------
  |  Branch (174:6): [True: 0, False: 8]
  ------------------
  175|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  176|      8|	data->argv = newargv;
  177|      8|	data->argv[data->argc] = strdup(arg);
  178|      8|	if (data->argv[data->argc] == NULL)
  ------------------
  |  Branch (178:6): [True: 0, False: 8]
  ------------------
  179|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  180|       |	/* Set the terminator of argv. */
  181|      8|	data->argv[++data->argc] = NULL;
  182|      8|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      8|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  183|      8|}

__archive_crc32:
  100|  5.26M|{
  101|  5.26M|	if (_p == NULL)
  ------------------
  |  Branch (101:6): [True: 1.27k, False: 5.26M]
  ------------------
  102|  1.27k|		return (0);
  103|  5.26M|	return crc32(crc, _p, (uInt)len);
  104|  5.26M|}

archive_cryptor.c:pbkdf2_sha1:
  120|  5.43k|    size_t derived_key_len) {
  121|       |
  122|  5.43k|	PKCS5_PBKDF2_HMAC_SHA1(pw, pw_len, salt, salt_len, rounds,
  123|  5.43k|	    derived_key_len, derived_key);
  124|  5.43k|	return 0;
  125|  5.43k|}
archive_cryptor.c:aes_ctr_init:
  376|  4.79k|{
  377|  4.79k|	if ((ctx->ctx = EVP_CIPHER_CTX_new()) == NULL)
  ------------------
  |  Branch (377:6): [True: 0, False: 4.79k]
  ------------------
  378|      0|		return -1;
  379|       |
  380|  4.79k|	switch (key_len) {
  381|    217|	case 16: ctx->type = EVP_aes_128_ecb(); break;
  ------------------
  |  Branch (381:2): [True: 217, False: 4.58k]
  ------------------
  382|  4.58k|	case 24: ctx->type = EVP_aes_192_ecb(); break;
  ------------------
  |  Branch (382:2): [True: 4.58k, False: 217]
  ------------------
  383|      0|	case 32: ctx->type = EVP_aes_256_ecb(); break;
  ------------------
  |  Branch (383:2): [True: 0, False: 4.79k]
  ------------------
  384|      0|	default: ctx->type = NULL; return -1;
  ------------------
  |  Branch (384:2): [True: 0, False: 4.79k]
  ------------------
  385|  4.79k|	}
  386|       |
  387|  4.79k|	ctx->key_len = key_len;
  388|  4.79k|	memcpy(ctx->key, key, key_len);
  389|  4.79k|	memset(ctx->nonce, 0, sizeof(ctx->nonce));
  390|  4.79k|	ctx->encr_pos = AES_BLOCK_SIZE;
  ------------------
  |  |  126|  4.79k|#define AES_BLOCK_SIZE	16
  ------------------
  391|  4.79k|	return 0;
  392|  4.79k|}
archive_cryptor.c:aes_ctr_update:
  478|   107k|{
  479|   107k|	uint8_t *const ebuf = ctx->encr_buf;
  480|   107k|	size_t pos = ctx->encr_pos;
  481|   107k|	size_t max = (in_len < *out_len)? in_len: *out_len;
  ------------------
  |  Branch (481:15): [True: 0, False: 107k]
  ------------------
  482|   107k|	size_t i;
  483|       |
  484|   239k|	for (i = 0; i < max; ) {
  ------------------
  |  Branch (484:14): [True: 132k, False: 107k]
  ------------------
  485|   132k|		if (pos == AES_BLOCK_SIZE) {
  ------------------
  |  |  126|   132k|#define AES_BLOCK_SIZE	16
  ------------------
  |  Branch (485:7): [True: 10.9k, False: 121k]
  ------------------
  486|  10.9k|			aes_ctr_increase_counter(ctx);
  487|  10.9k|			if (aes_ctr_encrypt_counter(ctx) != 0)
  ------------------
  |  Branch (487:8): [True: 0, False: 10.9k]
  ------------------
  488|      0|				return -1;
  489|  14.6M|			while (max -i >= AES_BLOCK_SIZE) {
  ------------------
  |  |  126|  14.6M|#define AES_BLOCK_SIZE	16
  ------------------
  |  Branch (489:11): [True: 14.6M, False: 10.9k]
  ------------------
  490|   248M|				for (pos = 0; pos < AES_BLOCK_SIZE; pos++)
  ------------------
  |  |  126|   248M|#define AES_BLOCK_SIZE	16
  ------------------
  |  Branch (490:19): [True: 233M, False: 14.6M]
  ------------------
  491|   233M|					out[i+pos] = in[i+pos] ^ ebuf[pos];
  492|  14.6M|				i += AES_BLOCK_SIZE;
  ------------------
  |  |  126|  14.6M|#define AES_BLOCK_SIZE	16
  ------------------
  493|  14.6M|				aes_ctr_increase_counter(ctx);
  494|  14.6M|				if (aes_ctr_encrypt_counter(ctx) != 0)
  ------------------
  |  Branch (494:9): [True: 0, False: 14.6M]
  ------------------
  495|      0|					return -1;
  496|  14.6M|			}
  497|  10.9k|			pos = 0;
  498|  10.9k|			if (i >= max)
  ------------------
  |  Branch (498:8): [True: 705, False: 10.2k]
  ------------------
  499|    705|				break;
  500|  10.9k|		}
  501|   131k|		out[i] = in[i] ^ ebuf[pos++];
  502|   131k|		i++;
  503|   131k|	}
  504|   107k|	ctx->encr_pos = pos;
  505|   107k|	*out_len = i;
  506|       |
  507|   107k|	return 0;
  508|   107k|}
archive_cryptor.c:aes_ctr_increase_counter:
  465|  14.6M|{
  466|  14.6M|	uint8_t *const nonce = ctx->nonce;
  467|  14.6M|	int j;
  468|       |
  469|  14.6M|	for (j = 0; j < 8; j++) {
  ------------------
  |  Branch (469:14): [True: 14.6M, False: 0]
  ------------------
  470|  14.6M|		if (++nonce[j])
  ------------------
  |  Branch (470:7): [True: 14.6M, False: 55.8k]
  ------------------
  471|  14.6M|			break;
  472|  14.6M|	}
  473|  14.6M|}
archive_cryptor.c:aes_ctr_encrypt_counter:
  396|  14.6M|{
  397|  14.6M|	int outl = 0;
  398|  14.6M|	int r;
  399|       |
  400|  14.6M|	r = EVP_EncryptInit_ex(ctx->ctx, ctx->type, NULL, ctx->key, NULL);
  401|  14.6M|	if (r == 0)
  ------------------
  |  Branch (401:6): [True: 0, False: 14.6M]
  ------------------
  402|      0|		return -1;
  403|  14.6M|	r = EVP_EncryptUpdate(ctx->ctx, ctx->encr_buf, &outl, ctx->nonce,
  404|  14.6M|	    AES_BLOCK_SIZE);
  ------------------
  |  |  126|  14.6M|#define AES_BLOCK_SIZE	16
  ------------------
  405|  14.6M|	if (r == 0 || outl != AES_BLOCK_SIZE)
  ------------------
  |  |  126|  14.6M|#define AES_BLOCK_SIZE	16
  ------------------
  |  Branch (405:6): [True: 0, False: 14.6M]
  |  Branch (405:16): [True: 0, False: 14.6M]
  ------------------
  406|      0|		return -1;
  407|  14.6M|	return 0;
  408|  14.6M|}
archive_cryptor.c:aes_ctr_release:
  412|  4.79k|{
  413|  4.79k|	EVP_CIPHER_CTX_free(ctx->ctx);
  414|  4.79k|	OPENSSL_cleanse(ctx->key, ctx->key_len);
  415|  4.79k|	OPENSSL_cleanse(ctx->nonce, sizeof(ctx->nonce));
  416|  4.79k|	return 0;
  417|  4.79k|}

archive_digest.c:__archive_md5init:
  282|     19|{
  283|     19|  if ((*ctx = EVP_MD_CTX_new()) == NULL)
  ------------------
  |  Branch (283:7): [True: 0, False: 19]
  ------------------
  284|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  285|     19|  if (!EVP_DigestInit(*ctx, EVP_md5()))
  ------------------
  |  Branch (285:7): [True: 0, False: 19]
  ------------------
  286|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  287|     19|  return (ARCHIVE_OK);
  ------------------
  |  |  233|     19|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  288|     19|}
archive_digest.c:__archive_md5update:
  293|    259|{
  294|    259|  EVP_DigestUpdate(*ctx, indata, insize);
  295|    259|  return (ARCHIVE_OK);
  ------------------
  |  |  233|    259|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  296|    259|}
archive_digest.c:__archive_md5final:
  300|     19|{
  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|     19|  if (*ctx) {
  ------------------
  |  Branch (305:7): [True: 19, False: 0]
  ------------------
  306|     19|    EVP_DigestFinal(*ctx, md, NULL);
  307|     19|    EVP_MD_CTX_free(*ctx);
  308|     19|    *ctx = NULL;
  309|     19|  }
  310|     19|  return (ARCHIVE_OK);
  ------------------
  |  |  233|     19|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  311|     19|}
archive_digest.c:__archive_sha1init:
  689|    957|{
  690|    957|  if ((*ctx = EVP_MD_CTX_new()) == NULL)
  ------------------
  |  Branch (690:7): [True: 0, False: 957]
  ------------------
  691|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  692|    957|  if (!EVP_DigestInit(*ctx, EVP_sha1()))
  ------------------
  |  Branch (692:7): [True: 0, False: 957]
  ------------------
  693|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  694|    957|  return (ARCHIVE_OK);
  ------------------
  |  |  233|    957|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  695|    957|}
archive_digest.c:__archive_sha1update:
  700|  3.19k|{
  701|  3.19k|  EVP_DigestUpdate(*ctx, indata, insize);
  702|  3.19k|  return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.19k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  703|  3.19k|}
archive_digest.c:__archive_sha1final:
  707|    957|{
  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|    957|  if (*ctx) {
  ------------------
  |  Branch (712:7): [True: 957, False: 0]
  ------------------
  713|    957|    EVP_DigestFinal(*ctx, md, NULL);
  714|    957|    EVP_MD_CTX_free(*ctx);
  715|    957|    *ctx = NULL;
  716|    957|  }
  717|    957|  return (ARCHIVE_OK);
  ------------------
  |  |  233|    957|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  718|    957|}
archive_digest.c:__archive_sha256init:
  965|      3|{
  966|      3|  if ((*ctx = EVP_MD_CTX_new()) == NULL)
  ------------------
  |  Branch (966:7): [True: 0, False: 3]
  ------------------
  967|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  968|      3|  if (!EVP_DigestInit(*ctx, EVP_sha256()))
  ------------------
  |  Branch (968:7): [True: 0, False: 3]
  ------------------
  969|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  970|      3|  return (ARCHIVE_OK);
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  971|      3|}
archive_digest.c:__archive_sha256update:
  976|      6|{
  977|      6|  EVP_DigestUpdate(*ctx, indata, insize);
  978|      6|  return (ARCHIVE_OK);
  ------------------
  |  |  233|      6|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  979|      6|}
archive_digest.c:__archive_sha256final:
  983|      3|{
  984|      3|  if (*ctx) {
  ------------------
  |  Branch (984:7): [True: 3, False: 0]
  ------------------
  985|      3|    EVP_DigestFinal(*ctx, md, NULL);
  986|      3|    EVP_MD_CTX_free(*ctx);
  987|      3|    *ctx = NULL;
  988|      3|  }
  989|      3|  return (ARCHIVE_OK);
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  990|      3|}
archive_digest.c:__archive_sha512init:
 1485|      6|{
 1486|      6|  if ((*ctx = EVP_MD_CTX_new()) == NULL)
  ------------------
  |  Branch (1486:7): [True: 0, False: 6]
  ------------------
 1487|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1488|      6|  if (!EVP_DigestInit(*ctx, EVP_sha512()))
  ------------------
  |  Branch (1488:7): [True: 0, False: 6]
  ------------------
 1489|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1490|      6|  return (ARCHIVE_OK);
  ------------------
  |  |  233|      6|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1491|      6|}
archive_digest.c:__archive_sha512update:
 1496|     45|{
 1497|     45|  EVP_DigestUpdate(*ctx, indata, insize);
 1498|     45|  return (ARCHIVE_OK);
  ------------------
  |  |  233|     45|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1499|     45|}
archive_digest.c:__archive_sha512final:
 1503|      6|{
 1504|      6|  if (*ctx) {
  ------------------
  |  Branch (1504:7): [True: 6, False: 0]
  ------------------
 1505|      6|    EVP_DigestFinal(*ctx, md, NULL);
 1506|      6|    EVP_MD_CTX_free(*ctx);
 1507|      6|    *ctx = NULL;
 1508|      6|  }
 1509|      6|  return (ARCHIVE_OK);
  ------------------
  |  |  233|      6|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1510|      6|}

archive_read_support_filter_gzip.c:archive_le32dec:
  144|  1.28k|{
  145|  1.28k|	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|  1.28k|	unsigned int p3 = p[3];
  151|  1.28k|	unsigned int p2 = p[2];
  152|  1.28k|	unsigned int p1 = p[1];
  153|  1.28k|	unsigned int p0 = p[0];
  154|       |
  155|  1.28k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  1.28k|}
archive_read_support_filter_gzip.c:archive_le16dec:
  115|     99|{
  116|     99|	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|     99|	unsigned int p1 = p[1];
  122|     99|	unsigned int p0 = p[0];
  123|       |
  124|     99|	return ((p1 << 8) | p0);
  125|     99|}
archive_read_support_filter_lz4.c:archive_le32dec:
  144|  31.9k|{
  145|  31.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|  31.9k|	unsigned int p3 = p[3];
  151|  31.9k|	unsigned int p2 = p[2];
  152|  31.9k|	unsigned int p1 = p[1];
  153|  31.9k|	unsigned int p0 = p[0];
  154|       |
  155|  31.9k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  31.9k|}
archive_read_support_filter_rpm.c:archive_be32dec:
   91|    552|{
   92|    552|	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|    552|	unsigned int p3 = p[3];
   98|    552|	unsigned int p2 = p[2];
   99|    552|	unsigned int p1 = p[1];
  100|    552|	unsigned int p0 = p[0];
  101|       |
  102|    552|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|    552|}
archive_read_support_filter_xz.c:archive_le32enc:
  216|    151|{
  217|    151|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|    151|	p[0] = u & 0xff;
  220|    151|	p[1] = (u >> 8) & 0xff;
  221|    151|	p[2] = (u >> 16) & 0xff;
  222|    151|	p[3] = (u >> 24) & 0xff;
  223|    151|}
archive_read_support_filter_xz.c:archive_le32dec:
  144|  55.7k|{
  145|  55.7k|	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|  55.7k|	unsigned int p3 = p[3];
  151|  55.7k|	unsigned int p2 = p[2];
  152|  55.7k|	unsigned int p1 = p[1];
  153|  55.7k|	unsigned int p0 = p[0];
  154|       |
  155|  55.7k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  55.7k|}
archive_read_support_filter_xz.c:archive_le64dec:
  160|  18.6k|{
  161|  18.6k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  18.6k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  18.6k|}
archive_read_support_filter_zstd.c:archive_le32dec:
  144|  19.1k|{
  145|  19.1k|	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|  19.1k|	unsigned int p3 = p[3];
  151|  19.1k|	unsigned int p2 = p[2];
  152|  19.1k|	unsigned int p1 = p[1];
  153|  19.1k|	unsigned int p0 = p[0];
  154|       |
  155|  19.1k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  19.1k|}
archive_read_support_format_cab.c:archive_le32dec:
  144|   119k|{
  145|   119k|	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|   119k|	unsigned int p3 = p[3];
  151|   119k|	unsigned int p2 = p[2];
  152|   119k|	unsigned int p1 = p[1];
  153|   119k|	unsigned int p0 = p[0];
  154|       |
  155|   119k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|   119k|}
archive_read_support_format_cab.c:archive_le16dec:
  115|  10.8k|{
  116|  10.8k|	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|  10.8k|	unsigned int p1 = p[1];
  122|  10.8k|	unsigned int p0 = p[0];
  123|       |
  124|  10.8k|	return ((p1 << 8) | p0);
  125|  10.8k|}
archive_read_support_format_cab.c:archive_le16enc:
  197|  2.05k|{
  198|  2.05k|	unsigned char *p = (unsigned char *)pp;
  199|       |
  200|  2.05k|	p[0] = u & 0xff;
  201|  2.05k|	p[1] = (u >> 8) & 0xff;
  202|  2.05k|}
archive_read_support_format_cab.c:archive_le32enc:
  216|    248|{
  217|    248|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|    248|	p[0] = u & 0xff;
  220|    248|	p[1] = (u >> 8) & 0xff;
  221|    248|	p[2] = (u >> 16) & 0xff;
  222|    248|	p[3] = (u >> 24) & 0xff;
  223|    248|}
archive_read_support_format_cpio.c:archive_be16dec:
   61|  23.0k|{
   62|  23.0k|	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|  23.0k|	unsigned int p1 = p[1];
   68|  23.0k|	unsigned int p0 = p[0];
   69|       |
   70|  23.0k|	return ((p0 << 8) | p1);
   71|  23.0k|}
archive_read_support_format_cpio.c:archive_le16dec:
  115|  19.9k|{
  116|  19.9k|	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|  19.9k|	unsigned int p1 = p[1];
  122|  19.9k|	unsigned int p0 = p[0];
  123|       |
  124|  19.9k|	return ((p1 << 8) | p0);
  125|  19.9k|}
archive_read_support_format_iso9660.c:archive_le32dec:
  144|  2.94k|{
  145|  2.94k|	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.94k|	unsigned int p3 = p[3];
  151|  2.94k|	unsigned int p2 = p[2];
  152|  2.94k|	unsigned int p1 = p[1];
  153|  2.94k|	unsigned int p0 = p[0];
  154|       |
  155|  2.94k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  2.94k|}
archive_read_support_format_iso9660.c:archive_le16dec:
  115|    436|{
  116|    436|	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|    436|	unsigned int p1 = p[1];
  122|    436|	unsigned int p0 = p[0];
  123|       |
  124|    436|	return ((p1 << 8) | p0);
  125|    436|}
archive_read_support_format_iso9660.c:archive_be32dec:
   91|    375|{
   92|    375|	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|    375|	unsigned int p3 = p[3];
   98|    375|	unsigned int p2 = p[2];
   99|    375|	unsigned int p1 = p[1];
  100|    375|	unsigned int p0 = p[0];
  101|       |
  102|    375|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|    375|}
archive_read_support_format_lha.c:archive_le32dec:
  144|  21.5k|{
  145|  21.5k|	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|  21.5k|	unsigned int p3 = p[3];
  151|  21.5k|	unsigned int p2 = p[2];
  152|  21.5k|	unsigned int p1 = p[1];
  153|  21.5k|	unsigned int p0 = p[0];
  154|       |
  155|  21.5k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  21.5k|}
archive_read_support_format_lha.c:archive_le16dec:
  115|  49.6k|{
  116|  49.6k|	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|  49.6k|	unsigned int p1 = p[1];
  122|  49.6k|	unsigned int p0 = p[0];
  123|       |
  124|  49.6k|	return ((p1 << 8) | p0);
  125|  49.6k|}
archive_read_support_format_lha.c:archive_be16dec:
   61|     31|{
   62|     31|	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|     31|	unsigned int p1 = p[1];
   68|     31|	unsigned int p0 = p[0];
   69|       |
   70|     31|	return ((p0 << 8) | p1);
   71|     31|}
archive_read_support_format_lha.c:archive_le64dec:
  160|    711|{
  161|    711|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|    711|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|    711|}
archive_read_support_format_rar.c:archive_le16dec:
  115|  46.3k|{
  116|  46.3k|	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|  46.3k|	unsigned int p1 = p[1];
  122|  46.3k|	unsigned int p0 = p[0];
  123|       |
  124|  46.3k|	return ((p1 << 8) | p0);
  125|  46.3k|}
archive_read_support_format_rar.c:archive_le64dec:
  160|  1.01k|{
  161|  1.01k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  1.01k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  1.01k|}
archive_read_support_format_rar.c:archive_le32dec:
  144|  49.3k|{
  145|  49.3k|	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|  49.3k|	unsigned int p3 = p[3];
  151|  49.3k|	unsigned int p2 = p[2];
  152|  49.3k|	unsigned int p1 = p[1];
  153|  49.3k|	unsigned int p0 = p[0];
  154|       |
  155|  49.3k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|  49.3k|}
archive_read_support_format_rar.c:archive_le32enc:
  216|   137k|{
  217|   137k|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|   137k|	p[0] = u & 0xff;
  220|   137k|	p[1] = (u >> 8) & 0xff;
  221|   137k|	p[2] = (u >> 16) & 0xff;
  222|   137k|	p[3] = (u >> 24) & 0xff;
  223|   137k|}
archive_read_support_format_rar5.c:archive_le32dec:
  144|   128k|{
  145|   128k|	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|   128k|	unsigned int p3 = p[3];
  151|   128k|	unsigned int p2 = p[2];
  152|   128k|	unsigned int p1 = p[1];
  153|   128k|	unsigned int p0 = p[0];
  154|       |
  155|   128k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|   128k|}
archive_read_support_format_rar5.c:archive_le64dec:
  160|    697|{
  161|    697|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|    697|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|    697|}
archive_read_support_format_rar5.c:archive_le16dec:
  115|    525|{
  116|    525|	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|    525|	unsigned int p1 = p[1];
  122|    525|	unsigned int p0 = p[0];
  123|       |
  124|    525|	return ((p1 << 8) | p0);
  125|    525|}
archive_read_support_format_rar5.c:archive_be24dec:
   75|  1.96M|{
   76|  1.96M|	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|  1.96M|	unsigned int p2 = p[2];
   82|  1.96M|	unsigned int p1 = p[1];
   83|  1.96M|	unsigned int p0 = p[0];
   84|       |
   85|  1.96M|	return ((p0 << 16) | (p1 << 8) | p2);
   86|  1.96M|}
archive_read_support_format_rar5.c:archive_be32dec:
   91|  18.4k|{
   92|  18.4k|	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|  18.4k|	unsigned int p3 = p[3];
   98|  18.4k|	unsigned int p2 = p[2];
   99|  18.4k|	unsigned int p1 = p[1];
  100|  18.4k|	unsigned int p0 = p[0];
  101|       |
  102|  18.4k|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|  18.4k|}
archive_read_support_format_rar5.c:archive_le32enc:
  216|  50.6k|{
  217|  50.6k|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|  50.6k|	p[0] = u & 0xff;
  220|  50.6k|	p[1] = (u >> 8) & 0xff;
  221|  50.6k|	p[2] = (u >> 16) & 0xff;
  222|  50.6k|	p[3] = (u >> 24) & 0xff;
  223|  50.6k|}
archive_read_support_format_xar.c:archive_be32dec:
   91|  23.7k|{
   92|  23.7k|	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|  23.7k|	unsigned int p3 = p[3];
   98|  23.7k|	unsigned int p2 = p[2];
   99|  23.7k|	unsigned int p1 = p[1];
  100|  23.7k|	unsigned int p0 = p[0];
  101|       |
  102|  23.7k|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|  23.7k|}
archive_read_support_format_xar.c:archive_be16dec:
   61|  3.22k|{
   62|  3.22k|	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|  3.22k|	unsigned int p1 = p[1];
   68|  3.22k|	unsigned int p0 = p[0];
   69|       |
   70|  3.22k|	return ((p0 << 8) | p1);
   71|  3.22k|}
archive_read_support_format_xar.c:archive_be64dec:
  107|  2.15k|{
  108|  2.15k|	unsigned char const *p = (unsigned char const *)pp;
  109|       |
  110|  2.15k|	return (((uint64_t)archive_be32dec(p) << 32) | archive_be32dec(p + 4));
  111|  2.15k|}
archive_read_support_format_zip.c:archive_le16dec:
  115|   245k|{
  116|   245k|	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|   245k|	unsigned int p1 = p[1];
  122|   245k|	unsigned int p0 = p[0];
  123|       |
  124|   245k|	return ((p1 << 8) | p0);
  125|   245k|}
archive_read_support_format_zip.c:archive_le32dec:
  144|   386k|{
  145|   386k|	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|   386k|	unsigned int p3 = p[3];
  151|   386k|	unsigned int p2 = p[2];
  152|   386k|	unsigned int p1 = p[1];
  153|   386k|	unsigned int p0 = p[0];
  154|       |
  155|   386k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|   386k|}
archive_read_support_format_zip.c:archive_le64dec:
  160|  38.2k|{
  161|  38.2k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  38.2k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  38.2k|}
archive_string.c:archive_be16enc:
  168|  11.5k|{
  169|  11.5k|	unsigned char *p = (unsigned char *)pp;
  170|       |
  171|  11.5k|	p[0] = (u >> 8) & 0xff;
  172|  11.5k|	p[1] = u & 0xff;
  173|  11.5k|}
archive_string.c:archive_le16enc:
  197|  4.33k|{
  198|  4.33k|	unsigned char *p = (unsigned char *)pp;
  199|       |
  200|  4.33k|	p[0] = u & 0xff;
  201|  4.33k|	p[1] = (u >> 8) & 0xff;
  202|  4.33k|}
archive_string.c:archive_be16dec:
   61|  45.9k|{
   62|  45.9k|	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|  45.9k|	unsigned int p1 = p[1];
   68|  45.9k|	unsigned int p0 = p[0];
   69|       |
   70|  45.9k|	return ((p0 << 8) | p1);
   71|  45.9k|}
archive_string.c:archive_le16dec:
  115|  38.9k|{
  116|  38.9k|	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|  38.9k|	unsigned int p1 = p[1];
  122|  38.9k|	unsigned int p0 = p[0];
  123|       |
  124|  38.9k|	return ((p1 << 8) | p0);
  125|  38.9k|}
archive_read_support_format_7zip.c:archive_le32dec:
  144|   128k|{
  145|   128k|	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|   128k|	unsigned int p3 = p[3];
  151|   128k|	unsigned int p2 = p[2];
  152|   128k|	unsigned int p1 = p[1];
  153|   128k|	unsigned int p0 = p[0];
  154|       |
  155|   128k|	return ((p3 << 24) | (p2 << 16) | (p1 << 8) | p0);
  156|   128k|}
archive_read_support_format_7zip.c:archive_le16dec:
  115|    715|{
  116|    715|	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|    715|	unsigned int p1 = p[1];
  122|    715|	unsigned int p0 = p[0];
  123|       |
  124|    715|	return ((p1 << 8) | p0);
  125|    715|}
archive_read_support_format_7zip.c:archive_be16dec:
   61|    339|{
   62|    339|	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|    339|	unsigned int p1 = p[1];
   68|    339|	unsigned int p0 = p[0];
   69|       |
   70|    339|	return ((p0 << 8) | p1);
   71|    339|}
archive_read_support_format_7zip.c:archive_be32dec:
   91|  1.10k|{
   92|  1.10k|	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|  1.10k|	unsigned int p3 = p[3];
   98|  1.10k|	unsigned int p2 = p[2];
   99|  1.10k|	unsigned int p1 = p[1];
  100|  1.10k|	unsigned int p0 = p[0];
  101|       |
  102|  1.10k|	return ((p0 << 24) | (p1 << 16) | (p2 << 8) | p3);
  103|  1.10k|}
archive_read_support_format_7zip.c:archive_be64dec:
  107|    299|{
  108|    299|	unsigned char const *p = (unsigned char const *)pp;
  109|       |
  110|    299|	return (((uint64_t)archive_be32dec(p) << 32) | archive_be32dec(p + 4));
  111|    299|}
archive_read_support_format_7zip.c:archive_le64dec:
  160|  5.67k|{
  161|  5.67k|	unsigned char const *p = (unsigned char const *)pp;
  162|       |
  163|  5.67k|	return (((uint64_t)archive_le32dec(p + 4) << 32) | archive_le32dec(p));
  164|  5.67k|}
archive_read_support_format_7zip.c:archive_le32enc:
  216|    127|{
  217|    127|	unsigned char *p = (unsigned char *)pp;
  218|       |
  219|    127|	p[0] = u & 0xff;
  220|    127|	p[1] = (u >> 8) & 0xff;
  221|    127|	p[2] = (u >> 16) & 0xff;
  222|    127|	p[3] = (u >> 24) & 0xff;
  223|    127|}
archive_read_support_format_7zip.c:archive_le24dec:
  129|     44|{
  130|     44|	unsigned char const *p = (unsigned char const *)pp;
  131|       |
  132|       |	/* Store into unsigned temporaries before left shifting, to avoid
  133|       |	promotion to signed int and then left shifting into the sign bit,
  134|       |	which is undefined behaviour. */
  135|     44|	unsigned int p2 = p[2];
  136|     44|	unsigned int p1 = p[1];
  137|     44|	unsigned int p0 = p[0];
  138|       |
  139|     44|	return ((p2 << 16) | (p1 << 8) | p0);
  140|     44|}
archive_read_support_format_7zip.c:archive_le24enc:
  206|     44|{
  207|     44|	unsigned char *p = (unsigned char *)pp;
  208|       |
  209|     44|	p[0] = u & 0xff;
  210|     44|	p[1] = (u >> 8) & 0xff;
  211|     44|	p[2] = (u >> 16) & 0xff;
  212|     44|}
archive_read_support_format_7zip.c:archive_be32enc:
  177|     34|{
  178|     34|	unsigned char *p = (unsigned char *)pp;
  179|       |
  180|     34|	p[0] = (u >> 24) & 0xff;
  181|     34|	p[1] = (u >> 16) & 0xff;
  182|     34|	p[2] = (u >> 8) & 0xff;
  183|     34|	p[3] = u & 0xff;
  184|     34|}

archive_entry_clear:
  155|   546k|{
  156|   546k|	if (entry == NULL)
  ------------------
  |  Branch (156:6): [True: 0, False: 546k]
  ------------------
  157|      0|		return (NULL);
  158|   546k|	archive_mstring_clean(&entry->ae_fflags_text);
  159|   546k|	archive_mstring_clean(&entry->ae_gname);
  160|   546k|	archive_mstring_clean(&entry->ae_linkname);
  161|   546k|	archive_mstring_clean(&entry->ae_pathname);
  162|   546k|	archive_mstring_clean(&entry->ae_sourcepath);
  163|   546k|	archive_mstring_clean(&entry->ae_uname);
  164|   546k|	archive_entry_copy_mac_metadata(entry, NULL, 0);
  165|   546k|	archive_acl_clear(&entry->acl);
  166|   546k|	archive_entry_xattr_clear(entry);
  167|   546k|	archive_entry_sparse_clear(entry);
  168|   546k|	free(entry->stat);
  169|   546k|	entry->ae_symlink_type = AE_SYMLINK_TYPE_UNDEFINED;
  ------------------
  |  |  227|   546k|#define AE_SYMLINK_TYPE_UNDEFINED	0
  ------------------
  170|   546k|	memset(entry, 0, sizeof(*entry));
  171|   546k|	return entry;
  172|   546k|}
archive_entry_free:
  250|  34.1k|{
  251|  34.1k|	archive_entry_clear(entry);
  252|  34.1k|	free(entry);
  253|  34.1k|}
archive_entry_new:
  257|  17.4k|{
  258|       |	return archive_entry_new2(NULL);
  259|  17.4k|}
archive_entry_new2:
  263|  34.1k|{
  264|  34.1k|	struct archive_entry *entry;
  265|       |
  266|  34.1k|	entry = calloc(1, sizeof(*entry));
  267|  34.1k|	if (entry == NULL)
  ------------------
  |  Branch (267:6): [True: 0, False: 34.1k]
  ------------------
  268|      0|		return (NULL);
  269|  34.1k|	entry->archive = a;
  270|  34.1k|	entry->ae_symlink_type = AE_SYMLINK_TYPE_UNDEFINED;
  ------------------
  |  |  227|  34.1k|#define AE_SYMLINK_TYPE_UNDEFINED	0
  ------------------
  271|  34.1k|	return (entry);
  272|  34.1k|}
archive_entry_atime:
  280|   399k|{
  281|   399k|	return (entry->ae_stat.aest_atime);
  282|   399k|}
archive_entry_atime_is_set:
  292|    755|{
  293|    755|	return (entry->ae_set & AE_SET_ATIME);
  ------------------
  |  |  141|    755|#define	AE_SET_ATIME	4
  ------------------
  294|    755|}
archive_entry_birthtime:
  298|   399k|{
  299|   399k|	return (entry->ae_stat.aest_birthtime);
  300|   399k|}
archive_entry_ctime:
  316|   399k|{
  317|   399k|	return (entry->ae_stat.aest_ctime);
  318|   399k|}
archive_entry_ctime_is_set:
  322|    755|{
  323|    755|	return (entry->ae_set & AE_SET_CTIME);
  ------------------
  |  |  142|    755|#define	AE_SET_CTIME	8
  ------------------
  324|    755|}
archive_entry_dev:
  334|   404k|{
  335|   404k|	if (entry->ae_stat.aest_dev_is_broken_down)
  ------------------
  |  Branch (335:6): [True: 8.75k, False: 396k]
  ------------------
  336|  8.75k|		return ae_makedev(entry->ae_stat.aest_devmajor,
  ------------------
  |  |   94|  8.75k|#define ae_makedev(maj, min) makedev((maj), (min))
  ------------------
  337|   396k|		    entry->ae_stat.aest_devminor);
  338|   396k|	else
  339|   396k|		return (entry->ae_stat.aest_dev);
  340|   404k|}
archive_entry_filetype:
  368|   725k|{
  369|   725k|	return (AE_IFMT & entry->acl.mode);
  ------------------
  |  |  215|   725k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  370|   725k|}
archive_entry_gid:
  427|   399k|{
  428|   399k|	return (entry->ae_stat.aest_gid);
  429|   399k|}
archive_entry_gid_is_set:
  433|   282k|{
  434|   282k|	return (entry->ae_set & AE_SET_GID);
  ------------------
  |  |  151|   282k|#define	AE_SET_GID	4096
  ------------------
  435|   282k|}
archive_entry_gname:
  439|  3.27k|{
  440|  3.27k|	const char *p;
  441|  3.27k|	if (archive_mstring_get_mbs(entry->archive, &entry->ae_gname, &p) == 0)
  ------------------
  |  Branch (441:6): [True: 3.27k, False: 0]
  ------------------
  442|  3.27k|		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|  2.84k|{
  481|  2.84k|	if ((entry->ae_set & AE_SET_SYMLINK) != 0) {
  ------------------
  |  |  140|  2.84k|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (481:6): [True: 0, False: 2.84k]
  ------------------
  482|      0|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
  483|      0|	}
  484|  2.84k|	entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|  2.84k|#define	AE_SET_HARDLINK	1
  ------------------
  485|  2.84k|}
archive_entry_hardlink:
  489|  2.84k|{
  490|  2.84k|	const char *p;
  491|  2.84k|	if ((entry->ae_set & AE_SET_HARDLINK) == 0)
  ------------------
  |  |  139|  2.84k|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (491:6): [True: 0, False: 2.84k]
  ------------------
  492|      0|		return (NULL);
  493|  2.84k|	if (archive_mstring_get_mbs(
  ------------------
  |  Branch (493:6): [True: 2.84k, False: 0]
  ------------------
  494|  2.84k|	    entry->archive, &entry->ae_linkname, &p) == 0)
  495|  2.84k|		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|  2.84k|{
  518|  2.84k|	const wchar_t *p;
  519|  2.84k|	if ((entry->ae_set & AE_SET_HARDLINK) == 0)
  ------------------
  |  |  139|  2.84k|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (519:6): [True: 0, False: 2.84k]
  ------------------
  520|      0|		return (NULL);
  521|  2.84k|	if (archive_mstring_get_wcs(
  ------------------
  |  Branch (521:6): [True: 2.82k, False: 16]
  ------------------
  522|  2.84k|	    entry->archive, &entry->ae_linkname, &p) == 0)
  523|  2.82k|		return (p);
  524|     16|	if (errno == ENOMEM)
  ------------------
  |  Branch (524:6): [True: 0, False: 16]
  ------------------
  525|      0|		__archive_errx(1, "No memory");
  526|     16|	return (NULL);
  527|     16|}
archive_entry_ino64:
  561|  5.07k|{
  562|  5.07k|	return (entry->ae_stat.aest_ino);
  563|  5.07k|}
archive_entry_mode:
  567|   399k|{
  568|   399k|	return (entry->acl.mode);
  569|   399k|}
archive_entry_mtime:
  573|   399k|{
  574|   399k|	return (entry->ae_stat.aest_mtime);
  575|   399k|}
archive_entry_mtime_is_set:
  585|   282k|{
  586|   282k|	return (entry->ae_set & AE_SET_MTIME);
  ------------------
  |  |  143|   282k|#define	AE_SET_MTIME	16
  ------------------
  587|   282k|}
archive_entry_nlink:
  591|  8.58k|{
  592|  8.58k|	return (entry->ae_stat.aest_nlink);
  593|  8.58k|}
archive_entry_pathname:
  604|  1.25M|{
  605|  1.25M|	const char *p;
  606|  1.25M|	if (archive_mstring_get_mbs(
  ------------------
  |  Branch (606:6): [True: 1.25M, False: 979]
  ------------------
  607|  1.25M|	    entry->archive, &entry->ae_pathname, &p) == 0)
  608|  1.25M|		return (p);
  609|       |#if HAVE_EILSEQ  /*{*/
  610|    979|    if (errno == EILSEQ) {
  ------------------
  |  Branch (610:9): [True: 979, False: 0]
  ------------------
  611|    979|	    if (archive_mstring_get_utf8(
  ------------------
  |  Branch (611:10): [True: 979, False: 0]
  ------------------
  612|    979|	        entry->archive, &entry->ae_pathname, &p) == 0)
  613|    979|		    return (p);
  614|    979|    }
  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|   427k|{
  624|   427k|	const char *p;
  625|   427k|	if (archive_mstring_get_utf8(
  ------------------
  |  Branch (625:6): [True: 404k, False: 23.2k]
  ------------------
  626|   427k|	    entry->archive, &entry->ae_pathname, &p) == 0)
  627|   404k|		return (p);
  628|  23.2k|	if (errno == ENOMEM)
  ------------------
  |  Branch (628:6): [True: 0, False: 23.2k]
  ------------------
  629|      0|		__archive_errx(1, "No memory");
  630|  23.2k|	return (NULL);
  631|  23.2k|}
archive_entry_pathname_w:
  635|   740k|{
  636|   740k|	const wchar_t *p;
  637|   740k|	if (archive_mstring_get_wcs(
  ------------------
  |  Branch (637:6): [True: 702k, False: 38.3k]
  ------------------
  638|   740k|	    entry->archive, &entry->ae_pathname, &p) == 0)
  639|   702k|		return (p);
  640|  38.3k|	if (errno == ENOMEM)
  ------------------
  |  Branch (640:6): [True: 0, False: 38.3k]
  ------------------
  641|      0|		__archive_errx(1, "No memory");
  642|  38.3k|	return (NULL);
  643|  38.3k|}
archive_entry_perm:
  654|    621|{
  655|    621|	return (~AE_IFMT & entry->acl.mode);
  ------------------
  |  |  215|    621|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  656|    621|}
archive_entry_perm_is_set:
  660|   282k|{
  661|   282k|	return (entry->ae_set & AE_SET_PERM);
  ------------------
  |  |  148|   282k|#define	AE_SET_PERM	512
  ------------------
  662|   282k|}
archive_entry_rdev_is_set:
  666|    517|{
  667|    517|	return (entry->ae_set & AE_SET_RDEV);
  ------------------
  |  |  152|    517|#define	AE_SET_RDEV	8192
  ------------------
  668|    517|}
archive_entry_size:
  712|   847k|{
  713|   847k|	return (entry->ae_stat.aest_size);
  714|   847k|}
archive_entry_size_is_set:
  718|   399k|{
  719|   399k|	return (entry->ae_set & AE_SET_SIZE);
  ------------------
  |  |  145|   399k|#define	AE_SET_SIZE	64
  ------------------
  720|   399k|}
archive_entry_symlink:
  746|  5.76k|{
  747|  5.76k|	const char *p;
  748|  5.76k|	if ((entry->ae_set & AE_SET_SYMLINK) == 0)
  ------------------
  |  |  140|  5.76k|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (748:6): [True: 5.50k, False: 264]
  ------------------
  749|  5.50k|		return (NULL);
  750|    264|	if (archive_mstring_get_mbs(
  ------------------
  |  Branch (750:6): [True: 264, False: 0]
  ------------------
  751|    264|	    entry->archive, &entry->ae_linkname, &p) == 0)
  752|    264|		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|    236|{
  761|    236|	if ((entry->ae_set & AE_SET_HARDLINK) != 0) {
  ------------------
  |  |  139|    236|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (761:6): [True: 42, False: 194]
  ------------------
  762|     42|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|     42|#define	AE_SET_HARDLINK	1
  ------------------
  763|     42|	}
  764|    236|	entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|    236|#define	AE_SET_SYMLINK	2
  ------------------
  765|    236|}
archive_entry_symlink_w:
  789|    526|{
  790|    526|	const wchar_t *p;
  791|    526|	if ((entry->ae_set & AE_SET_SYMLINK) == 0)
  ------------------
  |  |  140|    526|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (791:6): [True: 290, False: 236]
  ------------------
  792|    290|		return (NULL);
  793|    236|	if (archive_mstring_get_wcs(
  ------------------
  |  Branch (793:6): [True: 216, False: 20]
  ------------------
  794|    236|	    entry->archive, &entry->ae_linkname, &p) == 0)
  795|    216|		return (p);
  796|     20|	if (errno == ENOMEM)
  ------------------
  |  Branch (796:6): [True: 0, False: 20]
  ------------------
  797|      0|		__archive_errx(1, "No memory");
  798|     20|	return (NULL);
  799|     20|}
archive_entry_uid:
  815|   399k|{
  816|   399k|	return (entry->ae_stat.aest_uid);
  817|   399k|}
archive_entry_uid_is_set:
  821|   282k|{
  822|   282k|	return (entry->ae_set & AE_SET_UID);
  ------------------
  |  |  150|   282k|#define	AE_SET_UID	2048
  ------------------
  823|   282k|}
archive_entry_uname:
  827|  3.27k|{
  828|  3.27k|	const char *p;
  829|  3.27k|	if (archive_mstring_get_mbs(entry->archive, &entry->ae_uname, &p) == 0)
  ------------------
  |  Branch (829:6): [True: 3.27k, False: 0]
  ------------------
  830|  3.27k|		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|   399k|{
  868|   399k|	return ((entry->encryption & AE_ENCRYPTION_DATA) == AE_ENCRYPTION_DATA);
  ------------------
  |  |  169|   399k|#define AE_ENCRYPTION_DATA 1
  ------------------
              	return ((entry->encryption & AE_ENCRYPTION_DATA) == AE_ENCRYPTION_DATA);
  ------------------
  |  |  169|   399k|#define AE_ENCRYPTION_DATA 1
  ------------------
  869|   399k|}
archive_entry_is_metadata_encrypted:
  873|   399k|{
  874|   399k|	return ((entry->encryption & AE_ENCRYPTION_METADATA) == AE_ENCRYPTION_METADATA);
  ------------------
  |  |  170|   399k|#define AE_ENCRYPTION_METADATA 2
  ------------------
              	return ((entry->encryption & AE_ENCRYPTION_METADATA) == AE_ENCRYPTION_METADATA);
  ------------------
  |  |  170|   399k|#define AE_ENCRYPTION_METADATA 2
  ------------------
  875|   399k|}
archive_entry_is_encrypted:
  879|   399k|{
  880|   399k|	return (entry->encryption & (AE_ENCRYPTION_DATA|AE_ENCRYPTION_METADATA));
  ------------------
  |  |  169|   399k|#define AE_ENCRYPTION_DATA 1
  ------------------
              	return (entry->encryption & (AE_ENCRYPTION_DATA|AE_ENCRYPTION_METADATA));
  ------------------
  |  |  170|   399k|#define AE_ENCRYPTION_METADATA 2
  ------------------
  881|   399k|}
archive_entry_set_filetype:
  889|   626k|{
  890|   626k|	entry->stat_valid = 0;
  891|   626k|	entry->acl.mode &= ~AE_IFMT;
  ------------------
  |  |  215|   626k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  892|   626k|	entry->acl.mode |= AE_IFMT & type;
  ------------------
  |  |  215|   626k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  893|   626k|	entry->ae_set |= AE_SET_FILETYPE;
  ------------------
  |  |  149|   626k|#define	AE_SET_FILETYPE	1024
  ------------------
  894|   626k|}
archive_entry_copy_fflags_text:
  908|  7.57k|{
  909|  7.57k|	return archive_entry_copy_fflags_text_len(entry, flags, strlen(flags));
  910|  7.57k|}
archive_entry_copy_fflags_text_len:
  915|  7.59k|{
  916|  7.59k|	archive_mstring_copy_mbs_len(&entry->ae_fflags_text, flags, flags_length);
  917|  7.59k|	return (ae_strtofflags(flags, flags_length,
  918|  7.59k|		    &entry->ae_fflags_set, &entry->ae_fflags_clear));
  919|  7.59k|}
archive_entry_set_gid:
  932|   337k|{
  933|   337k|	if (g < 0) {
  ------------------
  |  Branch (933:6): [True: 694, False: 336k]
  ------------------
  934|    694|		g = 0;
  935|    694|	}
  936|   337k|	entry->stat_valid = 0;
  937|   337k|	entry->ae_stat.aest_gid = g;
  938|   337k|	entry->ae_set |= AE_SET_GID;
  ------------------
  |  |  151|   337k|#define	AE_SET_GID	4096
  ------------------
  939|   337k|}
archive_entry_set_gname:
  943|  1.43k|{
  944|  1.43k|	archive_mstring_copy_mbs(&entry->ae_gname, name);
  945|  1.43k|}
archive_entry_copy_gname:
  955|    218|{
  956|    218|	archive_mstring_copy_mbs(&entry->ae_gname, name);
  957|    218|}
__archive_entry_copy_gname_l:
  979|  3.28k|{
  980|  3.28k|	return (archive_mstring_copy_mbs_len_l(&entry->ae_gname, name, len, sc));
  981|  3.28k|}
archive_entry_set_ino:
  985|   378k|{
  986|   378k|	if (ino < 0) {
  ------------------
  |  Branch (986:6): [True: 290, False: 378k]
  ------------------
  987|    290|		entry->stat_valid = 0;
  988|    290|		entry->ae_set &= ~AE_SET_INO;
  ------------------
  |  |  146|    290|#define	AE_SET_INO	128
  ------------------
  989|    290|		return;
  990|    290|	}
  991|   378k|	entry->stat_valid = 0;
  992|   378k|	entry->ae_set |= AE_SET_INO;
  ------------------
  |  |  146|   378k|#define	AE_SET_INO	128
  ------------------
  993|   378k|	entry->ae_stat.aest_ino = ino;
  994|   378k|}
archive_entry_set_hardlink:
 1011|     58|{
 1012|     58|	if (target == NULL) {
  ------------------
  |  Branch (1012:6): [True: 1, False: 57]
  ------------------
 1013|      1|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|      1|#define	AE_SET_HARDLINK	1
  ------------------
 1014|      1|		if (entry->ae_set & AE_SET_SYMLINK) {
  ------------------
  |  |  140|      1|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1014:7): [True: 0, False: 1]
  ------------------
 1015|      0|			return;
 1016|      0|		}
 1017|     57|	} else {
 1018|     57|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|     57|#define	AE_SET_HARDLINK	1
  ------------------
 1019|     57|	}
 1020|     58|	entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|     58|#define	AE_SET_SYMLINK	2
  ------------------
 1021|     58|	archive_mstring_copy_mbs(&entry->ae_linkname, target);
 1022|     58|}
archive_entry_copy_hardlink:
 1038|  3.77k|{
 1039|  3.77k|	if (target == NULL && (entry->ae_set & AE_SET_SYMLINK))
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1039:6): [True: 0, False: 3.77k]
  |  Branch (1039:24): [True: 0, False: 0]
  ------------------
 1040|      0|		return;
 1041|  3.77k|	archive_mstring_copy_mbs(&entry->ae_linkname, target);
 1042|  3.77k|	if (target != NULL)
  ------------------
  |  Branch (1042:6): [True: 3.77k, False: 0]
  ------------------
 1043|  3.77k|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|  3.77k|#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.77k|}
archive_entry_update_hardlink_utf8:
 1062|  1.36k|{
 1063|  1.36k|	if (target == NULL && (entry->ae_set & AE_SET_SYMLINK))
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1063:6): [True: 0, False: 1.36k]
  |  Branch (1063:24): [True: 0, False: 0]
  ------------------
 1064|      0|		return (0);
 1065|  1.36k|	if (target != NULL)
  ------------------
  |  Branch (1065:6): [True: 1.36k, False: 0]
  ------------------
 1066|  1.36k|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|  1.36k|#define	AE_SET_HARDLINK	1
  ------------------
 1067|      0|	else
 1068|      0|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
 1069|  1.36k|	if (archive_mstring_update_utf8(entry->archive,
  ------------------
  |  Branch (1069:6): [True: 376, False: 985]
  ------------------
 1070|  1.36k|	    &entry->ae_linkname, target) == 0)
 1071|    376|		return (1);
 1072|    985|	if (errno == ENOMEM)
  ------------------
  |  Branch (1072:6): [True: 0, False: 985]
  ------------------
 1073|      0|		__archive_errx(1, "No memory");
 1074|    985|	return (0);
 1075|    985|}
__archive_entry_copy_hardlink_l:
 1080|  2.82k|{
 1081|  2.82k|	int r;
 1082|       |
 1083|  2.82k|	if (target == NULL && (entry->ae_set & AE_SET_SYMLINK))
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1083:6): [True: 0, False: 2.82k]
  |  Branch (1083:24): [True: 0, False: 0]
  ------------------
 1084|      0|		return (0);
 1085|  2.82k|	r = archive_mstring_copy_mbs_len_l(&entry->ae_linkname,
 1086|  2.82k|	    target, len, sc);
 1087|  2.82k|	if (target != NULL && r == 0)
  ------------------
  |  Branch (1087:6): [True: 2.82k, False: 0]
  |  Branch (1087:24): [True: 2.82k, False: 0]
  ------------------
 1088|  2.82k|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|  2.82k|#define	AE_SET_HARDLINK	1
  ------------------
 1089|      0|	else
 1090|      0|		entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
 1091|  2.82k|	return (r);
 1092|  2.82k|}
archive_entry_set_atime:
 1096|  51.5k|{
 1097|  51.5k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  51.5k|	do {	\
  |  |  113|  51.5k|		t += ns / 1000000000; \
  |  |  114|  51.5k|		ns %= 1000000000; \
  |  |  115|  51.5k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 51.5k]
  |  |  ------------------
  |  |  116|  51.5k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 51.5k]
  |  |  ------------------
  ------------------
 1098|  51.5k|	entry->stat_valid = 0;
 1099|  51.5k|	entry->ae_set |= AE_SET_ATIME;
  ------------------
  |  |  141|  51.5k|#define	AE_SET_ATIME	4
  ------------------
 1100|  51.5k|	entry->ae_stat.aest_atime = t;
 1101|  51.5k|	entry->ae_stat.aest_atime_nsec = ns;
 1102|  51.5k|}
archive_entry_unset_atime:
 1106|  6.11k|{
 1107|  6.11k|	archive_entry_set_atime(entry, 0, 0);
 1108|  6.11k|	entry->ae_set &= ~AE_SET_ATIME;
  ------------------
  |  |  141|  6.11k|#define	AE_SET_ATIME	4
  ------------------
 1109|  6.11k|}
archive_entry_set_birthtime:
 1113|  6.33k|{
 1114|  6.33k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  6.33k|	do {	\
  |  |  113|  6.33k|		t += ns / 1000000000; \
  |  |  114|  6.33k|		ns %= 1000000000; \
  |  |  115|  6.33k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 6.33k]
  |  |  ------------------
  |  |  116|  6.33k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 6.33k]
  |  |  ------------------
  ------------------
 1115|  6.33k|	entry->stat_valid = 0;
 1116|  6.33k|	entry->ae_set |= AE_SET_BIRTHTIME;
  ------------------
  |  |  144|  6.33k|#define	AE_SET_BIRTHTIME 32
  ------------------
 1117|  6.33k|	entry->ae_stat.aest_birthtime = t;
 1118|  6.33k|	entry->ae_stat.aest_birthtime_nsec = ns;
 1119|  6.33k|}
archive_entry_unset_birthtime:
 1123|  6.33k|{
 1124|  6.33k|	archive_entry_set_birthtime(entry, 0, 0);
 1125|  6.33k|	entry->ae_set &= ~AE_SET_BIRTHTIME;
  ------------------
  |  |  144|  6.33k|#define	AE_SET_BIRTHTIME 32
  ------------------
 1126|  6.33k|}
archive_entry_set_ctime:
 1130|  58.5k|{
 1131|  58.5k|	FIX_NS(t, ns);
  ------------------
  |  |  112|  58.5k|	do {	\
  |  |  113|  58.5k|		t += ns / 1000000000; \
  |  |  114|  58.5k|		ns %= 1000000000; \
  |  |  115|  58.5k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 58.5k]
  |  |  ------------------
  |  |  116|  58.5k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 58.5k]
  |  |  ------------------
  ------------------
 1132|  58.5k|	entry->stat_valid = 0;
 1133|  58.5k|	entry->ae_set |= AE_SET_CTIME;
  ------------------
  |  |  142|  58.5k|#define	AE_SET_CTIME	8
  ------------------
 1134|  58.5k|	entry->ae_stat.aest_ctime = t;
 1135|  58.5k|	entry->ae_stat.aest_ctime_nsec = ns;
 1136|  58.5k|}
archive_entry_unset_ctime:
 1140|  6.11k|{
 1141|  6.11k|	archive_entry_set_ctime(entry, 0, 0);
 1142|  6.11k|	entry->ae_set &= ~AE_SET_CTIME;
  ------------------
  |  |  142|  6.11k|#define	AE_SET_CTIME	8
  ------------------
 1143|  6.11k|}
archive_entry_set_dev:
 1147|   374k|{
 1148|   374k|	entry->stat_valid = 0;
 1149|   374k|	entry->ae_set |= AE_SET_DEV;
  ------------------
  |  |  147|   374k|#define	AE_SET_DEV	256
  ------------------
 1150|   374k|	entry->ae_stat.aest_dev_is_broken_down = 0;
 1151|   374k|	entry->ae_stat.aest_dev = d;
 1152|   374k|}
archive_entry_set_devmajor:
 1156|  4.45k|{
 1157|  4.45k|	entry->stat_valid = 0;
 1158|  4.45k|	entry->ae_set |= AE_SET_DEV;
  ------------------
  |  |  147|  4.45k|#define	AE_SET_DEV	256
  ------------------
 1159|  4.45k|	entry->ae_stat.aest_dev_is_broken_down = 1;
 1160|  4.45k|	entry->ae_stat.aest_devmajor = m;
 1161|  4.45k|}
archive_entry_set_devminor:
 1165|  4.45k|{
 1166|  4.45k|	entry->stat_valid = 0;
 1167|  4.45k|	entry->ae_set |= AE_SET_DEV;
  ------------------
  |  |  147|  4.45k|#define	AE_SET_DEV	256
  ------------------
 1168|  4.45k|	entry->ae_stat.aest_dev_is_broken_down = 1;
 1169|  4.45k|	entry->ae_stat.aest_devminor = m;
 1170|  4.45k|}
archive_entry_set_link:
 1175|    876|{
 1176|    876|	archive_mstring_copy_mbs(&entry->ae_linkname, target);
 1177|    876|	if ((entry->ae_set & AE_SET_SYMLINK) == 0) {
  ------------------
  |  |  140|    876|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1177:6): [True: 876, False: 0]
  ------------------
 1178|    876|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|    876|#define	AE_SET_HARDLINK	1
  ------------------
 1179|    876|	}
 1180|    876|}
archive_entry_copy_link:
 1194|      4|{
 1195|      4|	archive_mstring_copy_mbs(&entry->ae_linkname, target);
 1196|      4|	if ((entry->ae_set & AE_SET_SYMLINK) == 0) {
  ------------------
  |  |  140|      4|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1196:6): [True: 4, False: 0]
  ------------------
 1197|      4|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|      4|#define	AE_SET_HARDLINK	1
  ------------------
 1198|      4|	}
 1199|      4|}
__archive_entry_copy_link_l:
 1230|      5|{
 1231|      5|	int r;
 1232|       |
 1233|      5|	r = archive_mstring_copy_mbs_len_l(&entry->ae_linkname,
 1234|      5|		    target, len, sc);
 1235|      5|	if ((entry->ae_set & AE_SET_SYMLINK) == 0) {
  ------------------
  |  |  140|      5|#define	AE_SET_SYMLINK	2
  ------------------
  |  Branch (1235:6): [True: 5, False: 0]
  ------------------
 1236|      5|		entry->ae_set |= AE_SET_HARDLINK;
  ------------------
  |  |  139|      5|#define	AE_SET_HARDLINK	1
  ------------------
 1237|      5|	}
 1238|      5|	return (r);
 1239|      5|}
archive_entry_set_mode:
 1243|  77.9k|{
 1244|  77.9k|	entry->stat_valid = 0;
 1245|  77.9k|	entry->acl.mode = m;
 1246|  77.9k|	entry->ae_set |= AE_SET_PERM | AE_SET_FILETYPE;
  ------------------
  |  |  148|  77.9k|#define	AE_SET_PERM	512
  ------------------
              	entry->ae_set |= AE_SET_PERM | AE_SET_FILETYPE;
  ------------------
  |  |  149|  77.9k|#define	AE_SET_FILETYPE	1024
  ------------------
 1247|  77.9k|}
archive_entry_set_mtime:
 1251|   356k|{
 1252|   356k|	FIX_NS(t, ns);
  ------------------
  |  |  112|   356k|	do {	\
  |  |  113|   356k|		t += ns / 1000000000; \
  |  |  114|   356k|		ns %= 1000000000; \
  |  |  115|   356k|		if (ns < 0) { --t; ns += 1000000000; } \
  |  |  ------------------
  |  |  |  Branch (115:7): [True: 0, False: 356k]
  |  |  ------------------
  |  |  116|   356k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (116:11): [Folded, False: 356k]
  |  |  ------------------
  ------------------
 1253|   356k|	entry->stat_valid = 0;
 1254|   356k|	entry->ae_set |= AE_SET_MTIME;
  ------------------
  |  |  143|   356k|#define	AE_SET_MTIME	16
  ------------------
 1255|   356k|	entry->ae_stat.aest_mtime = t;
 1256|   356k|	entry->ae_stat.aest_mtime_nsec = ns;
 1257|   356k|}
archive_entry_unset_mtime:
 1261|    248|{
 1262|    248|	archive_entry_set_mtime(entry, 0, 0);
 1263|    248|	entry->ae_set &= ~AE_SET_MTIME;
  ------------------
  |  |  143|    248|#define	AE_SET_MTIME	16
  ------------------
 1264|    248|}
archive_entry_set_nlink:
 1268|  8.52k|{
 1269|  8.52k|	entry->stat_valid = 0;
 1270|  8.52k|	entry->ae_stat.aest_nlink = nlink;
 1271|  8.52k|}
archive_entry_set_pathname:
 1275|  1.31k|{
 1276|  1.31k|	archive_mstring_copy_mbs(&entry->ae_pathname, name);
 1277|  1.31k|}
archive_entry_copy_pathname:
 1287|  49.1k|{
 1288|  49.1k|	archive_mstring_copy_mbs(&entry->ae_pathname, name);
 1289|  49.1k|}
archive_entry_copy_pathname_w:
 1293|  7.23k|{
 1294|  7.23k|	archive_mstring_copy_wcs(&entry->ae_pathname, name);
 1295|  7.23k|}
archive_entry_update_pathname_utf8:
 1299|  37.2k|{
 1300|  37.2k|	if (archive_mstring_update_utf8(entry->archive,
  ------------------
  |  Branch (1300:6): [True: 5.51k, False: 31.7k]
  ------------------
 1301|  37.2k|	    &entry->ae_pathname, name) == 0)
 1302|  5.51k|		return (1);
 1303|  31.7k|	if (errno == ENOMEM)
  ------------------
  |  Branch (1303:6): [True: 0, False: 31.7k]
  ------------------
 1304|      0|		__archive_errx(1, "No memory");
 1305|  31.7k|	return (0);
 1306|  31.7k|}
__archive_entry_copy_pathname_l:
 1311|   341k|{
 1312|   341k|	return (archive_mstring_copy_mbs_len_l(&entry->ae_pathname,
 1313|   341k|	    name, len, sc));
 1314|   341k|}
archive_entry_set_perm:
 1318|   290k|{
 1319|   290k|	entry->stat_valid = 0;
 1320|   290k|	entry->acl.mode &= AE_IFMT;
  ------------------
  |  |  215|   290k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1321|   290k|	entry->acl.mode |= ~AE_IFMT & p;
  ------------------
  |  |  215|   290k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1322|   290k|	entry->ae_set |= AE_SET_PERM;
  ------------------
  |  |  148|   290k|#define	AE_SET_PERM	512
  ------------------
 1323|   290k|}
archive_entry_set_rdev:
 1327|  7.84k|{
 1328|  7.84k|	entry->stat_valid = 0;
 1329|  7.84k|	entry->ae_stat.aest_rdev = m;
 1330|  7.84k|	entry->ae_stat.aest_rdev_is_broken_down = 0;
 1331|  7.84k|	entry->ae_stat.aest_rdevmajor = 0;
 1332|  7.84k|	entry->ae_stat.aest_rdevminor = 0;
 1333|  7.84k|	entry->ae_set |= AE_SET_RDEV;
  ------------------
  |  |  152|  7.84k|#define	AE_SET_RDEV	8192
  ------------------
 1334|  7.84k|}
archive_entry_set_rdevmajor:
 1338|  4.99k|{
 1339|  4.99k|	entry->stat_valid = 0;
 1340|  4.99k|	entry->ae_stat.aest_rdev_is_broken_down = 1;
 1341|  4.99k|	entry->ae_stat.aest_rdev = 0;
 1342|  4.99k|	entry->ae_stat.aest_rdevmajor = m;
 1343|  4.99k|	entry->ae_set |= AE_SET_RDEV;
  ------------------
  |  |  152|  4.99k|#define	AE_SET_RDEV	8192
  ------------------
 1344|  4.99k|}
archive_entry_set_rdevminor:
 1348|  4.97k|{
 1349|  4.97k|	entry->stat_valid = 0;
 1350|  4.97k|	entry->ae_stat.aest_rdev_is_broken_down = 1;
 1351|  4.97k|	entry->ae_stat.aest_rdev = 0;
 1352|  4.97k|	entry->ae_stat.aest_rdevminor = m;
 1353|  4.97k|	entry->ae_set |= AE_SET_RDEV;
  ------------------
  |  |  152|  4.97k|#define	AE_SET_RDEV	8192
  ------------------
 1354|  4.97k|}
archive_entry_set_size:
 1358|   399k|{
 1359|   399k|	if (s < 0) {
  ------------------
  |  Branch (1359:6): [True: 234, False: 398k]
  ------------------
 1360|    234|		s = 0;
 1361|    234|	}
 1362|   399k|	entry->stat_valid = 0;
 1363|   399k|	entry->ae_stat.aest_size = s;
 1364|   399k|	entry->ae_set |= AE_SET_SIZE;
  ------------------
  |  |  145|   399k|#define	AE_SET_SIZE	64
  ------------------
 1365|   399k|}
archive_entry_unset_size:
 1369|    428|{
 1370|    428|	archive_entry_set_size(entry, 0);
 1371|    428|	entry->ae_set &= ~AE_SET_SIZE;
  ------------------
  |  |  145|    428|#define	AE_SET_SIZE	64
  ------------------
 1372|    428|}
archive_entry_set_symlink:
 1388|  5.84k|{
 1389|  5.84k|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|  5.84k|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1389:6): [True: 5.84k, False: 0]
  |  Branch (1389:26): [True: 0, False: 5.84k]
  ------------------
 1390|      0|		return;
 1391|  5.84k|	archive_mstring_copy_mbs(&entry->ae_linkname, linkname);
 1392|  5.84k|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|  5.84k|#define	AE_SET_HARDLINK	1
  ------------------
 1393|  5.84k|	if (linkname == NULL)
  ------------------
  |  Branch (1393:6): [True: 5.84k, False: 0]
  ------------------
 1394|  5.84k|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|  5.84k|#define	AE_SET_SYMLINK	2
  ------------------
 1395|      0|	else
 1396|      0|		entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
 1397|  5.84k|}
archive_entry_set_symlink_type:
 1401|  2.19k|{
 1402|  2.19k|	entry->ae_symlink_type = type;
 1403|  2.19k|}
archive_entry_copy_symlink:
 1420|  1.04k|{
 1421|  1.04k|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1421:6): [True: 0, False: 1.04k]
  |  Branch (1421:26): [True: 0, False: 0]
  ------------------
 1422|      0|		return;
 1423|  1.04k|	archive_mstring_copy_mbs(&entry->ae_linkname, linkname);
 1424|  1.04k|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|  1.04k|#define	AE_SET_HARDLINK	1
  ------------------
 1425|  1.04k|	if (linkname == NULL)
  ------------------
  |  Branch (1425:6): [True: 0, False: 1.04k]
  ------------------
 1426|      0|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
 1427|  1.04k|	else
 1428|  1.04k|		entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|  1.04k|#define	AE_SET_SYMLINK	2
  ------------------
 1429|  1.04k|}
archive_entry_copy_symlink_w:
 1433|     28|{
 1434|     28|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1434:6): [True: 0, False: 28]
  |  Branch (1434:26): [True: 0, False: 0]
  ------------------
 1435|      0|		return;
 1436|     28|	archive_mstring_copy_wcs(&entry->ae_linkname, linkname);
 1437|     28|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|     28|#define	AE_SET_HARDLINK	1
  ------------------
 1438|     28|	if (linkname == NULL)
  ------------------
  |  Branch (1438:6): [True: 0, False: 28]
  ------------------
 1439|      0|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
 1440|     28|	else
 1441|     28|		entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|     28|#define	AE_SET_SYMLINK	2
  ------------------
 1442|     28|}
archive_entry_update_symlink_utf8:
 1446|  2.18k|{
 1447|  2.18k|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1447:6): [True: 0, False: 2.18k]
  |  Branch (1447:26): [True: 0, False: 0]
  ------------------
 1448|      0|		return (0);
 1449|  2.18k|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|  2.18k|#define	AE_SET_HARDLINK	1
  ------------------
 1450|  2.18k|	if (linkname == NULL)
  ------------------
  |  Branch (1450:6): [True: 0, False: 2.18k]
  ------------------
 1451|      0|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|      0|#define	AE_SET_SYMLINK	2
  ------------------
 1452|  2.18k|	else
 1453|  2.18k|		entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|  2.18k|#define	AE_SET_SYMLINK	2
  ------------------
 1454|  2.18k|	if (archive_mstring_update_utf8(entry->archive,
  ------------------
  |  Branch (1454:6): [True: 762, False: 1.42k]
  ------------------
 1455|  2.18k|	    &entry->ae_linkname, linkname) == 0)
 1456|    762|		return (1);
 1457|  1.42k|	if (errno == ENOMEM)
  ------------------
  |  Branch (1457:6): [True: 0, False: 1.42k]
  ------------------
 1458|      0|		__archive_errx(1, "No memory");
 1459|  1.42k|	return (0);
 1460|  1.42k|}
__archive_entry_copy_symlink_l:
 1465|  2.59k|{
 1466|  2.59k|	int r;
 1467|       |
 1468|  2.59k|	if (linkname == NULL && (entry->ae_set & AE_SET_HARDLINK))
  ------------------
  |  |  139|      0|#define	AE_SET_HARDLINK	1
  ------------------
  |  Branch (1468:6): [True: 0, False: 2.59k]
  |  Branch (1468:26): [True: 0, False: 0]
  ------------------
 1469|      0|		return (0);
 1470|  2.59k|	entry->ae_set &= ~AE_SET_HARDLINK;
  ------------------
  |  |  139|  2.59k|#define	AE_SET_HARDLINK	1
  ------------------
 1471|  2.59k|	r = archive_mstring_copy_mbs_len_l(&entry->ae_linkname,
 1472|  2.59k|	    linkname, len, sc);
 1473|  2.59k|	if (linkname == NULL || r != 0)
  ------------------
  |  Branch (1473:6): [True: 0, False: 2.59k]
  |  Branch (1473:26): [True: 468, False: 2.12k]
  ------------------
 1474|    468|		entry->ae_set &= ~AE_SET_SYMLINK;
  ------------------
  |  |  140|    468|#define	AE_SET_SYMLINK	2
  ------------------
 1475|  2.12k|	else
 1476|  2.12k|		entry->ae_set |= AE_SET_SYMLINK;
  ------------------
  |  |  140|  2.12k|#define	AE_SET_SYMLINK	2
  ------------------
 1477|  2.59k|	return (r);
 1478|  2.59k|}
archive_entry_set_uid:
 1482|   338k|{
 1483|   338k|	if (u < 0) {
  ------------------
  |  Branch (1483:6): [True: 820, False: 337k]
  ------------------
 1484|    820|		u = 0;
 1485|    820|	}
 1486|   338k|	entry->stat_valid = 0;
 1487|   338k|	entry->ae_stat.aest_uid = u;
 1488|   338k|	entry->ae_set |= AE_SET_UID;
  ------------------
  |  |  150|   338k|#define	AE_SET_UID	2048
  ------------------
 1489|   338k|}
archive_entry_set_uname:
 1493|    501|{
 1494|    501|	archive_mstring_copy_mbs(&entry->ae_uname, name);
 1495|    501|}
archive_entry_copy_uname:
 1505|    268|{
 1506|    268|	archive_mstring_copy_mbs(&entry->ae_uname, name);
 1507|    268|}
archive_entry_set_is_data_encrypted:
 1528|  17.3k|{
 1529|  17.3k|	if (is_encrypted) {
  ------------------
  |  Branch (1529:6): [True: 17.3k, False: 0]
  ------------------
 1530|  17.3k|		entry->encryption |= AE_ENCRYPTION_DATA;
  ------------------
  |  |  169|  17.3k|#define AE_ENCRYPTION_DATA 1
  ------------------
 1531|  17.3k|	} else {
 1532|      0|		entry->encryption &= ~AE_ENCRYPTION_DATA;
  ------------------
  |  |  169|      0|#define AE_ENCRYPTION_DATA 1
  ------------------
 1533|      0|	}
 1534|  17.3k|}
archive_entry_set_is_metadata_encrypted:
 1538|     20|{
 1539|     20|	if (is_encrypted) {
  ------------------
  |  Branch (1539:6): [True: 20, False: 0]
  ------------------
 1540|     20|		entry->encryption |= AE_ENCRYPTION_METADATA;
  ------------------
  |  |  170|     20|#define AE_ENCRYPTION_METADATA 2
  ------------------
 1541|     20|	} else {
 1542|      0|		entry->encryption &= ~AE_ENCRYPTION_METADATA;
  ------------------
  |  |  170|      0|#define AE_ENCRYPTION_METADATA 2
  ------------------
 1543|      0|	}
 1544|     20|}
__archive_entry_copy_uname_l:
 1549|  3.28k|{
 1550|  3.28k|	return (archive_mstring_copy_mbs_len_l(&entry->ae_uname,
 1551|  3.28k|	    name, len, sc));
 1552|  3.28k|}
archive_entry_copy_mac_metadata:
 1564|   546k|{
 1565|   546k|	void *metadata;
 1566|       |
 1567|   546k|	if (p == NULL || s == 0) {
  ------------------
  |  Branch (1567:6): [True: 546k, False: 14]
  |  Branch (1567:19): [True: 11, False: 3]
  ------------------
 1568|   546k|		free(entry->mac_metadata);
 1569|   546k|		entry->mac_metadata = NULL;
 1570|   546k|		entry->mac_metadata_size = 0;
 1571|   546k|	} else {
 1572|      3|		metadata = malloc(s);
 1573|      3|		if (metadata == NULL)
  ------------------
  |  Branch (1573:7): [True: 0, False: 3]
  ------------------
 1574|      0|			abort();
 1575|      3|		memcpy(metadata, p, s);
 1576|      3|		free(entry->mac_metadata);
 1577|      3|		entry->mac_metadata = metadata;
 1578|      3|		entry->mac_metadata_size = s;
 1579|      3|	}
 1580|   546k|}
archive_entry_digest:
 1585|   399k|{
 1586|   399k|	switch (type) {
 1587|      0|	case ARCHIVE_ENTRY_DIGEST_MD5:
  ------------------
  |  |  444|      0|#define ARCHIVE_ENTRY_DIGEST_MD5              0x00000001
  ------------------
  |  Branch (1587:2): [True: 0, False: 399k]
  ------------------
 1588|      0|		return entry->digest.md5;
 1589|      0|	case ARCHIVE_ENTRY_DIGEST_RMD160:
  ------------------
  |  |  445|      0|#define ARCHIVE_ENTRY_DIGEST_RMD160           0x00000002
  ------------------
  |  Branch (1589:2): [True: 0, False: 399k]
  ------------------
 1590|      0|		return entry->digest.rmd160;
 1591|   399k|	case ARCHIVE_ENTRY_DIGEST_SHA1:
  ------------------
  |  |  446|   399k|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
  |  Branch (1591:2): [True: 399k, False: 0]
  ------------------
 1592|   399k|		return entry->digest.sha1;
 1593|      0|	case ARCHIVE_ENTRY_DIGEST_SHA256:
  ------------------
  |  |  447|      0|#define ARCHIVE_ENTRY_DIGEST_SHA256           0x00000004
  ------------------
  |  Branch (1593:2): [True: 0, False: 399k]
  ------------------
 1594|      0|		return entry->digest.sha256;
 1595|      0|	case ARCHIVE_ENTRY_DIGEST_SHA384:
  ------------------
  |  |  448|      0|#define ARCHIVE_ENTRY_DIGEST_SHA384           0x00000005
  ------------------
  |  Branch (1595:2): [True: 0, False: 399k]
  ------------------
 1596|      0|		return entry->digest.sha384;
 1597|      0|	case ARCHIVE_ENTRY_DIGEST_SHA512:
  ------------------
  |  |  449|      0|#define ARCHIVE_ENTRY_DIGEST_SHA512           0x00000006
  ------------------
  |  Branch (1597:2): [True: 0, False: 399k]
  ------------------
 1598|      0|		return entry->digest.sha512;
 1599|      0|	default:
  ------------------
  |  Branch (1599:2): [True: 0, False: 399k]
  ------------------
 1600|       |		return NULL;
 1601|   399k|	}
 1602|   399k|}
archive_entry_set_digest:
 1607|    958|{
 1608|    958|#define copy_digest(_e, _t, _d)\
 1609|    958|	memcpy(_e->digest._t, _d, sizeof(_e->digest._t))
 1610|       |
 1611|    958|	switch (type) {
 1612|    222|	case ARCHIVE_ENTRY_DIGEST_MD5:
  ------------------
  |  |  444|    222|#define ARCHIVE_ENTRY_DIGEST_MD5              0x00000001
  ------------------
  |  Branch (1612:2): [True: 222, False: 736]
  ------------------
 1613|    222|		copy_digest(entry, md5, digest);
  ------------------
  |  | 1609|    222|	memcpy(_e->digest._t, _d, sizeof(_e->digest._t))
  ------------------
 1614|    222|		entry->mset_digest |= AE_MSET_DIGEST_MD5;
  ------------------
  |  |  177|    222|#define AE_MSET_DIGEST_MD5	 1
  ------------------
 1615|    222|		break;
 1616|    170|	case ARCHIVE_ENTRY_DIGEST_RMD160:
  ------------------
  |  |  445|    170|#define ARCHIVE_ENTRY_DIGEST_RMD160           0x00000002
  ------------------
  |  Branch (1616:2): [True: 170, False: 788]
  ------------------
 1617|    170|		copy_digest(entry, rmd160, digest);
  ------------------
  |  | 1609|    170|	memcpy(_e->digest._t, _d, sizeof(_e->digest._t))
  ------------------
 1618|    170|		entry->mset_digest |= AE_MSET_DIGEST_RMD160;
  ------------------
  |  |  178|    170|#define AE_MSET_DIGEST_RMD160	 2
  ------------------
 1619|    170|		break;
 1620|    121|	case ARCHIVE_ENTRY_DIGEST_SHA1:
  ------------------
  |  |  446|    121|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
  |  Branch (1620:2): [True: 121, False: 837]
  ------------------
 1621|    121|		copy_digest(entry, sha1, digest);
  ------------------
  |  | 1609|    121|	memcpy(_e->digest._t, _d, sizeof(_e->digest._t))
  ------------------
 1622|    121|		entry->mset_digest |= AE_MSET_DIGEST_SHA1;
  ------------------
  |  |  179|    121|#define AE_MSET_DIGEST_SHA1	 4
  ------------------
 1623|    121|		break;
 1624|    220|	case ARCHIVE_ENTRY_DIGEST_SHA256:
  ------------------
  |  |  447|    220|#define ARCHIVE_ENTRY_DIGEST_SHA256           0x00000004
  ------------------
  |  Branch (1624:2): [True: 220, False: 738]
  ------------------
 1625|    220|		copy_digest(entry, sha256, digest);
  ------------------
  |  | 1609|    220|	memcpy(_e->digest._t, _d, sizeof(_e->digest._t))
  ------------------
 1626|    220|		entry->mset_digest |= AE_MSET_DIGEST_SHA256;
  ------------------
  |  |  180|    220|#define AE_MSET_DIGEST_SHA256	 8
  ------------------
 1627|    220|		break;
 1628|      0|	case ARCHIVE_ENTRY_DIGEST_SHA384:
  ------------------
  |  |  448|      0|#define ARCHIVE_ENTRY_DIGEST_SHA384           0x00000005
  ------------------
  |  Branch (1628:2): [True: 0, False: 958]
  ------------------
 1629|      0|		copy_digest(entry, sha384, digest);
  ------------------
  |  | 1609|      0|	memcpy(_e->digest._t, _d, sizeof(_e->digest._t))
  ------------------
 1630|      0|		entry->mset_digest |= AE_MSET_DIGEST_SHA384;
  ------------------
  |  |  181|      0|#define AE_MSET_DIGEST_SHA384	16
  ------------------
 1631|      0|		break;
 1632|    225|	case ARCHIVE_ENTRY_DIGEST_SHA512:
  ------------------
  |  |  449|    225|#define ARCHIVE_ENTRY_DIGEST_SHA512           0x00000006
  ------------------
  |  Branch (1632:2): [True: 225, False: 733]
  ------------------
 1633|    225|		copy_digest(entry, sha512, digest);
  ------------------
  |  | 1609|    225|	memcpy(_e->digest._t, _d, sizeof(_e->digest._t))
  ------------------
 1634|    225|		entry->mset_digest |= AE_MSET_DIGEST_SHA512;
  ------------------
  |  |  182|    225|#define AE_MSET_DIGEST_SHA512	32
  ------------------
 1635|    225|		break;
 1636|      0|	default:
  ------------------
  |  Branch (1636:2): [True: 0, False: 958]
  ------------------
 1637|      0|		return ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1638|    958|	}
 1639|       |
 1640|    958|	return ARCHIVE_OK;
  ------------------
  |  |  233|    958|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1641|    958|#undef copy_digest
 1642|    958|}
archive_entry_acl:
 1655|    621|{
 1656|    621|	return &entry->acl;
 1657|    621|}
archive_entry.c:ae_strtofflags:
 2149|  7.59k|{
 2150|  7.59k|	const char *start, *end;
 2151|  7.59k|	const struct flag *flag;
 2152|  7.59k|	unsigned long set, clear;
 2153|  7.59k|	const char *failed;
 2154|       |
 2155|  7.59k|	set = clear = 0;
 2156|  7.59k|	start = s;
 2157|  7.59k|	failed = NULL;
 2158|       |	/* Find start of first token. */
 2159|  9.93k|	while (l > 0 && (*start == '\t'  ||  *start == ' '  ||  *start == ',')) {
  ------------------
  |  Branch (2159:9): [True: 9.51k, False: 421]
  |  Branch (2159:19): [True: 141, False: 9.37k]
  |  Branch (2159:39): [True: 87, False: 9.28k]
  |  Branch (2159:58): [True: 2.10k, False: 7.17k]
  ------------------
 2160|  2.33k|		start++;
 2161|  2.33k|		l--;
 2162|  2.33k|	}
 2163|  18.6k|	while (l > 0) {
  ------------------
  |  Branch (2163:9): [True: 11.0k, False: 7.59k]
  ------------------
 2164|  11.0k|		size_t length;
 2165|       |		/* Locate end of token. */
 2166|  11.0k|		end = start;
 2167|  77.8k|		while (l > 0 && *end != '\t'  &&
  ------------------
  |  Branch (2167:10): [True: 70.9k, False: 6.91k]
  |  Branch (2167:19): [True: 70.8k, False: 49]
  ------------------
 2168|  70.8k|		    *end != ' '  &&  *end != ',') {
  ------------------
  |  Branch (2168:7): [True: 70.8k, False: 51]
  |  Branch (2168:24): [True: 66.8k, False: 4.00k]
  ------------------
 2169|  66.8k|			end++;
 2170|  66.8k|			l--;
 2171|  66.8k|		}
 2172|  11.0k|		length = end - start;
 2173|   219k|		for (flag = fileflags; flag->name != NULL; flag++) {
  ------------------
  |  Branch (2173:26): [True: 208k, False: 10.6k]
  ------------------
 2174|   208k|			size_t flag_length = strlen(flag->name);
 2175|   208k|			if (length == flag_length
  ------------------
  |  Branch (2175:8): [True: 40.6k, False: 168k]
  ------------------
 2176|  40.6k|			    && memcmp(start, flag->name, length) == 0) {
  ------------------
  |  Branch (2176:11): [True: 65, False: 40.5k]
  ------------------
 2177|       |				/* Matched "noXXXX", so reverse the sense. */
 2178|     65|				clear |= flag->set;
 2179|     65|				set |= flag->clear;
 2180|     65|				break;
 2181|   208k|			} else if (length == flag_length - 2
  ------------------
  |  Branch (2181:15): [True: 30.3k, False: 178k]
  ------------------
 2182|  30.3k|			    && memcmp(start, flag->name + 2, length) == 0) {
  ------------------
  |  Branch (2182:11): [True: 272, False: 30.1k]
  ------------------
 2183|       |				/* Matched "XXXX", so don't reverse. */
 2184|    272|				set |= flag->set;
 2185|    272|				clear |= flag->clear;
 2186|    272|				break;
 2187|    272|			}
 2188|   208k|		}
 2189|       |		/* Ignore unknown flag names. */
 2190|  11.0k|		if (flag->name == NULL  &&  failed == NULL)
  ------------------
  |  Branch (2190:7): [True: 10.6k, False: 337]
  |  Branch (2190:31): [True: 6.84k, False: 3.84k]
  ------------------
 2191|  6.84k|			failed = start;
 2192|       |
 2193|       |		/* Find start of next token. */
 2194|  11.0k|		start = end;
 2195|  16.4k|		while (l > 0 && (*start == '\t'  ||  *start == ' '  ||  *start == ',')) {
  ------------------
  |  Branch (2195:10): [True: 9.25k, False: 7.17k]
  |  Branch (2195:20): [True: 129, False: 9.12k]
  |  Branch (2195:40): [True: 130, False: 8.99k]
  |  Branch (2195:59): [True: 5.14k, False: 3.84k]
  ------------------
 2196|  5.40k|			start++;
 2197|  5.40k|			l--;
 2198|  5.40k|		}
 2199|       |
 2200|  11.0k|	}
 2201|       |
 2202|  7.59k|	if (setp)
  ------------------
  |  Branch (2202:6): [True: 7.59k, False: 0]
  ------------------
 2203|  7.59k|		*setp = set;
 2204|  7.59k|	if (clrp)
  ------------------
  |  Branch (2204:6): [True: 7.59k, False: 0]
  ------------------
 2205|  7.59k|		*clrp = clear;
 2206|       |
 2207|       |	/* Return location of first failure. */
 2208|  7.59k|	return (failed);
 2209|  7.59k|}

archive_entry_linkresolver_new:
  101|  1.11k|{
  102|  1.11k|	struct archive_entry_linkresolver *res;
  103|       |
  104|       |	/* Check for positive power-of-two */
  105|  1.11k|	if (links_cache_initial_size == 0 ||
  ------------------
  |  |   68|  1.11k|#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|  1.11k|	res = calloc(1, sizeof(struct archive_entry_linkresolver));
  110|  1.11k|	if (res == NULL)
  ------------------
  |  Branch (110:6): [True: 0, False: 1.11k]
  ------------------
  111|      0|		return (NULL);
  112|  1.11k|	res->number_buckets = links_cache_initial_size;
  ------------------
  |  |   68|  1.11k|#define	links_cache_initial_size 1024
  ------------------
  113|  1.11k|	res->buckets = calloc(res->number_buckets, sizeof(res->buckets[0]));
  114|  1.11k|	if (res->buckets == NULL) {
  ------------------
  |  Branch (114:6): [True: 0, False: 1.11k]
  ------------------
  115|      0|		free(res);
  116|      0|		return (NULL);
  117|      0|	}
  118|  1.11k|	return (res);
  119|  1.11k|}
archive_entry_linkresolver_set_strategy:
  124|  1.11k|{
  125|  1.11k|	int fmtbase = fmt & ARCHIVE_FORMAT_BASE_MASK;
  ------------------
  |  |  355|  1.11k|#define	ARCHIVE_FORMAT_BASE_MASK		0xff0000
  ------------------
  126|       |
  127|  1.11k|	switch (fmtbase) {
  128|      0|	case ARCHIVE_FORMAT_7ZIP:
  ------------------
  |  |  385|      0|#define	ARCHIVE_FORMAT_7ZIP			0xE0000
  ------------------
  |  Branch (128:2): [True: 0, False: 1.11k]
  ------------------
  129|      0|	case ARCHIVE_FORMAT_AR:
  ------------------
  |  |  376|      0|#define	ARCHIVE_FORMAT_AR			0x70000
  ------------------
  |  Branch (129:2): [True: 0, False: 1.11k]
  ------------------
  130|      0|	case ARCHIVE_FORMAT_ZIP:
  ------------------
  |  |  374|      0|#define	ARCHIVE_FORMAT_ZIP			0x50000
  ------------------
  |  Branch (130:2): [True: 0, False: 1.11k]
  ------------------
  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: 1.11k]
  ------------------
  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|  1.11k|	case ARCHIVE_FORMAT_MTREE:
  ------------------
  |  |  379|  1.11k|#define	ARCHIVE_FORMAT_MTREE			0x80000
  ------------------
  |  Branch (144:2): [True: 1.11k, False: 0]
  ------------------
  145|  1.11k|		res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_MTREE;
  ------------------
  |  |   63|  1.11k|#define ARCHIVE_ENTRY_LINKIFY_LIKE_MTREE 1
  ------------------
  146|  1.11k|		break;
  147|      0|	case ARCHIVE_FORMAT_ISO9660:
  ------------------
  |  |  372|      0|#define	ARCHIVE_FORMAT_ISO9660			0x40000
  ------------------
  |  Branch (147:2): [True: 0, False: 1.11k]
  ------------------
  148|      0|	case ARCHIVE_FORMAT_SHAR:
  ------------------
  |  |  364|      0|#define	ARCHIVE_FORMAT_SHAR			0x20000
  ------------------
  |  Branch (148:2): [True: 0, False: 1.11k]
  ------------------
  149|      0|	case ARCHIVE_FORMAT_TAR:
  ------------------
  |  |  367|      0|#define	ARCHIVE_FORMAT_TAR			0x30000
  ------------------
  |  Branch (149:2): [True: 0, False: 1.11k]
  ------------------
  150|      0|	case ARCHIVE_FORMAT_XAR:
  ------------------
  |  |  381|      0|#define	ARCHIVE_FORMAT_XAR			0xA0000
  ------------------
  |  Branch (150:2): [True: 0, False: 1.11k]
  ------------------
  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: 1.11k]
  ------------------
  154|      0|		res->strategy = ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO;
  ------------------
  |  |   64|      0|#define ARCHIVE_ENTRY_LINKIFY_LIKE_OLD_CPIO 2
  ------------------
  155|      0|		break;
  156|  1.11k|	}
  157|  1.11k|}
archive_entry_linkresolver_free:
  161|  16.7k|{
  162|  16.7k|	if (res == NULL)
  ------------------
  |  Branch (162:6): [True: 15.6k, False: 1.11k]
  ------------------
  163|  15.6k|		return;
  164|       |
  165|  1.11k|	while (next_entry(res, NEXT_ENTRY_ALL) != NULL) {
  ------------------
  |  |   89|  1.11k|#define	NEXT_ENTRY_ALL		(NEXT_ENTRY_DEFERRED | NEXT_ENTRY_PARTIAL)
  |  |  ------------------
  |  |  |  |   87|  1.11k|#define	NEXT_ENTRY_DEFERRED	1
  |  |  ------------------
  |  |               #define	NEXT_ENTRY_ALL		(NEXT_ENTRY_DEFERRED | NEXT_ENTRY_PARTIAL)
  |  |  ------------------
  |  |  |  |   88|  1.11k|#define	NEXT_ENTRY_PARTIAL	2
  |  |  ------------------
  ------------------
  |  Branch (165:9): [True: 0, False: 1.11k]
  ------------------
  166|       |		/* Actual freeing done by next_entry() */
  167|      0|	}
  168|  1.11k|	free(res->buckets);
  169|  1.11k|	free(res);
  170|  1.11k|}
archive_entry_link_resolver.c:next_entry:
  332|  1.11k|{
  333|  1.11k|	struct links_entry	*le;
  334|  1.11k|	size_t			 bucket;
  335|       |
  336|       |	/* Free a held entry. */
  337|  1.11k|	if (res->spare != NULL) {
  ------------------
  |  Branch (337:6): [True: 0, False: 1.11k]
  ------------------
  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|  1.14M|	for (bucket = 0; bucket < res->number_buckets; bucket++) {
  ------------------
  |  Branch (345:19): [True: 1.13M, False: 1.11k]
  ------------------
  346|  1.13M|		for (le = res->buckets[bucket]; le != NULL; le = le->next) {
  ------------------
  |  Branch (346:35): [True: 0, False: 1.13M]
  ------------------
  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|  1.13M|	}
  366|  1.11k|	return (NULL);
  367|  1.11k|}

archive_entry_sparse_clear:
   40|   546k|{
   41|   546k|	struct ae_sparse *sp;
   42|       |
   43|   546k|	while (entry->sparse_head != NULL) {
  ------------------
  |  Branch (43:9): [True: 100, False: 546k]
  ------------------
   44|    100|		sp = entry->sparse_head->next;
   45|    100|		free(entry->sparse_head);
   46|    100|		entry->sparse_head = sp;
   47|    100|	}
   48|   546k|	entry->sparse_tail = NULL;
   49|       |	entry->sparse_p = NULL;
   50|   546k|}
archive_entry_sparse_add_entry:
   55|  12.0k|{
   56|  12.0k|	struct ae_sparse *sp;
   57|       |
   58|  12.0k|	if (offset < 0 || length < 0)
  ------------------
  |  Branch (58:6): [True: 0, False: 12.0k]
  |  Branch (58:20): [True: 0, False: 12.0k]
  ------------------
   59|       |		/* Invalid value */
   60|      0|		return;
   61|  12.0k|	if (offset > INT64_MAX - length ||
  ------------------
  |  Branch (61:6): [True: 0, False: 12.0k]
  ------------------
   62|  12.0k|	    offset + length > archive_entry_size(entry))
  ------------------
  |  Branch (62:6): [True: 11.6k, False: 414]
  ------------------
   63|       |		/* A value of "length" parameter is too large. */
   64|  11.6k|		return;
   65|    414|	if ((sp = entry->sparse_tail) != NULL) {
  ------------------
  |  Branch (65:6): [True: 340, False: 74]
  ------------------
   66|    340|		if (sp->offset + sp->length > offset)
  ------------------
  |  Branch (66:7): [True: 310, False: 30]
  ------------------
   67|       |			/* Invalid value. */
   68|    310|			return;
   69|     30|		if (sp->offset + sp->length == offset) {
  ------------------
  |  Branch (69:7): [True: 4, False: 26]
  ------------------
   70|      4|			if (sp->offset + sp->length + length < 0)
  ------------------
  |  Branch (70:8): [True: 0, False: 4]
  ------------------
   71|       |				/* A value of "length" parameter is
   72|       |				 * too large. */
   73|      0|				return;
   74|       |			/* Expand existing sparse block size. */
   75|      4|			sp->length += length;
   76|      4|			return;
   77|      4|		}
   78|     30|	}
   79|       |
   80|    100|	if ((sp = malloc(sizeof(*sp))) == NULL)
  ------------------
  |  Branch (80:6): [True: 0, False: 100]
  ------------------
   81|       |		/* XXX Error XXX */
   82|      0|		return;
   83|       |
   84|    100|	sp->offset = offset;
   85|    100|	sp->length = length;
   86|    100|	sp->next = NULL;
   87|       |
   88|    100|	if (entry->sparse_head == NULL)
  ------------------
  |  Branch (88:6): [True: 74, False: 26]
  ------------------
   89|     74|		entry->sparse_head = entry->sparse_tail = sp;
   90|     26|	else {
   91|       |		/* Add a new sparse block to the tail of list. */
   92|     26|		if (entry->sparse_tail != NULL)
  ------------------
  |  Branch (92:7): [True: 26, False: 0]
  ------------------
   93|     26|			entry->sparse_tail->next = sp;
   94|     26|		entry->sparse_tail = sp;
   95|     26|	}
   96|    100|}
archive_entry_sparse_count:
  104|    181|{
  105|    181|	struct ae_sparse *sp;
  106|    181|	int count = 0;
  107|       |
  108|    281|	for (sp = entry->sparse_head; sp != NULL; sp = sp->next)
  ------------------
  |  Branch (108:32): [True: 100, False: 181]
  ------------------
  109|    100|		count++;
  110|       |
  111|       |	/*
  112|       |	 * Sanity check if this entry is exactly sparse.
  113|       |	 * If amount of sparse blocks is just one and it indicates the whole
  114|       |	 * file data, we should remove it and return zero.
  115|       |	 */
  116|    181|	if (count == 1) {
  ------------------
  |  Branch (116:6): [True: 61, False: 120]
  ------------------
  117|     61|		sp = entry->sparse_head;
  118|     61|		if (sp->offset == 0 &&
  ------------------
  |  Branch (118:7): [True: 51, False: 10]
  ------------------
  119|     51|		    sp->length >= archive_entry_size(entry)) {
  ------------------
  |  Branch (119:7): [True: 43, False: 8]
  ------------------
  120|     43|			count = 0;
  121|     43|			archive_entry_sparse_clear(entry);
  122|     43|		}
  123|     61|	}
  124|       |
  125|    181|	return (count);
  126|    181|}

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

archive_hmac.c:__hmac_sha1_init:
  224|  4.79k|{
  225|       |#if OPENSSL_VERSION_NUMBER >= 0x30000000L
  226|       |	EVP_MAC *mac;
  227|       |
  228|       |	char sha1[] = "SHA1";
  229|       |	OSSL_PARAM params[] = {
  230|       |		OSSL_PARAM_utf8_string("digest", sha1, sizeof(sha1) - 1),
  231|       |		OSSL_PARAM_END
  232|       |	};
  233|       |
  234|       |	mac = EVP_MAC_fetch(NULL, "HMAC", NULL);
  235|       |	*ctx = EVP_MAC_CTX_new(mac);
  236|       |	EVP_MAC_free(mac);
  237|       |	if (*ctx == NULL)
  238|       |		return -1;
  239|       |
  240|       |	EVP_MAC_init(*ctx, key, key_len, params);
  241|       |#else
  242|  4.79k|	*ctx = HMAC_CTX_new();
  243|  4.79k|	if (*ctx == NULL)
  ------------------
  |  Branch (243:6): [True: 0, False: 4.79k]
  ------------------
  244|      0|		return -1;
  245|  4.79k|	HMAC_Init_ex(*ctx, key, key_len, EVP_sha1(), NULL);
  246|  4.79k|#endif
  247|  4.79k|	return 0;
  248|  4.79k|}
archive_hmac.c:__hmac_sha1_update:
  253|   107k|{
  254|       |#if OPENSSL_VERSION_NUMBER >= 0x30000000L
  255|       |	EVP_MAC_update(*ctx, data, data_len);
  256|       |#else
  257|   107k|	HMAC_Update(*ctx, data, data_len);
  258|   107k|#endif
  259|   107k|}
archive_hmac.c:__hmac_sha1_final:
  263|  3.57k|{
  264|       |#if OPENSSL_VERSION_NUMBER >= 0x30000000L
  265|       |	size_t len = *out_len;
  266|       |#else
  267|  3.57k|	unsigned int len = (unsigned int)*out_len;
  268|  3.57k|#endif
  269|       |
  270|       |#if OPENSSL_VERSION_NUMBER >= 0x30000000L
  271|       |	EVP_MAC_final(*ctx, out, &len, *out_len);
  272|       |#else
  273|  3.57k|	HMAC_Final(*ctx, out, &len);
  274|  3.57k|#endif
  275|  3.57k|	*out_len = len;
  276|  3.57k|}
archive_hmac.c:__hmac_sha1_cleanup:
  280|  4.79k|{
  281|       |#if OPENSSL_VERSION_NUMBER >= 0x30000000L
  282|       |	EVP_MAC_CTX_free(*ctx);
  283|       |#else
  284|  4.79k|	HMAC_CTX_free(*ctx);
  285|  4.79k|#endif
  286|       |	*ctx = NULL;
  287|  4.79k|}

archive_read.c:archive_ckd_mul_size:
  187|  3.44k|{
  188|  3.44k|#if USE_STDCKDINT
  189|  3.44k|	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|  3.44k|}
archive_read_support_filter_lz4.c:archive_ckd_add_size:
  119|    540|{
  120|    540|#if USE_STDCKDINT
  121|    540|	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|    540|}
archive_read_support_filter_zstd.c:archive_ckd_add_size:
  119|    456|{
  120|    456|#if USE_STDCKDINT
  121|    456|	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|    456|}
archive_read_support_format_ar.c:archive_ckd_mul_u64:
  205|  18.5k|{
  206|  18.5k|#if USE_STDCKDINT
  207|  18.5k|	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|  18.5k|}
archive_read_support_format_ar.c:archive_ckd_add_u64:
  137|  18.5k|{
  138|  18.5k|#if USE_STDCKDINT
  139|  18.5k|	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|  18.5k|}
archive_read_support_format_mtree.c:archive_ckd_mul_i64:
  160|  78.3k|{
  161|  78.3k|#if USE_STDCKDINT
  162|  78.3k|	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|  78.3k|}
archive_read_support_format_mtree.c:archive_ckd_sub_i64:
  228|  41.9k|{
  229|  41.9k|#if USE_STDCKDINT
  230|  41.9k|	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|  41.9k|}
archive_read_support_format_mtree.c:archive_ckd_add_i64:
   94|  35.3k|{
   95|  35.3k|#if USE_STDCKDINT
   96|  35.3k|	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|  35.3k|}
archive_read_support_format_rar.c:archive_ckd_mul_size:
  187|  17.8k|{
  188|  17.8k|#if USE_STDCKDINT
  189|  17.8k|	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|  17.8k|}
archive_read_support_format_rar5.c:archive_ckd_mul_u64:
  205|   450k|{
  206|   450k|#if USE_STDCKDINT
  207|   450k|	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|   450k|}
archive_read_support_format_rar5.c:archive_ckd_add_u64:
  137|   448k|{
  138|   448k|#if USE_STDCKDINT
  139|   448k|	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|   448k|}
archive_read_support_format_raw.c:archive_ckd_add_i64:
   94|  24.0k|{
   95|  24.0k|#if USE_STDCKDINT
   96|  24.0k|	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|  24.0k|}
archive_read_support_format_tar.c:archive_ckd_mul_i64:
  160|  17.7M|{
  161|  17.7M|#if USE_STDCKDINT
  162|  17.7M|	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|  17.7M|}
archive_read_support_format_tar.c:archive_ckd_add_i64:
   94|  17.7M|{
   95|  17.7M|#if USE_STDCKDINT
   96|  17.7M|	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|  17.7M|}
archive_read_support_format_warc.c:archive_ckd_mul_i64:
  160|  27.1k|{
  161|  27.1k|#if USE_STDCKDINT
  162|  27.1k|	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.1k|}
archive_read_support_format_warc.c:archive_ckd_add_i64:
   94|  27.1k|{
   95|  27.1k|#if USE_STDCKDINT
   96|  27.1k|	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.1k|}
archive_read_support_format_xar.c:archive_ckd_mul_size:
  187|      8|{
  188|      8|#if USE_STDCKDINT
  189|      8|	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|      8|}
archive_read_support_format_xar.c:archive_ckd_mul_u64:
  205|   117k|{
  206|   117k|#if USE_STDCKDINT
  207|   117k|	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|   117k|}
archive_read_support_format_xar.c:archive_ckd_add_u64:
  137|   117k|{
  138|   117k|#if USE_STDCKDINT
  139|   117k|	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|   117k|}
archive_read_support_format_7zip.c:archive_ckd_add_i64:
   94|  23.5k|{
   95|  23.5k|#if USE_STDCKDINT
   96|  23.5k|	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|  23.5k|}
archive_read_support_format_7zip.c:archive_ckd_add_size:
  119|  8.08k|{
  120|  8.08k|#if USE_STDCKDINT
  121|  8.08k|	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|  8.08k|}
archive_read_support_format_7zip.c:archive_ckd_mul_i64:
  160|  8.81k|{
  161|  8.81k|#if USE_STDCKDINT
  162|  8.81k|	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|  8.81k|}

_archive_set_either_option:
   77|  50.1k|{
   78|  50.1k|	int r1, r2;
   79|       |
   80|  50.1k|	if (o == NULL && v == NULL)
  ------------------
  |  Branch (80:6): [True: 0, False: 50.1k]
  |  Branch (80:19): [True: 0, False: 0]
  ------------------
   81|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   82|  50.1k|	if (o == NULL)
  ------------------
  |  Branch (82:6): [True: 0, False: 50.1k]
  ------------------
   83|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
   84|       |
   85|  50.1k|	r1 = use_format_option(a, m, o, v);
   86|  50.1k|	if (r1 == ARCHIVE_FATAL)
  ------------------
  |  |  239|  50.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (86:6): [True: 0, False: 50.1k]
  ------------------
   87|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
   88|       |
   89|  50.1k|	r2 = use_filter_option(a, m, o, v);
   90|  50.1k|	if (r2 == ARCHIVE_FATAL)
  ------------------
  |  |  239|  50.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (90:6): [True: 0, False: 50.1k]
  ------------------
   91|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
   92|       |
   93|  50.1k|	if (r1 == ARCHIVE_WARN - 1)
  ------------------
  |  |  235|  50.1k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (93:6): [True: 0, False: 50.1k]
  ------------------
   94|      0|		return r2;
   95|  50.1k|	if (r2 == ARCHIVE_WARN -1)
  ------------------
  |  |  235|  50.1k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (95:6): [True: 50.1k, False: 0]
  ------------------
   96|  50.1k|		return r1;
   97|      0|	return r1 > r2 ? r1 : r2;
  ------------------
  |  Branch (97:9): [True: 0, False: 0]
  ------------------
   98|  50.1k|}
_archive_set_options:
  103|  16.7k|{
  104|  16.7k|	int allok = 1, anyok = 0, ignore_mod_err = 0, r;
  105|  16.7k|	char *data, *s;
  106|  16.7k|	const char *mod, *opt, *val;
  107|       |
  108|  16.7k|	archive_check_magic(a, magic, ARCHIVE_STATE_NEW, fn);
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
  109|       |
  110|  16.7k|	if (options == NULL || options[0] == '\0')
  ------------------
  |  Branch (110:6): [True: 0, False: 16.7k]
  |  Branch (110:25): [True: 0, False: 16.7k]
  ------------------
  111|      0|		return ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  112|       |
  113|  16.7k|	if ((data = strdup(options)) == NULL) {
  ------------------
  |  Branch (113:6): [True: 0, False: 16.7k]
  ------------------
  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|  16.7k|	s = data;
  119|       |
  120|  50.1k|	do {
  121|  50.1k|		mod = opt = val = NULL;
  122|       |
  123|  50.1k|		parse_option(&s, &mod, &opt, &val);
  124|  50.1k|		if (mod == NULL && opt != NULL &&
  ------------------
  |  Branch (124:7): [True: 0, False: 50.1k]
  |  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|  50.1k|		r = use_option(a, mod, opt, val);
  135|  50.1k|		if (r == ARCHIVE_FATAL) {
  ------------------
  |  |  239|  50.1k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (135:7): [True: 0, False: 50.1k]
  ------------------
  136|      0|			free(data);
  137|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  138|      0|		}
  139|  50.1k|		if (r == ARCHIVE_FAILED && mod != NULL) {
  ------------------
  |  |  237|   100k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (139:7): [True: 0, False: 50.1k]
  |  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|  50.1k|		if (r == ARCHIVE_WARN - 1) {
  ------------------
  |  |  235|  50.1k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (143:7): [True: 0, False: 50.1k]
  ------------------
  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|  50.1k|		if (r == ARCHIVE_WARN) {
  ------------------
  |  |  235|  50.1k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (152:7): [True: 0, False: 50.1k]
  ------------------
  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|  50.1k|		if (r == ARCHIVE_OK)
  ------------------
  |  |  233|  50.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (160:7): [True: 50.1k, False: 0]
  ------------------
  161|  50.1k|			anyok = 1;
  162|      0|		else
  163|      0|			allok = 0;
  164|  50.1k|	} while (s != NULL);
  ------------------
  |  Branch (164:11): [True: 33.4k, False: 16.7k]
  ------------------
  165|       |
  166|  16.7k|	free(data);
  167|  16.7k|	return allok ? ARCHIVE_OK : anyok ? ARCHIVE_WARN : ARCHIVE_FAILED;
  ------------------
  |  |  233|  16.7k|#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: 16.7k, False: 0]
  |  Branch (167:30): [True: 0, False: 0]
  ------------------
  168|  16.7k|}
archive_options.c:parse_option:
  172|  50.1k|{
  173|  50.1k|	const char *mod, *val;
  174|  50.1k|	char *end, *opt, *p;
  175|       |
  176|  50.1k|	end = NULL;
  177|  50.1k|	mod = NULL;
  178|  50.1k|	opt = *s;
  179|  50.1k|	val = "1";
  180|       |
  181|  50.1k|	p = strchr(opt, ',');
  182|       |
  183|  50.1k|	if (p != NULL) {
  ------------------
  |  Branch (183:6): [True: 33.4k, False: 16.7k]
  ------------------
  184|  33.4k|		*p = '\0';
  185|  33.4k|		end = p + 1;
  186|  33.4k|	}
  187|       |
  188|  50.1k|	if (0 == strlen(opt)) {
  ------------------
  |  Branch (188:6): [True: 0, False: 50.1k]
  ------------------
  189|      0|		*s = end;
  190|      0|		*m = NULL;
  191|      0|		*o = NULL;
  192|      0|		*v = NULL;
  193|      0|		return end;
  194|      0|	}
  195|       |
  196|  50.1k|	p = strchr(opt, ':');
  197|  50.1k|	if (p != NULL) {
  ------------------
  |  Branch (197:6): [True: 50.1k, False: 0]
  ------------------
  198|  50.1k|		*p = '\0';
  199|  50.1k|		mod = opt;
  200|  50.1k|		opt = ++p;
  201|  50.1k|	}
  202|       |
  203|  50.1k|	p = strchr(opt, '=');
  204|  50.1k|	if (p != NULL) {
  ------------------
  |  Branch (204:6): [True: 0, False: 50.1k]
  ------------------
  205|      0|		*p = '\0';
  206|      0|		val = ++p;
  207|  50.1k|	} else if (opt[0] == '!') {
  ------------------
  |  Branch (207:13): [True: 0, False: 50.1k]
  ------------------
  208|      0|		++opt;
  209|      0|		val = NULL;
  210|      0|	}
  211|       |
  212|  50.1k|	*s = end;
  213|  50.1k|	*m = mod;
  214|  50.1k|	*o = opt;
  215|  50.1k|	*v = val;
  216|       |
  217|  50.1k|	return end;
  218|  50.1k|}

__archive_pack_find:
  320|  11.1k|{
  321|  11.1k|	const struct format	*format;
  322|       |
  323|  11.1k|	format = bsearch(name, formats,
  324|  11.1k|	    sizeof(formats)/sizeof(formats[0]),
  325|  11.1k|	    sizeof(formats[0]), compare_format);
  326|  11.1k|	if (format == 0)
  ------------------
  |  Branch (326:6): [True: 668, False: 10.4k]
  ------------------
  327|    668|		return (NULL);
  328|  10.4k|	return (format->pack);
  329|  11.1k|}
archive_pack_dev.c:pack_8_8:
  167|    995|{
  168|    995|	dev_t dev = 0;
  169|       |
  170|    995|	if (n == 2) {
  ------------------
  |  Branch (170:6): [True: 768, False: 227]
  ------------------
  171|    768|		dev = makedev_8_8(numbers[0], numbers[1]);
  ------------------
  |  |  162|    768|#define	makedev_8_8(x,y)	((dev_t)((((x) << 8) & 0x0000ff00) | \
  |  |  163|    768|					 (((y) << 0) & 0x000000ff)))
  ------------------
  172|    768|		if ((unsigned long)major_8_8(dev) != numbers[0])
  ------------------
  |  |  160|    768|#define	major_8_8(x)		((int32_t)(((x) & 0x0000ff00) >> 8))
  ------------------
  |  Branch (172:7): [True: 358, False: 410]
  ------------------
  173|    358|			*error = iMajorError;
  174|    768|		if ((unsigned long)minor_8_8(dev) != numbers[1])
  ------------------
  |  |  161|    768|#define	minor_8_8(x)		((int32_t)(((x) & 0x000000ff) >> 0))
  ------------------
  |  Branch (174:7): [True: 136, False: 632]
  ------------------
  175|    136|			*error = iMinorError;
  176|    768|	} else
  177|    227|		*error = tooManyFields;
  178|    995|	return (dev);
  179|    995|}
archive_pack_dev.c:pack_bsdos:
  257|  2.00k|{
  258|  2.00k|	dev_t dev = 0;
  259|       |
  260|  2.00k|	if (n == 2) {
  ------------------
  |  Branch (260:6): [True: 902, False: 1.09k]
  ------------------
  261|    902|		dev = makedev_12_20(numbers[0], numbers[1]);
  ------------------
  |  |  184|    902|#define	makedev_12_20(x,y)	((dev_t)((((x) << 20) & 0xfff00000) | \
  |  |  185|    902|					 (((y) <<  0) & 0x000fffff)))
  ------------------
  262|    902|		if ((unsigned long)major_12_20(dev) != numbers[0])
  ------------------
  |  |  182|    902|#define	major_12_20(x)		((int32_t)(((x) & 0xfff00000) >> 20))
  ------------------
  |  Branch (262:7): [True: 410, False: 492]
  ------------------
  263|    410|			*error = iMajorError;
  264|    902|		if ((unsigned long)minor_12_20(dev) != numbers[1])
  ------------------
  |  |  183|    902|#define	minor_12_20(x)		((int32_t)(((x) & 0x000fffff) >>  0))
  ------------------
  |  Branch (264:7): [True: 565, False: 337]
  ------------------
  265|    565|			*error = iMinorError;
  266|  1.09k|	} else if (n == 3) {
  ------------------
  |  Branch (266:13): [True: 1.09k, False: 0]
  ------------------
  267|  1.09k|		dev = makedev_12_12_8(numbers[0], numbers[1], numbers[2]);
  ------------------
  |  |  251|  1.09k|#define	makedev_12_12_8(x,y,z)	((dev_t)((((x) << 20) & 0xfff00000) | \
  |  |  252|  1.09k|					 (((y) <<  8) & 0x000fff00) | \
  |  |  253|  1.09k|					 (((z) <<  0) & 0x000000ff)))
  ------------------
  268|  1.09k|		if ((unsigned long)major_12_12_8(dev) != numbers[0])
  ------------------
  |  |  248|  1.09k|#define	major_12_12_8(x)	((int32_t)(((x) & 0xfff00000) >> 20))
  ------------------
  |  Branch (268:7): [True: 558, False: 541]
  ------------------
  269|    558|			*error = iMajorError;
  270|  1.09k|		if ((unsigned long)unit_12_12_8(dev) != numbers[1])
  ------------------
  |  |  249|  1.09k|#define	unit_12_12_8(x)		((int32_t)(((x) & 0x000fff00) >>  8))
  ------------------
  |  Branch (270:7): [True: 683, False: 416]
  ------------------
  271|    683|			*error = "invalid unit number";
  272|  1.09k|		if ((unsigned long)subunit_12_12_8(dev) != numbers[2])
  ------------------
  |  |  250|  1.09k|#define	subunit_12_12_8(x)	((int32_t)(((x) & 0x000000ff) >>  0))
  ------------------
  |  Branch (272:7): [True: 406, False: 693]
  ------------------
  273|    406|			*error = "invalid subunit number";
  274|  1.09k|	} else
  275|      0|		*error = tooManyFields;
  276|  2.00k|	return (dev);
  277|  2.00k|}
archive_pack_dev.c:pack_8_24:
  233|  1.08k|{
  234|  1.08k|	dev_t dev = 0;
  235|       |
  236|  1.08k|	if (n == 2) {
  ------------------
  |  Branch (236:6): [True: 762, False: 325]
  ------------------
  237|    762|		dev = makedev_8_24(numbers[0], numbers[1]);
  ------------------
  |  |  228|    762|#define	makedev_8_24(x,y)	((dev_t)((((x) << 24) & 0xff000000) | \
  |  |  229|    762|					 (((y) <<  0) & 0x00ffffff)))
  ------------------
  238|    762|		if ((unsigned long)major_8_24(dev) != numbers[0])
  ------------------
  |  |  226|    762|#define	major_8_24(x)		((int32_t)(((x) & 0xff000000) >> 24))
  ------------------
  |  Branch (238:7): [True: 162, False: 600]
  ------------------
  239|    162|			*error = iMajorError;
  240|    762|		if ((unsigned long)minor_8_24(dev) != numbers[1])
  ------------------
  |  |  227|    762|#define	minor_8_24(x)		((int32_t)(((x) & 0x00ffffff) >>  0))
  ------------------
  |  Branch (240:7): [True: 272, False: 490]
  ------------------
  241|    272|			*error = iMinorError;
  242|    762|	} else
  243|    325|		*error = tooManyFields;
  244|  1.08k|	return (dev);
  245|  1.08k|}
archive_pack_dev.c:pack_native:
  106|  1.10k|{
  107|  1.10k|	dev_t dev = 0;
  108|       |
  109|  1.10k|	if (n == 2) {
  ------------------
  |  Branch (109:6): [True: 914, False: 191]
  ------------------
  110|    914|		dev = apd_makedev(numbers[0], numbers[1]);
  ------------------
  |  |   95|    914|#define apd_makedev(maj, min) makedev((maj), (min))
  ------------------
  111|    914|		if ((unsigned long)major(dev) != numbers[0])
  ------------------
  |  Branch (111:7): [True: 362, False: 552]
  ------------------
  112|    362|			*error = iMajorError;
  113|    552|		else if ((unsigned long)minor(dev) != numbers[1])
  ------------------
  |  Branch (113:12): [True: 386, False: 166]
  ------------------
  114|    386|			*error = iMinorError;
  115|    914|	} else
  116|    191|		*error = tooManyFields;
  117|  1.10k|	return (dev);
  118|  1.10k|}
archive_pack_dev.c:pack_netbsd:
  123|    702|{
  124|    702|	dev_t dev = 0;
  125|       |
  126|    702|	if (n == 2) {
  ------------------
  |  Branch (126:6): [True: 617, False: 85]
  ------------------
  127|    617|		dev = makedev_netbsd(numbers[0], numbers[1]);
  ------------------
  |  |   44|    617|#define	makedev_netbsd(x,y)	((dev_t)((((x) <<  8) & 0x000fff00) | \
  |  |   45|    617|					 (((y) << 12) & 0xfff00000) | \
  |  |   46|    617|					 (((y) <<  0) & 0x000000ff)))
  ------------------
  128|    617|		if ((unsigned long)major_netbsd(dev) != numbers[0])
  ------------------
  |  |   41|    617|#define	major_netbsd(x)		((int32_t)((((x) & 0x000fff00) >>  8)))
  ------------------
  |  Branch (128:7): [True: 183, False: 434]
  ------------------
  129|    183|			*error = iMajorError;
  130|    434|		else if ((unsigned long)minor_netbsd(dev) != numbers[1])
  ------------------
  |  |   42|    434|#define	minor_netbsd(x)		((int32_t)((((x) & 0xfff00000) >> 12) | \
  |  |   43|    434|					   (((x) & 0x000000ff) >>  0)))
  ------------------
  |  Branch (130:12): [True: 188, False: 246]
  ------------------
  131|    188|			*error = iMinorError;
  132|    617|	} else
  133|     85|		*error = tooManyFields;
  134|    702|	return (dev);
  135|    702|}
archive_pack_dev.c:pack_12_20:
  189|    844|{
  190|    844|	dev_t dev = 0;
  191|       |
  192|    844|	if (n == 2) {
  ------------------
  |  Branch (192:6): [True: 639, False: 205]
  ------------------
  193|    639|		dev = makedev_12_20(numbers[0], numbers[1]);
  ------------------
  |  |  184|    639|#define	makedev_12_20(x,y)	((dev_t)((((x) << 20) & 0xfff00000) | \
  |  |  185|    639|					 (((y) <<  0) & 0x000fffff)))
  ------------------
  194|    639|		if ((unsigned long)major_12_20(dev) != numbers[0])
  ------------------
  |  |  182|    639|#define	major_12_20(x)		((int32_t)(((x) & 0xfff00000) >> 20))
  ------------------
  |  Branch (194:7): [True: 202, False: 437]
  ------------------
  195|    202|			*error = iMajorError;
  196|    639|		if ((unsigned long)minor_12_20(dev) != numbers[1])
  ------------------
  |  |  183|    639|#define	minor_12_20(x)		((int32_t)(((x) & 0x000fffff) >>  0))
  ------------------
  |  Branch (196:7): [True: 288, False: 351]
  ------------------
  197|    288|			*error = iMinorError;
  198|    639|	} else
  199|    205|		*error = tooManyFields;
  200|    844|	return (dev);
  201|    844|}
archive_pack_dev.c:pack_14_18:
  211|    789|{
  212|    789|	dev_t dev = 0;
  213|       |
  214|    789|	if (n == 2) {
  ------------------
  |  Branch (214:6): [True: 487, False: 302]
  ------------------
  215|    487|		dev = makedev_14_18(numbers[0], numbers[1]);
  ------------------
  |  |  206|    487|#define	makedev_14_18(x,y)	((dev_t)((((x) << 18) & 0xfffc0000) | \
  |  |  207|    487|					 (((y) <<  0) & 0x0003ffff)))
  ------------------
  216|    487|		if ((unsigned long)major_14_18(dev) != numbers[0])
  ------------------
  |  |  204|    487|#define	major_14_18(x)		((int32_t)(((x) & 0xfffc0000) >> 18))
  ------------------
  |  Branch (216:7): [True: 222, False: 265]
  ------------------
  217|    222|			*error = iMajorError;
  218|    487|		if ((unsigned long)minor_14_18(dev) != numbers[1])
  ------------------
  |  |  205|    487|#define	minor_14_18(x)		((int32_t)(((x) & 0x0003ffff) >>  0))
  ------------------
  |  Branch (218:7): [True: 269, False: 218]
  ------------------
  219|    269|			*error = iMinorError;
  220|    487|	} else
  221|    302|		*error = tooManyFields;
  222|    789|	return (dev);
  223|    789|}
archive_pack_dev.c:compare_format:
  307|  34.4k|{
  308|  34.4k|	const char		*name;
  309|  34.4k|	const struct format	*format;
  310|       |
  311|  34.4k|	name = key;
  312|  34.4k|	format = element;
  313|       |
  314|  34.4k|	return (strcmp(name, format->name));
  315|  34.4k|}

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

archive_ppmd8.c:Ppmd8_Construct:
   65|  11.9k|{
   66|  11.9k|  unsigned i, k, m;
   67|       |
   68|  11.9k|  p->Base = 0;
   69|       |
   70|   464k|  for (i = 0, k = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|   464k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   464k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   464k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   464k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   464k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   464k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   464k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   464k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (70:22): [True: 452k, False: 11.9k]
  ------------------
   71|   452k|  {
   72|   452k|    unsigned step = (i >= 12 ? 4 : (i >> 2) + 1);
  ------------------
  |  Branch (72:22): [True: 309k, False: 142k]
  ------------------
   73|  1.52M|    do { p->Units2Indx[k++] = (Byte)i; } while (--step);
  ------------------
  |  Branch (73:49): [True: 1.07M, False: 452k]
  ------------------
   74|   452k|    p->Indx2Units[i] = (Byte)k;
   75|   452k|  }
   76|       |
   77|  11.9k|  p->NS2BSIndx[0] = (0 << 1);
   78|  11.9k|  p->NS2BSIndx[1] = (1 << 1);
   79|  11.9k|  memset(p->NS2BSIndx + 2, (2 << 1), 9);
   80|  11.9k|  memset(p->NS2BSIndx + 11, (3 << 1), 256 - 11);
   81|       |
   82|  71.4k|  for (i = 0; i < 5; i++)
  ------------------
  |  Branch (82:15): [True: 59.5k, False: 11.9k]
  ------------------
   83|  59.5k|    p->NS2Indx[i] = (Byte)i;
   84|  3.04M|  for (m = i, k = 1; i < 260; i++)
  ------------------
  |  Branch (84:22): [True: 3.03M, False: 11.9k]
  ------------------
   85|  3.03M|  {
   86|  3.03M|    p->NS2Indx[i] = (Byte)m;
   87|  3.03M|    if (--k == 0)
  ------------------
  |  Branch (87:9): [True: 261k, False: 2.77M]
  ------------------
   88|   261k|      k = (++m) - 4;
   89|  3.03M|  }
   90|  11.9k|}
archive_ppmd8.c:Ppmd8_Alloc:
  100|  10.7k|{
  101|  10.7k|  if (p->Base == 0 || p->Size != size)
  ------------------
  |  Branch (101:7): [True: 10.7k, False: 0]
  |  Branch (101:23): [True: 0, False: 0]
  ------------------
  102|  10.7k|  {
  103|  10.7k|    Ppmd8_Free(p);
  104|  10.7k|    p->AlignOffset =
  105|       |      #ifdef PPMD_32BIT
  106|       |        (4 - size) & 3;
  107|       |      #else
  108|  10.7k|        4 - (size & 3);
  109|  10.7k|      #endif
  110|  10.7k|    if ((p->Base = malloc(p->AlignOffset + size)) == 0)
  ------------------
  |  Branch (110:9): [True: 0, False: 10.7k]
  ------------------
  111|      0|      return False;
  ------------------
  |  |   56|      0|#define False 0
  ------------------
  112|  10.7k|    p->Size = size;
  113|  10.7k|  }
  114|  10.7k|  return True;
  ------------------
  |  |   55|  10.7k|#define True 1
  ------------------
  115|  10.7k|}
archive_ppmd8.c:Ppmd8_Free:
   93|  21.5k|{
   94|  21.5k|  free(p->Base);
   95|  21.5k|  p->Size = 0;
   96|  21.5k|  p->Base = 0;
   97|  21.5k|}
archive_ppmd8.c:Ppmd8_Init:
  411|  10.7k|{
  412|  10.7k|  p->MaxOrder = maxOrder;
  413|  10.7k|  p->RestoreMethod = restoreMethod;
  414|  10.7k|  RestartModel(p);
  415|  10.7k|  p->DummySee.Shift = PPMD_PERIOD_BITS;
  ------------------
  |  |   90|  10.7k|#define PPMD_PERIOD_BITS 7
  ------------------
  416|  10.7k|  p->DummySee.Summ = 0; /* unused */
  417|  10.7k|  p->DummySee.Count = 64; /* unused */
  418|  10.7k|}
archive_ppmd8.c:RestartModel:
  354|  10.8k|{
  355|  10.8k|  unsigned i, k, m, r;
  356|       |
  357|  10.8k|  memset(p->FreeList, 0, sizeof(p->FreeList));
  358|  10.8k|  memset(p->Stamps, 0, sizeof(p->Stamps));
  359|  10.8k|  RESET_TEXT(0);
  ------------------
  |  |  349|  10.8k|#define RESET_TEXT(offs) do {						\
  |  |  350|  10.8k|	p->Text = p->Base + p->AlignOffset + (offs);			\
  |  |  351|  10.8k|} while (0)
  |  |  ------------------
  |  |  |  Branch (351:10): [Folded, False: 10.8k]
  |  |  ------------------
  ------------------
  360|  10.8k|  p->HiUnit = p->Text + p->Size;
  361|  10.8k|  p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   15|  10.8k|#define UNIT_SIZE 12
  ------------------
                p->LoUnit = p->UnitsStart = p->HiUnit - p->Size / 8 / UNIT_SIZE * 7 * UNIT_SIZE;
  ------------------
  |  |   15|  10.8k|#define UNIT_SIZE 12
  ------------------
  362|  10.8k|  p->GlueCount = 0;
  363|       |
  364|  10.8k|  p->OrderFall = p->MaxOrder;
  365|  10.8k|  p->RunLength = p->InitRL = -(Int32)((p->MaxOrder < 12) ? p->MaxOrder : 12) - 1;
  ------------------
  |  Branch (365:39): [True: 7.05k, False: 3.79k]
  ------------------
  366|  10.8k|  p->PrevSuccess = 0;
  367|       |
  368|  10.8k|  p->MinContext = p->MaxContext = (CTX_PTR)(p->HiUnit -= UNIT_SIZE); /* AllocContext(p); */
  ------------------
  |  |   15|  10.8k|#define UNIT_SIZE 12
  ------------------
  369|  10.8k|  p->MinContext->Suffix = 0;
  370|  10.8k|  p->MinContext->NumStats = 255;
  371|  10.8k|  p->MinContext->Flags = 0;
  372|  10.8k|  p->MinContext->SummFreq = 256 + 1;
  373|  10.8k|  p->FoundState = (CPpmd_State *)p->LoUnit; /* AllocUnits(p, PPMD_NUM_INDEXES - 1); */
  374|  10.8k|  p->LoUnit += U2B(256 / 2);
  ------------------
  |  |   17|  10.8k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  10.8k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  375|  10.8k|  p->MinContext->Stats = REF(p->FoundState);
  ------------------
  |  |   24|  10.8k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  376|  2.78M|  for (i = 0; i < 256; i++)
  ------------------
  |  Branch (376:15): [True: 2.77M, False: 10.8k]
  ------------------
  377|  2.77M|  {
  378|  2.77M|    CPpmd_State *s = &p->FoundState[i];
  379|  2.77M|    s->Symbol = (Byte)i;
  380|  2.77M|    s->Freq = 1;
  381|  2.77M|    SetSuccessor(s, 0);
  382|  2.77M|  }
  383|       |
  384|   282k|  for (i = m = 0; m < 25; m++)
  ------------------
  |  Branch (384:19): [True: 271k, False: 10.8k]
  ------------------
  385|   271k|  {
  386|  2.60M|    while (p->NS2Indx[i] == m)
  ------------------
  |  Branch (386:12): [True: 2.33M, False: 271k]
  ------------------
  387|  2.33M|      i++;
  388|  2.44M|    for (k = 0; k < 8; k++)
  ------------------
  |  Branch (388:17): [True: 2.17M, False: 271k]
  ------------------
  389|  2.17M|    {
  390|  2.17M|      UInt16 val = (UInt16)(PPMD_BIN_SCALE - kInitBinEsc[k] / (i + 1));
  ------------------
  |  |   91|  2.17M|#define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   89|  2.17M|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_BIN_SCALE (1 << (PPMD_INT_BITS + PPMD_PERIOD_BITS))
  |  |  ------------------
  |  |  |  |   90|  2.17M|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  ------------------
  391|  2.17M|      UInt16 *dest = p->BinSumm[m] + k;
  392|  19.5M|      for (r = 0; r < 64; r += 8)
  ------------------
  |  Branch (392:19): [True: 17.3M, False: 2.17M]
  ------------------
  393|  17.3M|        dest[r] = val;
  394|  2.17M|    }
  395|   271k|  }
  396|       |
  397|   271k|  for (i = m = 0; m < 24; m++)
  ------------------
  |  Branch (397:19): [True: 260k, False: 10.8k]
  ------------------
  398|   260k|  {
  399|  3.02M|    while (p->NS2Indx[i + 3] == m + 3)
  ------------------
  |  Branch (399:12): [True: 2.76M, False: 260k]
  ------------------
  400|  2.76M|      i++;
  401|  8.59M|    for (k = 0; k < 32; k++)
  ------------------
  |  Branch (401:17): [True: 8.33M, False: 260k]
  ------------------
  402|  8.33M|    {
  403|  8.33M|      CPpmd_See *s = &p->See[m][k];
  404|  8.33M|      s->Summ = (UInt16)((2 * i + 5) << (s->Shift = PPMD_PERIOD_BITS - 4));
  ------------------
  |  |   90|  8.33M|#define PPMD_PERIOD_BITS 7
  ------------------
  405|  8.33M|      s->Count = 7;
  406|  8.33M|    }
  407|   260k|  }
  408|  10.8k|}
archive_ppmd8.c:SetSuccessor:
  344|   302M|{
  345|   302M|  (p)->SuccessorLow = (UInt16)((UInt32)(v) & 0xFFFF);
  346|   302M|  (p)->SuccessorHigh = (UInt16)(((UInt32)(v) >> 16) & 0xFFFF);
  347|   302M|}
archive_ppmd8.c:Ppmd8_RangeDec_Init:
 1131|  10.7k|{
 1132|  10.7k|  unsigned i;
 1133|  10.7k|  p->Low = 0;
 1134|  10.7k|  p->Range = 0xFFFFFFFF;
 1135|  10.7k|  p->Code = 0;
 1136|  53.9k|  for (i = 0; i < 4; i++)
  ------------------
  |  Branch (1136:15): [True: 43.1k, False: 10.7k]
  ------------------
 1137|  43.1k|    p->Code = (p->Code << 8) | p->Stream.In->Read(p->Stream.In);
 1138|  10.7k|  return (p->Code < 0xFFFFFFFF);
 1139|  10.7k|}
archive_ppmd8.c:Ppmd8_DecodeSymbol:
 1165|   115M|{
 1166|   115M|  size_t charMask[256 / sizeof(size_t)];
 1167|   115M|  if (p->MinContext->NumStats != 0)
  ------------------
  |  Branch (1167:7): [True: 15.1M, False: 100M]
  ------------------
 1168|  15.1M|  {
 1169|  15.1M|    CPpmd_State *s = Ppmd8_GetStats(p, p->MinContext);
  ------------------
  |  |   98|  15.1M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  ------------------
  |  |  |  |   96|  15.1M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1170|  15.1M|    unsigned i;
 1171|  15.1M|    UInt32 count, hiCnt;
 1172|  15.1M|    if ((count = RangeDec_GetThreshold(p, p->MinContext->SummFreq)) < (hiCnt = s->Freq))
  ------------------
  |  Branch (1172:9): [True: 5.74M, False: 9.40M]
  ------------------
 1173|  5.74M|    {
 1174|  5.74M|      Byte symbol;
 1175|  5.74M|      RangeDec_Decode(p, 0, s->Freq);
 1176|  5.74M|      p->FoundState = s;
 1177|  5.74M|      symbol = s->Symbol;
 1178|  5.74M|      Ppmd8_Update1_0(p);
 1179|  5.74M|      return symbol;
 1180|  5.74M|    }
 1181|  9.40M|    p->PrevSuccess = 0;
 1182|  9.40M|    i = p->MinContext->NumStats;
 1183|  9.40M|    do
 1184|  69.8M|    {
 1185|  69.8M|      if ((hiCnt += (++s)->Freq) > count)
  ------------------
  |  Branch (1185:11): [True: 5.46M, False: 64.4M]
  ------------------
 1186|  5.46M|      {
 1187|  5.46M|        Byte symbol;
 1188|  5.46M|        RangeDec_Decode(p, hiCnt - s->Freq, s->Freq);
 1189|  5.46M|        p->FoundState = s;
 1190|  5.46M|        symbol = s->Symbol;
 1191|  5.46M|        Ppmd8_Update1(p);
 1192|  5.46M|        return symbol;
 1193|  5.46M|      }
 1194|  69.8M|    }
 1195|  64.4M|    while (--i);
  ------------------
  |  Branch (1195:12): [True: 60.4M, False: 3.94M]
  ------------------
 1196|  3.94M|    if (count >= p->MinContext->SummFreq)
  ------------------
  |  Branch (1196:9): [True: 4.88k, False: 3.93M]
  ------------------
 1197|  4.88k|      return -2;
 1198|  3.93M|    RangeDec_Decode(p, hiCnt, p->MinContext->SummFreq - hiCnt);
 1199|  3.93M|    PPMD_SetAllBitsIn256Bytes(charMask);
  ------------------
  |  |  151|  3.93M|#define PPMD_SetAllBitsIn256Bytes(p) do {				\
  |  |  152|  3.93M|	unsigned j;							\
  |  |  153|  19.6M|	for (j = 0; j < 256 / sizeof(p[0]); j += 8) {			\
  |  |  ------------------
  |  |  |  Branch (153:14): [True: 15.7M, False: 3.93M]
  |  |  ------------------
  |  |  154|  15.7M|		p[j+7] = p[j+6] = p[j+5] = p[j+4] =			\
  |  |  155|  15.7M|		    p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0;	\
  |  |  156|  15.7M|	}								\
  |  |  157|  3.93M|} while (0)
  |  |  ------------------
  |  |  |  Branch (157:10): [Folded, False: 3.93M]
  |  |  ------------------
  ------------------
 1200|  3.93M|    MASK(s->Symbol) = 0;
  ------------------
  |  | 1162|  3.93M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1201|  3.93M|    i = p->MinContext->NumStats;
 1202|  12.0M|    do { MASK((--s)->Symbol) = 0; } while (--i);
  ------------------
  |  | 1162|  12.0M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  |  Branch (1202:44): [True: 8.10M, False: 3.93M]
  ------------------
 1203|  3.93M|  }
 1204|   100M|  else
 1205|   100M|  {
 1206|   100M|    UInt16 *prob = Ppmd8_GetBinSumm(p);
  ------------------
  |  |  102|   100M|    &p->BinSumm[p->NS2Indx[Ppmd8Context_OneState(p->MinContext)->Freq - 1]][ \
  |  |  ------------------
  |  |  |  |   38|   100M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  |  |  103|   100M|    p->NS2BSIndx[Ppmd8_GetContext(p, p->MinContext->Suffix)->NumStats] + \
  |  |  ------------------
  |  |  |  |   97|   100M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|   100M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  104|   100M|    p->PrevSuccess + p->MinContext->Flags + ((p->RunLength >> 26) & 0x20)]
  ------------------
 1207|   100M|    if (((p->Code / (p->Range >>= 14)) < *prob))
  ------------------
  |  Branch (1207:9): [True: 93.7M, False: 6.53M]
  ------------------
 1208|  93.7M|    {
 1209|  93.7M|      Byte symbol;
 1210|  93.7M|      RangeDec_Decode(p, 0, *prob);
 1211|  93.7M|      *prob = (UInt16)PPMD_UPDATE_PROB_0(*prob);
  ------------------
  |  |   95|  93.7M|#define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   89|  93.7M|#define PPMD_INT_BITS 7
  |  |  ------------------
  |  |               #define PPMD_UPDATE_PROB_0(prob) ((prob) + (1 << PPMD_INT_BITS) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   94|  93.7M|#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  93.7M|#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1212|  93.7M|      symbol = (p->FoundState = Ppmd8Context_OneState(p->MinContext))->Symbol;
  ------------------
  |  |   38|  93.7M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  ------------------
 1213|  93.7M|      Ppmd8_UpdateBin(p);
 1214|  93.7M|      return symbol;
 1215|  93.7M|    }
 1216|  6.53M|    RangeDec_Decode(p, *prob, (1 << 14) - *prob);
 1217|  6.53M|    *prob = (UInt16)PPMD_UPDATE_PROB_1(*prob);
  ------------------
  |  |   96|  6.53M|#define PPMD_UPDATE_PROB_1(prob) ((prob) - PPMD_GET_MEAN(prob))
  |  |  ------------------
  |  |  |  |   94|  6.53M|#define PPMD_GET_MEAN(summ) PPMD_GET_MEAN_SPEC((summ), PPMD_PERIOD_BITS, 2)
  |  |  |  |  ------------------
  |  |  |  |  |  |   93|  6.53M|#define PPMD_GET_MEAN_SPEC(summ, shift, round) (((summ) + (1 << ((shift) - (round)))) >> (shift))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1218|  6.53M|    p->InitEsc = PPMD8_kExpEscape[*prob >> 10];
 1219|  6.53M|    PPMD_SetAllBitsIn256Bytes(charMask);
  ------------------
  |  |  151|  6.53M|#define PPMD_SetAllBitsIn256Bytes(p) do {				\
  |  |  152|  6.53M|	unsigned j;							\
  |  |  153|  32.6M|	for (j = 0; j < 256 / sizeof(p[0]); j += 8) {			\
  |  |  ------------------
  |  |  |  Branch (153:14): [True: 26.1M, False: 6.53M]
  |  |  ------------------
  |  |  154|  26.1M|		p[j+7] = p[j+6] = p[j+5] = p[j+4] =			\
  |  |  155|  26.1M|		    p[j+3] = p[j+2] = p[j+1] = p[j+0] = ~(size_t)0;	\
  |  |  156|  26.1M|	}								\
  |  |  157|  6.53M|} while (0)
  |  |  ------------------
  |  |  |  Branch (157:10): [Folded, False: 6.53M]
  |  |  ------------------
  ------------------
 1220|  6.53M|    MASK(Ppmd8Context_OneState(p->MinContext)->Symbol) = 0;
  ------------------
  |  | 1162|  6.53M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1221|  6.53M|    p->PrevSuccess = 0;
 1222|  6.53M|  }
 1223|  10.4M|  for (;;)
 1224|  14.8M|  {
 1225|  14.8M|    CPpmd_State *ps[256], *s;
 1226|  14.8M|    UInt32 freqSum, count, hiCnt;
 1227|  14.8M|    CPpmd_See *see;
 1228|  14.8M|    unsigned i, num, numMasked = p->MinContext->NumStats;
 1229|  14.8M|    do
 1230|  41.3M|    {
 1231|  41.3M|      p->OrderFall++;
 1232|  41.3M|      if (!p->MinContext->Suffix)
  ------------------
  |  Branch (1232:11): [True: 1.01k, False: 41.3M]
  ------------------
 1233|  1.01k|        return -1;
 1234|  41.3M|      p->MinContext = Ppmd8_GetContext(p, p->MinContext->Suffix);
  ------------------
  |  |   97|  41.3M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  ------------------
  |  |  |  |   96|  41.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1235|  41.3M|    }
 1236|  41.3M|    while (p->MinContext->NumStats == numMasked);
  ------------------
  |  Branch (1236:12): [True: 26.5M, False: 14.8M]
  ------------------
 1237|  14.8M|    hiCnt = 0;
 1238|  14.8M|    s = Ppmd8_GetStats(p, p->MinContext);
  ------------------
  |  |   98|  14.8M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  ------------------
  |  |  |  |   96|  14.8M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  ------------------
  ------------------
 1239|  14.8M|    i = 0;
 1240|  14.8M|    num = p->MinContext->NumStats - numMasked;
 1241|  14.8M|    do
 1242|   619M|    {
 1243|   619M|      int k = (int)(MASK(s->Symbol));
  ------------------
  |  | 1162|   619M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
 1244|   619M|      hiCnt += (s->Freq & k);
 1245|   619M|      ps[i] = s++;
 1246|   619M|      i -= k;
 1247|   619M|    }
 1248|   619M|    while (i != num);
  ------------------
  |  Branch (1248:12): [True: 604M, False: 14.8M]
  ------------------
 1249|       |    
 1250|  14.8M|    see = Ppmd8_MakeEscFreq(p, numMasked, &freqSum);
 1251|  14.8M|    freqSum += hiCnt;
 1252|  14.8M|    count = RangeDec_GetThreshold(p, freqSum);
 1253|       |    
 1254|  14.8M|    if (count < hiCnt)
  ------------------
  |  Branch (1254:9): [True: 10.4M, False: 4.33M]
  ------------------
 1255|  10.4M|    {
 1256|  10.4M|      Byte symbol;
 1257|  10.4M|      CPpmd_State **pps = ps;
 1258|   168M|      for (hiCnt = 0; (hiCnt += (*pps)->Freq) <= count; pps++);
  ------------------
  |  Branch (1258:23): [True: 158M, False: 10.4M]
  ------------------
 1259|  10.4M|      s = *pps;
 1260|  10.4M|      RangeDec_Decode(p, hiCnt - s->Freq, s->Freq);
 1261|  10.4M|      Ppmd_See_Update(see);
  ------------------
  |  |  112|  10.4M|#define Ppmd_See_Update(p) do {						\
  |  |  113|  10.4M|	if ((p)->Shift < PPMD_PERIOD_BITS && --(p)->Count == 0) {	\
  |  |  ------------------
  |  |  |  |   90|  20.9M|#define PPMD_PERIOD_BITS 7
  |  |  ------------------
  |  |  |  Branch (113:6): [True: 6.57M, False: 3.89M]
  |  |  |  Branch (113:39): [True: 205k, False: 6.36M]
  |  |  ------------------
  |  |  114|   205k|		(p)->Summ <<= 1;					\
  |  |  115|   205k|		(p)->Count = (Byte)(3 << (p)->Shift++);			\
  |  |  116|   205k|    	}								\
  |  |  117|  10.4M|} while (0)
  |  |  ------------------
  |  |  |  Branch (117:10): [Folded, False: 10.4M]
  |  |  ------------------
  ------------------
 1262|  10.4M|      p->FoundState = s;
 1263|  10.4M|      symbol = s->Symbol;
 1264|  10.4M|      Ppmd8_Update2(p);
 1265|  10.4M|      return symbol;
 1266|  10.4M|    }
 1267|  4.33M|    if (count >= freqSum)
  ------------------
  |  Branch (1267:9): [True: 4.37k, False: 4.33M]
  ------------------
 1268|  4.37k|      return -2;
 1269|  4.33M|    RangeDec_Decode(p, hiCnt, freqSum - hiCnt);
 1270|  4.33M|    see->Summ = (UInt16)(see->Summ + freqSum);
 1271|  13.4M|    do { MASK(ps[--i]->Symbol) = 0; } while (i != 0);
  ------------------
  |  | 1162|  13.4M|#define MASK(sym) ((signed char *)charMask)[sym]
  ------------------
  |  Branch (1271:46): [True: 9.07M, False: 4.33M]
  ------------------
 1272|  4.33M|  }
 1273|  10.4M|}
archive_ppmd8.c:RangeDec_GetThreshold:
 1142|  29.9M|{
 1143|  29.9M|  return p->Code / (p->Range /= total);
 1144|  29.9M|}
archive_ppmd8.c:RangeDec_Decode:
 1147|   130M|{
 1148|   130M|  start *= p->Range;
 1149|   130M|  p->Low += start;
 1150|   130M|  p->Code -= start;
 1151|   130M|  p->Range *= size;
 1152|       |
 1153|   141M|  while ((p->Low ^ (p->Low + p->Range)) < kTop ||
  ------------------
  |  |   34|   282M|#define kTop (1 << 24)
  ------------------
  |  Branch (1153:10): [True: 10.9M, False: 130M]
  ------------------
 1154|   130M|      (p->Range < kBot && ((p->Range = (0 - p->Low) & (kBot - 1)), 1)))
  ------------------
  |  |   35|   260M|#define kBot (1 << 15)
  ------------------
                    (p->Range < kBot && ((p->Range = (0 - p->Low) & (kBot - 1)), 1)))
  ------------------
  |  |   35|  11.1k|#define kBot (1 << 15)
  ------------------
  |  Branch (1154:8): [True: 11.1k, False: 130M]
  |  Branch (1154:27): [True: 11.1k, False: 0]
  ------------------
 1155|  10.9M|  {
 1156|  10.9M|    p->Code = (p->Code << 8) | p->Stream.In->Read(p->Stream.In);
 1157|  10.9M|    p->Range <<= 8;
 1158|  10.9M|    p->Low <<= 8;
 1159|  10.9M|  }
 1160|   130M|}
archive_ppmd8.c:Ppmd8_Update1_0:
 1097|  5.74M|{
 1098|  5.74M|  p->PrevSuccess = (2 * p->FoundState->Freq >= p->MinContext->SummFreq);
 1099|  5.74M|  p->RunLength += p->PrevSuccess;
 1100|  5.74M|  p->MinContext->SummFreq += 4;
 1101|  5.74M|  if ((p->FoundState->Freq += 4) > MAX_FREQ)
  ------------------
  |  |   14|  5.74M|#define MAX_FREQ 124
  ------------------
  |  Branch (1101:7): [True: 48.9k, False: 5.69M]
  ------------------
 1102|  48.9k|    Rescale(p);
 1103|  5.74M|  NextContext(p);
 1104|  5.74M|}
archive_ppmd8.c:Rescale:
  975|  62.8k|{
  976|  62.8k|  unsigned i, adder, sumFreq, escFreq;
  977|  62.8k|  CPpmd_State *stats = STATS(p->MinContext);
  ------------------
  |  |   30|  62.8k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  62.8k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  62.8k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  978|  62.8k|  CPpmd_State *s = p->FoundState;
  979|  62.8k|  {
  980|  62.8k|    CPpmd_State tmp = *s;
  981|   190k|    for (; s != stats; s--)
  ------------------
  |  Branch (981:12): [True: 127k, False: 62.8k]
  ------------------
  982|   127k|      s[0] = s[-1];
  983|  62.8k|    *s = tmp;
  984|  62.8k|  }
  985|  62.8k|  escFreq = p->MinContext->SummFreq - s->Freq;
  986|  62.8k|  s->Freq += 4;
  987|  62.8k|  adder = (p->OrderFall != 0
  988|       |      #ifdef PPMD8_FREEZE_SUPPORT
  989|       |      || p->RestoreMethod > PPMD8_RESTORE_METHOD_FREEZE
  990|       |      #endif
  991|  62.8k|      );
  992|  62.8k|  s->Freq = (Byte)((s->Freq + adder) >> 1);
  993|  62.8k|  sumFreq = s->Freq;
  994|       |  
  995|  62.8k|  i = p->MinContext->NumStats;
  996|  62.8k|  do
  997|  2.39M|  {
  998|  2.39M|    escFreq -= (++s)->Freq;
  999|  2.39M|    s->Freq = (Byte)((s->Freq + adder) >> 1);
 1000|  2.39M|    sumFreq += s->Freq;
 1001|  2.39M|    if (s[0].Freq > s[-1].Freq)
  ------------------
  |  Branch (1001:9): [True: 725k, False: 1.66M]
  ------------------
 1002|   725k|    {
 1003|   725k|      CPpmd_State *s1 = s;
 1004|   725k|      CPpmd_State tmp = *s1;
 1005|   725k|      do
 1006|  32.4M|        s1[0] = s1[-1];
 1007|  32.4M|      while (--s1 != stats && tmp.Freq > s1[-1].Freq);
  ------------------
  |  Branch (1007:14): [True: 32.4M, False: 0]
  |  Branch (1007:31): [True: 31.7M, False: 725k]
  ------------------
 1008|   725k|      *s1 = tmp;
 1009|   725k|    }
 1010|  2.39M|  }
 1011|  2.39M|  while (--i);
  ------------------
  |  Branch (1011:10): [True: 2.32M, False: 62.8k]
  ------------------
 1012|       |  
 1013|  62.8k|  if (s->Freq == 0)
  ------------------
  |  Branch (1013:7): [True: 15.3k, False: 47.4k]
  ------------------
 1014|  15.3k|  {
 1015|  15.3k|    unsigned numStats = p->MinContext->NumStats;
 1016|  15.3k|    unsigned n0, n1;
 1017|  23.0k|    do { i++; } while ((--s)->Freq == 0);
  ------------------
  |  Branch (1017:24): [True: 7.64k, False: 15.3k]
  ------------------
 1018|  15.3k|    escFreq += i;
 1019|  15.3k|    p->MinContext->NumStats = (Byte)(p->MinContext->NumStats - i);
 1020|  15.3k|    if (p->MinContext->NumStats == 0)
  ------------------
  |  Branch (1020:9): [True: 4.63k, False: 10.7k]
  ------------------
 1021|  4.63k|    {
 1022|  4.63k|      CPpmd_State tmp = *stats;
 1023|  4.63k|      tmp.Freq = (Byte)((2 * tmp.Freq + escFreq - 1) / escFreq);
 1024|  4.63k|      if (tmp.Freq > MAX_FREQ / 3)
  ------------------
  |  |   14|  4.63k|#define MAX_FREQ 124
  ------------------
  |  Branch (1024:11): [True: 4.44k, False: 189]
  ------------------
 1025|  4.44k|        tmp.Freq = MAX_FREQ / 3;
  ------------------
  |  |   14|  4.44k|#define MAX_FREQ 124
  ------------------
 1026|  4.63k|      InsertNode(p, stats, U2I((numStats + 2) >> 1));
  ------------------
  |  |   18|  4.63k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
 1027|  4.63k|      p->MinContext->Flags = (Byte)((p->MinContext->Flags & 0x10) + 0x08 * (tmp.Symbol >= 0x40));
 1028|  4.63k|      *(p->FoundState = ONE_STATE(p->MinContext)) = tmp;
  ------------------
  |  |   31|  4.63k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  4.63k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
 1029|  4.63k|      return;
 1030|  4.63k|    }
 1031|  10.7k|    n0 = (numStats + 2) >> 1;
 1032|  10.7k|    n1 = (p->MinContext->NumStats + 2) >> 1;
 1033|  10.7k|    if (n0 != n1)
  ------------------
  |  Branch (1033:9): [True: 8.48k, False: 2.24k]
  ------------------
 1034|  8.48k|      p->MinContext->Stats = STATS_REF(ShrinkUnits(p, stats, n0, n1));
  ------------------
  |  |   27|  8.48k|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   24|  8.48k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
 1035|  10.7k|    p->MinContext->Flags &= ~0x08;
 1036|  10.7k|    p->MinContext->Flags |= 0x08 * ((s = STATS(p->MinContext))->Symbol >= 0x40);
  ------------------
  |  |   30|  10.7k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  10.7k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  10.7k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1037|  10.7k|    i = p->MinContext->NumStats;
 1038|  65.5k|    do { p->MinContext->Flags |= 0x08*((++s)->Symbol >= 0x40); } while (--i);
  ------------------
  |  Branch (1038:73): [True: 54.7k, False: 10.7k]
  ------------------
 1039|  10.7k|  }
 1040|  58.1k|  p->MinContext->SummFreq = (UInt16)(sumFreq + escFreq - (escFreq >> 1));
 1041|  58.1k|  p->MinContext->Flags |= 0x4;
 1042|  58.1k|  p->FoundState = STATS(p->MinContext);
  ------------------
  |  |   30|  58.1k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  58.1k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  58.1k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1043|  58.1k|}
archive_ppmd8.c:InsertNode:
  118|  76.1M|{
  119|  76.1M|  ((CPpmd8_Node *)node)->Stamp = EMPTY_NODE;
  ------------------
  |  |   62|  76.1M|#define EMPTY_NODE 0xFFFFFFFF
  ------------------
  120|  76.1M|  ((CPpmd8_Node *)node)->Next = (CPpmd8_Node_Ref)p->FreeList[indx];
  121|  76.1M|  ((CPpmd8_Node *)node)->NU = I2U(indx);
  ------------------
  |  |   19|  76.1M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  122|  76.1M|  p->FreeList[indx] = REF(node);
  ------------------
  |  |   24|  76.1M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  123|  76.1M|  p->Stamps[indx]++;
  124|  76.1M|}
archive_ppmd8.c:ShrinkUnits:
  255|  3.03M|{
  256|  3.03M|  unsigned i0 = U2I(oldNU);
  ------------------
  |  |   18|  3.03M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  257|  3.03M|  unsigned i1 = U2I(newNU);
  ------------------
  |  |   18|  3.03M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  258|  3.03M|  if (i0 == i1)
  ------------------
  |  Branch (258:7): [True: 488k, False: 2.55M]
  ------------------
  259|   488k|    return oldPtr;
  260|  2.55M|  if (p->FreeList[i1] != 0)
  ------------------
  |  Branch (260:7): [True: 2.54M, False: 4.91k]
  ------------------
  261|  2.54M|  {
  262|  2.54M|    void *ptr = RemoveNode(p, i1);
  263|  2.54M|    MyMem12Cpy(ptr, oldPtr, newNU);
  ------------------
  |  |  245|  2.54M|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  246|  2.54M|	UInt32 *d = (UInt32 *)dest;					\
  |  |  247|  2.54M|	const UInt32 *z = (const UInt32 *)src;				\
  |  |  248|  2.54M|	UInt32 n = num;							\
  |  |  249|  3.85M|	do {								\
  |  |  250|  3.85M|		d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3;	\
  |  |  251|  3.85M|	} while (--n);							\
  |  |  ------------------
  |  |  |  Branch (251:11): [True: 1.31M, False: 2.54M]
  |  |  ------------------
  |  |  252|  2.54M|} while (0)
  |  |  ------------------
  |  |  |  Branch (252:10): [Folded, False: 2.54M]
  |  |  ------------------
  ------------------
  264|  2.54M|    InsertNode(p, oldPtr, i0);
  265|  2.54M|    return ptr;
  266|  2.54M|  }
  267|  4.91k|  SplitBlock(p, oldPtr, i0, i1);
  268|  4.91k|  return oldPtr;
  269|  2.55M|}
archive_ppmd8.c:RemoveNode:
  127|  36.2M|{
  128|  36.2M|  CPpmd8_Node *node = NODE((CPpmd8_Node_Ref)p->FreeList[indx]);
  ------------------
  |  |   59|  36.2M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  129|  36.2M|  p->FreeList[indx] = node->Next;
  130|  36.2M|  p->Stamps[indx]--;
  131|  36.2M|  return node;
  132|  36.2M|}
archive_ppmd8.c:SplitBlock:
  135|  4.09M|{
  136|  4.09M|  unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
  ------------------
  |  |   19|  4.09M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
                unsigned i, nu = I2U(oldIndx) - I2U(newIndx);
  ------------------
  |  |   19|  4.09M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  137|  4.09M|  ptr = (Byte *)ptr + U2B(I2U(newIndx));
  ------------------
  |  |   17|  4.09M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  4.09M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  138|  4.09M|  if (I2U(i = U2I(nu)) != nu)
  ------------------
  |  |   19|  4.09M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  |  Branch (138:7): [True: 307k, False: 3.78M]
  ------------------
  139|   307k|  {
  140|   307k|    unsigned k = I2U(--i);
  ------------------
  |  |   19|   307k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  141|   307k|    InsertNode(p, ((Byte *)ptr) + U2B(k), nu - k - 1);
  ------------------
  |  |   17|   307k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|   307k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  142|   307k|  }
  143|  4.09M|  InsertNode(p, ptr, i);
  144|  4.09M|}
archive_ppmd8.c:NextContext:
 1070|   104M|{
 1071|   104M|  CTX_PTR c = CTX(SUCCESSOR(p->FoundState));
  ------------------
  |  |   29|   104M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|   104M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|   104M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1072|   104M|  if (p->OrderFall == 0 && (Byte *)c >= p->UnitsStart)
  ------------------
  |  Branch (1072:7): [True: 70.8M, False: 34.0M]
  |  Branch (1072:28): [True: 63.2M, False: 7.60M]
  ------------------
 1073|  63.2M|    p->MinContext = p->MaxContext = c;
 1074|  41.6M|  else
 1075|  41.6M|  {
 1076|  41.6M|    UpdateModel(p);
 1077|  41.6M|    p->MinContext = p->MaxContext;
 1078|  41.6M|  }
 1079|   104M|}
archive_ppmd8.c:UpdateModel:
  806|  52.1M|{
  807|  52.1M|  CPpmd_Void_Ref successor, fSuccessor = SUCCESSOR(p->FoundState);
  ------------------
  |  |  341|  52.1M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  808|  52.1M|  CTX_PTR c;
  809|  52.1M|  unsigned s0, ns, fFreq = p->FoundState->Freq;
  810|  52.1M|  Byte flag, fSymbol = p->FoundState->Symbol;
  811|  52.1M|  CPpmd_State *s = NULL;
  812|       |  
  813|  52.1M|  if (p->FoundState->Freq < MAX_FREQ / 4 && p->MinContext->Suffix != 0)
  ------------------
  |  |   14|  52.1M|#define MAX_FREQ 124
  ------------------
  |  Branch (813:7): [True: 48.6M, False: 3.47M]
  |  Branch (813:45): [True: 47.1M, False: 1.48M]
  ------------------
  814|  47.1M|  {
  815|  47.1M|    c = SUFFIX(p->MinContext);
  ------------------
  |  |   32|  47.1M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  47.1M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  47.1M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  47.1M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  816|       |    
  817|  47.1M|    if (c->NumStats == 0)
  ------------------
  |  Branch (817:9): [True: 28.0M, False: 19.0M]
  ------------------
  818|  28.0M|    {
  819|  28.0M|      s = ONE_STATE(c);
  ------------------
  |  |   31|  28.0M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  28.0M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  820|  28.0M|      if (s->Freq < 32)
  ------------------
  |  Branch (820:11): [True: 28.0M, False: 1.35k]
  ------------------
  821|  28.0M|        s->Freq++;
  822|  28.0M|    }
  823|  19.0M|    else
  824|  19.0M|    {
  825|  19.0M|      s = STATS(c);
  ------------------
  |  |   30|  19.0M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  19.0M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  19.0M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  826|  19.0M|      if (s->Symbol != p->FoundState->Symbol)
  ------------------
  |  Branch (826:11): [True: 11.8M, False: 7.27M]
  ------------------
  827|  11.8M|      {
  828|   155M|        do { s++; } while (s->Symbol != p->FoundState->Symbol);
  ------------------
  |  Branch (828:28): [True: 144M, False: 11.8M]
  ------------------
  829|  11.8M|        if (s[0].Freq >= s[-1].Freq)
  ------------------
  |  Branch (829:13): [True: 4.93M, False: 6.87M]
  ------------------
  830|  4.93M|        {
  831|  4.93M|          SwapStates(&s[0], &s[-1]);
  832|  4.93M|          s--;
  833|  4.93M|        }
  834|  11.8M|      }
  835|  19.0M|      if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|  19.0M|#define MAX_FREQ 124
  ------------------
  |  Branch (835:11): [True: 18.9M, False: 174k]
  ------------------
  836|  18.9M|      {
  837|  18.9M|        s->Freq += 2;
  838|  18.9M|        c->SummFreq += 2;
  839|  18.9M|      }
  840|  19.0M|    }
  841|  47.1M|  }
  842|       |  
  843|  52.1M|  c = p->MaxContext;
  844|  52.1M|  if (p->OrderFall == 0 && fSuccessor)
  ------------------
  |  Branch (844:7): [True: 7.60M, False: 44.5M]
  |  Branch (844:28): [True: 7.49M, False: 115k]
  ------------------
  845|  7.49M|  {
  846|  7.49M|    CTX_PTR cs = CreateSuccessors(p, True, s, p->MinContext);
  ------------------
  |  |   55|  7.49M|#define True 1
  ------------------
  847|  7.49M|    if (cs == 0)
  ------------------
  |  Branch (847:9): [True: 415, False: 7.49M]
  ------------------
  848|    415|    {
  849|    415|      SetSuccessor(p->FoundState, 0);
  850|    415|      RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  554|    415|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  851|    415|    }
  852|  7.49M|    else
  853|  7.49M|    {
  854|  7.49M|      SetSuccessor(p->FoundState, REF(cs));
  ------------------
  |  |   24|  7.49M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  855|  7.49M|      p->MaxContext = cs;
  856|  7.49M|    }
  857|  7.49M|    return;
  858|  7.49M|  }
  859|       |  
  860|  44.6M|  *p->Text++ = p->FoundState->Symbol;
  861|  44.6M|  successor = REF(p->Text);
  ------------------
  |  |   24|  44.6M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  862|  44.6M|  if (p->Text >= p->UnitsStart)
  ------------------
  |  Branch (862:7): [True: 38, False: 44.6M]
  ------------------
  863|     38|  {
  864|     38|    RESTORE_MODEL(c, CTX(fSuccessor)); /* check it */
  ------------------
  |  |  554|     38|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  865|     38|    return;
  866|     38|  }
  867|       |  
  868|  44.6M|  if (!fSuccessor)
  ------------------
  |  Branch (868:7): [True: 2.12M, False: 42.5M]
  ------------------
  869|  2.12M|  {
  870|  2.12M|    CTX_PTR cs = ReduceOrder(p, s, p->MinContext);
  871|  2.12M|    if (cs == NULL)
  ------------------
  |  Branch (871:9): [True: 24, False: 2.12M]
  ------------------
  872|     24|    {
  873|     24|      RESTORE_MODEL(c, 0);
  ------------------
  |  |  554|     24|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  874|     24|      return;
  875|     24|    }
  876|  2.12M|    fSuccessor = REF(cs);
  ------------------
  |  |   24|  2.12M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  877|  2.12M|  }
  878|  42.5M|  else if ((Byte *)Ppmd8_GetPtr(p, fSuccessor) < p->UnitsStart)
  ------------------
  |  |   96|  42.5M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  |  Branch (878:12): [True: 15.2M, False: 27.2M]
  ------------------
  879|  15.2M|  {
  880|  15.2M|    CTX_PTR cs = CreateSuccessors(p, False, s, p->MinContext);
  ------------------
  |  |   56|  15.2M|#define False 0
  ------------------
  881|  15.2M|    if (cs == NULL)
  ------------------
  |  Branch (881:9): [True: 238, False: 15.2M]
  ------------------
  882|    238|    {
  883|    238|      RESTORE_MODEL(c, 0);
  ------------------
  |  |  554|    238|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  884|    238|      return;
  885|    238|    }
  886|  15.2M|    fSuccessor = REF(cs);
  ------------------
  |  |   24|  15.2M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  887|  15.2M|  }
  888|       |  
  889|  44.6M|  if (--p->OrderFall == 0)
  ------------------
  |  Branch (889:7): [True: 1.65M, False: 42.9M]
  ------------------
  890|  1.65M|  {
  891|  1.65M|    successor = fSuccessor;
  892|  1.65M|    p->Text -= (p->MaxContext != p->MinContext);
  893|  1.65M|  }
  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|  44.6M|  s0 = p->MinContext->SummFreq - (ns = p->MinContext->NumStats) - fFreq;
  904|  44.6M|  flag = (Byte)(0x08 * (fSymbol >= 0x40));
  905|       |  
  906|  85.9M|  for (; c != p->MinContext; c = SUFFIX(c))
  ------------------
  |  |   32|  41.2M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  41.2M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  41.2M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  41.2M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (906:10): [True: 41.2M, False: 44.6M]
  ------------------
  907|  41.2M|  {
  908|  41.2M|    unsigned ns1;
  909|  41.2M|    UInt32 cf, sf;
  910|  41.2M|    if ((ns1 = c->NumStats) != 0)
  ------------------
  |  Branch (910:9): [True: 15.8M, False: 25.4M]
  ------------------
  911|  15.8M|    {
  912|  15.8M|      if ((ns1 & 1) != 0)
  ------------------
  |  Branch (912:11): [True: 10.6M, False: 5.18M]
  ------------------
  913|  10.6M|      {
  914|       |        /* Expand for one UNIT */
  915|  10.6M|        unsigned oldNU = (ns1 + 1) >> 1;
  916|  10.6M|        unsigned i = U2I(oldNU);
  ------------------
  |  |   18|  10.6M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  917|  10.6M|        if (i != U2I(oldNU + 1))
  ------------------
  |  |   18|  10.6M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  |  Branch (917:13): [True: 10.3M, False: 319k]
  ------------------
  918|  10.3M|        {
  919|  10.3M|          void *ptr = AllocUnits(p, i + 1);
  920|  10.3M|          void *oldPtr;
  921|  10.3M|          if (!ptr)
  ------------------
  |  Branch (921:15): [True: 308, False: 10.3M]
  ------------------
  922|    308|          {
  923|    308|            RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  554|    308|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  924|    308|            return;
  925|    308|          }
  926|  10.3M|          oldPtr = STATS(c);
  ------------------
  |  |   30|  10.3M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  10.3M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  10.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  927|  10.3M|          MyMem12Cpy(ptr, oldPtr, oldNU);
  ------------------
  |  |  245|  10.3M|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  246|  10.3M|	UInt32 *d = (UInt32 *)dest;					\
  |  |  247|  10.3M|	const UInt32 *z = (const UInt32 *)src;				\
  |  |  248|  10.3M|	UInt32 n = num;							\
  |  |  249|  15.5M|	do {								\
  |  |  250|  15.5M|		d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3;	\
  |  |  251|  15.5M|	} while (--n);							\
  |  |  ------------------
  |  |  |  Branch (251:11): [True: 5.19M, False: 10.3M]
  |  |  ------------------
  |  |  252|  10.3M|} while (0)
  |  |  ------------------
  |  |  |  Branch (252:10): [Folded, False: 10.3M]
  |  |  ------------------
  ------------------
  928|  10.3M|          InsertNode(p, oldPtr, i);
  929|  10.3M|          c->Stats = STATS_REF(ptr);
  ------------------
  |  |   27|  10.3M|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   24|  10.3M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
  930|  10.3M|        }
  931|  10.6M|      }
  932|  15.8M|      c->SummFreq = (UInt16)(c->SummFreq + (3 * ns1 + 1 < ns));
  933|  15.8M|    }
  934|  25.4M|    else
  935|  25.4M|    {
  936|  25.4M|      CPpmd_State *s2 = (CPpmd_State*)AllocUnits(p, 0);
  937|  25.4M|      if (!s2)
  ------------------
  |  Branch (937:11): [True: 484, False: 25.4M]
  ------------------
  938|    484|      {
  939|    484|        RESTORE_MODEL(c, CTX(fSuccessor));
  ------------------
  |  |  554|    484|  #define RESTORE_MODEL(c1, fSuccessor) RestoreModel(p, c1)
  ------------------
  940|    484|        return;
  941|    484|      }
  942|  25.4M|      *s2 = *ONE_STATE(c);
  ------------------
  |  |   31|  25.4M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  25.4M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  943|  25.4M|      c->Stats = REF(s2);
  ------------------
  |  |   24|  25.4M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  944|  25.4M|      if (s2->Freq < MAX_FREQ / 4 - 1)
  ------------------
  |  |   14|  25.4M|#define MAX_FREQ 124
  ------------------
  |  Branch (944:11): [True: 25.4M, False: 13.0k]
  ------------------
  945|  25.4M|        s2->Freq <<= 1;
  946|  13.0k|      else
  947|  13.0k|        s2->Freq = MAX_FREQ - 4;
  ------------------
  |  |   14|  13.0k|#define MAX_FREQ 124
  ------------------
  948|  25.4M|      c->SummFreq = (UInt16)(s2->Freq + p->InitEsc + (ns > 2));
  949|  25.4M|    }
  950|  41.2M|    cf = 2 * fFreq * (c->SummFreq + 6);
  951|  41.2M|    sf = (UInt32)s0 + c->SummFreq;
  952|  41.2M|    if (cf < 6 * sf)
  ------------------
  |  Branch (952:9): [True: 20.9M, False: 20.3M]
  ------------------
  953|  20.9M|    {
  954|  20.9M|      cf = 1 + (cf > sf) + (cf >= 4 * sf);
  955|  20.9M|      c->SummFreq += 4;
  956|  20.9M|    }
  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|  41.2M|    {
  963|  41.2M|      CPpmd_State *s2 = STATS(c) + ns1 + 1;
  ------------------
  |  |   30|  41.2M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  41.2M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  41.2M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  964|  41.2M|      SetSuccessor(s2, successor);
  965|  41.2M|      s2->Symbol = fSymbol;
  966|  41.2M|      s2->Freq = (Byte)cf;
  967|  41.2M|      c->Flags |= flag;
  968|  41.2M|      c->NumStats = (Byte)(ns1 + 1);
  969|  41.2M|    }
  970|  41.2M|  }
  971|  44.6M|  p->MaxContext = p->MinContext = CTX(fSuccessor);
  ------------------
  |  |   29|  44.6M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  44.6M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  44.6M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  972|  44.6M|}
archive_ppmd8.c:SwapStates:
  444|  33.8M|{
  445|  33.8M|  CPpmd_State tmp = *t1;
  446|  33.8M|  *t1 = *t2;
  447|  33.8M|  *t2 = tmp;
  448|  33.8M|}
archive_ppmd8.c:CreateSuccessors:
  619|  22.7M|{
  620|  22.7M|  CPpmd_State upState;
  621|  22.7M|  Byte flags;
  622|  22.7M|  CPpmd_Byte_Ref upBranch = (CPpmd_Byte_Ref)SUCCESSOR(p->FoundState);
  ------------------
  |  |  341|  22.7M|#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|  22.7M|  CPpmd_State *ps[PPMD8_MAX_ORDER + 1];
  625|  22.7M|  unsigned numPs = 0;
  626|       |  
  627|  22.7M|  if (!skip)
  ------------------
  |  Branch (627:7): [True: 15.2M, False: 7.49M]
  ------------------
  628|  15.2M|    ps[numPs++] = p->FoundState;
  629|       |  
  630|   108M|  while (c->Suffix)
  ------------------
  |  Branch (630:10): [True: 108M, False: 332k]
  ------------------
  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.5M, False: 85.5M]
  ------------------
  636|  22.5M|    {
  637|  22.5M|      s = s1;
  638|  22.5M|      s1 = NULL;
  639|  22.5M|    }
  640|  85.5M|    else if (c->NumStats != 0)
  ------------------
  |  Branch (640:14): [True: 22.2M, False: 63.3M]
  ------------------
  641|  22.2M|    {
  642|   119M|      for (s = STATS(c); s->Symbol != p->FoundState->Symbol; s++);
  ------------------
  |  |   30|  22.2M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  22.2M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  22.2M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (642:26): [True: 96.8M, False: 22.2M]
  ------------------
  643|  22.2M|      if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|  22.2M|#define MAX_FREQ 124
  ------------------
  |  Branch (643:11): [True: 22.2M, False: 38.6k]
  ------------------
  644|  22.2M|      {
  645|  22.2M|        s->Freq++;
  646|  22.2M|        c->SummFreq++;
  647|  22.2M|      }
  648|  22.2M|    }
  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.4M, False: 85.6M]
  ------------------
  656|  22.4M|    {
  657|  22.4M|      c = CTX(successor);
  ------------------
  |  |   29|  22.4M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  22.4M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  22.4M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  658|  22.4M|      if (numPs == 0)
  ------------------
  |  Branch (658:11): [True: 548k, False: 21.8M]
  ------------------
  659|   548k|        return c;
  660|  21.8M|      break;
  661|  22.4M|    }
  662|  85.6M|    ps[numPs++] = s;
  663|  85.6M|  }
  664|       |  
  665|  22.2M|  upState.Symbol = *(const Byte *)Ppmd8_GetPtr(p, upBranch);
  ------------------
  |  |   96|  22.2M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  666|  22.2M|  SetSuccessor(&upState, upBranch + 1);
  667|  22.2M|  flags = (Byte)(0x10 * (p->FoundState->Symbol >= 0x40) + 0x08 * (upState.Symbol >= 0x40));
  668|       |
  669|  22.2M|  if (c->NumStats == 0)
  ------------------
  |  Branch (669:7): [True: 11.4M, False: 10.7M]
  ------------------
  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|  10.7M|  else
  672|  10.7M|  {
  673|  10.7M|    UInt32 cf, s0;
  674|  10.7M|    CPpmd_State *s;
  675|  53.9M|    for (s = STATS(c); s->Symbol != upState.Symbol; s++);
  ------------------
  |  |   30|  10.7M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  10.7M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  10.7M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (675:24): [True: 43.2M, False: 10.7M]
  ------------------
  676|  10.7M|    cf = s->Freq - 1;
  677|  10.7M|    s0 = c->SummFreq - c->NumStats - cf;
  678|  10.7M|    upState.Freq = (Byte)(1 + ((2 * cf <= s0) ? (5 * cf > s0) : ((cf + 2 * s0 - 3) / s0)));
  ------------------
  |  Branch (678:32): [True: 6.81M, False: 3.88M]
  ------------------
  679|  10.7M|  }
  680|       |
  681|   123M|  while (numPs != 0)
  ------------------
  |  Branch (681:10): [True: 100M, False: 22.2M]
  ------------------
  682|   100M|  {
  683|       |    /* Create Child */
  684|   100M|    CTX_PTR c1; /* = AllocContext(p); */
  685|   100M|    if (p->HiUnit != p->LoUnit)
  ------------------
  |  Branch (685:9): [True: 75.9M, False: 24.9M]
  ------------------
  686|  75.9M|      c1 = (CTX_PTR)(p->HiUnit -= UNIT_SIZE);
  ------------------
  |  |   15|  75.9M|#define UNIT_SIZE 12
  ------------------
  687|  24.9M|    else if (p->FreeList[0] != 0)
  ------------------
  |  Branch (687:14): [True: 15.1M, False: 9.84M]
  ------------------
  688|  15.1M|      c1 = (CTX_PTR)RemoveNode(p, 0);
  689|  9.84M|    else
  690|  9.84M|    {
  691|  9.84M|      c1 = (CTX_PTR)AllocUnitsRare(p, 0);
  692|  9.84M|      if (!c1)
  ------------------
  |  Branch (692:11): [True: 677, False: 9.84M]
  ------------------
  693|    677|        return NULL;
  694|  9.84M|    }
  695|   100M|    c1->NumStats = 0;
  696|   100M|    c1->Flags = flags;
  697|   100M|    *ONE_STATE(c1) = upState;
  ------------------
  |  |   31|   100M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|   100M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  698|   100M|    c1->Suffix = REF(c);
  ------------------
  |  |   24|   100M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  699|   100M|    SetSuccessor(ps[--numPs], REF(c1));
  ------------------
  |  |   24|   100M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  700|   100M|    c = c1;
  701|   100M|  }
  702|       |
  703|  22.2M|  return c;
  704|  22.2M|}
archive_ppmd8.c:AllocUnitsRare:
  205|  12.7M|{
  206|  12.7M|  unsigned i;
  207|  12.7M|  void *retVal;
  208|  12.7M|  if (p->GlueCount == 0)
  ------------------
  |  Branch (208:7): [True: 2.23k, False: 12.7M]
  ------------------
  209|  2.23k|  {
  210|  2.23k|    GlueFreeBlocks(p);
  211|  2.23k|    if (p->FreeList[indx] != 0)
  ------------------
  |  Branch (211:9): [True: 1.01k, False: 1.22k]
  ------------------
  212|  1.01k|      return RemoveNode(p, indx);
  213|  2.23k|  }
  214|  12.7M|  i = indx;
  215|  12.7M|  do
  216|   336M|  {
  217|   336M|    if (++i == PPMD_NUM_INDEXES)
  ------------------
  |  |  102|   336M|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   336M|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   336M|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   336M|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   336M|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   336M|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   336M|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   336M|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (217:9): [True: 8.68M, False: 327M]
  ------------------
  218|  8.68M|    {
  219|  8.68M|      UInt32 numBytes = U2B(I2U(indx));
  ------------------
  |  |   17|  8.68M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  8.68M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  220|  8.68M|      p->GlueCount--;
  221|  8.68M|      return ((UInt32)(p->UnitsStart - p->Text) > numBytes) ? (p->UnitsStart -= numBytes) : (NULL);
  ------------------
  |  Branch (221:14): [True: 8.68M, False: 1.46k]
  ------------------
  222|  8.68M|    }
  223|   336M|  }
  224|   327M|  while (p->FreeList[i] == 0);
  ------------------
  |  Branch (224:10): [True: 323M, False: 4.08M]
  ------------------
  225|  4.08M|  retVal = RemoveNode(p, i);
  226|  4.08M|  SplitBlock(p, retVal, i, indx);
  227|  4.08M|  return retVal;
  228|  12.7M|}
archive_ppmd8.c:GlueFreeBlocks:
  147|  2.23k|{
  148|  2.23k|  CPpmd8_Node_Ref head = 0;
  149|  2.23k|  CPpmd8_Node_Ref *prev = &head;
  150|  2.23k|  unsigned i;
  151|       |
  152|  2.23k|  p->GlueCount = 1 << 13;
  153|  2.23k|  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.23k|  if (p->LoUnit != p->HiUnit)
  ------------------
  |  Branch (157:7): [True: 149, False: 2.08k]
  ------------------
  158|    149|    ((CPpmd8_Node *)p->LoUnit)->Stamp = 0;
  159|       |
  160|       |  /* Glue free blocks */
  161|  87.1k|  for (i = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|  87.1k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|  87.1k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|  87.1k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|  87.1k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|  87.1k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|  87.1k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  87.1k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|  87.1k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (161:15): [True: 84.9k, False: 2.23k]
  ------------------
  162|  84.9k|  {
  163|  84.9k|    CPpmd8_Node_Ref next = (CPpmd8_Node_Ref)p->FreeList[i];
  164|  84.9k|    p->FreeList[i] = 0;
  165|  19.0M|    while (next != 0)
  ------------------
  |  Branch (165:12): [True: 18.9M, False: 84.9k]
  ------------------
  166|  18.9M|    {
  167|  18.9M|      CPpmd8_Node *node = NODE(next);
  ------------------
  |  |   59|  18.9M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  168|  18.9M|      if (node->NU != 0)
  ------------------
  |  Branch (168:11): [True: 11.3M, False: 7.55M]
  ------------------
  169|  11.3M|      {
  170|  11.3M|        CPpmd8_Node *node2;
  171|  11.3M|        *prev = next;
  172|  11.3M|        prev = &(node->Next);
  173|  22.4M|        while ((node2 = node + node->NU)->Stamp == EMPTY_NODE)
  ------------------
  |  |   62|  22.4M|#define EMPTY_NODE 0xFFFFFFFF
  ------------------
  |  Branch (173:16): [True: 11.0M, False: 11.3M]
  ------------------
  174|  11.0M|        {
  175|  11.0M|          node->NU += node2->NU;
  176|  11.0M|          node2->NU = 0;
  177|  11.0M|        }
  178|  11.3M|      }
  179|  18.9M|      next = node->Next;
  180|  18.9M|    }
  181|  84.9k|  }
  182|  2.23k|  *prev = 0;
  183|       |  
  184|       |  /* Fill lists of free blocks */
  185|  11.3M|  while (head != 0)
  ------------------
  |  Branch (185:10): [True: 11.3M, False: 2.23k]
  ------------------
  186|  11.3M|  {
  187|  11.3M|    CPpmd8_Node *node = NODE(head);
  ------------------
  |  |   59|  11.3M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  188|  11.3M|    unsigned nu;
  189|  11.3M|    head = node->Next;
  190|  11.3M|    nu = node->NU;
  191|  11.3M|    if (nu == 0)
  ------------------
  |  Branch (191:9): [True: 3.51M, False: 7.86M]
  ------------------
  192|  3.51M|      continue;
  193|  7.86M|    for (; nu > 128; nu -= 128, node += 128)
  ------------------
  |  Branch (193:12): [True: 260, False: 7.86M]
  ------------------
  194|    260|      InsertNode(p, node, PPMD_NUM_INDEXES - 1);
  ------------------
  |  |  102|    260|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|    260|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|    260|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|    260|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|    260|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|    260|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|    260|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|    260|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  195|  7.86M|    if (I2U(i = U2I(nu)) != nu)
  ------------------
  |  |   19|  7.86M|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  |  Branch (195:9): [True: 502k, False: 7.36M]
  ------------------
  196|   502k|    {
  197|   502k|      unsigned k = I2U(--i);
  ------------------
  |  |   19|   502k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  198|   502k|      InsertNode(p, node + k, nu - k - 1);
  199|   502k|    }
  200|  7.86M|    InsertNode(p, node, i);
  201|  7.86M|  }
  202|  2.23k|}
archive_ppmd8.c:RestoreModel:
  562|  1.50k|{
  563|  1.50k|  CTX_PTR c;
  564|  1.50k|  CPpmd_State *s;
  565|  1.50k|  RESET_TEXT(0);
  ------------------
  |  |  349|  1.50k|#define RESET_TEXT(offs) do {						\
  |  |  350|  1.50k|	p->Text = p->Base + p->AlignOffset + (offs);			\
  |  |  351|  1.50k|} while (0)
  |  |  ------------------
  |  |  |  Branch (351:10): [Folded, False: 1.50k]
  |  |  ------------------
  ------------------
  566|  4.70k|  for (c = p->MaxContext; c != c1; c = SUFFIX(c))
  ------------------
  |  |   32|  3.19k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  3.19k|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  3.19k|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  3.19k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (566:27): [True: 3.19k, False: 1.50k]
  ------------------
  567|  3.19k|    if (--(c->NumStats) == 0)
  ------------------
  |  Branch (567:9): [True: 2.19k, False: 1.00k]
  ------------------
  568|  2.19k|    {
  569|  2.19k|      s = STATS(c);
  ------------------
  |  |   30|  2.19k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  2.19k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  2.19k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  570|  2.19k|      c->Flags = (Byte)((c->Flags & 0x10) + 0x08 * (s->Symbol >= 0x40));
  571|  2.19k|      *ONE_STATE(c) = *s;
  ------------------
  |  |   31|  2.19k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  2.19k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  572|  2.19k|      SpecialFreeUnit(p, s);
  573|  2.19k|      ONE_STATE(c)->Freq = (Byte)(((unsigned)ONE_STATE(c)->Freq + 11) >> 3);
  ------------------
  |  |   31|  2.19k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  2.19k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(((unsigned)ONE_STATE(c)->Freq + 11) >> 3);
  ------------------
  |  |   31|  2.19k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  2.19k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  574|  2.19k|    }
  575|  1.00k|    else
  576|  1.00k|      Refresh(p, c, (c->NumStats+3) >> 1, 0);
  577|       | 
  578|  6.65k|  for (; c != p->MinContext; c = SUFFIX(c))
  ------------------
  |  |   32|  5.15k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  5.15k|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  5.15k|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  5.15k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (578:10): [True: 5.15k, False: 1.50k]
  ------------------
  579|  5.15k|    if (!c->NumStats)
  ------------------
  |  Branch (579:9): [True: 3.35k, False: 1.79k]
  ------------------
  580|  3.35k|      ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|  3.35k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  3.35k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|  3.35k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  3.35k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(c)->Freq = (Byte)(ONE_STATE(c)->Freq - (ONE_STATE(c)->Freq >> 1));
  ------------------
  |  |   31|  3.35k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  3.35k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  581|  1.79k|    else if ((c->SummFreq += 4) > 128 + 4 * c->NumStats)
  ------------------
  |  Branch (581:14): [True: 52, False: 1.74k]
  ------------------
  582|     52|      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.50k|  if (p->RestoreMethod == PPMD8_RESTORE_METHOD_RESTART || GetUsedMemory(p) < (p->Size >> 1))
  ------------------
  |  Branch (601:7): [True: 71, False: 1.43k]
  |  Branch (601:59): [True: 0, False: 1.43k]
  ------------------
  602|     71|    RestartModel(p);
  603|  1.43k|  else
  604|  1.43k|  {
  605|  19.8k|    while (p->MaxContext->Suffix)
  ------------------
  |  Branch (605:12): [True: 18.4k, False: 1.43k]
  ------------------
  606|  18.4k|      p->MaxContext = SUFFIX(p->MaxContext);
  ------------------
  |  |   32|  18.4k|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  18.4k|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  18.4k|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  18.4k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  607|  1.43k|    do
  608|  1.43k|    {
  609|  1.43k|      CutOff(p, p->MaxContext, 0);
  610|  1.43k|      ExpandTextArea(p);
  611|  1.43k|    }
  612|  1.43k|    while (GetUsedMemory(p) > 3 * (p->Size >> 2));
  ------------------
  |  Branch (612:12): [True: 0, False: 1.43k]
  ------------------
  613|  1.43k|    p->GlueCount = 0;
  614|  1.43k|    p->OrderFall = p->MaxOrder;
  615|  1.43k|  }
  616|  1.50k|}
archive_ppmd8.c:SpecialFreeUnit:
  277|  37.0M|{
  278|  37.0M|  if ((Byte *)ptr != p->UnitsStart)
  ------------------
  |  Branch (278:7): [True: 37.0M, False: 1.97k]
  ------------------
  279|  37.0M|    InsertNode(p, ptr, 0);
  280|  1.97k|  else
  281|  1.97k|  {
  282|       |    #ifdef PPMD8_FREEZE_SUPPORT
  283|       |    *(UInt32 *)ptr = EMPTY_NODE; /* it's used for (Flags == 0xFF) check in RemoveBinContexts */
  284|       |    #endif
  285|  1.97k|    p->UnitsStart += UNIT_SIZE;
  ------------------
  |  |   15|  1.97k|#define UNIT_SIZE 12
  ------------------
  286|  1.97k|  }
  287|  37.0M|}
archive_ppmd8.c:Refresh:
  421|  3.03M|{
  422|  3.03M|  unsigned i = ctx->NumStats, escFreq, sumFreq, flags;
  423|  3.03M|  CPpmd_State *s = (CPpmd_State *)ShrinkUnits(p, STATS(ctx), oldNU, (i + 2) >> 1);
  ------------------
  |  |   30|  3.03M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  3.03M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  3.03M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  424|  3.03M|  ctx->Stats = REF(s);
  ------------------
  |  |   24|  3.03M|  #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|  3.03M|  flags = (ctx->Flags & (0x10 + 0x04 * scale)) + 0x08 * (s->Symbol >= 0x40);
  430|  3.03M|  escFreq = ctx->SummFreq - s->Freq;
  431|  3.03M|  sumFreq = (s->Freq = (Byte)((s->Freq + scale) >> scale));
  432|  3.03M|  do
  433|  6.53M|  {
  434|  6.53M|    escFreq -= (++s)->Freq;
  435|  6.53M|    sumFreq += (s->Freq = (Byte)((s->Freq + scale) >> scale));
  436|  6.53M|    flags |= 0x08 * (s->Symbol >= 0x40);
  437|  6.53M|  }
  438|  6.53M|  while (--i);
  ------------------
  |  Branch (438:10): [True: 3.50M, False: 3.03M]
  ------------------
  439|  3.03M|  ctx->SummFreq = (UInt16)(sumFreq + ((escFreq + scale) >> scale));
  440|  3.03M|  ctx->Flags = (Byte)flags;
  441|  3.03M|}
archive_ppmd8.c:GetUsedMemory:
  543|  2.87k|{
  544|  2.87k|  UInt32 v = 0;
  545|  2.87k|  unsigned i;
  546|   112k|  for (i = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|   112k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|   112k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|   112k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|   112k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|   112k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|   112k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|   112k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|   112k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (546:15): [True: 109k, False: 2.87k]
  ------------------
  547|   109k|    v += p->Stamps[i] * I2U(i);
  ------------------
  |  |   19|   109k|#define I2U(indx) (p->Indx2Units[indx])
  ------------------
  548|  2.87k|  return p->Size - (UInt32)(p->HiUnit - p->LoUnit) - (UInt32)(p->UnitsStart - p->Text) - U2B(v);
  ------------------
  |  |   17|  2.87k|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  2.87k|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  549|  2.87k|}
archive_ppmd8.c:CutOff:
  451|  93.3M|{
  452|  93.3M|  int i;
  453|  93.3M|  unsigned tmp;
  454|  93.3M|  CPpmd_State *s;
  455|       |  
  456|  93.3M|  if (!ctx->NumStats)
  ------------------
  |  Branch (456:7): [True: 72.8M, False: 20.5M]
  ------------------
  457|  72.8M|  {
  458|  72.8M|    s = ONE_STATE(ctx);
  ------------------
  |  |   31|  72.8M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  72.8M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  459|  72.8M|    if ((Byte *)Ppmd8_GetPtr(p, SUCCESSOR(s)) >= p->UnitsStart)
  ------------------
  |  |   96|  72.8M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  |  Branch (459:9): [True: 70.1M, False: 2.65M]
  ------------------
  460|  70.1M|    {
  461|  70.1M|      if (order < p->MaxOrder)
  ------------------
  |  Branch (461:11): [True: 65.0M, False: 5.15M]
  ------------------
  462|  65.0M|        SetSuccessor(s, CutOff(p, CTX(SUCCESSOR(s)), order + 1));
  ------------------
  |  |   29|  65.0M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  65.0M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  65.0M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  463|  5.15M|      else
  464|  5.15M|        SetSuccessor(s, 0);
  465|  70.1M|      if (SUCCESSOR(s) || order <= 9) /* O_BOUND */
  ------------------
  |  |  341|   140M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  |  |  ------------------
  |  |  |  Branch (341:22): [True: 33.6M, False: 36.5M]
  |  |  ------------------
  ------------------
  |  Branch (465:27): [True: 7.13M, False: 29.4M]
  ------------------
  466|  40.7M|        return REF(ctx);
  ------------------
  |  |   24|  40.7M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  467|  70.1M|    }
  468|  32.0M|    SpecialFreeUnit(p, ctx);
  469|  32.0M|    return 0;
  470|  72.8M|  }
  471|       |
  472|  20.5M|  ctx->Stats = STATS_REF(MoveUnitsUp(p, STATS(ctx), tmp = ((unsigned)ctx->NumStats + 2) >> 1));
  ------------------
  |  |   27|  20.5M|#define STATS_REF(ptr) ((CPpmd_State_Ref)REF(ptr))
  |  |  ------------------
  |  |  |  |   24|  20.5M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  |  |  ------------------
  ------------------
  473|       |
  474|  74.8M|  for (s = STATS(ctx) + (i = ctx->NumStats); s >= STATS(ctx); s--)
  ------------------
  |  |   30|  20.5M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  20.5M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  20.5M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                for (s = STATS(ctx) + (i = ctx->NumStats); s >= STATS(ctx); s--)
  ------------------
  |  |   30|  74.8M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  74.8M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  74.8M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (474:46): [True: 54.2M, False: 20.5M]
  ------------------
  475|  54.2M|    if ((Byte *)Ppmd8_GetPtr(p, SUCCESSOR(s)) < p->UnitsStart)
  ------------------
  |  |   96|  54.2M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  ------------------
  |  Branch (475:9): [True: 25.3M, False: 28.9M]
  ------------------
  476|  25.3M|    {
  477|  25.3M|      CPpmd_State *s2 = STATS(ctx) + (i--);
  ------------------
  |  |   30|  25.3M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  25.3M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  25.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  478|  25.3M|      SetSuccessor(s, 0);
  479|  25.3M|      SwapStates(s, s2);
  480|  25.3M|    }
  481|  28.9M|    else if (order < p->MaxOrder)
  ------------------
  |  Branch (481:14): [True: 28.3M, False: 533k]
  ------------------
  482|  28.3M|      SetSuccessor(s, CutOff(p, CTX(SUCCESSOR(s)), order + 1));
  ------------------
  |  |   29|  28.3M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  28.3M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  28.3M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  483|   533k|    else
  484|   533k|      SetSuccessor(s, 0);
  485|       |    
  486|  20.5M|  if (i != ctx->NumStats && order)
  ------------------
  |  Branch (486:7): [True: 16.0M, False: 4.49M]
  |  Branch (486:29): [True: 16.0M, False: 1.43k]
  ------------------
  487|  16.0M|  {
  488|  16.0M|    ctx->NumStats = (Byte)i;
  489|  16.0M|    s = STATS(ctx);
  ------------------
  |  |   30|  16.0M|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|  16.0M|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  16.0M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  490|  16.0M|    if (i < 0)
  ------------------
  |  Branch (490:9): [True: 5.00M, False: 11.0M]
  ------------------
  491|  5.00M|    {
  492|  5.00M|      FreeUnits(p, s, tmp);
  493|  5.00M|      SpecialFreeUnit(p, ctx);
  494|  5.00M|      return 0;
  495|  5.00M|    }
  496|  11.0M|    if (i == 0)
  ------------------
  |  Branch (496:9): [True: 8.05M, False: 3.02M]
  ------------------
  497|  8.05M|    {
  498|  8.05M|      ctx->Flags = (Byte)((ctx->Flags & 0x10) + 0x08 * (s->Symbol >= 0x40));
  499|  8.05M|      *ONE_STATE(ctx) = *s;
  ------------------
  |  |   31|  8.05M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  8.05M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  500|  8.05M|      FreeUnits(p, s, tmp);
  501|       |      /* 9.31: the code was fixed. It's was not BUG, if Freq <= MAX_FREQ = 124 */
  502|  8.05M|      ONE_STATE(ctx)->Freq = (Byte)(((unsigned)ONE_STATE(ctx)->Freq + 11) >> 3);
  ------------------
  |  |   31|  8.05M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  8.05M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
                    ONE_STATE(ctx)->Freq = (Byte)(((unsigned)ONE_STATE(ctx)->Freq + 11) >> 3);
  ------------------
  |  |   31|  8.05M|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|  8.05M|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  503|  8.05M|    }
  504|  3.02M|    else
  505|  3.02M|      Refresh(p, ctx, tmp, ctx->SummFreq > 16 * i);
  506|  11.0M|  }
  507|  15.5M|  return REF(ctx);
  ------------------
  |  |   24|  15.5M|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  508|  20.5M|}
archive_ppmd8.c:MoveUnitsUp:
  290|  20.5M|{
  291|  20.5M|  unsigned indx = U2I(nu);
  ------------------
  |  |   18|  20.5M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  292|  20.5M|  void *ptr;
  293|  20.5M|  if ((Byte *)oldPtr > p->UnitsStart + 16 * 1024 || REF(oldPtr) > p->FreeList[indx])
  ------------------
  |  |   24|   361k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  |  Branch (293:7): [True: 20.2M, False: 361k]
  |  Branch (293:53): [True: 3.47k, False: 358k]
  ------------------
  294|  20.2M|    return oldPtr;
  295|   358k|  ptr = RemoveNode(p, indx);
  296|   358k|  MyMem12Cpy(ptr, oldPtr, nu);
  ------------------
  |  |  245|   358k|#define MyMem12Cpy(dest, src, num) do {					\
  |  |  246|   358k|	UInt32 *d = (UInt32 *)dest;					\
  |  |  247|   358k|	const UInt32 *z = (const UInt32 *)src;				\
  |  |  248|   358k|	UInt32 n = num;							\
  |  |  249|   504k|	do {								\
  |  |  250|   504k|		d[0] = z[0]; d[1] = z[1]; d[2] = z[2]; z += 3; d += 3;	\
  |  |  251|   504k|	} while (--n);							\
  |  |  ------------------
  |  |  |  Branch (251:11): [True: 146k, False: 358k]
  |  |  ------------------
  |  |  252|   358k|} while (0)
  |  |  ------------------
  |  |  |  Branch (252:10): [Folded, False: 358k]
  |  |  ------------------
  ------------------
  297|   358k|  if ((Byte*)oldPtr != p->UnitsStart)
  ------------------
  |  Branch (297:7): [True: 358k, False: 305]
  ------------------
  298|   358k|    InsertNode(p, oldPtr, indx);
  299|    305|  else
  300|    305|    p->UnitsStart += U2B(I2U(indx));
  ------------------
  |  |   17|    305|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|    305|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  301|   358k|  return ptr;
  302|  20.5M|}
archive_ppmd8.c:FreeUnits:
  272|  13.0M|{
  273|  13.0M|  InsertNode(p, ptr, U2I(nu));
  ------------------
  |  |   18|  13.0M|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  274|  13.0M|}
archive_ppmd8.c:ExpandTextArea:
  305|  1.43k|{
  306|  1.43k|  UInt32 count[PPMD_NUM_INDEXES];
  307|  1.43k|  unsigned i;
  308|  1.43k|  memset(count, 0, sizeof(count));
  309|  1.43k|  if (p->LoUnit != p->HiUnit)
  ------------------
  |  Branch (309:7): [True: 0, False: 1.43k]
  ------------------
  310|      0|    ((CPpmd8_Node *)p->LoUnit)->Stamp = 0;
  311|       |  
  312|  1.43k|  {
  313|  1.43k|    CPpmd8_Node *node = (CPpmd8_Node *)p->UnitsStart;
  314|  35.7k|    for (; node->Stamp == EMPTY_NODE; node += node->NU)
  ------------------
  |  |   62|  35.7k|#define EMPTY_NODE 0xFFFFFFFF
  ------------------
  |  Branch (314:12): [True: 34.2k, False: 1.43k]
  ------------------
  315|  34.2k|    {
  316|  34.2k|      node->Stamp = 0;
  317|  34.2k|      count[U2I(node->NU)]++;
  ------------------
  |  |   18|  34.2k|#define U2I(nu) (p->Units2Indx[(nu) - 1])
  ------------------
  318|  34.2k|    }
  319|  1.43k|    p->UnitsStart = (Byte *)node;
  320|  1.43k|  }
  321|       |  
  322|  56.0k|  for (i = 0; i < PPMD_NUM_INDEXES; i++)
  ------------------
  |  |  102|  56.0k|#define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   98|  56.0k|#define PPMD_N1 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |   99|  56.0k|#define PPMD_N2 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  100|  56.0k|#define PPMD_N3 4
  |  |  ------------------
  |  |               #define PPMD_NUM_INDEXES (PPMD_N1 + PPMD_N2 + PPMD_N3 + PPMD_N4)
  |  |  ------------------
  |  |  |  |  101|  56.0k|#define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|  56.0k|#define PPMD_N1 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|  56.0k|#define PPMD_N2 4
  |  |  |  |  ------------------
  |  |  |  |               #define PPMD_N4 ((128 + 3 - 1 * PPMD_N1 - 2 * PPMD_N2 - 3 * PPMD_N3) / 4)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|  56.0k|#define PPMD_N3 4
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (322:15): [True: 54.5k, False: 1.43k]
  ------------------
  323|  54.5k|  {
  324|  54.5k|    CPpmd8_Node_Ref *next = (CPpmd8_Node_Ref *)&p->FreeList[i];
  325|  38.9M|    while (count[i] != 0)
  ------------------
  |  Branch (325:12): [True: 38.8M, False: 54.5k]
  ------------------
  326|  38.8M|    {
  327|  38.8M|      CPpmd8_Node *node = NODE(*next);
  ------------------
  |  |   59|  38.8M|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  328|  38.9M|      while (node->Stamp == 0)
  ------------------
  |  Branch (328:14): [True: 34.2k, False: 38.8M]
  ------------------
  329|  34.2k|      {
  330|  34.2k|        *next = node->Next;
  331|  34.2k|        node = NODE(*next);
  ------------------
  |  |   59|  34.2k|  #define NODE(offs) ((CPpmd8_Node *)(p->Base + (offs)))
  ------------------
  332|  34.2k|        p->Stamps[i]--;
  333|  34.2k|        if (--count[i] == 0)
  ------------------
  |  Branch (333:13): [True: 1.98k, False: 32.2k]
  ------------------
  334|  1.98k|          break;
  335|  34.2k|      }
  336|  38.8M|      next = &node->Next;
  337|  38.8M|    }
  338|  54.5k|  }
  339|  1.43k|}
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.29M|  {
  724|  3.29M|    if (s1)
  ------------------
  |  Branch (724:9): [True: 1.68M, False: 1.61M]
  ------------------
  725|  1.68M|    {
  726|  1.68M|      c = SUFFIX(c);
  ------------------
  |  |   32|  1.68M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  1.68M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  1.68M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.68M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  727|  1.68M|      s = s1;
  728|  1.68M|      s1 = NULL;
  729|  1.68M|    }
  730|  1.61M|    else
  731|  1.61M|    {
  732|  1.61M|      if (!c->Suffix)
  ------------------
  |  Branch (732:11): [True: 434k, False: 1.18M]
  ------------------
  733|   434k|      {
  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|   434k|        return c;
  743|   434k|      }
  744|  1.18M|      c = SUFFIX(c);
  ------------------
  |  |   32|  1.18M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  1.18M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  1.18M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  1.18M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  745|  1.18M|      if (c->NumStats)
  ------------------
  |  Branch (745:11): [True: 565k, False: 616k]
  ------------------
  746|   565k|      {
  747|   565k|        if ((s = STATS(c))->Symbol != p->FoundState->Symbol)
  ------------------
  |  |   30|   565k|#define STATS(ctx) Ppmd8_GetStats(p, ctx)
  |  |  ------------------
  |  |  |  |   98|   565k|  #define Ppmd8_GetStats(p, ctx) ((CPpmd_State *)Ppmd8_GetPtr((p), ((ctx)->Stats)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|   565k|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (747:13): [True: 342k, False: 222k]
  ------------------
  748|   974k|          do { s++; } while (s->Symbol != p->FoundState->Symbol);
  ------------------
  |  Branch (748:30): [True: 632k, False: 342k]
  ------------------
  749|   565k|        if (s->Freq < MAX_FREQ - 9)
  ------------------
  |  |   14|   565k|#define MAX_FREQ 124
  ------------------
  |  Branch (749:13): [True: 564k, False: 999]
  ------------------
  750|   564k|        {
  751|   564k|          s->Freq += 2;
  752|   564k|          c->SummFreq += 2;
  753|   564k|        }
  754|   565k|      }
  755|   616k|      else
  756|   616k|      {
  757|   616k|        s = ONE_STATE(c);
  ------------------
  |  |   31|   616k|#define ONE_STATE(ctx) Ppmd8Context_OneState(ctx)
  |  |  ------------------
  |  |  |  |   38|   616k|#define Ppmd8Context_OneState(p) ((CPpmd_State *)&(p)->SummFreq)
  |  |  ------------------
  ------------------
  758|   616k|        s->Freq = (Byte)(s->Freq + (s->Freq < 32));
  759|   616k|      }
  760|  1.18M|    }
  761|  2.86M|    if (SUCCESSOR(s))
  ------------------
  |  |  341|  2.86M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  |  |  ------------------
  |  |  |  Branch (341:22): [True: 1.68M, False: 1.17M]
  |  |  ------------------
  ------------------
  762|  1.68M|      break;
  763|       |    #ifdef PPMD8_FREEZE_SUPPORT
  764|       |    ps[numPs++] = s;
  765|       |    #endif
  766|  1.17M|    SetSuccessor(s, upBranch);
  767|  1.17M|    p->OrderFall++;
  768|  1.17M|  }
  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.68M|  if (SUCCESSOR(s) <= upBranch)
  ------------------
  |  |  341|  1.68M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  |  Branch (781:7): [True: 24.9k, False: 1.66M]
  ------------------
  782|  24.9k|  {
  783|  24.9k|    CTX_PTR successor;
  784|  24.9k|    CPpmd_State *s2 = p->FoundState;
  785|  24.9k|    p->FoundState = s;
  786|       |
  787|  24.9k|    successor = CreateSuccessors(p, False, NULL, c);
  ------------------
  |  |   56|  24.9k|#define False 0
  ------------------
  788|  24.9k|    if (successor == NULL)
  ------------------
  |  Branch (788:9): [True: 24, False: 24.9k]
  ------------------
  789|     24|      SetSuccessor(s, 0);
  790|  24.9k|    else
  791|  24.9k|      SetSuccessor(s, REF(successor));
  ------------------
  |  |   24|  24.9k|  #define REF(ptr) ((UInt32)((Byte *)(ptr) - (p)->Base))
  ------------------
  792|  24.9k|    p->FoundState = s2;
  793|  24.9k|  }
  794|       |  
  795|  1.68M|  if (p->OrderFall == 1 && c1 == p->MaxContext)
  ------------------
  |  Branch (795:7): [True: 21.4k, False: 1.66M]
  |  Branch (795:28): [True: 21.4k, False: 0]
  ------------------
  796|  21.4k|  {
  797|  21.4k|    SetSuccessor(p->FoundState, SUCCESSOR(s));
  ------------------
  |  |  341|  21.4k|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  798|  21.4k|    p->Text--;
  799|  21.4k|  }
  800|  1.68M|  if (SUCCESSOR(s) == 0)
  ------------------
  |  |  341|  1.68M|#define SUCCESSOR(p) ((CPpmd_Void_Ref)((p)->SuccessorLow | ((UInt32)(p)->SuccessorHigh << 16)))
  ------------------
  |  Branch (800:7): [True: 24, False: 1.68M]
  ------------------
  801|     24|    return NULL;
  802|  1.68M|  return CTX(SUCCESSOR(s));
  ------------------
  |  |   29|  1.68M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  ------------------
  |  |  |  |   97|  1.68M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|  1.68M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  803|  1.68M|}
archive_ppmd8.c:AllocUnits:
  231|  35.7M|{
  232|  35.7M|  UInt32 numBytes;
  233|  35.7M|  if (p->FreeList[indx] != 0)
  ------------------
  |  Branch (233:7): [True: 14.1M, False: 21.6M]
  ------------------
  234|  14.1M|    return RemoveNode(p, indx);
  235|  21.6M|  numBytes = U2B(I2U(indx));
  ------------------
  |  |   17|  21.6M|#define U2B(nu) ((UInt32)(nu) * UNIT_SIZE)
  |  |  ------------------
  |  |  |  |   15|  21.6M|#define UNIT_SIZE 12
  |  |  ------------------
  ------------------
  236|  21.6M|  if (numBytes <= (UInt32)(p->HiUnit - p->LoUnit))
  ------------------
  |  Branch (236:7): [True: 18.6M, False: 2.93M]
  ------------------
  237|  18.6M|  {
  238|  18.6M|    void *retVal = p->LoUnit;
  239|  18.6M|    p->LoUnit += numBytes;
  240|  18.6M|    return retVal;
  241|  18.6M|  }
  242|  2.93M|  return AllocUnitsRare(p, indx);
  243|  21.6M|}
archive_ppmd8.c:Ppmd8_Update1:
 1082|  5.46M|{
 1083|  5.46M|  CPpmd_State *s = p->FoundState;
 1084|  5.46M|  s->Freq += 4;
 1085|  5.46M|  p->MinContext->SummFreq += 4;
 1086|  5.46M|  if (s[0].Freq > s[-1].Freq)
  ------------------
  |  Branch (1086:7): [True: 3.57M, False: 1.88M]
  ------------------
 1087|  3.57M|  {
 1088|  3.57M|    SwapStates(&s[0], &s[-1]);
 1089|  3.57M|    p->FoundState = --s;
 1090|  3.57M|    if (s->Freq > MAX_FREQ)
  ------------------
  |  |   14|  3.57M|#define MAX_FREQ 124
  ------------------
  |  Branch (1090:9): [True: 477, False: 3.57M]
  ------------------
 1091|    477|      Rescale(p);
 1092|  3.57M|  }
 1093|  5.46M|  NextContext(p);
 1094|  5.46M|}
archive_ppmd8.c:Ppmd8_UpdateBin:
 1107|  93.7M|{
 1108|  93.7M|  p->FoundState->Freq = (Byte)(p->FoundState->Freq + (p->FoundState->Freq < 196));
 1109|  93.7M|  p->PrevSuccess = 1;
 1110|  93.7M|  p->RunLength++;
 1111|  93.7M|  NextContext(p);
 1112|  93.7M|}
archive_ppmd8.c:Ppmd8_MakeEscFreq:
 1046|  14.8M|{
 1047|  14.8M|  CPpmd_See *see;
 1048|  14.8M|  if (p->MinContext->NumStats != 0xFF)
  ------------------
  |  Branch (1048:7): [True: 12.7M, False: 2.03M]
  ------------------
 1049|  12.7M|  {
 1050|  12.7M|    see = p->See[(unsigned)p->NS2Indx[(unsigned)p->MinContext->NumStats + 2] - 3] +
 1051|  12.7M|        (p->MinContext->SummFreq > 11 * ((unsigned)p->MinContext->NumStats + 1)) +
 1052|  12.7M|        2 * (unsigned)(2 * (unsigned)p->MinContext->NumStats <
 1053|  12.7M|        ((unsigned)SUFFIX(p->MinContext)->NumStats + numMasked1)) +
  ------------------
  |  |   32|  12.7M|#define SUFFIX(ctx) CTX((ctx)->Suffix)
  |  |  ------------------
  |  |  |  |   29|  12.7M|#define CTX(ref) ((CPpmd8_Context *)Ppmd8_GetContext(p, ref))
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|  12.7M|  #define Ppmd8_GetContext(p, offs) ((CPpmd8_Context *)Ppmd8_GetPtr((p), (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|  12.7M|  #define Ppmd8_GetPtr(p, offs) ((void *)((p)->Base + (offs)))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1054|  12.7M|        p->MinContext->Flags;
 1055|  12.7M|    {
 1056|  12.7M|      unsigned r = (see->Summ >> see->Shift);
 1057|  12.7M|      see->Summ = (UInt16)(see->Summ - r);
 1058|  12.7M|      *escFreq = r + (r == 0);
 1059|  12.7M|    }
 1060|  12.7M|  }
 1061|  2.03M|  else
 1062|  2.03M|  {
 1063|  2.03M|    see = &p->DummySee;
 1064|  2.03M|    *escFreq = 1;
 1065|  2.03M|  }
 1066|  14.8M|  return see;
 1067|  14.8M|}
archive_ppmd8.c:Ppmd8_Update2:
 1115|  10.4M|{
 1116|  10.4M|  p->MinContext->SummFreq += 4;
 1117|  10.4M|  if ((p->FoundState->Freq += 4) > MAX_FREQ)
  ------------------
  |  |   14|  10.4M|#define MAX_FREQ 124
  ------------------
  |  Branch (1117:7): [True: 13.4k, False: 10.4M]
  ------------------
 1118|  13.4k|    Rescale(p);
 1119|  10.4M|  p->RunLength = p->InitRL;
 1120|  10.4M|  UpdateModel(p);
 1121|  10.4M|  p->MinContext = p->MaxContext;
 1122|  10.4M|}

__archive_rb_tree_init:
   97|  17.0k|{
   98|  17.0k|	rbt->rbt_ops = ops;
   99|       |	*((struct archive_rb_node **)&rbt->rbt_root) = RB_SENTINEL_NODE;
  ------------------
  |  |   89|  17.0k|#define	RB_SENTINEL_NODE	NULL
  ------------------
  100|  17.0k|}
__archive_rb_tree_find_node:
  104|  6.34k|{
  105|  6.34k|	archive_rbto_compare_key_fn compare_key = rbt->rbt_ops->rbto_compare_key;
  106|  6.34k|	struct archive_rb_node *parent = rbt->rbt_root;
  107|       |
  108|  16.0k|	while (!RB_SENTINEL_P(parent)) {
  ------------------
  |  |   53|  16.0k|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  ------------------
  |  Branch (108:9): [True: 16.0k, False: 0]
  ------------------
  109|  16.0k|		const signed int diff = (*compare_key)(parent, key);
  110|  16.0k|		if (diff == 0)
  ------------------
  |  Branch (110:7): [True: 6.34k, False: 9.71k]
  ------------------
  111|  6.34k|			return parent;
  112|  9.71k|		parent = parent->rb_nodes[diff > 0];
  113|  9.71k|	}
  114|       |
  115|      0|	return NULL;
  116|  6.34k|}
__archive_rb_tree_insert_node:
  159|  7.57k|{
  160|  7.57k|	archive_rbto_compare_nodes_fn compare_nodes = rbt->rbt_ops->rbto_compare_nodes;
  161|  7.57k|	struct archive_rb_node *parent, *tmp;
  162|  7.57k|	unsigned int position;
  163|  7.57k|	int rebalance;
  164|       |
  165|  7.57k|	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|  7.57k|	parent = (struct archive_rb_node *)(void *)&rbt->rbt_root;
  175|  7.57k|	position = RB_DIR_LEFT;
  ------------------
  |  |   39|  7.57k|#define	RB_DIR_LEFT		0
  ------------------
  176|       |
  177|       |	/*
  178|       |	 * Find out where to place this new leaf.
  179|       |	 */
  180|  24.1k|	while (!RB_SENTINEL_P(tmp)) {
  ------------------
  |  |   53|  24.1k|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  ------------------
  |  Branch (180:9): [True: 20.6k, False: 3.49k]
  ------------------
  181|  20.6k|		const signed int diff = (*compare_nodes)(tmp, self);
  182|  20.6k|		if (diff == 0) {
  ------------------
  |  Branch (182:7): [True: 4.08k, False: 16.6k]
  ------------------
  183|       |			/*
  184|       |			 * Node already exists; don't insert.
  185|       |			 */
  186|  4.08k|			return F;
  ------------------
  |  |   92|  4.08k|#define	F	0
  ------------------
  187|  4.08k|		}
  188|  16.6k|		parent = tmp;
  189|  16.6k|		position = (diff > 0);
  190|  16.6k|		tmp = parent->rb_nodes[position];
  191|  16.6k|	}
  192|       |
  193|       |	/*
  194|       |	 * Initialize the node and insert as a leaf into the tree.
  195|       |	 */
  196|  3.49k|	RB_SET_FATHER(self, parent);
  ------------------
  |  |   51|  3.49k|    ((void)((rb)->rb_info = (uintptr_t)(father)|((rb)->rb_info & RB_FLAG_MASK)))
  |  |  ------------------
  |  |  |  |   47|  3.49k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  3.49k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  3.49k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  197|  3.49k|	RB_SET_POSITION(self, position);
  ------------------
  |  |   73|  3.49k|    ((void)((position) ? ((rb)->rb_info |= RB_FLAG_POSITION) : \
  |  |  ------------------
  |  |  |  |   45|  1.71k|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  |  |  |  Branch (73:13): [True: 1.71k, False: 1.78k]
  |  |  ------------------
  |  |   74|  3.49k|    ((rb)->rb_info &= ~RB_FLAG_POSITION)))
  |  |  ------------------
  |  |  |  |   45|  1.78k|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  ------------------
  198|  3.49k|	if (parent == (struct archive_rb_node *)(void *)&rbt->rbt_root) {
  ------------------
  |  Branch (198:6): [True: 499, False: 2.99k]
  ------------------
  199|    499|		RB_MARK_BLACK(self);		/* root is always black */
  ------------------
  |  |   69|    499|#define	RB_MARK_BLACK(rb) 	((void)((rb)->rb_info &= ~RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|    499|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  200|    499|		rebalance = F;
  ------------------
  |  |   92|    499|#define	F	0
  ------------------
  201|  2.99k|	} else {
  202|       |		/*
  203|       |		 * All new nodes are colored red.  We only need to rebalance
  204|       |		 * if our parent is also red.
  205|       |		 */
  206|  2.99k|		RB_MARK_RED(self);
  ------------------
  |  |   68|  2.99k|#define	RB_MARK_RED(rb) 	((void)((rb)->rb_info |= RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|  2.99k|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  207|  2.99k|		rebalance = RB_RED_P(parent);
  ------------------
  |  |   66|  2.99k|#define	RB_RED_P(rb) 		(!RB_SENTINEL_P(rb) && ((rb)->rb_info & RB_FLAG_RED) != 0)
  |  |  ------------------
  |  |  |  |   53|  5.99k|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  |  |  ------------------
  |  |               #define	RB_RED_P(rb) 		(!RB_SENTINEL_P(rb) && ((rb)->rb_info & RB_FLAG_RED) != 0)
  |  |  ------------------
  |  |  |  |   46|  2.99k|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  |  |  |  Branch (66:25): [True: 2.99k, False: 0]
  |  |  |  Branch (66:47): [True: 2.10k, False: 892]
  |  |  ------------------
  ------------------
  208|  2.99k|	}
  209|  3.49k|	self->rb_left = parent->rb_nodes[position];
  ------------------
  |  |   42|  3.49k|#define	rb_left			rb_nodes[RB_DIR_LEFT]
  |  |  ------------------
  |  |  |  |   39|  3.49k|#define	RB_DIR_LEFT		0
  |  |  ------------------
  ------------------
  210|  3.49k|	self->rb_right = parent->rb_nodes[position];
  ------------------
  |  |   43|  3.49k|#define	rb_right		rb_nodes[RB_DIR_RIGHT]
  |  |  ------------------
  |  |  |  |   40|  3.49k|#define	RB_DIR_RIGHT		1
  |  |  ------------------
  ------------------
  211|  3.49k|	parent->rb_nodes[position] = self;
  212|       |
  213|       |	/*
  214|       |	 * Rebalance tree after insertion
  215|       |	 */
  216|  3.49k|	if (rebalance)
  ------------------
  |  Branch (216:6): [True: 2.10k, False: 1.39k]
  ------------------
  217|  2.10k|		__archive_rb_tree_insert_rebalance(rbt, self);
  218|       |
  219|  3.49k|	return T;
  ------------------
  |  |   91|  3.49k|#define T	1
  ------------------
  220|  7.57k|}
__archive_rb_tree_iterate:
  677|    289|{
  678|    289|	const unsigned int other = direction ^ RB_DIR_OTHER;
  ------------------
  |  |   41|    289|#define	RB_DIR_OTHER		1
  ------------------
  679|       |
  680|    289|	if (self == NULL) {
  ------------------
  |  Branch (680:6): [True: 95, False: 194]
  ------------------
  681|     95|		self = rbt->rbt_root;
  682|     95|		if (RB_SENTINEL_P(self))
  ------------------
  |  |   53|     95|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  |  |  ------------------
  |  |  |  Branch (53:27): [True: 38, False: 57]
  |  |  ------------------
  ------------------
  683|     38|			return NULL;
  684|    106|		while (!RB_SENTINEL_P(self->rb_nodes[direction]))
  ------------------
  |  |   53|    106|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  ------------------
  |  Branch (684:10): [True: 49, False: 57]
  ------------------
  685|     49|			self = self->rb_nodes[direction];
  686|     57|		return self;
  687|     95|	}
  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|    194|	if (RB_SENTINEL_P(self->rb_nodes[direction])) {
  ------------------
  |  |   53|    194|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  |  |  ------------------
  |  |  |  Branch (53:27): [True: 112, False: 82]
  |  |  ------------------
  ------------------
  693|    177|		while (!RB_ROOT_P(rbt, self)) {
  ------------------
  |  |   71|    177|#define	RB_ROOT_P(rbt, rb)	((rbt)->rbt_root == (rb))
  ------------------
  |  Branch (693:10): [True: 145, False: 32]
  ------------------
  694|    145|			if (other == (unsigned int)RB_POSITION(self))
  ------------------
  |  |   63|    145|    (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   45|    145|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  |  |                   (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   40|     65|#define	RB_DIR_RIGHT		1
  |  |  ------------------
  |  |                   (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   39|     80|#define	RB_DIR_LEFT		0
  |  |  ------------------
  |  |  |  Branch (63:6): [True: 65, False: 80]
  |  |  ------------------
  ------------------
  |  Branch (694:8): [True: 80, False: 65]
  ------------------
  695|     80|				return RB_FATHER(self);
  ------------------
  |  |   49|     80|    ((struct archive_rb_node *)((rb)->rb_info & ~RB_FLAG_MASK))
  |  |  ------------------
  |  |  |  |   47|     80|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|     80|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|     80|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  696|     65|			self = RB_FATHER(self);
  ------------------
  |  |   49|     65|    ((struct archive_rb_node *)((rb)->rb_info & ~RB_FLAG_MASK))
  |  |  ------------------
  |  |  |  |   47|     65|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|     65|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|     65|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  697|     65|		}
  698|     32|		return NULL;
  699|    112|	}
  700|       |
  701|       |	/*
  702|       |	 * Advance down one in current direction and go down as far as possible
  703|       |	 * in the opposite direction.
  704|       |	 */
  705|     82|	self = self->rb_nodes[direction];
  706|    135|	while (!RB_SENTINEL_P(self->rb_nodes[other]))
  ------------------
  |  |   53|    135|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  ------------------
  |  Branch (706:9): [True: 53, False: 82]
  ------------------
  707|     53|		self = self->rb_nodes[other];
  708|     82|	return self;
  709|    194|}
archive_rb.c:__archive_rb_tree_insert_rebalance:
  275|  2.10k|{
  276|  2.10k|	struct archive_rb_node * father = RB_FATHER(self);
  ------------------
  |  |   49|  2.10k|    ((struct archive_rb_node *)((rb)->rb_info & ~RB_FLAG_MASK))
  |  |  ------------------
  |  |  |  |   47|  2.10k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  2.10k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  2.10k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  277|  2.10k|	struct archive_rb_node * grandpa;
  278|  2.10k|	struct archive_rb_node * uncle;
  279|  2.10k|	unsigned int which;
  280|  2.10k|	unsigned int other;
  281|       |
  282|  2.98k|	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|  2.98k|		grandpa = RB_FATHER(father);
  ------------------
  |  |   49|  2.98k|    ((struct archive_rb_node *)((rb)->rb_info & ~RB_FLAG_MASK))
  |  |  ------------------
  |  |  |  |   47|  2.98k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  2.98k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  2.98k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  288|  2.98k|		which = (father == grandpa->rb_right);
  ------------------
  |  |   43|  2.98k|#define	rb_right		rb_nodes[RB_DIR_RIGHT]
  |  |  ------------------
  |  |  |  |   40|  2.98k|#define	RB_DIR_RIGHT		1
  |  |  ------------------
  ------------------
  289|  2.98k|		other = which ^ RB_DIR_OTHER;
  ------------------
  |  |   41|  2.98k|#define	RB_DIR_OTHER		1
  ------------------
  290|  2.98k|		uncle = grandpa->rb_nodes[other];
  291|       |
  292|  2.98k|		if (RB_BLACK_P(uncle))
  ------------------
  |  |   67|  2.98k|#define	RB_BLACK_P(rb) 		(RB_SENTINEL_P(rb) || ((rb)->rb_info & RB_FLAG_RED) == 0)
  |  |  ------------------
  |  |  |  |   53|  5.97k|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (53:27): [True: 1.05k, False: 1.93k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define	RB_BLACK_P(rb) 		(RB_SENTINEL_P(rb) || ((rb)->rb_info & RB_FLAG_RED) == 0)
  |  |  ------------------
  |  |  |  |   46|  1.93k|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  |  |  |  Branch (67:48): [True: 464, False: 1.47k]
  |  |  ------------------
  ------------------
  293|  1.51k|			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|  1.47k|		RB_MARK_BLACK(uncle);
  ------------------
  |  |   69|  1.47k|#define	RB_MARK_BLACK(rb) 	((void)((rb)->rb_info &= ~RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|  1.47k|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  302|  1.47k|		RB_MARK_BLACK(father);
  ------------------
  |  |   69|  1.47k|#define	RB_MARK_BLACK(rb) 	((void)((rb)->rb_info &= ~RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|  1.47k|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  303|  1.47k|		if (RB_ROOT_P(rbt, grandpa)) {
  ------------------
  |  |   71|  1.47k|#define	RB_ROOT_P(rbt, rb)	((rbt)->rbt_root == (rb))
  |  |  ------------------
  |  |  |  Branch (71:28): [True: 276, False: 1.19k]
  |  |  ------------------
  ------------------
  304|       |			/*
  305|       |			 * If our grandpa is root, don't bother
  306|       |			 * setting him to red, just return.
  307|       |			 */
  308|    276|			return;
  309|    276|		}
  310|  1.19k|		RB_MARK_RED(grandpa);
  ------------------
  |  |   68|  1.19k|#define	RB_MARK_RED(rb) 	((void)((rb)->rb_info |= RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|  1.19k|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  311|  1.19k|		self = grandpa;
  312|  1.19k|		father = RB_FATHER(self);
  ------------------
  |  |   49|  1.19k|    ((struct archive_rb_node *)((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
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  313|  1.19k|		if (RB_BLACK_P(father)) {
  ------------------
  |  |   67|  1.19k|#define	RB_BLACK_P(rb) 		(RB_SENTINEL_P(rb) || ((rb)->rb_info & RB_FLAG_RED) == 0)
  |  |  ------------------
  |  |  |  |   53|  2.39k|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (53:27): [True: 0, False: 1.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define	RB_BLACK_P(rb) 		(RB_SENTINEL_P(rb) || ((rb)->rb_info & RB_FLAG_RED) == 0)
  |  |  ------------------
  |  |  |  |   46|  1.19k|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  |  |  |  Branch (67:48): [True: 316, False: 882]
  |  |  ------------------
  ------------------
  314|       |			/*
  315|       |			 * If our great-grandpa is black, we're done.
  316|       |			 */
  317|    316|			return;
  318|    316|		}
  319|  1.19k|	}
  320|       |
  321|       |	/*
  322|       |	 * Case 2&3: our uncle is black.
  323|       |	 */
  324|  1.51k|	if (self == father->rb_nodes[other]) {
  ------------------
  |  Branch (324:6): [True: 696, False: 818]
  ------------------
  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|    696|		__archive_rb_tree_reparent_nodes(father, other);
  332|    696|	}
  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|  1.51k|	__archive_rb_tree_reparent_nodes(grandpa, which);
  340|       |
  341|       |	/*
  342|       |	 * Final step: Set the root to black.
  343|       |	 */
  344|  1.51k|	RB_MARK_BLACK(rbt->rbt_root);
  ------------------
  |  |   69|  1.51k|#define	RB_MARK_BLACK(rb) 	((void)((rb)->rb_info &= ~RB_FLAG_RED))
  |  |  ------------------
  |  |  |  |   46|  1.51k|#define	RB_FLAG_RED		0x1
  |  |  ------------------
  ------------------
  345|  1.51k|}
archive_rb.c:__archive_rb_tree_reparent_nodes:
  233|  2.21k|{
  234|  2.21k|	const unsigned int other = which ^ RB_DIR_OTHER;
  ------------------
  |  |   41|  2.21k|#define	RB_DIR_OTHER		1
  ------------------
  235|  2.21k|	struct archive_rb_node * const grandpa = RB_FATHER(old_father);
  ------------------
  |  |   49|  2.21k|    ((struct archive_rb_node *)((rb)->rb_info & ~RB_FLAG_MASK))
  |  |  ------------------
  |  |  |  |   47|  2.21k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  2.21k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  2.21k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  236|  2.21k|	struct archive_rb_node * const old_child = old_father->rb_nodes[which];
  237|  2.21k|	struct archive_rb_node * const new_father = old_child;
  238|  2.21k|	struct archive_rb_node * const new_child = old_father;
  239|       |
  240|  2.21k|	if (new_father == NULL)
  ------------------
  |  Branch (240:6): [True: 0, False: 2.21k]
  ------------------
  241|      0|		return;
  242|       |	/*
  243|       |	 * Exchange descendant linkages.
  244|       |	 */
  245|  2.21k|	grandpa->rb_nodes[RB_POSITION(old_father)] = new_father;
  ------------------
  |  |   63|  2.21k|    (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   45|  2.21k|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  |  |                   (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   40|  1.08k|#define	RB_DIR_RIGHT		1
  |  |  ------------------
  |  |                   (((rb)->rb_info & RB_FLAG_POSITION) ? RB_DIR_RIGHT : RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   39|  1.12k|#define	RB_DIR_LEFT		0
  |  |  ------------------
  |  |  |  Branch (63:6): [True: 1.08k, False: 1.12k]
  |  |  ------------------
  ------------------
  246|  2.21k|	new_child->rb_nodes[which] = old_child->rb_nodes[other];
  247|  2.21k|	new_father->rb_nodes[other] = new_child;
  248|       |
  249|       |	/*
  250|       |	 * Update ancestor linkages
  251|       |	 */
  252|  2.21k|	RB_SET_FATHER(new_father, grandpa);
  ------------------
  |  |   51|  2.21k|    ((void)((rb)->rb_info = (uintptr_t)(father)|((rb)->rb_info & RB_FLAG_MASK)))
  |  |  ------------------
  |  |  |  |   47|  2.21k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  2.21k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  2.21k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  253|  2.21k|	RB_SET_FATHER(new_child, new_father);
  ------------------
  |  |   51|  2.21k|    ((void)((rb)->rb_info = (uintptr_t)(father)|((rb)->rb_info & RB_FLAG_MASK)))
  |  |  ------------------
  |  |  |  |   47|  2.21k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  2.21k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  2.21k|#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|  2.21k|	RB_SWAP_PROPERTIES(new_father, new_child);
  ------------------
  |  |   78|  2.21k|#define RB_SWAP_PROPERTIES(a, b) do { \
  |  |   79|  2.21k|    uintptr_t xorinfo = ((a)->rb_info ^ (b)->rb_info) & RB_FLAG_MASK; \
  |  |  ------------------
  |  |  |  |   47|  2.21k|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|  2.21k|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|  2.21k|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |   80|  2.21k|    (a)->rb_info ^= xorinfo; \
  |  |   81|  2.21k|    (b)->rb_info ^= xorinfo; \
  |  |   82|  2.21k|  } while (/*CONSTCOND*/ 0)
  |  |  ------------------
  |  |  |  Branch (82:26): [Folded, False: 2.21k]
  |  |  ------------------
  ------------------
  260|  2.21k|	RB_SET_POSITION(new_child, other);
  ------------------
  |  |   73|  2.21k|    ((void)((position) ? ((rb)->rb_info |= RB_FLAG_POSITION) : \
  |  |  ------------------
  |  |  |  |   45|    886|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  |  |  |  Branch (73:13): [True: 886, False: 1.32k]
  |  |  ------------------
  |  |   74|  2.21k|    ((rb)->rb_info &= ~RB_FLAG_POSITION)))
  |  |  ------------------
  |  |  |  |   45|  1.32k|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  ------------------
  261|       |
  262|       |	/*
  263|       |	 * Make sure to reparent the new child to ourself.
  264|       |	 */
  265|  2.21k|	if (!RB_SENTINEL_P(new_child->rb_nodes[which])) {
  ------------------
  |  |   53|  2.21k|#define	RB_SENTINEL_P(rb)	((rb) == NULL)
  ------------------
  |  Branch (265:6): [True: 630, False: 1.58k]
  ------------------
  266|    630|		RB_SET_FATHER(new_child->rb_nodes[which], new_child);
  ------------------
  |  |   51|    630|    ((void)((rb)->rb_info = (uintptr_t)(father)|((rb)->rb_info & RB_FLAG_MASK)))
  |  |  ------------------
  |  |  |  |   47|    630|#define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   45|    630|#define	RB_FLAG_POSITION	0x2
  |  |  |  |  ------------------
  |  |  |  |               #define	RB_FLAG_MASK		(RB_FLAG_POSITION|RB_FLAG_RED)
  |  |  |  |  ------------------
  |  |  |  |  |  |   46|    630|#define	RB_FLAG_RED		0x1
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  267|    630|		RB_SET_POSITION(new_child->rb_nodes[which], which);
  ------------------
  |  |   73|    630|    ((void)((position) ? ((rb)->rb_info |= RB_FLAG_POSITION) : \
  |  |  ------------------
  |  |  |  |   45|    427|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  |  |  |  Branch (73:13): [True: 427, False: 203]
  |  |  ------------------
  |  |   74|    630|    ((rb)->rb_info &= ~RB_FLAG_POSITION)))
  |  |  ------------------
  |  |  |  |   45|    203|#define	RB_FLAG_POSITION	0x2
  |  |  ------------------
  ------------------
  268|    630|	}
  269|       |
  270|  2.21k|}

archive_read_new:
   97|  16.7k|{
   98|  16.7k|	struct archive_read *a;
   99|       |
  100|  16.7k|	a = calloc(1, sizeof(*a));
  101|  16.7k|	if (a == NULL)
  ------------------
  |  Branch (101:6): [True: 0, False: 16.7k]
  ------------------
  102|      0|		return (NULL);
  103|  16.7k|	a->archive.magic = ARCHIVE_READ_MAGIC;
  ------------------
  |  |   59|  16.7k|#define	ARCHIVE_READ_MAGIC	(0xdeb0c5U)
  ------------------
  104|       |
  105|  16.7k|	a->archive.state = ARCHIVE_STATE_NEW;
  ------------------
  |  |   76|  16.7k|#define	ARCHIVE_STATE_NEW	0x01U
  ------------------
  106|  16.7k|	a->entry = archive_entry_new2(&a->archive);
  107|  16.7k|	if (a->entry == NULL) {
  ------------------
  |  Branch (107:6): [True: 0, False: 16.7k]
  ------------------
  108|      0|		free(a);
  109|      0|		return (NULL);
  110|      0|	}
  111|  16.7k|	a->archive.vtable = &archive_read_vtable;
  112|  16.7k|	a->entry_bytes_declared = -1;
  113|       |
  114|  16.7k|	a->passphrases.last = &a->passphrases.first;
  115|       |
  116|  16.7k|	return (&a->archive);
  117|  16.7k|}
archive_read_set_open_callback:
  272|  16.7k|{
  273|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
  274|  16.7k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
  275|  16.7k|	    "archive_read_set_open_callback");
  276|  16.7k|	a->client.opener = client_opener;
  277|  16.7k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  278|  16.7k|}
archive_read_set_read_callback:
  283|  16.7k|{
  284|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
  285|  16.7k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
  286|  16.7k|	    "archive_read_set_read_callback");
  287|  16.7k|	a->client.reader = client_reader;
  288|  16.7k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  289|  16.7k|}
archive_read_set_skip_callback:
  294|  16.7k|{
  295|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
  296|  16.7k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
  297|  16.7k|	    "archive_read_set_skip_callback");
  298|  16.7k|	a->client.skipper = client_skipper;
  299|  16.7k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  300|  16.7k|}
archive_read_set_seek_callback:
  305|  16.7k|{
  306|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
  307|  16.7k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
  308|  16.7k|	    "archive_read_set_seek_callback");
  309|  16.7k|	a->client.seeker = client_seeker;
  310|  16.7k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  311|  16.7k|}
archive_read_set_close_callback:
  316|  16.7k|{
  317|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
  318|  16.7k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
  319|  16.7k|	    "archive_read_set_close_callback");
  320|  16.7k|	a->client.closer = client_closer;
  321|  16.7k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  322|  16.7k|}
archive_read_set_callback_data:
  337|  16.7k|{
  338|  16.7k|	return archive_read_set_callback_data2(_a, client_data, 0);
  339|  16.7k|}
archive_read_set_callback_data2:
  344|  16.7k|{
  345|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
  346|  16.7k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
  347|  16.7k|	    "archive_read_set_callback_data2");
  348|       |
  349|  16.7k|	if (a->client.nodes == 0)
  ------------------
  |  Branch (349:6): [True: 16.7k, False: 0]
  ------------------
  350|  16.7k|	{
  351|  16.7k|		a->client.dataset = (struct archive_read_data_node *)
  352|  16.7k|		    calloc(1, sizeof(*a->client.dataset));
  353|  16.7k|		if (a->client.dataset == NULL)
  ------------------
  |  Branch (353:7): [True: 0, False: 16.7k]
  ------------------
  354|      0|		{
  355|      0|			archive_set_error(&a->archive, ENOMEM,
  356|      0|				"No memory");
  357|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  358|      0|		}
  359|  16.7k|		a->client.nodes = 1;
  360|  16.7k|	}
  361|       |
  362|  16.7k|	if (iindex > a->client.nodes - 1)
  ------------------
  |  Branch (362:6): [True: 0, False: 16.7k]
  ------------------
  363|      0|	{
  364|      0|		archive_set_error(&a->archive, EINVAL,
  365|      0|			"Invalid index specified");
  366|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  367|      0|	}
  368|  16.7k|	a->client.dataset[iindex].data = client_data;
  369|  16.7k|	a->client.dataset[iindex].begin_position = -1;
  370|  16.7k|	a->client.dataset[iindex].total_size = -1;
  371|  16.7k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  372|  16.7k|}
archive_read_open1:
  443|  16.7k|{
  444|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
  445|  16.7k|	struct archive_read_filter *f, *tmp;
  446|  16.7k|	int slot, e = ARCHIVE_OK;
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  447|       |
  448|  16.7k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
  449|  16.7k|	    "archive_read_open");
  450|  16.7k|	archive_clear_error(&a->archive);
  451|       |
  452|  16.7k|	if (a->client.reader == NULL) {
  ------------------
  |  Branch (452:6): [True: 0, False: 16.7k]
  ------------------
  453|      0|		archive_set_error(&a->archive, EINVAL,
  454|      0|		    "No reader function provided to archive_read_open");
  455|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  456|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  457|      0|	}
  458|       |
  459|  16.7k|	a->archive.state = ARCHIVE_STATE_OPEN;
  ------------------
  |  |   78|  16.7k|#define	ARCHIVE_STATE_OPEN	0x02U
  ------------------
  460|       |
  461|       |	/* Open data source. */
  462|  16.7k|	if (a->client.opener != NULL) {
  ------------------
  |  Branch (462:6): [True: 16.7k, False: 0]
  ------------------
  463|  16.7k|		e = (a->client.opener)(&a->archive, a->client.dataset[0].data);
  464|  16.7k|		if (e != ARCHIVE_OK) {
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (464:7): [True: 0, False: 16.7k]
  ------------------
  465|       |			/* If the open failed, call the closer to clean up. */
  466|      0|			read_client_close_proxy(a);
  467|      0|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  468|      0|			return (e);
  469|      0|		}
  470|  16.7k|	}
  471|       |
  472|  16.7k|	f = calloc(1, sizeof(*f));
  473|  16.7k|	if (f == NULL) {
  ------------------
  |  Branch (473:6): [True: 0, False: 16.7k]
  ------------------
  474|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  475|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  476|      0|	}
  477|  16.7k|	f->bidder = NULL;
  478|  16.7k|	f->upstream = NULL;
  479|  16.7k|	f->archive = a;
  480|  16.7k|	f->data = a->client.dataset[0].data;
  481|  16.7k|	f->vtable = &none_reader_vtable;
  482|  16.7k|	f->name = "none";
  483|  16.7k|	f->code = ARCHIVE_FILTER_NONE;
  ------------------
  |  |  309|  16.7k|#define	ARCHIVE_FILTER_NONE	0
  ------------------
  484|  16.7k|	f->can_skip = a->client.skipper != NULL;
  485|  16.7k|	f->can_seek = a->client.seeker != NULL;
  486|       |
  487|  16.7k|	a->client.dataset[0].begin_position = 0;
  488|  16.7k|	if (!a->filter || !a->bypass_filter_bidding)
  ------------------
  |  Branch (488:6): [True: 16.7k, False: 0]
  |  Branch (488:20): [True: 0, False: 0]
  ------------------
  489|  16.7k|	{
  490|  16.7k|		a->filter = f;
  491|       |		/* Build out the input pipeline. */
  492|  16.7k|		e = choose_filters(a);
  493|  16.7k|		if (e < ARCHIVE_WARN) {
  ------------------
  |  |  235|  16.7k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (493:7): [True: 302, False: 16.4k]
  ------------------
  494|    302|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|    302|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  495|    302|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    302|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  496|    302|		}
  497|  16.7k|	}
  498|      0|	else
  499|      0|	{
  500|       |		/* Need to add "NONE" type filter at the end of the filter chain */
  501|      0|		tmp = a->filter;
  502|      0|		while (tmp->upstream)
  ------------------
  |  Branch (502:10): [True: 0, False: 0]
  ------------------
  503|      0|			tmp = tmp->upstream;
  504|      0|		tmp->upstream = f;
  505|      0|	}
  506|       |
  507|  16.4k|	if (!a->format)
  ------------------
  |  Branch (507:6): [True: 16.4k, False: 0]
  ------------------
  508|  16.4k|	{
  509|  16.4k|		slot = choose_format(a);
  510|  16.4k|		if (slot < 0) {
  ------------------
  |  Branch (510:7): [True: 171, False: 16.2k]
  ------------------
  511|    171|			close_filters(a);
  512|    171|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|    171|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  513|    171|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    171|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  514|    171|		}
  515|  16.2k|		a->format = &(a->formats[slot]);
  516|  16.2k|	}
  517|      0|	else if (a->format->bid != NULL)
  ------------------
  |  Branch (517:11): [True: 0, False: 0]
  ------------------
  518|      0|	{
  519|      0|		if (bid_format(a, -1) < 0) {
  ------------------
  |  Branch (519:7): [True: 0, False: 0]
  ------------------
  520|      0|			archive_set_error(&a->archive,
  521|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  522|      0|			    "Registered format does not match");
  523|      0|			close_filters(a);
  524|      0|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  525|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  526|      0|		}
  527|      0|	}
  528|       |
  529|  16.2k|	a->archive.state = ARCHIVE_STATE_HEADER;
  ------------------
  |  |   80|  16.2k|#define	ARCHIVE_STATE_HEADER	0x04U
  ------------------
  530|       |
  531|       |	/* Ensure libarchive starts from the first node in a multivolume set */
  532|  16.2k|	client_switch_proxy(a->filter, 0);
  533|  16.2k|	return (e);
  534|  16.4k|}
__archive_read_header:
  602|    726|{
  603|    726|	if (!a->filter->vtable->read_header)
  ------------------
  |  Branch (603:6): [True: 540, False: 186]
  ------------------
  604|    540|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    540|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  605|    186|	return a->filter->vtable->read_header(a->filter, entry);
  606|    726|}
archive_read_has_encrypted_entries:
  810|  16.2k|{
  811|  16.2k|	struct archive_read *a = (struct archive_read *)_a;
  812|  16.2k|	int format_supports_encryption = archive_read_format_capabilities(_a)
  813|  16.2k|			& (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA | ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  398|  16.2k|#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|  16.2k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
  814|       |
  815|  16.2k|	if (!_a || !format_supports_encryption) {
  ------------------
  |  Branch (815:6): [True: 0, False: 16.2k]
  |  Branch (815:13): [True: 7.88k, False: 8.36k]
  ------------------
  816|       |		/* Format in general doesn't support encryption */
  817|  7.88k|		return ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED;
  ------------------
  |  |  410|  7.88k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED -2
  ------------------
  818|  7.88k|	}
  819|       |
  820|       |	/* A reader potentially has read enough data now. */
  821|  8.36k|	if (a->format && a->format->has_encrypted_entries) {
  ------------------
  |  Branch (821:6): [True: 8.36k, False: 0]
  |  Branch (821:19): [True: 8.36k, False: 0]
  ------------------
  822|  8.36k|		return (a->format->has_encrypted_entries)(a);
  823|  8.36k|	}
  824|       |
  825|       |	/* For any other reason we cannot say how many entries are there. */
  826|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  827|  8.36k|}
archive_read_format_capabilities:
  835|  32.5k|{
  836|  32.5k|	struct archive_read *a = (struct archive_read *)_a;
  837|  32.5k|	if (a && a->format && a->format->format_capabilties) {
  ------------------
  |  Branch (837:6): [True: 32.5k, False: 0]
  |  Branch (837:11): [True: 32.5k, False: 0]
  |  Branch (837:24): [True: 16.7k, False: 15.7k]
  ------------------
  838|  16.7k|		return (a->format->format_capabilties)(a);
  839|  16.7k|	}
  840|  15.7k|	return ARCHIVE_READ_FORMAT_CAPS_NONE;
  ------------------
  |  |  397|  15.7k|#define ARCHIVE_READ_FORMAT_CAPS_NONE (0) /* no special capabilities */
  ------------------
  841|  32.5k|}
archive_read_data:
  856|   518M|{
  857|   518M|	struct archive *a = (struct archive *)_a;
  858|   518M|	char	*dest;
  859|   518M|	const void *read_buf;
  860|   518M|	size_t	 bytes_read;
  861|   518M|	size_t	 len;
  862|   518M|	int	 r;
  863|       |
  864|   518M|	bytes_read = 0;
  865|   518M|	dest = (char *)buff;
  866|       |
  867|  1.03G|	while (s > 0) {
  ------------------
  |  Branch (867:9): [True: 518M, False: 517M]
  ------------------
  868|   518M|		if (a->read_data_offset == a->read_data_output_offset &&
  ------------------
  |  Branch (868:7): [True: 1.74M, False: 516M]
  ------------------
  869|  1.74M|		    a->read_data_remaining == 0) {
  ------------------
  |  Branch (869:7): [True: 550k, False: 1.19M]
  ------------------
  870|   550k|			read_buf = a->read_data_block;
  871|   550k|			a->read_data_is_posix_read = 1;
  872|   550k|			a->read_data_requested = s;
  873|   550k|			r = archive_read_data_block(a, &read_buf,
  874|   550k|			    &a->read_data_remaining, &a->read_data_offset);
  875|   550k|			a->read_data_block = read_buf;
  876|   550k|			if (r == ARCHIVE_EOF &&
  ------------------
  |  |  232|  1.10M|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (876:8): [True: 389k, False: 161k]
  ------------------
  877|   389k|			    a->read_data_offset == a->read_data_output_offset &&
  ------------------
  |  Branch (877:8): [True: 385k, False: 3.88k]
  ------------------
  878|   385k|			    a->read_data_remaining == 0)
  ------------------
  |  Branch (878:8): [True: 385k, False: 0]
  ------------------
  879|   385k|				return (bytes_read);
  880|       |			/*
  881|       |			 * Error codes are all negative, so the status
  882|       |			 * return here cannot be confused with a valid
  883|       |			 * byte count.  (ARCHIVE_OK is zero.)
  884|       |			 */
  885|   165k|			if (r < ARCHIVE_OK)
  ------------------
  |  |  233|   165k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (885:8): [True: 39.1k, False: 126k]
  ------------------
  886|  39.1k|				return (r);
  887|   165k|		}
  888|       |
  889|   517M|		if (a->read_data_offset < a->read_data_output_offset) {
  ------------------
  |  Branch (889:7): [True: 2, False: 517M]
  ------------------
  890|      2|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  891|      2|			    "Encountered out-of-order sparse blocks");
  892|      2|			return (ARCHIVE_RETRY);
  ------------------
  |  |  234|      2|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  893|      2|		}
  894|       |
  895|       |		/* Compute the amount of zero padding needed. */
  896|   517M|		if (a->read_data_output_offset + (int64_t)s <
  ------------------
  |  Branch (896:7): [True: 516M, False: 1.32M]
  ------------------
  897|   517M|		    a->read_data_offset) {
  898|   516M|			len = s;
  899|   516M|		} else if (a->read_data_output_offset <
  ------------------
  |  Branch (899:14): [True: 3.90k, False: 1.31M]
  ------------------
  900|  1.32M|		    a->read_data_offset) {
  901|  3.90k|			len = (size_t)(a->read_data_offset -
  902|  3.90k|			    a->read_data_output_offset);
  903|  3.90k|		} else
  904|  1.31M|			len = 0;
  905|       |
  906|       |		/* Add zeroes. */
  907|   517M|		memset(dest, 0, len);
  908|   517M|		s -= len;
  909|   517M|		a->read_data_output_offset += len;
  910|   517M|		dest += len;
  911|   517M|		bytes_read += len;
  912|       |
  913|       |		/* Copy data if there is any space left. */
  914|   517M|		if (s > 0) {
  ------------------
  |  Branch (914:7): [True: 1.32M, False: 516M]
  ------------------
  915|  1.32M|			len = a->read_data_remaining;
  916|  1.32M|			if (len > s)
  ------------------
  |  Branch (916:8): [True: 1.19M, False: 126k]
  ------------------
  917|  1.19M|				len = s;
  918|  1.32M|			if (len) {
  ------------------
  |  Branch (918:8): [True: 1.29M, False: 23.8k]
  ------------------
  919|  1.29M|				memcpy(dest, a->read_data_block, len);
  920|  1.29M|				s -= len;
  921|  1.29M|				a->read_data_block += len;
  922|  1.29M|				a->read_data_remaining -= len;
  923|  1.29M|				a->read_data_output_offset += len;
  924|  1.29M|				a->read_data_offset += len;
  925|  1.29M|				dest += len;
  926|  1.29M|				bytes_read += len;
  927|  1.29M|			}
  928|  1.32M|		}
  929|   517M|	}
  930|   517M|	a->read_data_is_posix_read = 0;
  931|   517M|	a->read_data_requested = 0;
  932|   517M|	return (bytes_read);
  933|   518M|}
__archive_reset_read_data:
  939|   497k|{
  940|   497k|	a->read_data_output_offset = 0;
  941|   497k|	a->read_data_remaining = 0;
  942|   497k|	a->read_data_is_posix_read = 0;
  943|   497k|	a->read_data_requested = 0;
  944|       |
  945|       |   /* extra resets, from rar.c */
  946|       |   a->read_data_block = NULL;
  947|   497k|   a->read_data_offset = 0;
  948|   497k|}
archive_read_data_skip:
  955|   397k|{
  956|   397k|	struct archive_read *a = (struct archive_read *)_a;
  957|   397k|	int r;
  958|   397k|	const void *buff;
  959|   397k|	size_t size;
  960|   397k|	int64_t offset;
  961|       |
  962|   397k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|   397k|	do { \
  |  |  180|   397k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|   397k|			(allowed_states), (function_name)); \
  |  |  182|   397k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|   397k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 397k]
  |  |  ------------------
  |  |  183|   397k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|   397k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 397k]
  |  |  ------------------
  ------------------
  963|   397k|	    ARCHIVE_STATE_DATA | ARCHIVE_STATE_DATA_RECOVERY,
  964|   397k|	    "archive_read_data_skip");
  965|       |
  966|   397k|	if (a->format->read_data_skip != NULL)
  ------------------
  |  Branch (966:6): [True: 397k, False: 0]
  ------------------
  967|   397k|		r = (a->format->read_data_skip)(a);
  968|      0|	else {
  969|      0|		while ((r = archive_read_data_block(&a->archive,
  ------------------
  |  Branch (969:10): [True: 0, False: 0]
  ------------------
  970|      0|			    &buff, &size, &offset))
  971|      0|		    == ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  972|      0|			;
  973|      0|	}
  974|       |
  975|   397k|	if (r == ARCHIVE_EOF)
  ------------------
  |  |  232|   397k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (975:6): [True: 144, False: 397k]
  ------------------
  976|    144|		r = ARCHIVE_OK;
  ------------------
  |  |  233|    144|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  977|       |
  978|   397k|	if (r == ARCHIVE_FATAL)
  ------------------
  |  |  239|   397k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (978:6): [True: 2.21k, False: 395k]
  ------------------
  979|  2.21k|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|  2.21k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  980|   395k|	else
  981|   395k|		a->archive.state = ARCHIVE_STATE_HEADER;
  ------------------
  |  |   80|   395k|#define	ARCHIVE_STATE_HEADER	0x04U
  ------------------
  982|   397k|	return (r);
  983|   397k|}
archive_seek_data:
  987|  16.2k|{
  988|  16.2k|	struct archive_read *a = (struct archive_read *)_a;
  989|  16.2k|	la_int64_t r;
  990|       |
  991|  16.2k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_DATA,
  ------------------
  |  |  179|  16.2k|	do { \
  |  |  180|  16.2k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.2k|			(allowed_states), (function_name)); \
  |  |  182|  16.2k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.2k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 16.2k, False: 0]
  |  |  ------------------
  |  |  183|  16.2k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|  16.2k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.2k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 0]
  |  |  ------------------
  ------------------
  992|  16.2k|	    "archive_seek_data_block");
  993|       |
  994|      0|	if (a->format->seek_data == NULL) {
  ------------------
  |  Branch (994:6): [True: 0, False: 0]
  ------------------
  995|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  996|      0|		    "Cannot seek data with this format");
  997|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  998|      0|	}
  999|       |
 1000|      0|	r = (a->format->seek_data)(a, offset, whence);
 1001|      0|	if (r == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1001:6): [True: 0, False: 0]
  ------------------
 1002|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
 1003|      0|	return (r);
 1004|      0|}
__archive_read_free_filters:
 1061|  17.0k|{
 1062|       |	/* Make sure filters are closed and their buffers are freed */
 1063|  17.0k|	close_filters(a);
 1064|       |
 1065|  36.1k|	while (a->filter != NULL) {
  ------------------
  |  Branch (1065:9): [True: 19.0k, False: 17.0k]
  ------------------
 1066|  19.0k|		struct archive_read_filter *t = a->filter->upstream;
 1067|  19.0k|		free(a->filter);
 1068|  19.0k|		a->filter = t;
 1069|  19.0k|	}
 1070|  17.0k|}
__archive_read_register_format:
 1242|   301k|{
 1243|   301k|	int i, number_slots;
 1244|       |
 1245|   301k|	archive_check_magic(&a->archive,
  ------------------
  |  |  179|   301k|	do { \
  |  |  180|   301k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|   301k|			(allowed_states), (function_name)); \
  |  |  182|   301k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|   301k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 301k]
  |  |  ------------------
  |  |  183|   301k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|   301k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 301k]
  |  |  ------------------
  ------------------
 1246|   301k|	    ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
 1247|   301k|	    "__archive_read_register_format");
 1248|       |
 1249|   301k|	number_slots = sizeof(a->formats) / sizeof(a->formats[0]);
 1250|       |
 1251|  2.42M|	for (i = 0; i < number_slots; i++) {
  ------------------
  |  Branch (1251:14): [True: 2.42M, False: 0]
  ------------------
 1252|  2.42M|		if (a->formats[i].bid == bid)
  ------------------
  |  Branch (1252:7): [True: 33.4k, False: 2.39M]
  ------------------
 1253|  33.4k|			return (ARCHIVE_WARN); /* We've already installed */
  ------------------
  |  |  235|  33.4k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1254|  2.39M|		if (a->formats[i].bid == NULL) {
  ------------------
  |  Branch (1254:7): [True: 267k, False: 2.12M]
  ------------------
 1255|   267k|			a->formats[i].bid = bid;
 1256|   267k|			a->formats[i].options = options;
 1257|   267k|			a->formats[i].read_header = read_header;
 1258|   267k|			a->formats[i].read_data = read_data;
 1259|   267k|			a->formats[i].read_data_skip = read_data_skip;
 1260|   267k|			a->formats[i].seek_data = seek_data;
 1261|   267k|			a->formats[i].cleanup = cleanup;
 1262|   267k|			a->formats[i].data = format_data;
 1263|   267k|			a->formats[i].name = name;
 1264|   267k|			a->formats[i].format_capabilties = format_capabilities;
 1265|   267k|			a->formats[i].has_encrypted_entries = has_encrypted_entries;
 1266|   267k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|   267k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1267|   267k|		}
 1268|  2.39M|	}
 1269|       |
 1270|      0|	archive_set_error(&a->archive, ENOMEM,
 1271|      0|	    "Not enough slots for format registration");
 1272|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1273|   301k|}
__archive_read_register_bidder:
 1283|   217k|{
 1284|   217k|	struct archive_read_filter_bidder *bidder;
 1285|   217k|	int i, number_slots;
 1286|       |
 1287|   217k|	archive_check_magic(&a->archive, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|   217k|	do { \
  |  |  180|   217k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|   217k|			(allowed_states), (function_name)); \
  |  |  182|   217k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|   217k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 217k]
  |  |  ------------------
  |  |  183|   217k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|   217k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 217k]
  |  |  ------------------
  ------------------
 1288|   217k|	    ARCHIVE_STATE_NEW, "__archive_read_register_bidder");
 1289|       |
 1290|   217k|	number_slots = sizeof(a->bidders) / sizeof(a->bidders[0]);
 1291|       |
 1292|  1.52M|	for (i = 0; i < number_slots; i++) {
  ------------------
  |  Branch (1292:14): [True: 1.52M, False: 0]
  ------------------
 1293|  1.52M|		if (a->bidders[i].vtable != NULL)
  ------------------
  |  Branch (1293:7): [True: 1.30M, False: 217k]
  ------------------
 1294|  1.30M|			continue;
 1295|   217k|		memset(a->bidders + i, 0, sizeof(a->bidders[0]));
 1296|   217k|		bidder = (a->bidders + i);
 1297|   217k|		bidder->data = bidder_data;
 1298|   217k|		bidder->vtable = vtable;
 1299|   217k|		if (bidder->vtable->bid == NULL || bidder->vtable->init == NULL) {
  ------------------
  |  Branch (1299:7): [True: 0, False: 217k]
  |  Branch (1299:38): [True: 0, False: 217k]
  ------------------
 1300|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1301|      0|					"Internal error: "
 1302|      0|					"no bid/init for filter bidder");
 1303|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1304|      0|		}
 1305|       |
 1306|   217k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|   217k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1307|   217k|	}
 1308|       |
 1309|      0|	archive_set_error(&a->archive, ENOMEM,
 1310|      0|	    "Not enough slots for filter registration");
 1311|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1312|   217k|}
__archive_read_ahead:
 1367|  13.7M|{
 1368|  13.7M|	return (__archive_read_filter_ahead(a->filter, min, avail));
 1369|  13.7M|}
__archive_read_filter_ahead:
 1374|  17.0M|{
 1375|  17.0M|	ssize_t bytes_read;
 1376|  17.0M|	size_t min, tocopy;
 1377|       |
 1378|  17.0M|	if (f->fatal) {
  ------------------
  |  Branch (1378:6): [True: 5.21k, False: 17.0M]
  ------------------
 1379|  5.21k|		if (avail)
  ------------------
  |  Branch (1379:7): [True: 1.72k, False: 3.48k]
  ------------------
 1380|  1.72k|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|  1.72k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1381|  5.21k|		return (NULL);
 1382|  5.21k|	}
 1383|       |	/* request == 0 is perfectly well-defined.*/
 1384|  17.0M|	min = request == 0 ? 1 : request;
  ------------------
  |  Branch (1384:8): [True: 52.9k, False: 16.9M]
  ------------------
 1385|       |
 1386|       |	/*
 1387|       |	 * Keep pulling more data until we can satisfy the request.
 1388|       |	 */
 1389|  20.0M|	for (;;) {
 1390|       |
 1391|       |		/*
 1392|       |		 * If we can satisfy from the copy buffer (and the
 1393|       |		 * copy buffer isn't empty), we're done.
 1394|       |		 */
 1395|  20.0M|		if (f->avail >= min) {
  ------------------
  |  Branch (1395:7): [True: 3.71M, False: 16.3M]
  ------------------
 1396|  3.71M|			if (avail != NULL)
  ------------------
  |  Branch (1396:8): [True: 3.41M, False: 293k]
  ------------------
 1397|  3.41M|				*avail = f->avail;
 1398|  3.71M|			return (f->next);
 1399|  3.71M|		}
 1400|       |
 1401|       |		/*
 1402|       |		 * We can satisfy directly from client buffer if everything
 1403|       |		 * currently in the copy buffer is still in the client buffer.
 1404|       |		 */
 1405|  16.3M|		if (f->client_total >= f->client_avail + f->avail
  ------------------
  |  Branch (1405:7): [True: 13.3M, False: 2.99M]
  ------------------
 1406|  13.3M|		    && f->client_avail + f->avail >= min) {
  ------------------
  |  Branch (1406:10): [True: 13.2M, False: 103k]
  ------------------
 1407|       |			/* "Roll back" to client buffer. */
 1408|  13.2M|			f->client_avail += f->avail;
 1409|  13.2M|			f->client_next -= f->avail;
 1410|       |			/* Copy buffer is now empty. */
 1411|  13.2M|			f->avail = 0;
 1412|  13.2M|			f->next = f->buffer;
 1413|       |			/* Return data from client buffer. */
 1414|  13.2M|			if (avail != NULL)
  ------------------
  |  Branch (1414:8): [True: 941k, False: 12.3M]
  ------------------
 1415|   941k|				*avail = f->client_avail;
 1416|  13.2M|			return (f->client_next);
 1417|  13.2M|		}
 1418|       |
 1419|       |		/* Move data forward in copy buffer if necessary. */
 1420|  3.10M|		if (f->next > f->buffer &&
  ------------------
  |  Branch (1420:7): [True: 24.3k, False: 3.07M]
  ------------------
 1421|  24.3k|		    min > f->buffer_size - (f->next - f->buffer)) {
  ------------------
  |  Branch (1421:7): [True: 19.5k, False: 4.82k]
  ------------------
 1422|  19.5k|			if (f->avail > 0)
  ------------------
  |  Branch (1422:8): [True: 19.0k, False: 472]
  ------------------
 1423|  19.0k|				memmove(f->buffer, f->next,
 1424|  19.0k|				    f->avail);
 1425|  19.5k|			f->next = f->buffer;
 1426|  19.5k|		}
 1427|       |
 1428|       |		/* If we've used up the client data, get more. */
 1429|  3.10M|		if (f->client_avail <= 0) {
  ------------------
  |  Branch (1429:7): [True: 109k, False: 2.99M]
  ------------------
 1430|   109k|			static const char *empty = "";
 1431|       |
 1432|   109k|			if (f->end_of_file) {
  ------------------
  |  Branch (1432:8): [True: 19.1k, False: 90.0k]
  ------------------
 1433|  19.1k|				const char *eof;
 1434|       |
 1435|  19.1k|				if (avail != NULL)
  ------------------
  |  Branch (1435:9): [True: 13.4k, False: 5.62k]
  ------------------
 1436|  13.4k|					*avail = f->avail;
 1437|  19.1k|				if (request == 0)
  ------------------
  |  Branch (1437:9): [True: 14, False: 19.1k]
  ------------------
 1438|     14|					eof = f->avail == 0 ? empty : f->next;
  ------------------
  |  Branch (1438:12): [True: 14, False: 0]
  ------------------
 1439|  19.1k|				else
 1440|  19.1k|				 	eof = NULL;
 1441|  19.1k|				return (eof);
 1442|  19.1k|			}
 1443|  90.0k|			bytes_read = (f->vtable->read)(f,
 1444|  90.0k|			    &f->client_buff);
 1445|  90.0k|			if (bytes_read < 0) {		/* Read error. */
  ------------------
  |  Branch (1445:8): [True: 977, False: 89.0k]
  ------------------
 1446|    977|				f->client_total = f->client_avail = 0;
 1447|    977|				f->client_next =
 1448|    977|				    f->client_buff = NULL;
 1449|    977|				f->fatal = 1;
 1450|    977|				if (avail != NULL)
  ------------------
  |  Branch (1450:9): [True: 604, False: 373]
  ------------------
 1451|    604|					*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|    604|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1452|    977|				return (NULL);
 1453|    977|			}
 1454|  89.0k|			if (bytes_read == 0) {
  ------------------
  |  Branch (1454:8): [True: 19.9k, False: 69.1k]
  ------------------
 1455|  19.9k|				const char *eof;
 1456|       |
 1457|       |				/* Check for another client object first */
 1458|  19.9k|				if (f->archive->client.cursor !=
  ------------------
  |  Branch (1458:9): [True: 0, False: 19.9k]
  ------------------
 1459|  19.9k|				      f->archive->client.nodes - 1) {
 1460|      0|					if (client_switch_proxy(f,
  ------------------
  |  Branch (1460:10): [True: 0, False: 0]
  ------------------
 1461|      0|					    f->archive->client.cursor + 1)
 1462|      0|					    == ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1463|      0|						continue;
 1464|      0|				}
 1465|       |				/* Premature end-of-file. */
 1466|  19.9k|				f->client_total = f->client_avail = 0;
 1467|  19.9k|				f->client_next =
 1468|  19.9k|				    f->client_buff = NULL;
 1469|  19.9k|				f->end_of_file = 1;
 1470|       |				/* Return whatever we do have. */
 1471|  19.9k|				if (avail != NULL)
  ------------------
  |  Branch (1471:9): [True: 9.61k, False: 10.3k]
  ------------------
 1472|  9.61k|					*avail = f->avail;
 1473|  19.9k|				if (request == 0)
  ------------------
  |  Branch (1473:9): [True: 15, False: 19.9k]
  ------------------
 1474|     15|					eof = f->avail == 0 ? empty : f->next;
  ------------------
  |  Branch (1474:12): [True: 15, False: 0]
  ------------------
 1475|  19.9k|				else
 1476|  19.9k|				 	eof = NULL;
 1477|  19.9k|				return (eof);
 1478|  19.9k|			}
 1479|  69.1k|			f->client_total = bytes_read;
 1480|  69.1k|			f->client_avail = f->client_total;
 1481|  69.1k|			f->client_next = f->client_buff;
 1482|  2.99M|		} else {
 1483|       |			/*
 1484|       |			 * We can't satisfy the request from the copy
 1485|       |			 * buffer or the existing client data, so we
 1486|       |			 * need to copy more client data over to the
 1487|       |			 * copy buffer.
 1488|       |			 */
 1489|       |
 1490|       |			/* Ensure the buffer is big enough. */
 1491|  2.99M|			if (min > f->buffer_size) {
  ------------------
  |  Branch (1491:8): [True: 14.5k, False: 2.97M]
  ------------------
 1492|  14.5k|				size_t s;
 1493|  14.5k|				char *p;
 1494|       |
 1495|       |				/* Double the buffer; watch for overflow. */
 1496|  14.5k|				s = f->buffer_size;
 1497|  14.5k|				if (s == 0)
  ------------------
  |  Branch (1497:9): [True: 13.6k, False: 952]
  ------------------
 1498|  13.6k|					s = min;
 1499|  18.0k|				while (s < min) {
  ------------------
  |  Branch (1499:12): [True: 3.44k, False: 14.5k]
  ------------------
 1500|  3.44k|					if (archive_ckd_mul_size(&s, s, 2)) {
  ------------------
  |  Branch (1500:10): [True: 0, False: 3.44k]
  ------------------
 1501|       |						/* Integer overflow! */
 1502|      0|						archive_set_error(
 1503|      0|						    &f->archive->archive,
 1504|      0|						    ENOMEM,
 1505|      0|						    "Unable to allocate copy"
 1506|      0|						    " buffer");
 1507|      0|						f->fatal = 1;
 1508|      0|						if (avail != NULL)
  ------------------
  |  Branch (1508:11): [True: 0, False: 0]
  ------------------
 1509|      0|							*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1510|      0|						return (NULL);
 1511|      0|					}
 1512|  3.44k|				}
 1513|       |				/* Now s >= min, so allocate a new buffer. */
 1514|  14.5k|				p = malloc(s);
 1515|  14.5k|				if (p == NULL) {
  ------------------
  |  Branch (1515:9): [True: 9, False: 14.5k]
  ------------------
 1516|      9|					archive_set_error(
 1517|      9|						&f->archive->archive,
 1518|      9|						ENOMEM,
 1519|      9|					    "Unable to allocate copy buffer");
 1520|      9|					f->fatal = 1;
 1521|      9|					if (avail != NULL)
  ------------------
  |  Branch (1521:10): [True: 0, False: 9]
  ------------------
 1522|      0|						*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1523|      9|					return (NULL);
 1524|      9|				}
 1525|       |				/* Move data into newly-enlarged buffer. */
 1526|  14.5k|				if (f->avail > 0)
  ------------------
  |  Branch (1526:9): [True: 624, False: 13.9k]
  ------------------
 1527|    624|					memcpy(p, f->next, f->avail);
 1528|  14.5k|				free(f->buffer);
 1529|  14.5k|				f->next = f->buffer = p;
 1530|  14.5k|				f->buffer_size = s;
 1531|  14.5k|			}
 1532|       |
 1533|       |			/* We can add client data to copy buffer. */
 1534|       |			/* Don't waste time buffering more than we need to. */
 1535|  2.99M|			tocopy = min - f->avail;
 1536|       |			/* Don't copy more than is available. */
 1537|  2.99M|			if (tocopy > f->client_avail)
  ------------------
  |  Branch (1537:8): [True: 22.9k, False: 2.97M]
  ------------------
 1538|  22.9k|				tocopy = f->client_avail;
 1539|       |
 1540|  2.99M|			memcpy(f->next + f->avail,
 1541|  2.99M|			    f->client_next, tocopy);
 1542|       |			/* Remove this data from client buffer. */
 1543|  2.99M|			f->client_next += tocopy;
 1544|  2.99M|			f->client_avail -= tocopy;
 1545|       |			/* add it to copy buffer. */
 1546|  2.99M|			f->avail += tocopy;
 1547|  2.99M|		}
 1548|  3.10M|	}
 1549|  17.0M|}
__archive_read_consume:
 1556|  14.0M|{
 1557|  14.0M|	return (__archive_read_filter_consume(a->filter, request));
 1558|  14.0M|}
__archive_read_filter_consume:
 1563|  14.1M|{
 1564|  14.1M|	int64_t skipped;
 1565|       |
 1566|  14.1M|	if (request < 0)
  ------------------
  |  Branch (1566:6): [True: 591, False: 14.1M]
  ------------------
 1567|    591|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|    591|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1568|  14.1M|	if (request == 0)
  ------------------
  |  Branch (1568:6): [True: 781k, False: 13.3M]
  ------------------
 1569|   781k|		return 0;
 1570|       |
 1571|  13.3M|	skipped = advance_file_pointer(f, request);
 1572|  13.3M|	if (skipped == request)
  ------------------
  |  Branch (1572:6): [True: 13.3M, False: 4.25k]
  ------------------
 1573|  13.3M|		return (skipped);
 1574|       |	/* We hit EOF before we satisfied the skip request. */
 1575|  4.25k|	if (skipped < 0)  /* Map error code to 0 for error message below. */
  ------------------
  |  Branch (1575:6): [True: 168, False: 4.08k]
  ------------------
 1576|    168|		skipped = 0;
 1577|  4.25k|	archive_set_error(&f->archive->archive,
 1578|  4.25k|	    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  4.25k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1579|  4.25k|	    "Truncated input file (needed %jd bytes, only %jd available)",
 1580|  4.25k|	    (intmax_t)request, (intmax_t)skipped);
 1581|  4.25k|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|  4.25k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1582|  13.3M|}
__archive_read_seek:
 1706|  16.2k|{
 1707|  16.2k|	return __archive_read_filter_seek(a->filter, offset, whence);
 1708|  16.2k|}
__archive_read_filter_seek:
 1713|  16.2k|{
 1714|  16.2k|	struct archive_read_client *client;
 1715|  16.2k|	int64_t r;
 1716|  16.2k|	unsigned int cursor;
 1717|       |
 1718|  16.2k|	if (f->closed || f->fatal)
  ------------------
  |  Branch (1718:6): [True: 0, False: 16.2k]
  |  Branch (1718:19): [True: 163, False: 16.1k]
  ------------------
 1719|    163|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    163|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1720|  16.1k|	if (f->can_seek == 0)
  ------------------
  |  Branch (1720:6): [True: 473, False: 15.6k]
  ------------------
 1721|    473|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|    473|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1722|       |
 1723|  15.6k|	client = &(f->archive->client);
 1724|  15.6k|	switch (whence) {
 1725|      0|	case SEEK_CUR:
  ------------------
  |  Branch (1725:2): [True: 0, False: 15.6k]
  ------------------
 1726|       |		/* Adjust the offset and use SEEK_SET instead */
 1727|      0|		offset += f->position;
 1728|      0|		__LA_FALLTHROUGH;
 1729|  1.55k|	case SEEK_SET:
  ------------------
  |  Branch (1729:2): [True: 1.55k, False: 14.0k]
  ------------------
 1730|  1.55k|		cursor = 0;
 1731|  1.55k|		while (1)
  ------------------
  |  Branch (1731:10): [True: 1.55k, Folded]
  ------------------
 1732|  1.55k|		{
 1733|  1.55k|			if (client->dataset[cursor].begin_position < 0 ||
  ------------------
  |  Branch (1733:8): [True: 0, False: 1.55k]
  ------------------
 1734|  1.55k|			    client->dataset[cursor].total_size < 0 ||
  ------------------
  |  Branch (1734:8): [True: 554, False: 1.00k]
  ------------------
 1735|  1.00k|			    client->dataset[cursor].begin_position +
  ------------------
  |  Branch (1735:8): [True: 986, False: 14]
  ------------------
 1736|  1.00k|			      client->dataset[cursor].total_size - 1 > offset ||
 1737|     14|			    cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1737:8): [True: 14, False: 0]
  ------------------
 1738|  1.55k|				break;
 1739|      0|			r = client->dataset[cursor].begin_position +
 1740|      0|				client->dataset[cursor].total_size;
 1741|      0|			client->dataset[++cursor].begin_position = r;
 1742|      0|		}
 1743|  1.55k|		while (1) {
  ------------------
  |  Branch (1743:10): [True: 1.55k, Folded]
  ------------------
 1744|  1.55k|			r = client_switch_proxy(f, cursor);
 1745|  1.55k|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  1.55k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1745:8): [True: 0, False: 1.55k]
  ------------------
 1746|      0|				goto clear_buffer;
 1747|  1.55k|			if ((r = client_seek_proxy(f, 0, SEEK_END)) < 0)
  ------------------
  |  Branch (1747:8): [True: 0, False: 1.55k]
  ------------------
 1748|      0|				goto clear_buffer;
 1749|  1.55k|			client->dataset[cursor].total_size = r;
 1750|  1.55k|			if (client->dataset[cursor].begin_position +
  ------------------
  |  Branch (1750:8): [True: 1.50k, False: 50]
  ------------------
 1751|  1.55k|			    client->dataset[cursor].total_size - 1 > offset ||
 1752|     50|			    cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1752:8): [True: 50, False: 0]
  ------------------
 1753|  1.55k|				break;
 1754|      0|			r = client->dataset[cursor].begin_position +
 1755|      0|				client->dataset[cursor].total_size;
 1756|      0|			client->dataset[++cursor].begin_position = r;
 1757|      0|		}
 1758|  1.55k|		offset -= client->dataset[cursor].begin_position;
 1759|  1.55k|		if (offset < 0
  ------------------
  |  Branch (1759:7): [True: 20, False: 1.53k]
  ------------------
 1760|  1.53k|		    || offset > client->dataset[cursor].total_size) {
  ------------------
  |  Branch (1760:10): [True: 48, False: 1.48k]
  ------------------
 1761|     68|			r = ARCHIVE_FATAL;
  ------------------
  |  |  239|     68|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1762|     68|			goto clear_buffer;
 1763|     68|		}
 1764|  1.48k|		if ((r = client_seek_proxy(f, offset, SEEK_SET)) < 0)
  ------------------
  |  Branch (1764:7): [True: 0, False: 1.48k]
  ------------------
 1765|      0|			goto clear_buffer;
 1766|  1.48k|		break;
 1767|       |
 1768|  14.0k|	case SEEK_END:
  ------------------
  |  Branch (1768:2): [True: 14.0k, False: 1.55k]
  ------------------
 1769|  14.0k|		cursor = 0;
 1770|  14.0k|		while (1) {
  ------------------
  |  Branch (1770:10): [True: 14.0k, Folded]
  ------------------
 1771|  14.0k|			if (client->dataset[cursor].begin_position < 0 ||
  ------------------
  |  Branch (1771:8): [True: 0, False: 14.0k]
  ------------------
 1772|  14.0k|			    client->dataset[cursor].total_size < 0 ||
  ------------------
  |  Branch (1772:8): [True: 6.90k, False: 7.18k]
  ------------------
 1773|  7.18k|			    cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1773:8): [True: 7.18k, False: 0]
  ------------------
 1774|  14.0k|				break;
 1775|      0|			r = client->dataset[cursor].begin_position +
 1776|      0|				client->dataset[cursor].total_size;
 1777|      0|			client->dataset[++cursor].begin_position = r;
 1778|      0|		}
 1779|  14.0k|		while (1) {
  ------------------
  |  Branch (1779:10): [True: 14.0k, Folded]
  ------------------
 1780|  14.0k|			r = client_switch_proxy(f, cursor);
 1781|  14.0k|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  14.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1781:8): [True: 0, False: 14.0k]
  ------------------
 1782|      0|				goto clear_buffer;
 1783|  14.0k|			if ((r = client_seek_proxy(f, 0, SEEK_END)) < 0)
  ------------------
  |  Branch (1783:8): [True: 0, False: 14.0k]
  ------------------
 1784|      0|				goto clear_buffer;
 1785|  14.0k|			client->dataset[cursor].total_size = r;
 1786|  14.0k|			r = client->dataset[cursor].begin_position +
 1787|  14.0k|				client->dataset[cursor].total_size;
 1788|  14.0k|			if (cursor + 1 >= client->nodes)
  ------------------
  |  Branch (1788:8): [True: 14.0k, False: 0]
  ------------------
 1789|  14.0k|				break;
 1790|      0|			client->dataset[++cursor].begin_position = r;
 1791|      0|		}
 1792|  14.0k|		while (1) {
  ------------------
  |  Branch (1792:10): [True: 14.0k, Folded]
  ------------------
 1793|  14.0k|			if (r + offset >=
  ------------------
  |  Branch (1793:8): [True: 14.0k, False: 0]
  ------------------
 1794|  14.0k|			    client->dataset[cursor].begin_position)
 1795|  14.0k|				break;
 1796|      0|			offset += client->dataset[cursor].total_size;
 1797|      0|			if (cursor == 0)
  ------------------
  |  Branch (1797:8): [True: 0, False: 0]
  ------------------
 1798|      0|				break;
 1799|      0|			cursor--;
 1800|      0|			r = client->dataset[cursor].begin_position +
 1801|      0|				client->dataset[cursor].total_size;
 1802|      0|		}
 1803|  14.0k|		offset = (r + offset) - client->dataset[cursor].begin_position;
 1804|  14.0k|		if ((r = client_switch_proxy(f, cursor)) != ARCHIVE_OK)
  ------------------
  |  |  233|  14.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1804:7): [True: 0, False: 14.0k]
  ------------------
 1805|      0|			goto clear_buffer;
 1806|  14.0k|		r = client_seek_proxy(f, offset, SEEK_SET);
 1807|  14.0k|		if (r < ARCHIVE_OK)
  ------------------
  |  |  233|  14.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1807:7): [True: 0, False: 14.0k]
  ------------------
 1808|      0|			goto clear_buffer;
 1809|  14.0k|		break;
 1810|       |
 1811|  14.0k|	default:
  ------------------
  |  Branch (1811:2): [True: 0, False: 15.6k]
  ------------------
 1812|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1813|  15.6k|	}
 1814|  15.5k|	r += client->dataset[cursor].begin_position;
 1815|       |
 1816|  15.6k|clear_buffer:
 1817|       |	/*
 1818|       |	 * Ouch.  Clearing the buffer like this hurts, especially
 1819|       |	 * at bid time.  A lot of our efficiency at bid time comes
 1820|       |	 * from having bidders reuse the data we've already read.
 1821|       |	 *
 1822|       |	 * TODO: If the seek request is in data we already
 1823|       |	 * have, then don't call the seek callback.
 1824|       |	 *
 1825|       |	 * TODO: Zip seeks to end-of-file at bid time.  If
 1826|       |	 * other formats also start doing this, we may need to
 1827|       |	 * find a way for clients to fudge the seek offset to
 1828|       |	 * a block boundary.
 1829|       |	 *
 1830|       |	 * Hmmm... If whence was SEEK_END, we know the file
 1831|       |	 * size is (r - offset).  Can we use that to simplify
 1832|       |	 * the TODO items above?
 1833|       |	*/
 1834|  15.6k|	f->avail = f->client_avail = 0;
 1835|  15.6k|	f->next = f->buffer;
 1836|  15.6k|	if (r >= 0) {
  ------------------
  |  Branch (1836:6): [True: 15.5k, False: 68]
  ------------------
 1837|  15.5k|		f->position = r;
 1838|  15.5k|		f->end_of_file = 0;
 1839|  15.5k|	} else
 1840|     68|		f->fatal = 1;
 1841|       |
 1842|  15.6k|	return r;
 1843|  15.5k|}
archive_read.c:_archive_read_free:
 1119|  16.7k|{
 1120|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
 1121|  16.7k|	struct archive_read_passphrase *p;
 1122|  16.7k|	int i, n;
 1123|  16.7k|	int slots;
 1124|  16.7k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1125|       |
 1126|  16.7k|	if (_a == NULL)
  ------------------
  |  Branch (1126:6): [True: 0, False: 16.7k]
  ------------------
 1127|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1128|  16.7k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
 1129|  16.7k|	    ARCHIVE_STATE_ANY | ARCHIVE_STATE_FATAL, "archive_read_free");
 1130|  16.7k|	if (a->archive.state != ARCHIVE_STATE_CLOSED
  ------------------
  |  |   93|  33.4k|#define	ARCHIVE_STATE_CLOSED	0x40U
  ------------------
  |  Branch (1130:6): [True: 16.7k, False: 0]
  ------------------
 1131|  16.7k|	    && a->archive.state != ARCHIVE_STATE_FATAL)
  ------------------
  |  |   96|  16.7k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  |  Branch (1131:9): [True: 0, False: 16.7k]
  ------------------
 1132|      0|		r = archive_read_close(&a->archive);
 1133|       |
 1134|       |	/* Call cleanup functions registered by optional components. */
 1135|  16.7k|	if (a->cleanup_archive_extract != NULL)
  ------------------
  |  Branch (1135:6): [True: 0, False: 16.7k]
  ------------------
 1136|      0|		r = (a->cleanup_archive_extract)(a);
 1137|       |
 1138|       |	/* Cleanup format-specific data. */
 1139|  16.7k|	slots = sizeof(a->formats) / sizeof(a->formats[0]);
 1140|   284k|	for (i = 0; i < slots; i++) {
  ------------------
  |  Branch (1140:14): [True: 267k, False: 16.7k]
  ------------------
 1141|   267k|		a->format = &(a->formats[i]);
 1142|   267k|		if (a->formats[i].cleanup)
  ------------------
  |  Branch (1142:7): [True: 250k, False: 16.7k]
  ------------------
 1143|   250k|			(a->formats[i].cleanup)(a);
 1144|   267k|	}
 1145|       |
 1146|       |	/* Free the filters */
 1147|  16.7k|	__archive_read_free_filters(a);
 1148|       |
 1149|       |	/* Release the bidder objects. */
 1150|  16.7k|	n = sizeof(a->bidders)/sizeof(a->bidders[0]);
 1151|   284k|	for (i = 0; i < n; i++) {
  ------------------
  |  Branch (1151:14): [True: 267k, False: 16.7k]
  ------------------
 1152|   267k|		if (a->bidders[i].vtable == NULL ||
  ------------------
  |  Branch (1152:7): [True: 50.1k, False: 217k]
  ------------------
 1153|   217k|		    a->bidders[i].vtable->free == NULL)
  ------------------
  |  Branch (1153:7): [True: 217k, False: 0]
  ------------------
 1154|   267k|			continue;
 1155|      0|		(a->bidders[i].vtable->free)(&a->bidders[i]);
 1156|      0|	}
 1157|       |
 1158|       |	/* Release passphrase list. */
 1159|  16.7k|	p = a->passphrases.first;
 1160|  33.4k|	while (p != NULL) {
  ------------------
  |  Branch (1160:9): [True: 16.7k, False: 16.7k]
  ------------------
 1161|  16.7k|		struct archive_read_passphrase *np = p->next;
 1162|       |
 1163|       |		/* A passphrase should be cleaned. */
 1164|  16.7k|		memset(p->passphrase, 0, strlen(p->passphrase));
 1165|  16.7k|		free(p->passphrase);
 1166|  16.7k|		free(p);
 1167|  16.7k|		p = np;
 1168|  16.7k|	}
 1169|       |
 1170|  16.7k|	archive_string_free(&a->archive.error_string);
 1171|  16.7k|	archive_entry_free(a->entry);
 1172|  16.7k|	a->archive.magic = 0;
 1173|  16.7k|	__archive_clean(&a->archive);
 1174|  16.7k|	free(a->client.dataset);
 1175|  16.7k|	free(a);
 1176|  16.7k|	return (r);
 1177|  16.7k|}
archive_read.c:_archive_read_next_header:
  700|   500k|{
  701|   500k|	int ret;
  702|   500k|	struct archive_read *a = (struct archive_read *)_a;
  703|       |	*entryp = NULL;
  704|   500k|	ret = _archive_read_next_header2(_a, a->entry);
  705|   500k|	*entryp = a->entry;
  706|   500k|	return ret;
  707|   500k|}
archive_read.c:_archive_read_next_header2:
  613|   500k|{
  614|   500k|	struct archive_read *a = (struct archive_read *)_a;
  615|   500k|	int r1 = ARCHIVE_OK, r2;
  ------------------
  |  |  233|   500k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  616|       |
  617|   500k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|   500k|	do { \
  |  |  180|   500k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|   500k|			(allowed_states), (function_name)); \
  |  |  182|   500k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|   500k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 500k]
  |  |  ------------------
  |  |  183|   500k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|   500k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 500k]
  |  |  ------------------
  ------------------
  618|   500k|	    ARCHIVE_STATE_HEADER | ARCHIVE_STATE_DATA |
  619|   500k|	    ARCHIVE_STATE_DATA_RECOVERY,
  620|   500k|	    "archive_read_next_header");
  621|       |
  622|   500k|	archive_entry_clear(entry);
  623|   500k|	archive_clear_error(&a->archive);
  624|       |
  625|       |	/*
  626|       |	 * If client didn't consume entire data, skip any remainder
  627|       |	 * (This is especially important for GNU incremental directories.)
  628|       |	 * A header that failed to parse (DATA_RECOVERY) still needs the
  629|       |	 * same treatment: whatever of its body the format reader left
  630|       |	 * unconsumed must be skipped before we can read the next header.
  631|       |	 */
  632|   500k|	if (a->archive.state == ARCHIVE_STATE_DATA ||
  ------------------
  |  |   84|  1.00M|#define	ARCHIVE_STATE_DATA	0x08U
  ------------------
  |  Branch (632:6): [True: 397k, False: 102k]
  ------------------
  633|   397k|	    a->archive.state == ARCHIVE_STATE_DATA_RECOVERY) {
  ------------------
  |  |   88|   102k|#define	ARCHIVE_STATE_DATA_RECOVERY	0x10U
  ------------------
  |  Branch (633:6): [True: 0, False: 102k]
  ------------------
  634|   397k|		r1 = archive_read_data_skip(&a->archive);
  635|   397k|		if (r1 == ARCHIVE_EOF)
  ------------------
  |  |  232|   397k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (635:7): [True: 0, False: 397k]
  ------------------
  636|      0|			archive_set_error(&a->archive, EIO,
  637|      0|			    "Premature end-of-file");
  638|   397k|		if (r1 == ARCHIVE_EOF || r1 == ARCHIVE_FATAL) {
  ------------------
  |  |  232|   794k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
              		if (r1 == ARCHIVE_EOF || r1 == ARCHIVE_FATAL) {
  ------------------
  |  |  239|   397k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (638:7): [True: 0, False: 397k]
  |  Branch (638:28): [True: 2.21k, False: 395k]
  ------------------
  639|  2.21k|			a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|  2.21k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  640|  2.21k|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|  2.21k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  641|  2.21k|		}
  642|   397k|	}
  643|       |
  644|       |	/* Record start-of-header offset in uncompressed stream. */
  645|   497k|	a->header_position = a->filter->position;
  646|       |
  647|   497k|	++_a->file_count;
  648|   497k|	r2 = (a->format->read_header)(a, entry);
  649|       |
  650|       |	/*
  651|       |	 * EOF and FATAL are persistent at this layer.  By
  652|       |	 * modifying the state, we guarantee that future calls to
  653|       |	 * read a header or read data will fail.
  654|       |	 */
  655|   497k|	switch (r2) {
  ------------------
  |  Branch (655:10): [True: 497k, False: 0]
  ------------------
  656|  3.22k|	case ARCHIVE_EOF:
  ------------------
  |  |  232|  3.22k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (656:2): [True: 3.22k, False: 494k]
  ------------------
  657|  3.22k|		a->archive.state = ARCHIVE_STATE_EOF;
  ------------------
  |  |   91|  3.22k|#define	ARCHIVE_STATE_EOF	0x20U
  ------------------
  658|  3.22k|		--_a->file_count;/* Revert a file counter. */
  659|  3.22k|		break;
  660|   352k|	case ARCHIVE_OK:
  ------------------
  |  |  233|   352k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (660:2): [True: 352k, False: 144k]
  ------------------
  661|   352k|		a->archive.state = ARCHIVE_STATE_DATA;
  ------------------
  |  |   84|   352k|#define	ARCHIVE_STATE_DATA	0x08U
  ------------------
  662|   352k|		break;
  663|  46.9k|	case ARCHIVE_WARN:
  ------------------
  |  |  235|  46.9k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (663:2): [True: 46.9k, False: 451k]
  ------------------
  664|  46.9k|		a->archive.state = ARCHIVE_STATE_DATA;
  ------------------
  |  |   84|  46.9k|#define	ARCHIVE_STATE_DATA	0x08U
  ------------------
  665|  46.9k|		break;
  666|  86.4k|	case ARCHIVE_RETRY:
  ------------------
  |  |  234|  86.4k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (666:2): [True: 86.4k, False: 411k]
  ------------------
  667|  86.4k|		break;
  668|  8.33k|	case ARCHIVE_FATAL:
  ------------------
  |  |  239|  8.33k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (668:2): [True: 8.33k, False: 489k]
  ------------------
  669|  8.33k|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|  8.33k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
  670|  8.33k|		break;
  671|     58|	case ARCHIVE_FAILED:
  ------------------
  |  |  237|     58|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (671:2): [True: 58, False: 497k]
  ------------------
  672|       |		/*
  673|       |		 * This entry's header could not be parsed, so its metadata
  674|       |		 * cannot be trusted.  ARCHIVE_STATE_DATA_RECOVERY still
  675|       |		 * permits skipping past it (the format reader is
  676|       |		 * responsible for ensuring that's actually possible), but
  677|       |		 * blocks archive_read_data() and friends, which all check
  678|       |		 * for ARCHIVE_STATE_DATA specifically and would otherwise
  679|       |		 * return content for an entry we don't actually understand.
  680|       |		 */
  681|     58|		a->archive.state = ARCHIVE_STATE_DATA_RECOVERY;
  ------------------
  |  |   88|     58|#define	ARCHIVE_STATE_DATA_RECOVERY	0x10U
  ------------------
  682|     58|		break;
  683|   497k|	}
  684|       |
  685|   497k|	if (r2 == ARCHIVE_OK || r2 == ARCHIVE_WARN)
  ------------------
  |  |  233|   995k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	if (r2 == ARCHIVE_OK || r2 == ARCHIVE_WARN)
  ------------------
  |  |  235|   144k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (685:6): [True: 352k, False: 144k]
  |  Branch (685:26): [True: 46.9k, False: 98.0k]
  ------------------
  686|   399k|		a->entry_bytes_declared = archive_entry_size_is_set(entry)
  ------------------
  |  Branch (686:29): [True: 390k, False: 9.25k]
  ------------------
  687|   399k|		    ? archive_entry_size(entry) : -1;
  688|  98.0k|	else
  689|  98.0k|		a->entry_bytes_declared = -1;
  690|       |
  691|   497k|	__archive_reset_read_data(&a->archive);
  692|       |
  693|   497k|	a->data_start_node = a->client.cursor;
  694|       |	/* EOF always wins; otherwise return the worst error. */
  695|   497k|	return (r2 < r1 || r2 == ARCHIVE_EOF) ? r2 : r1;
  ------------------
  |  |  232|   356k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (695:10): [True: 141k, False: 356k]
  |  Branch (695:21): [True: 3.22k, False: 353k]
  ------------------
  696|   497k|}
archive_read.c:_archive_read_data_block:
 1017|   550k|{
 1018|   550k|	struct archive_read *a = (struct archive_read *)_a;
 1019|   550k|	int r;
 1020|       |
 1021|   550k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_DATA,
  ------------------
  |  |  179|   550k|	do { \
  |  |  180|   550k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|   550k|			(allowed_states), (function_name)); \
  |  |  182|   550k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|   550k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 58, False: 550k]
  |  |  ------------------
  |  |  183|   550k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|     58|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|   550k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 550k]
  |  |  ------------------
  ------------------
 1022|   550k|	    "archive_read_data_block");
 1023|       |
 1024|   550k|	if (a->format->read_data == NULL) {
  ------------------
  |  Branch (1024:6): [True: 0, False: 550k]
  ------------------
 1025|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1026|      0|		    "Internal error: "
 1027|      0|		    "No format->read_data function registered");
 1028|      0|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|      0|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
 1029|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1030|      0|	}
 1031|       |
 1032|   550k|	r = (a->format->read_data)(a, buff, size, offset);
 1033|   550k|	if (r == ARCHIVE_FATAL)
  ------------------
  |  |  239|   550k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1033:6): [True: 2.41k, False: 547k]
  ------------------
 1034|  2.41k|		a->archive.state = ARCHIVE_STATE_FATAL;
  ------------------
  |  |   96|  2.41k|#define	ARCHIVE_STATE_FATAL	0x8000U
  ------------------
 1035|   550k|	return (r);
 1036|   550k|}
archive_read.c:_archive_filter_bytes:
 1220|    365|{
 1221|    365|	struct archive_read_filter *f = get_filter(_a, n);
 1222|    365|	return f == NULL ? -1 : f->position;
  ------------------
  |  Branch (1222:9): [True: 0, False: 365]
  ------------------
 1223|    365|}
archive_read.c:get_filter:
 1181|    365|{
 1182|    365|	struct archive_read *a = (struct archive_read *)_a;
 1183|    365|	struct archive_read_filter *f = a->filter;
 1184|       |	/* We use n == -1 for 'the last filter', which is always the
 1185|       |	 * client proxy. */
 1186|    365|	if (n == -1 && f != NULL) {
  ------------------
  |  Branch (1186:6): [True: 0, False: 365]
  |  Branch (1186:17): [True: 0, False: 0]
  ------------------
 1187|      0|		struct archive_read_filter *last = f;
 1188|      0|		f = f->upstream;
 1189|      0|		while (f != NULL) {
  ------------------
  |  Branch (1189:10): [True: 0, False: 0]
  ------------------
 1190|      0|			last = f;
 1191|      0|			f = f->upstream;
 1192|      0|		}
 1193|      0|		return (last);
 1194|      0|	}
 1195|    365|	if (n < 0)
  ------------------
  |  Branch (1195:6): [True: 0, False: 365]
  ------------------
 1196|      0|		return NULL;
 1197|    365|	while (n > 0 && f != NULL) {
  ------------------
  |  Branch (1197:9): [True: 0, False: 365]
  |  Branch (1197:18): [True: 0, False: 0]
  ------------------
 1198|      0|		f = f->upstream;
 1199|      0|		--n;
 1200|      0|	}
 1201|    365|	return (f);
 1202|    365|}
archive_read.c:read_client_close_proxy:
  209|  16.7k|{
  210|  16.7k|	int r = ARCHIVE_OK, r2;
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  211|  16.7k|	unsigned int i;
  212|       |
  213|  16.7k|	if (a->client.closer == NULL)
  ------------------
  |  Branch (213:6): [True: 0, False: 16.7k]
  ------------------
  214|      0|		return (r);
  215|  33.4k|	for (i = 0; i < a->client.nodes; i++)
  ------------------
  |  Branch (215:14): [True: 16.7k, False: 16.7k]
  ------------------
  216|  16.7k|	{
  217|  16.7k|		r2 = (a->client.closer)
  218|  16.7k|			((struct archive *)a, a->client.dataset[i].data);
  219|  16.7k|		if (r > r2)
  ------------------
  |  Branch (219:7): [True: 0, False: 16.7k]
  ------------------
  220|      0|			r = r2;
  221|  16.7k|	}
  222|  16.7k|	return (r);
  223|  16.7k|}
archive_read.c:client_read_proxy:
  181|  48.2k|{
  182|  48.2k|	ssize_t r;
  183|  48.2k|	r = (f->archive->client.reader)(&f->archive->archive,
  184|  48.2k|	    f->data, buff);
  185|  48.2k|	return (r);
  186|  48.2k|}
archive_read.c:client_close_proxy:
  227|  16.7k|{
  228|  16.7k|	return read_client_close_proxy(f->archive);
  229|  16.7k|}
archive_read.c:client_switch_proxy:
  233|  45.9k|{
  234|  45.9k|	struct archive_read *a;
  235|  45.9k|	int r1 = ARCHIVE_OK, r2 = ARCHIVE_OK;
  ------------------
  |  |  233|  45.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	int r1 = ARCHIVE_OK, r2 = ARCHIVE_OK;
  ------------------
  |  |  233|  45.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  236|  45.9k|	void *data2;
  237|       |
  238|  47.5k|	while (f->upstream != NULL)
  ------------------
  |  Branch (238:9): [True: 1.54k, False: 45.9k]
  ------------------
  239|  1.54k|		f = f->upstream;
  240|  45.9k|	a = f->archive;
  241|       |
  242|       |	/* Don't do anything if already in the specified data node */
  243|  45.9k|	if (a->client.cursor == iindex)
  ------------------
  |  Branch (243:6): [True: 45.9k, False: 0]
  ------------------
  244|  45.9k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  45.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  245|       |
  246|      0|	a->client.cursor = iindex;
  247|      0|	data2 = a->client.dataset[a->client.cursor].data;
  248|      0|	if (a->client.switcher != NULL)
  ------------------
  |  Branch (248:6): [True: 0, False: 0]
  ------------------
  249|      0|	{
  250|      0|		r1 = r2 = (a->client.switcher)
  251|      0|			((struct archive *)a, f->data, data2);
  252|      0|		f->data = data2;
  253|      0|	}
  254|      0|	else
  255|      0|	{
  256|       |		/* Attempt to call close and open instead */
  257|      0|		if (a->client.closer != NULL)
  ------------------
  |  Branch (257:7): [True: 0, False: 0]
  ------------------
  258|      0|			r1 = (a->client.closer)
  259|      0|				((struct archive *)a, f->data);
  260|      0|		f->data = data2;
  261|      0|		if (a->client.opener != NULL)
  ------------------
  |  Branch (261:7): [True: 0, False: 0]
  ------------------
  262|      0|			r2 = (a->client.opener)
  263|      0|				((struct archive *)a, f->data);
  264|      0|	}
  265|      0|	f->client_total = f->client_avail = 0;
  266|      0|	return (r1 < r2) ? r1 : r2;
  ------------------
  |  Branch (266:9): [True: 0, False: 0]
  ------------------
  267|  45.9k|}
archive_read.c:choose_filters:
  547|  16.7k|{
  548|  16.7k|	int number_bidders, i, bid, best_bid, number_filters;
  549|  16.7k|	struct archive_read_filter_bidder *bidder, *best_bidder;
  550|  16.7k|	struct archive_read_filter *f;
  551|  16.7k|	ssize_t avail;
  552|  16.7k|	int r;
  553|       |
  554|  19.0k|	for (number_filters = 0; number_filters < MAX_NUMBER_FILTERS; ++number_filters) {
  ------------------
  |  |  543|  19.0k|#define MAX_NUMBER_FILTERS 25
  ------------------
  |  Branch (554:27): [True: 19.0k, False: 1]
  ------------------
  555|  19.0k|		number_bidders = sizeof(a->bidders) / sizeof(a->bidders[0]);
  556|       |
  557|  19.0k|		best_bid = 0;
  558|  19.0k|		best_bidder = NULL;
  559|       |
  560|  19.0k|		bidder = a->bidders;
  561|   324k|		for (i = 0; i < number_bidders; i++, bidder++) {
  ------------------
  |  Branch (561:15): [True: 305k, False: 19.0k]
  ------------------
  562|   305k|			if (bidder->vtable == NULL)
  ------------------
  |  Branch (562:8): [True: 57.2k, False: 248k]
  ------------------
  563|  57.2k|				continue;
  564|   248k|			bid = (bidder->vtable->bid)(bidder, a->filter);
  565|   248k|			if (bid > best_bid) {
  ------------------
  |  Branch (565:8): [True: 2.36k, False: 245k]
  ------------------
  566|  2.36k|				best_bid = bid;
  567|  2.36k|				best_bidder = bidder;
  568|  2.36k|			}
  569|   248k|		}
  570|       |
  571|       |		/* If no bidder, we're done. */
  572|  19.0k|		if (best_bidder == NULL) {
  ------------------
  |  Branch (572:7): [True: 16.7k, False: 2.36k]
  ------------------
  573|       |			/* Verify the filter by asking it for some data. */
  574|  16.7k|			__archive_read_filter_ahead(a->filter, 1, &avail);
  575|  16.7k|			if (avail < 0) {
  ------------------
  |  Branch (575:8): [True: 301, False: 16.4k]
  ------------------
  576|    301|				__archive_read_free_filters(a);
  577|    301|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    301|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  578|    301|			}
  579|  16.4k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  16.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  580|  16.7k|		}
  581|       |
  582|  2.36k|		f = calloc(1, sizeof(*f));
  583|  2.36k|		if (f == NULL)
  ------------------
  |  Branch (583:7): [True: 0, False: 2.36k]
  ------------------
  584|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  585|  2.36k|		f->bidder = best_bidder;
  586|  2.36k|		f->archive = a;
  587|  2.36k|		f->upstream = a->filter;
  588|  2.36k|		a->filter = f;
  589|  2.36k|		r = (best_bidder->vtable->init)(a->filter);
  590|  2.36k|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|  2.36k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (590:7): [True: 0, False: 2.36k]
  ------------------
  591|      0|			__archive_read_free_filters(a);
  592|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  593|      0|		}
  594|  2.36k|	}
  595|      1|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  596|      1|	    "Input requires too many filters for decoding");
  597|      1|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  598|  16.7k|}
archive_read.c:bid_format:
  711|   262k|{
  712|   262k|	int bid;
  713|       |
  714|   262k|	bid = (a->format->bid)(a, best_bid);
  715|   262k|	if (bid == ARCHIVE_FATAL)
  ------------------
  |  |  239|   262k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (715:6): [True: 0, False: 262k]
  ------------------
  716|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  717|   262k|	if (a->filter->position != 0 &&
  ------------------
  |  Branch (717:6): [True: 457, False: 262k]
  ------------------
  718|    457|	    __archive_read_seek(a, 0, SEEK_SET) < 0)
  ------------------
  |  Branch (718:6): [True: 1, False: 456]
  ------------------
  719|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  720|       |
  721|   262k|	return (bid);
  722|   262k|}
archive_read.c:choose_format:
  730|  16.4k|{
  731|  16.4k|	int slots;
  732|  16.4k|	int i;
  733|  16.4k|	int bid, best_bid;
  734|  16.4k|	int best_bid_slot;
  735|       |
  736|  16.4k|	slots = sizeof(a->formats) / sizeof(a->formats[0]);
  737|  16.4k|	best_bid = -1;
  738|  16.4k|	best_bid_slot = -1;
  739|       |
  740|       |	/* Set up a->format for convenience of bidders. */
  741|  16.4k|	a->format = &(a->formats[0]);
  742|   279k|	for (i = 0; i < slots; i++, a->format++) {
  ------------------
  |  Branch (742:14): [True: 262k, False: 16.4k]
  ------------------
  743|   262k|		if (a->format->bid) {
  ------------------
  |  Branch (743:7): [True: 262k, False: 0]
  ------------------
  744|   262k|			bid = bid_format(a, best_bid);
  745|   262k|			if (bid == ARCHIVE_FATAL)
  ------------------
  |  |  239|   262k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (745:8): [True: 1, False: 262k]
  ------------------
  746|      1|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  747|   262k|			if ((bid > best_bid) || (best_bid_slot < 0)) {
  ------------------
  |  Branch (747:8): [True: 31.3k, False: 231k]
  |  Branch (747:28): [True: 16.1k, False: 215k]
  ------------------
  748|  47.5k|				best_bid = bid;
  749|  47.5k|				best_bid_slot = i;
  750|  47.5k|			}
  751|   262k|		}
  752|   262k|	}
  753|       |
  754|       |	/*
  755|       |	 * There were no bidders; this is a serious programmer error
  756|       |	 * and demands a quick and definitive abort.
  757|       |	 */
  758|  16.4k|	if (best_bid_slot < 0) {
  ------------------
  |  Branch (758:6): [True: 0, False: 16.4k]
  ------------------
  759|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  760|      0|		    "No formats registered");
  761|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  762|      0|	}
  763|       |
  764|       |	/*
  765|       |	 * There were bidders, but no non-zero bids; this means we
  766|       |	 * can't support this stream.
  767|       |	 */
  768|  16.4k|	if (best_bid < 1) {
  ------------------
  |  Branch (768:6): [True: 170, False: 16.2k]
  ------------------
  769|    170|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    170|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  770|    170|		    "Unrecognized archive format");
  771|    170|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    170|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  772|    170|	}
  773|       |
  774|  16.2k|	return (best_bid_slot);
  775|  16.4k|}
archive_read.c:close_filters:
 1040|  17.1k|{
 1041|  17.1k|	struct archive_read_filter *f = a->filter;
 1042|  17.1k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  17.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1043|       |	/* Close each filter in the pipeline. */
 1044|  36.6k|	while (f != NULL) {
  ------------------
  |  Branch (1044:9): [True: 19.4k, False: 17.1k]
  ------------------
 1045|  19.4k|		struct archive_read_filter *t = f->upstream;
 1046|  19.4k|		if (!f->closed && f->vtable != NULL) {
  ------------------
  |  Branch (1046:7): [True: 19.0k, False: 388]
  |  Branch (1046:21): [True: 19.0k, False: 0]
  ------------------
 1047|  19.0k|			int r1 = (f->vtable->close)(f);
 1048|  19.0k|			f->closed = 1;
 1049|  19.0k|			if (r1 < r)
  ------------------
  |  Branch (1049:8): [True: 3, False: 19.0k]
  ------------------
 1050|      3|				r = r1;
 1051|  19.0k|		}
 1052|  19.4k|		free(f->buffer);
 1053|       |		f->buffer = NULL;
 1054|  19.4k|		f = t;
 1055|  19.4k|	}
 1056|  17.1k|	return r;
 1057|  17.1k|}
archive_read.c:advance_file_pointer:
 1592|  13.3M|{
 1593|  13.3M|	int64_t total_bytes_skipped = 0;
 1594|       |
 1595|  13.3M|	if (f->fatal)
  ------------------
  |  Branch (1595:6): [True: 54, False: 13.3M]
  ------------------
 1596|     54|		return (-1);
 1597|       |
 1598|       |	/* Use up the copy buffer first. */
 1599|  13.3M|	if (f->avail > 0) {
  ------------------
  |  Branch (1599:6): [True: 654k, False: 12.6M]
  ------------------
 1600|   654k|		size_t min = (size_t)minimum(request, (int64_t)f->avail);
  ------------------
  |  |   59|   654k|#define minimum(a, b) (a < b ? a : b)
  |  |  ------------------
  |  |  |  Branch (59:24): [True: 652k, False: 2.38k]
  |  |  ------------------
  ------------------
 1601|   654k|		f->next += min;
 1602|   654k|		f->avail -= min;
 1603|   654k|		request -= min;
 1604|   654k|		f->position += min;
 1605|   654k|		total_bytes_skipped += min;
 1606|   654k|	}
 1607|       |
 1608|       |	/* Then use up the client buffer. */
 1609|  13.3M|	if (f->client_avail > 0) {
  ------------------
  |  Branch (1609:6): [True: 12.7M, False: 636k]
  ------------------
 1610|  12.7M|		size_t min = (size_t)minimum(request, (int64_t)f->client_avail);
  ------------------
  |  |   59|  12.7M|#define minimum(a, b) (a < b ? a : b)
  |  |  ------------------
  |  |  |  Branch (59:24): [True: 12.6M, False: 41.3k]
  |  |  ------------------
  ------------------
 1611|  12.7M|		f->client_next += min;
 1612|  12.7M|		f->client_avail -= min;
 1613|  12.7M|		request -= min;
 1614|  12.7M|		f->position += min;
 1615|  12.7M|		total_bytes_skipped += min;
 1616|  12.7M|	}
 1617|  13.3M|	if (request == 0)
  ------------------
  |  Branch (1617:6): [True: 13.3M, False: 4.41k]
  ------------------
 1618|  13.3M|		return (total_bytes_skipped);
 1619|       |
 1620|       |	/* If there's an optimized skip function, use it. */
 1621|  4.41k|	if (f->can_skip != 0) {
  ------------------
  |  Branch (1621:6): [True: 4.06k, False: 353]
  ------------------
 1622|  4.06k|		while (request > 0) {
  ------------------
  |  Branch (1622:10): [True: 4.06k, False: 0]
  ------------------
 1623|  4.06k|			int64_t get = client_skip_proxy(f, request);
 1624|  4.06k|			if (get < 0 || get > request) {
  ------------------
  |  Branch (1624:8): [True: 0, False: 4.06k]
  |  Branch (1624:19): [True: 0, False: 4.06k]
  ------------------
 1625|      0|				f->fatal = 1;
 1626|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1627|      0|			}
 1628|  4.06k|			if (get == 0)
  ------------------
  |  Branch (1628:8): [True: 4.06k, False: 0]
  ------------------
 1629|  4.06k|				break;
 1630|      0|			f->position += get;
 1631|      0|			total_bytes_skipped += get;
 1632|      0|			request -= get;
 1633|      0|		}
 1634|  4.06k|		if (request == 0)
  ------------------
  |  Branch (1634:7): [True: 0, False: 4.06k]
  ------------------
 1635|      0|			return (total_bytes_skipped);
 1636|  4.06k|	} else if (f->can_seek != 0 && request > 64 * 1024) {
  ------------------
  |  Branch (1636:13): [True: 0, False: 353]
  |  Branch (1636:33): [True: 0, False: 0]
  ------------------
 1637|       |		/* If the client provided a seeker but not a skipper,
 1638|       |		 * we can use the seeker to skip forward.
 1639|       |		 *
 1640|       |		 * Note: This isn't always a good idea.  The client
 1641|       |		 * skipper is allowed to skip by less than requested
 1642|       |		 * if it needs to maintain block alignment.  The
 1643|       |		 * seeker is not allowed to play such games, so using
 1644|       |		 * the seeker here may be a performance loss compared
 1645|       |		 * to just reading and discarding.  That's why we
 1646|       |		 * only do this for skips of over 64k.
 1647|       |		 */
 1648|      0|		int64_t bytes_skipped;
 1649|      0|		int64_t before = f->position;
 1650|      0|		int64_t after = client_seek_proxy(f, request, SEEK_CUR);
 1651|      0|		if (after != before + request) {
  ------------------
  |  Branch (1651:7): [True: 0, False: 0]
  ------------------
 1652|      0|			f->fatal = 1;
 1653|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1654|      0|		}
 1655|      0|		bytes_skipped = after - before;
 1656|      0|		f->position += bytes_skipped;
 1657|      0|		total_bytes_skipped += bytes_skipped;
 1658|      0|		request -= bytes_skipped;
 1659|      0|		if (request == 0)
  ------------------
  |  Branch (1659:7): [True: 0, False: 0]
  ------------------
 1660|      0|			return (total_bytes_skipped);
 1661|      0|	}
 1662|       |
 1663|       |	/* Use ordinary reads as necessary to complete the request. */
 1664|  4.95k|	for (;;) {
 1665|  4.95k|		ssize_t bytes_read = (f->vtable->read)(f, &f->client_buff);
 1666|  4.95k|		if (bytes_read < 0) {
  ------------------
  |  Branch (1666:7): [True: 114, False: 4.84k]
  ------------------
 1667|    114|			f->client_buff = NULL;
 1668|    114|			f->fatal = 1;
 1669|    114|			return (bytes_read);
 1670|    114|		}
 1671|       |
 1672|  4.84k|		if (bytes_read == 0) {
  ------------------
  |  Branch (1672:7): [True: 4.08k, False: 760]
  ------------------
 1673|  4.08k|			if (f->archive->client.cursor !=
  ------------------
  |  Branch (1673:8): [True: 0, False: 4.08k]
  ------------------
 1674|  4.08k|			      f->archive->client.nodes - 1) {
 1675|      0|				if (client_switch_proxy(f,
  ------------------
  |  Branch (1675:9): [True: 0, False: 0]
  ------------------
 1676|      0|				    f->archive->client.cursor + 1)
 1677|      0|				    == ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1678|      0|					continue;
 1679|      0|			}
 1680|  4.08k|			f->client_buff = NULL;
 1681|  4.08k|			f->end_of_file = 1;
 1682|  4.08k|			return (total_bytes_skipped);
 1683|  4.08k|		}
 1684|       |
 1685|    760|		if (bytes_read >= request) {
  ------------------
  |  Branch (1685:7): [True: 218, False: 542]
  ------------------
 1686|    218|			f->client_next =
 1687|    218|			    ((const char *)f->client_buff) + request;
 1688|    218|			f->client_avail = (size_t)(bytes_read - request);
 1689|    218|			f->client_total = bytes_read;
 1690|    218|			total_bytes_skipped += request;
 1691|    218|			f->position += request;
 1692|    218|			return (total_bytes_skipped);
 1693|    218|		}
 1694|       |
 1695|    542|		f->position += bytes_read;
 1696|    542|		total_bytes_skipped += bytes_read;
 1697|    542|		request -= bytes_read;
 1698|    542|	}
 1699|  4.41k|}
archive_read.c:client_skip_proxy:
  190|  4.06k|{
  191|  4.06k|	return (f->archive->client.skipper)(&f->archive->archive,
  192|  4.06k|	    f->data, request);
  193|  4.06k|}
archive_read.c:client_seek_proxy:
  197|  31.2k|{
  198|       |	/* DO NOT use the skipper here!  If we transparently handled
  199|       |	 * forward seek here by using the skipper, that will break
  200|       |	 * other libarchive code that assumes a successful forward
  201|       |	 * seek means it can also seek backwards.
  202|       |	 */
  203|  31.2k|	return (f->archive->client.seeker)(&f->archive->archive,
  204|  31.2k|	    f->data, offset, whence);
  205|  31.2k|}

archive_read_add_passphrase:
   88|  16.7k|{
   89|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
   90|  16.7k|	struct archive_read_passphrase *p;
   91|       |
   92|  16.7k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
   93|  16.7k|		"archive_read_add_passphrase");
   94|       |
   95|  16.7k|	if (passphrase == NULL || passphrase[0] == '\0') {
  ------------------
  |  Branch (95:6): [True: 0, False: 16.7k]
  |  Branch (95:28): [True: 0, False: 16.7k]
  ------------------
   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|  16.7k|	p = new_read_passphrase(a, passphrase);
  102|  16.7k|	if (p == NULL)
  ------------------
  |  Branch (102:6): [True: 0, False: 16.7k]
  ------------------
  103|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  104|  16.7k|	add_passphrase_to_tail(a, p);
  105|       |
  106|  16.7k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  107|  16.7k|}
__archive_read_reset_passphrase:
  129|  39.4k|{
  130|       |
  131|  39.4k|	a->passphrases.candidate = -1;
  132|  39.4k|}
__archive_read_next_passphrase:
  139|  12.2k|{
  140|  12.2k|	struct archive_read_passphrase *p;
  141|  12.2k|	const char *passphrase;
  142|       |
  143|  12.2k|	if (a->passphrases.candidate < 0) {
  ------------------
  |  Branch (143:6): [True: 8.07k, False: 4.21k]
  ------------------
  144|       |		/* Count out how many passphrases we have. */
  145|  8.07k|		int cnt = 0;
  146|       |
  147|  16.1k|		for (p = a->passphrases.first; p != NULL; p = p->next)
  ------------------
  |  Branch (147:34): [True: 8.07k, False: 8.07k]
  ------------------
  148|  8.07k|			cnt++;
  149|  8.07k|		a->passphrases.candidate = cnt;
  150|  8.07k|		p = a->passphrases.first;
  151|  8.07k|	} else if (a->passphrases.candidate > 1) {
  ------------------
  |  Branch (151:13): [True: 0, False: 4.21k]
  ------------------
  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|  4.21k|	} else if (a->passphrases.candidate == 1) {
  ------------------
  |  Branch (158:13): [True: 2.55k, False: 1.65k]
  ------------------
  159|       |		/* This case is that all candidates failed to decrypt. */
  160|  2.55k|		a->passphrases.candidate = 0;
  161|  2.55k|		if (a->passphrases.first->next != NULL) {
  ------------------
  |  Branch (161:7): [True: 0, False: 2.55k]
  ------------------
  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.55k|		p = NULL;
  167|  2.55k|	} else  /* There is no passphrase candidate. */
  168|  1.65k|		p = NULL;
  169|       |
  170|  12.2k|	if (p != NULL)
  ------------------
  |  Branch (170:6): [True: 8.07k, False: 4.21k]
  ------------------
  171|  8.07k|		passphrase = p->passphrase;
  172|  4.21k|	else if (a->passphrases.callback != NULL) {
  ------------------
  |  Branch (172:11): [True: 0, False: 4.21k]
  ------------------
  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|  4.21k|		passphrase = NULL;
  187|       |
  188|  12.2k|	return (passphrase);
  189|  12.2k|}
archive_read_add_passphrase.c:new_read_passphrase:
   67|  16.7k|{
   68|  16.7k|	struct archive_read_passphrase *p;
   69|       |
   70|  16.7k|	p = malloc(sizeof(*p));
   71|  16.7k|	if (p == NULL) {
  ------------------
  |  Branch (71:6): [True: 0, False: 16.7k]
  ------------------
   72|      0|		archive_set_error(&a->archive, ENOMEM,
   73|      0|		    "Can't allocate memory");
   74|      0|		return (NULL);
   75|      0|	}
   76|  16.7k|	p->passphrase = strdup(passphrase);
   77|  16.7k|	if (p->passphrase == NULL) {
  ------------------
  |  Branch (77:6): [True: 0, False: 16.7k]
  ------------------
   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|  16.7k|	return (p);
   84|  16.7k|}
archive_read_add_passphrase.c:add_passphrase_to_tail:
   36|  16.7k|{
   37|  16.7k|	*a->passphrases.last = p;
   38|  16.7k|	a->passphrases.last = &p->next;
   39|       |	p->next = NULL;
   40|  16.7k|}

archive_read_open_memory:
   57|  16.7k|{
   58|  16.7k|	return archive_read_open_memory2(a, buff, size, size);
   59|  16.7k|}
archive_read_open_memory2:
   69|  16.7k|{
   70|  16.7k|	struct read_memory_data *mine;
   71|  16.7k|	int r;
   72|       |
   73|  16.7k|	mine = calloc(1, sizeof(*mine));
   74|  16.7k|	if (mine == NULL) {
  ------------------
  |  Branch (74:6): [True: 0, False: 16.7k]
  ------------------
   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|  16.7k|	mine->start = mine->p = (const unsigned char *)buff;
   79|  16.7k|	mine->end = mine->start + size;
   80|  16.7k|	mine->read_size = read_size;
   81|  16.7k|	archive_read_set_open_callback(a, memory_read_open);
   82|  16.7k|	archive_read_set_read_callback(a, memory_read);
   83|  16.7k|	archive_read_set_seek_callback(a, memory_read_seek);
   84|  16.7k|	archive_read_set_skip_callback(a, memory_read_skip);
   85|  16.7k|	archive_read_set_close_callback(a, memory_read_close);
   86|  16.7k|	r = archive_read_set_callback_data(a, mine);
   87|  16.7k|	if (r < 0) {
  ------------------
  |  Branch (87:6): [True: 0, False: 16.7k]
  ------------------
   88|      0|		free(mine);
   89|      0|		return (r);
   90|      0|	}
   91|  16.7k|	return (archive_read_open1(a));
   92|  16.7k|}
archive_read_open_memory.c:memory_read_open:
   99|  16.7k|{
  100|  16.7k|	(void)a; /* UNUSED */
  101|  16.7k|	(void)client_data; /* UNUSED */
  102|  16.7k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  103|  16.7k|}
archive_read_open_memory.c:memory_read:
  114|  48.2k|{
  115|  48.2k|	struct read_memory_data *mine = (struct read_memory_data *)client_data;
  116|  48.2k|	ssize_t size;
  117|       |
  118|  48.2k|	(void)a; /* UNUSED */
  119|  48.2k|	*buff = mine->p;
  120|  48.2k|	size = mine->end - mine->p;
  121|  48.2k|	if (size > mine->read_size)
  ------------------
  |  Branch (121:6): [True: 0, False: 48.2k]
  ------------------
  122|      0|		size = mine->read_size;
  123|  48.2k|        mine->p += size;
  124|  48.2k|	return (size);
  125|  48.2k|}
archive_read_open_memory.c:memory_read_skip:
  134|  4.06k|{
  135|  4.06k|	struct read_memory_data *mine = (struct read_memory_data *)client_data;
  136|       |
  137|  4.06k|	(void)a; /* UNUSED */
  138|  4.06k|	if ((int64_t)skip > (int64_t)(mine->end - mine->p))
  ------------------
  |  Branch (138:6): [True: 4.04k, False: 19]
  ------------------
  139|  4.04k|		skip = mine->end - mine->p;
  140|       |	/* Round down to block size. */
  141|  4.06k|	skip /= mine->read_size;
  142|  4.06k|	skip *= mine->read_size;
  143|  4.06k|	mine->p += skip;
  144|  4.06k|	return (skip);
  145|  4.06k|}
archive_read_open_memory.c:memory_read_seek:
  152|  31.2k|{
  153|  31.2k|	struct read_memory_data *mine = (struct read_memory_data *)client_data;
  154|  31.2k|	const unsigned char *p;
  155|       |
  156|  31.2k|	(void)a; /* UNUSED */
  157|  31.2k|	switch (whence) {
  158|  15.5k|	case SEEK_SET:
  ------------------
  |  Branch (158:2): [True: 15.5k, False: 15.6k]
  ------------------
  159|  15.5k|		p = mine->start + offset;
  160|  15.5k|		break;
  161|      0|	case SEEK_CUR:
  ------------------
  |  Branch (161:2): [True: 0, False: 31.2k]
  ------------------
  162|      0|		p = mine->p + offset;
  163|      0|		break;
  164|  15.6k|	case SEEK_END:
  ------------------
  |  Branch (164:2): [True: 15.6k, False: 15.5k]
  ------------------
  165|  15.6k|		p = mine->end + offset;
  166|  15.6k|		break;
  167|      0|	default:
  ------------------
  |  Branch (167:2): [True: 0, False: 31.2k]
  ------------------
  168|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  169|  31.2k|	}
  170|  31.2k|	if (p < mine->start)
  ------------------
  |  Branch (170:6): [True: 0, False: 31.2k]
  ------------------
  171|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  172|  31.2k|	if (p > mine->end)
  ------------------
  |  Branch (172:6): [True: 0, False: 31.2k]
  ------------------
  173|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  174|  31.2k|	mine->p = p;
  175|  31.2k|	return (mine->p - mine->start);
  176|  31.2k|}
archive_read_open_memory.c:memory_read_close:
  183|  16.7k|{
  184|  16.7k|	struct read_memory_data *mine = (struct read_memory_data *)client_data;
  185|  16.7k|	(void)a; /* UNUSED */
  186|  16.7k|	free(mine);
  187|  16.7k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  188|  16.7k|}

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

archive_read_support_filter_all:
   42|  16.7k|{
   43|  16.7k|	archive_check_magic(a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
   44|  16.7k|	    ARCHIVE_STATE_NEW, "archive_read_support_filter_all");
   45|       |
   46|       |	/* Bzip falls back to "bzip2 -d" command-line */
   47|  16.7k|	archive_read_support_filter_bzip2(a);
   48|       |	/* The decompress code doesn't use an outside library. */
   49|  16.7k|	archive_read_support_filter_compress(a);
   50|       |	/* Gzip decompress falls back to "gzip -d" command-line. */
   51|  16.7k|	archive_read_support_filter_gzip(a);
   52|       |	/* Lzip falls back to "lzip -d -q" command-line. */
   53|  16.7k|	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|  16.7k|	archive_read_support_filter_lzma(a);
   59|       |	/* Xz falls back to "xz -d -qq" command-line. */
   60|  16.7k|	archive_read_support_filter_xz(a);
   61|       |	/* The decode code doesn't use an outside library. */
   62|  16.7k|	archive_read_support_filter_uu(a);
   63|       |	/* The decode code doesn't use an outside library. */
   64|  16.7k|	archive_read_support_filter_rpm(a);
   65|       |	/* The decode code always uses "lrzip -d -q" command-line. */
   66|  16.7k|	archive_read_support_filter_lrzip(a);
   67|       |	/* Lzop decompress falls back to "lzop -d" command-line. */
   68|  16.7k|	archive_read_support_filter_lzop(a);
   69|       |	/* The decode code always uses "grzip -d" command-line. */
   70|  16.7k|	archive_read_support_filter_grzip(a);
   71|       |	/* Lz4 falls back to "lz4 -d -q" command-line. */
   72|  16.7k|	archive_read_support_filter_lz4(a);
   73|       |	/* Zstd falls back to "zstd -d -qq" command-line. */
   74|  16.7k|	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|  16.7k|	archive_clear_error(a);
   83|  16.7k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   84|  16.7k|}

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

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

archive_read_support_filter_grzip:
   62|  16.7k|{
   63|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
   64|       |
   65|  16.7k|	if (__archive_read_register_bidder(a, NULL,
  ------------------
  |  Branch (65:6): [True: 0, False: 16.7k]
  ------------------
   66|  16.7k|				&grzip_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  16.7k|#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|  16.7k|	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  16.7k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
   71|  16.7k|	    "Using external grzip program for grzip decompression");
   72|  16.7k|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|  16.7k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
   73|  16.7k|}
archive_read_support_filter_grzip.c:grzip_bidder_bid:
   81|  19.0k|{
   82|  19.0k|	const unsigned char *p;
   83|       |
   84|  19.0k|	(void)b; /* UNUSED */
   85|       |
   86|  19.0k|	p = __archive_read_filter_ahead(f, sizeof(grzip_magic), NULL);
   87|  19.0k|	if (p == NULL)
  ------------------
  |  Branch (87:6): [True: 363, False: 18.7k]
  ------------------
   88|    363|		return (0);
   89|       |
   90|  18.7k|	if (memcmp(p, grzip_magic, sizeof(grzip_magic)))
  ------------------
  |  Branch (90:6): [True: 18.7k, False: 0]
  ------------------
   91|  18.7k|		return (0);
   92|       |
   93|      0|	return (sizeof(grzip_magic) * 8);
   94|  18.7k|}

archive_read_support_filter_gzip:
   96|  16.7k|{
   97|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
   98|       |
   99|  16.7k|	if (__archive_read_register_bidder(a, NULL,
  ------------------
  |  Branch (99:6): [True: 0, False: 16.7k]
  ------------------
  100|  16.7k|				&gzip_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  16.7k|#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|  16.7k|#if HAVE_ZLIB_H
  105|  16.7k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  16.7k|#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|  16.7k|}
archive_read_support_filter_gzip.c:gzip_bidder_bid:
  241|  19.0k|{
  242|  19.0k|	int bits_checked;
  243|       |
  244|  19.0k|	(void)b; /* UNUSED */
  245|       |
  246|  19.0k|	if (peek_at_header(f, &bits_checked, NULL))
  ------------------
  |  Branch (246:6): [True: 1.00k, False: 18.0k]
  ------------------
  247|  1.00k|		return (bits_checked);
  248|  18.0k|	return (0);
  249|  19.0k|}
archive_read_support_filter_gzip.c:peek_at_header:
  130|  21.1k|{
  131|  21.1k|	const unsigned char *p;
  132|  21.1k|	ssize_t avail, len;
  133|  21.1k|	int bits = 0;
  134|  21.1k|	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|  21.1k|	len = 10;
  142|  21.1k|	p = __archive_read_filter_ahead(f, len, &avail);
  143|  21.1k|	if (p == NULL)
  ------------------
  |  Branch (143:6): [True: 801, False: 20.3k]
  ------------------
  144|    801|		return (0);
  145|       |	/* We only support deflation- third byte must be 0x08. */
  146|  20.3k|	if (memcmp(p, "\x1F\x8B\x08", 3) != 0)
  ------------------
  |  Branch (146:6): [True: 17.9k, False: 2.32k]
  ------------------
  147|  17.9k|		return (0);
  148|  2.32k|	bits += 24;
  149|  2.32k|	if ((p[3] & 0xE0)!= 0)	/* No reserved flags set. */
  ------------------
  |  Branch (149:6): [True: 27, False: 2.29k]
  ------------------
  150|     27|		return (0);
  151|  2.29k|	bits += 3;
  152|  2.29k|	header_flags = p[3];
  153|       |	/* Bytes 4-7 are mod time in little endian. */
  154|  2.29k|#ifdef HAVE_ZLIB_H
  155|  2.29k|	if (gzip)
  ------------------
  |  Branch (155:6): [True: 1.28k, False: 1.01k]
  ------------------
  156|  1.28k|		gzip->mtime = archive_le32dec(p + 4);
  157|  2.29k|#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|  2.29k|	if (header_flags & 4) {
  ------------------
  |  Branch (164:6): [True: 99, False: 2.19k]
  ------------------
  165|     99|		p = __archive_read_filter_ahead(f, len + 2, &avail);
  166|     99|		if (p == NULL)
  ------------------
  |  Branch (166:7): [True: 0, False: 99]
  ------------------
  167|      0|			return (0);
  168|     99|		len += archive_le16dec(p + len);
  169|     99|		len += 2;
  170|     99|	}
  171|       |
  172|       |	/* Null-terminated optional filename. */
  173|  2.29k|	if (header_flags & 8) {
  ------------------
  |  Branch (173:6): [True: 513, False: 1.78k]
  ------------------
  174|    513|#ifdef HAVE_ZLIB_H
  175|    513|		ssize_t file_start = len;
  176|    513|#endif
  177|  1.97M|		do {
  178|  1.97M|			++len;
  179|  1.97M|			if (avail < len) {
  ------------------
  |  Branch (179:8): [True: 1.96M, False: 5.00k]
  ------------------
  180|  1.96M|				if (avail > MAX_FILENAME_LENGTH) {
  ------------------
  |  |  120|  1.96M|#define MAX_FILENAME_LENGTH (1024 * 1024L)
  ------------------
  |  Branch (180:9): [True: 2, False: 1.96M]
  ------------------
  181|      2|					return (0);
  182|      2|				}
  183|  1.96M|				p = __archive_read_filter_ahead(f,
  184|  1.96M|				    len, &avail);
  185|  1.96M|			}
  186|  1.97M|			if (p == NULL)
  ------------------
  |  Branch (186:8): [True: 12, False: 1.97M]
  ------------------
  187|     12|				return (0);
  188|  1.97M|		} while (p[len - 1] != 0);
  ------------------
  |  Branch (188:12): [True: 1.97M, False: 499]
  ------------------
  189|       |
  190|    499|#ifdef HAVE_ZLIB_H
  191|    499|		if (gzip) {
  ------------------
  |  Branch (191:7): [True: 295, False: 204]
  ------------------
  192|       |			/* Reset the name in case of repeat header reads. */
  193|    295|			free(gzip->name);
  194|    295|			gzip->name = strdup((const char *)&p[file_start]);
  195|    295|		}
  196|    499|#endif
  197|    499|	}
  198|       |
  199|       |	/* Null-terminated optional comment. */
  200|  2.28k|	if (header_flags & 16) {
  ------------------
  |  Branch (200:6): [True: 589, False: 1.69k]
  ------------------
  201|  1.05M|		do {
  202|  1.05M|			++len;
  203|  1.05M|			if (avail < len) {
  ------------------
  |  Branch (203:8): [True: 983k, False: 69.3k]
  ------------------
  204|   983k|				if (avail > MAX_COMMENT_LENGTH) {
  ------------------
  |  |  121|   983k|#define MAX_COMMENT_LENGTH (1024 * 1024L)
  ------------------
  |  Branch (204:9): [True: 1, False: 983k]
  ------------------
  205|      1|					return (0);
  206|      1|				}
  207|   983k|				p = __archive_read_filter_ahead(f,
  208|   983k|				    len, &avail);
  209|   983k|			}
  210|  1.05M|			if (p == NULL)
  ------------------
  |  Branch (210:8): [True: 3, False: 1.05M]
  ------------------
  211|      3|				return (0);
  212|  1.05M|		} while (p[len - 1] != 0);
  ------------------
  |  Branch (212:12): [True: 1.05M, False: 585]
  ------------------
  213|    589|	}
  214|       |
  215|       |	/* Optional header CRC */
  216|  2.27k|	if ((header_flags & 2)) {
  ------------------
  |  Branch (216:6): [True: 181, False: 2.09k]
  ------------------
  217|    181|		p = __archive_read_filter_ahead(f, len + 2, &avail);
  218|    181|		if (p == NULL)
  ------------------
  |  Branch (218:7): [True: 5, False: 176]
  ------------------
  219|      5|			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|    176|		len += 2;
  228|    176|	}
  229|       |
  230|  2.27k|	if (pbits != NULL)
  ------------------
  |  Branch (230:6): [True: 1.00k, False: 1.27k]
  ------------------
  231|  1.00k|		*pbits = bits;
  232|  2.27k|	return (len);
  233|  2.27k|}
archive_read_support_filter_gzip.c:gzip_bidder_init:
  304|  1.00k|{
  305|  1.00k|	struct gzip *gzip;
  306|  1.00k|	static const size_t out_block_size = 64 * 1024;
  307|  1.00k|	void *out_block;
  308|       |
  309|  1.00k|	f->code = ARCHIVE_FILTER_GZIP;
  ------------------
  |  |  310|  1.00k|#define	ARCHIVE_FILTER_GZIP	1
  ------------------
  310|  1.00k|	f->name = "gzip";
  311|       |
  312|  1.00k|	gzip = calloc(1, sizeof(*gzip));
  313|  1.00k|	out_block = malloc(out_block_size);
  314|  1.00k|	if (gzip == NULL || out_block == NULL) {
  ------------------
  |  Branch (314:6): [True: 0, False: 1.00k]
  |  Branch (314:22): [True: 0, False: 1.00k]
  ------------------
  315|      0|		free(out_block);
  316|      0|		free(gzip);
  317|      0|		archive_set_error(&f->archive->archive, ENOMEM,
  318|      0|		    "Can't allocate data for gzip decompression");
  319|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  320|      0|	}
  321|       |
  322|  1.00k|	f->data = gzip;
  323|  1.00k|	gzip->out_block_size = out_block_size;
  324|  1.00k|	gzip->out_block = out_block;
  325|  1.00k|	f->vtable = &gzip_reader_vtable;
  326|       |
  327|  1.00k|	gzip->in_stream = 0; /* We're not actually within a stream yet. */
  328|       |
  329|  1.00k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.00k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  330|  1.00k|}
archive_read_support_filter_gzip.c:gzip_filter_read:
  432|  27.8k|{
  433|  27.8k|	struct gzip *gzip = f->data;
  434|  27.8k|	size_t decompressed;
  435|  27.8k|	ssize_t avail_in, max_in;
  436|  27.8k|	int ret;
  437|       |
  438|       |	/* Empty our output buffer. */
  439|  27.8k|	gzip->stream.next_out = gzip->out_block;
  440|  27.8k|	gzip->stream.avail_out = (uInt)gzip->out_block_size;
  441|       |
  442|       |	/* Try to fill the output buffer. */
  443|  56.4k|	while (gzip->stream.avail_out > 0 && !gzip->eof) {
  ------------------
  |  Branch (443:9): [True: 30.0k, False: 26.3k]
  |  Branch (443:39): [True: 29.4k, False: 566]
  ------------------
  444|       |		/* If we're not in a stream, read a header
  445|       |		 * and initialize the decompression library. */
  446|  29.4k|		if (!gzip->in_stream) {
  ------------------
  |  Branch (446:7): [True: 2.03k, False: 27.4k]
  ------------------
  447|  2.03k|			ret = consume_header(f);
  448|  2.03k|			if (ret == ARCHIVE_EOF) {
  ------------------
  |  |  232|  2.03k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (448:8): [True: 762, False: 1.27k]
  ------------------
  449|    762|				gzip->eof = 1;
  450|    762|				break;
  451|    762|			}
  452|  1.27k|			if (ret < ARCHIVE_OK)
  ------------------
  |  |  233|  1.27k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (452:8): [True: 0, False: 1.27k]
  ------------------
  453|      0|				return (ret);
  454|  1.27k|		}
  455|       |
  456|       |		/* Peek at the next available data. */
  457|       |		/* ZLib treats stream.next_in as const but doesn't declare
  458|       |		 * it so, hence this ugly cast. */
  459|  28.7k|		gzip->stream.next_in = (unsigned char *)(uintptr_t)
  460|  28.7k|		    __archive_read_filter_ahead(f->upstream, 1, &avail_in);
  461|  28.7k|		if (gzip->stream.next_in == NULL) {
  ------------------
  |  Branch (461:7): [True: 152, False: 28.5k]
  ------------------
  462|    152|			archive_set_error(&f->archive->archive,
  463|    152|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    152|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  464|    152|			    "truncated gzip input");
  465|    152|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    152|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  466|    152|		}
  467|  28.5k|		if (UINT_MAX >= SSIZE_MAX)
  ------------------
  |  Branch (467:7): [Folded, False: 28.5k]
  ------------------
  468|      0|			max_in = SSIZE_MAX;
  469|  28.5k|		else
  470|  28.5k|			max_in = UINT_MAX;
  471|  28.5k|		if (avail_in > max_in)
  ------------------
  |  Branch (471:7): [True: 0, False: 28.5k]
  ------------------
  472|      0|			avail_in = max_in;
  473|  28.5k|		gzip->stream.avail_in = (uInt)avail_in;
  474|       |
  475|       |		/* Decompress and consume some of that data. */
  476|  28.5k|		ret = inflate(&(gzip->stream), 0);
  477|  28.5k|		switch (ret) {
  478|  27.5k|		case Z_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (478:3): [True: 27.5k, False: 1.06k]
  ------------------
  479|  27.5k|			__archive_read_filter_consume(f->upstream,
  480|  27.5k|			    avail_in - gzip->stream.avail_in);
  481|  27.5k|			break;
  482|  1.03k|		case Z_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (482:3): [True: 1.03k, False: 27.5k]
  ------------------
  483|  1.03k|			__archive_read_filter_consume(f->upstream,
  484|  1.03k|			    avail_in - gzip->stream.avail_in);
  485|       |			/* Consume the stream trailer; release the
  486|       |			 * decompression library. */
  487|  1.03k|			ret = consume_trailer(f);
  488|  1.03k|			if (ret < ARCHIVE_OK)
  ------------------
  |  |  233|  1.03k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (488:8): [True: 1, False: 1.03k]
  ------------------
  489|      1|				return (ret);
  490|  1.03k|			break;
  491|  1.03k|		default:
  ------------------
  |  Branch (491:3): [True: 30, False: 28.5k]
  ------------------
  492|       |			/* Return an error. */
  493|     30|			archive_set_error(&f->archive->archive,
  494|     30|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     30|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  495|     30|			    "gzip decompression failed");
  496|     30|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     30|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  497|  28.5k|		}
  498|  28.5k|	}
  499|       |
  500|       |	/* We've read as much as we can. */
  501|  27.7k|	decompressed = gzip->stream.next_out - gzip->out_block;
  502|  27.7k|	if (decompressed == 0)
  ------------------
  |  Branch (502:6): [True: 572, False: 27.1k]
  ------------------
  503|    572|		*p = NULL;
  504|  27.1k|	else
  505|  27.1k|		*p = gzip->out_block;
  506|  27.7k|	return (decompressed);
  507|  27.8k|}
archive_read_support_filter_gzip.c:consume_header:
  334|  2.03k|{
  335|  2.03k|	struct gzip *gzip = f->data;
  336|  2.03k|	ssize_t avail, max_in;
  337|  2.03k|	size_t len;
  338|  2.03k|	int ret;
  339|       |
  340|       |	/* If this is a real header, consume it. */
  341|  2.03k|	len = peek_at_header(f->upstream, NULL, gzip);
  342|  2.03k|	if (len == 0)
  ------------------
  |  Branch (342:6): [True: 762, False: 1.27k]
  ------------------
  343|    762|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|    762|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  344|  1.27k|	__archive_read_filter_consume(f->upstream, len);
  345|       |
  346|       |	/* Initialize CRC accumulator. */
  347|  1.27k|	gzip->crc = __archive_crc32(0L, NULL, 0);
  348|       |
  349|       |	/* Initialize compression library. */
  350|  1.27k|	gzip->stream.next_in = (unsigned char *)(uintptr_t)
  351|  1.27k|	    __archive_read_filter_ahead(f->upstream, 1, &avail);
  352|  1.27k|	if (avail < 0) {
  ------------------
  |  Branch (352:6): [True: 0, False: 1.27k]
  ------------------
  353|      0|		archive_set_error(&f->archive->archive,
  354|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  355|      0|		    "Failed to read gzip input");
  356|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  357|      0|	}
  358|  1.27k|	if (UINT_MAX >= SSIZE_MAX)
  ------------------
  |  Branch (358:6): [Folded, False: 1.27k]
  ------------------
  359|      0|		max_in = SSIZE_MAX;
  360|  1.27k|	else
  361|  1.27k|		max_in = UINT_MAX;
  362|  1.27k|	if (avail > max_in)
  ------------------
  |  Branch (362:6): [True: 0, False: 1.27k]
  ------------------
  363|      0|		avail = max_in;
  364|  1.27k|	gzip->stream.avail_in = (uInt)avail;
  365|  1.27k|	ret = inflateInit2(&(gzip->stream),
  366|  1.27k|	    -15 /* Don't check for zlib header */);
  367|       |
  368|       |	/* Decipher the error code. */
  369|  1.27k|	switch (ret) {
  370|  1.27k|	case Z_OK:
  ------------------
  |  Branch (370:2): [True: 1.27k, False: 0]
  ------------------
  371|  1.27k|		gzip->in_stream = 1;
  372|  1.27k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.27k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  373|      0|	case Z_STREAM_ERROR:
  ------------------
  |  Branch (373:2): [True: 0, False: 1.27k]
  ------------------
  374|      0|		archive_set_error(&f->archive->archive,
  375|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  376|      0|		    "Internal error initializing compression library: "
  377|      0|		    "invalid setup parameter");
  378|      0|		break;
  379|      0|	case Z_MEM_ERROR:
  ------------------
  |  Branch (379:2): [True: 0, False: 1.27k]
  ------------------
  380|      0|		archive_set_error(&f->archive->archive, ENOMEM,
  381|      0|		    "Internal error initializing compression library: "
  382|      0|		    "out of memory");
  383|      0|		break;
  384|      0|	case Z_VERSION_ERROR:
  ------------------
  |  Branch (384:2): [True: 0, False: 1.27k]
  ------------------
  385|      0|		archive_set_error(&f->archive->archive,
  386|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  387|      0|		    "Internal error initializing compression library: "
  388|      0|		    "invalid library version");
  389|      0|		break;
  390|      0|	default:
  ------------------
  |  Branch (390:2): [True: 0, False: 1.27k]
  ------------------
  391|      0|		archive_set_error(&f->archive->archive,
  392|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  393|      0|		    "Internal error initializing compression library: "
  394|      0|		    " Zlib error %d", ret);
  395|      0|		break;
  396|  1.27k|	}
  397|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  398|  1.27k|}
archive_read_support_filter_gzip.c:consume_trailer:
  402|  1.03k|{
  403|  1.03k|	struct gzip *gzip = f->data;
  404|  1.03k|	const unsigned char *p;
  405|       |
  406|  1.03k|	gzip->in_stream = 0;
  407|  1.03k|	switch (inflateEnd(&(gzip->stream))) {
  408|  1.03k|	case Z_OK:
  ------------------
  |  Branch (408:2): [True: 1.03k, False: 0]
  ------------------
  409|  1.03k|		break;
  410|      0|	default:
  ------------------
  |  Branch (410:2): [True: 0, False: 1.03k]
  ------------------
  411|      0|		archive_set_error(&f->archive->archive,
  412|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  413|      0|		    "Failed to clean up gzip decompressor");
  414|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  415|  1.03k|	}
  416|       |
  417|       |	/* GZip trailer is a fixed 8 byte structure. */
  418|  1.03k|	p = __archive_read_filter_ahead(f->upstream, 8, NULL);
  419|  1.03k|	if (p == NULL)
  ------------------
  |  Branch (419:6): [True: 1, False: 1.03k]
  ------------------
  420|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  421|       |
  422|       |	/* XXX TODO: Verify the length and CRC. */
  423|       |
  424|       |	/* We've verified the trailer, so consume it now. */
  425|  1.03k|	__archive_read_filter_consume(f->upstream, 8);
  426|       |
  427|  1.03k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.03k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  428|  1.03k|}
archive_read_support_filter_gzip.c:gzip_filter_close:
  514|  1.00k|{
  515|  1.00k|	struct gzip *gzip = f->data;
  516|  1.00k|	int ret;
  517|       |
  518|  1.00k|	ret = ARCHIVE_OK;
  ------------------
  |  |  233|  1.00k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  519|       |
  520|  1.00k|	if (gzip->in_stream) {
  ------------------
  |  Branch (520:6): [True: 238, False: 763]
  ------------------
  521|    238|		switch (inflateEnd(&(gzip->stream))) {
  522|    238|		case Z_OK:
  ------------------
  |  Branch (522:3): [True: 238, False: 0]
  ------------------
  523|    238|			break;
  524|      0|		default:
  ------------------
  |  Branch (524:3): [True: 0, False: 238]
  ------------------
  525|      0|			archive_set_error(&(f->archive->archive),
  526|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  527|      0|			    "Failed to clean up gzip compressor");
  528|      0|			ret = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  529|    238|		}
  530|    238|	}
  531|       |
  532|  1.00k|	free(gzip->name);
  533|  1.00k|	free(gzip->out_block);
  534|  1.00k|	free(gzip);
  535|  1.00k|	return (ret);
  536|  1.00k|}
archive_read_support_filter_gzip.c:gzip_read_header:
  276|    147|{
  277|    147|	struct gzip *gzip = f->data;
  278|       |
  279|       |	/* An mtime of 0 is considered invalid/missing. */
  280|    147|	if (gzip->mtime != 0)
  ------------------
  |  Branch (280:6): [True: 147, False: 0]
  ------------------
  281|    147|		archive_entry_set_mtime(entry, gzip->mtime, 0);
  282|       |
  283|       |	/* If the name is available, extract it. */
  284|    147|	if (gzip->name)
  ------------------
  |  Branch (284:6): [True: 17, False: 130]
  ------------------
  285|     17|		archive_entry_set_pathname(entry, gzip->name);
  286|       |
  287|    147|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    147|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  288|    147|}

archive_read_support_filter_lrzip:
   61|  16.7k|{
   62|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
   63|       |
   64|  16.7k|	if (__archive_read_register_bidder(a, NULL,
  ------------------
  |  Branch (64:6): [True: 0, False: 16.7k]
  ------------------
   65|  16.7k|				&lrzip_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  16.7k|#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|  16.7k|	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  16.7k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
   70|  16.7k|	    "Using external lrzip program for lrzip decompression");
   71|  16.7k|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|  16.7k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
   72|  16.7k|}
archive_read_support_filter_lrzip.c:lrzip_bidder_bid:
   80|  19.0k|{
   81|  19.0k|	const unsigned char *p;
   82|  19.0k|	int i;
   83|       |
   84|  19.0k|	(void)b; /* UNUSED */
   85|       |	/* Start by looking at the first six bytes of the header, which
   86|       |	 * is all fixed layout. */
   87|  19.0k|	p = __archive_read_filter_ahead(f, 6, NULL);
   88|  19.0k|	if (p == NULL)
  ------------------
  |  Branch (88:6): [True: 336, False: 18.7k]
  ------------------
   89|    336|		return (0);
   90|       |
   91|  18.7k|	if (memcmp(p, LRZIP_HEADER_MAGIC, LRZIP_HEADER_MAGIC_LEN))
  ------------------
  |  |   45|  18.7k|#define LRZIP_HEADER_MAGIC "LRZI"
  ------------------
              	if (memcmp(p, LRZIP_HEADER_MAGIC, LRZIP_HEADER_MAGIC_LEN))
  ------------------
  |  |   46|  18.7k|#define LRZIP_HEADER_MAGIC_LEN 4
  ------------------
  |  Branch (91:6): [True: 18.7k, False: 8]
  ------------------
   92|  18.7k|		return (0);
   93|       |
   94|       |	/* current major version is always 0, verify this */
   95|      8|	if (p[LRZIP_HEADER_MAGIC_LEN])
  ------------------
  |  |   46|      8|#define LRZIP_HEADER_MAGIC_LEN 4
  ------------------
  |  Branch (95:6): [True: 6, False: 2]
  ------------------
   96|      6|		return 0;
   97|       |	/* support only v0.6+ lrzip for sanity */
   98|      2|	i = p[LRZIP_HEADER_MAGIC_LEN + 1];
  ------------------
  |  |   46|      2|#define LRZIP_HEADER_MAGIC_LEN 4
  ------------------
   99|      2|	if ((i < 6) || (i > 10))
  ------------------
  |  Branch (99:6): [True: 0, False: 2]
  |  Branch (99:17): [True: 0, False: 2]
  ------------------
  100|      0|		return 0;
  101|       |
  102|      2|	return (48);
  103|      2|}
archive_read_support_filter_lrzip.c:lrzip_bidder_init:
  107|      2|{
  108|      2|	int r;
  109|       |
  110|      2|	r = __archive_read_program(f, "lrzip -d -q");
  111|       |	/* Note: We set the format here even if __archive_read_program()
  112|       |	 * above fails.  We do, after all, know what the format is
  113|       |	 * even if we weren't able to read it. */
  114|      2|	f->code = ARCHIVE_FILTER_LRZIP;
  ------------------
  |  |  319|      2|#define	ARCHIVE_FILTER_LRZIP	10
  ------------------
  115|      2|	f->name = "lrzip";
  116|      2|	return (r);
  117|      2|}

archive_read_support_filter_lz4:
  118|  16.7k|{
  119|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
  120|       |
  121|  16.7k|	if (__archive_read_register_bidder(a, NULL,
  ------------------
  |  Branch (121:6): [True: 0, False: 16.7k]
  ------------------
  122|  16.7k|				&lz4_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  16.7k|#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|  16.7k|#if defined(HAVE_LIBLZ4)
  126|  16.7k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  16.7k|#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|  16.7k|}
archive_read_support_filter_lz4.c:lz4_reader_bid:
  144|  19.0k|{
  145|  19.0k|	const unsigned char *buffer;
  146|  19.0k|	ssize_t avail;
  147|  19.0k|	int bits_checked = 0;
  148|  19.0k|	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|  19.0k|	const size_t min_lz4_frame_size = 8;
  157|       |
  158|  19.0k|	size_t offset_in_buffer = 0;
  159|  19.0k|	const size_t max_lookahead = 64 * 1024;
  160|  19.0k|	uint32_t magic_number;
  161|       |
  162|  19.0k|	(void)b; /* 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|  19.0k|	buffer = __archive_read_filter_ahead(f, min_lz4_archive_size,
  172|  19.0k|	    &avail);
  173|  19.0k|	if (buffer == NULL)
  ------------------
  |  Branch (173:6): [True: 363, False: 18.7k]
  ------------------
  174|    363|		return (0);
  175|       |
  176|  18.7k|	magic_number = archive_le32dec(buffer);
  177|       |
  178|  18.9k|	while ((magic_number & LZ4_SKIPPABLE_MASK) == LZ4_SKIPPABLE_START) {
  ------------------
  |  |   57|  18.9k|#define LZ4_SKIPPABLE_MASK 0xFFFFFFF0
  ------------------
              	while ((magic_number & LZ4_SKIPPABLE_MASK) == LZ4_SKIPPABLE_START) {
  ------------------
  |  |   56|  18.9k|#define LZ4_SKIPPABLE_START 0x184D2A50
  ------------------
  |  Branch (178:9): [True: 270, False: 18.7k]
  ------------------
  179|    270|		size_t min;
  180|    270|		uint32_t frame_data_size;
  181|       |
  182|       |		/* Skip over the magic number */
  183|    270|		bits_checked += 28;
  184|    270|		offset_in_buffer += 4;
  185|       |
  186|       |		/* Ensure that we can read another 4 bytes. */
  187|    270|		if (offset_in_buffer + 4 > (size_t)avail) {
  ------------------
  |  Branch (187:7): [True: 0, False: 270]
  ------------------
  188|      0|			buffer = __archive_read_filter_ahead(f,
  189|      0|			    offset_in_buffer + 4, &avail);
  190|      0|			if (buffer == NULL)
  ------------------
  |  Branch (190:8): [True: 0, False: 0]
  ------------------
  191|      0|				return (0);
  192|      0|		}
  193|       |
  194|    270|		frame_data_size = archive_le32dec(buffer + offset_in_buffer);
  195|       |
  196|       |		/* Skip over the 4 frame data size bytes */
  197|    270|		offset_in_buffer += 4;
  198|       |
  199|       |		/* Skip over the value stored there. */
  200|    270|		if (archive_ckd_add_size(&offset_in_buffer,
  ------------------
  |  Branch (200:7): [True: 0, False: 270]
  ------------------
  201|    270|		    offset_in_buffer, frame_data_size))
  202|      0|			return (0);
  203|       |
  204|       |		/*
  205|       |		 * There should be at least one more frame
  206|       |		 * if this is LZ4 data.
  207|       |		 */
  208|    270|		if (archive_ckd_add_size(&min,
  ------------------
  |  Branch (208:7): [True: 0, False: 270]
  ------------------
  209|    270|		    offset_in_buffer, min_lz4_frame_size) ||
  210|    270|		    min > max_lookahead)
  ------------------
  |  Branch (210:7): [True: 1, False: 269]
  ------------------
  211|      1|			return (0);
  212|       |		/* TODO: should this be >= ? */
  213|    269|		if (min > (size_t)avail) {
  ------------------
  |  Branch (213:7): [True: 55, False: 214]
  ------------------
  214|     55|			buffer = __archive_read_filter_ahead(f,
  215|     55|			    min, &avail);
  216|     55|			if (buffer == NULL)
  ------------------
  |  Branch (216:8): [True: 8, False: 47]
  ------------------
  217|      8|				return (0); 
  218|     55|		}
  219|       |
  220|    261|		magic_number = archive_le32dec(buffer + offset_in_buffer);
  221|    261|	}
  222|       |
  223|       |	/*
  224|       |	 * We have skipped over any skippable frames. Either a regular LZ4 frame
  225|       |	 * follows, or this isn't LZ4 data.
  226|       |	 */
  227|       |
  228|  18.7k|	buffer = buffer + offset_in_buffer;
  229|       |
  230|  18.7k|	if (magic_number == LZ4_MAGICNUMBER) {
  ------------------
  |  |   52|  18.7k|#define LZ4_MAGICNUMBER		0x184d2204
  ------------------
  |  Branch (230:6): [True: 468, False: 18.2k]
  ------------------
  231|    468|		unsigned char flag, BD;
  232|       |
  233|    468|		bits_checked += 32;
  234|       |		/* Next follows a stream descriptor. */
  235|       |		/* Descriptor Flags. */
  236|    468|		flag = buffer[4];
  237|       |		/* A version number must be "01". */
  238|    468|		if (((flag & 0xc0) >> 6) != 1)
  ------------------
  |  Branch (238:7): [True: 0, False: 468]
  ------------------
  239|      0|			return (0);
  240|       |		/* A reserved bit must be "0". */
  241|    468|		if (flag & 2)
  ------------------
  |  Branch (241:7): [True: 0, False: 468]
  ------------------
  242|      0|			return (0);
  243|    468|		bits_checked += 8;
  244|    468|		BD = buffer[5];
  245|       |		/* A block maximum size should be more than 3. */
  246|    468|		if (((BD & 0x70) >> 4) < 4)
  ------------------
  |  Branch (246:7): [True: 0, False: 468]
  ------------------
  247|      0|			return (0);
  248|       |		/* Reserved bits must be "0". */
  249|    468|		if (BD & ~0x70)
  ------------------
  |  Branch (249:7): [True: 0, False: 468]
  ------------------
  250|      0|			return (0);
  251|    468|		bits_checked += 8;
  252|       |
  253|    468|		return (bits_checked);
  254|    468|	}
  255|       |
  256|  18.2k|	if (magic_number == LZ4_LEGACY) {
  ------------------
  |  |   53|  18.2k|#define LZ4_LEGACY		0x184c2102
  ------------------
  |  Branch (256:6): [True: 116, False: 18.1k]
  ------------------
  257|    116|		bits_checked += 32;
  258|    116|		return (bits_checked);
  259|    116|	}
  260|       |
  261|  18.1k|	return (0);
  262|  18.2k|}
archive_read_support_filter_lz4.c:lz4_reader_init:
  299|    584|{
  300|    584|	struct lz4 *lz4;
  301|       |
  302|    584|	f->code = ARCHIVE_FILTER_LZ4;
  ------------------
  |  |  322|    584|#define	ARCHIVE_FILTER_LZ4	13
  ------------------
  303|    584|	f->name = "lz4";
  304|       |
  305|    584|	lz4 = calloc(1, sizeof(*lz4));
  306|    584|	if (lz4 == NULL) {
  ------------------
  |  Branch (306:6): [True: 0, False: 584]
  ------------------
  307|      0|		archive_set_error(&f->archive->archive, ENOMEM,
  308|      0|		    "Can't allocate data for lz4 decompression");
  309|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  310|      0|	}
  311|       |
  312|    584|	f->data = lz4;
  313|    584|	lz4->stage = SELECT_STREAM;
  314|    584|	f->vtable = &lz4_reader_vtable;
  315|       |
  316|    584|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    584|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  317|    584|}
archive_read_support_filter_lz4.c:lz4_filter_read:
  374|  7.88k|{
  375|  7.88k|	struct lz4 *lz4 = f->data;
  376|  7.88k|	ssize_t ret;
  377|       |
  378|  7.88k|	if (lz4->eof) {
  ------------------
  |  Branch (378:6): [True: 10, False: 7.87k]
  ------------------
  379|     10|		*p = NULL;
  380|     10|		return (0);
  381|     10|	}
  382|       |
  383|  7.87k|	__archive_read_filter_consume(f->upstream, lz4->unconsumed);
  384|  7.87k|	lz4->unconsumed = 0;
  385|       |
  386|  7.87k|	switch (lz4->stage) {
  387|    584|	case SELECT_STREAM:
  ------------------
  |  Branch (387:2): [True: 584, False: 7.29k]
  ------------------
  388|    584|		break;
  389|      0|	case READ_DEFAULT_STREAM:
  ------------------
  |  Branch (389:2): [True: 0, False: 7.87k]
  ------------------
  390|      0|	case READ_LEGACY_STREAM:
  ------------------
  |  Branch (390:2): [True: 0, False: 7.87k]
  ------------------
  391|       |		/* Reading an lz4 stream already failed. */
  392|      0|		archive_set_error(&f->archive->archive,
  393|      0|		    ARCHIVE_ERRNO_MISC, "Invalid sequence");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  394|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  395|  6.16k|	case READ_DEFAULT_BLOCK:
  ------------------
  |  Branch (395:2): [True: 6.16k, False: 1.71k]
  ------------------
  396|  6.16k|		ret = lz4_filter_read_default_stream(f, p);
  397|  6.16k|		if (ret != 0 || lz4->stage != SELECT_STREAM)
  ------------------
  |  Branch (397:7): [True: 5.20k, False: 962]
  |  Branch (397:19): [True: 10, False: 952]
  ------------------
  398|  5.21k|			return ret;
  399|    952|		break;
  400|  1.12k|	case READ_LEGACY_BLOCK:
  ------------------
  |  Branch (400:2): [True: 1.12k, False: 6.74k]
  ------------------
  401|  1.12k|		ret = lz4_filter_read_legacy_stream(f, p);
  402|  1.12k|		if (ret != 0 || lz4->stage != SELECT_STREAM)
  ------------------
  |  Branch (402:7): [True: 317, False: 812]
  |  Branch (402:19): [True: 0, False: 812]
  ------------------
  403|    317|			return ret;
  404|    812|		break;
  405|    812|	default:
  ------------------
  |  Branch (405:2): [True: 0, False: 7.87k]
  ------------------
  406|      0|		archive_set_error(&f->archive->archive,
  407|      0|		    ARCHIVE_ERRNO_MISC, "Program error");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  408|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  409|  7.87k|	}
  410|       |
  411|  2.42k|	while (lz4->stage == SELECT_STREAM) {
  ------------------
  |  Branch (411:9): [True: 2.42k, False: 0]
  ------------------
  412|  2.42k|		const char *read_buf;
  413|       |
  414|       |		/* Read a magic number. */
  415|  2.42k|		read_buf = __archive_read_filter_ahead(f->upstream, 4,
  416|  2.42k|				NULL);
  417|  2.42k|		if (read_buf == NULL) {
  ------------------
  |  Branch (417:7): [True: 86, False: 2.33k]
  ------------------
  418|     86|			lz4->eof = 1;
  419|     86|			*p = NULL;
  420|     86|			return (0);
  421|     86|		}
  422|  2.33k|		uint32_t number = archive_le32dec(read_buf);
  423|  2.33k|		__archive_read_filter_consume(f->upstream, 4);
  424|  2.33k|		if (number == LZ4_MAGICNUMBER)
  ------------------
  |  |   52|  2.33k|#define LZ4_MAGICNUMBER		0x184d2204
  ------------------
  |  Branch (424:7): [True: 1.37k, False: 965]
  ------------------
  425|  1.37k|			return lz4_filter_read_default_stream(f, p);
  426|    965|		else if (number == LZ4_LEGACY)
  ------------------
  |  |   53|    965|#define LZ4_LEGACY		0x184c2102
  ------------------
  |  Branch (426:12): [True: 846, False: 119]
  ------------------
  427|    846|			return lz4_filter_read_legacy_stream(f, p);
  428|    119|		else if ((number & LZ4_SKIPPABLE_MASK) == LZ4_SKIPPABLE_START) {
  ------------------
  |  |   57|    119|#define LZ4_SKIPPABLE_MASK 0xFFFFFFF0
  ------------------
              		else if ((number & LZ4_SKIPPABLE_MASK) == LZ4_SKIPPABLE_START) {
  ------------------
  |  |   56|    119|#define LZ4_SKIPPABLE_START 0x184D2A50
  ------------------
  |  Branch (428:12): [True: 81, False: 38]
  ------------------
  429|     81|			read_buf = __archive_read_filter_ahead(
  430|     81|				f->upstream, 4, NULL);
  431|     81|			if (read_buf == NULL) {
  ------------------
  |  Branch (431:8): [True: 0, False: 81]
  ------------------
  432|      0|				archive_set_error(
  433|      0|				    &f->archive->archive,
  434|      0|		    		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  435|      0|				    "Malformed lz4 data");
  436|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  437|      0|			}
  438|     81|			int64_t skip_bytes = archive_le32dec(read_buf);
  439|     81|			if (__archive_read_filter_consume(f->upstream,
  ------------------
  |  Branch (439:8): [True: 5, False: 76]
  ------------------
  440|     81|			    4 + skip_bytes) < 0) {
  441|      5|				archive_set_error(
  442|      5|				    &f->archive->archive,
  443|      5|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      5|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  444|      5|				    "Malformed lz4 data");
  445|      5|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  446|      5|			}
  447|     81|		} else {
  448|       |			/* Ignore following unrecognized data. */
  449|     38|			lz4->eof = 1;
  450|     38|			*p = NULL;
  451|     38|			return (0);
  452|     38|		}
  453|  2.33k|	}
  454|      0|	lz4->eof = 1;
  455|       |	*p = NULL;
  456|      0|	return (0);
  457|  2.34k|}
archive_read_support_filter_lz4.c:lz4_filter_read_default_stream:
  707|  7.53k|{
  708|  7.53k|	struct lz4 *lz4 = f->data;
  709|  7.53k|	const char *read_buf;
  710|  7.53k|	ssize_t ret;
  711|       |
  712|  7.53k|	if (lz4->stage == SELECT_STREAM) {
  ------------------
  |  Branch (712:6): [True: 1.37k, False: 6.16k]
  ------------------
  713|  1.37k|		lz4->stage = READ_DEFAULT_STREAM;
  714|       |		/* First, read a descriptor. */
  715|  1.37k|		if((ret = lz4_filter_read_descriptor(f)) != ARCHIVE_OK)
  ------------------
  |  |  233|  1.37k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (715:6): [True: 1, False: 1.37k]
  ------------------
  716|      1|			return (ret);
  717|  1.37k|		lz4->stage = READ_DEFAULT_BLOCK;
  718|  1.37k|	}
  719|       |	/* Decompress a block. */
  720|  7.53k|	ret = lz4_filter_read_data_block(f, p);
  721|       |
  722|       |	/* If the end of block is detected, change the filter status
  723|       |	   to read next stream. */
  724|  7.53k|	if (ret == 0 && *p == NULL)
  ------------------
  |  Branch (724:6): [True: 971, False: 6.56k]
  |  Branch (724:18): [True: 961, False: 10]
  ------------------
  725|    961|		lz4->stage = SELECT_STREAM;
  726|       |
  727|       |	/* Optional processing, checking a stream sum. */
  728|  7.53k|	if (lz4->flags.stream_checksum) {
  ------------------
  |  Branch (728:6): [True: 6.06k, False: 1.46k]
  ------------------
  729|  6.06k|		if (lz4->stage == SELECT_STREAM) {
  ------------------
  |  Branch (729:7): [True: 402, False: 5.66k]
  ------------------
  730|    402|			unsigned int checksum;
  731|    402|			unsigned int checksum_stream;
  732|    402|			read_buf = __archive_read_filter_ahead(f->upstream,
  733|    402|			    4, NULL);
  734|    402|			if (read_buf == NULL) {
  ------------------
  |  Branch (734:8): [True: 9, False: 393]
  ------------------
  735|      9|				archive_set_error(&f->archive->archive,
  736|      9|				    ARCHIVE_ERRNO_MISC, "truncated lz4 input");
  ------------------
  |  |  204|      9|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  737|      9|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      9|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  738|      9|			}
  739|    393|			checksum = archive_le32dec(read_buf);
  740|    393|			__archive_read_filter_consume(f->upstream, 4);
  741|    393|			checksum_stream = __archive_xxhash.XXH32_digest(
  742|    393|			    lz4->xxh32_state);
  743|    393|			lz4->xxh32_state = NULL;
  744|    393|			if (checksum != checksum_stream) {
  ------------------
  |  Branch (744:8): [True: 393, False: 0]
  ------------------
  745|       |#ifndef DONT_FAIL_ON_CRC_ERROR
  746|       |				archive_set_error(&f->archive->archive,
  747|       |				    ARCHIVE_ERRNO_MISC,
  748|       |				    "lz4 stream checksum error");
  749|       |				return (ARCHIVE_FATAL);
  750|       |#endif
  751|    393|			}
  752|  5.66k|		} else if (ret > 0)
  ------------------
  |  Branch (752:14): [True: 5.37k, False: 293]
  ------------------
  753|  5.37k|			__archive_xxhash.XXH32_update(lz4->xxh32_state,
  754|  5.37k|			    *p, (int)ret);
  755|  6.06k|	}
  756|  7.52k|	return (ret);
  757|  7.53k|}
archive_read_support_filter_lz4.c:lz4_filter_read_descriptor:
  461|  1.37k|{
  462|  1.37k|	struct lz4 *lz4 = f->data;
  463|  1.37k|	const char *read_buf;
  464|  1.37k|	ssize_t bytes_remaining;
  465|  1.37k|	ssize_t descriptor_bytes;
  466|  1.37k|	unsigned char flag, bd;
  467|  1.37k|	unsigned int chsum, chsum_verifier;
  468|       |
  469|       |	/* Make sure we have 2 bytes for flags. */
  470|  1.37k|	read_buf = __archive_read_filter_ahead(f->upstream, 2,
  471|  1.37k|	    &bytes_remaining);
  472|  1.37k|	if (read_buf == NULL) {
  ------------------
  |  Branch (472:6): [True: 0, False: 1.37k]
  ------------------
  473|      0|		archive_set_error(&f->archive->archive,
  474|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  475|      0|		    "truncated lz4 input");
  476|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  477|      0|	}
  478|       |
  479|       |	/*
  480|       |	   Parse flags.
  481|       |	 */
  482|  1.37k|	flag = (unsigned char)read_buf[0];
  483|       |	/* Verify version number. */
  484|  1.37k|	if ((flag & 0xc0) != 1<<6)
  ------------------
  |  Branch (484:6): [True: 0, False: 1.37k]
  ------------------
  485|      0|		goto malformed_error;
  486|       |	/* A reserved bit must be zero. */
  487|  1.37k|	if (flag & 0x02)
  ------------------
  |  Branch (487:6): [True: 0, False: 1.37k]
  ------------------
  488|      0|		goto malformed_error;
  489|  1.37k|	lz4->flags.block_independence = (flag & 0x20) != 0;
  490|  1.37k|	lz4->flags.block_checksum = (flag & 0x10)?4:0;
  ------------------
  |  Branch (490:30): [True: 41, False: 1.33k]
  ------------------
  491|  1.37k|	lz4->flags.stream_size = (flag & 0x08) != 0;
  492|  1.37k|	lz4->flags.stream_checksum = (flag & 0x04) != 0;
  493|  1.37k|	lz4->flags.preset_dictionary = (flag & 0x01) != 0;
  494|       |
  495|       |	/* BD */
  496|  1.37k|	bd = (unsigned char)read_buf[1];
  497|       |	/* Reserved bits must be zero. */
  498|  1.37k|	if (bd & 0x8f)
  ------------------
  |  Branch (498:6): [True: 0, False: 1.37k]
  ------------------
  499|      0|		goto malformed_error;
  500|       |	/* Get a maximum block size. */
  501|  1.37k|	switch (read_buf[1] >> 4) {
  502|    414|	case 4: /* 64 KB */
  ------------------
  |  Branch (502:2): [True: 414, False: 959]
  ------------------
  503|    414|		lz4->flags.block_maximum_size = 64 * 1024;
  504|    414|		break;
  505|    389|	case 5: /* 256 KB */
  ------------------
  |  Branch (505:2): [True: 389, False: 984]
  ------------------
  506|    389|		lz4->flags.block_maximum_size = 256 * 1024;
  507|    389|		break;
  508|      2|	case 6: /* 1 MB */
  ------------------
  |  Branch (508:2): [True: 2, False: 1.37k]
  ------------------
  509|      2|		lz4->flags.block_maximum_size = 1024 * 1024;
  510|      2|		break;
  511|    568|	case 7: /* 4 MB */
  ------------------
  |  Branch (511:2): [True: 568, False: 805]
  ------------------
  512|    568|		lz4->flags.block_maximum_size = 4 * 1024 * 1024;
  513|    568|		break;
  514|      0|	default:
  ------------------
  |  Branch (514:2): [True: 0, False: 1.37k]
  ------------------
  515|      0|		goto malformed_error;
  516|  1.37k|	}
  517|       |
  518|       |	/* Read the whole descriptor in a stream block. */
  519|  1.37k|	descriptor_bytes = 3;
  520|  1.37k|	if (lz4->flags.stream_size)
  ------------------
  |  Branch (520:6): [True: 3, False: 1.37k]
  ------------------
  521|      3|		descriptor_bytes += 8;
  522|  1.37k|	if (lz4->flags.preset_dictionary)
  ------------------
  |  Branch (522:6): [True: 2, False: 1.37k]
  ------------------
  523|      2|		descriptor_bytes += 4;
  524|  1.37k|	if (bytes_remaining < descriptor_bytes) {
  ------------------
  |  Branch (524:6): [True: 3, False: 1.37k]
  ------------------
  525|      3|		read_buf = __archive_read_filter_ahead(f->upstream,
  526|      3|		    descriptor_bytes, &bytes_remaining);
  527|      3|		if (read_buf == NULL) {
  ------------------
  |  Branch (527:7): [True: 1, False: 2]
  ------------------
  528|      1|			archive_set_error(&f->archive->archive,
  529|      1|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  530|      1|			    "truncated lz4 input");
  531|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  532|      1|		}
  533|      3|	}
  534|       |	/* Check if a descriptor is corrupted */
  535|  1.37k|	chsum = __archive_xxhash.XXH32(read_buf, (int)descriptor_bytes -1, 0);
  536|  1.37k|	chsum = (chsum >> 8) & 0xff;
  537|  1.37k|	chsum_verifier = read_buf[descriptor_bytes-1] & 0xff;
  538|       |#ifndef DONT_FAIL_ON_CRC_ERROR
  539|       |	if (chsum != chsum_verifier)
  540|       |		goto malformed_error;
  541|       |#endif
  542|       |
  543|  1.37k|	__archive_read_filter_consume(f->upstream, descriptor_bytes);
  544|       |
  545|       |	/* Make sure we have a large enough buffer for uncompressed data. */
  546|  1.37k|	if (lz4_allocate_out_block(f) != ARCHIVE_OK)
  ------------------
  |  |  233|  1.37k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (546:6): [True: 0, False: 1.37k]
  ------------------
  547|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  548|  1.37k|	if (lz4->flags.stream_checksum) {
  ------------------
  |  Branch (548:6): [True: 711, False: 661]
  ------------------
  549|    711|		lz4->xxh32_state = __archive_xxhash.XXH32_init(0);
  550|    711|		if (lz4->xxh32_state == NULL)
  ------------------
  |  Branch (550:7): [True: 0, False: 711]
  ------------------
  551|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  552|    711|	}
  553|       |
  554|  1.37k|	lz4->decoded_size = 0;
  555|       |	/* Success */
  556|  1.37k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.37k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  557|      0|malformed_error:
  558|      0|	archive_set_error(&f->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  559|      0|	    "malformed lz4 data");
  560|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  561|  1.37k|}
archive_read_support_filter_lz4.c:lz4_allocate_out_block:
  321|  1.37k|{
  322|  1.37k|	struct lz4 *lz4 = f->data;
  323|  1.37k|	size_t out_block_size = lz4->flags.block_maximum_size;
  324|  1.37k|	void *out_block;
  325|       |
  326|  1.37k|	if (!lz4->flags.block_independence)
  ------------------
  |  Branch (326:6): [True: 680, False: 692]
  ------------------
  327|    680|		out_block_size += 64 * 1024;
  328|  1.37k|	if (lz4->out_block_size < out_block_size) {
  ------------------
  |  Branch (328:6): [True: 468, False: 904]
  ------------------
  329|    468|		free(lz4->out_block);
  330|    468|		lz4->out_block = NULL;
  331|    468|		out_block = malloc(out_block_size);
  332|    468|		if (out_block == NULL) {
  ------------------
  |  Branch (332:7): [True: 0, False: 468]
  ------------------
  333|      0|			lz4->out_block_size = 0;
  334|      0|			archive_set_error(&f->archive->archive, ENOMEM,
  335|      0|			    "Can't allocate data for lz4 decompression");
  336|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  337|      0|		}
  338|    468|		lz4->out_block_size = out_block_size;
  339|    468|		lz4->out_block = out_block;
  340|    468|	}
  341|  1.37k|	if (!lz4->flags.block_independence)
  ------------------
  |  Branch (341:6): [True: 680, False: 692]
  ------------------
  342|    680|		memset(lz4->out_block, 0, 64 * 1024);
  343|  1.37k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.37k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  344|  1.37k|}
archive_read_support_filter_lz4.c:lz4_filter_read_data_block:
  565|  7.53k|{
  566|  7.53k|	struct lz4 *lz4 = f->data;
  567|  7.53k|	ssize_t compressed_size;
  568|  7.53k|	const char *read_buf;
  569|  7.53k|	int checksum_size;
  570|  7.53k|	ssize_t uncompressed_size;
  571|  7.53k|	size_t prefix64k;
  572|       |
  573|  7.53k|	*p = NULL;
  574|       |
  575|       |	/* Make sure we have 4 bytes for a block size. */
  576|  7.53k|	read_buf = __archive_read_filter_ahead(f->upstream, 4, NULL);
  577|  7.53k|	if (read_buf == NULL)
  ------------------
  |  Branch (577:6): [True: 186, False: 7.34k]
  ------------------
  578|    186|		goto truncated_error;
  579|  7.34k|	compressed_size = archive_le32dec(read_buf);
  580|  7.34k|	if ((compressed_size & 0x7fffffff) > lz4->flags.block_maximum_size)
  ------------------
  |  Branch (580:6): [True: 114, False: 7.23k]
  ------------------
  581|    114|		goto malformed_error;
  582|       |	/* A compressed size == 0 means the end of stream blocks. */
  583|  7.23k|	if (compressed_size == 0) {
  ------------------
  |  Branch (583:6): [True: 961, False: 6.27k]
  ------------------
  584|    961|		__archive_read_filter_consume(f->upstream, 4);
  585|    961|		return 0;
  586|    961|	}
  587|       |
  588|  6.27k|	checksum_size = lz4->flags.block_checksum;
  589|       |	/* Check if the block is uncompressed. */
  590|  6.27k|	if (compressed_size & 0x80000000U) {
  ------------------
  |  Branch (590:6): [True: 5.45k, False: 815]
  ------------------
  591|  5.45k|		compressed_size &= 0x7fffffff;
  592|  5.45k|		uncompressed_size = compressed_size;
  593|  5.45k|	} else
  594|    815|		uncompressed_size = 0;/* Unknown yet. */
  595|       |
  596|       |	/*
  597|       |	  Unfortunately, lz4 decompression API requires a whole block
  598|       |	  for its decompression speed, so we read a whole block and allocate
  599|       |	  a huge buffer used for decoded data.
  600|       |	*/
  601|  6.27k|	read_buf = __archive_read_filter_ahead(f->upstream,
  602|  6.27k|	    4 + compressed_size + checksum_size, NULL);
  603|  6.27k|	if (read_buf == NULL)
  ------------------
  |  Branch (603:6): [True: 46, False: 6.22k]
  ------------------
  604|     46|		goto truncated_error;
  605|       |
  606|       |	/* Optional processing, checking a block sum. */
  607|  6.22k|	if (checksum_size) {
  ------------------
  |  Branch (607:6): [True: 624, False: 5.60k]
  ------------------
  608|    624|		unsigned int chsum = __archive_xxhash.XXH32(
  609|    624|			read_buf + 4, (int)compressed_size, 0);
  610|    624|		unsigned int chsum_block =
  611|    624|		    archive_le32dec(read_buf + 4 + compressed_size);
  612|       |#ifndef DONT_FAIL_ON_CRC_ERROR
  613|       |		if (chsum != chsum_block)
  614|       |			goto malformed_error;
  615|       |#endif
  616|    624|	}
  617|       |
  618|       |
  619|       |	/* If the block is uncompressed, there is nothing to do. */
  620|  6.22k|	if (uncompressed_size) {
  ------------------
  |  Branch (620:6): [True: 5.44k, False: 785]
  ------------------
  621|       |		/* Prepare a prefix 64k block for next block. */
  622|  5.44k|		if (!lz4->flags.block_independence) {
  ------------------
  |  Branch (622:7): [True: 1.68k, False: 3.75k]
  ------------------
  623|  1.68k|			prefix64k = 64 * 1024;
  624|  1.68k|			if (uncompressed_size < (ssize_t)prefix64k) {
  ------------------
  |  Branch (624:8): [True: 1.68k, False: 2]
  ------------------
  625|  1.68k|				memcpy(lz4->out_block
  626|  1.68k|					+ prefix64k - uncompressed_size,
  627|  1.68k|				    read_buf + 4,
  628|  1.68k|				    uncompressed_size);
  629|  1.68k|				memset(lz4->out_block, 0,
  630|  1.68k|				    prefix64k - uncompressed_size);
  631|  1.68k|			} else {
  632|      2|				memcpy(lz4->out_block,
  633|      2|				    read_buf + 4
  634|      2|					+ uncompressed_size - prefix64k,
  635|      2|				    prefix64k);
  636|      2|			}
  637|  1.68k|			lz4->decoded_size = 0;
  638|  1.68k|		}
  639|  5.44k|		lz4->unconsumed = 4 + uncompressed_size + checksum_size;
  640|  5.44k|		*p = read_buf + 4;
  641|  5.44k|		return uncompressed_size;
  642|  5.44k|	}
  643|       |
  644|       |	/*
  645|       |	   Decompress a block data.
  646|       |	 */
  647|    785|	if (lz4->flags.block_independence) {
  ------------------
  |  Branch (647:6): [True: 327, False: 458]
  ------------------
  648|    327|		prefix64k = 0;
  649|    327|		uncompressed_size = LZ4_decompress_safe(read_buf + 4,
  650|    327|		    lz4->out_block, (int)compressed_size,
  651|    327|		    lz4->flags.block_maximum_size);
  652|    458|	} else {
  653|    458|		prefix64k = 64 * 1024;
  654|    458|		if (lz4->decoded_size) {
  ------------------
  |  Branch (654:7): [True: 120, False: 338]
  ------------------
  655|    120|			if (lz4->decoded_size < prefix64k) {
  ------------------
  |  Branch (655:8): [True: 120, False: 0]
  ------------------
  656|    120|				memmove(lz4->out_block
  657|    120|					+ prefix64k - lz4->decoded_size,
  658|    120|				    lz4->out_block + prefix64k,
  659|    120|				    lz4->decoded_size);
  660|    120|				memset(lz4->out_block, 0,
  661|    120|				    prefix64k - lz4->decoded_size);
  662|    120|			} else {
  663|      0|				memmove(lz4->out_block,
  664|      0|				    lz4->out_block + lz4->decoded_size,
  665|      0|				    prefix64k);
  666|      0|			}
  667|    120|		}
  668|    458|#if LZ4_VERSION_MAJOR >= 1 && LZ4_VERSION_MINOR >= 7
  669|    458|		uncompressed_size = LZ4_decompress_safe_usingDict(
  670|    458|		    read_buf + 4,
  671|    458|		    lz4->out_block + prefix64k, (int)compressed_size,
  672|    458|		    lz4->flags.block_maximum_size,
  673|    458|		    lz4->out_block,
  674|    458|		    (int)prefix64k);
  675|       |#else
  676|       |		uncompressed_size = LZ4_decompress_safe_withPrefix64k(
  677|       |		    read_buf + 4,
  678|       |		    lz4->out_block + prefix64k, (int)compressed_size,
  679|       |		    lz4->flags.block_maximum_size);
  680|       |#endif
  681|    458|	}
  682|       |
  683|       |	/* Check if an error occurred in the decompression process. */
  684|    785|	if (uncompressed_size < 0) {
  ------------------
  |  Branch (684:6): [True: 16, False: 769]
  ------------------
  685|     16|		archive_set_error(&(f->archive->archive),
  686|     16|		    ARCHIVE_ERRNO_MISC, "lz4 decompression failed");
  ------------------
  |  |  204|     16|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  687|     16|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     16|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  688|     16|	}
  689|       |
  690|    769|	lz4->unconsumed = 4 + compressed_size + checksum_size;
  691|    769|	*p = lz4->out_block + prefix64k;
  692|    769|	lz4->decoded_size = uncompressed_size;
  693|    769|	return uncompressed_size;
  694|       |
  695|    114|malformed_error:
  696|    114|	archive_set_error(&f->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    114|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  697|    114|	    "malformed lz4 data");
  698|    114|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    114|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  699|    232|truncated_error:
  700|    232|	archive_set_error(&f->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    232|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  701|    232|	    "truncated lz4 input");
  702|    232|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    232|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  703|    785|}
archive_read_support_filter_lz4.c:lz4_filter_read_legacy_stream:
  761|  1.97k|{
  762|  1.97k|	struct lz4 *lz4 = f->data;
  763|  1.97k|	uint32_t compressed;
  764|  1.97k|	const char *read_buf;
  765|  1.97k|	ssize_t ret;
  766|       |
  767|  1.97k|	*p = NULL;
  768|  1.97k|	ret = lz4_allocate_out_block_for_legacy(f);
  769|  1.97k|	if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|  1.97k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (769:6): [True: 0, False: 1.97k]
  ------------------
  770|      0|		return ret;
  771|       |
  772|       |	/* Make sure we have 4 bytes for a block size. */
  773|  1.97k|	read_buf = __archive_read_filter_ahead(f->upstream, 4, NULL);
  774|  1.97k|	if (read_buf == NULL) {
  ------------------
  |  Branch (774:6): [True: 62, False: 1.91k]
  ------------------
  775|     62|		if (lz4->stage == SELECT_STREAM) {
  ------------------
  |  Branch (775:7): [True: 0, False: 62]
  ------------------
  776|      0|			lz4->stage = READ_LEGACY_STREAM;
  777|      0|			archive_set_error(&f->archive->archive,
  778|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  779|      0|			    "truncated lz4 input");
  780|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  781|      0|		}
  782|     62|		lz4->stage = SELECT_STREAM;
  783|     62|		return 0;
  784|     62|	}
  785|  1.91k|	lz4->stage = READ_LEGACY_BLOCK;
  786|  1.91k|	compressed = archive_le32dec(read_buf);
  787|  1.91k|	if (compressed > LZ4_COMPRESSBOUND(LEGACY_BLOCK_SIZE)) {
  ------------------
  |  Branch (787:6): [True: 750, False: 1.16k]
  |  Branch (787:19): [Folded, False: 1.91k]
  ------------------
  788|    750|		lz4->stage = SELECT_STREAM;
  789|    750|		return 0;
  790|    750|	}
  791|       |
  792|       |	/* Make sure we have a whole block. */
  793|  1.16k|	read_buf = __archive_read_filter_ahead(f->upstream,
  794|  1.16k|	    4 + compressed, NULL);
  795|  1.16k|	if (read_buf == NULL) {
  ------------------
  |  Branch (795:6): [True: 30, False: 1.13k]
  ------------------
  796|     30|		archive_set_error(&(f->archive->archive),
  797|     30|		    ARCHIVE_ERRNO_MISC, "truncated lz4 input");
  ------------------
  |  |  204|     30|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  798|     30|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     30|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  799|     30|	}
  800|  1.13k|	ret = LZ4_decompress_safe(read_buf + 4, lz4->out_block,
  801|  1.13k|	    compressed, (int)lz4->out_block_size);
  802|  1.13k|	if (ret < 0) {
  ------------------
  |  Branch (802:6): [True: 4, False: 1.12k]
  ------------------
  803|      4|		archive_set_error(&(f->archive->archive),
  804|      4|		    ARCHIVE_ERRNO_MISC, "lz4 decompression failed");
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  805|      4|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  806|      4|	}
  807|  1.12k|	*p = lz4->out_block;
  808|  1.12k|	lz4->unconsumed = 4 + compressed;
  809|  1.12k|	return ret;
  810|  1.13k|}
archive_read_support_filter_lz4.c:lz4_allocate_out_block_for_legacy:
  348|  1.97k|{
  349|  1.97k|	struct lz4 *lz4 = f->data;
  350|  1.97k|	size_t out_block_size = LEGACY_BLOCK_SIZE;
  ------------------
  |  |   89|  1.97k|#define LEGACY_BLOCK_SIZE	(8 * 1024 * 1024)
  ------------------
  351|  1.97k|	void *out_block;
  352|       |
  353|  1.97k|	if (lz4->out_block_size < out_block_size) {
  ------------------
  |  Branch (353:6): [True: 117, False: 1.85k]
  ------------------
  354|    117|		free(lz4->out_block);
  355|    117|		lz4->out_block = NULL;
  356|    117|		out_block = malloc(out_block_size);
  357|    117|		if (out_block == NULL) {
  ------------------
  |  Branch (357:7): [True: 0, False: 117]
  ------------------
  358|      0|			lz4->out_block_size = 0;
  359|      0|			archive_set_error(&f->archive->archive, ENOMEM,
  360|      0|			    "Can't allocate data for lz4 decompression");
  361|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  362|      0|		}
  363|    117|		lz4->out_block_size = out_block_size;
  364|    117|		lz4->out_block = out_block;
  365|    117|	}
  366|  1.97k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.97k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  367|  1.97k|}
archive_read_support_filter_lz4.c:lz4_filter_close:
  817|    584|{
  818|    584|	struct lz4 *lz4 = f->data;
  819|    584|	int ret = ARCHIVE_OK;
  ------------------
  |  |  233|    584|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  820|       |
  821|    584|	free(lz4->xxh32_state);
  822|    584|	free(lz4->out_block);
  823|    584|	free(lz4);
  824|    584|	return (ret);
  825|    584|}

archive_read_support_filter_lzop:
  109|  16.7k|{
  110|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
  111|       |
  112|  16.7k|	if (__archive_read_register_bidder(a, NULL,
  ------------------
  |  Branch (112:6): [True: 0, False: 16.7k]
  ------------------
  113|  16.7k|				&lzop_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  16.7k|#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|  16.7k|	archive_set_error(_a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  16.7k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  121|  16.7k|	    "Using external lzop program for lzop decompression");
  122|  16.7k|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|  16.7k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  123|  16.7k|#endif
  124|  16.7k|}
archive_read_support_filter_lzop.c:lzop_bidder_bid:
  132|  19.0k|{
  133|  19.0k|	const unsigned char *p;
  134|       |
  135|  19.0k|	(void)b; /* UNUSED */
  136|       |
  137|  19.0k|	p = __archive_read_filter_ahead(f, LZOP_HEADER_MAGIC_LEN, NULL);
  ------------------
  |  |   68|  19.0k|#define LZOP_HEADER_MAGIC_LEN 9
  ------------------
  138|  19.0k|	if (p == NULL)
  ------------------
  |  Branch (138:6): [True: 338, False: 18.7k]
  ------------------
  139|    338|		return (0);
  140|       |
  141|  18.7k|	if (memcmp(p, LZOP_HEADER_MAGIC, LZOP_HEADER_MAGIC_LEN))
  ------------------
  |  |   67|  18.7k|#define LZOP_HEADER_MAGIC "\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a"
  ------------------
              	if (memcmp(p, LZOP_HEADER_MAGIC, LZOP_HEADER_MAGIC_LEN))
  ------------------
  |  |   68|  18.7k|#define LZOP_HEADER_MAGIC_LEN 9
  ------------------
  |  Branch (141:6): [True: 18.7k, False: 1]
  ------------------
  142|  18.7k|		return (0);
  143|       |
  144|      1|	return (LZOP_HEADER_MAGIC_LEN * 8);
  ------------------
  |  |   68|      1|#define LZOP_HEADER_MAGIC_LEN 9
  ------------------
  145|  18.7k|}
archive_read_support_filter_lzop.c:lzop_bidder_init:
  155|      1|{
  156|      1|	int r;
  157|       |
  158|      1|	r = __archive_read_program(f, "lzop -d");
  159|       |	/* Note: We set the format here even if __archive_read_program()
  160|       |	 * above fails.  We do, after all, know what the format is
  161|       |	 * even if we weren't able to read it. */
  162|      1|	f->code = ARCHIVE_FILTER_LZOP;
  ------------------
  |  |  320|      1|#define	ARCHIVE_FILTER_LZOP	11
  ------------------
  163|      1|	f->name = "lzop";
  164|      1|	return (r);
  165|      1|}

__archive_read_program:
  399|      3|{
  400|      3|	struct program *program;
  401|      3|	static const size_t out_buf_len = 65536;
  402|      3|	char *out_buf;
  403|      3|	const char *prefix = "Program: ";
  404|      3|	int ret;
  405|      3|	size_t l;
  406|       |
  407|      3|	l = strlen(prefix) + strlen(cmd) + 1;
  408|      3|	program = calloc(1, sizeof(*program));
  409|      3|	out_buf = malloc(out_buf_len);
  410|      3|	if (program == NULL || out_buf == NULL ||
  ------------------
  |  Branch (410:6): [True: 0, False: 3]
  |  Branch (410:25): [True: 0, False: 3]
  ------------------
  411|      3|	    archive_string_ensure(&program->description, l) == NULL) {
  ------------------
  |  Branch (411:6): [True: 0, False: 3]
  ------------------
  412|      0|		archive_set_error(&f->archive->archive, ENOMEM,
  413|      0|		    "Can't allocate input data");
  414|      0|		if (program != NULL) {
  ------------------
  |  Branch (414:7): [True: 0, False: 0]
  ------------------
  415|      0|			archive_string_free(&program->description);
  416|      0|			free(program);
  417|      0|		}
  418|      0|		free(out_buf);
  419|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  420|      0|	}
  421|      3|	archive_strcpy(&program->description, prefix);
  ------------------
  |  |  165|      3|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|      6|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  422|      3|	archive_strcat(&program->description, cmd);
  423|       |
  424|      3|	f->code = ARCHIVE_FILTER_PROGRAM;
  ------------------
  |  |  313|      3|#define	ARCHIVE_FILTER_PROGRAM	4
  ------------------
  425|      3|	f->name = program->description.s;
  426|       |
  427|      3|	program->out_buf = out_buf;
  428|      3|	program->out_buf_len = out_buf_len;
  429|       |
  430|      3|	ret = __archive_create_child(cmd, &program->child_stdin,
  431|      3|	    &program->child_stdout, &program->child);
  432|      3|	if (ret != ARCHIVE_OK) {
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (432:6): [True: 0, False: 3]
  ------------------
  433|      0|		free(program->out_buf);
  434|      0|		archive_string_free(&program->description);
  435|      0|		free(program);
  436|      0|		archive_set_error(&f->archive->archive, EINVAL,
  437|      0|		    "Can't initialize filter; unable to run program \"%s\"",
  438|      0|		    cmd);
  439|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  440|      0|	}
  441|       |
  442|      3|	f->data = program;
  443|      3|	f->vtable = &program_reader_vtable;
  444|       |
  445|       |	/* XXX Check that we can read at least one byte? */
  446|      3|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  447|      3|}
archive_read_support_filter_program.c:program_filter_read:
  463|      3|{
  464|      3|	struct program *program = f->data;
  465|      3|	ssize_t bytes;
  466|      3|	size_t total;
  467|      3|	char *p;
  468|       |
  469|      3|	total = 0;
  470|      3|	p = program->out_buf;
  471|      3|	while (program->child_stdout != -1 && total < program->out_buf_len) {
  ------------------
  |  Branch (471:9): [True: 3, False: 0]
  |  Branch (471:40): [True: 3, False: 0]
  ------------------
  472|      3|		bytes = child_read(f, p, program->out_buf_len - total);
  473|      3|		if (bytes < 0)
  ------------------
  |  Branch (473:7): [True: 3, False: 0]
  ------------------
  474|       |			/* No recovery is possible if we can no longer
  475|       |			 * read from the child. */
  476|      3|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  477|      0|		if (bytes == 0)
  ------------------
  |  Branch (477:7): [True: 0, False: 0]
  ------------------
  478|       |			/* We got EOF from the child. */
  479|      0|			break;
  480|      0|		total += bytes;
  481|      0|		p += bytes;
  482|      0|	}
  483|       |
  484|      0|	*buff = program->out_buf;
  485|      0|	return (total);
  486|      3|}
archive_read_support_filter_program.c:child_read:
  303|      3|{
  304|      3|	struct program *program = f->data;
  305|      3|	ssize_t ret, requested, avail;
  306|      3|	const char *p;
  307|       |#if defined(_WIN32) && !defined(__CYGWIN__)
  308|       |	HANDLE handle = (HANDLE)_get_osfhandle(program->child_stdout);
  309|       |#endif
  310|       |
  311|      3|	requested = buf_len > SSIZE_MAX ? SSIZE_MAX : buf_len;
  ------------------
  |  Branch (311:14): [True: 0, False: 3]
  ------------------
  312|       |
  313|      3|	for (;;) {
  314|      3|		do {
  315|       |#if defined(_WIN32) && !defined(__CYGWIN__)
  316|       |			/* Avoid infinity wait.
  317|       |			 * Note: If there is no data in the pipe, ReadFile()
  318|       |			 * called in read() never returns and so we won't
  319|       |			 * write remaining encoded data to the pipe.
  320|       |			 * Note: This way may cause performance problem.
  321|       |			 * we are looking forward to great code to resolve
  322|       |			 * this.  */
  323|       |			DWORD pipe_avail = -1;
  324|       |			int cnt = 2;
  325|       |
  326|       |			while (PeekNamedPipe(handle, NULL, 0, NULL,
  327|       |			    &pipe_avail, NULL) != 0 && pipe_avail == 0 &&
  328|       |			    cnt--)
  329|       |				Sleep(5);
  330|       |			if (pipe_avail == 0) {
  331|       |				ret = -1;
  332|       |				errno = EAGAIN;
  333|       |				break;
  334|       |			}
  335|       |#endif
  336|      3|			ret = read(program->child_stdout, buf, requested);
  337|      3|		} while (ret == -1 && errno == EINTR);
  ------------------
  |  Branch (337:12): [True: 0, False: 3]
  |  Branch (337:25): [True: 0, False: 0]
  ------------------
  338|       |
  339|      3|		if (ret > 0)
  ------------------
  |  Branch (339:7): [True: 0, False: 3]
  ------------------
  340|      0|			return (ret);
  341|      3|		if (ret == 0 || (ret == -1 && errno == EPIPE))
  ------------------
  |  Branch (341:7): [True: 3, False: 0]
  |  Branch (341:20): [True: 0, False: 0]
  |  Branch (341:33): [True: 0, False: 0]
  ------------------
  342|       |			/* Child has closed its output; reap the child
  343|       |			 * and return the status. */
  344|      3|			return (child_stop(f, program));
  345|      0|		if (ret == -1 && errno != EAGAIN)
  ------------------
  |  Branch (345:7): [True: 0, False: 0]
  |  Branch (345:20): [True: 0, False: 0]
  ------------------
  346|      0|			return (-1);
  347|       |
  348|      0|		if (program->child_stdin == -1) {
  ------------------
  |  Branch (348:7): [True: 0, False: 0]
  ------------------
  349|       |			/* Block until child has some I/O ready. */
  350|      0|			__archive_check_child(program->child_stdin,
  351|      0|			    program->child_stdout);
  352|      0|			continue;
  353|      0|		}
  354|       |
  355|       |		/* Get some more data from upstream. */
  356|      0|		p = __archive_read_filter_ahead(f->upstream, 1, &avail);
  357|      0|		if (p == NULL) {
  ------------------
  |  Branch (357:7): [True: 0, False: 0]
  ------------------
  358|      0|			close(program->child_stdin);
  359|      0|			program->child_stdin = -1;
  360|      0|			fcntl(program->child_stdout, F_SETFL, 0);
  361|      0|			if (avail < 0)
  ------------------
  |  Branch (361:8): [True: 0, False: 0]
  ------------------
  362|      0|				return (avail);
  363|      0|			continue;
  364|      0|		}
  365|       |
  366|      0|		do {
  367|      0|			ret = write(program->child_stdin, p, avail);
  368|      0|		} while (ret == -1 && errno == EINTR);
  ------------------
  |  Branch (368:12): [True: 0, False: 0]
  |  Branch (368:25): [True: 0, False: 0]
  ------------------
  369|       |
  370|      0|		if (ret > 0) {
  ------------------
  |  Branch (370:7): [True: 0, False: 0]
  ------------------
  371|       |			/* Consume whatever we managed to write. */
  372|      0|			__archive_read_filter_consume(f->upstream, ret);
  373|      0|		} else if (ret == -1 && errno == EAGAIN) {
  ------------------
  |  Branch (373:14): [True: 0, False: 0]
  |  Branch (373:27): [True: 0, False: 0]
  ------------------
  374|       |			/* Block until child has some I/O ready. */
  375|      0|			__archive_check_child(program->child_stdin,
  376|      0|			    program->child_stdout);
  377|      0|		} else {
  378|       |			/* Write failed. */
  379|      0|			close(program->child_stdin);
  380|      0|			program->child_stdin = -1;
  381|      0|			fcntl(program->child_stdout, F_SETFL, 0);
  382|       |			/* If it was a bad error, we're done; otherwise
  383|       |			 * it was EPIPE or EOF, and we can still read
  384|       |			 * from the child. */
  385|      0|			if (ret == -1 && errno != EPIPE)
  ------------------
  |  Branch (385:8): [True: 0, False: 0]
  |  Branch (385:21): [True: 0, False: 0]
  ------------------
  386|      0|				return (-1);
  387|      0|		}
  388|      0|	}
  389|      3|}
archive_read_support_filter_program.c:child_stop:
  238|      6|{
  239|       |	/* Close our side of the I/O with the child. */
  240|      6|	if (program->child_stdin != -1) {
  ------------------
  |  Branch (240:6): [True: 3, False: 3]
  ------------------
  241|      3|		close(program->child_stdin);
  242|      3|		program->child_stdin = -1;
  243|      3|	}
  244|      6|	if (program->child_stdout != -1) {
  ------------------
  |  Branch (244:6): [True: 3, False: 3]
  ------------------
  245|      3|		close(program->child_stdout);
  246|      3|		program->child_stdout = -1;
  247|      3|	}
  248|       |
  249|      6|	if (program->child != 0) {
  ------------------
  |  Branch (249:6): [True: 3, False: 3]
  ------------------
  250|       |		/* Reap the child. */
  251|      3|		do {
  252|      3|			program->waitpid_return
  253|      3|			    = waitpid(program->child, &program->exit_status, 0);
  254|      3|		} while (program->waitpid_return == -1 && errno == EINTR);
  ------------------
  |  Branch (254:12): [True: 0, False: 3]
  |  Branch (254:45): [True: 0, False: 0]
  ------------------
  255|      3|		program->child = 0;
  256|      3|	}
  257|       |
  258|      6|	if (program->waitpid_return < 0) {
  ------------------
  |  Branch (258:6): [True: 0, False: 6]
  ------------------
  259|       |		/* waitpid() failed?  This is ugly. */
  260|      0|		archive_set_error(&f->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  261|      0|		    "Error closing child process");
  262|      0|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  263|      0|	}
  264|       |
  265|      6|#if !defined(_WIN32) || defined(__CYGWIN__)
  266|      6|	if (WIFSIGNALED(program->exit_status)) {
  ------------------
  |  Branch (266:6): [True: 0, False: 6]
  ------------------
  267|      0|#ifdef SIGPIPE
  268|       |		/* If the child died because we stopped reading before
  269|       |		 * it was done, that's okay.  Some archive formats
  270|       |		 * have padding at the end that we routinely ignore. */
  271|       |		/* The alternative to this would be to add a step
  272|       |		 * before close(child_stdout) above to read from the
  273|       |		 * child until the child has no more to write. */
  274|      0|		if (WTERMSIG(program->exit_status) == SIGPIPE)
  ------------------
  |  Branch (274:7): [True: 0, False: 0]
  ------------------
  275|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  276|      0|#endif
  277|      0|		archive_set_error(&f->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  278|      0|		    "Child process exited with signal %d",
  279|      0|		    WTERMSIG(program->exit_status));
  280|      0|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  281|      0|	}
  282|      6|#endif /* !_WIN32 || __CYGWIN__ */
  283|       |
  284|      6|	if (WIFEXITED(program->exit_status)) {
  ------------------
  |  Branch (284:6): [True: 6, False: 0]
  ------------------
  285|      6|		if (WEXITSTATUS(program->exit_status) == 0)
  ------------------
  |  Branch (285:7): [True: 0, False: 6]
  ------------------
  286|      0|			return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  287|       |
  288|      6|		archive_set_error(&f->archive->archive,
  289|      6|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      6|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  290|      6|		    "Child process exited with status %d",
  291|      6|		    WEXITSTATUS(program->exit_status));
  292|      6|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      6|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  293|      6|	}
  294|       |
  295|      0|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  296|      6|}
archive_read_support_filter_program.c:program_filter_close:
  490|      3|{
  491|      3|	struct program *program = f->data;
  492|      3|	int e;
  493|       |
  494|      3|	e = child_stop(f, program);
  495|       |
  496|       |	/* Release our private data. */
  497|      3|	free(program->out_buf);
  498|      3|	archive_string_free(&program->description);
  499|      3|	free(program);
  500|       |
  501|      3|	return (e);
  502|      3|}

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

archive_read_support_filter_uu:
   92|  16.7k|{
   93|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
   94|       |
   95|       |	return __archive_read_register_bidder(a, NULL,
   96|  16.7k|			&uudecode_bidder_vtable);
   97|  16.7k|}
archive_read_support_filter_uu.c:uudecode_bidder_bid:
  263|  19.0k|{
  264|  19.0k|	const unsigned char *p;
  265|  19.0k|	ssize_t avail, ravail;
  266|  19.0k|	ssize_t len, nl;
  267|  19.0k|	int l;
  268|  19.0k|	int firstline;
  269|  19.0k|	size_t nbytes_read;
  270|       |
  271|  19.0k|	(void)b; /* UNUSED */
  272|       |
  273|  19.0k|	p = __archive_read_filter_ahead(f, 1, &avail);
  274|  19.0k|	if (p == NULL)
  ------------------
  |  Branch (274:6): [True: 302, False: 18.7k]
  ------------------
  275|    302|		return (0);
  276|       |
  277|  18.7k|	firstline = 20;
  278|  18.7k|	ravail = avail;
  279|  18.7k|	nbytes_read = avail;
  280|  1.11M|	for (;;) {
  281|  1.11M|		len = bid_get_line(f, &p, &avail, &ravail, &nl, &nbytes_read);
  282|  1.11M|		if (len < 0 || nl == 0)
  ------------------
  |  Branch (282:7): [True: 17.9k, False: 1.09M]
  |  Branch (282:18): [True: 576, False: 1.09M]
  ------------------
  283|  18.5k|			return (0); /* No match found. */
  284|  1.09M|		if (len - nl >= 11 && memcmp(p, "begin ", 6) == 0)
  ------------------
  |  Branch (284:7): [True: 8.00k, False: 1.08M]
  |  Branch (284:25): [True: 1.98k, False: 6.01k]
  ------------------
  285|  1.98k|			l = 6;
  286|  1.09M|		else if (len -nl >= 18 && memcmp(p, "begin-base64 ", 13) == 0)
  ------------------
  |  Branch (286:12): [True: 3.41k, False: 1.08M]
  |  Branch (286:29): [True: 559, False: 2.85k]
  ------------------
  287|    559|			l = 13;
  288|  1.09M|		else
  289|  1.09M|			l = 0;
  290|       |
  291|  1.09M|		if (l > 0 && (p[l] < '0' || p[l] > '7' ||
  ------------------
  |  Branch (291:7): [True: 2.54k, False: 1.09M]
  |  Branch (291:17): [True: 229, False: 2.31k]
  |  Branch (291:31): [True: 399, False: 1.91k]
  ------------------
  292|  1.91k|		    p[l+1] < '0' || p[l+1] > '7' ||
  ------------------
  |  Branch (292:7): [True: 348, False: 1.56k]
  |  Branch (292:23): [True: 351, False: 1.21k]
  ------------------
  293|  1.21k|		    p[l+2] < '0' || p[l+2] > '7' || p[l+3] != ' '))
  ------------------
  |  Branch (293:7): [True: 163, False: 1.05k]
  |  Branch (293:23): [True: 443, False: 611]
  |  Branch (293:39): [True: 403, False: 208]
  ------------------
  294|  2.33k|			l = 0;
  295|       |
  296|  1.09M|		p += len;
  297|  1.09M|		avail -= len;
  298|  1.09M|		if (l)
  ------------------
  |  Branch (298:7): [True: 208, False: 1.09M]
  ------------------
  299|    208|			break;
  300|  1.09M|		firstline = 0;
  301|       |
  302|       |		/* Do not read more than UUENCODE_BID_MAX_READ bytes */
  303|  1.09M|		if (nbytes_read >= UUENCODE_BID_MAX_READ)
  ------------------
  |  |   44|  1.09M|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (303:7): [True: 30, False: 1.09M]
  ------------------
  304|     30|			return (0);
  305|  1.09M|	}
  306|    208|	if (!avail)
  ------------------
  |  Branch (306:6): [True: 0, False: 208]
  ------------------
  307|      0|		return (0);
  308|    208|	len = bid_get_line(f, &p, &avail, &ravail, &nl, &nbytes_read);
  309|    208|	if (len < 0 || nl == 0)
  ------------------
  |  Branch (309:6): [True: 0, False: 208]
  |  Branch (309:17): [True: 0, False: 208]
  ------------------
  310|      0|		return (0);/* There are non-ascii characters. */
  311|    208|	avail -= len;
  312|       |
  313|    208|	if (l == 6) {
  ------------------
  |  Branch (313:6): [True: 102, False: 106]
  ------------------
  314|       |		/* "begin " */
  315|    102|		if (!uuchar[*p])
  ------------------
  |  Branch (315:7): [True: 0, False: 102]
  ------------------
  316|      0|			return (0);
  317|       |		/* Get a length of decoded bytes. */
  318|    102|		l = UUDECODE(*p++); len--;
  ------------------
  |  |  258|    102|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  319|    102|		if (l > 45)
  ------------------
  |  Branch (319:7): [True: 0, False: 102]
  ------------------
  320|       |			/* Normally, maximum length is 45(character 'M'). */
  321|      0|			return (0);
  322|    102|		if (l > len - nl)
  ------------------
  |  Branch (322:7): [True: 1, False: 101]
  ------------------
  323|      1|			return (0); /* Line too short. */
  324|    242|		while (l) {
  ------------------
  |  Branch (324:10): [True: 142, False: 100]
  ------------------
  325|    142|			if (!uuchar[*p++])
  ------------------
  |  Branch (325:8): [True: 1, False: 141]
  ------------------
  326|      1|				return (0);
  327|    141|			--len;
  328|    141|			--l;
  329|    141|		}
  330|    100|		if (len-nl == 1 &&
  ------------------
  |  Branch (330:7): [True: 9, False: 91]
  ------------------
  331|      9|		    (uuchar[*p] ||		 /* Check sum. */
  ------------------
  |  Branch (331:8): [True: 9, False: 0]
  ------------------
  332|      9|		     (*p >= 'a' && *p <= 'z'))) {/* Padding data(MINIX). */
  ------------------
  |  Branch (332:9): [True: 0, False: 0]
  |  Branch (332:22): [True: 0, False: 0]
  ------------------
  333|      9|			++p;
  334|      9|			--len;
  335|      9|		}
  336|    100|		p += nl;
  337|    100|		if (avail && uuchar[*p])
  ------------------
  |  Branch (337:7): [True: 100, False: 0]
  |  Branch (337:16): [True: 100, False: 0]
  ------------------
  338|    100|			return (firstline+30);
  339|    106|	} else if (l == 13) {
  ------------------
  |  Branch (339:13): [True: 106, False: 0]
  ------------------
  340|       |		/* "begin-base64 " */
  341|    601|		while (len-nl > 0) {
  ------------------
  |  Branch (341:10): [True: 495, False: 106]
  ------------------
  342|    495|			if (!base64[*p++])
  ------------------
  |  Branch (342:8): [True: 0, False: 495]
  ------------------
  343|      0|				return (0);
  344|    495|			--len;
  345|    495|		}
  346|    106|		p += nl;
  347|       |
  348|    106|		if (avail >= 5 && memcmp(p, "====\n", 5) == 0)
  ------------------
  |  Branch (348:7): [True: 66, False: 40]
  |  Branch (348:21): [True: 7, False: 59]
  ------------------
  349|      7|			return (firstline+40);
  350|     99|		if (avail >= 6 && memcmp(p, "====\r\n", 6) == 0)
  ------------------
  |  Branch (350:7): [True: 59, False: 40]
  |  Branch (350:21): [True: 0, False: 59]
  ------------------
  351|      0|			return (firstline+40);
  352|     99|		if (avail > 0 && base64[*p])
  ------------------
  |  Branch (352:7): [True: 99, False: 0]
  |  Branch (352:20): [True: 98, False: 1]
  ------------------
  353|     98|			return (firstline+30);
  354|     99|	}
  355|       |
  356|      1|	return (0);
  357|    208|}
archive_read_support_filter_uu.c:bid_get_line:
  213|  1.11M|{
  214|  1.11M|	ssize_t len;
  215|  1.11M|	int quit;
  216|       |	
  217|  1.11M|	quit = 0;
  218|  1.11M|	if (*avail == 0) {
  ------------------
  |  Branch (218:6): [True: 194, False: 1.11M]
  ------------------
  219|    194|		*nl = 0;
  220|    194|		len = 0;
  221|    194|	} else
  222|  1.11M|		len = get_line(*b, *avail, nl);
  223|       |
  224|       |	/*
  225|       |	 * Read more bytes while it does not reach the end of line.
  226|       |	 */
  227|  1.11M|	while (*nl == 0 && len == *avail && !quit &&
  ------------------
  |  Branch (227:9): [True: 18.6k, False: 1.09M]
  |  Branch (227:21): [True: 697, False: 17.9k]
  |  Branch (227:38): [True: 691, False: 6]
  ------------------
  228|    691|	    *nbytes_read < UUENCODE_BID_MAX_READ) {
  ------------------
  |  |   44|    691|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (228:6): [True: 670, False: 21]
  ------------------
  229|    670|		ssize_t diff = *ravail - *avail;
  230|    670|		size_t nbytes_req = (*ravail+1023) & ~1023U;
  231|    670|		ssize_t tested;
  232|       |
  233|       |		/* Increase reading bytes if it is not enough for at least
  234|       |		 * two new lines. */
  235|    670|		if (nbytes_req < (size_t)*ravail + 160)
  ------------------
  |  Branch (235:7): [True: 111, False: 559]
  ------------------
  236|    111|			nbytes_req <<= 1;
  237|       |
  238|    670|		*b = __archive_read_filter_ahead(f, nbytes_req, avail);
  239|    670|		if (*b == NULL) {
  ------------------
  |  Branch (239:7): [True: 572, False: 98]
  ------------------
  240|    572|			if (*ravail >= *avail)
  ------------------
  |  Branch (240:8): [True: 549, False: 23]
  ------------------
  241|    549|				return (0);
  242|       |			/* Reading bytes reaches the end of a stream. */
  243|     23|			*b = __archive_read_filter_ahead(f, *avail, avail);
  244|     23|			quit = 1;
  245|     23|		}
  246|    121|		*nbytes_read = *avail;
  247|    121|		*ravail = *avail;
  248|    121|		*b += diff;
  249|    121|		*avail -= diff;
  250|    121|		tested = len;/* Skip some bytes we already determined. */
  251|    121|		len = get_line(*b + tested, *avail - tested, nl);
  252|    121|		if (len >= 0)
  ------------------
  |  Branch (252:7): [True: 110, False: 11]
  ------------------
  253|    110|			len += tested;
  254|    121|	}
  255|  1.11M|	return (len);
  256|  1.11M|}
archive_read_support_filter_uu.c:get_line:
  177|  1.64M|{
  178|  1.64M|	ssize_t len;
  179|       |
  180|  1.64M|	len = 0;
  181|  14.0M|	while (len < avail) {
  ------------------
  |  Branch (181:9): [True: 14.0M, False: 3.21k]
  ------------------
  182|  14.0M|		switch (ascii[*b]) {
  ------------------
  |  Branch (182:11): [True: 14.0M, False: 0]
  ------------------
  183|  18.0k|		case 0:	/* Non-ascii character or control character. */
  ------------------
  |  Branch (183:3): [True: 18.0k, False: 14.0M]
  ------------------
  184|  18.0k|			if (nlsize != NULL)
  ------------------
  |  Branch (184:8): [True: 18.0k, False: 0]
  ------------------
  185|  18.0k|				*nlsize = 0;
  186|  18.0k|			return (-1);
  187|  1.25M|		case '\r':
  ------------------
  |  Branch (187:3): [True: 1.25M, False: 12.8M]
  ------------------
  188|  1.25M|			if (avail-len > 1 && b[1] == '\n') {
  ------------------
  |  Branch (188:8): [True: 1.25M, False: 279]
  |  Branch (188:25): [True: 1.98k, False: 1.25M]
  ------------------
  189|  1.98k|				if (nlsize != NULL)
  ------------------
  |  Branch (189:9): [True: 1.98k, False: 0]
  ------------------
  190|  1.98k|					*nlsize = 2;
  191|  1.98k|				return (len+2);
  192|  1.98k|			}
  193|       |			/* FALL THROUGH */
  194|  1.62M|		case '\n':
  ------------------
  |  Branch (194:3): [True: 371k, False: 13.7M]
  ------------------
  195|  1.62M|			if (nlsize != NULL)
  ------------------
  |  Branch (195:8): [True: 1.62M, False: 0]
  ------------------
  196|  1.62M|				*nlsize = 1;
  197|  1.62M|			return (len+1);
  198|  12.4M|		case 1:
  ------------------
  |  Branch (198:3): [True: 12.4M, False: 1.64M]
  ------------------
  199|  12.4M|			b++;
  200|  12.4M|			len++;
  201|  12.4M|			break;
  202|  14.0M|		}
  203|  14.0M|	}
  204|  3.21k|	if (nlsize != NULL)
  ------------------
  |  Branch (204:6): [True: 3.21k, False: 0]
  ------------------
  205|  3.21k|		*nlsize = 0;
  206|  3.21k|	return (avail);
  207|  1.64M|}
archive_read_support_filter_uu.c:uudecode_bidder_init:
  368|    205|{
  369|    205|	struct uu   *uu;
  370|    205|	void *out_buff;
  371|    205|	void *in_buff;
  372|       |
  373|    205|	f->code = ARCHIVE_FILTER_UU;
  ------------------
  |  |  316|    205|#define	ARCHIVE_FILTER_UU	7
  ------------------
  374|    205|	f->name = "uu";
  375|       |
  376|    205|	uu = calloc(1, sizeof(*uu));
  377|    205|	out_buff = malloc(OUT_BUFF_SIZE);
  ------------------
  |  |   53|    205|#define OUT_BUFF_SIZE	(64 * 1024)
  ------------------
  378|    205|	in_buff = malloc(IN_BUFF_SIZE);
  ------------------
  |  |   49|    205|#define IN_BUFF_SIZE	(1024)
  ------------------
  379|    205|	if (uu == NULL || out_buff == NULL || in_buff == NULL) {
  ------------------
  |  Branch (379:6): [True: 0, False: 205]
  |  Branch (379:20): [True: 0, False: 205]
  |  Branch (379:40): [True: 0, False: 205]
  ------------------
  380|      0|		archive_set_error(&f->archive->archive, ENOMEM,
  381|      0|		    "Can't allocate data for uudecode");
  382|      0|		free(uu);
  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|    205|	f->data = uu;
  389|    205|	uu->in_buff = in_buff;
  390|    205|	uu->in_cnt = 0;
  391|    205|	uu->in_allocated = IN_BUFF_SIZE;
  ------------------
  |  |   49|    205|#define IN_BUFF_SIZE	(1024)
  ------------------
  392|    205|	uu->out_buff = out_buff;
  393|    205|	uu->state = ST_FIND_HEAD;
  ------------------
  |  |   55|    205|#define ST_FIND_HEAD	0
  ------------------
  394|    205|	uu->mode_set = 0;
  395|    205|	uu->name = NULL;
  396|    205|	f->vtable = &uudecode_reader_vtable;
  397|       |
  398|    205|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    205|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  399|    205|}
archive_read_support_filter_uu.c:uudecode_filter_read:
  456|  2.04k|{
  457|  2.04k|	struct uu *uu = f->data;
  458|  2.04k|	const unsigned char *b, *d;
  459|  2.04k|	unsigned char *out;
  460|  2.04k|	ssize_t avail_in, ravail;
  461|  2.04k|	ssize_t used;
  462|  2.04k|	ssize_t total;
  463|  2.04k|	ssize_t len, llen, nl, namelen;
  464|       |
  465|  3.09k|read_more:
  466|  3.09k|	d = __archive_read_filter_ahead(f->upstream, 1, &avail_in);
  467|  3.09k|	if (d == NULL && avail_in < 0)
  ------------------
  |  Branch (467:6): [True: 105, False: 2.99k]
  |  Branch (467:19): [True: 34, False: 71]
  ------------------
  468|     34|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     34|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  469|       |	/* Quiet a code analyzer; make sure avail_in must be zero
  470|       |	 * when d is NULL. */
  471|  3.06k|	if (d == NULL)
  ------------------
  |  Branch (471:6): [True: 71, False: 2.99k]
  ------------------
  472|     71|		avail_in = 0;
  473|  3.06k|	used = 0;
  474|  3.06k|	total = 0;
  475|  3.06k|	out = uu->out_buff;
  476|  3.06k|	if (avail_in > 2 * UUENCODE_BID_MAX_READ)
  ------------------
  |  |   44|  3.06k|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (476:6): [True: 8, False: 3.05k]
  ------------------
  477|      8|		avail_in = 2 * UUENCODE_BID_MAX_READ;
  ------------------
  |  |   44|      8|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  478|  3.06k|	ravail = avail_in;
  479|  3.06k|	if (uu->state == ST_IGNORE) {
  ------------------
  |  |   59|  3.06k|#define ST_IGNORE	4
  ------------------
  |  Branch (479:6): [True: 5, False: 3.05k]
  ------------------
  480|      5|		used = avail_in;
  481|      5|		goto finish;
  482|      5|	}
  483|  3.05k|	if (uu->in_cnt) {
  ------------------
  |  Branch (483:6): [True: 2.51k, False: 545]
  ------------------
  484|  2.51k|		if (uu->in_cnt > UUENCODE_BID_MAX_READ) {
  ------------------
  |  |   44|  2.51k|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (484:7): [True: 0, False: 2.51k]
  ------------------
  485|      0|			archive_set_error(&f->archive->archive,
  486|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  487|      0|			    "Invalid format data");
  488|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  489|      0|		}
  490|       |		/*
  491|       |		 * If there is remaining data which is saved by
  492|       |		 * a previous call, use it first.
  493|       |		 */
  494|  2.51k|		if (ensure_in_buff_size(f, uu,
  ------------------
  |  Branch (494:7): [True: 0, False: 2.51k]
  ------------------
  495|  2.51k|		    avail_in + uu->in_cnt) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.51k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  496|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  497|  2.51k|		if (avail_in > 0)
  ------------------
  |  Branch (497:7): [True: 2.46k, False: 47]
  ------------------
  498|  2.46k|			memcpy(uu->in_buff + uu->in_cnt,
  499|  2.46k|			    d, avail_in);
  500|  2.51k|		d = uu->in_buff;
  501|  2.51k|		avail_in += uu->in_cnt;
  502|  2.51k|		uu->in_cnt = 0;
  503|  2.51k|	}
  504|   536k|	for (;used < avail_in; d += llen, used += llen) {
  ------------------
  |  Branch (504:8): [True: 536k, False: 361]
  ------------------
  505|   536k|		ssize_t l, body;
  506|       |
  507|   536k|		b = d;
  508|   536k|		len = get_line(b, avail_in - used, &nl);
  509|   536k|		if (len < 0) {
  ------------------
  |  Branch (509:7): [True: 40, False: 535k]
  ------------------
  510|       |			/* Non-ascii character is found. */
  511|     40|			if (uu->state == ST_FIND_HEAD &&
  ------------------
  |  |   55|     80|#define ST_FIND_HEAD	0
  ------------------
  |  Branch (511:8): [True: 18, False: 22]
  ------------------
  512|     18|			    (uu->total > 0 || total > 0)) {
  ------------------
  |  Branch (512:9): [True: 10, False: 8]
  |  Branch (512:26): [True: 5, False: 3]
  ------------------
  513|     15|				uu->state = ST_IGNORE;
  ------------------
  |  |   59|     15|#define ST_IGNORE	4
  ------------------
  514|     15|				used = avail_in;
  515|     15|				goto finish;
  516|     15|			}
  517|     25|			archive_set_error(&f->archive->archive,
  518|     25|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     25|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  519|     25|			    "Insufficient compressed data");
  520|     25|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     25|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  521|     40|		}
  522|   535k|		if (len > UUENCODE_BID_MAX_READ) {
  ------------------
  |  |   44|   535k|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (522:7): [True: 1, False: 535k]
  ------------------
  523|      1|			archive_set_error(&f->archive->archive,
  524|      1|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  525|      1|			    "Invalid format data");
  526|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  527|      1|		}
  528|   535k|		llen = len;
  529|   535k|		if ((nl == 0) && (uu->state != ST_UUEND)) {
  ------------------
  |  |   57|  2.70k|#define ST_UUEND	2
  ------------------
  |  Branch (529:7): [True: 2.70k, False: 533k]
  |  Branch (529:20): [True: 2.58k, False: 123]
  ------------------
  530|  2.58k|			if (total == 0 && ravail <= 0) {
  ------------------
  |  Branch (530:8): [True: 1.09k, False: 1.48k]
  |  Branch (530:22): [True: 47, False: 1.05k]
  ------------------
  531|       |				/* There is nothing more to read, fail */
  532|     47|				archive_set_error(&f->archive->archive,
  533|     47|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     47|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  534|     47|				    "Missing format data");
  535|     47|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     47|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  536|     47|			}
  537|       |			/*
  538|       |			 * Save remaining data which does not contain
  539|       |			 * NL('\n','\r').
  540|       |			 */
  541|  2.53k|			if (ensure_in_buff_size(f, uu, len)
  ------------------
  |  Branch (541:8): [True: 0, False: 2.53k]
  ------------------
  542|  2.53k|			    != ARCHIVE_OK)
  ------------------
  |  |  233|  2.53k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  543|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  544|  2.53k|			if (uu->in_buff != b)
  ------------------
  |  Branch (544:8): [True: 1.75k, False: 787]
  ------------------
  545|  1.75k|				memmove(uu->in_buff, b, len);
  546|  2.53k|			uu->in_cnt = len;
  547|  2.53k|			if (total == 0) {
  ------------------
  |  Branch (547:8): [True: 1.05k, False: 1.48k]
  ------------------
  548|       |				/* Do not return 0; it means end-of-file.
  549|       |				 * We should try to read more bytes. */
  550|  1.05k|				__archive_read_filter_consume(
  551|  1.05k|				    f->upstream, ravail);
  552|  1.05k|				goto read_more;
  553|  1.05k|			}
  554|  1.48k|			used += len;
  555|  1.48k|			break;
  556|  2.53k|		}
  557|   533k|		switch (uu->state) {
  558|      0|		default:
  ------------------
  |  Branch (558:3): [True: 0, False: 533k]
  ------------------
  559|  39.0k|		case ST_FIND_HEAD:
  ------------------
  |  |   55|  39.0k|#define ST_FIND_HEAD	0
  ------------------
  |  Branch (559:3): [True: 39.0k, False: 494k]
  ------------------
  560|       |			/* Do not read more than UUENCODE_BID_MAX_READ bytes */
  561|  39.0k|			if (total + len >= UUENCODE_BID_MAX_READ) {
  ------------------
  |  |   44|  39.0k|#define UUENCODE_BID_MAX_READ 128*1024 /* in bytes */
  ------------------
  |  Branch (561:8): [True: 0, False: 39.0k]
  ------------------
  562|      0|				archive_set_error(&f->archive->archive,
  563|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  564|      0|				    "Invalid format data");
  565|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  566|      0|			}
  567|  39.0k|			if (len - nl >= 11 && memcmp(b, "begin ", 6) == 0)
  ------------------
  |  Branch (567:8): [True: 6.40k, False: 32.6k]
  |  Branch (567:26): [True: 3.23k, False: 3.17k]
  ------------------
  568|  3.23k|				l = 6;
  569|  35.7k|			else if (len - nl >= 18 &&
  ------------------
  |  Branch (569:13): [True: 1.28k, False: 34.4k]
  ------------------
  570|  1.28k|			    memcmp(b, "begin-base64 ", 13) == 0)
  ------------------
  |  Branch (570:8): [True: 656, False: 632]
  ------------------
  571|    656|				l = 13;
  572|  35.1k|			else
  573|  35.1k|				l = 0;
  574|  39.0k|			if (l != 0 && b[l] >= '0' && b[l] <= '7' &&
  ------------------
  |  Branch (574:8): [True: 3.89k, False: 35.1k]
  |  Branch (574:18): [True: 3.81k, False: 79]
  |  Branch (574:33): [True: 3.16k, False: 649]
  ------------------
  575|  3.16k|			    b[l+1] >= '0' && b[l+1] <= '7' &&
  ------------------
  |  Branch (575:8): [True: 2.90k, False: 258]
  |  Branch (575:25): [True: 2.09k, False: 810]
  ------------------
  576|  2.09k|			    b[l+2] >= '0' && b[l+2] <= '7' && b[l+3] == ' ') {
  ------------------
  |  Branch (576:8): [True: 1.99k, False: 100]
  |  Branch (576:25): [True: 1.30k, False: 694]
  |  Branch (576:42): [True: 711, False: 589]
  ------------------
  577|    711|				if (l == 6)
  ------------------
  |  Branch (577:9): [True: 170, False: 541]
  ------------------
  578|    170|					uu->state = ST_READ_UU;
  ------------------
  |  |   56|    170|#define ST_READ_UU	1
  ------------------
  579|    541|				else
  580|    541|					uu->state = ST_READ_BASE64;
  ------------------
  |  |   58|    541|#define ST_READ_BASE64	3
  ------------------
  581|    711|				uu->mode = (mode_t)(
  582|    711|				    ((int)(b[l] - '0') * 64) +
  583|    711|				    ((int)(b[l+1] - '0') * 8) +
  584|    711|				     (int)(b[l+2] - '0'));
  585|    711|				uu->mode_set = 1;
  586|    711|				namelen = len - nl - 4 - l;
  587|    711|				if (namelen > 1) {
  ------------------
  |  Branch (587:9): [True: 376, False: 335]
  ------------------
  588|    376|					if (uu->name != NULL)
  ------------------
  |  Branch (588:10): [True: 308, False: 68]
  ------------------
  589|    308|						free(uu->name);
  590|    376|					uu->name = malloc(namelen + 1);
  591|    376|					if (uu->name == NULL) {
  ------------------
  |  Branch (591:10): [True: 0, False: 376]
  ------------------
  592|      0|						archive_set_error(
  593|      0|						    &f->archive->archive,
  594|      0|						    ENOMEM,
  595|      0|						    "Can't allocate data for uudecode");
  596|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  597|      0|					}
  598|    376|					strncpy(uu->name,
  599|    376|					    (const char *)(b + l + 4),
  600|    376|					    namelen);
  601|    376|					uu->name[namelen] = '\0';
  602|    376|				}
  603|    711|			}
  604|  39.0k|			break;
  605|  39.0k|		case ST_READ_UU:
  ------------------
  |  |   56|    418|#define ST_READ_UU	1
  ------------------
  |  Branch (605:3): [True: 418, False: 532k]
  ------------------
  606|    418|			if (total + len * 2 > OUT_BUFF_SIZE)
  ------------------
  |  |   53|    418|#define OUT_BUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (606:8): [True: 3, False: 415]
  ------------------
  607|      3|				goto finish;
  608|    415|			body = len - nl;
  609|    415|			if (!uuchar[*b] || body <= 0) {
  ------------------
  |  Branch (609:8): [True: 2, False: 413]
  |  Branch (609:23): [True: 0, False: 413]
  ------------------
  610|      2|				archive_set_error(&f->archive->archive,
  611|      2|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  612|      2|				    "Insufficient compressed data");
  613|      2|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  614|      2|			}
  615|       |			/* Get length of undecoded bytes of current line. */
  616|    413|			l = UUDECODE(*b++);
  ------------------
  |  |  258|    413|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  617|    413|			body--;
  618|    413|			if (l > body) {
  ------------------
  |  Branch (618:8): [True: 1, False: 412]
  ------------------
  619|      1|				archive_set_error(&f->archive->archive,
  620|      1|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  621|      1|				    "Insufficient compressed data");
  622|      1|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  623|      1|			}
  624|    412|			if (l == 0) {
  ------------------
  |  Branch (624:8): [True: 126, False: 286]
  ------------------
  625|    126|				uu->state = ST_UUEND;
  ------------------
  |  |   57|    126|#define ST_UUEND	2
  ------------------
  626|    126|				break;
  627|    126|			}
  628|    708|			while (l > 0) {
  ------------------
  |  Branch (628:11): [True: 427, False: 281]
  ------------------
  629|    427|				int n = 0;
  630|       |
  631|    427|				if (!uuchar[b[0]] || !uuchar[b[1]])
  ------------------
  |  Branch (631:9): [True: 1, False: 426]
  |  Branch (631:26): [True: 1, False: 425]
  ------------------
  632|      2|					break;
  633|    425|				n = UUDECODE(*b++) << 18;
  ------------------
  |  |  258|    425|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  634|    425|				n |= UUDECODE(*b++) << 12;
  ------------------
  |  |  258|    425|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  635|    425|				*out++ = n >> 16; total++;
  636|    425|				--l;
  637|       |
  638|    425|				if (l > 0) {
  ------------------
  |  Branch (638:9): [True: 251, False: 174]
  ------------------
  639|    251|					if (!uuchar[b[0]])
  ------------------
  |  Branch (639:10): [True: 2, False: 249]
  ------------------
  640|      2|						break;
  641|    249|					n |= UUDECODE(*b++) << 6;
  ------------------
  |  |  258|    249|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  642|    249|					*out++ = (n >> 8) & 0xFF; total++;
  643|    249|					--l;
  644|    249|				}
  645|    423|				if (l > 0) {
  ------------------
  |  Branch (645:9): [True: 145, False: 278]
  ------------------
  646|    145|					if (!uuchar[b[0]])
  ------------------
  |  Branch (646:10): [True: 1, False: 144]
  ------------------
  647|      1|						break;
  648|    144|					n |= UUDECODE(*b++);
  ------------------
  |  |  258|    144|#define UUDECODE(c) (((c) - 0x20) & 0x3f)
  ------------------
  649|    144|					*out++ = n & 0xFF; total++;
  650|    144|					--l;
  651|    144|				}
  652|    423|			}
  653|    286|			if (l) {
  ------------------
  |  Branch (653:8): [True: 5, False: 281]
  ------------------
  654|      5|				archive_set_error(&f->archive->archive,
  655|      5|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      5|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  656|      5|				    "Insufficient compressed data");
  657|      5|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  658|      5|			}
  659|    281|			break;
  660|    281|		case ST_UUEND:
  ------------------
  |  |   57|    124|#define ST_UUEND	2
  ------------------
  |  Branch (660:3): [True: 124, False: 533k]
  ------------------
  661|    124|			if (len - nl == 3 && memcmp(b, "end ", 3) == 0)
  ------------------
  |  Branch (661:8): [True: 80, False: 44]
  |  Branch (661:25): [True: 78, False: 2]
  ------------------
  662|     78|				uu->state = ST_FIND_HEAD;
  ------------------
  |  |   55|     78|#define ST_FIND_HEAD	0
  ------------------
  663|     46|			else {
  664|     46|				archive_set_error(&f->archive->archive,
  665|     46|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     46|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  666|     46|				    "Insufficient compressed data");
  667|     46|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     46|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  668|     46|			}
  669|     78|			break;
  670|   493k|		case ST_READ_BASE64:
  ------------------
  |  |   58|   493k|#define ST_READ_BASE64	3
  ------------------
  |  Branch (670:3): [True: 493k, False: 39.5k]
  ------------------
  671|   493k|			if (total + len * 2 > OUT_BUFF_SIZE)
  ------------------
  |  |   53|   493k|#define OUT_BUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (671:8): [True: 3, False: 493k]
  ------------------
  672|      3|				goto finish;
  673|   493k|			l = len - nl;
  674|   493k|			if (l >= 3 && b[0] == '=' && b[1] == '=' &&
  ------------------
  |  Branch (674:8): [True: 370k, False: 122k]
  |  Branch (674:18): [True: 333k, False: 37.4k]
  |  Branch (674:33): [True: 96.8k, False: 236k]
  ------------------
  675|  96.8k|			    b[2] == '=') {
  ------------------
  |  Branch (675:8): [True: 464, False: 96.4k]
  ------------------
  676|    464|				uu->state = ST_FIND_HEAD;
  ------------------
  |  |   55|    464|#define ST_FIND_HEAD	0
  ------------------
  677|    464|				break;
  678|    464|			}
  679|   536k|			while (l > 0) {
  ------------------
  |  Branch (679:11): [True: 515k, False: 20.9k]
  ------------------
  680|   515k|				int n = 0;
  681|       |
  682|   515k|				if (!base64[b[0]] || !base64[b[1]])
  ------------------
  |  Branch (682:9): [True: 2, False: 515k]
  |  Branch (682:26): [True: 137k, False: 377k]
  ------------------
  683|   137k|					break;
  684|   377k|				n = base64num[*b++] << 18;
  685|   377k|				n |= base64num[*b++] << 12;
  686|   377k|				*out++ = n >> 16; total++;
  687|   377k|				l -= 2;
  688|       |
  689|   377k|				if (l > 0) {
  ------------------
  |  Branch (689:9): [True: 361k, False: 15.7k]
  ------------------
  690|   361k|					if (*b == '=')
  ------------------
  |  Branch (690:10): [True: 183k, False: 177k]
  ------------------
  691|   183k|						break;
  692|   177k|					if (!base64[*b])
  ------------------
  |  Branch (692:10): [True: 1, False: 177k]
  ------------------
  693|      1|						break;
  694|   177k|					n |= base64num[*b++] << 6;
  695|   177k|					*out++ = (n >> 8) & 0xFF; total++;
  696|   177k|					--l;
  697|   177k|				}
  698|   193k|				if (l > 0) {
  ------------------
  |  Branch (698:9): [True: 177k, False: 16.1k]
  ------------------
  699|   177k|					if (*b == '=')
  ------------------
  |  Branch (699:10): [True: 150k, False: 26.6k]
  ------------------
  700|   150k|						break;
  701|  26.6k|					if (!base64[*b])
  ------------------
  |  Branch (701:10): [True: 4, False: 26.6k]
  ------------------
  702|      4|						break;
  703|  26.6k|					n |= base64num[*b++];
  704|  26.6k|					*out++ = n & 0xFF; total++;
  705|  26.6k|					--l;
  706|  26.6k|				}
  707|   193k|			}
  708|   493k|			if (l && *b != '=') {
  ------------------
  |  Branch (708:8): [True: 472k, False: 20.9k]
  |  Branch (708:13): [True: 10, False: 472k]
  ------------------
  709|     10|				archive_set_error(&f->archive->archive,
  710|     10|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     10|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  711|     10|				    "Insufficient compressed data");
  712|     10|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     10|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  713|     10|			}
  714|   493k|			break;
  715|   533k|		}
  716|   533k|	}
  717|  1.87k|finish:
  718|  1.87k|	if (ravail < avail_in)
  ------------------
  |  Branch (718:6): [True: 1.66k, False: 214]
  ------------------
  719|  1.66k|		used -= avail_in - ravail;
  720|  1.87k|	__archive_read_filter_consume(f->upstream, used);
  721|       |
  722|  1.87k|	*buff = uu->out_buff;
  723|  1.87k|	uu->total += total;
  724|  1.87k|	return (total);
  725|  3.05k|}
archive_read_support_filter_uu.c:ensure_in_buff_size:
  404|  5.05k|{
  405|       |
  406|  5.05k|	if (size > uu->in_allocated) {
  ------------------
  |  Branch (406:6): [True: 42, False: 5.00k]
  ------------------
  407|     42|		unsigned char *ptr;
  408|     42|		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|     42|		newsize = uu->in_allocated;
  415|  1.15k|		do {
  416|  1.15k|			if (newsize < IN_BUFF_SIZE*32)
  ------------------
  |  |   49|  1.15k|#define IN_BUFF_SIZE	(1024)
  ------------------
  |  Branch (416:8): [True: 153, False: 1.00k]
  ------------------
  417|    153|				newsize <<= 1;
  418|  1.00k|			else
  419|  1.00k|				newsize += IN_BUFF_SIZE;
  ------------------
  |  |   49|  1.00k|#define IN_BUFF_SIZE	(1024)
  ------------------
  420|  1.15k|		} while (size > newsize);
  ------------------
  |  Branch (420:12): [True: 1.11k, False: 42]
  ------------------
  421|       |		/* Allocate the new buffer. */
  422|     42|		ptr = malloc(newsize);
  423|     42|		if (ptr == NULL) {
  ------------------
  |  Branch (423:7): [True: 0, False: 42]
  ------------------
  424|      0|			archive_set_error(&f->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|     42|		if (uu->in_cnt)
  ------------------
  |  Branch (430:7): [True: 18, False: 24]
  ------------------
  431|     18|			memcpy(ptr, uu->in_buff, uu->in_cnt);
  432|       |		/* Replace in_buff with the new buffer. */
  433|     42|		free(uu->in_buff);
  434|     42|		uu->in_buff = ptr;
  435|     42|		uu->in_allocated = newsize;
  436|     42|	}
  437|  5.05k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  5.05k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  438|  5.05k|}
archive_read_support_filter_uu.c:uudecode_filter_close:
  729|    205|{
  730|    205|	struct uu *uu = f->data;
  731|       |
  732|    205|	free(uu->in_buff);
  733|    205|	free(uu->out_buff);
  734|    205|	free(uu->name);
  735|    205|	free(uu);
  736|       |
  737|    205|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    205|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  738|    205|}
archive_read_support_filter_uu.c:uudecode_read_header:
  442|     39|{
  443|     39|	struct uu *uu = f->data;
  444|       |
  445|     39|	if (uu->mode_set != 0)
  ------------------
  |  Branch (445:6): [True: 39, False: 0]
  ------------------
  446|     39|		archive_entry_set_mode(entry, S_IFREG | uu->mode);
  447|       |
  448|     39|	if (uu->name != NULL)
  ------------------
  |  Branch (448:6): [True: 10, False: 29]
  ------------------
  449|     10|		archive_entry_set_pathname(entry, uu->name);
  450|       |
  451|     39|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     39|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  452|     39|}

archive_read_support_filter_xz:
  115|  16.7k|{
  116|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
  117|       |
  118|  16.7k|	if (__archive_read_register_bidder(a, NULL,
  ------------------
  |  Branch (118:6): [True: 0, False: 16.7k]
  ------------------
  119|  16.7k|				&xz_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  16.7k|#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|  16.7k|#if HAVE_LZMA_H && HAVE_LIBLZMA
  123|  16.7k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  16.7k|#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|  16.7k|}
archive_read_support_filter_lzma:
  147|  16.7k|{
  148|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
  149|       |
  150|  16.7k|	if (__archive_read_register_bidder(a, NULL,
  ------------------
  |  Branch (150:6): [True: 0, False: 16.7k]
  ------------------
  151|  16.7k|				&lzma_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  16.7k|#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|  16.7k|#if HAVE_LZMA_H && HAVE_LIBLZMA
  155|  16.7k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  16.7k|#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|  16.7k|}
archive_read_support_filter_lzip:
  180|  16.7k|{
  181|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
  182|       |
  183|  16.7k|	if (__archive_read_register_bidder(a, NULL,
  ------------------
  |  Branch (183:6): [True: 0, False: 16.7k]
  ------------------
  184|  16.7k|				&lzip_bidder_vtable) != ARCHIVE_OK)
  ------------------
  |  |  233|  16.7k|#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|  16.7k|#if HAVE_LZMA_H && HAVE_LIBLZMA
  188|  16.7k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  16.7k|#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|  16.7k|}
archive_read_support_filter_xz.c:xz_bidder_bid:
  202|  19.0k|{
  203|  19.0k|	const unsigned char *buffer;
  204|       |
  205|  19.0k|	(void)b; /* UNUSED */
  206|       |
  207|  19.0k|	buffer = __archive_read_filter_ahead(f, 6, NULL);
  208|  19.0k|	if (buffer == NULL)
  ------------------
  |  Branch (208:6): [True: 324, False: 18.7k]
  ------------------
  209|    324|		return (0);
  210|       |
  211|       |	/*
  212|       |	 * Verify Header Magic Bytes : FD 37 7A 58 5A 00
  213|       |	 */
  214|  18.7k|	if (memcmp(buffer, "\xFD\x37\x7A\x58\x5A\x00", 6) != 0)
  ------------------
  |  Branch (214:6): [True: 18.7k, False: 1]
  ------------------
  215|  18.7k|		return (0);
  216|       |
  217|      1|	return (48);
  218|  18.7k|}
archive_read_support_filter_xz.c:xz_bidder_init:
  387|      1|{
  388|      1|	f->code = ARCHIVE_FILTER_XZ;
  ------------------
  |  |  315|      1|#define	ARCHIVE_FILTER_XZ	6
  ------------------
  389|      1|	f->name = "xz";
  390|      1|	return (xz_lzma_bidder_init(f));
  391|      1|}
archive_read_support_filter_xz.c:xz_lzma_bidder_init:
  468|     81|{
  469|     81|	static const size_t out_block_size = 64 * 1024;
  470|     81|	void *out_block;
  471|     81|	struct xz *xz;
  472|     81|	int ret;
  473|       |
  474|     81|	xz = calloc(1, sizeof(*xz));
  475|     81|	out_block = malloc(out_block_size);
  476|     81|	if (xz == NULL || out_block == NULL) {
  ------------------
  |  Branch (476:6): [True: 0, False: 81]
  |  Branch (476:20): [True: 0, False: 81]
  ------------------
  477|      0|		archive_set_error(&f->archive->archive, ENOMEM,
  478|      0|		    "Can't allocate data for xz decompression");
  479|      0|		free(out_block);
  480|      0|		free(xz);
  481|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  482|      0|	}
  483|       |
  484|     81|	f->data = xz;
  485|     81|	xz->out_block_size = out_block_size;
  486|     81|	xz->out_block = out_block;
  487|     81|	f->vtable = &xz_lzma_reader_vtable;
  488|       |
  489|     81|	xz->stream.avail_in = 0;
  490|       |
  491|     81|	xz->stream.next_out = xz->out_block;
  492|     81|	xz->stream.avail_out = xz->out_block_size;
  493|       |
  494|     81|	xz->crc32 = 0;
  495|     81|	if (f->code == ARCHIVE_FILTER_LZIP) {
  ------------------
  |  |  318|     81|#define	ARCHIVE_FILTER_LZIP	9
  ------------------
  |  Branch (495:6): [True: 57, False: 24]
  ------------------
  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|     57|		xz->in_stream = 0;
  502|     57|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     57|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  503|     57|	} else
  504|     24|		xz->in_stream = 1;
  505|       |
  506|       |	/* Initialize compression library. */
  507|     24|	if (f->code == ARCHIVE_FILTER_XZ)
  ------------------
  |  |  315|     24|#define	ARCHIVE_FILTER_XZ	6
  ------------------
  |  Branch (507:6): [True: 1, False: 23]
  ------------------
  508|      1|		ret = lzma_stream_decoder(&(xz->stream),
  509|      1|		    LZMA_MEMLIMIT,/* memlimit */
  ------------------
  |  |   69|      1|#define LZMA_MEMLIMIT	UINT64_MAX
  ------------------
  510|      1|		    LZMA_CONCATENATED);
  511|     23|	else
  512|     23|		ret = lzma_alone_decoder(&(xz->stream),
  513|     23|		    LZMA_MEMLIMIT);/* memlimit */
  ------------------
  |  |   69|     23|#define LZMA_MEMLIMIT	UINT64_MAX
  ------------------
  514|       |
  515|     24|	if (ret == LZMA_OK)
  ------------------
  |  Branch (515:6): [True: 24, False: 0]
  ------------------
  516|     24|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     24|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  517|       |
  518|       |	/* Library setup failed: Choose an error message and clean up. */
  519|      0|	set_error(f, ret);
  520|       |
  521|      0|	free(xz->out_block);
  522|      0|	free(xz);
  523|      0|	f->data = NULL;
  524|      0|	f->vtable = NULL;
  525|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  526|     24|}
archive_read_support_filter_xz.c:xz_filter_read:
  646|    925|{
  647|    925|	struct xz *xz = f->data;
  648|    925|	size_t decompressed;
  649|    925|	ssize_t avail_in;
  650|    925|	int64_t member_in;
  651|    925|	int ret;
  652|       |
  653|    925|	redo:
  654|       |	/* Empty our output buffer. */
  655|    925|	xz->stream.next_out = xz->out_block;
  656|    925|	xz->stream.avail_out = xz->out_block_size;
  657|    925|	member_in = xz->member_in;
  658|       |
  659|       |	/* Try to fill the output buffer. */
  660|  1.86k|	while (xz->stream.avail_out > 0 && !xz->eof) {
  ------------------
  |  Branch (660:9): [True: 1.12k, False: 743]
  |  Branch (660:37): [True: 980, False: 145]
  ------------------
  661|    980|		if (!xz->in_stream) {
  ------------------
  |  Branch (661:7): [True: 151, False: 829]
  ------------------
  662|       |			/*
  663|       |			 * Initialize liblzma for lzip
  664|       |			 */
  665|    151|			ret = lzip_init(f);
  666|    151|			if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|    151|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (666:8): [True: 0, False: 151]
  ------------------
  667|      0|				return (ret);
  668|    151|			xz->in_stream = 1;
  669|    151|		}
  670|    980|		xz->stream.next_in =
  671|    980|		    __archive_read_filter_ahead(f->upstream, 1, &avail_in);
  672|    980|		if (xz->stream.next_in == NULL && avail_in < 0) {
  ------------------
  |  Branch (672:7): [True: 72, False: 908]
  |  Branch (672:37): [True: 1, False: 71]
  ------------------
  673|      1|			archive_set_error(&f->archive->archive,
  674|      1|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  675|      1|			    "truncated input");
  676|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  677|      1|		}
  678|    979|		xz->stream.avail_in = avail_in;
  679|       |
  680|       |		/* Decompress as much as we can in one pass. */
  681|    979|		ret = lzma_code(&(xz->stream),
  682|    979|		    (xz->stream.avail_in == 0)? LZMA_FINISH: LZMA_RUN);
  ------------------
  |  Branch (682:7): [True: 71, False: 908]
  ------------------
  683|    979|		switch (ret) {
  684|    138|		case LZMA_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (684:3): [True: 138, False: 841]
  ------------------
  685|    138|			xz->eof = 1;
  686|       |			/* FALL THROUGH */
  687|    943|		case LZMA_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (687:3): [True: 805, False: 174]
  ------------------
  688|    943|			__archive_read_filter_consume(f->upstream,
  689|    943|			    avail_in - xz->stream.avail_in);
  690|    943|			xz->member_in +=
  691|    943|			    avail_in - xz->stream.avail_in;
  692|    943|			break;
  693|     36|		default:
  ------------------
  |  Branch (693:3): [True: 36, False: 943]
  ------------------
  694|     36|			set_error(f, ret);
  695|     36|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     36|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  696|    979|		}
  697|    979|	}
  698|       |
  699|    888|	decompressed = xz->stream.next_out - xz->out_block;
  700|    888|	xz->member_out += decompressed;
  701|    888|	if (decompressed == 0) {
  ------------------
  |  Branch (701:6): [True: 8, False: 880]
  ------------------
  702|      8|		if (member_in != xz->member_in &&
  ------------------
  |  Branch (702:7): [True: 1, False: 7]
  ------------------
  703|      1|		    f->code == ARCHIVE_FILTER_LZIP &&
  ------------------
  |  |  318|      9|#define	ARCHIVE_FILTER_LZIP	9
  ------------------
  |  Branch (703:7): [True: 0, False: 1]
  ------------------
  704|      0|		    xz->eof) {
  ------------------
  |  Branch (704:7): [True: 0, False: 0]
  ------------------
  705|      0|			ret = lzip_tail(f);
  706|      0|			if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (706:8): [True: 0, False: 0]
  ------------------
  707|      0|				return (ret);
  708|      0|			if (!xz->eof)
  ------------------
  |  Branch (708:8): [True: 0, False: 0]
  ------------------
  709|      0|				goto redo;
  710|      0|		}
  711|      8|		*p = NULL;
  712|    880|	} else {
  713|    880|		*p = xz->out_block;
  714|    880|		if (f->code == ARCHIVE_FILTER_LZIP) {
  ------------------
  |  |  318|    880|#define	ARCHIVE_FILTER_LZIP	9
  ------------------
  |  Branch (714:7): [True: 359, False: 521]
  ------------------
  715|    359|			xz->crc32 = lzma_crc32(xz->out_block,
  716|    359|			    decompressed, xz->crc32);
  717|    359|			if (xz->eof) {
  ------------------
  |  Branch (717:8): [True: 134, False: 225]
  ------------------
  718|    134|				ret = lzip_tail(f);
  719|    134|				if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|    134|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (719:9): [True: 36, False: 98]
  ------------------
  720|     36|					return (ret);
  721|    134|			}
  722|    359|		}
  723|    880|	}
  724|    852|	return (decompressed);
  725|    888|}
archive_read_support_filter_xz.c:lzip_init:
  530|    151|{
  531|    151|	struct xz *xz = f->data;
  532|    151|	const unsigned char *h;
  533|    151|	lzma_filter filters[2];
  534|    151|	unsigned char props[5];
  535|    151|	uint32_t dicsize;
  536|    151|	int log2dic, ret;
  537|       |
  538|    151|	h = __archive_read_filter_ahead(f->upstream, 6, NULL);
  539|    151|	if (h == NULL)
  ------------------
  |  Branch (539:6): [True: 0, False: 151]
  ------------------
  540|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  541|       |
  542|       |	/* Get a version number. */
  543|    151|	xz->lzip_ver = h[4];
  544|       |
  545|       |	/*
  546|       |	 * Setup lzma property.
  547|       |	 */
  548|    151|	props[0] = 0x5d;
  549|       |
  550|       |	/* Get dictionary size. */
  551|    151|	log2dic = h[5] & 0x1f;
  552|    151|	if (log2dic < 12 || log2dic > 29)
  ------------------
  |  Branch (552:6): [True: 0, False: 151]
  |  Branch (552:22): [True: 0, False: 151]
  ------------------
  553|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  554|    151|	dicsize = 1U << log2dic;
  555|    151|	if (log2dic > 12)
  ------------------
  |  Branch (555:6): [True: 148, False: 3]
  ------------------
  556|    148|		dicsize -= (dicsize / 16) * (h[5] >> 5);
  557|    151|	archive_le32enc(props+1, dicsize);
  558|       |
  559|       |	/* Consume lzip header. */
  560|    151|	__archive_read_filter_consume(f->upstream, 6);
  561|    151|	xz->member_in = 6;
  562|       |
  563|    151|	filters[0].id = LZMA_FILTER_LZMA1;
  564|    151|	filters[0].options = NULL;
  565|    151|	filters[1].id = LZMA_VLI_UNKNOWN;
  566|    151|	filters[1].options = NULL;
  567|       |
  568|    151|	ret = lzma_properties_decode(&filters[0], NULL, props, sizeof(props));
  569|    151|	if (ret != LZMA_OK) {
  ------------------
  |  Branch (569:6): [True: 0, False: 151]
  ------------------
  570|      0|		set_error(f, ret);
  571|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  572|      0|	}
  573|    151|	ret = lzma_raw_decoder(&(xz->stream), filters);
  574|    151|	free(filters[0].options);
  575|    151|	if (ret != LZMA_OK) {
  ------------------
  |  Branch (575:6): [True: 0, False: 151]
  ------------------
  576|      0|		set_error(f, ret);
  577|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  578|      0|	}
  579|    151|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    151|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  580|    151|}
archive_read_support_filter_xz.c:lzip_tail:
  584|    134|{
  585|    134|	struct xz *xz = f->data;
  586|    134|	const unsigned char *p;
  587|    134|	ssize_t avail_in;
  588|    134|	int tail;
  589|       |
  590|    134|	if (xz->lzip_ver == 0)
  ------------------
  |  Branch (590:6): [True: 46, False: 88]
  ------------------
  591|     46|		tail = 12;
  592|     88|	else
  593|     88|		tail = 20;
  594|    134|	p = __archive_read_filter_ahead(f->upstream, tail, &avail_in);
  595|    134|	if (p == NULL && avail_in < 0)
  ------------------
  |  Branch (595:6): [True: 7, False: 127]
  |  Branch (595:19): [True: 0, False: 7]
  ------------------
  596|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  597|    134|	if (p == NULL || avail_in < tail) {
  ------------------
  |  Branch (597:6): [True: 7, False: 127]
  |  Branch (597:19): [True: 0, False: 127]
  ------------------
  598|      7|		archive_set_error(&f->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      7|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  599|      7|		    "Lzip: Remaining data is less bytes");
  600|      7|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      7|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  601|      7|	}
  602|       |
  603|       |	/* Check the crc32 value of the uncompressed data of the current
  604|       |	 * member */
  605|    127|	if (xz->crc32 != archive_le32dec(p)) {
  ------------------
  |  Branch (605:6): [True: 126, False: 1]
  ------------------
  606|       |#ifndef DONT_FAIL_ON_CRC_ERROR
  607|       |		archive_set_error(&f->archive->archive, ARCHIVE_ERRNO_MISC,
  608|       |		    "Lzip: CRC32 error");
  609|       |		return (ARCHIVE_FAILED);
  610|       |#endif
  611|    126|	}
  612|       |
  613|       |	/* Check the uncompressed size of the current member */
  614|    127|	if ((uint64_t)xz->member_out != archive_le64dec(p + 4)) {
  ------------------
  |  Branch (614:6): [True: 18, False: 109]
  ------------------
  615|     18|		archive_set_error(&f->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     18|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  616|     18|		    "Lzip: Uncompressed size error");
  617|     18|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     18|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  618|     18|	}
  619|       |
  620|       |	/* Check the total size of the current member */
  621|    109|	if (xz->lzip_ver == 1 &&
  ------------------
  |  Branch (621:6): [True: 72, False: 37]
  ------------------
  622|     72|	    (uint64_t)xz->member_in + tail != archive_le64dec(p + 12)) {
  ------------------
  |  Branch (622:6): [True: 11, False: 61]
  ------------------
  623|     11|		archive_set_error(&f->archive->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     11|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  624|     11|		    "Lzip: Member size error");
  625|     11|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     11|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  626|     11|	}
  627|     98|	__archive_read_filter_consume(f->upstream, tail);
  628|       |
  629|       |	/* If current lzip data consists of multi member, try decompressing
  630|       |	 * a next member. */
  631|     98|	if (lzip_has_member(f->upstream) != 0) {
  ------------------
  |  Branch (631:6): [True: 94, False: 4]
  ------------------
  632|     94|		xz->in_stream = 0;
  633|     94|		xz->crc32 = 0;
  634|     94|		xz->member_out = 0;
  635|     94|		xz->member_in = 0;
  636|     94|		xz->eof = 0;
  637|     94|	}
  638|     98|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     98|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  639|    109|}
archive_read_support_filter_xz.c:lzip_has_member:
  340|  19.1k|{
  341|  19.1k|	const unsigned char *buffer;
  342|  19.1k|	int bits_checked;
  343|  19.1k|	int log2dic;
  344|       |
  345|  19.1k|	buffer = __archive_read_filter_ahead(f, 6, NULL);
  346|  19.1k|	if (buffer == NULL)
  ------------------
  |  Branch (346:6): [True: 325, False: 18.8k]
  ------------------
  347|    325|		return (0);
  348|       |
  349|       |	/*
  350|       |	 * Verify Header Magic Bytes : 4C 5A 49 50 (`LZIP')
  351|       |	 */
  352|  18.8k|	bits_checked = 0;
  353|  18.8k|	if (memcmp(buffer, "LZIP", 4) != 0)
  ------------------
  |  Branch (353:6): [True: 18.6k, False: 167]
  ------------------
  354|  18.6k|		return (0);
  355|    167|	bits_checked += 32;
  356|       |
  357|       |	/* A version number must be 0 or 1 */
  358|    167|	if (buffer[4] != 0 && buffer[4] != 1)
  ------------------
  |  Branch (358:6): [True: 107, False: 60]
  |  Branch (358:24): [True: 15, False: 92]
  ------------------
  359|     15|		return (0);
  360|    152|	bits_checked += 8;
  361|       |
  362|       |	/* Dictionary size. */
  363|    152|	log2dic = buffer[5] & 0x1f;
  364|    152|	if (log2dic < 12 || log2dic > 29)
  ------------------
  |  Branch (364:6): [True: 0, False: 152]
  |  Branch (364:22): [True: 1, False: 151]
  ------------------
  365|      1|		return (0);
  366|    151|	bits_checked += 8;
  367|       |
  368|    151|	return (bits_checked);
  369|    152|}
archive_read_support_filter_xz.c:xz_filter_close:
  732|     81|{
  733|     81|	struct xz *xz = f->data;
  734|       |
  735|     81|	lzma_end(&(xz->stream));
  736|     81|	free(xz->out_block);
  737|     81|	free(xz);
  738|     81|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     81|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  739|     81|}
archive_read_support_filter_xz.c:set_error:
  414|     36|{
  415|       |
  416|     36|	switch (ret) {
  417|      0|	case LZMA_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (417:2): [True: 0, False: 36]
  ------------------
  418|      0|	case LZMA_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (418:2): [True: 0, False: 36]
  ------------------
  419|      0|		break;
  420|      0|	case LZMA_MEM_ERROR:
  ------------------
  |  Branch (420:2): [True: 0, False: 36]
  ------------------
  421|      0|		archive_set_error(&f->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: 36]
  ------------------
  425|      0|		archive_set_error(&f->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: 36]
  ------------------
  429|      0|		archive_set_error(&f->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: 36]
  ------------------
  434|      0|		archive_set_error(&f->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|      6|	case LZMA_DATA_ERROR:
  ------------------
  |  Branch (438:2): [True: 6, False: 30]
  ------------------
  439|      6|		archive_set_error(&f->archive->archive,
  440|      6|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      6|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  441|      6|		    "Lzma library error: Corrupted input data");
  442|      6|		break;
  443|     30|	case LZMA_BUF_ERROR:
  ------------------
  |  Branch (443:2): [True: 30, False: 6]
  ------------------
  444|     30|		archive_set_error(&f->archive->archive,
  445|     30|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     30|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  446|     30|		    "Lzma library error:  No progress is possible");
  447|     30|		break;
  448|      0|	default:
  ------------------
  |  Branch (448:2): [True: 0, False: 36]
  ------------------
  449|       |		/* Return an error. */
  450|      0|		archive_set_error(&f->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|     36|	}
  455|     36|}
archive_read_support_filter_xz.c:lzma_bidder_bid:
  235|  19.0k|{
  236|  19.0k|	const unsigned char *buffer;
  237|  19.0k|	uint32_t dicsize;
  238|  19.0k|	uint64_t uncompressed_size;
  239|  19.0k|	int bits_checked;
  240|       |
  241|  19.0k|	(void)b; /* UNUSED */
  242|       |
  243|  19.0k|	buffer = __archive_read_filter_ahead(f, 14, NULL);
  244|  19.0k|	if (buffer == NULL)
  ------------------
  |  Branch (244:6): [True: 354, False: 18.7k]
  ------------------
  245|    354|		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|  18.7k|	bits_checked = 0;
  264|  18.7k|	if (buffer[0] > (4 * 5 + 4) * 9 + 8)
  ------------------
  |  Branch (264:6): [True: 324, False: 18.4k]
  ------------------
  265|    324|		return (0);
  266|       |	/* Most likely value in the first byte of LZMA stream. */
  267|  18.4k|	if (buffer[0] == 0x5d || buffer[0] == 0x5e)
  ------------------
  |  Branch (267:6): [True: 20, False: 18.3k]
  |  Branch (267:27): [True: 2, False: 18.3k]
  ------------------
  268|     22|		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|  18.4k|	uncompressed_size = archive_le64dec(buffer+5);
  275|  18.4k|	if (uncompressed_size == (uint64_t)ARCHIVE_LITERAL_LL(-1))
  ------------------
  |  |  207|  18.4k|# define	ARCHIVE_LITERAL_LL(x)	x##ll
  ------------------
  |  Branch (275:6): [True: 61, False: 18.3k]
  ------------------
  276|     61|		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|  18.4k|	dicsize = archive_le32dec(buffer+1);
  286|  18.4k|	switch (dicsize) {
  287|      0|	case 0x00001000:/* lzma of LZMA SDK option -d12. */
  ------------------
  |  Branch (287:2): [True: 0, False: 18.4k]
  ------------------
  288|      0|	case 0x00002000:/* lzma of LZMA SDK option -d13. */
  ------------------
  |  Branch (288:2): [True: 0, False: 18.4k]
  ------------------
  289|      0|	case 0x00004000:/* lzma of LZMA SDK option -d14. */
  ------------------
  |  Branch (289:2): [True: 0, False: 18.4k]
  ------------------
  290|      0|	case 0x00008000:/* lzma of LZMA SDK option -d15. */
  ------------------
  |  Branch (290:2): [True: 0, False: 18.4k]
  ------------------
  291|     12|	case 0x00010000:/* lzma of XZ Utils option -0 and -1.
  ------------------
  |  Branch (291:2): [True: 12, False: 18.3k]
  ------------------
  292|       |			 * lzma of LZMA SDK option -d16. */
  293|     13|	case 0x00020000:/* lzma of LZMA SDK option -d17. */
  ------------------
  |  Branch (293:2): [True: 1, False: 18.4k]
  ------------------
  294|     13|	case 0x00040000:/* lzma of LZMA SDK option -d18. */
  ------------------
  |  Branch (294:2): [True: 0, False: 18.4k]
  ------------------
  295|     13|	case 0x00080000:/* lzma of XZ Utils option -2.
  ------------------
  |  Branch (295:2): [True: 0, False: 18.4k]
  ------------------
  296|       |			 * lzma of LZMA SDK option -d19. */
  297|     13|	case 0x00100000:/* lzma of XZ Utils option -3.
  ------------------
  |  Branch (297:2): [True: 0, False: 18.4k]
  ------------------
  298|       |			 * lzma of LZMA SDK option -d20. */
  299|     13|	case 0x00200000:/* lzma of XZ Utils option -4.
  ------------------
  |  Branch (299:2): [True: 0, False: 18.4k]
  ------------------
  300|       |			 * lzma of LZMA SDK option -d21. */
  301|     13|	case 0x00400000:/* lzma of XZ Utils option -5.
  ------------------
  |  Branch (301:2): [True: 0, False: 18.4k]
  ------------------
  302|       |			 * lzma of LZMA SDK option -d22. */
  303|     23|	case 0x00800000:/* lzma of XZ Utils option -6.
  ------------------
  |  Branch (303:2): [True: 10, False: 18.3k]
  ------------------
  304|       |			 * lzma of LZMA SDK option -d23. */
  305|     23|	case 0x01000000:/* lzma of XZ Utils option -7.
  ------------------
  |  Branch (305:2): [True: 0, False: 18.4k]
  ------------------
  306|       |			 * lzma of LZMA SDK option -d24. */
  307|     23|	case 0x02000000:/* lzma of XZ Utils option -8.
  ------------------
  |  Branch (307:2): [True: 0, False: 18.4k]
  ------------------
  308|       |			 * lzma of LZMA SDK option -d25. */
  309|     23|	case 0x04000000:/* lzma of XZ Utils option -9.
  ------------------
  |  Branch (309:2): [True: 0, False: 18.4k]
  ------------------
  310|       |			 * lzma of LZMA SDK option -d26. */
  311|     23|	case 0x08000000:/* lzma of LZMA SDK option -d27. */
  ------------------
  |  Branch (311:2): [True: 0, False: 18.4k]
  ------------------
  312|     23|		bits_checked += 32;
  313|     23|		break;
  314|  18.3k|	default:
  ------------------
  |  Branch (314:2): [True: 18.3k, False: 23]
  ------------------
  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|  18.3k|		if (dicsize <= 0x03F00000 && dicsize >= 0x00300000 &&
  ------------------
  |  Branch (320:7): [True: 2.89k, False: 15.4k]
  |  Branch (320:32): [True: 1.03k, False: 1.85k]
  ------------------
  321|  1.03k|		    (dicsize & ((1 << 20)-1)) == 0 &&
  ------------------
  |  Branch (321:7): [True: 1, False: 1.03k]
  ------------------
  322|      1|		    bits_checked == 8 + 64) {
  ------------------
  |  Branch (322:7): [True: 0, False: 1]
  ------------------
  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|  18.3k|		return (0);
  330|  18.4k|	}
  331|       |
  332|       |	/* TODO: The above test is still very weak.  It would be
  333|       |	 * good to do better. */
  334|       |
  335|     23|	return (bits_checked);
  336|  18.4k|}
archive_read_support_filter_xz.c:lzma_bidder_init:
  395|     23|{
  396|     23|	f->code = ARCHIVE_FILTER_LZMA;
  ------------------
  |  |  314|     23|#define	ARCHIVE_FILTER_LZMA	5
  ------------------
  397|     23|	f->name = "lzma";
  398|     23|	return (xz_lzma_bidder_init(f));
  399|     23|}
archive_read_support_filter_xz.c:lzip_bidder_bid:
  374|  19.0k|{
  375|       |
  376|  19.0k|	(void)b; /* UNUSED */
  377|  19.0k|	return (lzip_has_member(f));
  378|  19.0k|}
archive_read_support_filter_xz.c:lzip_bidder_init:
  403|     57|{
  404|     57|	f->code = ARCHIVE_FILTER_LZIP;
  ------------------
  |  |  318|     57|#define	ARCHIVE_FILTER_LZIP	9
  ------------------
  405|     57|	f->name = "lzip";
  406|     57|	return (xz_lzma_bidder_init(f));
  407|     57|}

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

archive_read_support_format_7zip:
  469|  16.7k|{
  470|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
  471|  16.7k|	struct _7zip *zip;
  472|  16.7k|	int r;
  473|       |
  474|  16.7k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
  475|  16.7k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_7zip");
  476|       |
  477|  16.7k|	zip = calloc(1, sizeof(*zip));
  478|  16.7k|	if (zip == NULL) {
  ------------------
  |  Branch (478:6): [True: 0, False: 16.7k]
  ------------------
  479|      0|		archive_set_error(_a, ENOMEM, "Can't allocate 7zip data");
  480|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  481|      0|	}
  482|       |
  483|       |	/*
  484|       |	 * Until enough data has been read, we cannot tell about
  485|       |	 * any encrypted entries yet.
  486|       |	 */
  487|  16.7k|	zip->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|  16.7k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  488|       |
  489|  16.7k|	r = __archive_read_register_format(a,
  490|  16.7k|	    zip,
  491|  16.7k|	    "7zip",
  492|  16.7k|	    archive_read_format_7zip_bid,
  493|  16.7k|	    NULL,
  494|  16.7k|	    archive_read_format_7zip_read_header,
  495|  16.7k|	    archive_read_format_7zip_read_data,
  496|  16.7k|	    archive_read_format_7zip_read_data_skip,
  497|  16.7k|	    NULL,
  498|  16.7k|	    archive_read_format_7zip_cleanup,
  499|  16.7k|	    archive_read_support_format_7zip_capabilities,
  500|  16.7k|	    archive_read_format_7zip_has_encrypted_entries);
  501|       |
  502|  16.7k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (502:6): [True: 0, False: 16.7k]
  ------------------
  503|      0|		free(zip);
  504|  16.7k|	return (r);
  505|  16.7k|}
archive_read_support_format_7zip.c:archive_read_support_format_7zip_capabilities:
  509|  3.07k|{
  510|  3.07k|	(void)a; /* UNUSED */
  511|  3.07k|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA |
  ------------------
  |  |  398|  3.07k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
  512|  3.07k|			ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  399|  3.07k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
  513|  3.07k|}
archive_read_support_format_7zip.c:archive_read_format_7zip_has_encrypted_entries:
  517|  1.53k|{
  518|  1.53k|	if (a && a->format) {
  ------------------
  |  Branch (518:6): [True: 1.53k, False: 0]
  |  Branch (518:11): [True: 1.53k, False: 0]
  ------------------
  519|  1.53k|		struct _7zip *zip = a->format->data;
  520|  1.53k|		if (zip) {
  ------------------
  |  Branch (520:7): [True: 1.53k, False: 0]
  ------------------
  521|  1.53k|			return zip->has_encrypted_entries;
  522|  1.53k|		}
  523|  1.53k|	}
  524|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  525|  1.53k|}
archive_read_support_format_7zip.c:archive_read_format_7zip_bid:
  598|  16.4k|{
  599|  16.4k|	int64_t data_offset;
  600|       |
  601|       |	/* If someone has already bid more than 48, then avoid
  602|       |	   trashing the look-ahead buffers with a seek. */
  603|  16.4k|	if (best_bid > 48)
  ------------------
  |  Branch (603:6): [True: 3.86k, False: 12.5k]
  ------------------
  604|  3.86k|		return (-1);
  605|       |
  606|  12.5k|	if (get_data_offset(a, &data_offset, 0) < 0)
  ------------------
  |  Branch (606:6): [True: 11.0k, False: 1.53k]
  ------------------
  607|  11.0k|		return (0);
  608|       |
  609|  1.53k|	return (48);
  610|  12.5k|}
archive_read_support_format_7zip.c:get_data_offset:
  529|  14.0k|{
  530|  14.0k|	const unsigned char *h;
  531|  14.0k|	int64_t offset, sfx_offset;
  532|  14.0k|	int r, window;
  533|       |
  534|  14.0k|	if ((h = __archive_read_ahead(a, 6, NULL)) == NULL) {
  ------------------
  |  Branch (534:6): [True: 139, False: 13.9k]
  ------------------
  535|    139|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    139|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  536|    139|		    "Truncated 7-Zip file body");
  537|    139|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    139|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  538|    139|	}
  539|       |
  540|       |	/* If first six bytes are the 7-Zip signature,
  541|       |	 * return the offset right now. */
  542|  13.9k|	if (memcmp(h, _7ZIP_SIGNATURE, 6) == 0) {
  ------------------
  |  |   65|  13.9k|#define _7ZIP_SIGNATURE	"7z\xBC\xAF\x27\x1C"
  ------------------
  |  Branch (542:6): [True: 3.04k, False: 10.9k]
  ------------------
  543|  3.04k|		*data_offset = 0;
  544|  3.04k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.04k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  545|  3.04k|	}
  546|       |
  547|       |	/*
  548|       |	 * It may be a 7-Zip SFX archive file. If first two bytes are
  549|       |	 * 'M' and 'Z' (PE, Windows) or first four bytes are
  550|       |	 * "\x7F\x45LF" (ELF, Posix-like systems), seek the 7-Zip
  551|       |	 * signature. While get_pe_sfx_offset can be performed without
  552|       |	 * performing a seek, get_elf_sfx_offset requires one,
  553|       |	 * thus a performance difference between the two is expected. 
  554|       |	 */
  555|  10.9k|	if ((h[0] == 'M' && h[1] == 'Z'))
  ------------------
  |  Branch (555:7): [True: 1.11k, False: 9.80k]
  |  Branch (555:22): [True: 602, False: 516]
  ------------------
  556|    602|		r = get_pe_sfx_offset(a, &sfx_offset);
  557|  10.3k|	else if (memcmp(h, "\x7F\x45LF", 4) == 0)
  ------------------
  |  Branch (557:11): [True: 224, False: 10.0k]
  ------------------
  558|    224|		r = get_elf_sfx_offset(a, &sfx_offset, compat);
  559|  10.0k|	else
  560|  10.0k|		r = ARCHIVE_FATAL;
  ------------------
  |  |  239|  10.0k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  561|  10.9k|	if (r < ARCHIVE_WARN || sfx_offset > SFX_MAX_SEEK)
  ------------------
  |  |  235|  21.8k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
              	if (r < ARCHIVE_WARN || sfx_offset > SFX_MAX_SEEK)
  ------------------
  |  |   69|    209|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (561:6): [True: 10.7k, False: 209]
  |  Branch (561:26): [True: 22, False: 187]
  ------------------
  562|  10.7k|		goto fail;
  563|       |
  564|    187|	offset = sfx_offset;
  565|    187|	window = 4096;
  566|    187|#define SFX_MAX_READAHEAD	(sfx_offset + SFX_MAX_OFFSET)
  567|    694|	while (offset + window <= SFX_MAX_READAHEAD) {
  ------------------
  |  |  566|    694|#define SFX_MAX_READAHEAD	(sfx_offset + SFX_MAX_OFFSET)
  |  |  ------------------
  |  |  |  |   68|    694|#define SFX_MAX_OFFSET	(SFX_MAX_ADDR - SFX_MIN_ADDR)
  |  |  |  |  ------------------
  |  |  |  |  |  |   67|    694|#define SFX_MAX_ADDR	0x60000
  |  |  |  |  ------------------
  |  |  |  |               #define SFX_MAX_OFFSET	(SFX_MAX_ADDR - SFX_MIN_ADDR)
  |  |  |  |  ------------------
  |  |  |  |  |  |   66|    694|#define SFX_MIN_ADDR	0x27000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (567:9): [True: 684, False: 10]
  ------------------
  568|    684|		ssize_t bytes_avail;
  569|       |
  570|    684|		h = __archive_read_ahead(a, offset + window, &bytes_avail);
  571|    684|		if (h == NULL) {
  ------------------
  |  Branch (571:7): [True: 213, False: 471]
  ------------------
  572|    213|			if (bytes_avail >= offset + 32) {
  ------------------
  |  Branch (572:8): [True: 71, False: 142]
  ------------------
  573|       |				/* Remaining bytes are less than window. */
  574|     71|				window = bytes_avail - offset;
  575|     71|				continue;
  576|     71|			}
  577|    142|			goto fail;
  578|    213|		}
  579|    471|		if (bytes_avail > SFX_MAX_READAHEAD)
  ------------------
  |  |  566|    471|#define SFX_MAX_READAHEAD	(sfx_offset + SFX_MAX_OFFSET)
  |  |  ------------------
  |  |  |  |   68|    471|#define SFX_MAX_OFFSET	(SFX_MAX_ADDR - SFX_MIN_ADDR)
  |  |  |  |  ------------------
  |  |  |  |  |  |   67|    471|#define SFX_MAX_ADDR	0x60000
  |  |  |  |  ------------------
  |  |  |  |               #define SFX_MAX_OFFSET	(SFX_MAX_ADDR - SFX_MIN_ADDR)
  |  |  |  |  ------------------
  |  |  |  |  |  |   66|    471|#define SFX_MIN_ADDR	0x27000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (579:7): [True: 6, False: 465]
  ------------------
  580|      6|			bytes_avail = SFX_MAX_READAHEAD;
  ------------------
  |  |  566|      6|#define SFX_MAX_READAHEAD	(sfx_offset + SFX_MAX_OFFSET)
  |  |  ------------------
  |  |  |  |   68|      6|#define SFX_MAX_OFFSET	(SFX_MAX_ADDR - SFX_MIN_ADDR)
  |  |  |  |  ------------------
  |  |  |  |  |  |   67|      6|#define SFX_MAX_ADDR	0x60000
  |  |  |  |  ------------------
  |  |  |  |               #define SFX_MAX_OFFSET	(SFX_MAX_ADDR - SFX_MIN_ADDR)
  |  |  |  |  ------------------
  |  |  |  |  |  |   66|      6|#define SFX_MIN_ADDR	0x27000
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  581|   562k|		while (offset <= bytes_avail - 32) {
  ------------------
  |  Branch (581:10): [True: 562k, False: 436]
  ------------------
  582|   562k|			size_t step = check_7zip_header_in_sfx(h + offset);
  583|   562k|			if (step == 0) {
  ------------------
  |  Branch (583:8): [True: 35, False: 562k]
  ------------------
  584|     35|				*data_offset = offset;
  585|     35|				return (ARCHIVE_OK);
  ------------------
  |  |  233|     35|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  586|     35|			}
  587|   562k|			offset += step;
  588|   562k|		}
  589|    471|	}
  590|  10.8k|fail:
  591|  10.8k|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  10.8k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  592|  10.8k|	    "Couldn't find out 7-Zip header");
  593|  10.8k|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|  10.8k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  594|    187|}
archive_read_support_format_7zip.c:get_pe_sfx_offset:
  639|    602|{
  640|    602|	const char *h;
  641|    602|	int64_t max_offset, offset;
  642|    602|	ssize_t bytes;
  643|    602|	uint16_t opt_hdr_sz, sec_cnt;
  644|       |
  645|       |	/*
  646|       |	 * If encounter any weirdness, revert to old brute-force style search
  647|       |	 */
  648|    602|	*sfx_offset = SFX_MIN_ADDR;
  ------------------
  |  |   66|    602|#define SFX_MIN_ADDR	0x27000
  ------------------
  649|       |
  650|    602|	for (;;) {
  651|       |		/*
  652|       |		 * Read Dos header to find e_lfanew
  653|       |		 */
  654|    602|		h = __archive_read_ahead(a, PE_DOS_HDR_LEN, &bytes);
  ------------------
  |  |   74|    602|#define PE_DOS_HDR_LEN			0x40
  ------------------
  655|    602|		if (h == NULL) {
  ------------------
  |  Branch (655:7): [True: 12, False: 590]
  ------------------
  656|     12|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  657|     12|		}
  658|    590|		if (h[0] != 'M' || h[1] != 'Z') {
  ------------------
  |  Branch (658:7): [True: 0, False: 590]
  |  Branch (658:22): [True: 0, False: 590]
  ------------------
  659|      0|			break;
  660|      0|		}
  661|    590|		offset = archive_le32dec(h + PE_DOS_HDR_ELFANEW_OFFSET);
  ------------------
  |  |   75|    590|#define PE_DOS_HDR_ELFANEW_OFFSET	0x3c
  ------------------
  662|    590|		if (offset > SFX_MAX_SEEK) {
  ------------------
  |  |   69|    590|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (662:7): [True: 334, False: 256]
  ------------------
  663|    334|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    334|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  664|    334|		}
  665|       |
  666|       |		/*
  667|       |		 * Read COFF header to find opt header size and sec cnt
  668|       |		 */
  669|    256|		if (bytes < offset + PE_COFF_HDR_LEN) {
  ------------------
  |  |   76|    256|#define PE_COFF_HDR_LEN			0x18
  ------------------
  |  Branch (669:7): [True: 70, False: 186]
  ------------------
  670|     70|			h = __archive_read_ahead(a, offset + PE_COFF_HDR_LEN,
  ------------------
  |  |   76|     70|#define PE_COFF_HDR_LEN			0x18
  ------------------
  671|     70|			    &bytes);
  672|     70|			if (h == NULL) {
  ------------------
  |  Branch (672:8): [True: 56, False: 14]
  ------------------
  673|     56|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     56|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  674|     56|			}
  675|     14|			if (h[offset] != 'P' || h[offset + 1] != 'E') {
  ------------------
  |  Branch (675:8): [True: 8, False: 6]
  |  Branch (675:28): [True: 1, False: 5]
  ------------------
  676|      9|				break;
  677|      9|			}
  678|     14|		}
  679|    191|		sec_cnt = archive_le16dec(
  680|    191|		    h + offset + PE_COFF_HDR_SEC_CNT_OFFSET);
  ------------------
  |  |   77|    191|#define PE_COFF_HDR_SEC_CNT_OFFSET	0x6
  ------------------
  681|    191|		opt_hdr_sz = archive_le16dec(
  682|    191|		    h + offset + PE_COFF_HDR_OPT_SZ_OFFSET);
  ------------------
  |  |   78|    191|#define PE_COFF_HDR_OPT_SZ_OFFSET	0x14
  ------------------
  683|       |
  684|       |		/*
  685|       |		 * Skip optional header
  686|       |		 */
  687|    191|		if (opt_hdr_sz != 0) {
  ------------------
  |  Branch (687:7): [True: 145, False: 46]
  ------------------
  688|    145|			offset += PE_COFF_HDR_LEN + opt_hdr_sz;
  ------------------
  |  |   76|    145|#define PE_COFF_HDR_LEN			0x18
  ------------------
  689|    145|		} else {
  690|     46|			break;
  691|     46|		}
  692|       |
  693|    145|		if (offset + sec_cnt * PE_SEC_HDR_LEN > SFX_MAX_SEEK) {
  ------------------
  |  |   79|    145|#define PE_SEC_HDR_LEN 			0x28
  ------------------
              		if (offset + sec_cnt * PE_SEC_HDR_LEN > SFX_MAX_SEEK) {
  ------------------
  |  |   69|    145|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (693:7): [True: 0, False: 145]
  ------------------
  694|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  695|      0|		}
  696|       |
  697|       |		/*
  698|       |		 * Traverse sec table to find max raw offset (i.e., overlay)
  699|       |		 */
  700|    145|		if (bytes < offset + sec_cnt * PE_SEC_HDR_LEN) {
  ------------------
  |  |   79|    145|#define PE_SEC_HDR_LEN 			0x28
  ------------------
  |  Branch (700:7): [True: 49, False: 96]
  ------------------
  701|     49|			h = __archive_read_ahead(a,
  702|     49|			    offset + sec_cnt * PE_SEC_HDR_LEN, NULL);
  ------------------
  |  |   79|     49|#define PE_SEC_HDR_LEN 			0x28
  ------------------
  703|     49|			if (h == NULL) {
  ------------------
  |  Branch (703:8): [True: 43, False: 6]
  ------------------
  704|     43|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     43|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  705|     43|			}
  706|     49|		}
  707|    102|		max_offset = offset;
  708|  51.8k|		while (sec_cnt > 0) {
  ------------------
  |  Branch (708:10): [True: 51.7k, False: 102]
  ------------------
  709|  51.7k|			int64_t sec_end;
  710|       |
  711|  51.7k|			sec_end = (int64_t)archive_le32dec(
  712|  51.7k|				      h + offset + PE_SEC_HDR_RAW_SZ_OFFSET) +
  ------------------
  |  |   81|  51.7k|#define PE_SEC_HDR_RAW_SZ_OFFSET	0x10
  ------------------
  713|  51.7k|			    archive_le32dec(
  714|  51.7k|				h + offset + PE_SEC_HDR_RAW_ADDR_OFFSET);
  ------------------
  |  |   80|  51.7k|#define PE_SEC_HDR_RAW_ADDR_OFFSET	0x14
  ------------------
  715|  51.7k|			if (sec_end > max_offset) {
  ------------------
  |  Branch (715:8): [True: 9.59k, False: 42.1k]
  ------------------
  716|  9.59k|				max_offset = sec_end;
  717|  9.59k|			}
  718|  51.7k|			offset += PE_SEC_HDR_LEN;
  ------------------
  |  |   79|  51.7k|#define PE_SEC_HDR_LEN 			0x28
  ------------------
  719|  51.7k|			sec_cnt--;
  720|  51.7k|		}
  721|    102|		*sfx_offset = max_offset;
  722|    102|		break;
  723|    145|	}
  724|       |
  725|    157|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    157|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  726|    602|}
archive_read_support_format_7zip.c:get_elf_sfx_offset:
  730|    224|{
  731|    224|	int64_t r;
  732|    224|	const char *h;
  733|    224|	char big_endian, format_64;
  734|    224|	size_t request;
  735|    224|	uint64_t e_shoff, strtab_offset, strtab_size;
  736|    224|	uint16_t e_shentsize, e_shnum, e_shstrndx;
  737|    224|	uint16_t (*dec16)(const void *);
  738|    224|	uint32_t (*dec32)(const void *);
  739|    224|	uint64_t (*dec64)(const void *);
  740|       |
  741|       |	/*
  742|       |	 * If encounter any weirdness, revert to old brute-force style search
  743|       |	 */
  744|    224|	*sfx_offset = SFX_MIN_ADDR;
  ------------------
  |  |   66|    224|#define SFX_MIN_ADDR	0x27000
  ------------------
  745|       |
  746|    224|	for (;;) {
  747|       |		/*
  748|       |		 * Read Elf header to find bitness & endianness
  749|       |		 */
  750|    224|		h = __archive_read_ahead(a, ELF_HDR_MIN_LEN, NULL);
  ------------------
  |  |   86|    224|#define ELF_HDR_MIN_LEN 0x40 /* sizeof(Elf64_Ehdr) */
  ------------------
  751|    224|		if (h == NULL) {
  ------------------
  |  Branch (751:7): [True: 0, False: 224]
  ------------------
  752|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  753|      0|		}
  754|    224|		if (memcmp(h, "\x7F\x45LF", 4) != 0) {
  ------------------
  |  Branch (754:7): [True: 0, False: 224]
  ------------------
  755|      0|			break;
  756|      0|		}
  757|    224|		format_64 = h[ELF_HDR_EI_CLASS_OFFSET] == 0x2;
  ------------------
  |  |   87|    224|#define ELF_HDR_EI_CLASS_OFFSET 0x04
  ------------------
  758|    224|		big_endian = h[ELF_HDR_EI_DATA_OFFSET] == 0x2;
  ------------------
  |  |   88|    224|#define ELF_HDR_EI_DATA_OFFSET 0x05
  ------------------
  759|    224|		if (big_endian) {
  ------------------
  |  Branch (759:7): [True: 113, False: 111]
  ------------------
  760|    113|			dec16 = &archive_be16dec;
  761|    113|			dec32 = &archive_be32dec;
  762|    113|			dec64 = &archive_be64dec;
  763|    113|		} else {
  764|    111|			dec16 = &archive_le16dec;
  765|    111|			dec32 = &archive_le32dec;
  766|    111|			dec64 = &archive_le64dec;
  767|    111|		}
  768|       |
  769|       |		/*
  770|       |		 * Read section header table info
  771|       |		 */
  772|    224|		if (format_64) {
  ------------------
  |  Branch (772:7): [True: 152, False: 72]
  ------------------
  773|    152|			e_shoff = (*dec64)(h + 0x28);
  774|    152|			e_shentsize = (*dec16)(h + 0x3A);
  775|    152|			e_shnum = (*dec16)(h + 0x3C);
  776|    152|			e_shstrndx = (*dec16)(h + 0x3E);
  777|    152|			if (e_shnum <= e_shstrndx || e_shentsize < 0x28)
  ------------------
  |  Branch (777:8): [True: 6, False: 146]
  |  Branch (777:33): [True: 4, False: 142]
  ------------------
  778|     10|				break;
  779|       |
  780|    152|		} else {
  781|     72|			e_shoff = (*dec32)(h + 0x20);
  782|     72|			e_shentsize = (*dec16)(h + 0x2E);
  783|     72|			e_shnum = (*dec16)(h + 0x30);
  784|     72|			e_shstrndx = (*dec16)(h + 0x32);
  785|     72|			if (e_shnum <= e_shstrndx || e_shentsize < 0x18)
  ------------------
  |  Branch (785:8): [True: 18, False: 54]
  |  Branch (785:33): [True: 4, False: 50]
  ------------------
  786|     22|				break;
  787|     72|		}
  788|       |
  789|    192|		if ((int64_t)e_shoff < 0) {
  ------------------
  |  Branch (789:7): [True: 32, False: 160]
  ------------------
  790|     32|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     32|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  791|     32|		}
  792|       |
  793|       |		/*
  794|       |		 * Reading the section table to find strtab section
  795|       |		 */
  796|    160|		if (seek_compat(a, e_shoff, SEEK_SET, compat) < 0) {
  ------------------
  |  Branch (796:7): [True: 22, False: 138]
  ------------------
  797|     22|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|     22|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  798|     22|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     22|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  799|     22|		}
  800|    138|		if (format_64) {
  ------------------
  |  Branch (800:7): [True: 104, False: 34]
  ------------------
  801|    104|			request = (size_t)e_shnum * e_shentsize + 0x28;
  802|    104|		} else {
  803|     34|			request = (size_t)e_shnum * e_shentsize + 0x18;
  804|     34|		}
  805|    138|		if (request > SFX_MAX_SEEK) {
  ------------------
  |  |   69|    138|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (805:7): [True: 8, False: 130]
  ------------------
  806|      8|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  807|      8|		}
  808|    130|		h = __archive_read_ahead(a, request, NULL);
  809|    130|		if (h == NULL) {
  ------------------
  |  Branch (809:7): [True: 6, False: 124]
  ------------------
  810|      6|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  811|      6|		}
  812|    124|		if (format_64) {
  ------------------
  |  Branch (812:7): [True: 98, False: 26]
  ------------------
  813|     98|			strtab_offset = (*dec64)(
  814|     98|			    h + e_shstrndx * e_shentsize + 0x18);
  815|     98|			strtab_size = (*dec64)(
  816|     98|			    h + e_shstrndx * e_shentsize + 0x20);
  817|     98|		} else {
  818|     26|			strtab_offset = (*dec32)(
  819|     26|			    h + e_shstrndx * e_shentsize + 0x10);
  820|     26|			strtab_size = (*dec32)(
  821|     26|			    h + e_shstrndx * e_shentsize + 0x14);
  822|     26|		}
  823|    124|		if ((int64_t)strtab_offset < 0 || strtab_size < 6 ||
  ------------------
  |  Branch (823:7): [True: 29, False: 95]
  |  Branch (823:37): [True: 1, False: 94]
  ------------------
  824|     94|		    strtab_size > SFX_MAX_SEEK)
  ------------------
  |  |   69|     94|#define SFX_MAX_SEEK	0x800000
  ------------------
  |  Branch (824:7): [True: 58, False: 36]
  ------------------
  825|     88|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     88|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  826|       |
  827|       |		/*
  828|       |		 * Read the STRTAB section to find the .data offset
  829|       |		 */
  830|     36|		if (seek_compat(a, strtab_offset, SEEK_SET, compat) < 0) {
  ------------------
  |  Branch (830:7): [True: 6, False: 30]
  ------------------
  831|      6|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      6|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  832|      6|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  833|      6|		}
  834|     30|		h = __archive_read_ahead(a, strtab_size, NULL);
  835|     30|		if (h == NULL) {
  ------------------
  |  Branch (835:7): [True: 2, False: 28]
  ------------------
  836|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  837|      2|		}
  838|     28|		size_t data_sym_offset = strtab_size;
  839|  16.3k|		for (size_t offset = 0; offset + 6 <= strtab_size; offset++) {
  ------------------
  |  Branch (839:27): [True: 16.3k, False: 5]
  ------------------
  840|  16.3k|			if (memcmp(h + offset, ".data\00", 6) == 0) {
  ------------------
  |  Branch (840:8): [True: 23, False: 16.3k]
  ------------------
  841|     23|				data_sym_offset = offset;
  842|     23|				break;
  843|     23|			}
  844|  16.3k|		}
  845|     28|		if (data_sym_offset == strtab_size) {
  ------------------
  |  Branch (845:7): [True: 5, False: 23]
  ------------------
  846|      5|			break;
  847|      5|		}
  848|       |
  849|       |		/*
  850|       |		 * Find the section with the .data name
  851|       |		 */
  852|     23|		if (seek_compat(a, e_shoff, SEEK_SET, compat) < 0) {
  ------------------
  |  Branch (852:7): [True: 0, False: 23]
  ------------------
  853|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  854|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  855|      0|		}
  856|     23|		h = __archive_read_ahead(a, (size_t)e_shnum * e_shentsize, NULL);
  857|     23|		if (h == NULL) {
  ------------------
  |  Branch (857:7): [True: 0, False: 23]
  ------------------
  858|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  859|      0|		}
  860|     23|		size_t sec_tbl_offset = 0;
  861|    682|		while (e_shnum > 0) {
  ------------------
  |  Branch (861:10): [True: 667, False: 15]
  ------------------
  862|    667|			uint32_t name_offset;
  863|       |
  864|    667|			name_offset = (*dec32)(h + sec_tbl_offset);
  865|    667|			if (name_offset == data_sym_offset) {
  ------------------
  |  Branch (865:8): [True: 8, False: 659]
  ------------------
  866|      8|				int64_t sel_offset;
  867|       |
  868|      8|				if (format_64) {
  ------------------
  |  Branch (868:9): [True: 5, False: 3]
  ------------------
  869|      5|					sel_offset = (*dec64)(
  870|      5|					    h + sec_tbl_offset + 0x18);
  871|      5|				} else {
  872|      3|					sel_offset = (*dec32)(
  873|      3|					    h + sec_tbl_offset + 0x10);
  874|      3|				}
  875|      8|				if (sel_offset >= 0)
  ------------------
  |  Branch (875:9): [True: 6, False: 2]
  ------------------
  876|      6|					*sfx_offset = sel_offset;
  877|      8|				break;
  878|      8|			}
  879|    659|			sec_tbl_offset += e_shentsize;
  880|    659|			e_shnum--;
  881|    659|		}
  882|     23|		break;
  883|     23|	}
  884|       |
  885|     60|	r = seek_compat(a, 0, SEEK_SET, compat);
  886|     60|	if (r < 0)
  ------------------
  |  Branch (886:6): [True: 8, False: 52]
  ------------------
  887|      8|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      8|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  888|     60|	return (int)r;
  889|    224|}
archive_read_support_format_7zip.c:seek_compat:
 4638|    674|{
 4639|    674|	int64_t ret = ARCHIVE_FAILED;
  ------------------
  |  |  237|    674|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 4640|       |
 4641|    674|	if (a->filter->can_seek)
  ------------------
  |  Branch (4641:6): [True: 659, False: 15]
  ------------------
 4642|    659|		ret = __archive_read_seek(a, offset, whence);
 4643|     15|	else if (compat) {
  ------------------
  |  Branch (4643:11): [True: 5, False: 10]
  ------------------
 4644|      5|		switch (whence) {
 4645|      0|		case SEEK_CUR:
  ------------------
  |  Branch (4645:3): [True: 0, False: 5]
  ------------------
 4646|      0|			ret = __archive_read_consume(a, offset);
 4647|      0|			break;
 4648|      5|		case SEEK_SET:
  ------------------
  |  Branch (4648:3): [True: 5, False: 0]
  ------------------
 4649|      5|			if (a->filter->position > offset)
  ------------------
  |  Branch (4649:8): [True: 1, False: 4]
  ------------------
 4650|      1|				break;
 4651|      4|			ret = __archive_read_consume(a,
 4652|      4|			    offset - a->filter->position);
 4653|      4|			break;
 4654|      0|		default:
  ------------------
  |  Branch (4654:3): [True: 0, False: 5]
  ------------------
 4655|      0|			break;
 4656|      5|		}
 4657|      5|	}
 4658|       |
 4659|    674|	return (ret);
 4660|    674|}
archive_read_support_format_7zip.c:check_7zip_header_in_sfx:
  614|   562k|{
  615|   562k|	switch (p[5]) {
  616|  7.80k|	case 0x1C:
  ------------------
  |  Branch (616:2): [True: 7.80k, False: 554k]
  ------------------
  617|  7.80k|		if (memcmp(p, _7ZIP_SIGNATURE, 6) != 0)
  ------------------
  |  |   65|  7.80k|#define _7ZIP_SIGNATURE	"7z\xBC\xAF\x27\x1C"
  ------------------
  |  Branch (617:7): [True: 3.05k, False: 4.75k]
  ------------------
  618|  3.05k|			return (6);
  619|       |		/*
  620|       |		 * Test the CRC because its extraction code has 7-Zip
  621|       |		 * Magic Code, so we should do this in order not to
  622|       |		 * make a mis-detection.
  623|       |		 */
  624|  4.75k|		if (__archive_crc32(0, p + 12, 20) != archive_le32dec(p + 8))
  ------------------
  |  Branch (624:7): [True: 4.71k, False: 35]
  ------------------
  625|  4.71k|			return (6);
  626|       |		/* Hit the header! */
  627|     35|		return (0);
  628|  8.36k|	case 0x37: return (5);
  ------------------
  |  Branch (628:2): [True: 8.36k, False: 553k]
  ------------------
  629|  2.84k|	case 0x7A: return (4);
  ------------------
  |  Branch (629:2): [True: 2.84k, False: 559k]
  ------------------
  630|    695|	case 0xBC: return (3);
  ------------------
  |  Branch (630:2): [True: 695, False: 561k]
  ------------------
  631|  3.31k|	case 0xAF: return (2);
  ------------------
  |  Branch (631:2): [True: 3.31k, False: 559k]
  ------------------
  632|  3.93k|	case 0x27: return (1);
  ------------------
  |  Branch (632:2): [True: 3.93k, False: 558k]
  ------------------
  633|   535k|	default: return (6);
  ------------------
  |  Branch (633:2): [True: 535k, False: 26.9k]
  ------------------
  634|   562k|	}
  635|   562k|}
archive_read_support_format_7zip.c:archive_read_format_7zip_read_header:
  894|  7.14k|{
  895|  7.14k|	struct _7zip *zip = a->format->data;
  896|  7.14k|	struct _7zip_entry *zip_entry;
  897|  7.14k|	int r, ret = ARCHIVE_OK;
  ------------------
  |  |  233|  7.14k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  898|  7.14k|	struct _7z_folder *folder = 0;
  899|       |
  900|       |	/*
  901|       |	 * It should be sufficient to call archive_read_next_header() for
  902|       |	 * a reader to determine if an entry is encrypted or not. If the
  903|       |	 * encryption of an entry is only detectable when calling
  904|       |	 * archive_read_data(), so be it. We'll do the same check there
  905|       |	 * as well.
  906|       |	 */
  907|  7.14k|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|  7.14k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (907:6): [True: 1.53k, False: 5.61k]
  ------------------
  908|  1.53k|		zip->has_encrypted_entries = 0;
  909|  1.53k|	}
  910|       |
  911|  7.14k|	a->archive.archive_format = ARCHIVE_FORMAT_7ZIP;
  ------------------
  |  |  385|  7.14k|#define	ARCHIVE_FORMAT_7ZIP			0xE0000
  ------------------
  912|  7.14k|	a->archive.archive_format_name = "7-Zip";
  913|       |
  914|  7.14k|	if (zip->entries == NULL) {
  ------------------
  |  Branch (914:6): [True: 1.53k, False: 5.61k]
  ------------------
  915|  1.53k|		struct _7z_header_info header;
  916|       |
  917|  1.53k|		memset(&header, 0, sizeof(header));
  918|  1.53k|		r = slurp_central_directory(a, zip, &header);
  919|  1.53k|		free_Header(&header);
  920|  1.53k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  1.53k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (920:7): [True: 1.34k, False: 195]
  ------------------
  921|  1.34k|			return (r);
  922|    195|		zip->entries_remaining = zip->numFiles;
  923|    195|		zip->entry = zip->entries;
  924|  5.61k|	} else {
  925|  5.61k|		++zip->entry;
  926|  5.61k|	}
  927|  5.80k|	zip_entry = zip->entry;
  928|       |
  929|  5.80k|	if (zip->entries_remaining == 0 || zip_entry == NULL)
  ------------------
  |  Branch (929:6): [True: 149, False: 5.65k]
  |  Branch (929:37): [True: 0, False: 5.65k]
  ------------------
  930|    149|		return ARCHIVE_EOF;
  ------------------
  |  |  232|    149|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  931|  5.65k|	--zip->entries_remaining;
  932|       |
  933|  5.65k|	zip->entry_offset = 0;
  934|  5.65k|	zip->end_of_entry = 0;
  935|  5.65k|	zip->entry_crc32 = 0;
  936|       |
  937|       |	/* Setup a string conversion for a filename. */
  938|  5.65k|	if (zip->sconv == NULL) {
  ------------------
  |  Branch (938:6): [True: 188, False: 5.46k]
  ------------------
  939|    188|		zip->sconv = archive_string_conversion_from_charset(
  940|    188|		    &a->archive, "UTF-16LE", 1);
  941|    188|		if (zip->sconv == NULL)
  ------------------
  |  Branch (941:7): [True: 0, False: 188]
  ------------------
  942|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  943|    188|	}
  944|       |
  945|       |	/* Figure out if the entry is encrypted by looking at the folder
  946|       |	   that is associated to the current 7zip entry. If the folder
  947|       |	   has a coder with a _7Z_CRYPTO codec then the folder is encrypted.
  948|       |	   Hence the entry must also be encrypted. */
  949|  5.65k|	if (zip_entry->folderIndex < zip->si.ci.numFolders) {
  ------------------
  |  Branch (949:6): [True: 144, False: 5.51k]
  ------------------
  950|    144|		size_t fidx = 0;
  951|       |
  952|    144|		folder = &(zip->si.ci.folders[zip_entry->folderIndex]);
  953|    402|		for (fidx = 0; fidx < folder->numCoders; fidx++) {
  ------------------
  |  Branch (953:18): [True: 258, False: 144]
  ------------------
  954|    258|			switch(folder->coders[fidx].codec) {
  ------------------
  |  Branch (954:11): [True: 0, False: 258]
  ------------------
  955|      0|				case _7Z_CRYPTO_MAIN_ZIP:
  ------------------
  |  |  100|      0|#define _7Z_CRYPTO_MAIN_ZIP		0x06F10101 /* Main Zip crypto algo */
  ------------------
  |  Branch (955:5): [True: 0, False: 258]
  ------------------
  956|      0|				case _7Z_CRYPTO_RAR_29:
  ------------------
  |  |  101|      0|#define _7Z_CRYPTO_RAR_29		0x06F10303 /* Rar29 AES-128 + (modified SHA-1) */
  ------------------
  |  Branch (956:5): [True: 0, False: 258]
  ------------------
  957|      0|				case _7Z_CRYPTO_AES_256_SHA_256: {
  ------------------
  |  |  102|      0|#define _7Z_CRYPTO_AES_256_SHA_256	0x06F10701 /* AES-256 + SHA-256 */
  ------------------
  |  Branch (957:5): [True: 0, False: 258]
  ------------------
  958|      0|					archive_entry_set_is_data_encrypted(entry, 1);
  959|      0|					zip->has_encrypted_entries = 1;
  960|      0|					break;
  961|      0|				}
  962|    258|			}
  963|    258|		}
  964|    144|	}
  965|       |
  966|  5.65k|	if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|  5.65k|#define archive_entry_copy_pathname_l	__archive_entry_copy_pathname_l
  ------------------
  |  Branch (966:6): [True: 797, False: 4.86k]
  ------------------
  967|  5.65k|	    (const char *)zip_entry->utf16name,
  968|  5.65k|	    zip_entry->name_len, zip->sconv) != 0) {
  969|    797|		if (errno == ENOMEM) {
  ------------------
  |  Branch (969:7): [True: 0, False: 797]
  ------------------
  970|      0|			archive_set_error(&a->archive, ENOMEM,
  971|      0|			    "Can't allocate memory for Pathname");
  972|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  973|      0|		}
  974|    797|		archive_set_error(&a->archive,
  975|    797|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    797|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  976|    797|		    "Pathname cannot be converted "
  977|    797|		    "from %s to current locale",
  978|    797|		    archive_string_conversion_charset_name(zip->sconv));
  979|    797|		ret = ARCHIVE_WARN;
  ------------------
  |  |  235|    797|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  980|    797|	}
  981|       |
  982|       |	/* Populate some additional entry fields: */
  983|  5.65k|	archive_entry_set_mode(entry, zip_entry->mode);
  984|  5.65k|	if (zip_entry->flg & MTIME_IS_SET)
  ------------------
  |  |  243|  5.65k|#define MTIME_IS_SET	(1<<0)
  ------------------
  |  Branch (984:6): [True: 219, False: 5.43k]
  ------------------
  985|    219|		archive_entry_set_mtime(entry, zip_entry->mtime,
  986|    219|			zip_entry->mtime_ns);
  987|  5.65k|	if (zip_entry->flg & CTIME_IS_SET)
  ------------------
  |  |  245|  5.65k|#define CTIME_IS_SET	(1<<2)
  ------------------
  |  Branch (987:6): [True: 76, False: 5.58k]
  ------------------
  988|     76|		archive_entry_set_ctime(entry, zip_entry->ctime,
  989|     76|		    zip_entry->ctime_ns);
  990|  5.65k|	if (zip_entry->flg & ATIME_IS_SET)
  ------------------
  |  |  244|  5.65k|#define ATIME_IS_SET	(1<<1)
  ------------------
  |  Branch (990:6): [True: 118, False: 5.53k]
  ------------------
  991|    118|		archive_entry_set_atime(entry, zip_entry->atime,
  992|    118|		    zip_entry->atime_ns);
  993|  5.65k|	if (zip_entry->ssIndex != (size_t)-1) {
  ------------------
  |  Branch (993:6): [True: 144, False: 5.51k]
  ------------------
  994|    144|		zip->entry_bytes_remaining =
  995|    144|		    zip->si.ss.unpackSizes[zip_entry->ssIndex];
  996|    144|		archive_entry_set_size(entry, zip->entry_bytes_remaining);
  997|  5.51k|	} else {
  998|  5.51k|		zip->entry_bytes_remaining = 0;
  999|  5.51k|		archive_entry_set_size(entry, 0);
 1000|  5.51k|	}
 1001|       |
 1002|       |	// These attributes are supported by the windows implementation of archive_write_disk.
 1003|  5.65k|	const int supported_attrs = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
  ------------------
  |  |  148|  5.65k|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
              	const int supported_attrs = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
  ------------------
  |  |  152|  5.65k|#define FILE_ATTRIBUTE_HIDDEN 0x00000002
  ------------------
              	const int supported_attrs = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
  ------------------
  |  |  156|  5.65k|#define FILE_ATTRIBUTE_SYSTEM 0x00000004
  ------------------
 1004|       |
 1005|  5.65k|	if (zip_entry->attr & supported_attrs) {
  ------------------
  |  Branch (1005:6): [True: 1.05k, False: 4.60k]
  ------------------
 1006|  1.05k|		char buf[sizeof(",rdonly,hidden,system")];
 1007|  1.05k|		const char *fflags[3] = { "", "", "" };
 1008|  1.05k|		const char **flag = fflags;
 1009|       |
 1010|  1.05k|		if (zip_entry->attr & FILE_ATTRIBUTE_READONLY)
  ------------------
  |  |  148|  1.05k|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (1010:7): [True: 673, False: 380]
  ------------------
 1011|    673|			*flag++ = ",rdonly";
 1012|  1.05k|		if (zip_entry->attr & FILE_ATTRIBUTE_HIDDEN)
  ------------------
  |  |  152|  1.05k|#define FILE_ATTRIBUTE_HIDDEN 0x00000002
  ------------------
  |  Branch (1012:7): [True: 716, False: 337]
  ------------------
 1013|    716|			*flag++ = ",hidden";
 1014|  1.05k|		if (zip_entry->attr & FILE_ATTRIBUTE_SYSTEM)
  ------------------
  |  |  156|  1.05k|#define FILE_ATTRIBUTE_SYSTEM 0x00000004
  ------------------
  |  Branch (1014:7): [True: 586, False: 467]
  ------------------
 1015|    586|			*flag++ = ",system";
 1016|       |
 1017|  1.05k|		snprintf(buf, sizeof(buf), "%s%s%s", fflags[0], fflags[1], fflags[2]);
 1018|  1.05k|		archive_entry_copy_fflags_text(entry, buf + 1);
 1019|  1.05k|	}
 1020|       |
 1021|       |	/* If there's no body, force read_data() to return EOF immediately. */
 1022|  5.65k|	if (zip->entry_bytes_remaining < 1)
  ------------------
  |  Branch (1022:6): [True: 5.51k, False: 141]
  ------------------
 1023|  5.51k|		zip->end_of_entry = 1;
 1024|       |
 1025|  5.65k|	if ((zip_entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  215|  5.65k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip_entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  217|  5.65k|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (1025:6): [True: 87, False: 5.57k]
  ------------------
 1026|     87|		unsigned char *symname = NULL;
 1027|     87|		size_t symsize = 0;
 1028|       |
 1029|     87|		if (zip->entry_bytes_remaining > 1024 * 1024) {
  ------------------
  |  Branch (1029:7): [True: 2, False: 85]
  ------------------
 1030|      2|			archive_set_error(&a->archive, ENOMEM,
 1031|      2|			    "Rejecting malformed 7zip archive: "
 1032|      2|			    "symlink contents exceed 1 megabyte");
 1033|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1034|      2|		}
 1035|       |
 1036|       |		/*
 1037|       |		 * Symbolic-name is recorded as its contents. We have to
 1038|       |		 * read the contents at this time.
 1039|       |		 */
 1040|     86|		while (zip->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (1040:10): [True: 1, False: 85]
  ------------------
 1041|      1|			const void *buff;
 1042|      1|			unsigned char *mem;
 1043|      1|			size_t size;
 1044|      1|			int64_t offset;
 1045|       |
 1046|      1|			r = archive_read_format_7zip_read_data(a, &buff,
 1047|      1|				&size, &offset);
 1048|      1|			if (r < ARCHIVE_WARN) {
  ------------------
  |  |  235|      1|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1048:8): [True: 0, False: 1]
  ------------------
 1049|      0|				free(symname);
 1050|      0|				return (r);
 1051|      0|			}
 1052|      1|			mem = realloc(symname, symsize + size + 1);
 1053|      1|			if (mem == NULL) {
  ------------------
  |  Branch (1053:8): [True: 0, False: 1]
  ------------------
 1054|      0|				free(symname);
 1055|      0|				archive_set_error(&a->archive, ENOMEM,
 1056|      0|				    "Can't allocate memory for Symname");
 1057|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1058|      0|			}
 1059|      1|			symname = mem;
 1060|      1|			memcpy(symname+symsize, buff, size);
 1061|      1|			symsize += size;
 1062|      1|		}
 1063|     85|		if (symsize == 0) {
  ------------------
  |  Branch (1063:7): [True: 84, False: 1]
  ------------------
 1064|       |			/* If there is no symname, handle it as a regular
 1065|       |			 * file. */
 1066|     84|			zip_entry->mode &= ~AE_IFMT;
  ------------------
  |  |  215|     84|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1067|     84|			zip_entry->mode |= AE_IFREG;
  ------------------
  |  |  216|     84|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1068|     84|			archive_entry_set_mode(entry, zip_entry->mode);
 1069|     84|		} else {
 1070|      1|			struct archive_string_conv* utf8_conv;
 1071|       |
 1072|      1|			symname[symsize] = '\0';
 1073|       |
 1074|       |			/* Symbolic links are embedded as UTF-8 strings */
 1075|      1|			utf8_conv = archive_string_conversion_from_charset(&a->archive,
 1076|      1|			    "UTF-8", 1);
 1077|      1|			if (utf8_conv == NULL) {
  ------------------
  |  Branch (1077:8): [True: 0, False: 1]
  ------------------
 1078|      0|				free(symname);
 1079|      0|				return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1080|      0|			}
 1081|       |
 1082|      1|			archive_entry_copy_symlink_l(entry, (const char*)symname, symsize,
  ------------------
  |  |   83|      1|#define archive_entry_copy_symlink_l	__archive_entry_copy_symlink_l
  ------------------
 1083|      1|			    utf8_conv);
 1084|      1|		}
 1085|     85|		free(symname);
 1086|     85|		archive_entry_set_size(entry, 0);
 1087|     85|	}
 1088|       |
 1089|  5.65k|	return (ret);
 1090|  5.65k|}
archive_read_support_format_7zip.c:slurp_central_directory:
 3287|  1.53k|{
 3288|  1.53k|	const unsigned char *p;
 3289|  1.53k|	int64_t next_header_offset;
 3290|  1.53k|	int64_t next_header_size;
 3291|  1.53k|	uint32_t next_header_crc;
 3292|  1.53k|	ssize_t bytes_avail;
 3293|  1.53k|	int64_t data_offset;
 3294|  1.53k|	int check_header_crc, r;
 3295|       |
 3296|  1.53k|	if (get_data_offset(a, &data_offset, 1) < 0)
  ------------------
  |  Branch (3296:6): [True: 2, False: 1.53k]
  ------------------
 3297|      2|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3298|  1.53k|	if (__archive_read_consume(a, data_offset) < 0) {
  ------------------
  |  Branch (3298:6): [True: 0, False: 1.53k]
  ------------------
 3299|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3300|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3301|      0|	}
 3302|  1.53k|	if ((p = __archive_read_ahead(a, 32, &bytes_avail)) == NULL) {
  ------------------
  |  Branch (3302:6): [True: 0, False: 1.53k]
  ------------------
 3303|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3304|      0|		    "Truncated 7-Zip file header");
 3305|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3306|      0|	}
 3307|       |
 3308|  1.53k|	if (archive_ckd_add_i64(&zip->seek_base, data_offset, 32)) {
  ------------------
  |  Branch (3308:6): [True: 0, False: 1.53k]
  ------------------
 3309|      0|		archive_set_error(&a->archive, -1, "Malformed 7-Zip archive");
 3310|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3311|      0|	}
 3312|       |
 3313|  1.53k|	if (memcmp(p, _7ZIP_SIGNATURE, 6) != 0) {
  ------------------
  |  |   65|  1.53k|#define _7ZIP_SIGNATURE	"7z\xBC\xAF\x27\x1C"
  ------------------
  |  Branch (3313:6): [True: 0, False: 1.53k]
  ------------------
 3314|      0|		archive_set_error(&a->archive, -1, "Not 7-Zip archive file");
 3315|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3316|      0|	}
 3317|       |
 3318|       |	/* CRC check. */
 3319|  1.53k|	if (__archive_crc32(0, p + 12, 20)
  ------------------
  |  Branch (3319:6): [True: 1.47k, False: 60]
  ------------------
 3320|  1.53k|	    != archive_le32dec(p + 8)) {
 3321|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 3322|       |		archive_set_error(&a->archive, -1, "Header CRC error");
 3323|       |		return (ARCHIVE_FATAL);
 3324|       |#endif
 3325|  1.47k|	}
 3326|       |
 3327|  1.53k|	next_header_offset = archive_le64dec(p + 12);
 3328|  1.53k|	if (next_header_offset < 0) {
  ------------------
  |  Branch (3328:6): [True: 1, False: 1.53k]
  ------------------
 3329|      1|		archive_set_error(&a->archive, -1, "Malformed 7-Zip archive");
 3330|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3331|      1|	}
 3332|  1.53k|	next_header_size = archive_le64dec(p + 20);
 3333|  1.53k|	if (next_header_size < 0) {
  ------------------
  |  Branch (3333:6): [True: 7, False: 1.52k]
  ------------------
 3334|      7|		archive_set_error(&a->archive, -1, "Malformed 7-Zip archive");
 3335|      7|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3336|      7|	}
 3337|  1.52k|	next_header_crc = archive_le32dec(p + 28);
 3338|       |
 3339|  1.52k|	if (next_header_size == 0)
  ------------------
  |  Branch (3339:6): [True: 1, False: 1.52k]
  ------------------
 3340|       |		/* There is no entry in the archive file. */
 3341|      1|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3342|       |
 3343|  1.52k|	__archive_read_consume(a, 32);
 3344|  1.52k|	if (next_header_offset != 0) {
  ------------------
  |  Branch (3344:6): [True: 1.21k, False: 309]
  ------------------
 3345|  1.21k|		if (bytes_avail >= next_header_offset)
  ------------------
  |  Branch (3345:7): [True: 1.19k, False: 19]
  ------------------
 3346|  1.19k|			__archive_read_consume(a, next_header_offset);
 3347|     19|		else {
 3348|     19|			int64_t target;
 3349|       |
 3350|     19|			if (archive_ckd_add_i64(&target,
  ------------------
  |  Branch (3350:8): [True: 0, False: 19]
  ------------------
 3351|     19|			    zip->seek_base, next_header_offset) ||
 3352|     19|			    seek_compat(a, target, SEEK_SET, 1) < 0) {
  ------------------
  |  Branch (3352:8): [True: 19, False: 0]
  ------------------
 3353|     19|				archive_set_error(&a->archive,
 3354|     19|				    ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|     19|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3355|     19|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     19|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3356|     19|			}
 3357|     19|		}
 3358|  1.21k|	}
 3359|  1.50k|	zip->stream_offset = next_header_offset;
 3360|  1.50k|	zip->header_offset = next_header_offset;
 3361|  1.50k|	zip->header_bytes_remaining = next_header_size;
 3362|  1.50k|	zip->header_crc32 = 0;
 3363|  1.50k|	zip->header_is_encoded = 0;
 3364|  1.50k|	zip->header_is_being_read = 1;
 3365|  1.50k|	zip->has_encrypted_entries = 0;
 3366|  1.50k|	check_header_crc = 1;
 3367|       |
 3368|  1.50k|	if ((p = header_bytes(a, 1)) == NULL) {
  ------------------
  |  Branch (3368:6): [True: 1, False: 1.50k]
  ------------------
 3369|      1|		archive_set_error(&a->archive,
 3370|      1|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3371|      1|		    "Truncated 7-Zip file body");
 3372|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3373|      1|	}
 3374|       |	/* Parse ArchiveProperties. */
 3375|  1.50k|	switch (p[0]) {
 3376|    376|	case kEncodedHeader:
  ------------------
  |  |  142|    376|#define kEncodedHeader		0x17
  ------------------
  |  Branch (3376:2): [True: 376, False: 1.13k]
  ------------------
 3377|       |		/*
 3378|       |		 * The archive has an encoded header and we have to decode it
 3379|       |		 * in order to parse the header correctly.
 3380|       |		 */
 3381|    376|		r = decode_encoded_header_info(a, &(zip->si));
 3382|       |
 3383|       |		/* Check the EncodedHeader CRC.*/
 3384|    376|		if (r == 0 && zip->header_crc32 != next_header_crc) {
  ------------------
  |  Branch (3384:7): [True: 316, False: 60]
  |  Branch (3384:17): [True: 275, False: 41]
  ------------------
 3385|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 3386|       |			archive_set_error(&a->archive, -1,
 3387|       |			    "Damaged 7-Zip archive");
 3388|       |			r = -1;
 3389|       |#endif
 3390|    275|		}
 3391|    376|		if (r == 0) {
  ------------------
  |  Branch (3391:7): [True: 316, False: 60]
  ------------------
 3392|    316|			if (zip->si.ci.folders[0].digest_defined)
  ------------------
  |  Branch (3392:8): [True: 96, False: 220]
  ------------------
 3393|     96|				next_header_crc = zip->si.ci.folders[0].digest;
 3394|    220|			else
 3395|    220|				check_header_crc = 0;
 3396|    316|			if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (3396:8): [True: 316, False: 0]
  ------------------
 3397|    316|				read_consume(a);
 3398|    316|			r = setup_decode_folder(a, zip->si.ci.folders, 1);
 3399|    316|			if (r == 0) {
  ------------------
  |  Branch (3399:8): [True: 280, False: 36]
  ------------------
 3400|    280|				zip->header_bytes_remaining =
 3401|    280|					zip->folder_outbytes_remaining;
 3402|    280|				r = seek_pack(a);
 3403|    280|			}
 3404|    316|		}
 3405|       |		/* Clean up StreamsInfo. */
 3406|    376|		free_StreamsInfo(&(zip->si));
 3407|    376|		memset(&(zip->si), 0, sizeof(zip->si));
 3408|    376|		if (r < 0)
  ------------------
  |  Branch (3408:7): [True: 99, False: 277]
  ------------------
 3409|     99|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     99|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3410|    277|		zip->header_is_encoded = 1;
 3411|    277|		zip->header_crc32 = 0;
 3412|       |		/* FALL THROUGH */
 3413|  1.39k|	case kHeader:
  ------------------
  |  |  121|  1.39k|#define kHeader			0x01
  ------------------
  |  Branch (3413:2): [True: 1.11k, False: 390]
  ------------------
 3414|       |		/*
 3415|       |		 * Parse the header.
 3416|       |		 */
 3417|  1.39k|		errno = 0;
 3418|  1.39k|		r = read_Header(a, header, zip->header_is_encoded);
 3419|  1.39k|		if (r < 0) {
  ------------------
  |  Branch (3419:7): [True: 1.17k, False: 222]
  ------------------
 3420|  1.17k|			if (errno == ENOMEM)
  ------------------
  |  Branch (3420:8): [True: 8, False: 1.16k]
  ------------------
 3421|      8|				archive_set_error(&a->archive, -1,
 3422|      8|				    "Couldn't allocate memory");
 3423|  1.16k|			else
 3424|  1.16k|				archive_set_error(&a->archive, -1,
 3425|  1.16k|				    "Damaged 7-Zip archive");
 3426|  1.17k|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|  1.17k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3427|  1.17k|		}
 3428|       |
 3429|       |		/*
 3430|       |		 *  Must be kEnd.
 3431|       |		 */
 3432|    222|		if ((p = header_bytes(a, 1)) == NULL ||*p != kEnd) {
  ------------------
  |  |  120|    214|#define kEnd			0x00
  ------------------
  |  Branch (3432:7): [True: 8, False: 214]
  |  Branch (3432:42): [True: 19, False: 195]
  ------------------
 3433|     27|			archive_set_error(&a->archive, -1,
 3434|     27|			    "Malformed 7-Zip archive");
 3435|     27|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     27|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3436|     27|		}
 3437|       |
 3438|       |		/* Check the Header CRC.*/
 3439|    195|		if (check_header_crc && zip->header_crc32 != next_header_crc) {
  ------------------
  |  Branch (3439:7): [True: 191, False: 4]
  |  Branch (3439:27): [True: 148, False: 43]
  ------------------
 3440|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 3441|       |			archive_set_error(&a->archive, -1,
 3442|       |			    "Malformed 7-Zip archive");
 3443|       |			return (ARCHIVE_FATAL);
 3444|       |#endif
 3445|    148|		}
 3446|    195|		break;
 3447|     14|	default:
  ------------------
  |  Branch (3447:2): [True: 14, False: 1.49k]
  ------------------
 3448|     14|		archive_set_error(&a->archive, -1,
 3449|     14|		    "Unexpected Property ID = %X", p[0]);
 3450|     14|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     14|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3451|  1.50k|	}
 3452|       |
 3453|       |	/* Clean up variables be used for decoding the archive header */
 3454|    195|	zip->pack_stream_remaining = 0;
 3455|    195|	zip->pack_stream_index = 0;
 3456|    195|	zip->folder_outbytes_remaining = 0;
 3457|    195|	zip->uncompressed_buffer_bytes_remaining = 0;
 3458|    195|	zip->pack_stream_bytes_unconsumed = 0;
 3459|    195|	zip->header_is_being_read = 0;
 3460|       |
 3461|    195|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    195|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3462|  1.50k|}
archive_read_support_format_7zip.c:header_bytes:
 3253|   423k|{
 3254|   423k|	struct _7zip *zip = a->format->data;
 3255|   423k|	const unsigned char *p;
 3256|       |
 3257|   423k|	if ((uint64_t)zip->header_bytes_remaining < rbytes)
  ------------------
  |  Branch (3257:6): [True: 39, False: 423k]
  ------------------
 3258|     39|		return (NULL);
 3259|   423k|	if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (3259:6): [True: 417k, False: 6.82k]
  ------------------
 3260|   417k|		read_consume(a);
 3261|       |
 3262|   423k|	if (zip->header_is_encoded == 0) {
  ------------------
  |  Branch (3262:6): [True: 419k, False: 4.17k]
  ------------------
 3263|   419k|		p = __archive_read_ahead(a, rbytes, NULL);
 3264|   419k|		if (p == NULL)
  ------------------
  |  Branch (3264:7): [True: 410, False: 419k]
  ------------------
 3265|    410|			return (NULL);
 3266|   419k|		zip->header_bytes_remaining -= rbytes;
 3267|   419k|		zip->pack_stream_bytes_unconsumed = rbytes;
 3268|   419k|	} else {
 3269|  4.17k|		const void *buff;
 3270|  4.17k|		ssize_t bytes;
 3271|       |
 3272|  4.17k|		bytes = read_stream(a, &buff, rbytes, rbytes);
 3273|  4.17k|		if (bytes <= 0)
  ------------------
  |  Branch (3273:7): [True: 148, False: 4.02k]
  ------------------
 3274|    148|			return (NULL);
 3275|  4.02k|		zip->header_bytes_remaining -= bytes;
 3276|  4.02k|		p = buff;
 3277|  4.02k|	}
 3278|       |
 3279|       |	/* Update checksum */
 3280|   423k|	zip->header_crc32 = __archive_crc32(zip->header_crc32, p, (unsigned)rbytes);
 3281|   423k|	return (p);
 3282|   423k|}
archive_read_support_format_7zip.c:read_stream:
 3719|  4.31k|{
 3720|  4.31k|	struct _7zip *zip = a->format->data;
 3721|  4.31k|	int64_t skip_bytes = 0;
 3722|  4.31k|	ssize_t r;
 3723|       |
 3724|  4.31k|	if (zip->uncompressed_buffer_bytes_remaining == 0) {
  ------------------
  |  Branch (3724:6): [True: 379, False: 3.94k]
  ------------------
 3725|    379|		if (zip->pack_stream_inbytes_remaining > 0) {
  ------------------
  |  Branch (3725:7): [True: 272, False: 107]
  ------------------
 3726|    272|			r = extract_pack_stream(a, 0);
 3727|    272|			if (r < 0)
  ------------------
  |  Branch (3727:8): [True: 141, False: 131]
  ------------------
 3728|    141|				return (r);
 3729|    131|			return (get_uncompressed_data(a, buff, size, minimum));
 3730|    272|		} else if (zip->folder_outbytes_remaining > 0) {
  ------------------
  |  Branch (3730:14): [True: 13, False: 94]
  ------------------
 3731|       |			/* Extract a remaining pack stream. */
 3732|     13|			r = extract_pack_stream(a, 0);
 3733|     13|			if (r < 0)
  ------------------
  |  Branch (3733:8): [True: 3, False: 10]
  ------------------
 3734|      3|				return (r);
 3735|     10|			return (get_uncompressed_data(a, buff, size, minimum));
 3736|     13|		}
 3737|    379|	} else
 3738|  3.94k|		return (get_uncompressed_data(a, buff, size, minimum));
 3739|       |
 3740|       |	/*
 3741|       |	 * Current pack stream has been consumed.
 3742|       |	 */
 3743|     94|	if (zip->pack_stream_remaining == 0) {
  ------------------
  |  Branch (3743:6): [True: 94, False: 0]
  ------------------
 3744|     94|		if (zip->header_is_being_read) {
  ------------------
  |  Branch (3744:7): [True: 1, False: 93]
  ------------------
 3745|       |			/* Invalid sequence. This might happen when
 3746|       |			 * reading a malformed archive. */
 3747|      1|			archive_set_error(&(a->archive),
 3748|      1|			    ARCHIVE_ERRNO_MISC, "Malformed 7-Zip archive");
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3749|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3750|      1|		}
 3751|       |
 3752|       |		/*
 3753|       |		 * All current folder's pack streams have been
 3754|       |		 * consumed. Switch to next folder.
 3755|       |		 */
 3756|     93|		if (zip->folder_index == 0 &&
  ------------------
  |  Branch (3756:7): [True: 90, False: 3]
  ------------------
 3757|     90|		    (zip->si.ci.folders[zip->entry->folderIndex].skipped_bytes
  ------------------
  |  Branch (3757:8): [True: 0, False: 90]
  ------------------
 3758|     90|		     || zip->folder_index != zip->entry->folderIndex)) {
  ------------------
  |  Branch (3758:11): [True: 0, False: 90]
  ------------------
 3759|      0|			zip->folder_index = zip->entry->folderIndex;
 3760|      0|			skip_bytes =
 3761|      0|			    zip->si.ci.folders[zip->folder_index].skipped_bytes;
 3762|      0|		}
 3763|       |
 3764|     93|		if (zip->folder_index >= zip->si.ci.numFolders) {
  ------------------
  |  Branch (3764:7): [True: 0, False: 93]
  ------------------
 3765|       |			/*
 3766|       |			 * We have consumed all folders and its pack streams.
 3767|       |			 */
 3768|      0|			*buff = NULL;
 3769|      0|			return (0);
 3770|      0|		}
 3771|     93|		r = setup_decode_folder(a,
 3772|     93|			&(zip->si.ci.folders[zip->folder_index]), 0);
 3773|     93|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|     93|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3773:7): [True: 8, False: 85]
  ------------------
 3774|      8|			return (r);
 3775|       |
 3776|     85|		zip->folder_index++;
 3777|     85|	}
 3778|       |
 3779|       |	/*
 3780|       |	 * Switch to next pack stream.
 3781|       |	 */
 3782|     85|	r = seek_pack(a);
 3783|     85|	if (r < 0)
  ------------------
  |  Branch (3783:6): [True: 3, False: 82]
  ------------------
 3784|      3|		return (r);
 3785|       |
 3786|       |	/* Extract a new pack stream. */
 3787|     82|	r = extract_pack_stream(a, 0);
 3788|     82|	if (r < 0)
  ------------------
  |  Branch (3788:6): [True: 21, False: 61]
  ------------------
 3789|     21|		return (r);
 3790|       |
 3791|       |	/*
 3792|       |	 * Skip the bytes we already have skipped in skip_stream().
 3793|       |	 */
 3794|     61|	while (1) {
  ------------------
  |  Branch (3794:9): [True: 61, Folded]
  ------------------
 3795|     61|		size_t request;
 3796|     61|		ssize_t skipped;
 3797|       |
 3798|     61|		if (zip->uncompressed_buffer_bytes_remaining == 0) {
  ------------------
  |  Branch (3798:7): [True: 5, False: 56]
  ------------------
 3799|      5|			if (zip->pack_stream_inbytes_remaining > 0) {
  ------------------
  |  Branch (3799:8): [True: 0, False: 5]
  ------------------
 3800|      0|				r = extract_pack_stream(a, 0);
 3801|      0|				if (r < 0)
  ------------------
  |  Branch (3801:9): [True: 0, False: 0]
  ------------------
 3802|      0|					return (r);
 3803|      5|			} else if (zip->folder_outbytes_remaining > 0) {
  ------------------
  |  Branch (3803:15): [True: 5, False: 0]
  ------------------
 3804|       |				/* Extract a remaining pack stream. */
 3805|      5|				r = extract_pack_stream(a, 0);
 3806|      5|				if (r < 0)
  ------------------
  |  Branch (3806:9): [True: 0, False: 5]
  ------------------
 3807|      0|					return (r);
 3808|      5|			} else {
 3809|      0|				archive_set_error(&a->archive,
 3810|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3811|      0|				    "Truncated 7-Zip file body");
 3812|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3813|      0|			}
 3814|      5|		}
 3815|       |
 3816|     61|		if (!skip_bytes)
  ------------------
  |  Branch (3816:7): [True: 61, False: 0]
  ------------------
 3817|     61|			break;
 3818|       |
 3819|      0|		if (skip_bytes > MAX_READ)
  ------------------
  |  |  394|      0|#define MAX_READ	16 * 1024 * 1024
  ------------------
  |  Branch (3819:7): [True: 0, False: 0]
  ------------------
 3820|      0|			request = MAX_READ;
  ------------------
  |  |  394|      0|#define MAX_READ	16 * 1024 * 1024
  ------------------
 3821|      0|		else
 3822|      0|			request = (size_t)skip_bytes;
 3823|       |
 3824|      0|		skipped = get_uncompressed_data(a, buff, request, 0);
 3825|      0|		if (skipped < 0)
  ------------------
  |  Branch (3825:7): [True: 0, False: 0]
  ------------------
 3826|      0|			return (skipped);
 3827|      0|		skip_bytes -= skipped;
 3828|      0|		if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (3828:7): [True: 0, False: 0]
  ------------------
 3829|      0|			read_consume(a);
 3830|      0|	}
 3831|       |
 3832|     61|	return (get_uncompressed_data(a, buff, size, minimum));
 3833|     61|}
archive_read_support_format_7zip.c:extract_pack_stream:
 3530|    428|{
 3531|    428|	struct _7zip *zip = a->format->data;
 3532|    428|	ssize_t bytes_avail;
 3533|    428|	int r;
 3534|       |
 3535|    428|	if (zip->codec == _7Z_COPY && zip->codec2 == -1) {
  ------------------
  |  |   93|    856|#define _7Z_COPY	0
  ------------------
  |  Branch (3535:6): [True: 153, False: 275]
  |  Branch (3535:32): [True: 69, False: 84]
  ------------------
 3536|     69|		if (minimum == 0)
  ------------------
  |  Branch (3536:7): [True: 69, False: 0]
  ------------------
 3537|     69|			minimum = 1;
 3538|     69|		if (__archive_read_ahead(a, minimum, &bytes_avail) == NULL
  ------------------
  |  Branch (3538:7): [True: 0, False: 69]
  ------------------
 3539|     69|		    || bytes_avail <= 0) {
  ------------------
  |  Branch (3539:10): [True: 0, False: 69]
  ------------------
 3540|      0|			archive_set_error(&a->archive,
 3541|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3542|      0|			    "Truncated 7-Zip file body");
 3543|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3544|      0|		}
 3545|     69|		if (bytes_avail > zip->pack_stream_inbytes_remaining)
  ------------------
  |  Branch (3545:7): [True: 69, False: 0]
  ------------------
 3546|     69|			bytes_avail = (ssize_t)zip->pack_stream_inbytes_remaining;
 3547|     69|		zip->pack_stream_inbytes_remaining -= bytes_avail;
 3548|     69|		if (bytes_avail > zip->folder_outbytes_remaining)
  ------------------
  |  Branch (3548:7): [True: 12, False: 57]
  ------------------
 3549|     12|			bytes_avail = (ssize_t)zip->folder_outbytes_remaining;
 3550|     69|		zip->folder_outbytes_remaining -= bytes_avail;
 3551|     69|		zip->uncompressed_buffer_bytes_remaining = bytes_avail;
 3552|     69|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     69|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3553|     69|	}
 3554|       |
 3555|       |	/* If the buffer hasn't been allocated, allocate it now. */
 3556|    359|	if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (3556:6): [True: 270, False: 89]
  ------------------
 3557|    270|		size_t new_size = UBUFF_SIZE;
  ------------------
  |  |  291|    270|#define UBUFF_SIZE	(64 * 1024)
  ------------------
 3558|       |
 3559|    270|		if (new_size < minimum)
  ------------------
  |  Branch (3559:7): [True: 0, False: 270]
  ------------------
 3560|      0|		    new_size = align_size(minimum);
 3561|    270|		zip->uncompressed_buffer = malloc(new_size);
 3562|    270|		if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (3562:7): [True: 0, False: 270]
  ------------------
 3563|      0|			archive_set_error(&a->archive, ENOMEM,
 3564|      0|			    "No memory for 7-Zip decompression");
 3565|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3566|      0|		}
 3567|    270|		zip->uncompressed_buffer_size = new_size;
 3568|    270|		zip->uncompressed_buffer_bytes_remaining = 0;
 3569|    270|	} else if (zip->uncompressed_buffer_size < minimum ||
  ------------------
  |  Branch (3569:13): [True: 0, False: 89]
  ------------------
 3570|     89|	    zip->uncompressed_buffer_bytes_remaining < minimum) {
  ------------------
  |  Branch (3570:6): [True: 0, False: 89]
  ------------------
 3571|       |		/*
 3572|       |		 * Make sure the uncompressed buffer can have bytes
 3573|       |		 * at least `minimum' bytes.
 3574|       |		 * NOTE: This case happen when reading the header.
 3575|       |		 */
 3576|      0|		size_t used;
 3577|      0|		if (zip->uncompressed_buffer_pointer != 0)
  ------------------
  |  Branch (3577:7): [True: 0, False: 0]
  ------------------
 3578|      0|			used = zip->uncompressed_buffer_pointer -
 3579|      0|				zip->uncompressed_buffer;
 3580|      0|		else
 3581|      0|			used = 0;
 3582|      0|		if (zip->uncompressed_buffer_size < minimum) {
  ------------------
  |  Branch (3582:7): [True: 0, False: 0]
  ------------------
 3583|       |			/*
 3584|       |			 * Expand the uncompressed buffer up to
 3585|       |			 * the minimum size.
 3586|       |			 */
 3587|      0|			void *p;
 3588|      0|			size_t new_size = align_size(minimum);
 3589|       |
 3590|      0|			p = realloc(zip->uncompressed_buffer, new_size);
 3591|      0|			if (p == NULL) {
  ------------------
  |  Branch (3591:8): [True: 0, False: 0]
  ------------------
 3592|      0|				archive_set_error(&a->archive, ENOMEM,
 3593|      0|				    "No memory for 7-Zip decompression");
 3594|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3595|      0|			}
 3596|      0|			zip->uncompressed_buffer = (unsigned char *)p;
 3597|      0|			zip->uncompressed_buffer_size = new_size;
 3598|      0|		}
 3599|       |		/*
 3600|       |		 * Move unconsumed bytes to the head.
 3601|       |		 */
 3602|      0|		if (used) {
  ------------------
  |  Branch (3602:7): [True: 0, False: 0]
  ------------------
 3603|      0|			memmove(zip->uncompressed_buffer,
 3604|      0|				zip->uncompressed_buffer + used,
 3605|      0|				zip->uncompressed_buffer_bytes_remaining);
 3606|      0|		}
 3607|      0|	} else
 3608|     89|		zip->uncompressed_buffer_bytes_remaining = 0;
 3609|    359|	zip->uncompressed_buffer_pointer = NULL;
 3610|    491|	for (;;) {
 3611|    491|		size_t bytes_in, bytes_out;
 3612|    491|		const void *buff_in;
 3613|    491|		unsigned char *buff_out;
 3614|    491|		int end_of_data;
 3615|       |
 3616|       |		/*
 3617|       |		 * Note: '1' here is a performance optimization.
 3618|       |		 * Recall that the decompression layer returns a count of
 3619|       |		 * available bytes; asking for more than that forces the
 3620|       |		 * decompressor to combine reads by copying data.
 3621|       |		 */
 3622|    491|		buff_in = __archive_read_ahead(a, 1, &bytes_avail);
 3623|    491|		if (bytes_avail <= 0) {
  ------------------
  |  Branch (3623:7): [True: 0, False: 491]
  ------------------
 3624|      0|			archive_set_error(&a->archive,
 3625|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3626|      0|			    "Truncated 7-Zip file body");
 3627|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3628|      0|		}
 3629|       |
 3630|    491|		buff_out = zip->uncompressed_buffer
 3631|    491|			+ zip->uncompressed_buffer_bytes_remaining;
 3632|    491|		bytes_out = zip->uncompressed_buffer_size
 3633|    491|			- zip->uncompressed_buffer_bytes_remaining;
 3634|    491|		bytes_in = bytes_avail;
 3635|    491|		if (bytes_in > (uint64_t)zip->pack_stream_inbytes_remaining)
  ------------------
  |  Branch (3635:7): [True: 491, False: 0]
  ------------------
 3636|    491|			bytes_in = (size_t)zip->pack_stream_inbytes_remaining;
 3637|       |		/* Drive decompression. */
 3638|    491|		r = decompress(a, zip, buff_out, &bytes_out,
 3639|    491|			buff_in, &bytes_in);
 3640|    491|		switch (r) {
 3641|    319|		case ARCHIVE_OK:
  ------------------
  |  |  233|    319|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3641:3): [True: 319, False: 172]
  ------------------
 3642|    319|			end_of_data = 0;
 3643|    319|			break;
 3644|     45|		case ARCHIVE_EOF:
  ------------------
  |  |  232|     45|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (3644:3): [True: 45, False: 446]
  ------------------
 3645|     45|			end_of_data = 1;
 3646|     45|			break;
 3647|    127|		default:
  ------------------
  |  Branch (3647:3): [True: 127, False: 364]
  ------------------
 3648|    127|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    127|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3649|    491|		}
 3650|    364|		zip->pack_stream_inbytes_remaining -= bytes_in;
 3651|    364|		if (bytes_out > (uint64_t)zip->folder_outbytes_remaining)
  ------------------
  |  Branch (3651:7): [True: 148, False: 216]
  ------------------
 3652|    148|			bytes_out = (size_t)zip->folder_outbytes_remaining;
 3653|    364|		zip->folder_outbytes_remaining -= bytes_out;
 3654|    364|		zip->uncompressed_buffer_bytes_remaining += bytes_out;
 3655|    364|		zip->pack_stream_bytes_unconsumed = bytes_in;
 3656|       |
 3657|       |		/*
 3658|       |		 * Continue decompression until uncompressed_buffer is full.
 3659|       |		 */
 3660|    364|		if (zip->uncompressed_buffer_bytes_remaining ==
  ------------------
  |  Branch (3660:7): [True: 1, False: 363]
  ------------------
 3661|    364|		    zip->uncompressed_buffer_size)
 3662|      1|			break;
 3663|    363|		if (zip->codec2 == _7Z_X86 && zip->odd_bcj_size &&
  ------------------
  |  |  105|    726|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (3663:7): [True: 62, False: 301]
  |  Branch (3663:33): [True: 38, False: 24]
  ------------------
 3664|     38|		    zip->uncompressed_buffer_bytes_remaining + 5 >
  ------------------
  |  Branch (3664:7): [True: 0, False: 38]
  ------------------
 3665|     38|		    zip->uncompressed_buffer_size)
 3666|      0|			break;
 3667|    363|		if (zip->pack_stream_inbytes_remaining == 0 &&
  ------------------
  |  Branch (3667:7): [True: 351, False: 12]
  ------------------
 3668|    351|		    zip->folder_outbytes_remaining == 0)
  ------------------
  |  Branch (3668:7): [True: 191, False: 160]
  ------------------
 3669|    191|			break;
 3670|    172|		if (end_of_data || (bytes_in == 0 && bytes_out == 0)) {
  ------------------
  |  Branch (3670:7): [True: 35, False: 137]
  |  Branch (3670:23): [True: 5, False: 132]
  |  Branch (3670:40): [True: 5, False: 0]
  ------------------
 3671|     40|			archive_set_error(&(a->archive),
 3672|     40|			    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  204|     40|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3673|     40|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     40|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3674|     40|		}
 3675|    132|		read_consume(a);
 3676|    132|	}
 3677|    192|	if (zip->uncompressed_buffer_bytes_remaining < minimum) {
  ------------------
  |  Branch (3677:6): [True: 0, False: 192]
  ------------------
 3678|      0|		archive_set_error(&(a->archive),
 3679|      0|		    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3680|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3681|      0|	}
 3682|    192|	zip->uncompressed_buffer_pointer = zip->uncompressed_buffer;
 3683|    192|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    192|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3684|    192|}
archive_read_support_format_7zip.c:decompress:
 1675|    491|{
 1676|    491|	const uint8_t *t_next_in;
 1677|    491|	uint8_t *t_next_out;
 1678|    491|	size_t o_avail_in, o_avail_out;
 1679|    491|	size_t t_avail_in, t_avail_out;
 1680|    491|	uint8_t *bcj2_next_out;
 1681|    491|	size_t bcj2_avail_out;
 1682|    491|	int r, ret = ARCHIVE_OK;
  ------------------
  |  |  233|    491|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1683|       |
 1684|    491|	t_avail_in = o_avail_in = *used;
 1685|    491|	t_avail_out = o_avail_out = *outbytes;
 1686|    491|	t_next_in = b;
 1687|    491|	t_next_out = buff;
 1688|       |
 1689|    491|	if (zip->codec != _7Z_LZMA2 && zip->codec2 == _7Z_X86) {
  ------------------
  |  |   95|    982|#define _7Z_LZMA2	0x21
  ------------------
              	if (zip->codec != _7Z_LZMA2 && zip->codec2 == _7Z_X86) {
  ------------------
  |  |  105|    454|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1689:6): [True: 454, False: 37]
  |  Branch (1689:33): [True: 62, False: 392]
  ------------------
 1690|     62|		int i;
 1691|       |
 1692|       |		/* Do not copy out the BCJ remaining bytes when the output
 1693|       |		 * buffer size is less than five bytes. */
 1694|     62|		if (o_avail_in != 0 && t_avail_out < 5 && zip->odd_bcj_size) {
  ------------------
  |  Branch (1694:7): [True: 42, False: 20]
  |  Branch (1694:26): [True: 0, False: 42]
  |  Branch (1694:45): [True: 0, False: 0]
  ------------------
 1695|      0|			*used = 0;
 1696|      0|			*outbytes = 0;
 1697|      0|			return (ret);
 1698|      0|		}
 1699|    120|		for (i = 0; zip->odd_bcj_size > 0 && t_avail_out; i++) {
  ------------------
  |  Branch (1699:15): [True: 58, False: 62]
  |  Branch (1699:40): [True: 58, False: 0]
  ------------------
 1700|     58|			*t_next_out++ = zip->odd_bcj[i];
 1701|     58|			t_avail_out--;
 1702|     58|			zip->odd_bcj_size--;
 1703|     58|		}
 1704|     62|		if (o_avail_in == 0 || t_avail_out == 0) {
  ------------------
  |  Branch (1704:7): [True: 20, False: 42]
  |  Branch (1704:26): [True: 0, False: 42]
  ------------------
 1705|     20|			*used = o_avail_in - t_avail_in;
 1706|     20|			*outbytes = o_avail_out - t_avail_out;
 1707|     20|			if (o_avail_in == 0)
  ------------------
  |  Branch (1707:8): [True: 20, False: 0]
  ------------------
 1708|     20|				ret = ARCHIVE_EOF;
  ------------------
  |  |  232|     20|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1709|     20|			return (ret);
 1710|     20|		}
 1711|     62|	}
 1712|       |
 1713|    471|	bcj2_next_out = t_next_out;
 1714|    471|	bcj2_avail_out = t_avail_out;
 1715|    471|	if (zip->codec2 == _7Z_X86_BCJ2) {
  ------------------
  |  |  106|    471|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1715:6): [True: 19, False: 452]
  ------------------
 1716|       |		/*
 1717|       |		 * Decode a remaining decompressed main stream for BCJ2.
 1718|       |		 */
 1719|     19|		if (zip->tmp_stream_bytes_remaining) {
  ------------------
  |  Branch (1719:7): [True: 0, False: 19]
  ------------------
 1720|      0|			ssize_t bytes;
 1721|      0|			size_t remaining = zip->tmp_stream_bytes_remaining;
 1722|      0|			bytes = Bcj2_Decode(zip, t_next_out, t_avail_out);
 1723|      0|			if (bytes < 0) {
  ------------------
  |  Branch (1723:8): [True: 0, False: 0]
  ------------------
 1724|      0|				archive_set_error(&(a->archive),
 1725|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1726|      0|				    "BCJ2 conversion failed");
 1727|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1728|      0|			}
 1729|      0|			zip->main_stream_bytes_remaining -=
 1730|      0|			    remaining - zip->tmp_stream_bytes_remaining;
 1731|      0|			t_avail_out -= bytes;
 1732|      0|			if (o_avail_in == 0 || t_avail_out == 0) {
  ------------------
  |  Branch (1732:8): [True: 0, False: 0]
  |  Branch (1732:27): [True: 0, False: 0]
  ------------------
 1733|      0|				*used = 0;
 1734|      0|				*outbytes = o_avail_out - t_avail_out;
 1735|      0|				if (o_avail_in == 0 &&
  ------------------
  |  Branch (1735:9): [True: 0, False: 0]
  ------------------
 1736|      0|				    zip->tmp_stream_bytes_remaining)
  ------------------
  |  Branch (1736:9): [True: 0, False: 0]
  ------------------
 1737|      0|					ret = ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1738|      0|				return (ret);
 1739|      0|			}
 1740|      0|			t_next_out += bytes;
 1741|      0|			bcj2_next_out = t_next_out;
 1742|      0|			bcj2_avail_out = t_avail_out;
 1743|      0|		}
 1744|     19|		t_next_out = zip->tmp_stream_buff;
 1745|     19|		t_avail_out = zip->tmp_stream_buff_size;
 1746|     19|	}
 1747|       |
 1748|    471|	switch (zip->codec) {
 1749|     97|	case _7Z_COPY:
  ------------------
  |  |   93|     97|#define _7Z_COPY	0
  ------------------
  |  Branch (1749:2): [True: 97, False: 374]
  ------------------
 1750|     97|	{
 1751|     97|		size_t bytes = (t_avail_in > t_avail_out) ?
  ------------------
  |  Branch (1751:18): [True: 0, False: 97]
  ------------------
 1752|     97|		    t_avail_out : t_avail_in;
 1753|       |
 1754|     97|		memcpy(t_next_out, t_next_in, bytes);
 1755|     97|		t_avail_in -= bytes;
 1756|     97|		t_avail_out -= bytes;
 1757|     97|		if (o_avail_in == 0)
  ------------------
  |  Branch (1757:7): [True: 14, False: 83]
  ------------------
 1758|     14|			ret = ARCHIVE_EOF;
  ------------------
  |  |  232|     14|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1759|     97|		break;
 1760|      0|	}
 1761|      0|#ifdef HAVE_LZMA_H
 1762|    158|	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   94|    121|#define _7Z_LZMA	0x030101
  ------------------
              	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   95|    158|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1762:2): [True: 121, False: 350]
  |  Branch (1762:17): [True: 37, False: 434]
  ------------------
 1763|    158|		zip->lzstream.next_in = t_next_in;
 1764|    158|		zip->lzstream.avail_in = t_avail_in;
 1765|    158|		zip->lzstream.next_out = t_next_out;
 1766|    158|		zip->lzstream.avail_out = t_avail_out;
 1767|       |
 1768|    158|		r = lzma_code(&(zip->lzstream), LZMA_RUN);
 1769|    158|		switch (r) {
 1770|     21|		case LZMA_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1770:3): [True: 21, False: 137]
  ------------------
 1771|     21|			lzma_end(&(zip->lzstream));
 1772|     21|			zip->lzstream_valid = 0;
 1773|     21|			ret = ARCHIVE_EOF;
  ------------------
  |  |  232|     21|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1774|     21|			break;
 1775|    133|		case LZMA_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (1775:3): [True: 133, False: 25]
  ------------------
 1776|    133|			break;
 1777|      4|		default:
  ------------------
  |  Branch (1777:3): [True: 4, False: 154]
  ------------------
 1778|      4|			archive_set_error(&(a->archive),
 1779|      4|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1780|      4|				"Decompression failed (%d)",
 1781|      4|			    r);
 1782|      4|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      4|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1783|    158|		}
 1784|    154|		t_avail_in = zip->lzstream.avail_in;
 1785|    154|		t_avail_out = zip->lzstream.avail_out;
 1786|    154|		break;
 1787|      0|#endif
 1788|      0|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 1789|      0|	case _7Z_BZ2:
  ------------------
  |  |   97|      0|#define _7Z_BZ2		0x040202
  ------------------
  |  Branch (1789:2): [True: 0, False: 471]
  ------------------
 1790|      0|		if (t_avail_in > UINT_MAX)
  ------------------
  |  Branch (1790:7): [True: 0, False: 0]
  ------------------
 1791|      0|			t_avail_in = UINT_MAX;
 1792|      0|		if (t_avail_out > UINT_MAX)
  ------------------
  |  Branch (1792:7): [True: 0, False: 0]
  ------------------
 1793|      0|			t_avail_out = UINT_MAX;
 1794|      0|		zip->bzstream.next_in = (char *)(uintptr_t)t_next_in;
 1795|      0|		zip->bzstream.avail_in = (unsigned int)t_avail_in;
 1796|      0|		zip->bzstream.next_out = (char *)(uintptr_t)t_next_out;
 1797|      0|		zip->bzstream.avail_out = (unsigned int)t_avail_out;
 1798|      0|		r = BZ2_bzDecompress(&(zip->bzstream));
 1799|      0|		switch (r) {
 1800|      0|		case BZ_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1800:3): [True: 0, False: 0]
  ------------------
 1801|      0|			switch (BZ2_bzDecompressEnd(&(zip->bzstream))) {
 1802|      0|			case BZ_OK:
  ------------------
  |  Branch (1802:4): [True: 0, False: 0]
  ------------------
 1803|      0|				break;
 1804|      0|			default:
  ------------------
  |  Branch (1804:4): [True: 0, False: 0]
  ------------------
 1805|      0|				archive_set_error(&(a->archive),
 1806|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1807|      0|				    "Failed to clean up decompressor");
 1808|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1809|      0|			}
 1810|      0|			zip->bzstream_valid = 0;
 1811|      0|			ret = ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1812|      0|			break;
 1813|      0|		case BZ_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (1813:3): [True: 0, False: 0]
  ------------------
 1814|      0|			break;
 1815|      0|		default:
  ------------------
  |  Branch (1815:3): [True: 0, False: 0]
  ------------------
 1816|      0|			archive_set_error(&(a->archive),
 1817|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1818|      0|			    "bzip decompression failed");
 1819|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1820|      0|		}
 1821|      0|		t_avail_in = zip->bzstream.avail_in;
 1822|      0|		t_avail_out = zip->bzstream.avail_out;
 1823|      0|		break;
 1824|      0|#endif
 1825|      0|#ifdef HAVE_ZLIB_H
 1826|      0|	case _7Z_DEFLATE:
  ------------------
  |  |   96|      0|#define _7Z_DEFLATE	0x040108
  ------------------
  |  Branch (1826:2): [True: 0, False: 471]
  ------------------
 1827|      0|		if (t_avail_in > UINT_MAX)
  ------------------
  |  Branch (1827:7): [True: 0, False: 0]
  ------------------
 1828|      0|			t_avail_in = UINT_MAX;
 1829|      0|		if (t_avail_out > UINT_MAX)
  ------------------
  |  Branch (1829:7): [True: 0, False: 0]
  ------------------
 1830|      0|			t_avail_out = UINT_MAX;
 1831|      0|		zip->stream.next_in = (Bytef *)(uintptr_t)t_next_in;
 1832|      0|		zip->stream.avail_in = (uInt)t_avail_in;
 1833|      0|		zip->stream.next_out = t_next_out;
 1834|      0|		zip->stream.avail_out = (uInt)t_avail_out;
 1835|      0|		r = inflate(&(zip->stream), 0);
 1836|      0|		switch (r) {
 1837|      0|		case Z_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1837:3): [True: 0, False: 0]
  ------------------
 1838|      0|			ret = ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1839|      0|			break;
 1840|      0|		case Z_OK: /* Decompressor made some progress.*/
  ------------------
  |  Branch (1840:3): [True: 0, False: 0]
  ------------------
 1841|      0|			break;
 1842|      0|		default:
  ------------------
  |  Branch (1842:3): [True: 0, False: 0]
  ------------------
 1843|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1844|      0|			    "File decompression failed (%d)", r);
 1845|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1846|      0|		}
 1847|      0|		t_avail_in = zip->stream.avail_in;
 1848|      0|		t_avail_out = zip->stream.avail_out;
 1849|      0|		break;
 1850|      0|#endif
 1851|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 1852|       |	case _7Z_ZSTD:
 1853|       |	{
 1854|       |		/* src, size, pos */
 1855|       |		ZSTD_inBuffer input = { t_next_in, t_avail_in, 0 };
 1856|       |		/* dst, size, pos */
 1857|       |		ZSTD_outBuffer output = { t_next_out, t_avail_out, 0 };
 1858|       |
 1859|       |		size_t const zret = ZSTD_decompressStream(zip->zstd_dstream,
 1860|       |		    &output, &input);
 1861|       |		if (ZSTD_isError(zret)) {
 1862|       |			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
 1863|       |			    "Zstd decompression failed: %s",
 1864|       |			    ZSTD_getErrorName(zret));
 1865|       |			return ARCHIVE_FAILED;
 1866|       |		}
 1867|       |		t_avail_in -= input.pos;
 1868|       |		t_avail_out -= output.pos;
 1869|       |		break;
 1870|       |	}
 1871|       |#endif
 1872|    216|	case _7Z_PPMD:
  ------------------
  |  |   98|    216|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (1872:2): [True: 216, False: 255]
  ------------------
 1873|    216|	{
 1874|    216|		int64_t flush_bytes;
 1875|       |
 1876|    216|		if (!zip->ppmd7_valid || zip->ppmd7_stat < 0 ||
  ------------------
  |  Branch (1876:7): [True: 0, False: 216]
  |  Branch (1876:28): [True: 0, False: 216]
  ------------------
 1877|    216|		    t_avail_out <= 0) {
  ------------------
  |  Branch (1877:7): [True: 0, False: 216]
  ------------------
 1878|      0|			archive_set_error(&(a->archive),
 1879|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1880|      0|			    "Decompression internal error");
 1881|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1882|      0|		}
 1883|    216|		zip->ppstream.next_in = t_next_in;
 1884|    216|		zip->ppstream.avail_in = t_avail_in;
 1885|    216|		zip->ppstream.stream_in = 0;
 1886|    216|		zip->ppstream.next_out = t_next_out;
 1887|    216|		zip->ppstream.avail_out = t_avail_out;
 1888|    216|		if (zip->ppmd7_stat == 0) {
  ------------------
  |  Branch (1888:7): [True: 122, False: 94]
  ------------------
 1889|    122|			zip->bytein.a = a;
 1890|    122|			zip->bytein.Read = &ppmd_read;
 1891|    122|			zip->range_dec.Stream = &zip->bytein;
 1892|    122|			r = __archive_ppmd7_functions.Ppmd7z_RangeDec_Init(
 1893|    122|				&(zip->range_dec));
 1894|    122|			if (r == 0) {
  ------------------
  |  Branch (1894:8): [True: 1, False: 121]
  ------------------
 1895|      1|				zip->ppmd7_stat = -1;
 1896|      1|				archive_set_error(&a->archive,
 1897|      1|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1898|      1|				    "Failed to initialize PPMd range decoder");
 1899|      1|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1900|      1|			}
 1901|    121|			if (zip->ppstream.overconsumed) {
  ------------------
  |  Branch (1901:8): [True: 5, False: 116]
  ------------------
 1902|      5|				zip->ppmd7_stat = -1;
 1903|      5|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      5|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1904|      5|			}
 1905|    116|			zip->ppmd7_stat = 1;
 1906|    116|		}
 1907|       |
 1908|    210|		if (t_avail_in == 0)
  ------------------
  |  Branch (1908:7): [True: 84, False: 126]
  ------------------
 1909|       |			/* XXX Flush out remaining decoded data XXX */
 1910|     84|			flush_bytes = zip->folder_outbytes_remaining;
 1911|    126|		else
 1912|    126|			flush_bytes = 0;
 1913|       |
 1914|  1.16M|		do {
 1915|  1.16M|			int sym;
 1916|       |
 1917|  1.16M|			sym = __archive_ppmd7_functions.Ppmd7_DecodeSymbol(
 1918|  1.16M|				&(zip->ppmd7_context), &(zip->range_dec.p));
 1919|  1.16M|			if (sym < 0) {
  ------------------
  |  Branch (1919:8): [True: 17, False: 1.16M]
  ------------------
 1920|     17|				zip->ppmd7_stat = -1;
 1921|     17|				archive_set_error(&a->archive,
 1922|     17|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     17|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1923|     17|				    "Failed to decode PPMd");
 1924|     17|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     17|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1925|     17|			}
 1926|  1.16M|			if (zip->ppstream.overconsumed) {
  ------------------
  |  Branch (1926:8): [True: 88, False: 1.16M]
  ------------------
 1927|     88|				zip->ppmd7_stat = -1;
 1928|     88|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     88|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1929|     88|			}
 1930|  1.16M|			*zip->ppstream.next_out++ = (unsigned char)sym;
 1931|  1.16M|			zip->ppstream.avail_out--;
 1932|  1.16M|			if (flush_bytes > 0)
  ------------------
  |  Branch (1932:8): [True: 1.67k, False: 1.16M]
  ------------------
 1933|  1.67k|				flush_bytes--;
 1934|  1.16M|		} while (zip->ppstream.avail_out &&
  ------------------
  |  Branch (1934:12): [True: 1.16M, False: 11]
  ------------------
 1935|  1.16M|			(zip->ppstream.avail_in || flush_bytes));
  ------------------
  |  Branch (1935:5): [True: 1.16M, False: 1.76k]
  |  Branch (1935:31): [True: 1.67k, False: 94]
  ------------------
 1936|       |
 1937|    105|		t_avail_in = zip->ppstream.avail_in;
 1938|    105|		t_avail_out = zip->ppstream.avail_out;
 1939|    105|		break;
 1940|    210|	}
 1941|      0|	default:
  ------------------
  |  Branch (1941:2): [True: 0, False: 471]
  ------------------
 1942|      0|		archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1943|      0|		    "Decompression internal error");
 1944|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1945|    471|	}
 1946|    356|	if (ret != ARCHIVE_OK && ret != ARCHIVE_EOF)
  ------------------
  |  |  233|    712|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	if (ret != ARCHIVE_OK && ret != ARCHIVE_EOF)
  ------------------
  |  |  232|     35|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1946:6): [True: 35, False: 321]
  |  Branch (1946:27): [True: 0, False: 35]
  ------------------
 1947|      0|		return (ret);
 1948|       |
 1949|    356|	if (zip->codec == _7Z_PPMD)
  ------------------
  |  |   98|    356|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (1949:6): [True: 105, False: 251]
  ------------------
 1950|    105|		*used = zip->ppstream.stream_in;
 1951|    251|	else
 1952|    251|		*used = o_avail_in - t_avail_in;
 1953|    356|	*outbytes = o_avail_out - t_avail_out;
 1954|       |
 1955|       |	/*
 1956|       |	 * Decode BCJ.
 1957|       |	 */
 1958|    356|	if (zip->codec != _7Z_LZMA2) {
  ------------------
  |  |   95|    356|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1958:6): [True: 320, False: 36]
  ------------------
 1959|    320|		if (zip->codec2 == _7Z_X86) {
  ------------------
  |  |  105|    320|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1959:7): [True: 42, False: 278]
  ------------------
 1960|     42|			size_t l = x86_Convert(zip, buff, *outbytes);
 1961|       |
 1962|     42|			zip->odd_bcj_size = *outbytes - l;
 1963|     42|			if (zip->odd_bcj_size > 0 && zip->odd_bcj_size <= 4 &&
  ------------------
  |  Branch (1963:8): [True: 39, False: 3]
  |  Branch (1963:33): [True: 39, False: 0]
  ------------------
 1964|     39|			    o_avail_in && ret != ARCHIVE_EOF) {
  ------------------
  |  |  232|     39|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1964:8): [True: 39, False: 0]
  |  Branch (1964:22): [True: 38, False: 1]
  ------------------
 1965|     38|				memcpy(zip->odd_bcj,
 1966|     38|				    ((unsigned char *)buff) + l,
 1967|     38|				    zip->odd_bcj_size);
 1968|     38|				*outbytes = l;
 1969|     38|			} else
 1970|      4|				zip->odd_bcj_size = 0;
 1971|    278|		} else if (zip->codec2 == _7Z_ARM) {
  ------------------
  |  |  109|    278|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1971:14): [True: 14, False: 264]
  ------------------
 1972|     14|			*outbytes = arm_Convert(zip, buff, *outbytes);
 1973|    264|		} else if (zip->codec2 == _7Z_ARM64) {
  ------------------
  |  |  111|    264|#define _7Z_ARM64	0xa
  ------------------
  |  Branch (1973:14): [True: 31, False: 233]
  ------------------
 1974|     31|			*outbytes = arm64_Convert(zip, buff, *outbytes);
 1975|    233|		} else if (zip->codec2 == _7Z_SPARC) {
  ------------------
  |  |  113|    233|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1975:14): [True: 18, False: 215]
  ------------------
 1976|     18|			*outbytes = sparc_Convert(zip, buff, *outbytes);
 1977|    215|		} else if (zip->codec2 == _7Z_POWERPC) {
  ------------------
  |  |  107|    215|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1977:14): [True: 16, False: 199]
  ------------------
 1978|     16|			*outbytes = powerpc_Convert(zip, buff, *outbytes);
 1979|     16|		}
 1980|    320|	}
 1981|       |
 1982|       |	/*
 1983|       |	 * Decode BCJ2 with a decompressed main stream.
 1984|       |	 */
 1985|    356|	if (zip->codec2 == _7Z_X86_BCJ2) {
  ------------------
  |  |  106|    356|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1985:6): [True: 19, False: 337]
  ------------------
 1986|     19|		ssize_t bytes;
 1987|       |
 1988|     19|		zip->tmp_stream_bytes_avail =
 1989|     19|		    zip->tmp_stream_buff_size - t_avail_out;
 1990|     19|		if (zip->tmp_stream_bytes_avail >
  ------------------
  |  Branch (1990:7): [True: 2, False: 17]
  ------------------
 1991|     19|		      (uint64_t)zip->main_stream_bytes_remaining)
 1992|      2|			zip->tmp_stream_bytes_avail =
 1993|      2|			    zip->main_stream_bytes_remaining;
 1994|     19|		zip->tmp_stream_bytes_remaining = zip->tmp_stream_bytes_avail;
 1995|     19|		bytes = Bcj2_Decode(zip, bcj2_next_out, bcj2_avail_out);
 1996|     19|		if (bytes < 0) {
  ------------------
  |  Branch (1996:7): [True: 12, False: 7]
  ------------------
 1997|     12|			archive_set_error(&(a->archive),
 1998|     12|			    ARCHIVE_ERRNO_MISC, "BCJ2 conversion failed");
  ------------------
  |  |  204|     12|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1999|     12|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     12|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2000|     12|		}
 2001|      7|		zip->main_stream_bytes_remaining -=
 2002|      7|		    zip->tmp_stream_bytes_avail
 2003|      7|		      - zip->tmp_stream_bytes_remaining;
 2004|      7|		bcj2_avail_out -= bytes;
 2005|      7|		*outbytes = o_avail_out - bcj2_avail_out;
 2006|      7|	}
 2007|       |
 2008|    344|	return (ret);
 2009|    356|}
archive_read_support_format_7zip.c:Bcj2_Decode:
 4498|     19|{
 4499|     19|	size_t inPos = 0, outPos = 0;
 4500|     19|	const uint8_t *buf0, *buf1, *buf2, *buf3;
 4501|     19|	size_t size0, size1, size2, size3;
 4502|     19|	const uint8_t *buffer, *bufferLim;
 4503|     19|	size_t i, j;
 4504|       |
 4505|     19|	size0 = zip->tmp_stream_bytes_remaining;
 4506|     19|	buf0 = zip->tmp_stream_buff + zip->tmp_stream_bytes_avail - size0;
 4507|     19|	size1 = zip->sub_stream_bytes_remaining[0];
 4508|     19|	buf1 = zip->sub_stream_buff[0] + zip->sub_stream_size[0] - size1;
 4509|     19|	size2 = zip->sub_stream_bytes_remaining[1];
 4510|     19|	buf2 = zip->sub_stream_buff[1] + zip->sub_stream_size[1] - size2;
 4511|     19|	size3 = zip->sub_stream_bytes_remaining[2];
 4512|     19|	buf3 = zip->sub_stream_buff[2] + zip->sub_stream_size[2] - size3;
 4513|       |
 4514|     19|	buffer = buf3;
 4515|     19|	bufferLim = buffer + size3;
 4516|       |
 4517|     19|	if (zip->bcj_state == 0) {
  ------------------
  |  Branch (4517:6): [True: 17, False: 2]
  ------------------
 4518|       |		/*
 4519|       |		 * Initialize.
 4520|       |		 */
 4521|     17|		zip->bcj2_prevByte = 0;
 4522|     17|		for (i = 0;
 4523|  4.40k|		    i < sizeof(zip->bcj2_p) / sizeof(zip->bcj2_p[0]); i++)
  ------------------
  |  Branch (4523:7): [True: 4.38k, False: 17]
  ------------------
 4524|  4.38k|			zip->bcj2_p[i] = kBitModelTotal >> 1;
  ------------------
  |  | 4473|  4.38k|#define kBitModelTotal (1 << kNumBitModelTotalBits)
  |  |  ------------------
  |  |  |  | 4472|  4.38k|#define kNumBitModelTotalBits 11
  |  |  ------------------
  ------------------
 4525|     17|		RC_INIT2;
  ------------------
  |  | 4478|     17|#define RC_INIT2 do {							\
  |  | 4479|     17|	zip->bcj2_code = 0;						\
  |  | 4480|     17|	zip->bcj2_range = 0xFFFFFFFF;					\
  |  | 4481|     17|	{								\
  |  | 4482|     17|		int ii;							\
  |  | 4483|    102|		for (ii = 0; ii < 5; ii++) {				\
  |  |  ------------------
  |  |  |  Branch (4483:16): [True: 85, False: 17]
  |  |  ------------------
  |  | 4484|     85|			RC_TEST;					\
  |  |  ------------------
  |  |  |  | 4477|     85|#define RC_TEST { if (buffer == bufferLim) return SZ_ERROR_DATA; }
  |  |  |  |  ------------------
  |  |  |  |  |  | 4464|      0|#define SZ_ERROR_DATA	 ARCHIVE_FAILED
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (4477:23): [True: 0, False: 85]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 4485|     85|			zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; \
  |  |  ------------------
  |  |  |  | 4476|     85|#define RC_READ_BYTE (*buffer++)
  |  |  ------------------
  |  | 4486|     85|		}							\
  |  | 4487|     17|	}								\
  |  | 4488|     17|} while (0)
  |  |  ------------------
  |  |  |  Branch (4488:10): [Folded, False: 17]
  |  |  ------------------
  ------------------
 4526|     17|		zip->bcj_state = 1;
 4527|     17|	}
 4528|       |
 4529|       |	/*
 4530|       |	 * Gather the odd bytes of a previous call.
 4531|       |	 */
 4532|     19|	for (i = 0; zip->odd_bcj_size > 0 && outPos < outSize; i++) {
  ------------------
  |  Branch (4532:14): [True: 0, False: 19]
  |  Branch (4532:39): [True: 0, False: 0]
  ------------------
 4533|      0|		outBuf[outPos++] = zip->odd_bcj[i];
 4534|      0|		zip->odd_bcj_size--;
 4535|      0|	}
 4536|       |
 4537|     19|	if (outSize == 0) {
  ------------------
  |  Branch (4537:6): [True: 0, False: 19]
  ------------------
 4538|      0|		zip->bcj2_outPos += outPos;
 4539|      0|		return (outPos);
 4540|      0|	}
 4541|       |
 4542|     88|	for (;;) {
 4543|     88|		uint8_t b;
 4544|     88|		CProb *prob;
  ------------------
  |  |  373|     88|#define CProb uint16_t
  ------------------
 4545|     88|		uint32_t bound;
 4546|     88|		uint32_t ttt;
 4547|       |
 4548|     88|		size_t limit = size0 - inPos;
 4549|     88|		if (outSize - outPos < limit)
  ------------------
  |  Branch (4549:7): [True: 0, False: 88]
  ------------------
 4550|      0|			limit = outSize - outPos;
 4551|       |
 4552|     88|		if (zip->bcj_state == 1) {
  ------------------
  |  Branch (4552:7): [True: 88, False: 0]
  ------------------
 4553|    535|			while (limit != 0) {
  ------------------
  |  Branch (4553:11): [True: 528, False: 7]
  ------------------
 4554|    528|				uint8_t bb = buf0[inPos];
 4555|    528|				outBuf[outPos++] = bb;
 4556|    528|				if (IsJ(zip->bcj2_prevByte, bb)) {
  ------------------
  |  | 4467|    528|#define IsJ(b0, b1) ((b1 & 0xFE) == 0xE8 || IsJcc(b0, b1))
  |  |  ------------------
  |  |  |  | 4466|    471|#define IsJcc(b0, b1) ((b0) == 0x0F && ((b1) & 0xF0) == 0x80)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (4466:24): [True: 112, False: 359]
  |  |  |  |  |  Branch (4466:40): [True: 24, False: 88]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (4467:22): [True: 57, False: 471]
  |  |  ------------------
  ------------------
 4557|     81|					zip->bcj_state = 2;
 4558|     81|					break;
 4559|     81|				}
 4560|    447|				inPos++;
 4561|    447|				zip->bcj2_prevByte = bb;
 4562|    447|				limit--;
 4563|    447|			}
 4564|     88|		}
 4565|       |
 4566|     88|		if (limit == 0 || outPos == outSize)
  ------------------
  |  Branch (4566:7): [True: 7, False: 81]
  |  Branch (4566:21): [True: 0, False: 81]
  ------------------
 4567|      7|			break;
 4568|     81|		zip->bcj_state = 1;
 4569|       |
 4570|     81|		b = buf0[inPos++];
 4571|       |
 4572|     81|		if (b == 0xE8)
  ------------------
  |  Branch (4572:7): [True: 27, False: 54]
  ------------------
 4573|     27|			prob = zip->bcj2_p + zip->bcj2_prevByte;
 4574|     54|		else if (b == 0xE9)
  ------------------
  |  Branch (4574:12): [True: 30, False: 24]
  ------------------
 4575|     30|			prob = zip->bcj2_p + 256;
 4576|     24|		else
 4577|     24|			prob = zip->bcj2_p + 257;
 4578|       |
 4579|     81|		IF_BIT_0(prob) {
  ------------------
  |  | 4492|     81|#define IF_BIT_0(p) ttt = *(p); bound = (zip->bcj2_range >> kNumBitModelTotalBits) * ttt; if (zip->bcj2_code < bound)
  |  |  ------------------
  |  |  |  | 4472|     81|#define kNumBitModelTotalBits 11
  |  |  ------------------
  |  |  |  Branch (4492:95): [True: 72, False: 9]
  |  |  ------------------
  ------------------
 4580|     72|			UPDATE_0(prob)
  ------------------
  |  | 4493|     72|#define UPDATE_0(p) zip->bcj2_range = bound; *(p) = (CProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); NORMALIZE;
  |  |  ------------------
  |  |  |  | 4473|     72|#define kBitModelTotal (1 << kNumBitModelTotalBits)
  |  |  |  |  ------------------
  |  |  |  |  |  | 4472|     72|#define kNumBitModelTotalBits 11
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define UPDATE_0(p) zip->bcj2_range = bound; *(p) = (CProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); NORMALIZE;
  |  |  ------------------
  |  |  |  | 4474|     72|#define kNumMoveBits 5
  |  |  ------------------
  |  |               #define UPDATE_0(p) zip->bcj2_range = bound; *(p) = (CProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); NORMALIZE;
  |  |  ------------------
  |  |  |  | 4490|     72|#define NORMALIZE if (zip->bcj2_range < kTopValue) { RC_TEST; zip->bcj2_range <<= 8; zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; }
  |  |  |  |  ------------------
  |  |  |  |  |  | 4470|     72|#define kTopValue ((uint32_t)1 << kNumTopBits)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 4469|     72|#define kNumTopBits 24
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define NORMALIZE if (zip->bcj2_range < kTopValue) { RC_TEST; zip->bcj2_range <<= 8; zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; }
  |  |  |  |  ------------------
  |  |  |  |  |  | 4477|      3|#define RC_TEST { if (buffer == bufferLim) return SZ_ERROR_DATA; }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 4464|      3|#define SZ_ERROR_DATA	 ARCHIVE_FAILED
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  237|      3|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (4477:23): [True: 3, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define NORMALIZE if (zip->bcj2_range < kTopValue) { RC_TEST; zip->bcj2_range <<= 8; zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; }
  |  |  |  |  ------------------
  |  |  |  |  |  | 4476|      0|#define RC_READ_BYTE (*buffer++)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (4490:23): [True: 3, False: 69]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4581|     69|			zip->bcj2_prevByte = b;
 4582|     69|		} else {
 4583|      9|			uint32_t dest;
 4584|      9|			const uint8_t *v;
 4585|      9|			uint8_t out[4];
 4586|       |
 4587|      9|			UPDATE_1(prob)
  ------------------
  |  | 4494|      9|#define UPDATE_1(p) zip->bcj2_range -= bound; zip->bcj2_code -= bound; *(p) = (CProb)(ttt - (ttt >> kNumMoveBits)); NORMALIZE;
  |  |  ------------------
  |  |  |  | 4474|      9|#define kNumMoveBits 5
  |  |  ------------------
  |  |               #define UPDATE_1(p) zip->bcj2_range -= bound; zip->bcj2_code -= bound; *(p) = (CProb)(ttt - (ttt >> kNumMoveBits)); NORMALIZE;
  |  |  ------------------
  |  |  |  | 4490|      9|#define NORMALIZE if (zip->bcj2_range < kTopValue) { RC_TEST; zip->bcj2_range <<= 8; zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; }
  |  |  |  |  ------------------
  |  |  |  |  |  | 4470|      9|#define kTopValue ((uint32_t)1 << kNumTopBits)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 4469|      9|#define kNumTopBits 24
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define NORMALIZE if (zip->bcj2_range < kTopValue) { RC_TEST; zip->bcj2_range <<= 8; zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; }
  |  |  |  |  ------------------
  |  |  |  |  |  | 4477|      1|#define RC_TEST { if (buffer == bufferLim) return SZ_ERROR_DATA; }
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  | 4464|      1|#define SZ_ERROR_DATA	 ARCHIVE_FAILED
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (4477:23): [True: 1, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define NORMALIZE if (zip->bcj2_range < kTopValue) { RC_TEST; zip->bcj2_range <<= 8; zip->bcj2_code = (zip->bcj2_code << 8) | RC_READ_BYTE; }
  |  |  |  |  ------------------
  |  |  |  |  |  | 4476|      0|#define RC_READ_BYTE (*buffer++)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (4490:23): [True: 1, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4588|      8|			if (b == 0xE8) {
  ------------------
  |  Branch (4588:8): [True: 3, False: 5]
  ------------------
 4589|      3|				v = buf1;
 4590|      3|				if (size1 < 4)
  ------------------
  |  Branch (4590:9): [True: 3, False: 0]
  ------------------
 4591|      3|					return SZ_ERROR_DATA;
  ------------------
  |  | 4464|      3|#define SZ_ERROR_DATA	 ARCHIVE_FAILED
  |  |  ------------------
  |  |  |  |  237|      3|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  |  |  ------------------
  ------------------
 4592|      0|				buf1 += 4;
 4593|      0|				size1 -= 4;
 4594|      5|			} else {
 4595|      5|				v = buf2;
 4596|      5|				if (size2 < 4)
  ------------------
  |  Branch (4596:9): [True: 5, False: 0]
  ------------------
 4597|      5|					return SZ_ERROR_DATA;
  ------------------
  |  | 4464|      5|#define SZ_ERROR_DATA	 ARCHIVE_FAILED
  |  |  ------------------
  |  |  |  |  237|      5|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  |  |  ------------------
  ------------------
 4598|      0|				buf2 += 4;
 4599|      0|				size2 -= 4;
 4600|      0|			}
 4601|      0|			dest = archive_be32dec(v) -
 4602|      0|			    (zip->bcj2_outPos + outPos + 4);
 4603|      0|			archive_le32enc(out, dest);
 4604|      0|			zip->bcj2_prevByte = out[3];
 4605|       |
 4606|      0|			for (i = 0; i < 4 && outPos < outSize; i++)
  ------------------
  |  Branch (4606:16): [True: 0, False: 0]
  |  Branch (4606:25): [True: 0, False: 0]
  ------------------
 4607|      0|				outBuf[outPos++] = out[i];
 4608|      0|			if (i < 4) {
  ------------------
  |  Branch (4608:8): [True: 0, False: 0]
  ------------------
 4609|       |				/*
 4610|       |				 * Save odd bytes which we could not add into
 4611|       |				 * the output buffer because of out of space.
 4612|       |				 */
 4613|      0|				zip->odd_bcj_size = 4 - i;
 4614|      0|				for (; i < 4; i++) {
  ------------------
  |  Branch (4614:12): [True: 0, False: 0]
  ------------------
 4615|      0|					j = i - 4 + (unsigned)zip->odd_bcj_size;
 4616|      0|					zip->odd_bcj[j] = out[i];
 4617|      0|				}
 4618|      0|				break;
 4619|      0|			}
 4620|      0|		}
 4621|     81|	}
 4622|      7|	zip->tmp_stream_bytes_remaining -= inPos;
 4623|      7|	zip->sub_stream_bytes_remaining[0] = size1;
 4624|      7|	zip->sub_stream_bytes_remaining[1] = size2;
 4625|      7|	zip->sub_stream_bytes_remaining[2] = bufferLim - buffer;
 4626|      7|	zip->bcj2_outPos += outPos;
 4627|       |
 4628|      7|	return ((ssize_t)outPos);
 4629|     19|}
archive_read_support_format_7zip.c:ppmd_read:
 1292|  11.4k|{
 1293|  11.4k|	struct archive_read *a = ((IByteIn*)p)->a;
 1294|  11.4k|	struct _7zip *zip = a->format->data;
 1295|  11.4k|	Byte b;
 1296|       |
 1297|  11.4k|	if (zip->ppstream.avail_in == 0) {
  ------------------
  |  Branch (1297:6): [True: 117, False: 11.3k]
  ------------------
 1298|       |		/*
 1299|       |		 * Ppmd7_DecodeSymbol might require reading multiple bytes
 1300|       |		 * and we are on boundary;
 1301|       |		 * last resort to read using __archive_read_ahead.
 1302|       |		 */
 1303|    117|		if (zip->pack_stream_inbytes_remaining <= 0 ||
  ------------------
  |  Branch (1303:7): [True: 103, False: 14]
  ------------------
 1304|     14|		    zip->ppstream.stream_in >=
  ------------------
  |  Branch (1304:7): [True: 14, False: 0]
  ------------------
 1305|    117|		    (uint64_t)zip->pack_stream_inbytes_remaining) {
 1306|    117|			archive_set_error(&a->archive,
 1307|    117|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    117|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1308|    117|			    "Truncated 7z file data");
 1309|    117|			zip->ppstream.overconsumed = 1;
 1310|    117|			return (0);
 1311|    117|		}
 1312|      0|		const uint8_t *data = __archive_read_ahead(a,
 1313|      0|		    zip->ppstream.stream_in + 1, NULL);
 1314|      0|		if (data == NULL) {
  ------------------
  |  Branch (1314:7): [True: 0, False: 0]
  ------------------
 1315|      0|			archive_set_error(&a->archive,
 1316|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1317|      0|			    "Truncated 7z file data");
 1318|      0|			zip->ppstream.overconsumed = 1;
 1319|      0|			return (0);
 1320|      0|		}
 1321|      0|		b = data[zip->ppstream.stream_in];
 1322|  11.3k|	} else {
 1323|  11.3k|		b = *zip->ppstream.next_in++;
 1324|  11.3k|		zip->ppstream.avail_in--;
 1325|  11.3k|	}
 1326|  11.3k|	zip->ppstream.stream_in++;
 1327|  11.3k|	return (b);
 1328|  11.4k|}
archive_read_support_format_7zip.c:x86_Convert:
 4174|     42|{
 4175|     42|	static const uint8_t kMaskToAllowedStatus[8] = {1, 1, 1, 0, 1, 0, 0, 0};
 4176|     42|	static const uint8_t kMaskToBitNumber[8] = {0, 1, 2, 2, 3, 3, 3, 3};
 4177|     42|	size_t bufferPos, prevPosT;
 4178|     42|	uint32_t ip, prevMask;
 4179|       |
 4180|     42|	if (size < 5)
  ------------------
  |  Branch (4180:6): [True: 2, False: 40]
  ------------------
 4181|      2|		return 0;
 4182|       |
 4183|     40|	bufferPos = 0;
 4184|     40|	prevPosT = zip->bcj_prevPosT;
 4185|     40|	prevMask = zip->bcj_prevMask;
 4186|     40|	ip = zip->bcj_ip;
 4187|       |
 4188|  1.56k|	for (;;) {
 4189|  1.56k|		uint8_t *p = data + bufferPos;
 4190|  1.56k|		uint8_t *limit = data + size - 4;
 4191|       |
 4192|  10.3k|		for (; p < limit; p++)
  ------------------
  |  Branch (4192:10): [True: 10.3k, False: 40]
  ------------------
 4193|  10.3k|			if ((*p & 0xFE) == 0xE8)
  ------------------
  |  Branch (4193:8): [True: 1.52k, False: 8.82k]
  ------------------
 4194|  1.52k|				break;
 4195|  1.56k|		bufferPos = (size_t)(p - data);
 4196|  1.56k|		if (p >= limit)
  ------------------
  |  Branch (4196:7): [True: 40, False: 1.52k]
  ------------------
 4197|     40|			break;
 4198|  1.52k|		prevPosT = bufferPos - prevPosT;
 4199|  1.52k|		if (prevPosT == 0 || prevPosT > 3)
  ------------------
  |  Branch (4199:7): [True: 0, False: 1.52k]
  |  Branch (4199:24): [True: 585, False: 939]
  ------------------
 4200|    585|			prevMask = 0;
 4201|    939|		else {
 4202|    939|			prevMask = (prevMask << ((int)prevPosT - 1)) & 0x7;
 4203|    939|			if (prevMask != 0) {
  ------------------
  |  Branch (4203:8): [True: 904, False: 35]
  ------------------
 4204|    904|				unsigned char b =
 4205|    904|					p[4 - kMaskToBitNumber[prevMask]];
 4206|    904|				if (!kMaskToAllowedStatus[prevMask] ||
  ------------------
  |  Branch (4206:9): [True: 401, False: 503]
  ------------------
 4207|    503|				    Test86MSByte(b)) {
  ------------------
  |  | 4161|    503|#define Test86MSByte(b) ((b) == 0 || (b) == 0xFF)
  |  |  ------------------
  |  |  |  Branch (4161:26): [True: 15, False: 488]
  |  |  |  Branch (4161:38): [True: 23, False: 465]
  |  |  ------------------
  ------------------
 4208|    439|					prevPosT = bufferPos;
 4209|    439|					prevMask = ((prevMask << 1) & 0x7) | 1;
 4210|    439|					bufferPos++;
 4211|    439|					continue;
 4212|    439|				}
 4213|    904|			}
 4214|    939|		}
 4215|  1.08k|		prevPosT = bufferPos;
 4216|       |
 4217|  1.08k|		if (Test86MSByte(p[4])) {
  ------------------
  |  | 4161|  1.08k|#define Test86MSByte(b) ((b) == 0 || (b) == 0xFF)
  |  |  ------------------
  |  |  |  Branch (4161:26): [True: 122, False: 963]
  |  |  |  Branch (4161:38): [True: 128, False: 835]
  |  |  ------------------
  ------------------
 4218|    250|			uint32_t src = archive_le32dec(p + 1);
 4219|    250|			uint32_t dest;
 4220|    264|			for (;;) {
 4221|    264|				uint8_t b;
 4222|    264|				int b_index;
 4223|       |
 4224|    264|				dest = src - (ip + (uint32_t)bufferPos);
 4225|    264|				if (prevMask == 0)
  ------------------
  |  Branch (4225:9): [True: 132, False: 132]
  ------------------
 4226|    132|					break;
 4227|    132|				b_index = kMaskToBitNumber[prevMask] * 8;
 4228|    132|				b = (uint8_t)(dest >> (24 - b_index));
 4229|    132|				if (!Test86MSByte(b))
  ------------------
  |  | 4161|    132|#define Test86MSByte(b) ((b) == 0 || (b) == 0xFF)
  |  |  ------------------
  |  |  |  Branch (4161:26): [True: 13, False: 119]
  |  |  |  Branch (4161:38): [True: 1, False: 118]
  |  |  ------------------
  ------------------
 4230|    118|					break;
 4231|     14|				src = dest ^ ((1 << (32 - b_index)) - 1);
 4232|     14|			}
 4233|    250|			p[4] = (uint8_t)(~(((dest >> 24) & 1) - 1));
 4234|    250|			p[3] = (uint8_t)(dest >> 16);
 4235|    250|			p[2] = (uint8_t)(dest >> 8);
 4236|    250|			p[1] = (uint8_t)dest;
 4237|    250|			bufferPos += 5;
 4238|    835|		} else {
 4239|    835|			prevMask = ((prevMask << 1) & 0x7) | 1;
 4240|    835|			bufferPos++;
 4241|    835|		}
 4242|  1.08k|	}
 4243|     40|	zip->bcj_prevPosT = prevPosT;
 4244|     40|	zip->bcj_prevMask = prevMask;
 4245|     40|	zip->bcj_ip += (uint32_t)bufferPos;
 4246|     40|	return (bufferPos);
 4247|     42|}
archive_read_support_format_7zip.c:arm_Convert:
 4257|     14|{
 4258|       |	// This function was adapted from
 4259|       |	// static size_t bcj_arm(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
 4260|       |	// in https://git.tukaani.org/xz-embedded.git
 4261|       |
 4262|       |	/*
 4263|       |	 * Branch/Call/Jump (BCJ) filter decoders
 4264|       |	 *
 4265|       |	 * Authors: Lasse Collin <lasse.collin@tukaani.org>
 4266|       |	 *          Igor Pavlov <https://7-zip.org/>
 4267|       |	 *
 4268|       |	 * This file has been put into the public domain.
 4269|       |	 * You can do whatever you want with this file.
 4270|       |	 */
 4271|       |
 4272|     14|	size_t i;
 4273|     14|	uint32_t addr;
 4274|       |
 4275|    144|	for (i = 0; i + 4 <= size; i += 4) {
  ------------------
  |  Branch (4275:14): [True: 130, False: 14]
  ------------------
 4276|    130|		if (buf[i + 3] == 0xEB) {
  ------------------
  |  Branch (4276:7): [True: 44, False: 86]
  ------------------
 4277|       |			// Calculate the transformed addr.
 4278|     44|			addr = archive_le24dec(buf + i);
 4279|     44|			addr <<= 2;
 4280|     44|			addr -= zip->bcj_ip + (uint32_t)i;
 4281|     44|			addr >>= 2;
 4282|       |
 4283|       |			// Store the transformed addr in buf.
 4284|     44|			archive_le24enc(buf + i, addr);
 4285|     44|		}
 4286|    130|	}
 4287|       |
 4288|     14|	zip->bcj_ip += (uint32_t)i;
 4289|       |
 4290|     14|	return i;
 4291|     14|}
archive_read_support_format_7zip.c:arm64_Convert:
 4295|     31|{
 4296|       |	// This function was adapted from
 4297|       |	// static size_t bcj_arm64(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
 4298|       |	// in https://git.tukaani.org/xz-embedded.git
 4299|       |
 4300|       |	/*
 4301|       |	 * Branch/Call/Jump (BCJ) filter decoders
 4302|       |	 *
 4303|       |	 * Authors: Lasse Collin <lasse.collin@tukaani.org>
 4304|       |	 *          Igor Pavlov <https://7-zip.org/>
 4305|       |	 *
 4306|       |	 * This file has been put into the public domain.
 4307|       |	 * You can do whatever you want with this file.
 4308|       |	 */
 4309|       |
 4310|     31|	size_t i;
 4311|     31|	uint32_t instr;
 4312|     31|	uint32_t addr;
 4313|       |
 4314|    578|	for (i = 0; i + 4 <= size; i += 4) {
  ------------------
  |  Branch (4314:14): [True: 547, False: 31]
  ------------------
 4315|    547|		instr = archive_le32dec(buf + i);
 4316|       |
 4317|    547|		if ((instr >> 26) == 0x25) {
  ------------------
  |  Branch (4317:7): [True: 86, False: 461]
  ------------------
 4318|       |			/* BL instruction */
 4319|     86|			addr = instr - ((zip->bcj_ip + (uint32_t)i) >> 2);
 4320|     86|			instr = 0x94000000 | (addr & 0x03FFFFFF);
 4321|       |
 4322|     86|			archive_le32enc(buf + i, instr);
 4323|    461|		} else if ((instr & 0x9F000000) == 0x90000000) {
  ------------------
  |  Branch (4323:14): [True: 76, False: 385]
  ------------------
 4324|       |			/* ADRP instruction */
 4325|     76|			addr = ((instr >> 29) & 3) | ((instr >> 3) & 0x1FFFFC);
 4326|       |
 4327|       |			/* Only convert values in the range +/-512 MiB. */
 4328|     76|			if ((addr + 0x020000) & 0x1C0000)
  ------------------
  |  Branch (4328:8): [True: 35, False: 41]
  ------------------
 4329|     35|				continue;
 4330|       |
 4331|     41|			addr -= (zip->bcj_ip + (uint32_t)i) >> 12;
 4332|       |
 4333|     41|			instr &= 0x9000001F;
 4334|     41|			instr |= (addr & 3) << 29;
 4335|     41|			instr |= (addr & 0x03FFFC) << 3;
 4336|     41|			instr |= (0U - (addr & 0x020000)) & 0xE00000;
 4337|       |
 4338|     41|			archive_le32enc(buf + i, instr);
 4339|     41|		}
 4340|    547|	}
 4341|       |
 4342|     31|	zip->bcj_ip += (uint32_t)i;
 4343|       |
 4344|     31|	return i;
 4345|     31|}
archive_read_support_format_7zip.c:sparc_Convert:
 4349|     18|{
 4350|       |	// This function was adapted from
 4351|       |	// static size_t bcj_sparc(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
 4352|       |	// in https://git.tukaani.org/xz-embedded.git
 4353|       |
 4354|       |	/*
 4355|       |	 * Branch/Call/Jump (BCJ) filter decoders
 4356|       |	 *
 4357|       |	 * Authors: Lasse Collin <lasse.collin@tukaani.org>
 4358|       |	 *          Igor Pavlov <https://7-zip.org/>
 4359|       |	 *
 4360|       |	 * Copyright (C) The XZ Embedded authors and contributors
 4361|       |	 *
 4362|       |	 * Permission to use, copy, modify, and/or distribute this
 4363|       |	 * software for any purpose with or without fee is hereby granted.
 4364|       |	 *
 4365|       |	 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
 4366|       |	 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
 4367|       |	 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
 4368|       |	 * THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
 4369|       |	 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 4370|       |	 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 4371|       |	 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 4372|       |	 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 4373|       |	 */
 4374|       |
 4375|     18|	size_t i;
 4376|     18|	uint32_t instr;
 4377|       |
 4378|     18|	size &= ~(size_t)3;
 4379|       |
 4380|    210|	for (i = 0; i < size; i += 4) {
  ------------------
  |  Branch (4380:14): [True: 192, False: 18]
  ------------------
 4381|    192|		instr = archive_be32dec(buf + i);
 4382|       |
 4383|    192|		if ((instr >> 22) == 0x100 || (instr >> 22) == 0x1FF) {
  ------------------
  |  Branch (4383:7): [True: 24, False: 168]
  |  Branch (4383:33): [True: 10, False: 158]
  ------------------
 4384|     34|			instr <<= 2;
 4385|     34|			instr -= zip->bcj_ip + (uint32_t)i;
 4386|     34|			instr >>= 2;
 4387|     34|			instr = ((uint32_t)0x40000000 - (instr & 0x400000))
 4388|     34|			        | 0x40000000 | (instr & 0x3FFFFF);
 4389|       |
 4390|     34|			archive_be32enc(buf + i, instr);
 4391|     34|		}
 4392|    192|	}
 4393|       |
 4394|     18|	zip->bcj_ip += (uint32_t)i;
 4395|       |
 4396|     18|	return i;
 4397|     18|}
archive_read_support_format_7zip.c:powerpc_Convert:
 4401|     16|{
 4402|       |	// This function was adapted from
 4403|       |	// static size_t powerpc_code(void *simple, uint32_t now_pos, bool is_encoder, uint8_t *buffer, size_t size)
 4404|       |	// in https://git.tukaani.org/xz.git
 4405|       |
 4406|       |	/*
 4407|       |	 * Filter for PowerPC (big endian) binaries
 4408|       |	 *
 4409|       |	 * Authors: Igor Pavlov
 4410|       |	 *          Lasse Collin
 4411|       |	 *
 4412|       |	 * Copyright (C) The XZ Utils authors and contributors
 4413|       |	 *
 4414|       |	 * Permission to use, copy, modify, and/or distribute this
 4415|       |	 * software for any purpose with or without fee is hereby granted.
 4416|       |	 *
 4417|       |	 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
 4418|       |	 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
 4419|       |	 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
 4420|       |	 * THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
 4421|       |	 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 4422|       |	 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
 4423|       |	 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
 4424|       |	 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 4425|       |	 */
 4426|       |
 4427|     16|	size &= ~(size_t)3;
 4428|       |
 4429|     16|	size_t i;
 4430|    234|	for (i = 0; i < size; i += 4) {
  ------------------
  |  Branch (4430:14): [True: 218, False: 16]
  ------------------
 4431|       |		// PowerPC branch 6(48) 24(Offset) 1(Abs) 1(Link)
 4432|    218|		if ((buf[i] >> 2) == 0x12
  ------------------
  |  Branch (4432:7): [True: 82, False: 136]
  ------------------
 4433|     82|			&& ((buf[i + 3] & 3) == 1)) {
  ------------------
  |  Branch (4433:7): [True: 38, False: 44]
  ------------------
 4434|       |
 4435|     38|			const uint32_t src
 4436|     38|				= (((uint32_t)(buf[i + 0]) & 3) << 24)
 4437|     38|				| ((uint32_t)(buf[i + 1]) << 16)
 4438|     38|				| ((uint32_t)(buf[i + 2]) << 8)
 4439|     38|				| ((uint32_t)(buf[i + 3]) & ~UINT32_C(3));
 4440|       |
 4441|     38|			uint32_t dest = src - (zip->bcj_ip + (uint32_t)(i));
 4442|       |
 4443|     38|			buf[i + 0] = 0x48 | ((dest >> 24) &  0x03);
 4444|     38|			buf[i + 1] = (dest >> 16);
 4445|     38|			buf[i + 2] = (dest >> 8);
 4446|     38|			buf[i + 3] &= 0x03;
 4447|     38|			buf[i + 3] |= dest;
 4448|     38|		}
 4449|    218|	}
 4450|       |
 4451|     16|	zip->bcj_ip += (uint32_t)i;
 4452|       |
 4453|     16|	return i;
 4454|     16|}
archive_read_support_format_7zip.c:get_uncompressed_data:
 3467|  4.19k|{
 3468|  4.19k|	struct _7zip *zip = a->format->data;
 3469|  4.19k|	ssize_t bytes_avail;
 3470|       |
 3471|  4.19k|	if (zip->codec == _7Z_COPY && zip->codec2 == -1) {
  ------------------
  |  |   93|  8.39k|#define _7Z_COPY	0
  ------------------
  |  Branch (3471:6): [True: 345, False: 3.85k]
  |  Branch (3471:32): [True: 118, False: 227]
  ------------------
 3472|       |		/* Copy mode. */
 3473|       |
 3474|    118|		*buff = __archive_read_ahead(a, minimum, &bytes_avail);
 3475|    118|		if (*buff == NULL) {
  ------------------
  |  Branch (3475:7): [True: 1, False: 117]
  ------------------
 3476|      1|			archive_set_error(&a->archive,
 3477|      1|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3478|      1|			    "Truncated 7-Zip file data");
 3479|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3480|      1|		}
 3481|    117|		if ((size_t)bytes_avail >
  ------------------
  |  Branch (3481:7): [True: 117, False: 0]
  ------------------
 3482|    117|		    zip->uncompressed_buffer_bytes_remaining)
 3483|    117|			bytes_avail = (ssize_t)
 3484|    117|			    zip->uncompressed_buffer_bytes_remaining;
 3485|    117|		if ((size_t)bytes_avail > size)
  ------------------
  |  Branch (3485:7): [True: 63, False: 54]
  ------------------
 3486|     63|			bytes_avail = (ssize_t)size;
 3487|       |
 3488|    117|		zip->pack_stream_bytes_unconsumed = bytes_avail;
 3489|  4.07k|	} else if (zip->uncompressed_buffer_pointer == NULL) {
  ------------------
  |  Branch (3489:13): [True: 0, False: 4.07k]
  ------------------
 3490|       |		/* Decompression has failed. */
 3491|      0|		archive_set_error(&(a->archive),
 3492|      0|		    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3493|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3494|  4.07k|	} else {
 3495|       |		/* Packed mode. */
 3496|  4.07k|		if (minimum > zip->uncompressed_buffer_bytes_remaining) {
  ------------------
  |  Branch (3496:7): [True: 0, False: 4.07k]
  ------------------
 3497|       |			/*
 3498|       |			 * If remaining uncompressed data size is less than
 3499|       |			 * the minimum size, fill the buffer up to the
 3500|       |			 * minimum size.
 3501|       |			 */
 3502|      0|			if (extract_pack_stream(a, minimum) < 0)
  ------------------
  |  Branch (3502:8): [True: 0, False: 0]
  ------------------
 3503|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3504|      0|		}
 3505|  4.07k|		if (size > zip->uncompressed_buffer_bytes_remaining)
  ------------------
  |  Branch (3505:7): [True: 0, False: 4.07k]
  ------------------
 3506|      0|			bytes_avail = (ssize_t)
 3507|      0|			    zip->uncompressed_buffer_bytes_remaining;
 3508|  4.07k|		else
 3509|  4.07k|			bytes_avail = (ssize_t)size;
 3510|  4.07k|		*buff = zip->uncompressed_buffer_pointer;
 3511|  4.07k|		zip->uncompressed_buffer_pointer += bytes_avail;
 3512|  4.07k|	}
 3513|  4.19k|	zip->uncompressed_buffer_bytes_remaining -= bytes_avail;
 3514|  4.19k|	return (bytes_avail);
 3515|  4.19k|}
archive_read_support_format_7zip.c:decode_encoded_header_info:
 3218|    376|{
 3219|    376|	struct _7zip *zip = a->format->data;
 3220|    376|	int64_t pi_end;
 3221|       |
 3222|    376|	errno = 0;
 3223|    376|	if (read_StreamsInfo(a, si) < 0) {
  ------------------
  |  Branch (3223:6): [True: 58, False: 318]
  ------------------
 3224|     58|		if (errno == ENOMEM)
  ------------------
  |  Branch (3224:7): [True: 0, False: 58]
  ------------------
 3225|      0|			archive_set_error(&a->archive, -1,
 3226|      0|			    "Couldn't allocate memory");
 3227|     58|		else
 3228|     58|			archive_set_error(&a->archive, -1,
 3229|     58|			    "Malformed 7-Zip archive");
 3230|     58|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     58|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3231|     58|	}
 3232|       |
 3233|    318|	if (si->pi.numPackStreams == 0 || si->ci.numFolders == 0) {
  ------------------
  |  Branch (3233:6): [True: 0, False: 318]
  |  Branch (3233:36): [True: 2, False: 316]
  ------------------
 3234|      2|		archive_set_error(&a->archive, -1, "Malformed 7-Zip archive");
 3235|      2|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3236|      2|	}
 3237|       |
 3238|    316|	if (archive_ckd_add_i64(&pi_end, si->pi.pos, si->pi.sizes[0])) {
  ------------------
  |  Branch (3238:6): [True: 0, False: 316]
  ------------------
 3239|      0|		archive_set_error(&a->archive, -1, "Malformed 7-Zip archive");
 3240|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3241|      0|	}
 3242|       |
 3243|    316|	if (zip->header_offset < pi_end) {
  ------------------
  |  Branch (3243:6): [True: 0, False: 316]
  ------------------
 3244|      0|		archive_set_error(&a->archive, -1, "Malformed Header offset");
 3245|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3246|      0|	}
 3247|       |
 3248|    316|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    316|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3249|    316|}
archive_read_support_format_7zip.c:read_StreamsInfo:
 2693|  1.11k|{
 2694|  1.11k|	struct _7zip *zip = a->format->data;
 2695|  1.11k|	const unsigned char *p;
 2696|  1.11k|	size_t i;
 2697|       |
 2698|  1.11k|	memset(si, 0, sizeof(*si));
 2699|       |
 2700|  1.11k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2700:6): [True: 0, False: 1.11k]
  ------------------
 2701|      0|		return (-1);
 2702|  1.11k|	if (*p == kPackInfo) {
  ------------------
  |  |  126|  1.11k|#define kPackInfo		0x06
  ------------------
  |  Branch (2702:6): [True: 1.02k, False: 89]
  ------------------
 2703|  1.02k|		int64_t packPos;
 2704|       |
 2705|  1.02k|		if (read_PackInfo(a, &(si->pi)) < 0)
  ------------------
  |  Branch (2705:7): [True: 111, False: 910]
  ------------------
 2706|    111|			return (-1);
 2707|       |
 2708|    910|		if (si->pi.positions == NULL || si->pi.sizes == NULL)
  ------------------
  |  Branch (2708:7): [True: 2, False: 908]
  |  Branch (2708:35): [True: 0, False: 908]
  ------------------
 2709|      2|			return (-1);
 2710|       |		/*
 2711|       |		 * Calculate packed stream positions.
 2712|       |		 */
 2713|    908|		packPos = si->pi.pos;
 2714|  2.27k|		for (i = 0; i < si->pi.numPackStreams; i++) {
  ------------------
  |  Branch (2714:15): [True: 1.40k, False: 869]
  ------------------
 2715|  1.40k|			si->pi.positions[i] = packPos;
 2716|  1.40k|			if (archive_ckd_add_i64(&packPos,
  ------------------
  |  Branch (2716:8): [True: 1, False: 1.40k]
  ------------------
 2717|  1.40k|			    packPos, si->pi.sizes[i]))
 2718|      1|				return (-1);
 2719|  1.40k|			if (packPos > zip->header_offset)
  ------------------
  |  Branch (2719:8): [True: 38, False: 1.36k]
  ------------------
 2720|     38|				return (-1);
 2721|  1.40k|		}
 2722|    869|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2722:7): [True: 1, False: 868]
  ------------------
 2723|      1|			return (-1);
 2724|    869|	}
 2725|    957|	if (*p == kUnPackInfo) {
  ------------------
  |  |  127|    957|#define kUnPackInfo		0x07
  ------------------
  |  Branch (2725:6): [True: 944, False: 13]
  ------------------
 2726|    944|		size_t packIndex;
 2727|    944|		struct _7z_folder *f;
 2728|       |
 2729|    944|		if (read_CodersInfo(a, &(si->ci)) < 0)
  ------------------
  |  Branch (2729:7): [True: 372, False: 572]
  ------------------
 2730|    372|			return (-1);
 2731|       |
 2732|       |		/*
 2733|       |		 * Calculate packed stream indexes.
 2734|       |		 */
 2735|    572|		packIndex = 0;
 2736|    572|		f = si->ci.folders;
 2737|  1.14k|		for (i = 0; i < si->ci.numFolders; i++) {
  ------------------
  |  Branch (2737:15): [True: 577, False: 569]
  ------------------
 2738|    577|			f[i].packIndex = packIndex;
 2739|    577|			if (archive_ckd_add_size(&packIndex,
  ------------------
  |  Branch (2739:8): [True: 0, False: 577]
  ------------------
 2740|    577|			    packIndex, f[i].numPackedStreams) ||
 2741|    577|			    packIndex > si->pi.numPackStreams)
  ------------------
  |  Branch (2741:8): [True: 3, False: 574]
  ------------------
 2742|      3|				return (-1);
 2743|    577|		}
 2744|    569|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2744:7): [True: 2, False: 567]
  ------------------
 2745|      2|			return (-1);
 2746|    569|	}
 2747|       |
 2748|    580|	if (*p == kSubStreamsInfo) {
  ------------------
  |  |  128|    580|#define kSubStreamsInfo		0x08
  ------------------
  |  Branch (2748:6): [True: 259, False: 321]
  ------------------
 2749|    259|		if (read_SubStreamsInfo(a, &(si->ss),
  ------------------
  |  Branch (2749:7): [True: 82, False: 177]
  ------------------
 2750|    259|		    si->ci.folders, si->ci.numFolders) < 0)
 2751|     82|			return (-1);
 2752|    177|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2752:7): [True: 2, False: 175]
  ------------------
 2753|      2|			return (-1);
 2754|    177|	}
 2755|       |
 2756|       |	/*
 2757|       |	 *  Must be kEnd.
 2758|       |	 */
 2759|    496|	if (*p != kEnd)
  ------------------
  |  |  120|    496|#define kEnd			0x00
  ------------------
  |  Branch (2759:6): [True: 2, False: 494]
  ------------------
 2760|      2|		return (-1);
 2761|    494|	return (0);
 2762|    496|}
archive_read_support_format_7zip.c:read_PackInfo:
 2176|  1.02k|{
 2177|  1.02k|	const unsigned char *p;
 2178|  1.02k|	size_t i;
 2179|       |
 2180|  1.02k|	memset(pi, 0, sizeof(*pi));
 2181|       |
 2182|       |	/*
 2183|       |	 * Read PackPos.
 2184|       |	 */
 2185|  1.02k|	if (parse_7zip_int64(a, &(pi->pos)) < 0)
  ------------------
  |  Branch (2185:6): [True: 7, False: 1.01k]
  ------------------
 2186|      7|		return (-1);
 2187|       |
 2188|       |	/*
 2189|       |	 * Read NumPackStreams.
 2190|       |	 */
 2191|  1.01k|	if (parse_7zip_size(a, &(pi->numPackStreams)) < 0)
  ------------------
  |  Branch (2191:6): [True: 18, False: 996]
  ------------------
 2192|     18|		return (-1);
 2193|    996|	if (pi->numPackStreams == 0)
  ------------------
  |  Branch (2193:6): [True: 1, False: 995]
  ------------------
 2194|      1|		return (-1);
 2195|       |
 2196|       |	/*
 2197|       |	 * Read PackSizes[num]
 2198|       |	 */
 2199|    995|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2199:6): [True: 2, False: 993]
  ------------------
 2200|      2|		return (-1);
 2201|    993|	if (*p == kEnd)
  ------------------
  |  |  120|    993|#define kEnd			0x00
  ------------------
  |  Branch (2201:6): [True: 2, False: 991]
  ------------------
 2202|       |		/* PackSizes[num] are not present. */
 2203|      2|		return (0);
 2204|    991|	if (*p != kSize)
  ------------------
  |  |  129|    991|#define kSize			0x09
  ------------------
  |  Branch (2204:6): [True: 7, False: 984]
  ------------------
 2205|      7|		return (-1);
 2206|    984|	pi->sizes = calloc(pi->numPackStreams, sizeof(int64_t));
 2207|    984|	pi->positions = calloc(pi->numPackStreams, sizeof(int64_t));
 2208|    984|	if (pi->sizes == NULL || pi->positions == NULL)
  ------------------
  |  Branch (2208:6): [True: 0, False: 984]
  |  Branch (2208:27): [True: 0, False: 984]
  ------------------
 2209|      0|		return (-1);
 2210|       |
 2211|  23.7k|	for (i = 0; i < pi->numPackStreams; i++) {
  ------------------
  |  Branch (2211:14): [True: 22.8k, False: 939]
  ------------------
 2212|  22.8k|		if (parse_7zip_int64(a, &(pi->sizes[i])) < 0)
  ------------------
  |  Branch (2212:7): [True: 45, False: 22.7k]
  ------------------
 2213|     45|			return (-1);
 2214|  22.8k|	}
 2215|       |
 2216|       |	/*
 2217|       |	 * Read PackStreamDigests[num]
 2218|       |	 */
 2219|    939|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2219:6): [True: 1, False: 938]
  ------------------
 2220|      1|		return (-1);
 2221|    938|	if (*p == kEnd) {
  ------------------
  |  |  120|    938|#define kEnd			0x00
  ------------------
  |  Branch (2221:6): [True: 903, False: 35]
  ------------------
 2222|       |		/* PackStreamDigests[num] are not present. */
 2223|    903|		pi->digest.defineds =
 2224|    903|		    calloc(pi->numPackStreams, sizeof(*pi->digest.defineds));
 2225|    903|		pi->digest.digests =
 2226|    903|		    calloc(pi->numPackStreams, sizeof(*pi->digest.digests));
 2227|    903|		if (pi->digest.defineds == NULL || pi->digest.digests == NULL)
  ------------------
  |  Branch (2227:7): [True: 0, False: 903]
  |  Branch (2227:38): [True: 0, False: 903]
  ------------------
 2228|      0|			return (-1);
 2229|    903|		return (0);
 2230|    903|	}
 2231|       |
 2232|     35|	if (*p != kCRC)
  ------------------
  |  |  130|     35|#define kCRC			0x0A
  ------------------
  |  Branch (2232:6): [True: 7, False: 28]
  ------------------
 2233|      7|		return (-1);
 2234|       |
 2235|     28|	if (read_Digests(a, &(pi->digest), pi->numPackStreams) < 0)
  ------------------
  |  Branch (2235:6): [True: 16, False: 12]
  ------------------
 2236|     16|		return (-1);
 2237|       |
 2238|       |	/*
 2239|       |	 *  Must be marked by kEnd.
 2240|       |	 */
 2241|     12|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2241:6): [True: 0, False: 12]
  ------------------
 2242|      0|		return (-1);
 2243|     12|	if (*p != kEnd)
  ------------------
  |  |  120|     12|#define kEnd			0x00
  ------------------
  |  Branch (2243:6): [True: 7, False: 5]
  ------------------
 2244|      7|		return (-1);
 2245|      5|	return (0);
 2246|     12|}
archive_read_support_format_7zip.c:parse_7zip_int64:
 2072|   358k|{
 2073|   358k|	uint64_t v;
 2074|   358k|	const unsigned char *p;
 2075|   358k|	unsigned char avail, mask;
 2076|   358k|	int i;
 2077|       |
 2078|   358k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2078:6): [True: 79, False: 358k]
  ------------------
 2079|     79|		return (-1);
 2080|   358k|	avail = *p;
 2081|   358k|	mask = 0x80;
 2082|   358k|	v = 0;
 2083|   378k|	for (i = 0; i < 8; i++) {
  ------------------
  |  Branch (2083:14): [True: 377k, False: 1.31k]
  ------------------
 2084|   377k|		if (avail & mask) {
  ------------------
  |  Branch (2084:7): [True: 20.3k, False: 357k]
  ------------------
 2085|  20.3k|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2085:8): [True: 64, False: 20.3k]
  ------------------
 2086|     64|				return (-1);
 2087|  20.3k|			v |= ((uint64_t)*p) << (8 * i);
 2088|  20.3k|			mask >>= 1;
 2089|  20.3k|			continue;
 2090|  20.3k|		}
 2091|   357k|		v += ((uint64_t)(avail & (mask - 1))) << (8 * i);
 2092|   357k|		break;
 2093|   377k|	}
 2094|   358k|	if (v > (uint64_t)INT64_MAX)
  ------------------
  |  Branch (2094:6): [True: 188, False: 358k]
  ------------------
 2095|    188|		return (-1);
 2096|   358k|	*val = (int64_t)v;
 2097|   358k|	return (0);
 2098|   358k|}
archive_read_support_format_7zip.c:parse_7zip_size:
 2060|   316k|{
 2061|   316k|	int64_t v;
 2062|       |
 2063|   316k|	if (parse_7zip_int64(a, &v) < 0 || v > UMAX_ENTRY)
  ------------------
  |  |  391|   316k|#define UMAX_ENTRY	ARCHIVE_LITERAL_LL(100000000)
  |  |  ------------------
  |  |  |  |  207|   316k|# define	ARCHIVE_LITERAL_LL(x)	x##ll
  |  |  ------------------
  ------------------
  |  Branch (2063:6): [True: 186, False: 316k]
  |  Branch (2063:37): [True: 137, False: 316k]
  ------------------
 2064|    323|		return (-1);
 2065|       |
 2066|   316k|	*val = (size_t)v;
 2067|   316k|	return (0);
 2068|   316k|}
archive_read_support_format_7zip.c:read_Digests:
 2129|    296|{
 2130|    296|	const unsigned char *p;
 2131|    296|	size_t i;
 2132|       |
 2133|    296|	if (num == 0)
  ------------------
  |  Branch (2133:6): [True: 3, False: 293]
  ------------------
 2134|      3|		return (-1);
 2135|    293|	memset(d, 0, sizeof(*d));
 2136|       |
 2137|    293|	d->defineds = malloc(num);
 2138|    293|	if (d->defineds == NULL)
  ------------------
  |  Branch (2138:6): [True: 0, False: 293]
  ------------------
 2139|      0|		return (-1);
 2140|       |	/*
 2141|       |	 * Read Bools.
 2142|       |	 */
 2143|    293|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2143:6): [True: 1, False: 292]
  ------------------
 2144|      1|		return (-1);
 2145|    292|	if (*p == 0) {
  ------------------
  |  Branch (2145:6): [True: 30, False: 262]
  ------------------
 2146|     30|		if (read_Bools(a, d->defineds, num) < 0)
  ------------------
  |  Branch (2146:7): [True: 3, False: 27]
  ------------------
 2147|      3|			return (-1);
 2148|     30|	} else
 2149|       |		/* All are defined */
 2150|    262|		memset(d->defineds, 1, num);
 2151|       |
 2152|    289|	d->digests = calloc(num, sizeof(*d->digests));
 2153|    289|	if (d->digests == NULL)
  ------------------
  |  Branch (2153:6): [True: 0, False: 289]
  ------------------
 2154|      0|		return (-1);
 2155|  1.51k|	for (i = 0; i < num; i++) {
  ------------------
  |  Branch (2155:14): [True: 1.24k, False: 272]
  ------------------
 2156|  1.24k|		if (d->defineds[i]) {
  ------------------
  |  Branch (2156:7): [True: 754, False: 486]
  ------------------
 2157|    754|			if ((p = header_bytes(a, 4)) == NULL)
  ------------------
  |  Branch (2157:8): [True: 17, False: 737]
  ------------------
 2158|     17|				return (-1);
 2159|    737|			d->digests[i] = archive_le32dec(p);
 2160|    737|		}
 2161|  1.24k|	}
 2162|       |
 2163|    272|	return (0);
 2164|    289|}
archive_read_support_format_7zip.c:read_Bools:
 2102|    587|{
 2103|    587|	const unsigned char *p;
 2104|    587|	size_t i;
 2105|    587|	unsigned mask = 0, avail = 0;
 2106|       |
 2107|  36.2k|	for (i = 0; i < num; i++) {
  ------------------
  |  Branch (2107:14): [True: 35.7k, False: 574]
  ------------------
 2108|  35.7k|		if (mask == 0) {
  ------------------
  |  Branch (2108:7): [True: 4.76k, False: 30.9k]
  ------------------
 2109|  4.76k|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2109:8): [True: 13, False: 4.75k]
  ------------------
 2110|     13|				return (-1);
 2111|  4.75k|			avail = *p;
 2112|  4.75k|			mask = 0x80;
 2113|  4.75k|		}
 2114|  35.6k|		data[i] = (avail & mask) ? 1 : 0;
  ------------------
  |  Branch (2114:13): [True: 19.4k, False: 16.2k]
  ------------------
 2115|  35.6k|		mask >>= 1;
 2116|  35.6k|	}
 2117|    574|	return (0);
 2118|    587|}
archive_read_support_format_7zip.c:read_CodersInfo:
 2411|    944|{
 2412|    944|	struct _7zip *zip = a->format->data;
 2413|    944|	const unsigned char *p;
 2414|    944|	struct _7z_digests digest;
 2415|    944|	size_t dataStreamIndex, i;
 2416|       |
 2417|    944|	memset(ci, 0, sizeof(*ci));
 2418|    944|	memset(&digest, 0, sizeof(digest));
 2419|       |
 2420|    944|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2420:6): [True: 0, False: 944]
  ------------------
 2421|      0|		goto failed;
 2422|    944|	if (*p != kFolder)
  ------------------
  |  |  131|    944|#define kFolder			0x0B
  ------------------
  |  Branch (2422:6): [True: 1, False: 943]
  ------------------
 2423|      1|		goto failed;
 2424|       |
 2425|       |	/*
 2426|       |	 * Read NumFolders.
 2427|       |	 */
 2428|    943|	if (parse_7zip_size(a, &(ci->numFolders)) < 0)
  ------------------
  |  Branch (2428:6): [True: 19, False: 924]
  ------------------
 2429|     19|		goto failed;
 2430|       |	/*
 2431|       |	 * Each folder is encoded by at least one byte in the coders
 2432|       |	 * list that follows, so a folder count larger than the bytes
 2433|       |	 * left in the header cannot be honored and is rejected here
 2434|       |	 * before it is used to size the folders allocation.
 2435|       |	 */
 2436|    924|	if (ci->numFolders > (uint64_t)zip->header_bytes_remaining)
  ------------------
  |  Branch (2436:6): [True: 1, False: 923]
  ------------------
 2437|      1|		goto failed;
 2438|       |
 2439|       |	/*
 2440|       |	 * Read External.
 2441|       |	 */
 2442|    923|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2442:6): [True: 0, False: 923]
  ------------------
 2443|      0|		goto failed;
 2444|    923|	switch (*p) {
 2445|    910|	case 0:
  ------------------
  |  Branch (2445:2): [True: 910, False: 13]
  ------------------
 2446|    910|		ci->folders =
 2447|    910|			calloc(ci->numFolders, sizeof(*ci->folders));
 2448|    910|		if (ci->folders == NULL)
  ------------------
  |  Branch (2448:7): [True: 0, False: 910]
  ------------------
 2449|      0|			return (-1);
 2450|  2.78k|		for (i = 0; i < ci->numFolders; i++) {
  ------------------
  |  Branch (2450:15): [True: 2.16k, False: 618]
  ------------------
 2451|  2.16k|			if (read_Folder(a, &(ci->folders[i])) < 0)
  ------------------
  |  Branch (2451:8): [True: 292, False: 1.87k]
  ------------------
 2452|    292|				goto failed;
 2453|  2.16k|		}
 2454|    618|		break;
 2455|    618|	case 1:
  ------------------
  |  Branch (2455:2): [True: 11, False: 912]
  ------------------
 2456|     11|		if (parse_7zip_size(a, &dataStreamIndex) < 0)
  ------------------
  |  Branch (2456:7): [True: 4, False: 7]
  ------------------
 2457|      4|			return (-1);
 2458|      7|		if (ci->numFolders > 0) {
  ------------------
  |  Branch (2458:7): [True: 2, False: 5]
  ------------------
 2459|      2|			archive_set_error(&a->archive, -1,
 2460|      2|			    "Malformed 7-Zip archive");
 2461|      2|			goto failed;
 2462|      2|		}
 2463|      5|		break;
 2464|      5|	default:
  ------------------
  |  Branch (2464:2): [True: 2, False: 921]
  ------------------
 2465|      2|		archive_set_error(&a->archive, -1,
 2466|      2|		    "Malformed 7-Zip archive");
 2467|      2|		goto failed;
 2468|    923|	}
 2469|       |
 2470|    623|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2470:6): [True: 1, False: 622]
  ------------------
 2471|      1|		goto failed;
 2472|    622|	if (*p != kCodersUnPackSize)
  ------------------
  |  |  132|    622|#define kCodersUnPackSize	0x0C
  ------------------
  |  Branch (2472:6): [True: 18, False: 604]
  ------------------
 2473|     18|		goto failed;
 2474|       |
 2475|  1.27k|	for (i = 0; i < ci->numFolders; i++) {
  ------------------
  |  Branch (2475:14): [True: 691, False: 580]
  ------------------
 2476|    691|		struct _7z_folder *folder = &(ci->folders[i]);
 2477|    691|		size_t j;
 2478|       |
 2479|    691|		folder->unPackSize =
 2480|    691|		    calloc(folder->numOutStreams, sizeof(*folder->unPackSize));
 2481|    691|		if (folder->unPackSize == NULL)
  ------------------
  |  Branch (2481:7): [True: 0, False: 691]
  ------------------
 2482|      0|			goto failed;
 2483|  2.15k|		for (j = 0; j < folder->numOutStreams; j++) {
  ------------------
  |  Branch (2483:15): [True: 1.49k, False: 667]
  ------------------
 2484|  1.49k|			if (parse_7zip_int64(a, &(folder->unPackSize[j])) < 0)
  ------------------
  |  Branch (2484:8): [True: 24, False: 1.46k]
  ------------------
 2485|     24|				goto failed;
 2486|  1.49k|		}
 2487|    691|	}
 2488|       |
 2489|       |	/*
 2490|       |	 * Read CRCs.
 2491|       |	 */
 2492|    580|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2492:6): [True: 1, False: 579]
  ------------------
 2493|      1|		goto failed;
 2494|    579|	if (*p == kEnd)
  ------------------
  |  |  120|    579|#define kEnd			0x00
  ------------------
  |  Branch (2494:6): [True: 469, False: 110]
  ------------------
 2495|    469|		return (0);
 2496|    110|	if (*p != kCRC)
  ------------------
  |  |  130|    110|#define kCRC			0x0A
  ------------------
  |  Branch (2496:6): [True: 2, False: 108]
  ------------------
 2497|      2|		goto failed;
 2498|    108|	if (read_Digests(a, &digest, ci->numFolders) < 0)
  ------------------
  |  Branch (2498:6): [True: 3, False: 105]
  ------------------
 2499|      3|		goto failed;
 2500|    219|	for (i = 0; i < ci->numFolders; i++) {
  ------------------
  |  Branch (2500:14): [True: 114, False: 105]
  ------------------
 2501|    114|		ci->folders[i].digest_defined = digest.defineds[i];
 2502|    114|		ci->folders[i].digest = digest.digests[i];
 2503|    114|	}
 2504|       |
 2505|       |	/*
 2506|       |	 *  Must be kEnd.
 2507|       |	 */
 2508|    105|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2508:6): [True: 1, False: 104]
  ------------------
 2509|      1|		goto failed;
 2510|    104|	if (*p != kEnd)
  ------------------
  |  |  120|    104|#define kEnd			0x00
  ------------------
  |  Branch (2510:6): [True: 1, False: 103]
  ------------------
 2511|      1|		goto failed;
 2512|    103|	free_Digest(&digest);
 2513|    103|	return (0);
 2514|    368|failed:
 2515|    368|	free_Digest(&digest);
 2516|    368|	return (-1);
 2517|    104|}
archive_read_support_format_7zip.c:read_Folder:
 2265|  2.16k|{
 2266|  2.16k|	struct _7zip *zip = a->format->data;
 2267|  2.16k|	const unsigned char *p;
 2268|  2.16k|	size_t numInStreamsTotal = 0;
 2269|  2.16k|	size_t numOutStreamsTotal = 0;
 2270|  2.16k|	size_t i;
 2271|       |
 2272|  2.16k|	memset(f, 0, sizeof(*f));
 2273|       |
 2274|       |	/*
 2275|       |	 * Read NumCoders.
 2276|       |	 */
 2277|  2.16k|	if (parse_7zip_size(a, &(f->numCoders)) < 0)
  ------------------
  |  Branch (2277:6): [True: 25, False: 2.14k]
  ------------------
 2278|     25|		return (-1);
 2279|  2.14k|	if (f->numCoders > 4)
  ------------------
  |  Branch (2279:6): [True: 13, False: 2.13k]
  ------------------
 2280|       |		/* Too many coders. */
 2281|     13|		return (-1);
 2282|       |
 2283|  2.13k|	f->coders = calloc(f->numCoders, sizeof(*f->coders));
 2284|  2.13k|	if (f->coders == NULL)
  ------------------
  |  Branch (2284:6): [True: 0, False: 2.13k]
  ------------------
 2285|      0|		return (-1);
 2286|  5.72k|	for (i = 0; i< f->numCoders; i++) {
  ------------------
  |  Branch (2286:14): [True: 3.67k, False: 2.04k]
  ------------------
 2287|  3.67k|		size_t codec_size;
 2288|  3.67k|		int simple, attr;
 2289|       |
 2290|  3.67k|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2290:7): [True: 4, False: 3.67k]
  ------------------
 2291|      4|			return (-1);
 2292|       |		/*
 2293|       |		 * 0:3 CodecIdSize
 2294|       |		 * 4:  0 - IsSimple
 2295|       |		 *     1 - Is not Simple
 2296|       |		 * 5:  0 - No Attributes
 2297|       |		 *     1 - There are Attributes;
 2298|       |		 * 7:  Must be zero.
 2299|       |		 */
 2300|  3.67k|		codec_size = *p & 0xf;
 2301|  3.67k|		simple = (*p & 0x10) ? 0 : 1;
  ------------------
  |  Branch (2301:12): [True: 503, False: 3.16k]
  ------------------
 2302|  3.67k|		attr = *p & 0x20;
 2303|  3.67k|		if (*p & 0x80)
  ------------------
  |  Branch (2303:7): [True: 5, False: 3.66k]
  ------------------
 2304|      5|			return (-1);/* Not supported. */
 2305|       |
 2306|       |		/*
 2307|       |		 * Read Decompression Method IDs.
 2308|       |		 */
 2309|  3.66k|		if ((p = header_bytes(a, codec_size)) == NULL)
  ------------------
  |  Branch (2309:7): [True: 6, False: 3.66k]
  ------------------
 2310|      6|			return (-1);
 2311|       |
 2312|  3.66k|		if (decode_codec_id(p, codec_size, &f->coders[i].codec) < 0)
  ------------------
  |  Branch (2312:7): [True: 16, False: 3.64k]
  ------------------
 2313|     16|			return (-1);
 2314|       |
 2315|  3.64k|		if (simple) {
  ------------------
  |  Branch (2315:7): [True: 3.15k, False: 487]
  ------------------
 2316|  3.15k|			f->coders[i].numInStreams = 1;
 2317|  3.15k|			f->coders[i].numOutStreams = 1;
 2318|  3.15k|		} else {
 2319|    487|			if (parse_7zip_size(
  ------------------
  |  Branch (2319:8): [True: 13, False: 474]
  ------------------
 2320|    487|			    a, &(f->coders[i].numInStreams)) < 0)
 2321|     13|				return (-1);
 2322|    474|			if (parse_7zip_size(
  ------------------
  |  Branch (2322:8): [True: 27, False: 447]
  ------------------
 2323|    474|			    a, &(f->coders[i].numOutStreams)) < 0)
 2324|     27|				return (-1);
 2325|    474|		}
 2326|       |
 2327|  3.60k|		if (attr) {
  ------------------
  |  Branch (2327:7): [True: 791, False: 2.81k]
  ------------------
 2328|    791|			if (parse_7zip_size(
  ------------------
  |  Branch (2328:8): [True: 10, False: 781]
  ------------------
 2329|    791|			    a, &(f->coders[i].propertiesSize)) < 0)
 2330|     10|				return (-1);
 2331|    781|			if ((p = header_bytes(
  ------------------
  |  Branch (2331:8): [True: 6, False: 775]
  ------------------
 2332|    781|			    a, f->coders[i].propertiesSize)) == NULL)
 2333|      6|				return (-1);
 2334|    775|			f->coders[i].properties =
 2335|    775|			    malloc(f->coders[i].propertiesSize);
 2336|    775|			if (f->coders[i].properties == NULL)
  ------------------
  |  Branch (2336:8): [True: 0, False: 775]
  ------------------
 2337|      0|				return (-1);
 2338|    775|			memcpy(f->coders[i].properties, p,
 2339|    775|			    f->coders[i].propertiesSize);
 2340|    775|		}
 2341|       |
 2342|  3.58k|		if (archive_ckd_add_size(&numInStreamsTotal,
  ------------------
  |  Branch (2342:7): [True: 0, False: 3.58k]
  ------------------
 2343|  3.58k|		    numInStreamsTotal, f->coders[i].numInStreams) ||
 2344|  3.58k|		    archive_ckd_add_size(&numOutStreamsTotal,
  ------------------
  |  Branch (2344:7): [True: 0, False: 3.58k]
  ------------------
 2345|  3.58k|		    numOutStreamsTotal, f->coders[i].numOutStreams))
 2346|      0|			return (-1);
 2347|  3.58k|	}
 2348|       |
 2349|  2.04k|	if (numOutStreamsTotal == 0 ||
  ------------------
  |  Branch (2349:6): [True: 10, False: 2.03k]
  ------------------
 2350|  2.03k|	    numInStreamsTotal < numOutStreamsTotal-1)
  ------------------
  |  Branch (2350:6): [True: 5, False: 2.02k]
  ------------------
 2351|     15|		return (-1);
 2352|       |
 2353|  2.02k|	f->numBindPairs = numOutStreamsTotal - 1;
 2354|  2.02k|	if ((uint64_t)zip->header_bytes_remaining < f->numBindPairs)
  ------------------
  |  Branch (2354:6): [True: 2, False: 2.02k]
  ------------------
 2355|      2|			return (-1);
 2356|  2.02k|	if (f->numBindPairs > 0) {
  ------------------
  |  Branch (2356:6): [True: 945, False: 1.08k]
  ------------------
 2357|    945|		f->bindPairs =
 2358|    945|			calloc(f->numBindPairs, sizeof(*f->bindPairs));
 2359|    945|		if (f->bindPairs == NULL)
  ------------------
  |  Branch (2359:7): [True: 0, False: 945]
  ------------------
 2360|      0|			return (-1);
 2361|    945|	} else
 2362|  1.08k|		f->bindPairs = NULL;
 2363|  8.11k|	for (i = 0; i < f->numBindPairs; i++) {
  ------------------
  |  Branch (2363:14): [True: 6.18k, False: 1.93k]
  ------------------
 2364|  6.18k|		if (parse_7zip_size(a, &(f->bindPairs[i].inIndex)) < 0)
  ------------------
  |  Branch (2364:7): [True: 51, False: 6.13k]
  ------------------
 2365|     51|			return (-1);
 2366|  6.13k|		if (parse_7zip_size(a, &(f->bindPairs[i].outIndex)) < 0)
  ------------------
  |  Branch (2366:7): [True: 44, False: 6.09k]
  ------------------
 2367|     44|			return (-1);
 2368|  6.13k|	}
 2369|       |
 2370|  1.93k|	f->numPackedStreams = numInStreamsTotal - f->numBindPairs;
 2371|       |	/* packedStreams are not needed; parse/verify nonetheless */
 2372|  1.93k|	if (f->numPackedStreams == 1) {
  ------------------
  |  Branch (2372:6): [True: 1.66k, False: 268]
  ------------------
 2373|  1.76k|		for (i = 0; i < numInStreamsTotal; i++) {
  ------------------
  |  Branch (2373:15): [True: 1.76k, False: 0]
  ------------------
 2374|  1.76k|			size_t j;
 2375|  4.78k|			for (j = 0; j < f->numBindPairs; j++) {
  ------------------
  |  Branch (2375:16): [True: 3.12k, False: 1.66k]
  ------------------
 2376|  3.12k|				if (f->bindPairs[j].inIndex == i)
  ------------------
  |  Branch (2376:9): [True: 104, False: 3.01k]
  ------------------
 2377|    104|					break;
 2378|  3.12k|			}
 2379|  1.76k|			if (j == f->numBindPairs)
  ------------------
  |  Branch (2379:8): [True: 1.66k, False: 104]
  ------------------
 2380|  1.66k|				break;
 2381|  1.76k|		}
 2382|  1.66k|		if (i == numInStreamsTotal)
  ------------------
  |  Branch (2382:7): [True: 0, False: 1.66k]
  ------------------
 2383|      0|			return (-1);
 2384|  1.66k|	} else {
 2385|   296k|		for (i = 0; i < f->numPackedStreams; i++) {
  ------------------
  |  Branch (2385:15): [True: 296k, False: 213]
  ------------------
 2386|   296k|			size_t packedStream;
 2387|   296k|			if (parse_7zip_size(a, &packedStream) < 0)
  ------------------
  |  Branch (2387:8): [True: 55, False: 296k]
  ------------------
 2388|     55|				return (-1);
 2389|   296k|		}
 2390|    268|	}
 2391|  1.87k|	f->numInStreams = numInStreamsTotal;
 2392|  1.87k|	f->numOutStreams = numOutStreamsTotal;
 2393|       |
 2394|  1.87k|	return (0);
 2395|  1.93k|}
archive_read_support_format_7zip.c:decode_codec_id:
 1278|  3.66k|{
 1279|  3.66k|	size_t i;
 1280|       |
 1281|  3.66k|	*id = 0;
 1282|  12.4k|	for (i = 0; i < id_size; i++) {
  ------------------
  |  Branch (1282:14): [True: 8.81k, False: 3.64k]
  ------------------
 1283|  8.81k|		if (archive_ckd_mul_i64(id, *id, 256) ||
  ------------------
  |  Branch (1283:7): [True: 16, False: 8.79k]
  ------------------
 1284|  8.79k|		    archive_ckd_add_i64(id, *id, codecId[i]))
  ------------------
  |  Branch (1284:7): [True: 0, False: 8.79k]
  ------------------
 1285|     16|			return (-1);
 1286|  8.81k|	}
 1287|  3.64k|	return (0);
 1288|  3.66k|}
archive_read_support_format_7zip.c:free_Digest:
 2122|  17.7k|{
 2123|  17.7k|	free(d->defineds);
 2124|  17.7k|	free(d->digests);
 2125|  17.7k|}
archive_read_support_format_7zip.c:read_SubStreamsInfo:
 2548|    259|{
 2549|    259|	const unsigned char *p;
 2550|    259|	int64_t *usizes;
 2551|    259|	size_t numDigests;
 2552|    259|	size_t unpack_streams;
 2553|    259|	size_t i;
 2554|    259|	int type;
 2555|       |
 2556|    259|	memset(ss, 0, sizeof(*ss));
 2557|       |
 2558|    515|	for (i = 0; i < numFolders; i++)
  ------------------
  |  Branch (2558:14): [True: 256, False: 259]
  ------------------
 2559|    256|		f[i].numUnpackStreams = 1;
 2560|       |
 2561|    259|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2561:6): [True: 1, False: 258]
  ------------------
 2562|      1|		return (-1);
 2563|    258|	type = *p;
 2564|       |
 2565|    258|	if (type == kNumUnPackStream) {
  ------------------
  |  |  133|    258|#define kNumUnPackStream	0x0D
  ------------------
  |  Branch (2565:6): [True: 141, False: 117]
  ------------------
 2566|    141|		unpack_streams = 0;
 2567|    272|		for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2567:15): [True: 138, False: 134]
  ------------------
 2568|    138|			if (parse_7zip_size(a, &(f[i].numUnpackStreams)) < 0)
  ------------------
  |  Branch (2568:8): [True: 7, False: 131]
  ------------------
 2569|      7|				return (-1);
 2570|    131|			if (archive_ckd_add_size(&unpack_streams,
  ------------------
  |  Branch (2570:8): [True: 0, False: 131]
  ------------------
 2571|    131|			    unpack_streams, f[i].numUnpackStreams))
 2572|      0|				return (-1);
 2573|    131|		}
 2574|    134|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2574:7): [True: 2, False: 132]
  ------------------
 2575|      2|			return (-1);
 2576|    132|		type = *p;
 2577|    132|	} else
 2578|    117|		unpack_streams = numFolders;
 2579|       |
 2580|    249|	if (unpack_streams > UMAX_ENTRY)
  ------------------
  |  |  391|    249|#define UMAX_ENTRY	ARCHIVE_LITERAL_LL(100000000)
  |  |  ------------------
  |  |  |  |  207|    249|# define	ARCHIVE_LITERAL_LL(x)	x##ll
  |  |  ------------------
  ------------------
  |  Branch (2580:6): [True: 0, False: 249]
  ------------------
 2581|      0|		return (-1);
 2582|       |
 2583|    249|	if (type != kSize) {
  ------------------
  |  |  129|    249|#define kSize			0x09
  ------------------
  |  Branch (2583:6): [True: 127, False: 122]
  ------------------
 2584|    247|		for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2584:15): [True: 127, False: 120]
  ------------------
 2585|    127|			if (f[i].numUnpackStreams > 1)
  ------------------
  |  Branch (2585:8): [True: 7, False: 120]
  ------------------
 2586|      7|				return (-1);
 2587|    127|		}
 2588|    127|	}
 2589|       |
 2590|    242|	ss->unpack_streams = unpack_streams;
 2591|    242|	if (unpack_streams) {
  ------------------
  |  Branch (2591:6): [True: 229, False: 13]
  ------------------
 2592|    229|		ss->unpackSizes = calloc(unpack_streams,
 2593|    229|		    sizeof(*ss->unpackSizes));
 2594|    229|		ss->digestsDefined = calloc(unpack_streams,
 2595|    229|		    sizeof(*ss->digestsDefined));
 2596|    229|		ss->digests = calloc(unpack_streams,
 2597|    229|		    sizeof(*ss->digests));
 2598|    229|		if (ss->unpackSizes == NULL || ss->digestsDefined == NULL ||
  ------------------
  |  Branch (2598:7): [True: 0, False: 229]
  |  Branch (2598:34): [True: 0, False: 229]
  ------------------
 2599|    229|		    ss->digests == NULL)
  ------------------
  |  Branch (2599:7): [True: 0, False: 229]
  ------------------
 2600|      0|			return (-1);
 2601|    229|	}
 2602|       |
 2603|    242|	usizes = ss->unpackSizes;
 2604|    445|	for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2604:14): [True: 240, False: 205]
  ------------------
 2605|    240|		int64_t size, sum;
 2606|    240|		size_t pack;
 2607|       |
 2608|    240|		if (f[i].numUnpackStreams == 0)
  ------------------
  |  Branch (2608:7): [True: 8, False: 232]
  ------------------
 2609|      8|			continue;
 2610|       |
 2611|    232|		sum = 0;
 2612|    232|		if (type == kSize) {
  ------------------
  |  |  129|    232|#define kSize			0x09
  ------------------
  |  Branch (2612:7): [True: 116, False: 116]
  ------------------
 2613|  11.2k|			for (pack = 1; pack < f[i].numUnpackStreams; pack++) {
  ------------------
  |  Branch (2613:19): [True: 11.1k, False: 86]
  ------------------
 2614|  11.1k|				if (parse_7zip_int64(a, usizes) < 0)
  ------------------
  |  Branch (2614:9): [True: 25, False: 11.1k]
  ------------------
 2615|     25|					return (-1);
 2616|  11.1k|				if (archive_ckd_add_i64(&sum, sum, *usizes++))
  ------------------
  |  Branch (2616:9): [True: 5, False: 11.1k]
  ------------------
 2617|      5|					return (-1);
 2618|  11.1k|			}
 2619|    116|		}
 2620|    202|		size = folder_uncompressed_size(&f[i]);
 2621|    202|		if (size < sum)
  ------------------
  |  Branch (2621:7): [True: 7, False: 195]
  ------------------
 2622|      7|			return (-1);
 2623|    195|		*usizes++ = size - sum;
 2624|    195|	}
 2625|       |
 2626|    205|	if (type == kSize) {
  ------------------
  |  |  129|    205|#define kSize			0x09
  ------------------
  |  Branch (2626:6): [True: 85, False: 120]
  ------------------
 2627|     85|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2627:7): [True: 5, False: 80]
  ------------------
 2628|      5|			return (-1);
 2629|     80|		type = *p;
 2630|     80|	}
 2631|       |
 2632|    200|	numDigests = 0;
 2633|    398|	for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2633:14): [True: 198, False: 200]
  ------------------
 2634|    198|		if (f[i].numUnpackStreams != 1 || !f[i].digest_defined)
  ------------------
  |  Branch (2634:7): [True: 80, False: 118]
  |  Branch (2634:37): [True: 117, False: 1]
  ------------------
 2635|    197|			if (archive_ckd_add_size(&numDigests,
  ------------------
  |  Branch (2635:8): [True: 0, False: 197]
  ------------------
 2636|    197|			    numDigests, f[i].numUnpackStreams)) {
 2637|      0|				errno = ENOMEM;
 2638|      0|				return (-1);
 2639|      0|			}
 2640|    198|	}
 2641|       |
 2642|    200|	if (type == kCRC) {
  ------------------
  |  |  130|    200|#define kCRC			0x0A
  ------------------
  |  Branch (2642:6): [True: 160, False: 40]
  ------------------
 2643|    160|		struct _7z_digests tmpDigests;
 2644|    160|		unsigned char *digestsDefined = ss->digestsDefined;
 2645|    160|		uint32_t *digests = ss->digests;
 2646|    160|		size_t di = 0;
 2647|       |
 2648|    160|		memset(&tmpDigests, 0, sizeof(tmpDigests));
 2649|    160|		if (read_Digests(a, &(tmpDigests), numDigests) < 0) {
  ------------------
  |  Branch (2649:7): [True: 5, False: 155]
  ------------------
 2650|      5|			free_Digest(&tmpDigests);
 2651|      5|			return (-1);
 2652|      5|		}
 2653|    313|		for (i = 0; i < numFolders; i++) {
  ------------------
  |  Branch (2653:15): [True: 158, False: 155]
  ------------------
 2654|    158|			if (f[i].numUnpackStreams == 1 && f[i].digest_defined) {
  ------------------
  |  Branch (2654:8): [True: 99, False: 59]
  |  Branch (2654:38): [True: 0, False: 99]
  ------------------
 2655|      0|				*digestsDefined++ = 1;
 2656|      0|				*digests++ = f[i].digest;
 2657|    158|			} else {
 2658|    158|				size_t j;
 2659|       |
 2660|    451|				for (j = 0; j < f[i].numUnpackStreams;
  ------------------
  |  Branch (2660:17): [True: 293, False: 158]
  ------------------
 2661|    293|				    j++, di++) {
 2662|    293|					*digestsDefined++ =
 2663|    293|					    tmpDigests.defineds[di];
 2664|    293|					*digests++ =
 2665|    293|					    tmpDigests.digests[di];
 2666|    293|				}
 2667|    158|			}
 2668|    158|		}
 2669|    155|		free_Digest(&tmpDigests);
 2670|    155|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2670:7): [True: 2, False: 153]
  ------------------
 2671|      2|			return (-1);
 2672|    153|		type = *p;
 2673|    153|	}
 2674|       |
 2675|       |	/*
 2676|       |	 *  Must be kEnd.
 2677|       |	 */
 2678|    193|	if (type != kEnd)
  ------------------
  |  |  120|    193|#define kEnd			0x00
  ------------------
  |  Branch (2678:6): [True: 16, False: 177]
  ------------------
 2679|     16|		return (-1);
 2680|    177|	return (0);
 2681|    193|}
archive_read_support_format_7zip.c:folder_uncompressed_size:
 2521|    628|{
 2522|    628|	size_t n = f->numOutStreams;
 2523|    628|	size_t pairs = f->numBindPairs;
 2524|       |
 2525|    737|	while (n-- > 0) {
  ------------------
  |  Branch (2525:9): [True: 737, False: 0]
  ------------------
 2526|    737|		size_t i;
 2527|  2.98k|		for (i = 0; i < pairs; i++) {
  ------------------
  |  Branch (2527:15): [True: 2.35k, False: 628]
  ------------------
 2528|  2.35k|			if (f->bindPairs[i].outIndex == n)
  ------------------
  |  Branch (2528:8): [True: 109, False: 2.24k]
  ------------------
 2529|    109|				break;
 2530|  2.35k|		}
 2531|    737|		if (i >= pairs)
  ------------------
  |  Branch (2531:7): [True: 628, False: 109]
  ------------------
 2532|    628|			return (f->unPackSize[n]);
 2533|    737|	}
 2534|      0|	return (0);
 2535|    628|}
archive_read_support_format_7zip.c:read_consume:
 1209|   417k|{
 1210|   417k|	struct _7zip *zip = a->format->data;
 1211|       |
 1212|   417k|	if (zip->pack_stream_bytes_unconsumed) {
  ------------------
  |  Branch (1212:6): [True: 417k, False: 0]
  ------------------
 1213|   417k|		int64_t r;
 1214|       |
 1215|   417k|		if ((r = __archive_read_consume(a,
  ------------------
  |  Branch (1215:7): [True: 0, False: 417k]
  ------------------
 1216|   417k|		    zip->pack_stream_bytes_unconsumed)) < 0)
 1217|      0|			return ((int)r);
 1218|       |
 1219|   417k|		zip->stream_offset += zip->pack_stream_bytes_unconsumed;
 1220|   417k|		zip->pack_stream_bytes_unconsumed = 0;
 1221|   417k|	}
 1222|       |
 1223|   417k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|   417k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1224|   417k|}
archive_read_support_format_7zip.c:setup_decode_folder:
 3838|    409|{
 3839|    409|	struct _7zip *zip = a->format->data;
 3840|    409|	const struct _7z_coder *coder1, *coder2;
 3841|    409|	const char *cname = (header)?"archive header":"file content";
  ------------------
  |  Branch (3841:22): [True: 316, False: 93]
  ------------------
 3842|    409|	size_t i;
 3843|    409|	int r, found_bcj2 = 0;
 3844|       |
 3845|       |	/*
 3846|       |	 * Release the memory which the previous folder used for BCJ2.
 3847|       |	 */
 3848|  1.63k|	for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (3848:14): [True: 1.22k, False: 409]
  ------------------
 3849|  1.22k|		free(zip->sub_stream_buff[i]);
 3850|  1.22k|		zip->sub_stream_buff[i] = NULL;
 3851|  1.22k|	}
 3852|       |
 3853|       |	/*
 3854|       |	 * Check coder types before modifying any stream-reader state, so that
 3855|       |	 * an early return leaves zip unchanged (avoids partially-initialized
 3856|       |	 * state that callers would have to reason about).
 3857|       |	 */
 3858|    996|	for (i = 0; i < folder->numCoders; i++) {
  ------------------
  |  Branch (3858:14): [True: 587, False: 409]
  ------------------
 3859|    587|		switch(folder->coders[i].codec) {
  ------------------
  |  Branch (3859:10): [True: 20, False: 567]
  ------------------
 3860|      0|			case _7Z_CRYPTO_MAIN_ZIP:
  ------------------
  |  |  100|      0|#define _7Z_CRYPTO_MAIN_ZIP		0x06F10101 /* Main Zip crypto algo */
  ------------------
  |  Branch (3860:4): [True: 0, False: 587]
  ------------------
 3861|      0|			case _7Z_CRYPTO_RAR_29:
  ------------------
  |  |  101|      0|#define _7Z_CRYPTO_RAR_29		0x06F10303 /* Rar29 AES-128 + (modified SHA-1) */
  ------------------
  |  Branch (3861:4): [True: 0, False: 587]
  ------------------
 3862|      0|			case _7Z_CRYPTO_AES_256_SHA_256: {
  ------------------
  |  |  102|      0|#define _7Z_CRYPTO_AES_256_SHA_256	0x06F10701 /* AES-256 + SHA-256 */
  ------------------
  |  Branch (3862:4): [True: 0, False: 587]
  ------------------
 3863|       |				/* For entry that is associated with this folder, mark
 3864|       |				   it as encrypted (data+metadata). */
 3865|      0|				zip->has_encrypted_entries = 1;
 3866|      0|				if (a->entry) {
  ------------------
  |  Branch (3866:9): [True: 0, False: 0]
  ------------------
 3867|      0|					archive_entry_set_is_data_encrypted(a->entry, 1);
 3868|      0|					archive_entry_set_is_metadata_encrypted(a->entry, 1);
 3869|      0|				}
 3870|      0|				archive_set_error(&(a->archive),
 3871|      0|					ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3872|      0|					"The %s is encrypted, "
 3873|      0|					"but currently not supported", cname);
 3874|      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 (3874:13): [True: 0, False: 0]
  ------------------
 3875|      0|			}
 3876|     20|			case _7Z_X86_BCJ2: {
  ------------------
  |  |  106|     20|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (3876:4): [True: 20, False: 567]
  ------------------
 3877|     20|				found_bcj2++;
 3878|     20|				break;
 3879|      0|			}
 3880|    587|		}
 3881|    587|	}
 3882|       |	/* Now that we've checked for encryption, if there were still no
 3883|       |	 * encrypted entries found we can say for sure that there are none.
 3884|       |	 */
 3885|    409|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|    409|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (3885:6): [True: 0, False: 409]
  ------------------
 3886|      0|		zip->has_encrypted_entries = 0;
 3887|      0|	}
 3888|       |
 3889|    409|	if ((folder->numCoders > 2 && !found_bcj2) || found_bcj2 > 1) {
  ------------------
  |  Branch (3889:7): [True: 19, False: 390]
  |  Branch (3889:32): [True: 0, False: 19]
  |  Branch (3889:48): [True: 0, False: 409]
  ------------------
 3890|      0|		archive_set_error(&(a->archive),
 3891|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3892|      0|		    "The %s is encoded with many filters, "
 3893|      0|		    "but currently not supported", cname);
 3894|      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 (3894:11): [True: 0, False: 0]
  ------------------
 3895|      0|	}
 3896|       |
 3897|       |	/*
 3898|       |	 * Initialize a stream reader.
 3899|       |	 */
 3900|    409|	zip->pack_stream_remaining = folder->numPackedStreams;
 3901|    409|	zip->pack_stream_index = folder->packIndex;
 3902|    409|	zip->folder_outbytes_remaining = folder_uncompressed_size(folder);
 3903|    409|	zip->uncompressed_buffer_bytes_remaining = 0;
 3904|    409|	coder1 = &(folder->coders[0]);
 3905|    409|	if (folder->numCoders == 2)
  ------------------
  |  Branch (3905:6): [True: 121, False: 288]
  ------------------
 3906|    121|		coder2 = &(folder->coders[1]);
 3907|    288|	else
 3908|    288|		coder2 = NULL;
 3909|       |
 3910|    409|	if (found_bcj2) {
  ------------------
  |  Branch (3910:6): [True: 20, False: 389]
  ------------------
 3911|       |		/*
 3912|       |		 * Preparation to decode BCJ2.
 3913|       |		 * Decoding BCJ2 requires four sources. Those are at least,
 3914|       |		 * as far as I know, two types of the storage form.
 3915|       |		 */
 3916|     20|		const struct _7z_coder *fc = folder->coders;
 3917|     20|		static const struct _7z_coder coder_copy = {0, 1, 1, 0, NULL};
 3918|     20|		const struct _7z_coder *scoder[3] =
 3919|     20|			{&coder_copy, &coder_copy, &coder_copy};
 3920|     20|		const void *buff;
 3921|     20|		ssize_t bytes;
 3922|     20|		unsigned char *b[3] = {NULL, NULL, NULL};
 3923|     20|		int64_t sunpack[3] ={-1, -1, -1};
 3924|     20|		int64_t remaining;
 3925|     20|		size_t s[3] = {0, 0, 0};
 3926|     20|		int idx[3] = {0, 1, 2};
 3927|       |
 3928|     20|		if (folder->numCoders == 4 && fc[3].codec == _7Z_X86_BCJ2 &&
  ------------------
  |  |  106|     39|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (3928:7): [True: 19, False: 1]
  |  Branch (3928:33): [True: 19, False: 0]
  ------------------
 3929|     19|		    folder->numInStreams == 7 && folder->numOutStreams == 4 &&
  ------------------
  |  Branch (3929:7): [True: 19, False: 0]
  |  Branch (3929:36): [True: 19, False: 0]
  ------------------
 3930|     19|		    zip->pack_stream_remaining == 4) {
  ------------------
  |  Branch (3930:7): [True: 19, False: 0]
  ------------------
 3931|       |			/* Source type 1 made by 7zr or 7z with -m options. */
 3932|     19|			if (folder->bindPairs[0].inIndex == 5) {
  ------------------
  |  Branch (3932:8): [True: 19, False: 0]
  ------------------
 3933|       |				/* The form made by 7zr */
 3934|     19|				idx[0] = 1; idx[1] = 2; idx[2] = 0;
 3935|     19|				scoder[1] = &(fc[1]);
 3936|     19|				scoder[2] = &(fc[0]);
 3937|     19|				sunpack[1] = folder->unPackSize[1];
 3938|     19|				sunpack[2] = folder->unPackSize[0];
 3939|     19|				coder1 = &(fc[2]);
 3940|     19|			} else {
 3941|       |				/*
 3942|       |				 * NOTE: Some patterns do not work.
 3943|       |				 * work:
 3944|       |				 *  7z a -m0=BCJ2 -m1=COPY -m2=COPY
 3945|       |				 *       -m3=(any)
 3946|       |				 *  7z a -m0=BCJ2 -m1=COPY -m2=(any)
 3947|       |				 *       -m3=COPY
 3948|       |				 *  7z a -m0=BCJ2 -m1=(any) -m2=COPY
 3949|       |				 *       -m3=COPY
 3950|       |				 * not work:
 3951|       |				 *  other patterns.
 3952|       |				 *
 3953|       |				 * We have to handle this like `pipe' or
 3954|       |				 * our libarchive7s filter frame work,
 3955|       |				 * decoding the BCJ2 main stream sequentially,
 3956|       |				 * m3 -> m2 -> m1 -> BCJ2.
 3957|       |				 *
 3958|       |				 */
 3959|      0|				if (fc[0].codec == _7Z_COPY &&
  ------------------
  |  |   93|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3959:9): [True: 0, False: 0]
  ------------------
 3960|      0|				    fc[1].codec == _7Z_COPY)
  ------------------
  |  |   93|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3960:9): [True: 0, False: 0]
  ------------------
 3961|      0|					coder1 = &(folder->coders[2]);
 3962|      0|				else if (fc[0].codec == _7Z_COPY &&
  ------------------
  |  |   93|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3962:14): [True: 0, False: 0]
  ------------------
 3963|      0|				    fc[2].codec == _7Z_COPY)
  ------------------
  |  |   93|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3963:9): [True: 0, False: 0]
  ------------------
 3964|      0|					coder1 = &(folder->coders[1]);
 3965|      0|				else if (fc[1].codec == _7Z_COPY &&
  ------------------
  |  |   93|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3965:14): [True: 0, False: 0]
  ------------------
 3966|      0|				    fc[2].codec == _7Z_COPY)
  ------------------
  |  |   93|      0|#define _7Z_COPY	0
  ------------------
  |  Branch (3966:9): [True: 0, False: 0]
  ------------------
 3967|      0|					coder1 = &(folder->coders[0]);
 3968|      0|				else {
 3969|      0|					archive_set_error(&(a->archive),
 3970|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3971|      0|					    "Unsupported form of "
 3972|      0|					    "BCJ2 streams");
 3973|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3974|      0|				}
 3975|      0|			}
 3976|     19|			coder2 = &(fc[3]);
 3977|     19|			remaining = folder->unPackSize[2];
 3978|     19|		} else if (coder2 != NULL && coder2->codec == _7Z_X86_BCJ2 &&
  ------------------
  |  |  106|      2|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (3978:14): [True: 1, False: 0]
  |  Branch (3978:32): [True: 1, False: 0]
  ------------------
 3979|      1|		    zip->pack_stream_remaining == 4 &&
  ------------------
  |  Branch (3979:7): [True: 0, False: 1]
  ------------------
 3980|      0|		    folder->numInStreams == 5 && folder->numOutStreams == 2) {
  ------------------
  |  Branch (3980:7): [True: 0, False: 0]
  |  Branch (3980:36): [True: 0, False: 0]
  ------------------
 3981|       |			/* Source type 0 made by 7z */
 3982|      0|			remaining = folder->unPackSize[0];
 3983|      1|		} else {
 3984|       |			/* We got an unexpected form. */
 3985|      1|			archive_set_error(&(a->archive),
 3986|      1|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3987|      1|			    "Unsupported form of BCJ2 streams");
 3988|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3989|      1|		}
 3990|     19|		zip->main_stream_bytes_remaining = remaining;
 3991|       |
 3992|       |
 3993|       |		/* Skip the main stream at this time. */
 3994|     19|		if ((r = seek_pack(a)) < 0)
  ------------------
  |  Branch (3994:7): [True: 0, False: 19]
  ------------------
 3995|      0|			return (r);
 3996|     19|		zip->pack_stream_bytes_unconsumed =
 3997|     19|		    zip->pack_stream_inbytes_remaining;
 3998|     19|		if ((r = read_consume(a)) < 0)
  ------------------
  |  Branch (3998:7): [True: 0, False: 19]
  ------------------
 3999|      0|			return (r);
 4000|       |
 4001|       |		/* Read following three sub streams. */
 4002|     73|		for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (4002:15): [True: 56, False: 17]
  ------------------
 4003|     56|			const struct _7z_coder *coder = scoder[i];
 4004|       |
 4005|     56|			if ((r = seek_pack(a)) < 0) {
  ------------------
  |  Branch (4005:8): [True: 0, False: 56]
  ------------------
 4006|      0|				free(b[0]); free(b[1]); free(b[2]);
 4007|      0|				return (r);
 4008|      0|			}
 4009|       |
 4010|     56|			if (sunpack[i] == -1)
  ------------------
  |  Branch (4010:8): [True: 19, False: 37]
  ------------------
 4011|     19|				zip->folder_outbytes_remaining =
 4012|     19|				    zip->pack_stream_inbytes_remaining;
 4013|     37|			else
 4014|     37|				zip->folder_outbytes_remaining = sunpack[i];
 4015|       |
 4016|     56|			r = init_decompression(a, zip, coder, NULL);
 4017|     56|			if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|     56|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4017:8): [True: 0, False: 56]
  ------------------
 4018|      0|				free(b[0]); free(b[1]); free(b[2]);
 4019|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4020|      0|			}
 4021|       |
 4022|       |			/* Allocate memory for the decoded data of a sub
 4023|       |			 * stream. */
 4024|     56|			if ((uint64_t)zip->folder_outbytes_remaining > SIZE_MAX) {
  ------------------
  |  Branch (4024:8): [True: 0, False: 56]
  ------------------
 4025|      0|				free(b[0]); free(b[1]); free(b[2]);
 4026|      0|				archive_set_error(&a->archive,
 4027|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 4028|      0|				    "7-Zip sub-stream size exceeds "
 4029|      0|				    "platform maximum");
 4030|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4031|      0|			}
 4032|     56|			b[i] = malloc((size_t)zip->folder_outbytes_remaining);
 4033|     56|			if (b[i] == NULL) {
  ------------------
  |  Branch (4033:8): [True: 0, False: 56]
  ------------------
 4034|      0|				free(b[0]); free(b[1]); free(b[2]);
 4035|      0|				archive_set_error(&a->archive, ENOMEM,
 4036|      0|				    "No memory for 7-Zip decompression");
 4037|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4038|      0|			}
 4039|       |
 4040|       |			/* Extract a sub stream. */
 4041|    110|			while (zip->pack_stream_inbytes_remaining > 0) {
  ------------------
  |  Branch (4041:11): [True: 56, False: 54]
  ------------------
 4042|     56|				r = (int)extract_pack_stream(a, 0);
 4043|     56|				if (r < 0) {
  ------------------
  |  Branch (4043:9): [True: 2, False: 54]
  ------------------
 4044|      2|					free(b[0]); free(b[1]); free(b[2]);
 4045|      2|					return (r);
 4046|      2|				}
 4047|     54|				bytes = get_uncompressed_data(a, &buff,
 4048|     54|				    zip->uncompressed_buffer_bytes_remaining,
 4049|     54|				    0);
 4050|     54|				if (bytes < 0) {
  ------------------
  |  Branch (4050:9): [True: 0, False: 54]
  ------------------
 4051|      0|					free(b[0]); free(b[1]); free(b[2]);
 4052|      0|					return ((int)bytes);
 4053|      0|				}
 4054|     54|				memcpy(b[i]+s[i], buff, bytes);
 4055|     54|				s[i] += bytes;
 4056|     54|				if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (4056:9): [True: 54, False: 0]
  ------------------
 4057|     54|					read_consume(a);
 4058|     54|			}
 4059|     56|		}
 4060|       |
 4061|       |		/* Set the sub streams to the right place. */
 4062|     68|		for (i = 0; i < 3; i++) {
  ------------------
  |  Branch (4062:15): [True: 51, False: 17]
  ------------------
 4063|     51|			zip->sub_stream_buff[i] = b[idx[i]];
 4064|     51|			zip->sub_stream_size[i] = s[idx[i]];
 4065|     51|			zip->sub_stream_bytes_remaining[i] = s[idx[i]];
 4066|     51|		}
 4067|       |
 4068|       |		/* Allocate memory used for decoded main stream bytes. */
 4069|     17|		if (zip->tmp_stream_buff == NULL) {
  ------------------
  |  Branch (4069:7): [True: 17, False: 0]
  ------------------
 4070|     17|			zip->tmp_stream_buff_size = 32 * 1024;
 4071|     17|			zip->tmp_stream_buff =
 4072|     17|			    malloc(zip->tmp_stream_buff_size);
 4073|     17|			if (zip->tmp_stream_buff == NULL) {
  ------------------
  |  Branch (4073:8): [True: 0, False: 17]
  ------------------
 4074|      0|				archive_set_error(&a->archive, ENOMEM,
 4075|      0|				    "No memory for 7-Zip decompression");
 4076|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4077|      0|			}
 4078|     17|		}
 4079|     17|		zip->tmp_stream_bytes_avail = 0;
 4080|     17|		zip->tmp_stream_bytes_remaining = 0;
 4081|     17|		zip->odd_bcj_size = 0;
 4082|     17|		zip->bcj2_outPos = 0;
 4083|       |
 4084|       |		/*
 4085|       |		 * Reset a stream reader in order to read the main stream
 4086|       |		 * of BCJ2.
 4087|       |		 */
 4088|     17|		zip->pack_stream_remaining = 1;
 4089|     17|		zip->pack_stream_index = folder->packIndex;
 4090|     17|		zip->folder_outbytes_remaining =
 4091|     17|		    folder_uncompressed_size(folder);
 4092|     17|		zip->uncompressed_buffer_bytes_remaining = 0;
 4093|     17|	}
 4094|       |
 4095|       |	/*
 4096|       |	 * Initialize the decompressor for the new folder's pack streams.
 4097|       |	 */
 4098|    406|	r = init_decompression(a, zip, coder1, coder2);
 4099|    406|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    406|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4099:6): [True: 41, False: 365]
  ------------------
 4100|     41|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     41|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4101|    365|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    365|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4102|    406|}
archive_read_support_format_7zip.c:init_decompression:
 1333|    462|{
 1334|    462|	int r;
 1335|       |
 1336|    462|	zip->codec = coder1->codec;
 1337|    462|	zip->codec2 = -1;
 1338|       |
 1339|    462|	switch (zip->codec) {
 1340|    153|	case _7Z_COPY:
  ------------------
  |  |   93|    153|#define _7Z_COPY	0
  ------------------
  |  Branch (1340:2): [True: 153, False: 309]
  ------------------
 1341|    153|	case _7Z_BZ2:
  ------------------
  |  |   97|    153|#define _7Z_BZ2		0x040202
  ------------------
  |  Branch (1341:2): [True: 0, False: 462]
  ------------------
 1342|    153|	case _7Z_DEFLATE:
  ------------------
  |  |   96|    153|#define _7Z_DEFLATE	0x040108
  ------------------
  |  Branch (1342:2): [True: 0, False: 462]
  ------------------
 1343|    153|	case _7Z_ZSTD:
  ------------------
  |  |  115|    153|#define _7Z_ZSTD	0x4F71101 /* Copied from https://github.com/mcmilk/7-Zip-zstd.git */
  ------------------
  |  Branch (1343:2): [True: 0, False: 462]
  ------------------
 1344|    281|	case _7Z_PPMD:
  ------------------
  |  |   98|    281|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (1344:2): [True: 128, False: 334]
  ------------------
 1345|    281|		if (coder2 != NULL) {
  ------------------
  |  Branch (1345:7): [True: 92, False: 189]
  ------------------
 1346|     92|			if (coder2->codec != _7Z_X86 &&
  ------------------
  |  |  105|    184|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1346:8): [True: 73, False: 19]
  ------------------
 1347|     73|			    coder2->codec != _7Z_X86_BCJ2 &&
  ------------------
  |  |  106|    165|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1347:8): [True: 73, False: 0]
  ------------------
 1348|     73|			    coder2->codec != _7Z_ARM &&
  ------------------
  |  |  109|    165|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1348:8): [True: 62, False: 11]
  ------------------
 1349|     62|			    coder2->codec != _7Z_ARM64 &&
  ------------------
  |  |  111|    154|#define _7Z_ARM64	0xa
  ------------------
  |  Branch (1349:8): [True: 38, False: 24]
  ------------------
 1350|     38|			    coder2->codec != _7Z_POWERPC &&
  ------------------
  |  |  107|    130|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1350:8): [True: 24, False: 14]
  ------------------
 1351|     24|			    coder2->codec != _7Z_SPARC) {
  ------------------
  |  |  113|     24|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1351:8): [True: 8, False: 16]
  ------------------
 1352|      8|				archive_set_error(&a->archive,
 1353|      8|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      8|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1354|      8|				    "Unsupported filter %jx for %jx",
 1355|      8|				    (uintmax_t)coder2->codec,
 1356|      8|				    (uintmax_t)coder1->codec);
 1357|      8|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      8|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1358|      8|			}
 1359|     84|			zip->codec2 = coder2->codec;
 1360|     84|			zip->bcj_state = 0;
 1361|     84|			if (coder2->codec == _7Z_X86)
  ------------------
  |  |  105|     84|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1361:8): [True: 19, False: 65]
  ------------------
 1362|     19|				x86_Init(zip);
 1363|     65|			else if (coder2->codec == _7Z_ARM)
  ------------------
  |  |  109|     65|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1363:13): [True: 11, False: 54]
  ------------------
 1364|     11|				arm_Init(zip);
 1365|     84|		}
 1366|    273|		break;
 1367|    273|	default:
  ------------------
  |  Branch (1367:2): [True: 181, False: 281]
  ------------------
 1368|    181|		break;
 1369|    462|	}
 1370|       |
 1371|    454|	switch (zip->codec) {
 1372|    145|	case _7Z_COPY:
  ------------------
  |  |   93|    145|#define _7Z_COPY	0
  ------------------
  |  Branch (1372:2): [True: 145, False: 309]
  ------------------
 1373|    145|		break;
 1374|       |
 1375|    156|	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   94|    123|#define _7Z_LZMA	0x030101
  ------------------
              	case _7Z_LZMA: case _7Z_LZMA2:
  ------------------
  |  |   95|    156|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1375:2): [True: 123, False: 331]
  |  Branch (1375:17): [True: 33, False: 421]
  ------------------
 1376|    156|#ifdef HAVE_LZMA_H
 1377|    156|#if LZMA_VERSION_MAJOR >= 5
 1378|       |/* Effectively disable the limiter. */
 1379|    156|#define LZMA_MEMLIMIT   UINT64_MAX
 1380|       |#else
 1381|       |/* NOTE: This needs to check memory size which running system has. */
 1382|       |#define LZMA_MEMLIMIT   (1U << 30)
 1383|       |#endif
 1384|    156|	{
 1385|    156|		lzma_options_delta delta_opt;
 1386|    156|		lzma_filter filters[LZMA_FILTERS_MAX], *ff;
 1387|    156|		int fi = 0;
 1388|       |
 1389|    156|		if (zip->lzstream_valid) {
  ------------------
  |  Branch (1389:7): [True: 88, False: 68]
  ------------------
 1390|     88|			lzma_end(&(zip->lzstream));
 1391|     88|			zip->lzstream_valid = 0;
 1392|     88|		}
 1393|       |
 1394|       |		/*
 1395|       |		 * NOTE: liblzma incompletely handle the BCJ+LZMA compressed
 1396|       |		 * data made by 7-Zip because 7-Zip does not add End-Of-
 1397|       |		 * Payload Marker(EOPM) at the end of LZMA compressed data,
 1398|       |		 * and so liblzma cannot know the end of the compressed data
 1399|       |		 * without EOPM. So consequently liblzma will not return last
 1400|       |		 * three or four bytes of uncompressed data because
 1401|       |		 * LZMA_FILTER_X86 filter does not handle input data if its
 1402|       |		 * data size is less than five bytes. If liblzma detect EOPM
 1403|       |		 * or know the uncompressed data size, liblzma will flush out
 1404|       |		 * the remaining that three or four bytes of uncompressed
 1405|       |		 * data. That is why we have to use our converting program
 1406|       |		 * for BCJ+LZMA. If we were able to tell the uncompressed
 1407|       |		 * size to liblzma when using lzma_raw_decoder() liblzma
 1408|       |		 * could correctly deal with BCJ+LZMA. But unfortunately
 1409|       |		 * there is no way to do that.
 1410|       |		 *
 1411|       |		 * Reference: https://web.archive.org/web/20240405171610/https://www.mail-archive.com/xz-devel@tukaani.org/msg00373.html
 1412|       |		 */
 1413|    156|		if (coder2 != NULL) {
  ------------------
  |  Branch (1413:7): [True: 45, False: 111]
  ------------------
 1414|     45|			zip->codec2 = coder2->codec;
 1415|       |
 1416|     45|			filters[fi].options = NULL;
 1417|     45|			switch (zip->codec2) {
 1418|     24|			case _7Z_X86:
  ------------------
  |  |  105|     24|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1418:4): [True: 24, False: 21]
  ------------------
 1419|     24|				if (zip->codec == _7Z_LZMA2) {
  ------------------
  |  |   95|     24|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1419:9): [True: 0, False: 24]
  ------------------
 1420|      0|					filters[fi].id = LZMA_FILTER_X86;
 1421|      0|					fi++;
 1422|      0|				} else
 1423|       |					/* Use our filter. */
 1424|     24|					x86_Init(zip);
 1425|     24|				break;
 1426|     17|			case _7Z_X86_BCJ2:
  ------------------
  |  |  106|     17|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1426:4): [True: 17, False: 28]
  ------------------
 1427|       |				/* Use our filter. */
 1428|     17|				zip->bcj_state = 0;
 1429|     17|				break;
 1430|      0|			case _7Z_DELTA:
  ------------------
  |  |   99|      0|#define _7Z_DELTA	0x03
  ------------------
  |  Branch (1430:4): [True: 0, False: 45]
  ------------------
 1431|      0|				if (coder2->propertiesSize != 1) {
  ------------------
  |  Branch (1431:9): [True: 0, False: 0]
  ------------------
 1432|      0|					archive_set_error(&a->archive,
 1433|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1434|      0|					    "Invalid Delta parameter");
 1435|      0|					return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1436|      0|				}
 1437|      0|				filters[fi].id = LZMA_FILTER_DELTA;
 1438|      0|				memset(&delta_opt, 0, sizeof(delta_opt));
 1439|      0|				delta_opt.type = LZMA_DELTA_TYPE_BYTE;
 1440|      0|				delta_opt.dist =
 1441|      0|				    coder2->properties[0] + 1;
 1442|      0|				filters[fi].options = &delta_opt;
 1443|      0|				fi++;
 1444|      0|				break;
 1445|       |			/* Following filters have not been tested yet. */
 1446|      1|			case _7Z_POWERPC:
  ------------------
  |  |  107|      1|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1446:4): [True: 1, False: 44]
  ------------------
 1447|      1|				filters[fi].id = LZMA_FILTER_POWERPC;
 1448|      1|				fi++;
 1449|      1|				break;
 1450|      1|			case _7Z_IA64:
  ------------------
  |  |  108|      1|#define _7Z_IA64	0x03030401
  ------------------
  |  Branch (1450:4): [True: 1, False: 44]
  ------------------
 1451|      1|				filters[fi].id = LZMA_FILTER_IA64;
 1452|      1|				fi++;
 1453|      1|				break;
 1454|      1|			case _7Z_ARM:
  ------------------
  |  |  109|      1|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1454:4): [True: 1, False: 44]
  ------------------
 1455|      1|				filters[fi].id = LZMA_FILTER_ARM;
 1456|      1|				fi++;
 1457|      1|				break;
 1458|      0|			case _7Z_ARMTHUMB:
  ------------------
  |  |  110|      0|#define _7Z_ARMTHUMB	0x03030701
  ------------------
  |  Branch (1458:4): [True: 0, False: 45]
  ------------------
 1459|      0|				filters[fi].id = LZMA_FILTER_ARMTHUMB;
 1460|      0|				fi++;
 1461|      0|				break;
 1462|       |#ifdef LZMA_FILTER_ARM64
 1463|       |			case _7Z_ARM64:
 1464|       |				filters[fi].id = LZMA_FILTER_ARM64;
 1465|       |				fi++;
 1466|       |				break;
 1467|       |#endif
 1468|       |#ifdef LZMA_FILTER_RISCV
 1469|       |			case _7Z_RISCV:
 1470|       |				filters[fi].id = LZMA_FILTER_RISCV;
 1471|       |				fi++;
 1472|       |				break;
 1473|       |#endif
 1474|      0|			case _7Z_SPARC:
  ------------------
  |  |  113|      0|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1474:4): [True: 0, False: 45]
  ------------------
 1475|      0|				filters[fi].id = LZMA_FILTER_SPARC;
 1476|      0|				fi++;
 1477|      0|				break;
 1478|      1|			default:
  ------------------
  |  Branch (1478:4): [True: 1, False: 44]
  ------------------
 1479|      1|				archive_set_error(&a->archive,
 1480|      1|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1481|      1|				    "Unexpected codec ID: %jX",
 1482|      1|				    (uintmax_t)zip->codec2);
 1483|      1|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1484|     45|			}
 1485|     45|		}
 1486|       |
 1487|    155|		if (zip->codec == _7Z_LZMA2)
  ------------------
  |  |   95|    155|#define _7Z_LZMA2	0x21
  ------------------
  |  Branch (1487:7): [True: 33, False: 122]
  ------------------
 1488|     33|			filters[fi].id = LZMA_FILTER_LZMA2;
 1489|    122|		else
 1490|    122|			filters[fi].id = LZMA_FILTER_LZMA1;
 1491|    155|		filters[fi].options = NULL;
 1492|    155|		ff = &filters[fi];
 1493|    155|		r = lzma_properties_decode(&filters[fi], NULL,
 1494|    155|		    coder1->properties, coder1->propertiesSize);
 1495|    155|		if (r != LZMA_OK) {
  ------------------
  |  Branch (1495:7): [True: 2, False: 153]
  ------------------
 1496|      2|			set_error(a, r);
 1497|      2|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      2|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1498|      2|		}
 1499|    153|		fi++;
 1500|       |
 1501|    153|		filters[fi].id = LZMA_VLI_UNKNOWN;
 1502|    153|		filters[fi].options = NULL;
 1503|    153|		r = lzma_raw_decoder(&(zip->lzstream), filters);
 1504|    153|		free(ff->options);
 1505|    153|		if (r != LZMA_OK) {
  ------------------
  |  Branch (1505:7): [True: 0, False: 153]
  ------------------
 1506|      0|			set_error(a, r);
 1507|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1508|      0|		}
 1509|    153|		zip->lzstream_valid = 1;
 1510|    153|		zip->lzstream.total_in = 0;
 1511|    153|		zip->lzstream.total_out = 0;
 1512|    153|		break;
 1513|    153|	}
 1514|       |#else
 1515|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
 1516|       |		    "LZMA codec is unsupported");
 1517|       |		return (ARCHIVE_FAILED);
 1518|       |#endif
 1519|      0|	case _7Z_BZ2:
  ------------------
  |  |   97|      0|#define _7Z_BZ2		0x040202
  ------------------
  |  Branch (1519:2): [True: 0, False: 454]
  ------------------
 1520|      0|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 1521|      0|		if (zip->bzstream_valid) {
  ------------------
  |  Branch (1521:7): [True: 0, False: 0]
  ------------------
 1522|      0|			BZ2_bzDecompressEnd(&(zip->bzstream));
 1523|      0|			zip->bzstream_valid = 0;
 1524|      0|		}
 1525|      0|		r = BZ2_bzDecompressInit(&(zip->bzstream), 0, 0);
 1526|      0|		if (r == BZ_MEM_ERROR)
  ------------------
  |  Branch (1526:7): [True: 0, False: 0]
  ------------------
 1527|      0|			r = BZ2_bzDecompressInit(&(zip->bzstream), 0, 1);
 1528|      0|		if (r != BZ_OK) {
  ------------------
  |  Branch (1528:7): [True: 0, False: 0]
  ------------------
 1529|      0|			int err = ARCHIVE_ERRNO_MISC;
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1530|      0|			const char *detail = NULL;
 1531|      0|			switch (r) {
  ------------------
  |  Branch (1531:12): [True: 0, False: 0]
  ------------------
 1532|      0|			case BZ_PARAM_ERROR:
  ------------------
  |  Branch (1532:4): [True: 0, False: 0]
  ------------------
 1533|      0|				detail = "invalid setup parameter";
 1534|      0|				break;
 1535|      0|			case BZ_MEM_ERROR:
  ------------------
  |  Branch (1535:4): [True: 0, False: 0]
  ------------------
 1536|      0|				err = ENOMEM;
 1537|      0|				detail = "out of memory";
 1538|      0|				break;
 1539|      0|			case BZ_CONFIG_ERROR:
  ------------------
  |  Branch (1539:4): [True: 0, False: 0]
  ------------------
 1540|      0|				detail = "mis-compiled library";
 1541|      0|				break;
 1542|      0|			}
 1543|      0|			archive_set_error(&a->archive, err,
 1544|      0|			    "Internal error initializing decompressor: %s",
 1545|      0|			    detail != NULL ? detail : "??");
  ------------------
  |  Branch (1545:8): [True: 0, False: 0]
  ------------------
 1546|      0|			zip->bzstream_valid = 0;
 1547|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1548|      0|		}
 1549|      0|		zip->bzstream_valid = 1;
 1550|      0|		zip->bzstream.total_in_lo32 = 0;
 1551|      0|		zip->bzstream.total_in_hi32 = 0;
 1552|      0|		zip->bzstream.total_out_lo32 = 0;
 1553|      0|		zip->bzstream.total_out_hi32 = 0;
 1554|      0|		break;
 1555|       |#else
 1556|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
 1557|       |		    "BZ2 codec is unsupported");
 1558|       |		return (ARCHIVE_FAILED);
 1559|       |#endif
 1560|      0|	case _7Z_ZSTD:
  ------------------
  |  |  115|      0|#define _7Z_ZSTD	0x4F71101 /* Copied from https://github.com/mcmilk/7-Zip-zstd.git */
  ------------------
  |  Branch (1560:2): [True: 0, False: 454]
  ------------------
 1561|      0|	{
 1562|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 1563|       |		if (zip->zstdstream_valid) {
 1564|       |			ZSTD_freeDStream(zip->zstd_dstream);
 1565|       |			zip->zstdstream_valid = 0;
 1566|       |		}
 1567|       |		zip->zstd_dstream = ZSTD_createDStream();
 1568|       |		zip->zstdstream_valid = 1;
 1569|       |		break;
 1570|       |#else
 1571|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1572|      0|			"ZSTD codec is unsupported");
 1573|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1574|      0|#endif
 1575|      0|	}
 1576|      0|	case _7Z_DEFLATE:
  ------------------
  |  |   96|      0|#define _7Z_DEFLATE	0x040108
  ------------------
  |  Branch (1576:2): [True: 0, False: 454]
  ------------------
 1577|      0|#ifdef HAVE_ZLIB_H
 1578|      0|		if (zip->stream_valid)
  ------------------
  |  Branch (1578:7): [True: 0, False: 0]
  ------------------
 1579|      0|			r = inflateReset(&(zip->stream));
 1580|      0|		else
 1581|      0|			r = inflateInit2(&(zip->stream),
 1582|      0|			    -15 /* Don't check for zlib header */);
 1583|      0|		if (r != Z_OK) {
  ------------------
  |  Branch (1583:7): [True: 0, False: 0]
  ------------------
 1584|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1585|      0|			    "Couldn't initialize zlib stream");
 1586|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1587|      0|		}
 1588|      0|		zip->stream_valid = 1;
 1589|      0|		zip->stream.total_in = 0;
 1590|      0|		zip->stream.total_out = 0;
 1591|      0|		break;
 1592|       |#else
 1593|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
 1594|       |		    "DEFLATE codec is unsupported");
 1595|       |		return (ARCHIVE_FAILED);
 1596|       |#endif
 1597|    128|	case _7Z_PPMD:
  ------------------
  |  |   98|    128|#define _7Z_PPMD	0x030401
  ------------------
  |  Branch (1597:2): [True: 128, False: 326]
  ------------------
 1598|    128|	{
 1599|    128|		unsigned order;
 1600|    128|		uint32_t msize;
 1601|       |
 1602|    128|		if (zip->ppmd7_valid) {
  ------------------
  |  Branch (1602:7): [True: 0, False: 128]
  ------------------
 1603|      0|			__archive_ppmd7_functions.Ppmd7_Free(
 1604|      0|			    &zip->ppmd7_context);
 1605|      0|			zip->ppmd7_valid = 0;
 1606|      0|		}
 1607|       |
 1608|    128|		if (coder1->propertiesSize < 5) {
  ------------------
  |  Branch (1608:7): [True: 1, False: 127]
  ------------------
 1609|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1610|      1|			    "Malformed PPMd parameter");
 1611|      1|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1612|      1|		}
 1613|    127|		order = coder1->properties[0];
 1614|    127|		msize = archive_le32dec(&(coder1->properties[1]));
 1615|    127|		if (order < PPMD7_MIN_ORDER || order > PPMD7_MAX_ORDER ||
  ------------------
  |  |   18|    254|#define PPMD7_MIN_ORDER 2
  ------------------
              		if (order < PPMD7_MIN_ORDER || order > PPMD7_MAX_ORDER ||
  ------------------
  |  |   19|    253|#define PPMD7_MAX_ORDER 64
  ------------------
  |  Branch (1615:7): [True: 1, False: 126]
  |  Branch (1615:34): [True: 1, False: 125]
  ------------------
 1616|    125|		    msize < PPMD7_MIN_MEM_SIZE || msize > PPMD7_MAX_MEM_SIZE) {
  ------------------
  |  |   21|    252|#define PPMD7_MIN_MEM_SIZE (1 << 11)
  ------------------
              		    msize < PPMD7_MIN_MEM_SIZE || msize > PPMD7_MAX_MEM_SIZE) {
  ------------------
  |  |   22|    124|#define PPMD7_MAX_MEM_SIZE (0xFFFFFFFFu - 12 * 3)
  ------------------
  |  Branch (1616:7): [True: 1, False: 124]
  |  Branch (1616:37): [True: 1, False: 123]
  ------------------
 1617|      4|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1618|      4|			    "Malformed PPMd parameter");
 1619|      4|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      4|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1620|      4|		}
 1621|    123|		__archive_ppmd7_functions.Ppmd7_Construct(&zip->ppmd7_context);
 1622|    123|		r = __archive_ppmd7_functions.Ppmd7_Alloc(
 1623|    123|			&zip->ppmd7_context, msize);
 1624|    123|		if (r == 0) {
  ------------------
  |  Branch (1624:7): [True: 0, False: 123]
  ------------------
 1625|      0|			archive_set_error(&a->archive, ENOMEM,
 1626|      0|			    "Coludn't allocate memory for PPMd");
 1627|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1628|      0|		}
 1629|    123|		__archive_ppmd7_functions.Ppmd7_Init(
 1630|    123|			&zip->ppmd7_context, order);
 1631|    123|		__archive_ppmd7_functions.Ppmd7z_RangeDec_CreateVTable(
 1632|    123|			&zip->range_dec);
 1633|    123|		zip->ppmd7_valid = 1;
 1634|    123|		zip->ppmd7_stat = 0;
 1635|    123|		zip->ppstream.overconsumed = 0;
 1636|    123|		break;
 1637|    123|	}
 1638|      0|	case _7Z_X86:
  ------------------
  |  |  105|      0|#define _7Z_X86		0x03030103
  ------------------
  |  Branch (1638:2): [True: 0, False: 454]
  ------------------
 1639|      0|	case _7Z_X86_BCJ2:
  ------------------
  |  |  106|      0|#define _7Z_X86_BCJ2	0x0303011B
  ------------------
  |  Branch (1639:2): [True: 0, False: 454]
  ------------------
 1640|      0|	case _7Z_POWERPC:
  ------------------
  |  |  107|      0|#define _7Z_POWERPC	0x03030205
  ------------------
  |  Branch (1640:2): [True: 0, False: 454]
  ------------------
 1641|      0|	case _7Z_IA64:
  ------------------
  |  |  108|      0|#define _7Z_IA64	0x03030401
  ------------------
  |  Branch (1641:2): [True: 0, False: 454]
  ------------------
 1642|      0|	case _7Z_ARM:
  ------------------
  |  |  109|      0|#define _7Z_ARM		0x03030501
  ------------------
  |  Branch (1642:2): [True: 0, False: 454]
  ------------------
 1643|      0|	case _7Z_ARMTHUMB:
  ------------------
  |  |  110|      0|#define _7Z_ARMTHUMB	0x03030701
  ------------------
  |  Branch (1643:2): [True: 0, False: 454]
  ------------------
 1644|      1|	case _7Z_ARM64:
  ------------------
  |  |  111|      1|#define _7Z_ARM64	0xa
  ------------------
  |  Branch (1644:2): [True: 1, False: 453]
  ------------------
 1645|      2|	case _7Z_RISCV:
  ------------------
  |  |  112|      2|#define _7Z_RISCV	0xb
  ------------------
  |  Branch (1645:2): [True: 1, False: 453]
  ------------------
 1646|      2|	case _7Z_SPARC:
  ------------------
  |  |  113|      2|#define _7Z_SPARC	0x03030805
  ------------------
  |  Branch (1646:2): [True: 0, False: 454]
  ------------------
 1647|      3|	case _7Z_DELTA:
  ------------------
  |  |   99|      3|#define _7Z_DELTA	0x03
  ------------------
  |  Branch (1647:2): [True: 1, False: 453]
  ------------------
 1648|      3|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1649|      3|		    "Unexpected codec ID: %jX", (uintmax_t)zip->codec);
 1650|      3|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      3|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1651|      0|	case _7Z_CRYPTO_MAIN_ZIP:
  ------------------
  |  |  100|      0|#define _7Z_CRYPTO_MAIN_ZIP		0x06F10101 /* Main Zip crypto algo */
  ------------------
  |  Branch (1651:2): [True: 0, False: 454]
  ------------------
 1652|      0|	case _7Z_CRYPTO_RAR_29:
  ------------------
  |  |  101|      0|#define _7Z_CRYPTO_RAR_29		0x06F10303 /* Rar29 AES-128 + (modified SHA-1) */
  ------------------
  |  Branch (1652:2): [True: 0, False: 454]
  ------------------
 1653|      0|	case _7Z_CRYPTO_AES_256_SHA_256:
  ------------------
  |  |  102|      0|#define _7Z_CRYPTO_AES_256_SHA_256	0x06F10701 /* AES-256 + SHA-256 */
  ------------------
  |  Branch (1653:2): [True: 0, False: 454]
  ------------------
 1654|      0|		if (a->entry) {
  ------------------
  |  Branch (1654:7): [True: 0, False: 0]
  ------------------
 1655|      0|			archive_entry_set_is_metadata_encrypted(a->entry, 1);
 1656|      0|			archive_entry_set_is_data_encrypted(a->entry, 1);
 1657|      0|			zip->has_encrypted_entries = 1;
 1658|      0|		}
 1659|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1660|      0|		    "Crypto codec not supported yet (ID: 0x%jX)",
 1661|      0|		    (uintmax_t)zip->codec);
 1662|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1663|     22|	default:
  ------------------
  |  Branch (1663:2): [True: 22, False: 432]
  ------------------
 1664|     22|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     22|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1665|     22|		    "Unknown codec ID: %jX", (uintmax_t)zip->codec);
 1666|     22|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     22|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1667|    454|	}
 1668|       |
 1669|    421|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    421|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1670|    454|}
archive_read_support_format_7zip.c:x86_Init:
 4165|     43|{
 4166|     43|	zip->bcj_state = 0;
 4167|     43|	zip->bcj_prevPosT = (size_t)0 - 1;
 4168|     43|	zip->bcj_prevMask = 0;
 4169|     43|	zip->bcj_ip = 5;
 4170|     43|}
archive_read_support_format_7zip.c:arm_Init:
 4251|     11|{
 4252|     11|	zip->bcj_ip = 8;
 4253|     11|}
archive_read_support_format_7zip.c:set_error:
 1232|      2|{
 1233|       |
 1234|      2|	switch (ret) {
 1235|      0|	case LZMA_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1235:2): [True: 0, False: 2]
  ------------------
 1236|      0|	case LZMA_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (1236:2): [True: 0, False: 2]
  ------------------
 1237|      0|		break;
 1238|      0|	case LZMA_MEM_ERROR:
  ------------------
  |  Branch (1238:2): [True: 0, False: 2]
  ------------------
 1239|      0|		archive_set_error(&a->archive, ENOMEM,
 1240|      0|		    "Lzma library error: Cannot allocate memory");
 1241|      0|		break;
 1242|      0|	case LZMA_MEMLIMIT_ERROR:
  ------------------
  |  Branch (1242:2): [True: 0, False: 2]
  ------------------
 1243|      0|		archive_set_error(&a->archive, ENOMEM,
 1244|      0|		    "Lzma library error: Out of memory");
 1245|      0|		break;
 1246|      0|	case LZMA_FORMAT_ERROR:
  ------------------
  |  Branch (1246:2): [True: 0, False: 2]
  ------------------
 1247|      0|		archive_set_error(&a->archive,
 1248|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1249|      0|		    "Lzma library error: format not recognized");
 1250|      0|		break;
 1251|      2|	case LZMA_OPTIONS_ERROR:
  ------------------
  |  Branch (1251:2): [True: 2, False: 0]
  ------------------
 1252|      2|		archive_set_error(&a->archive,
 1253|      2|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1254|      2|		    "Lzma library error: Invalid options");
 1255|      2|		break;
 1256|      0|	case LZMA_DATA_ERROR:
  ------------------
  |  Branch (1256:2): [True: 0, False: 2]
  ------------------
 1257|      0|		archive_set_error(&a->archive,
 1258|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1259|      0|		    "Lzma library error: Corrupted input data");
 1260|      0|		break;
 1261|      0|	case LZMA_BUF_ERROR:
  ------------------
  |  Branch (1261:2): [True: 0, False: 2]
  ------------------
 1262|      0|		archive_set_error(&a->archive,
 1263|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1264|      0|		    "Lzma library error:  No progress is possible");
 1265|      0|		break;
 1266|      0|	default:
  ------------------
  |  Branch (1266:2): [True: 0, False: 2]
  ------------------
 1267|       |		/* Return an error. */
 1268|      0|		archive_set_error(&a->archive,
 1269|      0|		    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1270|      0|		    "Lzma decompression failed:  Unknown error");
 1271|      0|		break;
 1272|      2|	}
 1273|      2|}
archive_read_support_format_7zip.c:seek_pack:
 3688|    440|{
 3689|    440|	struct _7zip *zip = a->format->data;
 3690|    440|	int64_t pack_offset;
 3691|       |
 3692|    440|	if (zip->pack_stream_remaining == 0) {
  ------------------
  |  Branch (3692:6): [True: 5, False: 435]
  ------------------
 3693|      5|		archive_set_error(&(a->archive),
 3694|      5|		    ARCHIVE_ERRNO_MISC, "Damaged 7-Zip archive");
  ------------------
  |  |  204|      5|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3695|      5|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3696|      5|	}
 3697|    435|	zip->pack_stream_inbytes_remaining =
 3698|    435|	    zip->si.pi.sizes[zip->pack_stream_index];
 3699|    435|	pack_offset = zip->si.pi.positions[zip->pack_stream_index];
 3700|    435|	if (zip->stream_offset != pack_offset) {
  ------------------
  |  Branch (3700:6): [True: 376, False: 59]
  ------------------
 3701|    376|		int64_t target;
 3702|       |
 3703|    376|		if (archive_ckd_add_i64(&target,
  ------------------
  |  Branch (3703:7): [True: 0, False: 376]
  ------------------
 3704|    376|		    zip->seek_base, pack_offset) ||
 3705|    376|		    0 > seek_compat(a, target, SEEK_SET, 1)) {
  ------------------
  |  Branch (3705:7): [True: 1, False: 375]
  ------------------
 3706|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Seek error");
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3707|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3708|      1|		}
 3709|    375|		zip->stream_offset = pack_offset;
 3710|    375|	}
 3711|    434|	zip->pack_stream_index++;
 3712|    434|	zip->pack_stream_remaining--;
 3713|    434|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    434|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3714|    435|}
archive_read_support_format_7zip.c:free_StreamsInfo:
 2685|  17.1k|{
 2686|  17.1k|	free_PackInfo(&(si->pi));
 2687|  17.1k|	free_CodersInfo(&(si->ci));
 2688|  17.1k|	free_SubStreamsInfo(&(si->ss));
 2689|  17.1k|}
archive_read_support_format_7zip.c:free_PackInfo:
 2168|  17.1k|{
 2169|  17.1k|	free(pi->sizes);
 2170|  17.1k|	free(pi->positions);
 2171|  17.1k|	free_Digest(&(pi->digest));
 2172|  17.1k|}
archive_read_support_format_7zip.c:free_CodersInfo:
 2399|  17.1k|{
 2400|  17.1k|	size_t i;
 2401|       |
 2402|  17.1k|	if (ci->folders) {
  ------------------
  |  Branch (2402:6): [True: 910, False: 16.1k]
  ------------------
 2403|   721k|		for (i = 0; i < ci->numFolders; i++)
  ------------------
  |  Branch (2403:15): [True: 720k, False: 910]
  ------------------
 2404|   720k|			free_Folder(&(ci->folders[i]));
 2405|    910|		free(ci->folders);
 2406|    910|	}
 2407|  17.1k|}
archive_read_support_format_7zip.c:free_Folder:
 2250|   720k|{
 2251|   720k|	if (f->coders) {
  ------------------
  |  Branch (2251:6): [True: 2.13k, False: 718k]
  ------------------
 2252|  2.13k|		size_t i;
 2253|       |
 2254|  5.84k|		for (i = 0; i< f->numCoders; i++) {
  ------------------
  |  Branch (2254:15): [True: 3.71k, False: 2.13k]
  ------------------
 2255|  3.71k|			free(f->coders[i].properties);
 2256|  3.71k|		}
 2257|  2.13k|		free(f->coders);
 2258|  2.13k|	}
 2259|   720k|	free(f->bindPairs);
 2260|   720k|	free(f->unPackSize);
 2261|   720k|}
archive_read_support_format_7zip.c:free_SubStreamsInfo:
 2539|  17.1k|{
 2540|  17.1k|	free(ss->unpackSizes);
 2541|  17.1k|	free(ss->digestsDefined);
 2542|  17.1k|	free(ss->digests);
 2543|  17.1k|}
archive_read_support_format_7zip.c:read_Header:
 2795|  1.39k|{
 2796|  1.39k|	struct _7zip *zip = a->format->data;
 2797|  1.39k|	const unsigned char *p;
 2798|  1.39k|	struct _7z_folder *folders;
 2799|  1.39k|	struct _7z_stream_info *si = &(zip->si);
 2800|  1.39k|	struct _7zip_entry *entries;
 2801|  1.39k|	size_t folderIndex, indexInFolder;
 2802|  1.39k|	size_t i;
 2803|  1.39k|	size_t eindex, empty_streams, sindex;
 2804|  1.39k|	int attr_seen = 0;
 2805|       |
 2806|  1.39k|	if (check_header_id) {
  ------------------
  |  Branch (2806:6): [True: 277, False: 1.11k]
  ------------------
 2807|       |		/*
 2808|       |		 * Read Header.
 2809|       |		 */
 2810|    277|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2810:7): [True: 146, False: 131]
  ------------------
 2811|    146|			return (-1);
 2812|    131|		if (*p != kHeader)
  ------------------
  |  |  121|    131|#define kHeader			0x01
  ------------------
  |  Branch (2812:7): [True: 51, False: 80]
  ------------------
 2813|     51|			return (-1);
 2814|    131|	}
 2815|       |
 2816|       |	/*
 2817|       |	 * Read ArchiveProperties.
 2818|       |	 */
 2819|  1.19k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2819:6): [True: 0, False: 1.19k]
  ------------------
 2820|      0|		return (-1);
 2821|  1.19k|	if (*p == kArchiveProperties) {
  ------------------
  |  |  122|  1.19k|#define kArchiveProperties	0x02
  ------------------
  |  Branch (2821:6): [True: 79, False: 1.11k]
  ------------------
 2822|  1.35k|		for (;;) {
 2823|  1.35k|			int64_t size;
 2824|  1.35k|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2824:8): [True: 3, False: 1.35k]
  ------------------
 2825|      3|				return (-1);
 2826|  1.35k|			if (*p == kEnd)
  ------------------
  |  |  120|  1.35k|#define kEnd			0x00
  ------------------
  |  Branch (2826:8): [True: 11, False: 1.34k]
  ------------------
 2827|     11|				break;
 2828|  1.34k|			if (parse_7zip_int64(a, &size) < 0)
  ------------------
  |  Branch (2828:8): [True: 13, False: 1.33k]
  ------------------
 2829|     13|				return (-1);
 2830|  1.33k|			if (size < 0 || zip->header_bytes_remaining < size)
  ------------------
  |  Branch (2830:8): [True: 0, False: 1.33k]
  |  Branch (2830:20): [True: 11, False: 1.32k]
  ------------------
 2831|     11|				return (-1);
 2832|       |
 2833|       |			/* Skip the property data to keep header parsing aligned. */
 2834|  2.56k|			while (size > 0) {
  ------------------
  |  Branch (2834:11): [True: 1.28k, False: 1.28k]
  ------------------
 2835|  1.28k|				int64_t skip = size;
 2836|       |
 2837|  1.28k|				if (skip > UBUFF_SIZE)
  ------------------
  |  |  291|  1.28k|#define UBUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (2837:9): [True: 91, False: 1.19k]
  ------------------
 2838|     91|					skip = UBUFF_SIZE;
  ------------------
  |  |  291|     91|#define UBUFF_SIZE	(64 * 1024)
  ------------------
 2839|  1.28k|				if (header_bytes(a, (size_t)skip) == NULL)
  ------------------
  |  Branch (2839:9): [True: 41, False: 1.24k]
  ------------------
 2840|     41|					return (-1);
 2841|  1.24k|				size -= skip;
 2842|  1.24k|			}
 2843|  1.32k|		}
 2844|     11|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2844:7): [True: 0, False: 11]
  ------------------
 2845|      0|			return (-1);
 2846|     11|	}
 2847|       |
 2848|       |	/*
 2849|       |	 * Read MainStreamsInfo.
 2850|       |	 */
 2851|  1.12k|	if (*p == kMainStreamsInfo) {
  ------------------
  |  |  124|  1.12k|#define kMainStreamsInfo	0x04
  ------------------
  |  Branch (2851:6): [True: 734, False: 395]
  ------------------
 2852|    734|		if (read_StreamsInfo(a, &(zip->si)) < 0)
  ------------------
  |  Branch (2852:7): [True: 558, False: 176]
  ------------------
 2853|    558|			return (-1);
 2854|    176|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2854:7): [True: 1, False: 175]
  ------------------
 2855|      1|			return (-1);
 2856|    176|	}
 2857|    570|	if (*p == kEnd)
  ------------------
  |  |  120|    570|#define kEnd			0x00
  ------------------
  |  Branch (2857:6): [True: 7, False: 563]
  ------------------
 2858|      7|		return (0);
 2859|       |
 2860|       |	/*
 2861|       |	 * Read FilesInfo.
 2862|       |	 */
 2863|    563|	if (*p != kFilesInfo)
  ------------------
  |  |  125|    563|#define kFilesInfo		0x05
  ------------------
  |  Branch (2863:6): [True: 12, False: 551]
  ------------------
 2864|     12|		return (-1);
 2865|       |
 2866|    551|	if (parse_7zip_size(a, &(zip->numFiles)) < 0)
  ------------------
  |  Branch (2866:6): [True: 13, False: 538]
  ------------------
 2867|     13|		return (-1);
 2868|    538|	if (!files_info_numfiles_is_sane(zip))
  ------------------
  |  Branch (2868:6): [True: 2, False: 536]
  ------------------
 2869|      2|		return (-1);
 2870|       |
 2871|    536|	zip->entries = calloc(zip->numFiles, sizeof(*zip->entries));
 2872|    536|	if (zip->entries == NULL)
  ------------------
  |  Branch (2872:6): [True: 0, False: 536]
  ------------------
 2873|      0|		return (-1);
 2874|    536|	entries = zip->entries;
 2875|       |
 2876|    536|	empty_streams = 0;
 2877|  4.79k|	for (;;) {
 2878|  4.79k|		int type;
 2879|  4.79k|		int64_t size;
 2880|  4.79k|		size_t ll;
 2881|       |
 2882|  4.79k|		if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2882:7): [True: 14, False: 4.78k]
  ------------------
 2883|     14|			return (-1);
 2884|  4.78k|		type = *p;
 2885|  4.78k|		if (type == kEnd)
  ------------------
  |  |  120|  4.78k|#define kEnd			0x00
  ------------------
  |  Branch (2885:7): [True: 246, False: 4.53k]
  ------------------
 2886|    246|			break;
 2887|       |
 2888|  4.53k|		if (parse_7zip_int64(a, &size) < 0)
  ------------------
  |  Branch (2888:7): [True: 31, False: 4.50k]
  ------------------
 2889|     31|			return (-1);
 2890|  4.50k|		if (zip->header_bytes_remaining < size ||
  ------------------
  |  Branch (2890:7): [True: 8, False: 4.50k]
  ------------------
 2891|  4.50k|		    size > (int64_t)(SIZE_MAX / 4))
  ------------------
  |  Branch (2891:7): [True: 1, False: 4.49k]
  ------------------
 2892|      9|			return (-1);
 2893|  4.49k|		ll = (size_t)size;
 2894|       |
 2895|  4.49k|		switch (type) {
 2896|    242|		case kEmptyStream:
  ------------------
  |  |  134|    242|#define kEmptyStream		0x0E
  ------------------
  |  Branch (2896:3): [True: 242, False: 4.25k]
  ------------------
 2897|    242|			if (h->emptyStreamBools != NULL)
  ------------------
  |  Branch (2897:8): [True: 2, False: 240]
  ------------------
 2898|      2|				return (-1);
 2899|    240|			h->emptyStreamBools = calloc(zip->numFiles,
 2900|    240|			    sizeof(*h->emptyStreamBools));
 2901|    240|			if (h->emptyStreamBools == NULL)
  ------------------
  |  Branch (2901:8): [True: 0, False: 240]
  ------------------
 2902|      0|				return (-1);
 2903|    240|			if (read_Bools(
  ------------------
  |  Branch (2903:8): [True: 3, False: 237]
  ------------------
 2904|    240|			    a, h->emptyStreamBools, zip->numFiles) < 0)
 2905|      3|				return (-1);
 2906|    237|			empty_streams = 0;
 2907|  11.6k|			for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (2907:16): [True: 11.3k, False: 237]
  ------------------
 2908|  11.3k|				if (h->emptyStreamBools[i])
  ------------------
  |  Branch (2908:9): [True: 10.4k, False: 983]
  ------------------
 2909|  10.4k|					empty_streams++;
 2910|  11.3k|			}
 2911|    237|			break;
 2912|    127|		case kEmptyFile:
  ------------------
  |  |  135|    127|#define kEmptyFile		0x0F
  ------------------
  |  Branch (2912:3): [True: 127, False: 4.37k]
  ------------------
 2913|    127|			if (empty_streams <= 0) {
  ------------------
  |  Branch (2913:8): [True: 106, False: 21]
  ------------------
 2914|       |				/* Unexcepted sequence. Skip this. */
 2915|    106|				if (header_bytes(a, ll) == NULL)
  ------------------
  |  Branch (2915:9): [True: 4, False: 102]
  ------------------
 2916|      4|					return (-1);
 2917|    102|				break;
 2918|    106|			}
 2919|     21|			if (h->emptyFileBools != NULL)
  ------------------
  |  Branch (2919:8): [True: 1, False: 20]
  ------------------
 2920|      1|				return (-1);
 2921|     20|			h->emptyFileBools = calloc(empty_streams,
 2922|     20|			    sizeof(*h->emptyFileBools));
 2923|     20|			if (h->emptyFileBools == NULL)
  ------------------
  |  Branch (2923:8): [True: 0, False: 20]
  ------------------
 2924|      0|				return (-1);
 2925|     20|			if (read_Bools(a, h->emptyFileBools, empty_streams) < 0)
  ------------------
  |  Branch (2925:8): [True: 1, False: 19]
  ------------------
 2926|      1|				return (-1);
 2927|     19|			break;
 2928|    302|		case kAnti:
  ------------------
  |  |  136|    302|#define kAnti			0x10
  ------------------
  |  Branch (2928:3): [True: 302, False: 4.19k]
  ------------------
 2929|    302|			if (empty_streams <= 0) {
  ------------------
  |  Branch (2929:8): [True: 293, False: 9]
  ------------------
 2930|       |				/* Unexcepted sequence. Skip this. */
 2931|    293|				if (header_bytes(a, ll) == NULL)
  ------------------
  |  Branch (2931:9): [True: 6, False: 287]
  ------------------
 2932|      6|					return (-1);
 2933|    287|				break;
 2934|    293|			}
 2935|      9|			if (h->antiBools != NULL)
  ------------------
  |  Branch (2935:8): [True: 1, False: 8]
  ------------------
 2936|      1|				return (-1);
 2937|      8|			h->antiBools = calloc(empty_streams,
 2938|      8|			    sizeof(*h->antiBools));
 2939|      8|			if (h->antiBools == NULL)
  ------------------
  |  Branch (2939:8): [True: 0, False: 8]
  ------------------
 2940|      0|				return (-1);
 2941|      8|			if (read_Bools(a, h->antiBools, empty_streams) < 0)
  ------------------
  |  Branch (2941:8): [True: 0, False: 8]
  ------------------
 2942|      0|				return (-1);
 2943|      8|			break;
 2944|    557|		case kCTime:
  ------------------
  |  |  138|    557|#define kCTime			0x12
  ------------------
  |  Branch (2944:3): [True: 557, False: 3.94k]
  ------------------
 2945|  1.41k|		case kATime:
  ------------------
  |  |  139|  1.41k|#define kATime			0x13
  ------------------
  |  Branch (2945:3): [True: 860, False: 3.63k]
  ------------------
 2946|  1.60k|		case kMTime:
  ------------------
  |  |  140|  1.60k|#define kMTime			0x14
  ------------------
  |  Branch (2946:3): [True: 188, False: 4.31k]
  ------------------
 2947|  1.60k|			if (read_Times(a, type) < 0)
  ------------------
  |  Branch (2947:8): [True: 101, False: 1.50k]
  ------------------
 2948|    101|				return (-1);
 2949|  1.50k|			break;
 2950|  1.50k|		case kName:
  ------------------
  |  |  137|    137|#define kName			0x11
  ------------------
  |  Branch (2950:3): [True: 137, False: 4.36k]
  ------------------
 2951|    137|		{
 2952|    137|			unsigned char *np;
 2953|    137|			size_t nl, nb;
 2954|       |
 2955|       |			/* Skip one byte. */
 2956|    137|			if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (2956:8): [True: 0, False: 137]
  ------------------
 2957|      0|				return (-1);
 2958|    137|			ll--;
 2959|       |
 2960|    137|			if ((ll & 1) || ll < zip->numFiles * 4)
  ------------------
  |  Branch (2960:8): [True: 1, False: 136]
  |  Branch (2960:20): [True: 0, False: 136]
  ------------------
 2961|      1|				return (-1);
 2962|       |
 2963|    136|			if (zip->entry_names != NULL)
  ------------------
  |  Branch (2963:8): [True: 1, False: 135]
  ------------------
 2964|      1|				return (-1);
 2965|    135|			zip->entry_names = malloc(ll);
 2966|    135|			if (zip->entry_names == NULL)
  ------------------
  |  Branch (2966:8): [True: 1, False: 134]
  ------------------
 2967|      1|				return (-1);
 2968|    134|			np = zip->entry_names;
 2969|    134|			nb = ll;
 2970|       |			/*
 2971|       |			 * Copy whole file names.
 2972|       |			 * NOTE: This loop prevents from expanding
 2973|       |			 * the uncompressed buffer in order not to
 2974|       |			 * use extra memory resource.
 2975|       |			 */
 2976|    265|			while (nb) {
  ------------------
  |  Branch (2976:11): [True: 133, False: 132]
  ------------------
 2977|    133|				size_t b;
 2978|    133|				if (nb > UBUFF_SIZE)
  ------------------
  |  |  291|    133|#define UBUFF_SIZE	(64 * 1024)
  ------------------
  |  Branch (2978:9): [True: 1, False: 132]
  ------------------
 2979|      1|					b = UBUFF_SIZE;
  ------------------
  |  |  291|      1|#define UBUFF_SIZE	(64 * 1024)
  ------------------
 2980|    132|				else
 2981|    132|					b = nb;
 2982|    133|				if ((p = header_bytes(a, b)) == NULL)
  ------------------
  |  Branch (2982:9): [True: 2, False: 131]
  ------------------
 2983|      2|					return (-1);
 2984|    131|				memcpy(np, p, b);
 2985|    131|				np += b;
 2986|    131|				nb -= b;
 2987|    131|			}
 2988|    132|			np = zip->entry_names;
 2989|    132|			nl = ll;
 2990|       |
 2991|  4.21k|			for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (2991:16): [True: 4.08k, False: 123]
  ------------------
 2992|  4.08k|				entries[i].utf16name = np;
 2993|       |#if defined(_WIN32) && !defined(__CYGWIN__) && defined(_DEBUG)
 2994|       |				entries[i].wname = (wchar_t *)np;
 2995|       |#endif
 2996|       |
 2997|       |				/* Find a terminator. */
 2998|  43.3k|				while (nl >= 2 && (np[0] || np[1])) {
  ------------------
  |  Branch (2998:12): [True: 43.3k, False: 9]
  |  Branch (2998:24): [True: 37.8k, False: 5.41k]
  |  Branch (2998:33): [True: 1.33k, False: 4.08k]
  ------------------
 2999|  39.2k|					np += 2;
 3000|  39.2k|					nl -= 2;
 3001|  39.2k|				}
 3002|  4.08k|				if (nl < 2)
  ------------------
  |  Branch (3002:9): [True: 9, False: 4.08k]
  ------------------
 3003|      9|					return (-1);/* Terminator not found */
 3004|  4.08k|				entries[i].name_len = np - entries[i].utf16name;
 3005|  4.08k|				np += 2;
 3006|  4.08k|				nl -= 2;
 3007|  4.08k|			}
 3008|    123|			break;
 3009|    132|		}
 3010|    153|		case kAttributes:
  ------------------
  |  |  141|    153|#define kAttributes		0x15
  ------------------
  |  Branch (3010:3): [True: 153, False: 4.34k]
  ------------------
 3011|    153|		{
 3012|    153|			int allAreDefined;
 3013|       |
 3014|    153|			if ((p = header_bytes(a, 2)) == NULL)
  ------------------
  |  Branch (3014:8): [True: 0, False: 153]
  ------------------
 3015|      0|				return (-1);
 3016|    153|			allAreDefined = *p;
 3017|    153|			if (attr_seen)
  ------------------
  |  Branch (3017:8): [True: 1, False: 152]
  ------------------
 3018|      1|				return (-1);
 3019|    152|			attr_seen = 1;
 3020|    152|			if (!allAreDefined) {
  ------------------
  |  Branch (3020:8): [True: 42, False: 110]
  ------------------
 3021|     42|				h->attrBools = calloc(zip->numFiles,
 3022|     42|				    sizeof(*h->attrBools));
 3023|     42|				if (h->attrBools == NULL)
  ------------------
  |  Branch (3023:9): [True: 0, False: 42]
  ------------------
 3024|      0|					return (-1);
 3025|     42|				if (read_Bools(a, h->attrBools,
  ------------------
  |  Branch (3025:9): [True: 1, False: 41]
  ------------------
 3026|     42|				    zip->numFiles) < 0)
 3027|      1|					return (-1);
 3028|     42|			}
 3029|  4.70k|			for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (3029:16): [True: 4.57k, False: 136]
  ------------------
 3030|  4.57k|				if (allAreDefined || h->attrBools[i]) {
  ------------------
  |  Branch (3030:9): [True: 2.36k, False: 2.20k]
  |  Branch (3030:26): [True: 817, False: 1.38k]
  ------------------
 3031|  3.18k|					if ((p = header_bytes(a, 4)) == NULL)
  ------------------
  |  Branch (3031:10): [True: 15, False: 3.16k]
  ------------------
 3032|     15|						return (-1);
 3033|  3.16k|					entries[i].attr = archive_le32dec(p);
 3034|  3.16k|				}
 3035|  4.57k|			}
 3036|    136|			break;
 3037|    151|		}
 3038|    596|		case kDummy:
  ------------------
  |  |  143|    596|#define kDummy			0x19
  ------------------
  |  Branch (3038:3): [True: 596, False: 3.90k]
  ------------------
 3039|    596|			if (ll == 0)
  ------------------
  |  Branch (3039:8): [True: 104, False: 492]
  ------------------
 3040|    104|				break;
 3041|    492|			__LA_FALLTHROUGH;
 3042|  1.82k|		default:
  ------------------
  |  Branch (3042:3): [True: 1.33k, False: 3.16k]
  ------------------
 3043|  1.82k|			if (header_bytes(a, ll) == NULL)
  ------------------
  |  Branch (3043:8): [True: 86, False: 1.74k]
  ------------------
 3044|     86|				return (-1);
 3045|  1.74k|			break;
 3046|  4.49k|		}
 3047|  4.49k|	}
 3048|       |
 3049|       |	/*
 3050|       |	 * Set up entry's attributes.
 3051|       |	 */
 3052|    246|	folders = si->ci.folders;
 3053|    246|	eindex = sindex = 0;
 3054|    246|	folderIndex = indexInFolder = 0;
 3055|  7.77k|	for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (3055:14): [True: 7.56k, False: 215]
  ------------------
 3056|  7.56k|		if (h->emptyStreamBools == NULL || h->emptyStreamBools[i] == 0)
  ------------------
  |  Branch (3056:7): [True: 108, False: 7.45k]
  |  Branch (3056:38): [True: 152, False: 7.30k]
  ------------------
 3057|    260|			entries[i].flg |= HAS_STREAM;
  ------------------
  |  |  247|    260|#define HAS_STREAM	(1<<4)
  ------------------
 3058|       |		/* The high 16 bits of attributes is a posix file mode. */
 3059|  7.56k|		entries[i].mode = entries[i].attr >> 16;
 3060|       |
 3061|  7.56k|		if (!(entries[i].attr & FILE_ATTRIBUTE_UNIX_EXTENSION)) {
  ------------------
  |  |  167|  7.56k|#define FILE_ATTRIBUTE_UNIX_EXTENSION 0x8000
  ------------------
  |  Branch (3061:7): [True: 6.67k, False: 887]
  ------------------
 3062|       |			// Only windows permissions specified for this entry. Translate to
 3063|       |			// reasonable corresponding unix permissions.
 3064|       |
 3065|  6.67k|			if (entries[i].attr & FILE_ATTRIBUTE_DIRECTORY) {
  ------------------
  |  |  160|  6.67k|#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
  ------------------
  |  Branch (3065:8): [True: 360, False: 6.31k]
  ------------------
 3066|    360|				if (entries[i].attr & FILE_ATTRIBUTE_READONLY) {
  ------------------
  |  |  148|    360|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (3066:9): [True: 213, False: 147]
  ------------------
 3067|       |					// Read-only directory.
 3068|    213|					entries[i].mode = AE_IFDIR | 0555;
  ------------------
  |  |  221|    213|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3069|    213|				} else {
 3070|       |					// Read-write directory.
 3071|    147|					entries[i].mode = AE_IFDIR | 0755;
  ------------------
  |  |  221|    147|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3072|    147|				}
 3073|  6.31k|			} else if (entries[i].attr & FILE_ATTRIBUTE_READONLY) {
  ------------------
  |  |  148|  6.31k|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (3073:15): [True: 202, False: 6.11k]
  ------------------
 3074|       |				// Readonly file.
 3075|    202|				entries[i].mode = AE_IFREG | 0444;
  ------------------
  |  |  216|    202|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3076|  6.11k|			} else {
 3077|       |				// Assume read-write file.
 3078|  6.11k|				entries[i].mode = AE_IFREG | 0644;
  ------------------
  |  |  216|  6.11k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3079|  6.11k|			}
 3080|  6.67k|		}
 3081|       |
 3082|  7.56k|		if (entries[i].flg & HAS_STREAM) {
  ------------------
  |  |  247|  7.56k|#define HAS_STREAM	(1<<4)
  ------------------
  |  Branch (3082:7): [True: 260, False: 7.30k]
  ------------------
 3083|    260|			if (sindex >= si->ss.unpack_streams)
  ------------------
  |  Branch (3083:8): [True: 31, False: 229]
  ------------------
 3084|     31|				return (-1);
 3085|    229|			if (entries[i].mode == 0)
  ------------------
  |  Branch (3085:8): [True: 1, False: 228]
  ------------------
 3086|      1|				entries[i].mode = AE_IFREG | 0666;
  ------------------
  |  |  216|      1|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3087|    229|			if (si->ss.digestsDefined[sindex])
  ------------------
  |  Branch (3087:8): [True: 174, False: 55]
  ------------------
 3088|    174|				entries[i].flg |= CRC32_IS_SET;
  ------------------
  |  |  246|    174|#define CRC32_IS_SET	(1<<3)
  ------------------
 3089|    229|			entries[i].ssIndex = sindex;
 3090|    229|			sindex++;
 3091|  7.30k|		} else {
 3092|  7.30k|			int dir = 1;
 3093|       |
 3094|  7.30k|			if (h->emptyFileBools != NULL) {
  ------------------
  |  Branch (3094:8): [True: 686, False: 6.61k]
  ------------------
 3095|    686|				dir = !h->emptyFileBools[eindex];
 3096|    686|				eindex++;
 3097|    686|			}
 3098|  7.30k|			if (entries[i].mode == 0) {
  ------------------
  |  Branch (3098:8): [True: 163, False: 7.13k]
  ------------------
 3099|    163|				if (dir)
  ------------------
  |  Branch (3099:9): [True: 101, False: 62]
  ------------------
 3100|    101|					entries[i].mode = AE_IFDIR | 0777;
  ------------------
  |  |  221|    101|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3101|     62|				else
 3102|     62|					entries[i].mode = AE_IFREG | 0666;
  ------------------
  |  |  216|     62|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 3103|  7.13k|			} else if (dir &&
  ------------------
  |  Branch (3103:15): [True: 6.92k, False: 215]
  ------------------
 3104|  6.92k|			    (entries[i].mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  215|  6.92k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    (entries[i].mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  221|  6.92k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (3104:8): [True: 6.51k, False: 403]
  ------------------
 3105|  6.51k|				entries[i].mode &= ~AE_IFMT;
  ------------------
  |  |  215|  6.51k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 3106|  6.51k|				entries[i].mode |= AE_IFDIR;
  ------------------
  |  |  221|  6.51k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 3107|  6.51k|			}
 3108|  7.30k|			if ((entries[i].mode & AE_IFMT) == AE_IFDIR &&
  ------------------
  |  |  215|  7.30k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			if ((entries[i].mode & AE_IFMT) == AE_IFDIR &&
  ------------------
  |  |  221|  14.6k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (3108:8): [True: 7.04k, False: 253]
  ------------------
 3109|  7.04k|			    entries[i].name_len >= 2 &&
  ------------------
  |  Branch (3109:8): [True: 1.11k, False: 5.92k]
  ------------------
 3110|  1.11k|			    (entries[i].utf16name[entries[i].name_len-2] != '/' ||
  ------------------
  |  Branch (3110:9): [True: 1.06k, False: 52]
  ------------------
 3111|  1.09k|			     entries[i].utf16name[entries[i].name_len-1] != 0)) {
  ------------------
  |  Branch (3111:9): [True: 24, False: 28]
  ------------------
 3112|  1.09k|				entries[i].utf16name[entries[i].name_len] = '/';
 3113|  1.09k|				entries[i].utf16name[entries[i].name_len+1] = 0;
 3114|  1.09k|				entries[i].name_len += 2;
 3115|  1.09k|			}
 3116|  7.30k|			entries[i].ssIndex = -1;
 3117|  7.30k|		}
 3118|  7.52k|		if (entries[i].attr & FILE_ATTRIBUTE_READONLY)
  ------------------
  |  |  148|  7.52k|#define FILE_ATTRIBUTE_READONLY 0x00000001
  ------------------
  |  Branch (3118:7): [True: 820, False: 6.70k]
  ------------------
 3119|    820|			entries[i].mode &= ~0222;/* Read only. */
 3120|       |
 3121|  7.52k|		if ((entries[i].flg & HAS_STREAM) == 0 && indexInFolder == 0) {
  ------------------
  |  |  247|  7.52k|#define HAS_STREAM	(1<<4)
  ------------------
  |  Branch (3121:7): [True: 7.30k, False: 229]
  |  Branch (3121:45): [True: 7.27k, False: 27]
  ------------------
 3122|       |			/*
 3123|       |			 * The entry is an empty file or a directory file,
 3124|       |			 * those both have no contents.
 3125|       |			 */
 3126|  7.27k|			entries[i].folderIndex = -1;
 3127|  7.27k|			continue;
 3128|  7.27k|		}
 3129|    256|		if (indexInFolder == 0) {
  ------------------
  |  Branch (3129:7): [True: 108, False: 148]
  ------------------
 3130|    108|			for (;;) {
 3131|    108|				if (folderIndex >= si->ci.numFolders)
  ------------------
  |  Branch (3131:9): [True: 0, False: 108]
  ------------------
 3132|      0|					return (-1);
 3133|    108|				if (folders[folderIndex].numUnpackStreams)
  ------------------
  |  Branch (3133:9): [True: 108, False: 0]
  ------------------
 3134|    108|					break;
 3135|      0|				folderIndex++;
 3136|      0|			}
 3137|    108|		}
 3138|    256|		entries[i].folderIndex = folderIndex;
 3139|    256|		if ((entries[i].flg & HAS_STREAM) == 0)
  ------------------
  |  |  247|    256|#define HAS_STREAM	(1<<4)
  ------------------
  |  Branch (3139:7): [True: 27, False: 229]
  ------------------
 3140|     27|			continue;
 3141|    229|		indexInFolder++;
 3142|    229|		if (indexInFolder >= folders[folderIndex].numUnpackStreams) {
  ------------------
  |  Branch (3142:7): [True: 95, False: 134]
  ------------------
 3143|     95|			folderIndex++;
 3144|     95|			indexInFolder = 0;
 3145|     95|		}
 3146|    229|	}
 3147|       |
 3148|    215|	return (0);
 3149|    246|}
archive_read_support_format_7zip.c:files_info_numfiles_is_sane:
 2779|    538|{
 2780|    538|	int64_t empty_stream_map_bytes;
 2781|       |
 2782|    538|	if (zip->numFiles > SIZE_MAX / sizeof(*zip->entries))
  ------------------
  |  Branch (2782:6): [True: 0, False: 538]
  ------------------
 2783|      0|		return (0);
 2784|       |
 2785|    538|	if (zip->numFiles <= zip->si.ss.unpack_streams)
  ------------------
  |  Branch (2785:6): [True: 113, False: 425]
  ------------------
 2786|    113|		return (1);
 2787|       |
 2788|    425|	empty_stream_map_bytes = (zip->numFiles + 7) / 8;
 2789|    425|	return (empty_stream_map_bytes <= zip->header_bytes_remaining);
 2790|    538|}
archive_read_support_format_7zip.c:read_Times:
 3153|  1.60k|{
 3154|  1.60k|	struct _7zip *zip = a->format->data;
 3155|  1.60k|	const unsigned char *p;
 3156|  1.60k|	struct _7zip_entry *entries = zip->entries;
 3157|  1.60k|	unsigned char *timeBools = NULL;
 3158|  1.60k|	int allAreDefined;
 3159|  1.60k|	size_t dataIndex, i;
 3160|       |
 3161|       |	/* Read allAreDefined. */
 3162|  1.60k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (3162:6): [True: 2, False: 1.60k]
  ------------------
 3163|      2|		goto failed;
 3164|  1.60k|	allAreDefined = *p;
 3165|       |
 3166|  1.60k|	if (!allAreDefined) {
  ------------------
  |  Branch (3166:6): [True: 247, False: 1.35k]
  ------------------
 3167|    247|		timeBools = calloc(zip->numFiles, sizeof(*timeBools));
 3168|    247|		if (timeBools == NULL)
  ------------------
  |  Branch (3168:7): [True: 0, False: 247]
  ------------------
 3169|      0|			goto failed;
 3170|    247|		if (read_Bools(a, timeBools, zip->numFiles) < 0)
  ------------------
  |  Branch (3170:7): [True: 5, False: 242]
  ------------------
 3171|      5|			goto failed;
 3172|    247|	}
 3173|       |
 3174|       |	/* Read external. */
 3175|  1.59k|	if ((p = header_bytes(a, 1)) == NULL)
  ------------------
  |  Branch (3175:6): [True: 8, False: 1.59k]
  ------------------
 3176|      8|		goto failed;
 3177|  1.59k|	if (*p) {
  ------------------
  |  Branch (3177:6): [True: 1.37k, False: 214]
  ------------------
 3178|  1.37k|		if (parse_7zip_size(a, &dataIndex) < 0)
  ------------------
  |  Branch (3178:7): [True: 37, False: 1.33k]
  ------------------
 3179|     37|			goto failed;
 3180|  1.37k|	}
 3181|       |
 3182|  5.62k|	for (i = 0; i < zip->numFiles; i++) {
  ------------------
  |  Branch (3182:14): [True: 4.11k, False: 1.50k]
  ------------------
 3183|  4.11k|		if (!allAreDefined && !timeBools[i])
  ------------------
  |  Branch (3183:7): [True: 2.09k, False: 2.02k]
  |  Branch (3183:25): [True: 1.51k, False: 576]
  ------------------
 3184|  1.51k|			continue;
 3185|  2.60k|		if ((p = header_bytes(a, 8)) == NULL)
  ------------------
  |  Branch (3185:7): [True: 49, False: 2.55k]
  ------------------
 3186|     49|			goto failed;
 3187|  2.55k|		switch (type) {
  ------------------
  |  Branch (3187:11): [True: 2.55k, False: 0]
  ------------------
 3188|    337|		case kCTime:
  ------------------
  |  |  138|    337|#define kCTime			0x12
  ------------------
  |  Branch (3188:3): [True: 337, False: 2.21k]
  ------------------
 3189|    337|			__archive_ntfs_to_unix(archive_le64dec(p),
 3190|    337|			    &(entries[i].ctime),
 3191|    337|			    &(entries[i].ctime_ns));
 3192|    337|			entries[i].flg |= CTIME_IS_SET;
  ------------------
  |  |  245|    337|#define CTIME_IS_SET	(1<<2)
  ------------------
 3193|    337|			break;
 3194|  1.64k|		case kATime:
  ------------------
  |  |  139|  1.64k|#define kATime			0x13
  ------------------
  |  Branch (3194:3): [True: 1.64k, False: 904]
  ------------------
 3195|  1.64k|			__archive_ntfs_to_unix(archive_le64dec(p),
 3196|  1.64k|			    &(entries[i].atime),
 3197|  1.64k|			    &(entries[i].atime_ns));
 3198|  1.64k|			entries[i].flg |= ATIME_IS_SET;
  ------------------
  |  |  244|  1.64k|#define ATIME_IS_SET	(1<<1)
  ------------------
 3199|  1.64k|			break;
 3200|    567|		case kMTime:
  ------------------
  |  |  140|    567|#define kMTime			0x14
  ------------------
  |  Branch (3200:3): [True: 567, False: 1.98k]
  ------------------
 3201|    567|			__archive_ntfs_to_unix(archive_le64dec(p),
 3202|    567|			    &(entries[i].mtime),
 3203|    567|			    &(entries[i].mtime_ns));
 3204|    567|			entries[i].flg |= MTIME_IS_SET;
  ------------------
  |  |  243|    567|#define MTIME_IS_SET	(1<<0)
  ------------------
 3205|    567|			break;
 3206|  2.55k|		}
 3207|  2.55k|	}
 3208|       |
 3209|  1.50k|	free(timeBools);
 3210|  1.50k|	return (0);
 3211|    101|failed:
 3212|    101|	free(timeBools);
 3213|    101|	return (-1);
 3214|  1.55k|}
archive_read_support_format_7zip.c:free_Header:
 2766|  1.53k|{
 2767|  1.53k|	free(h->emptyStreamBools);
 2768|  1.53k|	free(h->emptyFileBools);
 2769|  1.53k|	free(h->antiBools);
 2770|  1.53k|	free(h->attrBools);
 2771|  1.53k|}
archive_read_support_format_7zip.c:archive_read_format_7zip_read_data:
 1095|  5.70k|{
 1096|  5.70k|	struct _7zip *zip = a->format->data;
 1097|  5.70k|	ssize_t bytes;
 1098|  5.70k|	int ret = ARCHIVE_OK;
  ------------------
  |  |  233|  5.70k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1099|       |
 1100|  5.70k|	if (zip->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|  5.70k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (1100:6): [True: 0, False: 5.70k]
  ------------------
 1101|      0|		zip->has_encrypted_entries = 0;
 1102|      0|	}
 1103|       |
 1104|  5.70k|	if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (1104:6): [True: 26, False: 5.68k]
  ------------------
 1105|     26|		read_consume(a);
 1106|       |
 1107|  5.70k|	*offset = zip->entry_offset;
 1108|  5.70k|	*size = 0;
 1109|  5.70k|	*buff = NULL;
 1110|       |	/*
 1111|       |	 * If we hit end-of-entry last time, clean up and return
 1112|       |	 * ARCHIVE_EOF this time.
 1113|       |	 */
 1114|  5.70k|	if (zip->end_of_entry)
  ------------------
  |  Branch (1114:6): [True: 5.56k, False: 144]
  ------------------
 1115|  5.56k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  5.56k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1116|       |
 1117|    144|	size_t bytes_to_read = MAX_READ;
  ------------------
  |  |  394|    144|#define MAX_READ	16 * 1024 * 1024
  ------------------
 1118|    144|	if ((int64_t)bytes_to_read > zip->entry_bytes_remaining) {
  ------------------
  |  Branch (1118:6): [True: 140, False: 4]
  ------------------
 1119|    140|		bytes_to_read = (size_t)zip->entry_bytes_remaining;
 1120|    140|	}
 1121|    144|	bytes = read_stream(a, buff, bytes_to_read, 0);
 1122|    144|	if (bytes < 0)
  ------------------
  |  Branch (1122:6): [True: 32, False: 112]
  ------------------
 1123|     32|		return ((int)bytes);
 1124|    112|	if (bytes == 0) {
  ------------------
  |  Branch (1124:6): [True: 12, False: 100]
  ------------------
 1125|     12|		archive_set_error(&a->archive,
 1126|     12|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     12|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1127|     12|		    "Truncated 7-Zip file body");
 1128|     12|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1129|     12|	}
 1130|    100|	zip->entry_bytes_remaining -= bytes;
 1131|    100|	if (zip->entry_bytes_remaining == 0)
  ------------------
  |  Branch (1131:6): [True: 95, False: 5]
  ------------------
 1132|     95|		zip->end_of_entry = 1;
 1133|       |
 1134|       |	/* Update checksum */
 1135|    100|	if ((zip->entry->flg & CRC32_IS_SET) && bytes)
  ------------------
  |  |  246|    100|#define CRC32_IS_SET	(1<<3)
  ------------------
  |  Branch (1135:6): [True: 81, False: 19]
  |  Branch (1135:42): [True: 81, False: 0]
  ------------------
 1136|     81|		zip->entry_crc32 = __archive_crc32(zip->entry_crc32, *buff,
 1137|     81|		    (unsigned)bytes);
 1138|       |
 1139|       |	/* If we hit the end, swallow any end-of-data marker. */
 1140|    100|	if (zip->end_of_entry) {
  ------------------
  |  Branch (1140:6): [True: 95, False: 5]
  ------------------
 1141|       |		/* Check computed CRC against file contents. */
 1142|     95|		if ((zip->entry->flg & CRC32_IS_SET) &&
  ------------------
  |  |  246|     95|#define CRC32_IS_SET	(1<<3)
  ------------------
  |  Branch (1142:7): [True: 79, False: 16]
  ------------------
 1143|     79|			zip->si.ss.digests[zip->entry->ssIndex] !=
  ------------------
  |  Branch (1143:4): [True: 73, False: 6]
  ------------------
 1144|     79|		    zip->entry_crc32) {
 1145|     73|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     73|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1146|     73|			    "7-Zip bad CRC: 0x%lx should be 0x%lx",
 1147|     73|			    zip->entry_crc32,
 1148|     73|			    (unsigned long)zip->si.ss.digests[
 1149|     73|			    		zip->entry->ssIndex]);
 1150|     73|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     73|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1151|     73|		}
 1152|     95|	}
 1153|       |
 1154|    100|	*size = bytes;
 1155|    100|	*offset = zip->entry_offset;
 1156|    100|	zip->entry_offset += bytes;
 1157|       |
 1158|    100|	return (ret);
 1159|    112|}
archive_read_support_format_7zip.c:archive_read_format_7zip_read_data_skip:
 1163|  5.61k|{
 1164|  5.61k|	struct _7zip *zip = a->format->data;
 1165|  5.61k|	int r;
 1166|       |
 1167|  5.61k|	if (zip->pack_stream_bytes_unconsumed)
  ------------------
  |  Branch (1167:6): [True: 46, False: 5.56k]
  ------------------
 1168|     46|		read_consume(a);
 1169|       |
 1170|       |	/* If we've already read to end of data, we're done. */
 1171|  5.61k|	if (zip->end_of_entry)
  ------------------
  |  Branch (1171:6): [True: 5.61k, False: 0]
  ------------------
 1172|  5.61k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  5.61k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1173|       |
 1174|       |	/*
 1175|       |	 * If the length is at the beginning, we can skip the
 1176|       |	 * compressed data much more quickly.
 1177|       |	 */
 1178|      0|	r = skip_stream(a, zip->entry_bytes_remaining);
 1179|      0|	if (r < 0)
  ------------------
  |  Branch (1179:6): [True: 0, False: 0]
  ------------------
 1180|      0|		return (r);
 1181|      0|	zip->entry_bytes_remaining = 0;
 1182|       |
 1183|       |	/* This entry is finished and done. */
 1184|      0|	zip->end_of_entry = 1;
 1185|      0|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1186|      0|}
archive_read_support_format_7zip.c:archive_read_format_7zip_cleanup:
 1190|  16.7k|{
 1191|  16.7k|	struct _7zip *zip = a->format->data;
 1192|       |
 1193|  16.7k|	free_StreamsInfo(&(zip->si));
 1194|  16.7k|	free(zip->entries);
 1195|  16.7k|	free(zip->entry_names);
 1196|  16.7k|	free_decompression(a, zip);
 1197|  16.7k|	free(zip->uncompressed_buffer);
 1198|  16.7k|	free(zip->sub_stream_buff[0]);
 1199|  16.7k|	free(zip->sub_stream_buff[1]);
 1200|  16.7k|	free(zip->sub_stream_buff[2]);
 1201|  16.7k|	free(zip->tmp_stream_buff);
 1202|  16.7k|	free(zip);
 1203|  16.7k|	a->format->data = NULL;
 1204|  16.7k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1205|  16.7k|}
archive_read_support_format_7zip.c:free_decompression:
 2013|  16.7k|{
 2014|  16.7k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2015|       |
 2016|       |#if !defined(HAVE_ZLIB_H) &&\
 2017|       |	!(defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR))
 2018|       |	(void)a;/* UNUSED */
 2019|       |#endif
 2020|  16.7k|#ifdef HAVE_LZMA_H
 2021|  16.7k|	if (zip->lzstream_valid)
  ------------------
  |  Branch (2021:6): [True: 44, False: 16.6k]
  ------------------
 2022|     44|		lzma_end(&(zip->lzstream));
 2023|  16.7k|#endif
 2024|  16.7k|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 2025|  16.7k|	if (zip->bzstream_valid) {
  ------------------
  |  Branch (2025:6): [True: 0, False: 16.7k]
  ------------------
 2026|      0|		if (BZ2_bzDecompressEnd(&(zip->bzstream)) != BZ_OK) {
  ------------------
  |  Branch (2026:7): [True: 0, False: 0]
  ------------------
 2027|      0|			archive_set_error(&a->archive,
 2028|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2029|      0|			    "Failed to clean up bzip2 decompressor");
 2030|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2031|      0|		}
 2032|      0|		zip->bzstream_valid = 0;
 2033|      0|	}
 2034|  16.7k|#endif
 2035|  16.7k|#ifdef HAVE_ZLIB_H
 2036|  16.7k|	if (zip->stream_valid) {
  ------------------
  |  Branch (2036:6): [True: 0, False: 16.7k]
  ------------------
 2037|      0|		if (inflateEnd(&(zip->stream)) != Z_OK) {
  ------------------
  |  Branch (2037:7): [True: 0, False: 0]
  ------------------
 2038|      0|			archive_set_error(&a->archive,
 2039|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2040|      0|			    "Failed to clean up zlib decompressor");
 2041|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2042|      0|		}
 2043|      0|		zip->stream_valid = 0;
 2044|      0|	}
 2045|  16.7k|#endif
 2046|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 2047|       |	if (zip->zstdstream_valid)
 2048|       |		ZSTD_freeDStream(zip->zstd_dstream);
 2049|       |#endif
 2050|  16.7k|	if (zip->ppmd7_valid) {
  ------------------
  |  Branch (2050:6): [True: 123, False: 16.6k]
  ------------------
 2051|    123|		__archive_ppmd7_functions.Ppmd7_Free(
 2052|    123|			&zip->ppmd7_context);
 2053|    123|		zip->ppmd7_valid = 0;
 2054|    123|	}
 2055|  16.7k|	return (r);
 2056|  16.7k|}

archive_read_support_format_all:
   33|  16.7k|{
   34|  16.7k|	archive_check_magic(a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
   35|  16.7k|	    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|  16.7k|	archive_read_support_format_ar(a);
   57|  16.7k|	archive_read_support_format_cpio(a);
   58|  16.7k|	archive_read_support_format_empty(a);
   59|  16.7k|	archive_read_support_format_lha(a);
   60|  16.7k|	archive_read_support_format_mtree(a);
   61|  16.7k|	archive_read_support_format_tar(a);
   62|  16.7k|	archive_read_support_format_xar(a);
   63|  16.7k|	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|  16.7k|	archive_read_support_format_7zip(a);
   72|  16.7k|	archive_read_support_format_cab(a);
   73|  16.7k|	archive_read_support_format_rar(a);
   74|  16.7k|	archive_read_support_format_rar5(a);
   75|  16.7k|	archive_read_support_format_iso9660(a);
   76|       |	/* Seek is really bad, since it forces the read-ahead
   77|       |	 * logic to discard buffered data. */
   78|  16.7k|	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|       |	 * formats should enable those individually so they can
   84|       |	 * verify the level of support. */
   85|       |	/* Clear any warning messages set by the above functions. */
   86|  16.7k|	archive_clear_error(a);
   87|  16.7k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
   88|  16.7k|}

archive_read_support_format_ar:
   99|  16.7k|{
  100|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
  101|  16.7k|	struct ar *ar;
  102|  16.7k|	int r;
  103|       |
  104|  16.7k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
  105|  16.7k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_ar");
  106|       |
  107|  16.7k|	ar = calloc(1, sizeof(*ar));
  108|  16.7k|	if (ar == NULL) {
  ------------------
  |  Branch (108:6): [True: 0, False: 16.7k]
  ------------------
  109|      0|		archive_set_error(_a, ENOMEM, "Can't allocate ar data");
  110|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  111|      0|	}
  112|  16.7k|	ar->strtab = NULL;
  113|       |
  114|  16.7k|	r = __archive_read_register_format(a,
  115|  16.7k|	    ar,
  116|  16.7k|	    "ar",
  117|  16.7k|	    archive_read_format_ar_bid,
  118|  16.7k|	    NULL,
  119|  16.7k|	    archive_read_format_ar_read_header,
  120|  16.7k|	    archive_read_format_ar_read_data,
  121|  16.7k|	    archive_read_format_ar_skip,
  122|  16.7k|	    NULL,
  123|  16.7k|	    archive_read_format_ar_cleanup,
  124|  16.7k|	    NULL,
  125|  16.7k|	    NULL);
  126|       |
  127|  16.7k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (127:6): [True: 0, False: 16.7k]
  ------------------
  128|      0|		free(ar);
  129|  16.7k|	return (r);
  130|  16.7k|}
archive_read_support_format_ar.c:archive_read_format_ar_cleanup:
  134|  16.7k|{
  135|  16.7k|	struct ar *ar = a->format->data;
  136|       |
  137|  16.7k|	free(ar->strtab);
  138|  16.7k|	free(ar);
  139|  16.7k|	a->format->data = NULL;
  140|       |
  141|  16.7k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  142|  16.7k|}
archive_read_support_format_ar.c:archive_read_format_ar_bid:
  146|  16.4k|{
  147|  16.4k|	const void *h;
  148|       |
  149|  16.4k|	(void)best_bid; /* UNUSED */
  150|       |
  151|       |	/*
  152|       |	 * Verify the 8-byte file signature.
  153|       |	 * TODO: Do we need to check more than this?
  154|       |	 */
  155|  16.4k|	if ((h = __archive_read_ahead(a, 8, NULL)) == NULL)
  ------------------
  |  Branch (155:6): [True: 41, False: 16.3k]
  ------------------
  156|     41|		return (-1);
  157|  16.3k|	if (memcmp(h, "!<arch>\n", 8) == 0) {
  ------------------
  |  Branch (157:6): [True: 233, False: 16.1k]
  ------------------
  158|    233|		return (64);
  159|    233|	}
  160|  16.1k|	return (-1);
  161|  16.3k|}
archive_read_support_format_ar.c:archive_read_format_ar_read_header:
  398|  2.97k|{
  399|  2.97k|	struct ar *ar = a->format->data;
  400|  2.97k|	int64_t unconsumed;
  401|  2.97k|	const void *header_data;
  402|  2.97k|	int ret;
  403|       |
  404|  2.97k|	if (!ar->read_global_header) {
  ------------------
  |  Branch (404:6): [True: 233, False: 2.73k]
  ------------------
  405|       |		/*
  406|       |		 * We are at the beginning of the archive now,
  407|       |		 * so we have to consume the ar global header first.
  408|       |		 */
  409|    233|		__archive_read_consume(a, 8);
  410|    233|		ar->read_global_header = 1;
  411|       |		/* Set a default format code for now. */
  412|    233|		a->archive.archive_format = ARCHIVE_FORMAT_AR;
  ------------------
  |  |  376|    233|#define	ARCHIVE_FORMAT_AR			0x70000
  ------------------
  413|    233|	}
  414|       |
  415|       |	/* Read the header for the next file entry. */
  416|  2.97k|	if ((header_data = __archive_read_ahead(a, 60, NULL)) == NULL)
  ------------------
  |  Branch (416:6): [True: 77, False: 2.89k]
  ------------------
  417|       |		/* Broken header. */
  418|     77|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|     77|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  419|       |
  420|  2.89k|	unconsumed = 60;
  421|       |
  422|  2.89k|	ret = _ar_read_header(a, entry, ar, (const char *)header_data, &unconsumed);
  423|       |
  424|  2.89k|	if (unconsumed)
  ------------------
  |  Branch (424:6): [True: 1.35k, False: 1.54k]
  ------------------
  425|  1.35k|		__archive_read_consume(a, unconsumed);
  426|       |
  427|  2.89k|	return ret;
  428|  2.97k|}
archive_read_support_format_ar.c:_ar_read_header:
  166|  2.89k|{
  167|  2.89k|	char filename[AR_name_size + 1];
  168|  2.89k|	uint64_t number; /* Used to hold parsed numbers before validation. */
  169|  2.89k|	char *p;
  170|  2.89k|	const void *b;
  171|       |
  172|       |	/* Verify the magic signature on the file header. */
  173|  2.89k|	if (strncmp(h + AR_fmag_offset, "`\n", 2) != 0) {
  ------------------
  |  |   81|  2.89k|#define AR_fmag_offset 58
  ------------------
  |  Branch (173:6): [True: 62, False: 2.83k]
  ------------------
  174|     62|		archive_set_error(&a->archive, EINVAL,
  175|     62|		    "Incorrect file header signature");
  176|     62|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     62|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  177|     62|	}
  178|       |
  179|       |	/* Copy filename into work buffer. */
  180|  2.83k|	strncpy(filename, h + AR_name_offset, AR_name_size);
  ------------------
  |  |   69|  2.83k|#define AR_name_offset 0
  ------------------
              	strncpy(filename, h + AR_name_offset, AR_name_size);
  ------------------
  |  |   70|  2.83k|#define AR_name_size 16
  ------------------
  181|  2.83k|	filename[AR_name_size] = '\0';
  ------------------
  |  |   70|  2.83k|#define AR_name_size 16
  ------------------
  182|       |
  183|       |	/*
  184|       |	 * Guess the format variant based on the filename.
  185|       |	 */
  186|  2.83k|	if (a->archive.archive_format == ARCHIVE_FORMAT_AR) {
  ------------------
  |  |  376|  2.83k|#define	ARCHIVE_FORMAT_AR			0x70000
  ------------------
  |  Branch (186:6): [True: 342, False: 2.48k]
  ------------------
  187|       |		/* We don't already know the variant, so let's guess. */
  188|       |		/*
  189|       |		 * Biggest clue is presence of '/': GNU starts special
  190|       |		 * filenames with '/', appends '/' as terminator to
  191|       |		 * non-special names, so anything with '/' should be
  192|       |		 * GNU except for BSD long filenames.
  193|       |		 */
  194|    342|		if (strncmp(filename, "#1/", 3) == 0)
  ------------------
  |  Branch (194:7): [True: 67, False: 275]
  ------------------
  195|     67|			a->archive.archive_format = ARCHIVE_FORMAT_AR_BSD;
  ------------------
  |  |  378|     67|#define	ARCHIVE_FORMAT_AR_BSD			(ARCHIVE_FORMAT_AR | 2)
  |  |  ------------------
  |  |  |  |  376|     67|#define	ARCHIVE_FORMAT_AR			0x70000
  |  |  ------------------
  ------------------
  196|    275|		else if (strchr(filename, '/') != NULL)
  ------------------
  |  Branch (196:12): [True: 137, False: 138]
  ------------------
  197|    137|			a->archive.archive_format = ARCHIVE_FORMAT_AR_GNU;
  ------------------
  |  |  377|    137|#define	ARCHIVE_FORMAT_AR_GNU			(ARCHIVE_FORMAT_AR | 1)
  |  |  ------------------
  |  |  |  |  376|    137|#define	ARCHIVE_FORMAT_AR			0x70000
  |  |  ------------------
  ------------------
  198|    138|		else if (strncmp(filename, "__.SYMDEF", 9) == 0)
  ------------------
  |  Branch (198:12): [True: 0, False: 138]
  ------------------
  199|      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
  |  |  ------------------
  ------------------
  200|       |		/*
  201|       |		 * XXX Do GNU/SVR4 'ar' programs ever omit trailing '/'
  202|       |		 * if name exactly fills 16-byte field?  If so, we
  203|       |		 * can't assume entries without '/' are BSD. XXX
  204|       |		 */
  205|    342|	}
  206|       |
  207|       |	/* Update format name from the code. */
  208|  2.83k|	if (a->archive.archive_format == ARCHIVE_FORMAT_AR_GNU)
  ------------------
  |  |  377|  2.83k|#define	ARCHIVE_FORMAT_AR_GNU			(ARCHIVE_FORMAT_AR | 1)
  |  |  ------------------
  |  |  |  |  376|  2.83k|#define	ARCHIVE_FORMAT_AR			0x70000
  |  |  ------------------
  ------------------
  |  Branch (208:6): [True: 1.37k, False: 1.45k]
  ------------------
  209|  1.37k|		a->archive.archive_format_name = "ar (GNU/SVR4)";
  210|  1.45k|	else if (a->archive.archive_format == ARCHIVE_FORMAT_AR_BSD)
  ------------------
  |  |  378|  1.45k|#define	ARCHIVE_FORMAT_AR_BSD			(ARCHIVE_FORMAT_AR | 2)
  |  |  ------------------
  |  |  |  |  376|  1.45k|#define	ARCHIVE_FORMAT_AR			0x70000
  |  |  ------------------
  ------------------
  |  Branch (210:11): [True: 1.31k, False: 138]
  ------------------
  211|  1.31k|		a->archive.archive_format_name = "ar (BSD)";
  212|    138|	else
  213|    138|		a->archive.archive_format_name = "ar";
  214|       |
  215|       |	/*
  216|       |	 * Remove trailing spaces from the filename.  GNU and BSD
  217|       |	 * variants both pad filename area out with spaces.
  218|       |	 * This will only be wrong if GNU/SVR4 'ar' implementations
  219|       |	 * omit trailing '/' for 16-char filenames and we have
  220|       |	 * a 16-char filename that ends in ' '.
  221|       |	 */
  222|  2.83k|	p = filename + AR_name_size - 1;
  ------------------
  |  |   70|  2.83k|#define AR_name_size 16
  ------------------
  223|  4.26k|	while (p >= filename && *p == ' ') {
  ------------------
  |  Branch (223:9): [True: 4.26k, False: 1]
  |  Branch (223:26): [True: 1.43k, False: 2.83k]
  ------------------
  224|  1.43k|		*p = '\0';
  225|  1.43k|		p--;
  226|  1.43k|	}
  227|       |
  228|       |	/*
  229|       |	 * Remove trailing slash unless first character is '/'.
  230|       |	 * (BSD entries never end in '/', so this will only trim
  231|       |	 * GNU-format entries.  GNU special entries start with '/'
  232|       |	 * and are not terminated in '/', so we don't trim anything
  233|       |	 * that starts with '/'.)
  234|       |	 */
  235|  2.83k|	if (filename[0] != '/' && p > filename && *p == '/') {
  ------------------
  |  Branch (235:6): [True: 2.40k, False: 426]
  |  Branch (235:28): [True: 2.37k, False: 29]
  |  Branch (235:44): [True: 12, False: 2.36k]
  ------------------
  236|     12|		*p = '\0';
  237|     12|	}
  238|       |
  239|  2.83k|	if (p < filename) {
  ------------------
  |  Branch (239:6): [True: 1, False: 2.83k]
  ------------------
  240|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  241|      1|		    "Found entry with empty filename");
  242|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  243|      1|	}
  244|       |
  245|       |	/*
  246|       |	 * Parse the time, owner, mode, size fields.
  247|       |	 * This must come before any call to _read_ahead.
  248|       |	 */
  249|  2.83k|	ar_parse_common_header(ar, entry, h);
  250|       |
  251|       |	/*
  252|       |	 * '//' is the GNU filename table.
  253|       |	 * Later entries can refer to names in this table.
  254|       |	 */
  255|  2.83k|	if (strcmp(filename, "//") == 0) {
  ------------------
  |  Branch (255:6): [True: 69, False: 2.76k]
  ------------------
  256|     69|		char *st;
  257|     69|		size_t entry_size;
  258|       |
  259|     69|		archive_entry_copy_pathname(entry, filename);
  260|       |		/* Get the size of the filename table. */
  261|     69|		number = ar_atol10(h + AR_size_offset, AR_size_size);
  ------------------
  |  |   79|     69|#define AR_size_offset 48
  ------------------
              		number = ar_atol10(h + AR_size_offset, AR_size_size);
  ------------------
  |  |   80|     69|#define AR_size_size 10
  ------------------
  262|     69|		if (number > SIZE_MAX || number > 1024 * 1024 * 1024) {
  ------------------
  |  Branch (262:7): [True: 0, False: 69]
  |  Branch (262:28): [True: 1, False: 68]
  ------------------
  263|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  264|      1|			    "Filename table too large");
  265|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  266|      1|		}
  267|     68|		entry_size = (size_t)number;
  268|     68|		if (entry_size == 0) {
  ------------------
  |  Branch (268:7): [True: 12, False: 56]
  ------------------
  269|     12|			archive_set_error(&a->archive, EINVAL,
  270|     12|			    "Invalid string table");
  271|     12|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  272|     12|		}
  273|     56|		if (ar->strtab != NULL) {
  ------------------
  |  Branch (273:7): [True: 1, False: 55]
  ------------------
  274|      1|			archive_set_error(&a->archive, EINVAL,
  275|      1|			    "More than one string table exists");
  276|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  277|      1|		}
  278|       |
  279|       |		/* Read the filename table into memory. */
  280|     55|		st = malloc(entry_size);
  281|     55|		if (st == NULL) {
  ------------------
  |  Branch (281:7): [True: 0, False: 55]
  ------------------
  282|      0|			archive_set_error(&a->archive, ENOMEM,
  283|      0|			    "Can't allocate filename table buffer");
  284|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  285|      0|		}
  286|     55|		ar->strtab = st;
  287|     55|		ar->strtab_size = entry_size;
  288|       |
  289|     55|		if (*unconsumed) {
  ------------------
  |  Branch (289:7): [True: 55, False: 0]
  ------------------
  290|     55|			__archive_read_consume(a, *unconsumed);
  291|     55|			*unconsumed = 0;
  292|     55|		}
  293|       |
  294|     55|		if ((b = __archive_read_ahead(a, entry_size, NULL)) == NULL)
  ------------------
  |  Branch (294:7): [True: 12, False: 43]
  ------------------
  295|     12|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  296|     43|		memcpy(st, b, entry_size);
  297|     43|		__archive_read_consume(a, entry_size);
  298|       |		/* All contents are consumed. */
  299|     43|		ar->entry_bytes_remaining = 0;
  300|     43|		archive_entry_set_size(entry, ar->entry_bytes_remaining);
  301|       |
  302|       |		/* Parse the filename table. */
  303|     43|		return (ar_parse_gnu_filename_table(a));
  304|     55|	}
  305|       |
  306|       |	/*
  307|       |	 * GNU variant handles long filenames by storing /<number>
  308|       |	 * to indicate a name stored in the filename table.
  309|       |	 * XXX TODO: Verify that it's all digits... Don't be fooled
  310|       |	 * by "/9xyz" XXX
  311|       |	 */
  312|  2.76k|	if (filename[0] == '/' && filename[1] >= '0' && filename[1] <= '9') {
  ------------------
  |  Branch (312:6): [True: 357, False: 2.40k]
  |  Branch (312:28): [True: 306, False: 51]
  |  Branch (312:50): [True: 299, False: 7]
  ------------------
  313|    299|		number = ar_atol10(h + AR_name_offset + 1, AR_name_size - 1);
  ------------------
  |  |   69|    299|#define AR_name_offset 0
  ------------------
              		number = ar_atol10(h + AR_name_offset + 1, AR_name_size - 1);
  ------------------
  |  |   70|    299|#define AR_name_size 16
  ------------------
  314|       |		/* Fail if we can't look up the real name. */
  315|    299|		if (ar->strtab == NULL || number >= ar->strtab_size) {
  ------------------
  |  Branch (315:7): [True: 7, False: 292]
  |  Branch (315:29): [True: 7, False: 285]
  ------------------
  316|     14|			archive_set_error(&a->archive, EINVAL,
  317|     14|			    "Can't find long filename for GNU/SVR4 archive entry");
  318|     14|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     14|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  319|     14|		}
  320|       |
  321|    285|		archive_entry_copy_pathname(entry, &ar->strtab[(size_t)number]);
  322|    285|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    285|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  323|    299|	}
  324|       |
  325|       |	/*
  326|       |	 * BSD handles long filenames by storing "#1/" followed by the
  327|       |	 * length of filename as a decimal number, then prepends the
  328|       |	 * the filename to the file contents.
  329|       |	 */
  330|  2.46k|	if (strncmp(filename, "#1/", 3) == 0) {
  ------------------
  |  Branch (330:6): [True: 1.49k, False: 963]
  ------------------
  331|  1.49k|		size_t bsd_name_length;
  332|       |
  333|       |		/* Parse the size of the name, adjust the file size. */
  334|  1.49k|		number = ar_atol10(h + AR_name_offset + 3, AR_name_size - 3);
  ------------------
  |  |   69|  1.49k|#define AR_name_offset 0
  ------------------
              		number = ar_atol10(h + AR_name_offset + 3, AR_name_size - 3);
  ------------------
  |  |   70|  1.49k|#define AR_name_size 16
  ------------------
  335|       |		/* Sanity check the filename length:
  336|       |		 *   = Must be <= SIZE_MAX - 1
  337|       |		 *   = Must be <= 1MB
  338|       |		 *   = Cannot be bigger than the entire entry
  339|       |		 */
  340|  1.49k|		if (number > SIZE_MAX - 1
  ------------------
  |  Branch (340:7): [True: 0, False: 1.49k]
  ------------------
  341|  1.49k|		    || number > 1024 * 1024
  ------------------
  |  Branch (341:10): [True: 6, False: 1.49k]
  ------------------
  342|  1.49k|		    || number > (uint64_t)ar->entry_bytes_remaining) {
  ------------------
  |  Branch (342:10): [True: 7, False: 1.48k]
  ------------------
  343|     13|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     13|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  344|     13|			    "Bad input file size");
  345|     13|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     13|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  346|     13|		}
  347|  1.48k|		bsd_name_length = (size_t)number;
  348|  1.48k|		ar->entry_bytes_remaining -= bsd_name_length;
  349|       |		/* Adjust file size reported to client. */
  350|  1.48k|		archive_entry_set_size(entry, ar->entry_bytes_remaining);
  351|       |
  352|  1.48k|		if (*unconsumed) {
  ------------------
  |  Branch (352:7): [True: 1.48k, False: 0]
  ------------------
  353|  1.48k|			__archive_read_consume(a, *unconsumed);
  354|  1.48k|			*unconsumed = 0;
  355|  1.48k|		}
  356|       |
  357|       |		/* Read the long name into memory. */
  358|  1.48k|		if ((b = __archive_read_ahead(a, bsd_name_length, NULL)) == NULL) {
  ------------------
  |  Branch (358:7): [True: 1, False: 1.48k]
  ------------------
  359|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  360|      1|			    "Truncated input file");
  361|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  362|      1|		}
  363|       |		/* Store it in the entry. */
  364|  1.48k|		p = malloc(bsd_name_length + 1);
  365|  1.48k|		if (p == NULL) {
  ------------------
  |  Branch (365:7): [True: 0, False: 1.48k]
  ------------------
  366|      0|			archive_set_error(&a->archive, ENOMEM,
  367|      0|			    "Can't allocate fname buffer");
  368|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  369|      0|		}
  370|  1.48k|		strncpy(p, b, bsd_name_length);
  371|  1.48k|		p[bsd_name_length] = '\0';
  372|       |
  373|  1.48k|		__archive_read_consume(a, bsd_name_length);
  374|       |
  375|  1.48k|		archive_entry_copy_pathname(entry, p);
  376|  1.48k|		free(p);
  377|  1.48k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.48k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  378|  1.48k|	}
  379|       |
  380|       |	/*
  381|       |	 * Otherwise, this is a standard entry.  The filename
  382|       |	 * has already been trimmed as much as possible, based
  383|       |	 * on our current knowledge of the format.
  384|       |	 *
  385|       |	 * Note for future implementations:
  386|       |	 *
  387|       |	 * - "/" is the SVR4/GNU archive symbol table.
  388|       |	 * - "/SYM64/" is the SVR4/GNU 64-bit variant archive symbol table.
  389|       |	 * - "__.SYMDEF" is a BSD archive symbol table.
  390|       |	 */
  391|    963|	archive_entry_copy_pathname(entry, filename);
  392|    963|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    963|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  393|  2.46k|}
archive_read_support_format_ar.c:ar_parse_common_header:
  434|  2.83k|{
  435|  2.83k|	int64_t n;
  436|       |
  437|       |	/* Copy remaining header */
  438|  2.83k|	archive_entry_set_mtime(entry,
  439|  2.83k|	    (time_t)ar_atol10(h + AR_date_offset, AR_date_size), 0L);
  ------------------
  |  |   71|  2.83k|#define AR_date_offset 16
  ------------------
              	    (time_t)ar_atol10(h + AR_date_offset, AR_date_size), 0L);
  ------------------
  |  |   72|  2.83k|#define AR_date_size 12
  ------------------
  440|  2.83k|	archive_entry_set_uid(entry,
  441|  2.83k|	    (uid_t)ar_atol10(h + AR_uid_offset, AR_uid_size));
  ------------------
  |  |   73|  2.83k|#define AR_uid_offset 28
  ------------------
              	    (uid_t)ar_atol10(h + AR_uid_offset, AR_uid_size));
  ------------------
  |  |   74|  2.83k|#define AR_uid_size 6
  ------------------
  442|  2.83k|	archive_entry_set_gid(entry,
  443|  2.83k|	    (gid_t)ar_atol10(h + AR_gid_offset, AR_gid_size));
  ------------------
  |  |   75|  2.83k|#define AR_gid_offset 34
  ------------------
              	    (gid_t)ar_atol10(h + AR_gid_offset, AR_gid_size));
  ------------------
  |  |   76|  2.83k|#define AR_gid_size 6
  ------------------
  444|  2.83k|	archive_entry_set_mode(entry,
  445|  2.83k|	    (mode_t)ar_atol8(h + AR_mode_offset, AR_mode_size));
  ------------------
  |  |   77|  2.83k|#define AR_mode_offset 40
  ------------------
              	    (mode_t)ar_atol8(h + AR_mode_offset, AR_mode_size));
  ------------------
  |  |   78|  2.83k|#define AR_mode_size 8
  ------------------
  446|  2.83k|	archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  2.83k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  447|  2.83k|	n = (int64_t)ar_atol10(h + AR_size_offset, AR_size_size);
  ------------------
  |  |   79|  2.83k|#define AR_size_offset 48
  ------------------
              	n = (int64_t)ar_atol10(h + AR_size_offset, AR_size_size);
  ------------------
  |  |   80|  2.83k|#define AR_size_size 10
  ------------------
  448|       |
  449|  2.83k|	ar->entry_offset = 0;
  450|  2.83k|	ar->entry_padding = n % 2;
  451|  2.83k|	archive_entry_set_size(entry, n);
  452|  2.83k|	ar->entry_bytes_remaining = n;
  453|  2.83k|}
archive_read_support_format_ar.c:ar_atol8:
  551|  2.83k|{
  552|  2.83k|	uint64_t l;
  553|  2.83k|	unsigned int digit, base;
  554|       |
  555|  2.83k|	base = 8;
  556|       |
  557|  11.2k|	while ((*p == ' ' || *p == '\t') && char_cnt-- > 0)
  ------------------
  |  Branch (557:10): [True: 5.88k, False: 5.40k]
  |  Branch (557:23): [True: 2.70k, False: 2.70k]
  |  Branch (557:38): [True: 8.45k, False: 121]
  ------------------
  558|  8.45k|		p++;
  559|       |
  560|  2.83k|	l = 0;
  561|  2.83k|	digit = *p - '0';
  562|  3.33k|	while (*p >= '0' && digit < base && char_cnt-- > 0) {
  ------------------
  |  Branch (562:9): [True: 1.37k, False: 1.96k]
  |  Branch (562:22): [True: 521, False: 855]
  |  Branch (562:38): [True: 507, False: 14]
  ------------------
  563|    507|		if (archive_ckd_mul_u64(&l, l, base) ||
  ------------------
  |  Branch (563:7): [True: 0, False: 507]
  ------------------
  564|    507|		    archive_ckd_add_u64(&l, l, digit)) {
  ------------------
  |  Branch (564:7): [True: 0, False: 507]
  ------------------
  565|      0|			l = UINT64_MAX; /* Truncate on overflow. */
  566|      0|			break;
  567|      0|		}
  568|    507|		digit = *++p - '0';
  569|    507|	}
  570|  2.83k|	return (l);
  571|  2.83k|}
archive_read_support_format_ar.c:ar_atol10:
  575|  13.1k|{
  576|  13.1k|	uint64_t l;
  577|  13.1k|	unsigned int base, digit;
  578|       |
  579|  13.1k|	base = 10;
  580|       |
  581|  44.1k|	while ((*p == ' ' || *p == '\t') && char_cnt-- > 0)
  ------------------
  |  Branch (581:10): [True: 19.6k, False: 24.4k]
  |  Branch (581:23): [True: 13.1k, False: 11.3k]
  |  Branch (581:38): [True: 30.9k, False: 1.85k]
  ------------------
  582|  30.9k|		p++;
  583|  13.1k|	l = 0;
  584|  13.1k|	digit = *p - '0';
  585|  31.1k|	while (*p >= '0' && digit < base  && char_cnt-- > 0) {
  ------------------
  |  Branch (585:9): [True: 21.7k, False: 9.40k]
  |  Branch (585:22): [True: 18.7k, False: 3.06k]
  |  Branch (585:39): [True: 17.9k, False: 718]
  ------------------
  586|  17.9k|		if (archive_ckd_mul_u64(&l, l, base) ||
  ------------------
  |  Branch (586:7): [True: 0, False: 17.9k]
  ------------------
  587|  17.9k|		    archive_ckd_add_u64(&l, l, digit)) {
  ------------------
  |  Branch (587:7): [True: 0, False: 17.9k]
  ------------------
  588|      0|			l = UINT64_MAX; /* Truncate on overflow. */
  589|      0|			break;
  590|      0|		}
  591|  17.9k|		digit = *++p - '0';
  592|  17.9k|	}
  593|  13.1k|	return (l);
  594|  13.1k|}
archive_read_support_format_ar.c:ar_parse_gnu_filename_table:
  514|     43|{
  515|     43|	struct ar *ar = a->format->data;
  516|     43|	char *p;
  517|     43|	size_t size;
  518|       |
  519|     43|	size = ar->strtab_size;
  520|       |
  521|  1.79k|	for (p = ar->strtab; p < ar->strtab + size - 1; ++p) {
  ------------------
  |  Branch (521:23): [True: 1.76k, False: 37]
  ------------------
  522|  1.76k|		if (*p == '/') {
  ------------------
  |  Branch (522:7): [True: 144, False: 1.61k]
  ------------------
  523|    144|			*p++ = '\0';
  524|    144|			if (*p != '\n')
  ------------------
  |  Branch (524:8): [True: 6, False: 138]
  ------------------
  525|      6|				goto bad_string_table;
  526|    138|			*p = '\0';
  527|    138|		}
  528|  1.76k|	}
  529|       |	/*
  530|       |	 * GNU ar always pads the table to an even size.
  531|       |	 * The pad character is either '\n' or '`'.
  532|       |	 */
  533|     37|	if (p != ar->strtab + size && *p != '\n' && *p != '`')
  ------------------
  |  Branch (533:6): [True: 36, False: 1]
  |  Branch (533:32): [True: 32, False: 4]
  |  Branch (533:46): [True: 8, False: 24]
  ------------------
  534|      8|		goto bad_string_table;
  535|       |
  536|       |	/* Enforce zero termination. */
  537|     29|	ar->strtab[size - 1] = '\0';
  538|       |
  539|     29|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     29|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  540|       |
  541|     14|bad_string_table:
  542|     14|	archive_set_error(&a->archive, EINVAL,
  543|     14|	    "Invalid string table");
  544|     14|	free(ar->strtab);
  545|     14|	ar->strtab = NULL;
  546|     14|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     14|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  547|     37|}
archive_read_support_format_ar.c:archive_read_format_ar_read_data:
  458|  5.77k|{
  459|  5.77k|	struct ar *ar = a->format->data;
  460|  5.77k|	ssize_t bytes_read;
  461|       |
  462|  5.77k|	if (ar->entry_bytes_unconsumed) {
  ------------------
  |  Branch (462:6): [True: 1.51k, False: 4.25k]
  ------------------
  463|  1.51k|		__archive_read_consume(a, ar->entry_bytes_unconsumed);
  464|  1.51k|		ar->entry_bytes_unconsumed = 0;
  465|  1.51k|	}
  466|       |
  467|  5.77k|	if (ar->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (467:6): [True: 1.53k, False: 4.23k]
  ------------------
  468|  1.53k|		*buff = __archive_read_ahead(a, 1, &bytes_read);
  469|  1.53k|		if (bytes_read == 0) {
  ------------------
  |  Branch (469:7): [True: 23, False: 1.51k]
  ------------------
  470|     23|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     23|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  471|     23|			    "Truncated ar archive");
  472|     23|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     23|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  473|     23|		}
  474|  1.51k|		if (bytes_read < 0)
  ------------------
  |  Branch (474:7): [True: 0, False: 1.51k]
  ------------------
  475|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  476|  1.51k|		if (bytes_read > ar->entry_bytes_remaining)
  ------------------
  |  Branch (476:7): [True: 1.49k, False: 16]
  ------------------
  477|  1.49k|			bytes_read = (ssize_t)ar->entry_bytes_remaining;
  478|  1.51k|		*size = bytes_read;
  479|  1.51k|		ar->entry_bytes_unconsumed = bytes_read;
  480|  1.51k|		*offset = ar->entry_offset;
  481|  1.51k|		ar->entry_offset += bytes_read;
  482|  1.51k|		ar->entry_bytes_remaining -= bytes_read;
  483|  1.51k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.51k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  484|  4.23k|	} else {
  485|  4.23k|		if (__archive_read_consume(a, ar->entry_padding) < 0)
  ------------------
  |  Branch (485:7): [True: 2, False: 4.23k]
  ------------------
  486|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  487|  4.23k|		ar->entry_padding = 0;
  488|  4.23k|		*buff = NULL;
  489|  4.23k|		*size = 0;
  490|  4.23k|		*offset = ar->entry_offset;
  491|  4.23k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  4.23k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  492|  4.23k|	}
  493|  5.77k|}
archive_read_support_format_ar.c:archive_read_format_ar_skip:
  497|  2.73k|{
  498|  2.73k|	struct ar *ar = a->format->data;
  499|       |
  500|  2.73k|	if (__archive_read_consume(a,
  ------------------
  |  Branch (500:6): [True: 0, False: 2.73k]
  ------------------
  501|  2.73k|	    ar->entry_bytes_remaining + ar->entry_padding +
  502|  2.73k|	    ar->entry_bytes_unconsumed) < 0)
  503|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  504|       |
  505|  2.73k|	ar->entry_bytes_remaining = 0;
  506|  2.73k|	ar->entry_bytes_unconsumed = 0;
  507|  2.73k|	ar->entry_padding = 0;
  508|       |
  509|  2.73k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.73k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  510|  2.73k|}

archive_read_support_format_cab:
  455|  16.7k|{
  456|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
  457|  16.7k|	struct cab *cab;
  458|  16.7k|	int r;
  459|       |
  460|  16.7k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
  461|  16.7k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_cab");
  462|       |
  463|  16.7k|	cab = calloc(1, sizeof(*cab));
  464|  16.7k|	if (cab == NULL) {
  ------------------
  |  Branch (464:6): [True: 0, False: 16.7k]
  ------------------
  465|      0|		archive_set_error(_a, ENOMEM,
  466|      0|		    "Can't allocate CAB data");
  467|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  468|      0|	}
  469|  16.7k|	archive_string_init(&cab->ws);
  ------------------
  |  |   71|  16.7k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
  470|  16.7k|	if (archive_wstring_ensure(&cab->ws, 256) == NULL) {
  ------------------
  |  Branch (470:6): [True: 0, False: 16.7k]
  ------------------
  471|      0|		archive_set_error(_a, ENOMEM, "Can't allocate memory");
  472|      0|		free(cab);
  473|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  474|      0|	}
  475|       |
  476|  16.7k|	r = __archive_read_register_format(a,
  477|  16.7k|	    cab,
  478|  16.7k|	    "cab",
  479|  16.7k|	    archive_read_format_cab_bid,
  480|  16.7k|	    archive_read_format_cab_options,
  481|  16.7k|	    archive_read_format_cab_read_header,
  482|  16.7k|	    archive_read_format_cab_read_data,
  483|  16.7k|	    archive_read_format_cab_read_data_skip,
  484|  16.7k|	    NULL,
  485|  16.7k|	    archive_read_format_cab_cleanup,
  486|  16.7k|	    NULL,
  487|  16.7k|	    NULL);
  488|       |
  489|  16.7k|	if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (489:6): [True: 0, False: 16.7k]
  ------------------
  490|      0|		archive_wstring_free(&cab->ws);
  491|      0|		free(cab);
  492|      0|	}
  493|  16.7k|	return (r);
  494|  16.7k|}
archive_read_support_format_cab.c:archive_read_format_cab_bid:
  521|  16.4k|{
  522|  16.4k|	const char *h;
  523|       |
  524|       |	/* If there's already a better bid than we can ever
  525|       |	   make, don't bother testing. */
  526|  16.4k|	if (best_bid > 64)
  ------------------
  |  Branch (526:6): [True: 1.33k, False: 15.0k]
  ------------------
  527|  1.33k|		return (-1);
  528|       |
  529|  15.0k|	if ((h = __archive_read_ahead(a, 8, NULL)) == NULL)
  ------------------
  |  Branch (529:6): [True: 170, False: 14.9k]
  ------------------
  530|    170|		return (-1);
  531|       |
  532|  14.9k|	if (memcmp(h, "MSCF\0\0\0\0", 8) == 0)
  ------------------
  |  Branch (532:6): [True: 461, False: 14.4k]
  ------------------
  533|    461|		return (64);
  534|       |
  535|       |	/*
  536|       |	 * Attempt to handle self-extracting archives
  537|       |	 * by noting a PE header and searching forward
  538|       |	 * up to 128k for an 'MSCF' marker.
  539|       |	 */
  540|  14.4k|	if (h[0] == 'M' && h[1] == 'Z') {
  ------------------
  |  Branch (540:6): [True: 692, False: 13.7k]
  |  Branch (540:21): [True: 601, False: 91]
  ------------------
  541|    601|		ssize_t bytes_avail;
  542|    601|		ssize_t offset, window;
  543|       |
  544|    601|		offset = 0;
  545|    601|		window = 4096;
  546|  1.68k|		while (offset + window <= SFX_MAX_READAHEAD) {
  ------------------
  |  |  289|  1.68k|#define SFX_MAX_READAHEAD	(1024 * 128)
  ------------------
  |  Branch (546:10): [True: 1.64k, False: 39]
  ------------------
  547|  1.64k|			h = __archive_read_ahead(a, offset + window,
  548|  1.64k|			    &bytes_avail);
  549|  1.64k|			if (h == NULL) {
  ------------------
  |  Branch (549:8): [True: 873, False: 775]
  ------------------
  550|    873|				if (bytes_avail >= offset + 8) {
  ------------------
  |  Branch (550:9): [True: 464, False: 409]
  ------------------
  551|       |					/* Remaining bytes are less than window. */
  552|    464|					window = bytes_avail - offset;
  553|    464|					continue;
  554|    464|				}
  555|    409|				return (0);
  556|    873|			}
  557|    775|			if (bytes_avail > SFX_MAX_READAHEAD)
  ------------------
  |  |  289|    775|#define SFX_MAX_READAHEAD	(1024 * 128)
  ------------------
  |  Branch (557:8): [True: 31, False: 744]
  ------------------
  558|     31|				bytes_avail = SFX_MAX_READAHEAD;
  ------------------
  |  |  289|     31|#define SFX_MAX_READAHEAD	(1024 * 128)
  ------------------
  559|  1.57M|			while (offset <= bytes_avail - 8) {
  ------------------
  |  Branch (559:11): [True: 1.57M, False: 622]
  ------------------
  560|  1.57M|				size_t next = find_cab_magic(h + offset);
  561|  1.57M|				if (next == 0)
  ------------------
  |  Branch (561:9): [True: 153, False: 1.57M]
  ------------------
  562|    153|					return (64);
  563|  1.57M|				offset += next;
  564|  1.57M|			}
  565|    775|		}
  566|    601|	}
  567|  13.8k|	return (0);
  568|  14.4k|}
archive_read_support_format_cab.c:find_cab_magic:
  498|  1.58M|{
  499|  1.58M|	switch (p[4]) {
  500|   281k|	case 0:
  ------------------
  |  Branch (500:2): [True: 281k, False: 1.29M]
  ------------------
  501|       |		/*
  502|       |		 * Note: Self-Extraction program has 'MSCF' string in their
  503|       |		 * program. If we were finding 'MSCF' string only, we got
  504|       |		 * wrong place for Cabinet header, thus, we have to check
  505|       |		 * following four bytes which are reserved and must be set
  506|       |		 * to zero.
  507|       |		 */
  508|   281k|		if (memcmp(p, "MSCF\0\0\0\0", 8) == 0)
  ------------------
  |  Branch (508:7): [True: 305, False: 281k]
  ------------------
  509|    305|			return 0;
  510|   281k|		return 5;
  511|  8.53k|	case 'F': return 1;
  ------------------
  |  Branch (511:2): [True: 8.53k, False: 1.57M]
  ------------------
  512|  7.51k|	case 'C': return 2;
  ------------------
  |  Branch (512:2): [True: 7.51k, False: 1.57M]
  ------------------
  513|  16.2k|	case 'S': return 3;
  ------------------
  |  Branch (513:2): [True: 16.2k, False: 1.56M]
  ------------------
  514|  7.22k|	case 'M': return 4;
  ------------------
  |  Branch (514:2): [True: 7.22k, False: 1.57M]
  ------------------
  515|  1.25M|	default:  return 5;
  ------------------
  |  Branch (515:2): [True: 1.25M, False: 320k]
  ------------------
  516|  1.58M|	}
  517|  1.58M|}
archive_read_support_format_cab.c:archive_read_format_cab_read_header:
 1010|    910|{
 1011|    910|	struct cab *cab = a->format->data;
 1012|    910|	struct cfheader *hd;
 1013|    910|	struct cffolder *prev_folder;
 1014|    910|	struct cffile *file;
 1015|    910|	struct archive_string_conv *sconv;
 1016|    910|	int err = ARCHIVE_OK, r;
  ------------------
  |  |  233|    910|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1017|       |
 1018|    910|	if (cab->found_header == 0) {
  ------------------
  |  Branch (1018:6): [True: 614, False: 296]
  ------------------
 1019|    614|		err = cab_read_header(a); 
 1020|    614|		if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|    614|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1020:7): [True: 148, False: 466]
  ------------------
 1021|    148|			return (err);
 1022|       |		/* We've found the header. */
 1023|    466|		cab->found_header = 1;
 1024|    466|	}
 1025|    762|	hd = &cab->cfheader;
 1026|       |
 1027|    762|	if (hd->file_index >= hd->file_count) {
  ------------------
  |  Branch (1027:6): [True: 47, False: 715]
  ------------------
 1028|     47|		cab->end_of_archive = 1;
 1029|     47|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|     47|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1030|     47|	}
 1031|    715|	file = &hd->file_array[hd->file_index++];
 1032|       |
 1033|    715|	cab->end_of_entry = 0;
 1034|    715|	cab->end_of_entry_cleanup = 0;
 1035|    715|	cab->entry_unconsumed = 0;
 1036|    715|	cab->entry_cffile = file;
 1037|       |
 1038|       |	/*
 1039|       |	 * Choose a proper folder.
 1040|       |	 */
 1041|    715|	prev_folder = cab->entry_cffolder;
 1042|    715|	switch (file->folder) {
 1043|     23|	case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  342|     23|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1043:2): [True: 23, False: 692]
  ------------------
 1044|     27|	case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  344|     27|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1044:2): [True: 4, False: 711]
  ------------------
 1045|     27|		cab->entry_cffolder = &hd->folder_array[0];
 1046|     27|		break;
 1047|      9|	case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  343|      9|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1047:2): [True: 9, False: 706]
  ------------------
 1048|      9|		cab->entry_cffolder = &hd->folder_array[hd->folder_count-1];
 1049|      9|		break;
 1050|    679|	default:
  ------------------
  |  Branch (1050:2): [True: 679, False: 36]
  ------------------
 1051|    679|		cab->entry_cffolder = &hd->folder_array[file->folder];
 1052|    679|		break;
 1053|    715|	}
 1054|       |	/* If a cffolder of this file is changed, reset a cfdata to read
 1055|       |	 * file contents from next cfdata. */
 1056|    715|	if (prev_folder != cab->entry_cffolder) {
  ------------------
  |  Branch (1056:6): [True: 468, False: 247]
  ------------------
 1057|    468|		cab->entry_cfdata = NULL;
 1058|       |		/*
 1059|       |		 * Bytes of files we skipped so far belong to folders we
 1060|       |		 * are done with; reading this file will seek directly to
 1061|       |		 * the data of the new folder, so we must not charge the
 1062|       |		 * skipped bytes against the new folder's data.
 1063|       |		 */
 1064|    468|		cab->bytes_skipped = 0;
 1065|    468|	}
 1066|       |
 1067|       |	/* If a pathname is UTF-8, prepare a string conversion object
 1068|       |	 * for UTF-8 and use it. */
 1069|    715|	if (file->attr & ATTR_NAME_IS_UTF) {
  ------------------
  |  |  347|    715|#define ATTR_NAME_IS_UTF	0x80
  ------------------
  |  Branch (1069:6): [True: 121, False: 594]
  ------------------
 1070|    121|		if (cab->sconv_utf8 == NULL) {
  ------------------
  |  Branch (1070:7): [True: 52, False: 69]
  ------------------
 1071|     52|			cab->sconv_utf8 =
 1072|     52|			    archive_string_conversion_from_charset(
 1073|     52|				&(a->archive), "UTF-8", 1);
 1074|     52|			if (cab->sconv_utf8 == NULL)
  ------------------
  |  Branch (1074:8): [True: 0, False: 52]
  ------------------
 1075|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1076|     52|		}
 1077|    121|		sconv = cab->sconv_utf8;
 1078|    594|	} else if (cab->sconv != NULL) {
  ------------------
  |  Branch (1078:13): [True: 0, False: 594]
  ------------------
 1079|       |		/* Choose the conversion specified by the option. */
 1080|      0|		sconv = cab->sconv;
 1081|    594|	} else {
 1082|       |		/* Choose the default conversion. */
 1083|    594|		if (!cab->init_default_conversion) {
  ------------------
  |  Branch (1083:7): [True: 433, False: 161]
  ------------------
 1084|    433|			cab->sconv_default =
 1085|    433|			    archive_string_default_conversion_for_read(
 1086|    433|			      &(a->archive));
 1087|    433|			cab->init_default_conversion = 1;
 1088|    433|		}
 1089|    594|		sconv = cab->sconv_default;
 1090|    594|	}
 1091|       |
 1092|       |	/*
 1093|       |	 * Set a default value and common data
 1094|       |	 */
 1095|    715|	r = cab_convert_path_separator_1(&(file->pathname), file->attr);
 1096|    715|	if (archive_entry_copy_pathname_l(entry, file->pathname.s,
  ------------------
  |  |   80|    715|#define archive_entry_copy_pathname_l	__archive_entry_copy_pathname_l
  ------------------
  |  Branch (1096:6): [True: 98, False: 617]
  ------------------
 1097|    715|	    archive_strlen(&(file->pathname)), sconv) != 0) {
  ------------------
  |  |  178|    715|#define	archive_strlen(a) ((a)->length)
  ------------------
 1098|     98|		if (errno == ENOMEM) {
  ------------------
  |  Branch (1098:7): [True: 0, False: 98]
  ------------------
 1099|      0|			archive_set_error(&a->archive, ENOMEM,
 1100|      0|			    "Can't allocate memory for Pathname");
 1101|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1102|      0|		}
 1103|     98|		archive_set_error(&a->archive,
 1104|     98|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     98|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1105|     98|		    "Pathname cannot be converted "
 1106|     98|		    "from %s to current locale",
 1107|     98|		    archive_string_conversion_charset_name(sconv));
 1108|     98|		err = ARCHIVE_WARN;
  ------------------
  |  |  235|     98|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1109|     98|	}
 1110|    715|	if (r < 0) {
  ------------------
  |  Branch (1110:6): [True: 31, False: 684]
  ------------------
 1111|       |		/* Convert a path separator '\' -> '/' */
 1112|     31|		cab_convert_path_separator_2(cab, entry);
 1113|     31|	}
 1114|       |
 1115|    715|	archive_entry_set_size(entry, file->uncompressed_size);
 1116|    715|	if (file->attr & ATTR_RDONLY)
  ------------------
  |  |  346|    715|#define ATTR_RDONLY		0x01
  ------------------
  |  Branch (1116:6): [True: 202, False: 513]
  ------------------
 1117|    202|		archive_entry_set_mode(entry, AE_IFREG | 0555);
  ------------------
  |  |  216|    202|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1118|    513|	else
 1119|    513|		archive_entry_set_mode(entry, AE_IFREG | 0666);
  ------------------
  |  |  216|    513|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1120|    715|	archive_entry_set_mtime(entry, file->mtime, 0);
 1121|       |
 1122|    715|	cab->entry_bytes_remaining = file->uncompressed_size;
 1123|    715|	cab->entry_offset = 0;
 1124|       |	/* We don't need compress data. */
 1125|    715|	if (file->uncompressed_size == 0)
  ------------------
  |  Branch (1125:6): [True: 248, False: 467]
  ------------------
 1126|    248|		cab->end_of_entry_cleanup = cab->end_of_entry = 1;
 1127|       |
 1128|       |	/* Set up a more descriptive format name. */
 1129|    715|	snprintf(cab->format_name, sizeof(cab->format_name), "CAB %d.%d (%s)",
 1130|    715|	    hd->major, hd->minor, cab->entry_cffolder->compname);
 1131|    715|	a->archive.archive_format_name = cab->format_name;
 1132|       |
 1133|    715|	return (err);
 1134|    715|}
archive_read_support_format_cab.c:cab_read_header:
  731|    614|{
  732|    614|	struct cab *cab = a->format->data;
  733|    614|	const char *p;
  734|    614|	struct cfheader *hd;
  735|    614|	size_t bytes, len, maxlen, used;
  736|    614|	ssize_t avail;
  737|    614|	int64_t skip;
  738|    614|	int err, i;
  739|    614|	int cur_folder, prev_folder;
  740|    614|	uint32_t offset32;
  741|       |	
  742|    614|	a->archive.archive_format = ARCHIVE_FORMAT_CAB;
  ------------------
  |  |  383|    614|#define	ARCHIVE_FORMAT_CAB			0xC0000
  ------------------
  743|    614|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (743:6): [True: 614, False: 0]
  ------------------
  744|    614|		a->archive.archive_format_name = "CAB";
  745|       |
  746|    614|	if ((p = __archive_read_ahead(a, 42, NULL)) == NULL)
  ------------------
  |  Branch (746:6): [True: 0, False: 614]
  ------------------
  747|      0|		return (truncated_error(a));
  748|       |
  749|    614|	if (cab->found_header == 0 &&
  ------------------
  |  Branch (749:6): [True: 614, False: 0]
  ------------------
  750|    614|	    p[0] == 'M' && p[1] == 'Z') {
  ------------------
  |  Branch (750:6): [True: 614, False: 0]
  |  Branch (750:21): [True: 153, False: 461]
  ------------------
  751|       |		/* This is an executable?  Must be self-extracting... */
  752|    153|		err = cab_skip_sfx(a);
  753|    153|		if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|    153|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (753:7): [True: 1, False: 152]
  ------------------
  754|      1|			return (err);
  755|       |
  756|       |		/* Re-read header after processing the SFX. */
  757|    152|		if ((p = __archive_read_ahead(a, 42, NULL)) == NULL)
  ------------------
  |  Branch (757:7): [True: 17, False: 135]
  ------------------
  758|     17|			return (truncated_error(a));
  759|    152|	}
  760|       |
  761|    596|	cab->cab_offset = 0;
  762|       |	/*
  763|       |	 * Read CFHEADER.
  764|       |	 */
  765|    596|	hd = &cab->cfheader;
  766|    596|	if (p[CFHEADER_signature+0] != 'M' || p[CFHEADER_signature+1] != 'S' ||
  ------------------
  |  |  253|    596|#define CFHEADER_signature	0
  ------------------
              	if (p[CFHEADER_signature+0] != 'M' || p[CFHEADER_signature+1] != 'S' ||
  ------------------
  |  |  253|    596|#define CFHEADER_signature	0
  ------------------
  |  Branch (766:6): [True: 0, False: 596]
  |  Branch (766:40): [True: 0, False: 596]
  ------------------
  767|    596|	    p[CFHEADER_signature+2] != 'C' || p[CFHEADER_signature+3] != 'F') {
  ------------------
  |  |  253|    596|#define CFHEADER_signature	0
  ------------------
              	    p[CFHEADER_signature+2] != 'C' || p[CFHEADER_signature+3] != 'F') {
  ------------------
  |  |  253|    596|#define CFHEADER_signature	0
  ------------------
  |  Branch (767:6): [True: 0, False: 596]
  |  Branch (767:40): [True: 0, False: 596]
  ------------------
  768|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  769|      0|		    "Couldn't find out CAB header");
  770|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  771|      0|	}
  772|    596|	hd->files_offset = archive_le32dec(p + CFHEADER_coffFiles);
  ------------------
  |  |  255|    596|#define CFHEADER_coffFiles	16
  ------------------
  773|    596|	hd->minor = p[CFHEADER_versionMinor];
  ------------------
  |  |  256|    596|#define CFHEADER_versionMinor	24
  ------------------
  774|    596|	hd->major = p[CFHEADER_versionMajor];
  ------------------
  |  |  257|    596|#define CFHEADER_versionMajor	25
  ------------------
  775|    596|	hd->folder_count = archive_le16dec(p + CFHEADER_cFolders);
  ------------------
  |  |  258|    596|#define CFHEADER_cFolders	26
  ------------------
  776|    596|	if (hd->folder_count == 0)
  ------------------
  |  Branch (776:6): [True: 4, False: 592]
  ------------------
  777|      4|		goto invalid;
  778|    592|	hd->file_count = archive_le16dec(p + CFHEADER_cFiles);
  ------------------
  |  |  259|    592|#define CFHEADER_cFiles		28
  ------------------
  779|    592|	if (hd->file_count == 0)
  ------------------
  |  Branch (779:6): [True: 0, False: 592]
  ------------------
  780|      0|		goto invalid;
  781|    592|	hd->flags = archive_le16dec(p + CFHEADER_flags);
  ------------------
  |  |  260|    592|#define CFHEADER_flags		30
  ------------------
  782|    592|	hd->cabinet = archive_le16dec(p + CFHEADER_iCabinet);
  ------------------
  |  |  262|    592|#define CFHEADER_iCabinet	34
  ------------------
  783|    592|	used = CFHEADER_iCabinet + 2;
  ------------------
  |  |  262|    592|#define CFHEADER_iCabinet	34
  ------------------
  784|    592|	if (hd->flags & RESERVE_PRESENT) {
  ------------------
  |  |  358|    592|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (784:6): [True: 25, False: 567]
  ------------------
  785|     25|		uint16_t cfheader;
  786|     25|		cfheader = archive_le16dec(p + CFHEADER_cbCFHeader);
  ------------------
  |  |  263|     25|#define CFHEADER_cbCFHeader	36
  ------------------
  787|     25|		if (cfheader > 60000U)
  ------------------
  |  Branch (787:7): [True: 2, False: 23]
  ------------------
  788|      2|			goto invalid;
  789|     23|		hd->cffolder = p[CFHEADER_cbCFFolder];
  ------------------
  |  |  264|     23|#define CFHEADER_cbCFFolder	38
  ------------------
  790|     23|		hd->cfdata = p[CFHEADER_cbCFData];
  ------------------
  |  |  265|     23|#define CFHEADER_cbCFData	39
  ------------------
  791|     23|		used += 4;/* cbCFHeader, cbCFFolder and cbCFData */
  792|     23|		used += cfheader;/* abReserve */
  793|     23|	} else
  794|    567|		hd->cffolder = 0;/* Avoid compiling warning. */
  795|    590|	if (hd->flags & PREV_CABINET) {
  ------------------
  |  |  356|    590|#define PREV_CABINET	0x0001
  ------------------
  |  Branch (795:6): [True: 30, False: 560]
  ------------------
  796|       |		/* How many bytes are used for szCabinetPrev. */
  797|     30|		if ((p = cab_read_ahead_remaining(a, used + 256,
  ------------------
  |  Branch (797:7): [True: 1, False: 29]
  ------------------
  798|     30|		    &avail)) == NULL || (size_t)avail <= used)
  ------------------
  |  Branch (798:27): [True: 5, False: 24]
  ------------------
  799|      6|			return (truncated_error(a));
  800|     24|		maxlen = avail - used;
  801|     24|		len = cab_strnlen(p + used, maxlen);
  ------------------
  |  |  649|     24|#define cab_strnlen(a,b) strnlen(a,b)
  ------------------
  802|     24|		if (len == 0 || len == maxlen) {
  ------------------
  |  Branch (802:7): [True: 0, False: 24]
  |  Branch (802:19): [True: 1, False: 23]
  ------------------
  803|      1|			goto invalid;
  804|      1|		}
  805|     23|		used += len + 1;
  806|       |		/* How many bytes are used for szDiskPrev. */
  807|     23|		if ((p = cab_read_ahead_remaining(a, used + 256,
  ------------------
  |  Branch (807:7): [True: 1, False: 22]
  ------------------
  808|     23|		    &avail)) == NULL || (size_t)avail <= used)
  ------------------
  |  Branch (808:27): [True: 0, False: 22]
  ------------------
  809|      1|			return (truncated_error(a));
  810|     22|		maxlen = avail - used;
  811|     22|		len = cab_strnlen(p + used, maxlen);
  ------------------
  |  |  649|     22|#define cab_strnlen(a,b) strnlen(a,b)
  ------------------
  812|     22|		if (len == maxlen)
  ------------------
  |  Branch (812:7): [True: 3, False: 19]
  ------------------
  813|      3|			goto invalid;
  814|     19|		used += len + 1;
  815|     19|	}
  816|    579|	if (hd->flags & NEXT_CABINET) {
  ------------------
  |  |  357|    579|#define NEXT_CABINET	0x0002
  ------------------
  |  Branch (816:6): [True: 19, False: 560]
  ------------------
  817|       |		/* How many bytes are used for szCabinetNext. */
  818|     19|		if ((p = cab_read_ahead_remaining(a, used + 256,
  ------------------
  |  Branch (818:7): [True: 1, False: 18]
  ------------------
  819|     19|		    &avail)) == NULL || (size_t)avail <= used)
  ------------------
  |  Branch (819:27): [True: 1, False: 17]
  ------------------
  820|      2|			return (truncated_error(a));
  821|     17|		maxlen = avail - used;
  822|     17|		len = cab_strnlen(p + used, maxlen);
  ------------------
  |  |  649|     17|#define cab_strnlen(a,b) strnlen(a,b)
  ------------------
  823|     17|		if (len == 0 || len == maxlen)
  ------------------
  |  Branch (823:7): [True: 1, False: 16]
  |  Branch (823:19): [True: 1, False: 15]
  ------------------
  824|      2|			goto invalid;
  825|     15|		used += len + 1;
  826|       |		/* How many bytes are used for szDiskNext. */
  827|     15|		if ((p = cab_read_ahead_remaining(a, used + 256,
  ------------------
  |  Branch (827:7): [True: 1, False: 14]
  ------------------
  828|     15|		    &avail)) == NULL || (size_t)avail <= used)
  ------------------
  |  Branch (828:27): [True: 0, False: 14]
  ------------------
  829|      1|			return (truncated_error(a));
  830|     14|		maxlen = avail - used;
  831|     14|		len = cab_strnlen(p + used, maxlen);
  ------------------
  |  |  649|     14|#define cab_strnlen(a,b) strnlen(a,b)
  ------------------
  832|     14|		if (len == maxlen)
  ------------------
  |  Branch (832:7): [True: 2, False: 12]
  ------------------
  833|      2|			goto invalid;
  834|     12|		used += len + 1;
  835|     12|	}
  836|    572|	__archive_read_consume(a, used);
  837|    572|	cab->cab_offset += used;
  838|    572|	used = 0;
  839|       |
  840|       |	/*
  841|       |	 * Read CFFOLDER.
  842|       |	 */
  843|    572|	hd->folder_array = calloc(
  844|    572|	    hd->folder_count, sizeof(struct cffolder));
  845|    572|	if (hd->folder_array == NULL)
  ------------------
  |  Branch (845:6): [True: 0, False: 572]
  ------------------
  846|      0|		goto nomem;
  847|       |	
  848|    572|	bytes = 8;
  849|    572|	if (hd->flags & RESERVE_PRESENT)
  ------------------
  |  |  358|    572|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (849:6): [True: 15, False: 557]
  ------------------
  850|     15|		bytes += hd->cffolder;
  851|    572|	bytes *= hd->folder_count;
  852|    572|	if ((p = __archive_read_ahead(a, bytes, NULL)) == NULL)
  ------------------
  |  Branch (852:6): [True: 18, False: 554]
  ------------------
  853|     18|		return (truncated_error(a));
  854|    554|	offset32 = 0;
  855|  1.62k|	for (i = 0; i < hd->folder_count; i++) {
  ------------------
  |  Branch (855:14): [True: 1.08k, False: 540]
  ------------------
  856|  1.08k|		struct cffolder *folder = &(hd->folder_array[i]);
  857|  1.08k|		folder->cfdata_offset_in_cab =
  858|  1.08k|		    archive_le32dec(p + CFFOLDER_coffCabStart);
  ------------------
  |  |  268|  1.08k|#define CFFOLDER_coffCabStart	0
  ------------------
  859|  1.08k|		folder->cfdata_count = archive_le16dec(p+CFFOLDER_cCFData);
  ------------------
  |  |  269|  1.08k|#define CFFOLDER_cCFData	4
  ------------------
  860|  1.08k|		folder->comptype =
  861|  1.08k|		    archive_le16dec(p+CFFOLDER_typeCompress) & 0x0F;
  ------------------
  |  |  270|  1.08k|#define CFFOLDER_typeCompress	6
  ------------------
  862|  1.08k|		folder->compdata =
  863|  1.08k|		    archive_le16dec(p+CFFOLDER_typeCompress) >> 8;
  ------------------
  |  |  270|  1.08k|#define CFFOLDER_typeCompress	6
  ------------------
  864|       |		/* Get a compression name. */
  865|  1.08k|		if (folder->comptype <
  ------------------
  |  Branch (865:7): [True: 835, False: 253]
  ------------------
  866|  1.08k|		    sizeof(compression_name) / sizeof(compression_name[0]))
  867|    835|			folder->compname = compression_name[folder->comptype];
  868|    253|		else
  869|    253|			folder->compname = "UNKNOWN";
  870|  1.08k|		p += 8;
  871|  1.08k|		used += 8;
  872|  1.08k|		if (hd->flags & RESERVE_PRESENT) {
  ------------------
  |  |  358|  1.08k|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (872:7): [True: 61, False: 1.02k]
  ------------------
  873|     61|			p += hd->cffolder;/* abReserve */
  874|     61|			used += hd->cffolder;
  875|     61|		}
  876|       |		/*
  877|       |		 * Sanity check if each data is acceptable.
  878|       |		 */
  879|  1.08k|		if (offset32 >= folder->cfdata_offset_in_cab)
  ------------------
  |  Branch (879:7): [True: 14, False: 1.07k]
  ------------------
  880|     14|			goto invalid;
  881|  1.07k|		offset32 = folder->cfdata_offset_in_cab;
  882|       |
  883|       |		/* Set a request to initialize zlib for the CFDATA of
  884|       |		 * this folder. */
  885|  1.07k|		folder->decompress_init = 0;
  886|  1.07k|	}
  887|    540|	__archive_read_consume(a, used);
  888|    540|	cab->cab_offset += used;
  889|       |
  890|       |	/*
  891|       |	 * Read CFFILE.
  892|       |	 */
  893|       |	/* Seek read pointer to the offset of CFFILE if needed. */
  894|    540|	skip = (int64_t)hd->files_offset - cab->cab_offset;
  895|    540|	if (skip < 0) {
  ------------------
  |  Branch (895:6): [True: 7, False: 533]
  ------------------
  896|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      7|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  897|      7|		    "Invalid offset of CFFILE %jd < %jd",
  898|      7|		    (intmax_t)hd->files_offset, (intmax_t)cab->cab_offset);
  899|      7|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  900|      7|	}
  901|    533|	if (skip) {
  ------------------
  |  Branch (901:6): [True: 31, False: 502]
  ------------------
  902|     31|		if (__archive_read_consume(a, skip) < 0)
  ------------------
  |  Branch (902:7): [True: 7, False: 24]
  ------------------
  903|      7|			return (truncated_error(a));
  904|     24|		cab->cab_offset += skip;
  905|     24|	}
  906|       |	/* Allocate memory for CFDATA */
  907|    526|	hd->file_array = calloc(
  908|    526|	    hd->file_count, sizeof(struct cffile));
  909|    526|	if (hd->file_array == NULL)
  ------------------
  |  Branch (909:6): [True: 0, False: 526]
  ------------------
  910|      0|		goto nomem;
  911|       |
  912|    526|	prev_folder = -1;
  913|  1.45k|	for (i = 0; i < hd->file_count; i++) {
  ------------------
  |  Branch (913:14): [True: 992, False: 466]
  ------------------
  914|    992|		struct cffile *file = &(hd->file_array[i]);
  915|       |
  916|    992|		if ((p = __archive_read_ahead(a, 16, NULL)) == NULL)
  ------------------
  |  Branch (916:7): [True: 11, False: 981]
  ------------------
  917|     11|			return (truncated_error(a));
  918|    981|		file->uncompressed_size = archive_le32dec(p + CFFILE_cbFile);
  ------------------
  |  |  274|    981|#define CFFILE_cbFile		0
  ------------------
  919|    981|		file->offset = archive_le32dec(p + CFFILE_uoffFolderStart);
  ------------------
  |  |  275|    981|#define CFFILE_uoffFolderStart	4
  ------------------
  920|    981|		file->folder = archive_le16dec(p + CFFILE_iFolder);
  ------------------
  |  |  276|    981|#define CFFILE_iFolder		8
  ------------------
  921|    981|		file->mtime = cab_dos_time(p + CFFILE_date_time);
  ------------------
  |  |  277|    981|#define CFFILE_date_time	10
  ------------------
  922|    981|		file->attr = (uint8_t)archive_le16dec(p + CFFILE_attribs);
  ------------------
  |  |  278|    981|#define CFFILE_attribs		14
  ------------------
  923|    981|		__archive_read_consume(a, 16);
  924|       |
  925|    981|		cab->cab_offset += 16;
  926|    981|		if ((p = cab_read_ahead_remaining(a, 256, &avail)) == NULL)
  ------------------
  |  Branch (926:7): [True: 3, False: 978]
  ------------------
  927|      3|			return (truncated_error(a));
  928|    978|		maxlen = avail;
  929|    978|		len = cab_strnlen(p, maxlen);
  ------------------
  |  |  649|    978|#define cab_strnlen(a,b) strnlen(a,b)
  ------------------
  930|    978|		if (len == 0 || len == maxlen)
  ------------------
  |  Branch (930:7): [True: 5, False: 973]
  |  Branch (930:19): [True: 4, False: 969]
  ------------------
  931|      9|			goto invalid;
  932|       |
  933|       |		/* Copy a pathname.  */
  934|    969|		archive_string_init(&(file->pathname));
  ------------------
  |  |   71|    969|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 969]
  |  |  ------------------
  ------------------
  935|    969|		archive_strncpy(&(file->pathname), p, len);
  ------------------
  |  |  173|    969|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
  936|    969|		__archive_read_consume(a, len + 1);
  937|    969|		cab->cab_offset += len + 1;
  938|       |
  939|       |		/*
  940|       |		 * Sanity check if each data is acceptable.
  941|       |		 */
  942|    969|		if (file->uncompressed_size > MAX_FILE_SIZE)
  ------------------
  |  |  287|    969|#define MAX_FILE_SIZE		(UINT16_MAX * MAX_UNCOMPRESS_SIZE)
  |  |  ------------------
  |  |  |  |  286|    969|#define MAX_UNCOMPRESS_SIZE	0x8000
  |  |  ------------------
  ------------------
  |  Branch (942:7): [True: 3, False: 966]
  ------------------
  943|      3|			goto invalid;/* Too large */
  944|    966|		if ((int64_t)file->offset + (int64_t)file->uncompressed_size
  ------------------
  |  Branch (944:7): [True: 4, False: 962]
  ------------------
  945|    966|		    > (int64_t)MAX_FILE_SIZE)
  ------------------
  |  |  287|    966|#define MAX_FILE_SIZE		(UINT16_MAX * MAX_UNCOMPRESS_SIZE)
  |  |  ------------------
  |  |  |  |  286|    966|#define MAX_UNCOMPRESS_SIZE	0x8000
  |  |  ------------------
  ------------------
  946|      4|			goto invalid;/* Too large */
  947|    962|		switch (file->folder) {
  948|     12|		case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  343|     12|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (948:3): [True: 12, False: 950]
  ------------------
  949|       |			/* This must be last file in a folder. */
  950|     12|			if (i != hd->file_count -1)
  ------------------
  |  Branch (950:8): [True: 1, False: 11]
  ------------------
  951|      1|				goto invalid;
  952|     11|			cur_folder = hd->folder_count -1;
  953|     11|			break;
  954|      4|		case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  344|      4|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (954:3): [True: 4, False: 958]
  ------------------
  955|       |			/* This must be only one file in a folder. */
  956|      4|			if (hd->file_count != 1)
  ------------------
  |  Branch (956:8): [True: 0, False: 4]
  ------------------
  957|      0|				goto invalid;
  958|       |			/* FALL THROUGH */
  959|     33|		case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  342|     33|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (959:3): [True: 29, False: 933]
  ------------------
  960|       |			/* This must be first file in a folder. */
  961|     33|			if (i != 0)
  ------------------
  |  Branch (961:8): [True: 1, False: 32]
  ------------------
  962|      1|				goto invalid;
  963|     32|			prev_folder = cur_folder = 0;
  964|     32|			offset32 = file->offset;
  965|     32|			break;
  966|    917|		default:
  ------------------
  |  Branch (966:3): [True: 917, False: 45]
  ------------------
  967|    917|			if (file->folder >= hd->folder_count)
  ------------------
  |  Branch (967:8): [True: 12, False: 905]
  ------------------
  968|     12|				goto invalid;
  969|    905|			cur_folder = file->folder;
  970|    905|			break;
  971|    962|		}
  972|       |		/* Dot not back track. */
  973|    948|		if (cur_folder < prev_folder)
  ------------------
  |  Branch (973:7): [True: 1, False: 947]
  ------------------
  974|      1|			goto invalid;
  975|    947|		if (cur_folder != prev_folder)
  ------------------
  |  Branch (975:7): [True: 471, False: 476]
  ------------------
  976|    471|			offset32 = 0;
  977|    947|		prev_folder = cur_folder;
  978|       |
  979|       |		/* Make sure there are not any blanks from last file
  980|       |		 * contents. */
  981|    947|		if (offset32 != file->offset)
  ------------------
  |  Branch (981:7): [True: 12, False: 935]
  ------------------
  982|     12|			goto invalid;
  983|    935|		offset32 += file->uncompressed_size;
  984|       |
  985|       |		/* CFDATA is available for file contents. */
  986|    935|		if (file->uncompressed_size > 0 &&
  ------------------
  |  Branch (986:7): [True: 492, False: 443]
  ------------------
  987|    492|		    hd->folder_array[cur_folder].cfdata_count == 0)
  ------------------
  |  Branch (987:7): [True: 3, False: 489]
  ------------------
  988|      3|			goto invalid;
  989|    935|	}
  990|       |
  991|    466|	if (hd->cabinet != 0 || hd->flags & (PREV_CABINET | NEXT_CABINET)) {
  ------------------
  |  |  356|    317|#define PREV_CABINET	0x0001
  ------------------
              	if (hd->cabinet != 0 || hd->flags & (PREV_CABINET | NEXT_CABINET)) {
  ------------------
  |  |  357|    317|#define NEXT_CABINET	0x0002
  ------------------
  |  Branch (991:6): [True: 149, False: 317]
  |  Branch (991:26): [True: 2, False: 315]
  ------------------
  992|    151|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    151|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  993|    151|		    "Multivolume cabinet file is unsupported");
  994|    151|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|    151|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  995|    151|	}
  996|    315|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    315|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  997|     74|invalid:
  998|     74|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     74|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  999|     74|	    "Invalid CAB header");
 1000|     74|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     74|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1001|      0|nomem:
 1002|      0|	archive_set_error(&a->archive, ENOMEM,
 1003|      0|	    "Can't allocate memory for CAB data");
 1004|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1005|    466|}
archive_read_support_format_cab.c:truncated_error:
  642|    112|{
  643|    112|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    112|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  644|    112|	    "Truncated CAB header");
  645|    112|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    112|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  646|    112|}
archive_read_support_format_cab.c:cab_skip_sfx:
  600|    153|{
  601|    153|	const char *p, *q;
  602|    153|	size_t skip;
  603|    153|	ssize_t bytes, window;
  604|       |
  605|    153|	window = 4096;
  606|    612|	for (;;) {
  607|    612|		const char *h = __archive_read_ahead(a, window, &bytes);
  608|    612|		if (h == NULL) {
  ------------------
  |  Branch (608:7): [True: 460, False: 152]
  ------------------
  609|       |			/* Remaining size is less than window. */
  610|    460|			window >>= 1;
  611|    460|			if (window < 128) {
  ------------------
  |  Branch (611:8): [True: 1, False: 459]
  ------------------
  612|      1|				archive_set_error(&a->archive,
  613|      1|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  614|      1|				    "Couldn't find out CAB header");
  615|      1|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  616|      1|			}
  617|    459|			continue;
  618|    460|		}
  619|    152|		p = h;
  620|    152|		q = p + bytes;
  621|       |
  622|       |		/*
  623|       |		 * Scan ahead until we find something that looks
  624|       |		 * like the cab header.
  625|       |		 */
  626|  9.15k|		while (p + 8 < q) {
  ------------------
  |  Branch (626:10): [True: 9.15k, False: 0]
  ------------------
  627|  9.15k|			size_t next = find_cab_magic(p);
  628|  9.15k|			if (next == 0) {
  ------------------
  |  Branch (628:8): [True: 152, False: 9.00k]
  ------------------
  629|    152|				skip = p - h;
  630|    152|				__archive_read_consume(a, skip);
  631|    152|				return (ARCHIVE_OK);
  ------------------
  |  |  233|    152|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  632|    152|			}
  633|  9.00k|			p += next;
  634|  9.00k|		}
  635|      0|		skip = p - h;
  636|      0|		__archive_read_consume(a, skip);
  637|      0|	}
  638|    153|}
archive_read_support_format_cab.c:cab_read_ahead_remaining:
  667|  1.06k|{
  668|  1.06k|	const void *p = __archive_read_ahead(a, max, avail);
  669|       |
  670|  1.06k|	if (p == NULL && *avail > 0)
  ------------------
  |  Branch (670:6): [True: 578, False: 490]
  |  Branch (670:19): [True: 571, False: 7]
  ------------------
  671|    571|		p = __archive_read_ahead(a, *avail, avail);
  672|  1.06k|	if (p != NULL && (size_t)*avail > max)
  ------------------
  |  Branch (672:6): [True: 1.06k, False: 7]
  |  Branch (672:19): [True: 485, False: 576]
  ------------------
  673|    485|		*avail = max;
  674|       |
  675|  1.06k|	return (p);
  676|  1.06k|}
archive_read_support_format_cab.c:cab_dos_time:
 2172|    981|{
 2173|    981|	int msTime, msDate;
 2174|    981|	struct tm ts;
 2175|       |
 2176|    981|	msDate = archive_le16dec(p);
 2177|    981|	msTime = archive_le16dec(p+2);
 2178|       |
 2179|    981|	memset(&ts, 0, sizeof(ts));
 2180|    981|	ts.tm_year = ((msDate >> 9) & 0x7f) + 80;   /* Years since 1900. */
 2181|    981|	ts.tm_mon = ((msDate >> 5) & 0x0f) - 1;     /* Month number.     */
 2182|    981|	ts.tm_mday = msDate & 0x1f;		    /* Day of month.     */
 2183|    981|	ts.tm_hour = (msTime >> 11) & 0x1f;
 2184|    981|	ts.tm_min = (msTime >> 5) & 0x3f;
 2185|    981|	ts.tm_sec = (msTime << 1) & 0x3e;
 2186|    981|	ts.tm_isdst = -1;
 2187|    981|	return (mktime(&ts));
 2188|    981|}
archive_read_support_format_cab.c:cab_convert_path_separator_1:
  681|    715|{
  682|    715|	size_t i;
  683|    715|	int mb;
  684|       |
  685|       |	/* Easy check if we have '\' in multi-byte string. */
  686|    715|	mb = 0;
  687|  7.55k|	for (i = 0; i < archive_strlen(fn); i++) {
  ------------------
  |  |  178|  7.55k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (687:14): [True: 6.87k, False: 684]
  ------------------
  688|  6.87k|		if (fn->s[i] == '\\') {
  ------------------
  |  Branch (688:7): [True: 309, False: 6.56k]
  ------------------
  689|    309|			if (mb) {
  ------------------
  |  Branch (689:8): [True: 31, False: 278]
  ------------------
  690|       |				/* This may be second byte of multi-byte
  691|       |				 * character. */
  692|     31|				break;
  693|     31|			}
  694|    278|			fn->s[i] = '/';
  695|    278|			mb = 0;
  696|  6.56k|		} else if ((fn->s[i] & 0x80) && !(attr & ATTR_NAME_IS_UTF))
  ------------------
  |  |  347|  1.90k|#define ATTR_NAME_IS_UTF	0x80
  ------------------
  |  Branch (696:14): [True: 1.90k, False: 4.66k]
  |  Branch (696:35): [True: 1.33k, False: 564]
  ------------------
  697|  1.33k|			mb = 1;
  698|  5.23k|		else
  699|  5.23k|			mb = 0;
  700|  6.87k|	}
  701|    715|	if (i == archive_strlen(fn))
  ------------------
  |  |  178|    715|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (701:6): [True: 684, False: 31]
  ------------------
  702|    684|		return (0);
  703|     31|	return (-1);
  704|    715|}
archive_read_support_format_cab.c:cab_convert_path_separator_2:
  711|     31|{
  712|     31|	const wchar_t *wp;
  713|     31|	size_t i;
  714|       |
  715|       |	/* If a conversion to wide character failed, force the replacement. */
  716|     31|	if ((wp = archive_entry_pathname_w(entry)) != NULL) {
  ------------------
  |  Branch (716:6): [True: 0, False: 31]
  ------------------
  717|      0|		archive_wstrcpy(&(cab->ws), wp);
  ------------------
  |  |  167|      0|	archive_wstrncpy((as), (p), ((p) == NULL ? 0 : wcslen(p)))
  |  |  ------------------
  |  |  |  |  175|      0|	((as)->length = 0, archive_wstrncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (175:50): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  718|      0|		for (i = 0; i < archive_strlen(&(cab->ws)); i++) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (718:15): [True: 0, False: 0]
  ------------------
  719|      0|			if (cab->ws.s[i] == L'\\')
  ------------------
  |  Branch (719:8): [True: 0, False: 0]
  ------------------
  720|      0|				cab->ws.s[i] = L'/';
  721|      0|		}
  722|      0|		archive_entry_copy_pathname_w(entry, cab->ws.s);
  723|      0|	}
  724|     31|}
archive_read_support_format_cab.c:archive_read_format_cab_read_data:
 1139|    975|{
 1140|    975|	struct cab *cab = a->format->data;
 1141|    975|	int r;
 1142|       |
 1143|    975|	switch (cab->entry_cffile->folder) {
 1144|     23|	case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  342|     23|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1144:2): [True: 23, False: 952]
  ------------------
 1145|     32|	case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  343|     32|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1145:2): [True: 9, False: 966]
  ------------------
 1146|     36|	case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  344|     36|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1146:2): [True: 4, False: 971]
  ------------------
 1147|     36|		*buff = NULL;
 1148|     36|		*size = 0;
 1149|     36|		*offset = 0;
 1150|     36|		archive_clear_error(&a->archive);
 1151|     36|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     36|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1152|     36|		    "Cannot restore this file split in multivolume");
 1153|     36|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     36|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1154|    939|	default:
  ------------------
  |  Branch (1154:2): [True: 939, False: 36]
  ------------------
 1155|    939|		break;
 1156|    975|	}
 1157|    939|	if (cab->read_data_invoked == 0) {
  ------------------
  |  Branch (1157:6): [True: 460, False: 479]
  ------------------
 1158|    460|		if (cab->bytes_skipped) {
  ------------------
  |  Branch (1158:7): [True: 19, False: 441]
  ------------------
 1159|     19|			if (cab->entry_cfdata == NULL) {
  ------------------
  |  Branch (1159:8): [True: 19, False: 0]
  ------------------
 1160|     19|				r = cab_next_cfdata(a);
 1161|     19|				if (r < 0)
  ------------------
  |  Branch (1161:9): [True: 3, False: 16]
  ------------------
 1162|      3|					return (r);
 1163|     19|			}
 1164|     16|			if (cab_consume_cfdata(a, cab->bytes_skipped) < 0)
  ------------------
  |  Branch (1164:8): [True: 6, False: 10]
  ------------------
 1165|      6|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1166|     10|			cab->bytes_skipped = 0;
 1167|     10|		}
 1168|    451|		cab->read_data_invoked = 1;
 1169|    451|	}
 1170|    930|	if (cab->entry_unconsumed) {
  ------------------
  |  Branch (1170:6): [True: 224, False: 706]
  ------------------
 1171|       |		/* Consume as much as the compressor actually used. */
 1172|    224|		r = (int)cab_consume_cfdata(a, cab->entry_unconsumed);
 1173|    224|		cab->entry_unconsumed = 0;
 1174|    224|		if (r < 0)
  ------------------
  |  Branch (1174:7): [True: 0, False: 224]
  ------------------
 1175|      0|			return (r);
 1176|    224|	}
 1177|    930|	if (cab->end_of_archive || cab->end_of_entry) {
  ------------------
  |  Branch (1177:6): [True: 0, False: 930]
  |  Branch (1177:29): [True: 314, False: 616]
  ------------------
 1178|    314|		if (!cab->end_of_entry_cleanup) {
  ------------------
  |  Branch (1178:7): [True: 36, False: 278]
  ------------------
 1179|       |			/* End-of-entry cleanup done. */
 1180|     36|			cab->end_of_entry_cleanup = 1;
 1181|     36|		}
 1182|    314|		*offset = cab->entry_offset;
 1183|    314|		*size = 0;
 1184|    314|		*buff = NULL;
 1185|    314|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|    314|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1186|    314|	}
 1187|       |
 1188|    616|	return (cab_read_data(a, buff, size, offset));
 1189|    930|}
archive_read_support_format_cab.c:cab_next_cfdata:
 1324|    701|{
 1325|    701|	struct cab *cab = a->format->data;
 1326|    701|	struct cfdata *cfdata = cab->entry_cfdata;
 1327|       |
 1328|       |	/* There are remaining bytes in current CFDATA, use it first. */
 1329|    701|	if (cfdata != NULL && cfdata->uncompressed_bytes_remaining > 0)
  ------------------
  |  Branch (1329:6): [True: 241, False: 460]
  |  Branch (1329:24): [True: 49, False: 192]
  ------------------
 1330|     49|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     49|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1331|       |
 1332|    652|	if (cfdata == NULL) {
  ------------------
  |  Branch (1332:6): [True: 460, False: 192]
  ------------------
 1333|    460|		int64_t skip;
 1334|       |
 1335|    460|		cab->entry_cffolder->cfdata_index = 0;
 1336|       |
 1337|       |		/* Seek read pointer to the offset of CFDATA if needed. */
 1338|    460|		skip = cab->entry_cffolder->cfdata_offset_in_cab
 1339|    460|			- cab->cab_offset;
 1340|    460|		if (skip < 0) {
  ------------------
  |  Branch (1340:7): [True: 12, False: 448]
  ------------------
 1341|     12|			int folder_index;
 1342|     12|			switch (cab->entry_cffile->folder) {
 1343|      0|			case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  342|      0|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1343:4): [True: 0, False: 12]
  ------------------
 1344|      0|			case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  344|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1344:4): [True: 0, False: 12]
  ------------------
 1345|      0|				folder_index = 0;
 1346|      0|				break;
 1347|      0|			case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  343|      0|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1347:4): [True: 0, False: 12]
  ------------------
 1348|      0|				folder_index = cab->cfheader.folder_count-1;
 1349|      0|				break;
 1350|     12|			default:
  ------------------
  |  Branch (1350:4): [True: 12, False: 0]
  ------------------
 1351|     12|				folder_index = cab->entry_cffile->folder;
 1352|     12|				break;
 1353|     12|			}
 1354|     12|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     12|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1355|     12|			    "Invalid offset of CFDATA in folder(%d) %jd < %jd",
 1356|     12|			    folder_index,
 1357|     12|			    (intmax_t)cab->entry_cffolder->cfdata_offset_in_cab,
 1358|     12|			    (intmax_t)cab->cab_offset);
 1359|     12|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1360|     12|		}
 1361|    448|		if (skip > 0) {
  ------------------
  |  Branch (1361:7): [True: 225, False: 223]
  ------------------
 1362|    225|			if (__archive_read_consume(a, skip) < 0)
  ------------------
  |  Branch (1362:8): [True: 29, False: 196]
  ------------------
 1363|     29|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     29|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1364|    196|			cab->cab_offset =
 1365|    196|			    cab->entry_cffolder->cfdata_offset_in_cab;
 1366|    196|		}
 1367|    448|	}
 1368|       |
 1369|       |	/*
 1370|       |	 * Read a CFDATA.
 1371|       |	 */
 1372|    611|	if (cab->entry_cffolder->cfdata_index <
  ------------------
  |  Branch (1372:6): [True: 561, False: 50]
  ------------------
 1373|    611|	    cab->entry_cffolder->cfdata_count) {
 1374|    561|		const unsigned char *p;
 1375|    561|		int l;
 1376|       |
 1377|    561|		cfdata = &(cab->entry_cffolder->cfdata);
 1378|    561|		cab->entry_cffolder->cfdata_index++;
 1379|    561|		cab->entry_cfdata = cfdata;
 1380|    561|		cfdata->sum_calculated = 0;
 1381|    561|		cfdata->sum_extra_avail = 0;
 1382|    561|		cfdata->sum_ptr = NULL;
 1383|    561|		l = 8;
 1384|    561|		if (cab->cfheader.flags & RESERVE_PRESENT)
  ------------------
  |  |  358|    561|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (1384:7): [True: 2, False: 559]
  ------------------
 1385|      2|			l += cab->cfheader.cfdata;
 1386|    561|		if ((p = __archive_read_ahead(a, l, NULL)) == NULL)
  ------------------
  |  Branch (1386:7): [True: 16, False: 545]
  ------------------
 1387|     16|			return (truncated_error(a));
 1388|    545|		cfdata->sum = archive_le32dec(p + CFDATA_csum);
  ------------------
  |  |  281|    545|#define CFDATA_csum		0
  ------------------
 1389|    545|		cfdata->compressed_size = archive_le16dec(p + CFDATA_cbData);
  ------------------
  |  |  282|    545|#define CFDATA_cbData		4
  ------------------
 1390|    545|		cfdata->compressed_bytes_remaining = cfdata->compressed_size;
 1391|    545|		cfdata->uncompressed_size =
 1392|    545|		    archive_le16dec(p + CFDATA_cbUncomp);
  ------------------
  |  |  283|    545|#define CFDATA_cbUncomp		6
  ------------------
 1393|    545|		cfdata->uncompressed_bytes_remaining =
 1394|    545|		    cfdata->uncompressed_size;
 1395|    545|		cfdata->uncompressed_avail = 0;
 1396|    545|		cfdata->read_offset = 0;
 1397|    545|		cfdata->unconsumed = 0;
 1398|       |
 1399|       |		/*
 1400|       |		 * Sanity check if data size is acceptable.
 1401|       |		 */
 1402|    545|		if (cfdata->compressed_size == 0 ||
  ------------------
  |  Branch (1402:7): [True: 10, False: 535]
  ------------------
 1403|    535|		    cfdata->compressed_size > (MAX_UNCOMPRESS_SIZE + 6144))
  ------------------
  |  |  286|    535|#define MAX_UNCOMPRESS_SIZE	0x8000
  ------------------
  |  Branch (1403:7): [True: 3, False: 532]
  ------------------
 1404|     13|			goto invalid;
 1405|    532|		if (cfdata->uncompressed_size > MAX_UNCOMPRESS_SIZE)
  ------------------
  |  |  286|    532|#define MAX_UNCOMPRESS_SIZE	0x8000
  ------------------
  |  Branch (1405:7): [True: 1, False: 531]
  ------------------
 1406|      1|			goto invalid;
 1407|    531|		if (cfdata->uncompressed_size == 0) {
  ------------------
  |  Branch (1407:7): [True: 3, False: 528]
  ------------------
 1408|      3|			switch (cab->entry_cffile->folder) {
 1409|      0|			case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  344|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1409:4): [True: 0, False: 3]
  ------------------
 1410|      1|			case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  343|      1|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1410:4): [True: 1, False: 2]
  ------------------
 1411|      1|				break;
 1412|      0|			case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  342|      0|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1412:4): [True: 0, False: 3]
  ------------------
 1413|      2|			default:
  ------------------
  |  Branch (1413:4): [True: 2, False: 1]
  ------------------
 1414|      2|				goto invalid;
 1415|      3|			}
 1416|      3|		}
 1417|       |		/* If CFDATA is not last in a folder, an uncompressed
 1418|       |		 * size must be 0x8000 (32 KiB) */
 1419|    529|		if ((cab->entry_cffolder->cfdata_index <
  ------------------
  |  Branch (1419:7): [True: 253, False: 276]
  ------------------
 1420|    529|		     cab->entry_cffolder->cfdata_count) &&
 1421|    253|		       cfdata->uncompressed_size != MAX_UNCOMPRESS_SIZE)
  ------------------
  |  |  286|    253|#define MAX_UNCOMPRESS_SIZE	0x8000
  ------------------
  |  Branch (1421:10): [True: 10, False: 243]
  ------------------
 1422|     10|			goto invalid;
 1423|       |
 1424|       |		/* A compressed data size and an uncompressed data size must
 1425|       |		 * be the same in no compression mode. */
 1426|    519|		if (cab->entry_cffolder->comptype == COMPTYPE_NONE &&
  ------------------
  |  |  324|  1.03k|#define COMPTYPE_NONE		0x0000
  ------------------
  |  Branch (1426:7): [True: 25, False: 494]
  ------------------
 1427|     25|		    cfdata->compressed_size != cfdata->uncompressed_size)
  ------------------
  |  Branch (1427:7): [True: 3, False: 22]
  ------------------
 1428|      3|			goto invalid;
 1429|       |
 1430|       |		/*
 1431|       |		 * Save CFDATA image for sum check.
 1432|       |		 */
 1433|    516|		if (cfdata->memimage_size < (size_t)l) {
  ------------------
  |  Branch (1433:7): [True: 382, False: 134]
  ------------------
 1434|    382|			free(cfdata->memimage);
 1435|    382|			cfdata->memimage = malloc(l);
 1436|    382|			if (cfdata->memimage == NULL) {
  ------------------
  |  Branch (1436:8): [True: 0, False: 382]
  ------------------
 1437|      0|				archive_set_error(&a->archive, ENOMEM,
 1438|      0|				    "Can't allocate memory for CAB data");
 1439|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1440|      0|			}
 1441|    382|			cfdata->memimage_size = l;
 1442|    382|		}
 1443|    516|		memcpy(cfdata->memimage, p, l);
 1444|       |
 1445|       |		/* Consume bytes as much as we used. */
 1446|    516|		__archive_read_consume(a, l);
 1447|    516|		cab->cab_offset += l;
 1448|    516|	} else if (cab->entry_cffolder->cfdata_count > 0) {
  ------------------
  |  Branch (1448:13): [True: 36, False: 14]
  ------------------
 1449|       |		/* Run out of all CFDATA in a folder. */
 1450|     36|		cfdata->compressed_size = 0;
 1451|     36|		cfdata->uncompressed_size = 0;
 1452|     36|		cfdata->compressed_bytes_remaining = 0;
 1453|     36|		cfdata->uncompressed_bytes_remaining = 0;
 1454|     36|	} else {
 1455|       |		/* Current folder does not have any CFDATA. */
 1456|     14|		cfdata = &(cab->entry_cffolder->cfdata);
 1457|     14|		cab->entry_cfdata = cfdata;
 1458|     14|		memset(cfdata, 0, sizeof(*cfdata));
 1459|     14|	}
 1460|    566|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    566|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1461|     29|invalid:
 1462|     29|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     29|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1463|     29|	    "Invalid CFDATA");
 1464|     29|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     29|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1465|    611|}
archive_read_support_format_cab.c:cab_consume_cfdata:
 1893|    253|{
 1894|    253|	struct cab *cab = a->format->data;
 1895|    253|	struct cfdata *cfdata;
 1896|    253|	int64_t cbytes, rbytes;
 1897|    253|	int err;
 1898|       |
 1899|    253|	rbytes = cab_minimum_consume_cfdata(a, consumed_bytes);
 1900|    253|	if (rbytes < 0)
  ------------------
  |  Branch (1900:6): [True: 0, False: 253]
  ------------------
 1901|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1902|       |
 1903|    253|	cfdata = cab->entry_cfdata;
 1904|    267|	while (rbytes > 0) {
  ------------------
  |  Branch (1904:9): [True: 32, False: 235]
  ------------------
 1905|     32|		ssize_t avail;
 1906|       |
 1907|     32|		if (cfdata->compressed_size == 0) {
  ------------------
  |  Branch (1907:7): [True: 1, False: 31]
  ------------------
 1908|      1|			archive_set_error(&a->archive,
 1909|      1|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1910|      1|			    "Invalid CFDATA");
 1911|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1912|      1|		}
 1913|     31|		cbytes = cfdata->uncompressed_bytes_remaining;
 1914|     31|		if (cbytes > rbytes)
  ------------------
  |  Branch (1914:7): [True: 14, False: 17]
  ------------------
 1915|     14|			cbytes = rbytes;
 1916|     31|		rbytes -= cbytes;
 1917|       |
 1918|     31|		if (cfdata->uncompressed_avail == 0 &&
  ------------------
  |  Branch (1918:7): [True: 24, False: 7]
  ------------------
 1919|     24|		   (cab->entry_cffile->folder == iFoldCONTINUED_PREV_AND_NEXT ||
  ------------------
  |  |  344|     48|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1919:7): [True: 0, False: 24]
  ------------------
 1920|     24|		    cab->entry_cffile->folder == iFoldCONTINUED_FROM_PREV)) {
  ------------------
  |  |  342|     24|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1920:7): [True: 0, False: 24]
  ------------------
 1921|       |			/* We have not read any data yet. */
 1922|      0|			if (cbytes == cfdata->uncompressed_bytes_remaining) {
  ------------------
  |  Branch (1922:8): [True: 0, False: 0]
  ------------------
 1923|       |				/* Skip whole current CFDATA. */
 1924|      0|				__archive_read_consume(a,
 1925|      0|				    cfdata->compressed_size);
 1926|      0|				cab->cab_offset += cfdata->compressed_size;
 1927|      0|				cfdata->compressed_bytes_remaining = 0;
 1928|      0|				cfdata->uncompressed_bytes_remaining = 0;
 1929|      0|				err = cab_next_cfdata(a);
 1930|      0|				if (err < 0)
  ------------------
  |  Branch (1930:9): [True: 0, False: 0]
  ------------------
 1931|      0|					return (err);
 1932|      0|				cfdata = cab->entry_cfdata;
 1933|      0|				if (cfdata->uncompressed_size == 0) {
  ------------------
  |  Branch (1933:9): [True: 0, False: 0]
  ------------------
 1934|      0|					switch (cab->entry_cffile->folder) {
 1935|      0|					case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  344|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1935:6): [True: 0, False: 0]
  ------------------
 1936|      0|					case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  343|      0|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1936:6): [True: 0, False: 0]
  ------------------
 1937|      0|					case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  342|      0|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1937:6): [True: 0, False: 0]
  ------------------
 1938|      0|						rbytes = 0;
 1939|      0|						break;
 1940|      0|					default:
  ------------------
  |  Branch (1940:6): [True: 0, False: 0]
  ------------------
 1941|      0|						break;
 1942|      0|					}
 1943|      0|				}
 1944|      0|				continue;
 1945|      0|			}
 1946|      0|			cfdata->read_offset += (uint16_t)cbytes;
 1947|      0|			cfdata->uncompressed_bytes_remaining -= (uint16_t)cbytes;
 1948|      0|			break;
 1949|     31|		} else if (cbytes == 0) {
  ------------------
  |  Branch (1949:14): [True: 7, False: 24]
  ------------------
 1950|      7|			err = cab_next_cfdata(a);
 1951|      7|			if (err < 0)
  ------------------
  |  Branch (1951:8): [True: 3, False: 4]
  ------------------
 1952|      3|				return (err);
 1953|      4|			cfdata = cab->entry_cfdata;
 1954|      4|			if (cfdata->uncompressed_size == 0) {
  ------------------
  |  Branch (1954:8): [True: 2, False: 2]
  ------------------
 1955|      2|				switch (cab->entry_cffile->folder) {
 1956|      0|				case iFoldCONTINUED_PREV_AND_NEXT:
  ------------------
  |  |  344|      0|#define iFoldCONTINUED_PREV_AND_NEXT	0xFFFF
  ------------------
  |  Branch (1956:5): [True: 0, False: 2]
  ------------------
 1957|      1|				case iFoldCONTINUED_TO_NEXT:
  ------------------
  |  |  343|      1|#define iFoldCONTINUED_TO_NEXT		0xFFFE
  ------------------
  |  Branch (1957:5): [True: 1, False: 1]
  ------------------
 1958|      1|				case iFoldCONTINUED_FROM_PREV:
  ------------------
  |  |  342|      1|#define iFoldCONTINUED_FROM_PREV	0xFFFD
  ------------------
  |  Branch (1958:5): [True: 0, False: 2]
  ------------------
 1959|      1|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1960|      1|				default:
  ------------------
  |  Branch (1960:5): [True: 1, False: 1]
  ------------------
 1961|      1|					break;
 1962|      2|				}
 1963|      2|			}
 1964|      3|			continue;
 1965|      4|		}
 1966|     38|		while (cbytes > 0) {
  ------------------
  |  Branch (1966:10): [True: 27, False: 11]
  ------------------
 1967|     27|			(void)cab_read_ahead_cfdata(a, &avail);
 1968|     27|			if (avail <= 0)
  ------------------
  |  Branch (1968:8): [True: 13, False: 14]
  ------------------
 1969|     13|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     13|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1970|     14|			if (avail > cbytes)
  ------------------
  |  Branch (1970:8): [True: 10, False: 4]
  ------------------
 1971|     10|				avail = (ssize_t)cbytes;
 1972|     14|			if (cab_minimum_consume_cfdata(a, avail) < 0)
  ------------------
  |  Branch (1972:8): [True: 0, False: 14]
  ------------------
 1973|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1974|     14|			cbytes -= avail;
 1975|     14|		}
 1976|     24|	}
 1977|    235|	return (consumed_bytes);
 1978|    253|}
archive_read_support_format_cab.c:cab_minimum_consume_cfdata:
 1986|  1.75k|{
 1987|  1.75k|	struct cab *cab = a->format->data;
 1988|  1.75k|	struct cfdata *cfdata;
 1989|  1.75k|	int64_t cbytes, rbytes;
 1990|  1.75k|	int err;
 1991|       |
 1992|  1.75k|	cfdata = cab->entry_cfdata;
 1993|  1.75k|	rbytes = consumed_bytes;
 1994|  1.75k|	if (cab->entry_cffolder->comptype == COMPTYPE_NONE) {
  ------------------
  |  |  324|  1.75k|#define COMPTYPE_NONE		0x0000
  ------------------
  |  Branch (1994:6): [True: 45, False: 1.71k]
  ------------------
 1995|     45|		if (consumed_bytes < cfdata->unconsumed)
  ------------------
  |  Branch (1995:7): [True: 10, False: 35]
  ------------------
 1996|     10|			cbytes = consumed_bytes;
 1997|     35|		else
 1998|     35|			cbytes = cfdata->unconsumed;
 1999|     45|		rbytes -= cbytes; 
 2000|     45|		cfdata->read_offset += (uint16_t)cbytes;
 2001|     45|		cfdata->uncompressed_bytes_remaining -= (uint16_t)cbytes;
 2002|     45|		cfdata->unconsumed -= cbytes;
 2003|  1.71k|	} else {
 2004|  1.71k|		cbytes = cfdata->uncompressed_avail - cfdata->read_offset;
 2005|  1.71k|		if (cbytes > 0) {
  ------------------
  |  Branch (2005:7): [True: 214, False: 1.49k]
  ------------------
 2006|    214|			if (consumed_bytes < cbytes)
  ------------------
  |  Branch (2006:8): [True: 25, False: 189]
  ------------------
 2007|     25|				cbytes = consumed_bytes;
 2008|    214|			rbytes -= cbytes;
 2009|    214|			cfdata->read_offset += (uint16_t)cbytes;
 2010|    214|			cfdata->uncompressed_bytes_remaining -= (uint16_t)cbytes;
 2011|    214|		}
 2012|       |
 2013|  1.71k|		if (cfdata->unconsumed) {
  ------------------
  |  Branch (2013:7): [True: 1.36k, False: 352]
  ------------------
 2014|  1.36k|			cbytes = cfdata->unconsumed;
 2015|  1.36k|			cfdata->unconsumed = 0;
 2016|  1.36k|		} else
 2017|    352|			cbytes = 0;
 2018|  1.71k|	}
 2019|  1.75k|	if (cbytes) {
  ------------------
  |  Branch (2019:6): [True: 1.39k, False: 366]
  ------------------
 2020|       |		/* Compute the sum. */
 2021|  1.39k|		cab_checksum_update(a, (size_t)cbytes);
 2022|       |
 2023|       |		/* Consume as much as the compressor actually used. */
 2024|  1.39k|		__archive_read_consume(a, cbytes);
 2025|  1.39k|		cab->cab_offset += cbytes;
 2026|  1.39k|		cfdata->compressed_bytes_remaining -= (uint16_t)cbytes;
 2027|  1.39k|		if (cfdata->compressed_bytes_remaining == 0) {
  ------------------
  |  Branch (2027:7): [True: 212, False: 1.18k]
  ------------------
 2028|    212|			err = cab_checksum_finish(a);
 2029|    212|			if (err < 0)
  ------------------
  |  Branch (2029:8): [True: 0, False: 212]
  ------------------
 2030|      0|				return (err);
 2031|    212|		}
 2032|  1.39k|	}
 2033|  1.75k|	return (rbytes);
 2034|  1.75k|}
archive_read_support_format_cab.c:cab_checksum_update:
 1239|  1.39k|{
 1240|  1.39k|	struct cab *cab = a->format->data;
 1241|  1.39k|	struct cfdata *cfdata = cab->entry_cfdata;
 1242|  1.39k|	const unsigned char *p;
 1243|  1.39k|	size_t sumbytes;
 1244|       |
 1245|  1.39k|	if (cfdata->sum == 0 || cfdata->sum_ptr == NULL)
  ------------------
  |  Branch (1245:6): [True: 132, False: 1.26k]
  |  Branch (1245:26): [True: 0, False: 1.26k]
  ------------------
 1246|    132|		return;
 1247|       |	/*
 1248|       |	 * Calculate the sum of this CFDATA.
 1249|       |	 * Make sure CFDATA must be calculated in four bytes.
 1250|       |	 */
 1251|  1.26k|	p = cfdata->sum_ptr;
 1252|  1.26k|	sumbytes = bytes;
 1253|  1.26k|	if (cfdata->sum_extra_avail) {
  ------------------
  |  Branch (1253:6): [True: 567, False: 693]
  ------------------
 1254|  1.68k|		while (cfdata->sum_extra_avail < 4 && sumbytes > 0) {
  ------------------
  |  Branch (1254:10): [True: 1.12k, False: 565]
  |  Branch (1254:41): [True: 1.12k, False: 2]
  ------------------
 1255|  1.12k|			cfdata->sum_extra[
 1256|  1.12k|			    cfdata->sum_extra_avail++] = *p++;
 1257|  1.12k|			sumbytes--;
 1258|  1.12k|		}
 1259|    567|		if (cfdata->sum_extra_avail == 4) {
  ------------------
  |  Branch (1259:7): [True: 565, False: 2]
  ------------------
 1260|    565|			cfdata->sum_calculated = cab_checksum_cfdata_4(
 1261|    565|			    cfdata->sum_extra, 4, cfdata->sum_calculated);
 1262|    565|			cfdata->sum_extra_avail = 0;
 1263|    565|		}
 1264|    567|	}
 1265|  1.26k|	if (sumbytes) {
  ------------------
  |  Branch (1265:6): [True: 1.25k, False: 4]
  ------------------
 1266|  1.25k|		int odd = sumbytes & 3;
 1267|  1.25k|		if ((int)(sumbytes - odd) > 0)
  ------------------
  |  Branch (1267:7): [True: 1.22k, False: 34]
  ------------------
 1268|  1.22k|			cfdata->sum_calculated = cab_checksum_cfdata_4(
 1269|  1.22k|			    p, sumbytes - odd, cfdata->sum_calculated);
 1270|  1.25k|		if (odd)
  ------------------
  |  Branch (1270:7): [True: 837, False: 419]
  ------------------
 1271|    837|			memcpy(cfdata->sum_extra, p + sumbytes - odd, odd);
 1272|  1.25k|		cfdata->sum_extra_avail = odd;
 1273|  1.25k|	}
 1274|       |	cfdata->sum_ptr = NULL;
 1275|  1.26k|}
archive_read_support_format_cab.c:cab_checksum_cfdata_4:
 1193|  2.17k|{
 1194|  2.17k|	const unsigned char *b;
 1195|  2.17k|	unsigned u32num;
 1196|  2.17k|	uint32_t sum;
 1197|       |
 1198|  2.17k|	u32num = (unsigned)bytes / 4;
 1199|  2.17k|	sum = seed;
 1200|  2.17k|	b = p;
 1201|   112k|	for (;u32num > 0; --u32num) {
  ------------------
  |  Branch (1201:8): [True: 110k, False: 2.17k]
  ------------------
 1202|   110k|		sum ^= archive_le32dec(b);
 1203|   110k|		b += 4;
 1204|   110k|	}
 1205|  2.17k|	return (sum);
 1206|  2.17k|}
archive_read_support_format_cab.c:cab_checksum_finish:
 1279|    212|{
 1280|    212|	struct cab *cab = a->format->data;
 1281|    212|	struct cfdata *cfdata = cab->entry_cfdata;
 1282|    212|	int l;
 1283|       |
 1284|       |	/* Do not need to compute a sum. */
 1285|    212|	if (cfdata->sum == 0)
  ------------------
  |  Branch (1285:6): [True: 7, False: 205]
  ------------------
 1286|      7|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      7|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1287|       |
 1288|       |	/*
 1289|       |	 * Calculate the sum of remaining CFDATA.
 1290|       |	 */
 1291|    205|	if (cfdata->sum_extra_avail) {
  ------------------
  |  Branch (1291:6): [True: 180, False: 25]
  ------------------
 1292|    180|		cfdata->sum_calculated =
 1293|    180|		    cab_checksum_cfdata(cfdata->sum_extra,
 1294|    180|		       cfdata->sum_extra_avail, cfdata->sum_calculated);
 1295|    180|		cfdata->sum_extra_avail = 0;
 1296|    180|	}
 1297|       |
 1298|    205|	l = 4;
 1299|    205|	if (cab->cfheader.flags & RESERVE_PRESENT)
  ------------------
  |  |  358|    205|#define RESERVE_PRESENT	0x0004
  ------------------
  |  Branch (1299:6): [True: 0, False: 205]
  ------------------
 1300|      0|		l += cab->cfheader.cfdata;
 1301|    205|	if (cfdata->memimage == NULL) {
  ------------------
  |  Branch (1301:6): [True: 0, False: 205]
  ------------------
 1302|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1303|      0|	}
 1304|    205|	cfdata->sum_calculated = cab_checksum_cfdata(
 1305|    205|	    cfdata->memimage + CFDATA_cbData, l, cfdata->sum_calculated);
  ------------------
  |  |  282|    205|#define CFDATA_cbData		4
  ------------------
 1306|    205|	if (cfdata->sum_calculated != cfdata->sum) {
  ------------------
  |  Branch (1306:6): [True: 204, False: 1]
  ------------------
 1307|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 1308|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 1309|       |		    "Checksum error CFDATA[%d] %" PRIx32 ":%" PRIx32 " in %d bytes",
 1310|       |		    cab->entry_cffolder->cfdata_index -1,
 1311|       |		    cfdata->sum, cfdata->sum_calculated,
 1312|       |		    cfdata->compressed_size);
 1313|       |		return (ARCHIVE_FAILED);
 1314|       |#endif
 1315|    204|	}
 1316|    205|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    205|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1317|    205|}
archive_read_support_format_cab.c:cab_checksum_cfdata:
 1210|    385|{
 1211|    385|	const unsigned char *b;
 1212|    385|	uint32_t sum;
 1213|    385|	uint32_t t;
 1214|       |
 1215|    385|	sum = cab_checksum_cfdata_4(p, bytes, seed);
 1216|    385|	b = p;
 1217|    385|	b += bytes & ~3;
 1218|    385|	t = 0;
 1219|    385|	switch (bytes & 3) {
 1220|      9|	case 3:
  ------------------
  |  Branch (1220:2): [True: 9, False: 376]
  ------------------
 1221|      9|		t |= ((uint32_t)(*b++)) << 16;
 1222|       |		/* FALL THROUGH */
 1223|    153|	case 2:
  ------------------
  |  Branch (1223:2): [True: 144, False: 241]
  ------------------
 1224|    153|		t |= ((uint32_t)(*b++)) << 8;
 1225|       |		/* FALL THROUGH */
 1226|    180|	case 1:
  ------------------
  |  Branch (1226:2): [True: 27, False: 358]
  ------------------
 1227|    180|		t |= *b;
 1228|       |		/* FALL THROUGH */
 1229|    385|	default:
  ------------------
  |  Branch (1229:2): [True: 205, False: 180]
  ------------------
 1230|    385|		break;
 1231|    385|	}
 1232|    385|	sum ^= t;
 1233|       |
 1234|    385|	return (sum);
 1235|    385|}
archive_read_support_format_cab.c:cab_read_ahead_cfdata:
 1472|    643|{
 1473|    643|	struct cab *cab = a->format->data;
 1474|    643|	int err;
 1475|       |
 1476|    643|	err = cab_next_cfdata(a);
 1477|    643|	if (err < ARCHIVE_OK) {
  ------------------
  |  |  233|    643|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1477:6): [True: 68, False: 575]
  ------------------
 1478|     68|		*avail = err;
 1479|     68|		return (NULL);
 1480|     68|	}
 1481|       |
 1482|    575|	switch (cab->entry_cffolder->comptype) {
 1483|     40|	case COMPTYPE_NONE:
  ------------------
  |  |  324|     40|#define COMPTYPE_NONE		0x0000
  ------------------
  |  Branch (1483:2): [True: 40, False: 535]
  ------------------
 1484|     40|		return (cab_read_ahead_cfdata_none(a, avail));
 1485|     41|	case COMPTYPE_MSZIP:
  ------------------
  |  |  325|     41|#define COMPTYPE_MSZIP		0x0001
  ------------------
  |  Branch (1485:2): [True: 41, False: 534]
  ------------------
 1486|     41|		return (cab_read_ahead_cfdata_deflate(a, avail));
 1487|    482|	case COMPTYPE_LZX:
  ------------------
  |  |  327|    482|#define COMPTYPE_LZX		0x0003
  ------------------
  |  Branch (1487:2): [True: 482, False: 93]
  ------------------
 1488|    482|		return (cab_read_ahead_cfdata_lzx(a, avail));
 1489|     12|	default: /* Unsupported compression. */
  ------------------
  |  Branch (1489:2): [True: 12, False: 563]
  ------------------
 1490|     12|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     12|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1491|     12|		    "Unsupported CAB compression: %s",
 1492|     12|		    cab->entry_cffolder->compname);
 1493|     12|		*avail = ARCHIVE_FAILED;
  ------------------
  |  |  237|     12|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1494|       |		return (NULL);
 1495|    575|	}
 1496|    575|}
archive_read_support_format_cab.c:cab_read_ahead_cfdata_none:
 1503|     40|{
 1504|     40|	struct cab *cab = a->format->data;
 1505|     40|	struct cfdata *cfdata;
 1506|     40|	const void *d;
 1507|       |
 1508|     40|	cfdata = cab->entry_cfdata;
 1509|       |
 1510|       |	/*
 1511|       |	 * Note: '1' here is a performance optimization.
 1512|       |	 * Recall that the decompression layer returns a count of
 1513|       |	 * available bytes; asking for more than that forces the
 1514|       |	 * decompressor to combine reads by copying data.
 1515|       |	 */
 1516|     40|	d = __archive_read_ahead(a, 1, avail);
 1517|     40|	if (*avail <= 0) {
  ------------------
  |  Branch (1517:6): [True: 7, False: 33]
  ------------------
 1518|      7|		*avail = truncated_error(a);
 1519|      7|		return (NULL);
 1520|      7|	}
 1521|     33|	if (*avail > cfdata->uncompressed_bytes_remaining)
  ------------------
  |  Branch (1521:6): [True: 9, False: 24]
  ------------------
 1522|      9|		*avail = cfdata->uncompressed_bytes_remaining;
 1523|     33|	cfdata->uncompressed_avail = cfdata->uncompressed_size;
 1524|     33|	cfdata->unconsumed = *avail;
 1525|     33|	cfdata->sum_ptr = d;
 1526|     33|	return (d);
 1527|     40|}
archive_read_support_format_cab.c:cab_read_ahead_cfdata_deflate:
 1535|     41|{
 1536|     41|	struct cab *cab = a->format->data;
 1537|     41|	struct cfdata *cfdata;
 1538|     41|	const void *d;
 1539|     41|	int r, mszip;
 1540|     41|	uint16_t uavail;
 1541|     41|	char eod = 0;
 1542|       |
 1543|     41|	cfdata = cab->entry_cfdata;
 1544|       |	/* If the buffer hasn't been allocated, allocate it now. */
 1545|     41|	if (cab->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (1545:6): [True: 32, False: 9]
  ------------------
 1546|     32|		cab->uncompressed_buffer_size = MAX_UNCOMPRESS_SIZE;
  ------------------
  |  |  286|     32|#define MAX_UNCOMPRESS_SIZE	0x8000
  ------------------
 1547|     32|		cab->uncompressed_buffer
 1548|     32|		    = malloc(cab->uncompressed_buffer_size);
 1549|     32|		if (cab->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (1549:7): [True: 0, False: 32]
  ------------------
 1550|      0|			archive_set_error(&a->archive, ENOMEM,
 1551|      0|			    "No memory for CAB reader");
 1552|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1553|      0|			return (NULL);
 1554|      0|		}
 1555|     32|	}
 1556|       |
 1557|     41|	uavail = cfdata->uncompressed_avail;
 1558|     41|	if (uavail == cfdata->uncompressed_size) {
  ------------------
  |  Branch (1558:6): [True: 3, False: 38]
  ------------------
 1559|      3|		d = cab->uncompressed_buffer + cfdata->read_offset;
 1560|      3|		*avail = uavail - cfdata->read_offset;
 1561|      3|		return (d);
 1562|      3|	}
 1563|       |
 1564|     38|	if (!cab->entry_cffolder->decompress_init) {
  ------------------
  |  Branch (1564:6): [True: 32, False: 6]
  ------------------
 1565|     32|		cab->stream.next_in = NULL;
 1566|     32|		cab->stream.avail_in = 0;
 1567|     32|		cab->stream.total_in = 0;
 1568|     32|		cab->stream.next_out = NULL;
 1569|     32|		cab->stream.avail_out = 0;
 1570|     32|		cab->stream.total_out = 0;
 1571|     32|		if (cab->stream_valid)
  ------------------
  |  Branch (1571:7): [True: 0, False: 32]
  ------------------
 1572|      0|			r = inflateReset(&cab->stream);
 1573|     32|		else
 1574|     32|			r = inflateInit2(&cab->stream,
 1575|     32|			    -15 /* Don't check for zlib header */);
 1576|     32|		if (r != Z_OK) {
  ------------------
  |  Branch (1576:7): [True: 0, False: 32]
  ------------------
 1577|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1578|      0|			    "Can't initialize deflate decompression");
 1579|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1580|      0|			return (NULL);
 1581|      0|		}
 1582|       |		/* Stream structure has been set up. */
 1583|     32|		cab->stream_valid = 1;
 1584|       |		/* We've initialized decompression for this stream. */
 1585|     32|		cab->entry_cffolder->decompress_init = 1;
 1586|     32|	}
 1587|       |
 1588|     38|	if (cfdata->compressed_bytes_remaining == cfdata->compressed_size)
  ------------------
  |  Branch (1588:6): [True: 38, False: 0]
  ------------------
 1589|     38|		mszip = 2;
 1590|      0|	else
 1591|      0|		mszip = 0;
 1592|     38|	eod = 0;
 1593|     38|	cab->stream.total_out = uavail;
 1594|       |	/*
 1595|       |	 * We always uncompress all data in current CFDATA.
 1596|       |	 */
 1597|     61|	while (!eod && cab->stream.total_out < cfdata->uncompressed_size) {
  ------------------
  |  Branch (1597:9): [True: 59, False: 2]
  |  Branch (1597:17): [True: 41, False: 18]
  ------------------
 1598|     41|		ssize_t bytes_avail;
 1599|       |
 1600|     41|		cab->stream.next_out =
 1601|     41|		    cab->uncompressed_buffer + cab->stream.total_out;
 1602|     41|		cab->stream.avail_out =
 1603|     41|		    cfdata->uncompressed_size - cab->stream.total_out;
 1604|       |
 1605|     41|		d = __archive_read_ahead(a, 1, &bytes_avail);
 1606|     41|		if (bytes_avail <= 0) {
  ------------------
  |  Branch (1606:7): [True: 3, False: 38]
  ------------------
 1607|      3|			*avail = truncated_error(a);
 1608|      3|			return (NULL);
 1609|      3|		}
 1610|     38|		if (bytes_avail > cfdata->compressed_bytes_remaining)
  ------------------
  |  Branch (1610:7): [True: 21, False: 17]
  ------------------
 1611|     21|			bytes_avail = cfdata->compressed_bytes_remaining;
 1612|       |		/*
 1613|       |		 * A bug in zlib.h: stream.next_in should be marked 'const'
 1614|       |		 * but isn't (the library never alters data through the
 1615|       |		 * next_in pointer, only reads it).  The result: this ugly
 1616|       |		 * cast to remove 'const'.
 1617|       |		 */
 1618|     38|		cab->stream.next_in = (Bytef *)(uintptr_t)d;
 1619|     38|		cab->stream.avail_in = (uInt)bytes_avail;
 1620|     38|		cab->stream.total_in = 0;
 1621|       |
 1622|       |		/* Cut out a tow-byte MSZIP signature(0x43, 0x4b). */
 1623|     38|		if (mszip > 0) {
  ------------------
  |  Branch (1623:7): [True: 36, False: 2]
  ------------------
 1624|     36|			if (bytes_avail <= 0)
  ------------------
  |  Branch (1624:8): [True: 1, False: 35]
  ------------------
 1625|      1|				goto nomszip;
 1626|     35|			if (bytes_avail <= mszip) {
  ------------------
  |  Branch (1626:8): [True: 8, False: 27]
  ------------------
 1627|      8|				if (mszip == 2) {
  ------------------
  |  Branch (1627:9): [True: 8, False: 0]
  ------------------
 1628|      8|					if (cab->stream.next_in[0] != 0x43)
  ------------------
  |  Branch (1628:10): [True: 4, False: 4]
  ------------------
 1629|      4|						goto nomszip;
 1630|      4|					if (bytes_avail > 1 &&
  ------------------
  |  Branch (1630:10): [True: 3, False: 1]
  ------------------
 1631|      3|					    cab->stream.next_in[1] != 0x4b)
  ------------------
  |  Branch (1631:10): [True: 1, False: 2]
  ------------------
 1632|      1|						goto nomszip;
 1633|      4|				} else if (cab->stream.next_in[0] != 0x4b)
  ------------------
  |  Branch (1633:16): [True: 0, False: 0]
  ------------------
 1634|      0|					goto nomszip;
 1635|      3|				cfdata->unconsumed = bytes_avail;
 1636|      3|				cfdata->sum_ptr = d;
 1637|      3|				if (cab_minimum_consume_cfdata(
  ------------------
  |  Branch (1637:9): [True: 0, False: 3]
  ------------------
 1638|      3|				    a, cfdata->unconsumed) < 0) {
 1639|      0|					*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1640|      0|					return (NULL);
 1641|      0|				}
 1642|      3|				mszip -= (int)bytes_avail;
 1643|      3|				continue;
 1644|      3|			}
 1645|     27|			if (mszip == 1 && cab->stream.next_in[0] != 0x4b)
  ------------------
  |  Branch (1645:8): [True: 0, False: 27]
  |  Branch (1645:22): [True: 0, False: 0]
  ------------------
 1646|      0|				goto nomszip;
 1647|     27|			else if (mszip == 2 && (cab->stream.next_in[0] != 0x43 ||
  ------------------
  |  Branch (1647:13): [True: 27, False: 0]
  |  Branch (1647:28): [True: 5, False: 22]
  ------------------
 1648|     22|			    cab->stream.next_in[1] != 0x4b))
  ------------------
  |  Branch (1648:8): [True: 1, False: 21]
  ------------------
 1649|      6|				goto nomszip;
 1650|     21|			cab->stream.next_in += mszip;
 1651|     21|			cab->stream.avail_in -= mszip;
 1652|     21|			cab->stream.total_in += mszip;
 1653|     21|			mszip = 0;
 1654|     21|		}
 1655|       |
 1656|     23|		r = inflate(&cab->stream, 0);
 1657|     23|		switch (r) {
 1658|     18|		case Z_OK:
  ------------------
  |  Branch (1658:3): [True: 18, False: 5]
  ------------------
 1659|     18|			break;
 1660|      2|		case Z_STREAM_END:
  ------------------
  |  Branch (1660:3): [True: 2, False: 21]
  ------------------
 1661|      2|			eod = 1;
 1662|      2|			break;
 1663|      3|		default:
  ------------------
  |  Branch (1663:3): [True: 3, False: 20]
  ------------------
 1664|      3|			goto zlibfailed;
 1665|     23|		}
 1666|     20|		cfdata->unconsumed = cab->stream.total_in;
 1667|     20|		cfdata->sum_ptr = d;
 1668|     20|		if (cab_minimum_consume_cfdata(a, cfdata->unconsumed) < 0) {
  ------------------
  |  Branch (1668:7): [True: 0, False: 20]
  ------------------
 1669|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1670|      0|			return (NULL);
 1671|      0|		}
 1672|     20|	}
 1673|     20|	uavail = (uint16_t)cab->stream.total_out;
 1674|       |
 1675|     20|	if (uavail < cfdata->uncompressed_size) {
  ------------------
  |  Branch (1675:6): [True: 1, False: 19]
  ------------------
 1676|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1677|      1|		    "Invalid uncompressed size (%d < %d)",
 1678|      1|		    uavail, cfdata->uncompressed_size);
 1679|      1|		*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1680|      1|		return (NULL);
 1681|      1|	}
 1682|       |
 1683|       |	/*
 1684|       |	 * Note: I suspect there is a bug in makecab.exe because, in rare
 1685|       |	 * case, compressed bytes are still remaining regardless we have
 1686|       |	 * gotten all uncompressed bytes, which size is recorded in CFDATA,
 1687|       |	 * as much as we need, and we have to use the garbage so as to
 1688|       |	 * correctly compute the sum of CFDATA accordingly.
 1689|       |	 */
 1690|     19|	if (cfdata->compressed_bytes_remaining > 0) {
  ------------------
  |  Branch (1690:6): [True: 15, False: 4]
  ------------------
 1691|     15|		d = __archive_read_ahead(a, cfdata->compressed_bytes_remaining,
 1692|     15|		    NULL);
 1693|     15|		if (d == NULL) {
  ------------------
  |  Branch (1693:7): [True: 3, False: 12]
  ------------------
 1694|      3|			*avail = truncated_error(a);
 1695|      3|			return (NULL);
 1696|      3|		}
 1697|     12|		cfdata->unconsumed = cfdata->compressed_bytes_remaining;
 1698|     12|		cfdata->sum_ptr = d;
 1699|     12|		if (cab_minimum_consume_cfdata(a, cfdata->unconsumed) < 0) {
  ------------------
  |  Branch (1699:7): [True: 0, False: 12]
  ------------------
 1700|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1701|      0|			return (NULL);
 1702|      0|		}
 1703|     12|	}
 1704|       |
 1705|       |	/*
 1706|       |	 * Set dictionary data for decompressing of next CFDATA, which
 1707|       |	 * in the same folder. This is why we always do decompress CFDATA
 1708|       |	 * even if beginning CFDATA or some of CFDATA are not used in
 1709|       |	 * skipping file data.
 1710|       |	 */
 1711|     16|	if (cab->entry_cffolder->cfdata_index <
  ------------------
  |  Branch (1711:6): [True: 10, False: 6]
  ------------------
 1712|     16|	    cab->entry_cffolder->cfdata_count) {
 1713|     10|		r = inflateReset(&cab->stream);
 1714|     10|		if (r != Z_OK)
  ------------------
  |  Branch (1714:7): [True: 0, False: 10]
  ------------------
 1715|      0|			goto zlibfailed;
 1716|     10|		r = inflateSetDictionary(&cab->stream,
 1717|     10|		    cab->uncompressed_buffer, cfdata->uncompressed_size);
 1718|     10|		if (r != Z_OK)
  ------------------
  |  Branch (1718:7): [True: 0, False: 10]
  ------------------
 1719|      0|			goto zlibfailed;
 1720|     10|	}
 1721|       |
 1722|     16|	d = cab->uncompressed_buffer + cfdata->read_offset;
 1723|     16|	*avail = uavail - cfdata->read_offset;
 1724|     16|	cfdata->uncompressed_avail = uavail;
 1725|       |
 1726|     16|	return (d);
 1727|       |
 1728|      3|zlibfailed:
 1729|      3|	switch (r) {
 1730|      0|	case Z_MEM_ERROR:
  ------------------
  |  Branch (1730:2): [True: 0, False: 3]
  ------------------
 1731|      0|		archive_set_error(&a->archive, ENOMEM,
 1732|      0|		    "Out of memory for deflate decompression");
 1733|      0|		break;
 1734|      3|	default:
  ------------------
  |  Branch (1734:2): [True: 3, False: 0]
  ------------------
 1735|      3|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1736|      3|		    "Deflate decompression failed (%d)", r);
 1737|      3|		break;
 1738|      3|	}
 1739|      3|	*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1740|      3|	return (NULL);
 1741|     12|nomszip:
 1742|     12|	archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     12|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1743|     12|	    "CFDATA incorrect(no MSZIP signature)");
 1744|     12|	*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1745|       |	return (NULL);
 1746|      3|}
archive_read_support_format_cab.c:cab_read_ahead_cfdata_lzx:
 1763|    482|{
 1764|    482|	struct cab *cab = a->format->data;
 1765|    482|	struct cfdata *cfdata;
 1766|    482|	const void *d;
 1767|    482|	int r;
 1768|    482|	uint16_t uavail;
 1769|       |
 1770|    482|	cfdata = cab->entry_cfdata;
 1771|       |	/* If the buffer hasn't been allocated, allocate it now. */
 1772|    482|	if (cab->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (1772:6): [True: 322, False: 160]
  ------------------
 1773|    322|		cab->uncompressed_buffer_size = MAX_UNCOMPRESS_SIZE;
  ------------------
  |  |  286|    322|#define MAX_UNCOMPRESS_SIZE	0x8000
  ------------------
 1774|    322|		cab->uncompressed_buffer
 1775|    322|		    = malloc(cab->uncompressed_buffer_size);
 1776|    322|		if (cab->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (1776:7): [True: 0, False: 322]
  ------------------
 1777|      0|			archive_set_error(&a->archive, ENOMEM,
 1778|      0|			    "No memory for CAB reader");
 1779|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1780|      0|			return (NULL);
 1781|      0|		}
 1782|    322|	}
 1783|       |
 1784|    482|	uavail = cfdata->uncompressed_avail;
 1785|    482|	if (uavail == cfdata->uncompressed_size) {
  ------------------
  |  Branch (1785:6): [True: 0, False: 482]
  ------------------
 1786|      0|		d = cab->uncompressed_buffer + cfdata->read_offset;
 1787|      0|		*avail = uavail - cfdata->read_offset;
 1788|      0|		return (d);
 1789|      0|	}
 1790|       |
 1791|    482|	if (!cab->entry_cffolder->decompress_init) {
  ------------------
  |  Branch (1791:6): [True: 322, False: 160]
  ------------------
 1792|    322|		r = lzx_decode_init(&cab->xstrm,
 1793|    322|		    cab->entry_cffolder->compdata);
 1794|    322|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|    322|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1794:7): [True: 2, False: 320]
  ------------------
 1795|      2|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1796|      2|			    "Can't initialize LZX decompression");
 1797|      2|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1798|      2|			return (NULL);
 1799|      2|		}
 1800|       |		/* We've initialized decompression for this stream. */
 1801|    320|		cab->entry_cffolder->decompress_init = 1;
 1802|    320|	}
 1803|       |
 1804|       |	/* Clean up remaining bits of previous CFDATA. */
 1805|    480|	lzx_cleanup_bitstream(&cab->xstrm);
 1806|    480|	cab->xstrm.total_out = uavail;
 1807|  1.76k|	while (cab->xstrm.total_out < cfdata->uncompressed_size) {
  ------------------
  |  Branch (1807:9): [True: 1.52k, False: 238]
  ------------------
 1808|  1.52k|		ssize_t bytes_avail;
 1809|       |
 1810|  1.52k|		cab->xstrm.next_out =
 1811|  1.52k|		    cab->uncompressed_buffer + cab->xstrm.total_out;
 1812|  1.52k|		cab->xstrm.avail_out =
 1813|  1.52k|		    cfdata->uncompressed_size - cab->xstrm.total_out;
 1814|       |
 1815|  1.52k|		d = __archive_read_ahead(a, 1, &bytes_avail);
 1816|  1.52k|		if (d == NULL) {
  ------------------
  |  Branch (1816:7): [True: 88, False: 1.43k]
  ------------------
 1817|     88|			archive_set_error(&a->archive,
 1818|     88|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     88|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1819|     88|			    "Truncated CAB file data");
 1820|     88|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|     88|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1821|     88|			return (NULL);
 1822|     88|		}
 1823|  1.43k|		if (bytes_avail > cfdata->compressed_bytes_remaining)
  ------------------
  |  Branch (1823:7): [True: 430, False: 1.00k]
  ------------------
 1824|    430|			bytes_avail = cfdata->compressed_bytes_remaining;
 1825|       |
 1826|  1.43k|		cab->xstrm.next_in = d;
 1827|  1.43k|		cab->xstrm.avail_in = bytes_avail;
 1828|  1.43k|		cab->xstrm.total_in = 0;
 1829|  1.43k|		r = lzx_decode(&cab->xstrm,
 1830|  1.43k|		    cfdata->compressed_bytes_remaining == bytes_avail);
 1831|  1.43k|		switch (r) {
 1832|    293|		case ARCHIVE_OK:
  ------------------
  |  |  233|    293|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1832:3): [True: 293, False: 1.14k]
  ------------------
 1833|  1.28k|		case ARCHIVE_EOF:
  ------------------
  |  |  232|  1.28k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1833:3): [True: 987, False: 447]
  ------------------
 1834|  1.28k|			break;
 1835|    154|		default:
  ------------------
  |  Branch (1835:3): [True: 154, False: 1.28k]
  ------------------
 1836|    154|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    154|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1837|    154|			    "LZX decompression failed (%d)", r);
 1838|    154|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|    154|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1839|    154|			return (NULL);
 1840|  1.43k|		}
 1841|  1.28k|		cfdata->unconsumed = cab->xstrm.total_in;
 1842|  1.28k|		cfdata->sum_ptr = d;
 1843|  1.28k|		if (cab_minimum_consume_cfdata(a, cfdata->unconsumed) < 0) {
  ------------------
  |  Branch (1843:7): [True: 0, False: 1.28k]
  ------------------
 1844|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1845|      0|			return (NULL);
 1846|      0|		}
 1847|  1.28k|	}
 1848|       |
 1849|    238|	uavail = (uint16_t)cab->xstrm.total_out;
 1850|       |	/*
 1851|       |	 * Make sure a read pointer advances to next CFDATA.
 1852|       |	 */
 1853|    238|	if (cfdata->compressed_bytes_remaining > 0) {
  ------------------
  |  Branch (1853:6): [True: 193, False: 45]
  ------------------
 1854|    193|		d = __archive_read_ahead(a, cfdata->compressed_bytes_remaining,
 1855|    193|		    NULL);
 1856|    193|		if (d == NULL) {
  ------------------
  |  Branch (1856:7): [True: 17, False: 176]
  ------------------
 1857|     17|			*avail = truncated_error(a);
 1858|     17|			return (NULL);
 1859|     17|		}
 1860|    176|		cfdata->unconsumed = cfdata->compressed_bytes_remaining;
 1861|    176|		cfdata->sum_ptr = d;
 1862|    176|		if (cab_minimum_consume_cfdata(a, cfdata->unconsumed) < 0) {
  ------------------
  |  Branch (1862:7): [True: 0, False: 176]
  ------------------
 1863|      0|			*avail = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1864|      0|			return (NULL);
 1865|      0|		}
 1866|    176|	}
 1867|       |
 1868|       |	/*
 1869|       |	 * Translation reversal of x86 processor CALL byte sequence(E8).
 1870|       |	 */
 1871|    221|	lzx_translation(&cab->xstrm, cab->uncompressed_buffer,
 1872|    221|	    cfdata->uncompressed_size,
 1873|    221|	    (cab->entry_cffolder->cfdata_index - 1) * MAX_UNCOMPRESS_SIZE);
  ------------------
  |  |  286|    221|#define MAX_UNCOMPRESS_SIZE	0x8000
  ------------------
 1874|       |
 1875|    221|	d = cab->uncompressed_buffer + cfdata->read_offset;
 1876|    221|	*avail = uavail - cfdata->read_offset;
 1877|    221|	cfdata->uncompressed_avail = uavail;
 1878|       |
 1879|    221|	return (d);
 1880|    238|}
archive_read_support_format_cab.c:lzx_decode_init:
 2206|    322|{
 2207|    322|	int base_inc[18];
 2208|    322|	struct lzx_dec *ds;
 2209|    322|	uint32_t base;
 2210|    322|	uint16_t slot, w_size, w_slot;
 2211|    322|	uint8_t footer;
 2212|       |
 2213|    322|	if (strm->ds == NULL) {
  ------------------
  |  Branch (2213:6): [True: 322, False: 0]
  ------------------
 2214|    322|		strm->ds = calloc(1, sizeof(*strm->ds));
 2215|    322|		if (strm->ds == NULL)
  ------------------
  |  Branch (2215:7): [True: 0, False: 322]
  ------------------
 2216|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2217|    322|	}
 2218|    322|	ds = strm->ds;
 2219|    322|	ds->error = ARCHIVE_FAILED;
  ------------------
  |  |  237|    322|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2220|       |
 2221|       |	/* Allow bits from 15 (32 KiB) up to 21 (2 MiB) */
 2222|    322|	if (w_bits < SLOT_BASE || w_bits > SLOT_MAX)
  ------------------
  |  |  236|    644|#define SLOT_BASE	15
  ------------------
              	if (w_bits < SLOT_BASE || w_bits > SLOT_MAX)
  ------------------
  |  |  237|    321|#define SLOT_MAX	21/*->25*/
  ------------------
  |  Branch (2222:6): [True: 1, False: 321]
  |  Branch (2222:28): [True: 1, False: 320]
  ------------------
 2223|      2|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      2|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2224|       |
 2225|    320|	ds->error = ARCHIVE_FATAL;
  ------------------
  |  |  239|    320|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2226|       |
 2227|       |	/*
 2228|       |	 * Alloc window
 2229|       |	 */
 2230|    320|	w_size = ds->w_size;
 2231|    320|	w_slot = slots[w_bits - SLOT_BASE];
  ------------------
  |  |  236|    320|#define SLOT_BASE	15
  ------------------
 2232|    320|	ds->w_size = 1U << w_bits;
 2233|    320|	ds->w_mask = ds->w_size - 1;
 2234|    320|	if (ds->w_buff == NULL || w_size != ds->w_size) {
  ------------------
  |  Branch (2234:6): [True: 320, False: 0]
  |  Branch (2234:28): [True: 0, False: 0]
  ------------------
 2235|    320|		free(ds->w_buff);
 2236|    320|		ds->w_buff = malloc(ds->w_size);
 2237|    320|		if (ds->w_buff == NULL)
  ------------------
  |  Branch (2237:7): [True: 0, False: 320]
  ------------------
 2238|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2239|    320|		free(ds->pos_tbl);
 2240|    320|		ds->pos_tbl = malloc(sizeof(ds->pos_tbl[0]) * w_slot);
 2241|    320|		if (ds->pos_tbl == NULL)
  ------------------
  |  Branch (2241:7): [True: 0, False: 320]
  ------------------
 2242|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2243|    320|	}
 2244|       |
 2245|  6.08k|	for (footer = 0; footer < 18; footer++)
  ------------------
  |  Branch (2245:19): [True: 5.76k, False: 320]
  ------------------
 2246|  5.76k|		base_inc[footer] = 1 << footer;
 2247|    320|	base = footer = 0;
 2248|  12.3k|	for (slot = 0; slot < w_slot; slot++) {
  ------------------
  |  Branch (2248:17): [True: 12.0k, False: 320]
  ------------------
 2249|  12.0k|		int n;
 2250|  12.0k|		if (footer == 0)
  ------------------
  |  Branch (2250:7): [True: 1.60k, False: 10.4k]
  ------------------
 2251|  1.60k|			base = slot;
 2252|  10.4k|		else
 2253|  10.4k|			base += base_inc[footer];
 2254|  12.0k|		if (footer < 17) {
  ------------------
  |  Branch (2254:7): [True: 10.8k, False: 1.16k]
  ------------------
 2255|  10.8k|			footer = 0;
 2256|   109k|			for (n = base; n; n >>= 1)
  ------------------
  |  Branch (2256:19): [True: 98.1k, False: 10.8k]
  ------------------
 2257|  98.1k|				footer++;
 2258|  10.8k|			if (footer <= 2)
  ------------------
  |  Branch (2258:8): [True: 1.28k, False: 9.61k]
  ------------------
 2259|  1.28k|				footer = 0;
 2260|  9.61k|			else
 2261|  9.61k|				footer -= 2;
 2262|  10.8k|		}
 2263|  12.0k|		ds->pos_tbl[slot].base = base;
 2264|  12.0k|		ds->pos_tbl[slot].footer_bits = footer;
 2265|  12.0k|	}
 2266|       |
 2267|    320|	ds->w_pos = 0;
 2268|    320|	ds->w_filled = 0;
 2269|    320|	ds->state = ST_RD_TRANSLATION;
  ------------------
  |  |  157|    320|#define ST_RD_TRANSLATION	0
  ------------------
 2270|    320|	ds->br.cache_buffer = 0;
 2271|    320|	ds->br.cache_avail = 0;
 2272|    320|	ds->r0 = ds->r1 = ds->r2 = 1;
 2273|       |
 2274|       |	/* Initialize aligned offset tree. */
 2275|    320|	if (lzx_huffman_init(&(ds->at), 8, 8) != ARCHIVE_OK)
  ------------------
  |  |  233|    320|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2275:6): [True: 0, False: 320]
  ------------------
 2276|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2277|       |
 2278|       |	/* Initialize pre-tree. */
 2279|    320|	if (lzx_huffman_init(&(ds->pt), 20, 10) != ARCHIVE_OK)
  ------------------
  |  |  233|    320|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2279:6): [True: 0, False: 320]
  ------------------
 2280|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2281|       |
 2282|       |	/* Initialize Main tree. */
 2283|    320|	if (lzx_huffman_init(&(ds->mt), 256 + (w_slot << 3), 16)
  ------------------
  |  Branch (2283:6): [True: 0, False: 320]
  ------------------
 2284|    320|	    != ARCHIVE_OK)
  ------------------
  |  |  233|    320|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2285|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2286|       |
 2287|       |	/* Initialize Length tree. */
 2288|    320|	if (lzx_huffman_init(&(ds->lt), 249, 16) != ARCHIVE_OK)
  ------------------
  |  |  233|    320|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2288:6): [True: 0, False: 320]
  ------------------
 2289|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2290|       |
 2291|    320|	ds->error = 0;
 2292|       |
 2293|    320|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    320|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2294|    320|}
archive_read_support_format_cab.c:lzx_huffman_init:
 3257|  1.28k|{
 3258|  1.28k|	size_t tbl_size = (size_t)1 << tbl_bits;
 3259|       |
 3260|  1.28k|	if (hf->bitlen == NULL || hf->symbol_count != symbol_count) {
  ------------------
  |  Branch (3260:6): [True: 1.28k, False: 0]
  |  Branch (3260:28): [True: 0, False: 0]
  ------------------
 3261|  1.28k|		free(hf->bitlen);
 3262|  1.28k|		hf->bitlen = calloc(symbol_count, sizeof(hf->bitlen[0]));
 3263|  1.28k|		if (hf->bitlen == NULL)
  ------------------
  |  Branch (3263:7): [True: 0, False: 1.28k]
  ------------------
 3264|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3265|  1.28k|		hf->symbol_count = symbol_count;
 3266|  1.28k|	} else
 3267|      0|		memset(hf->bitlen, 0, symbol_count * sizeof(hf->bitlen[0]));
 3268|  1.28k|	if (hf->tbl == NULL) {
  ------------------
  |  Branch (3268:6): [True: 1.28k, False: 0]
  ------------------
 3269|  1.28k|		hf->tbl = calloc(tbl_size, sizeof(hf->tbl[0]));
 3270|  1.28k|		if (hf->tbl == NULL)
  ------------------
  |  Branch (3270:7): [True: 0, False: 1.28k]
  ------------------
 3271|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3272|  1.28k|		hf->tbl_bits = tbl_bits;
 3273|  1.28k|	} else
 3274|      0|		memset(hf->tbl, 0,
 3275|      0|		    ((size_t)1 << hf->tbl_bits) * sizeof(hf->tbl[0]));
 3276|  1.28k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.28k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3277|  1.28k|}
archive_read_support_format_cab.c:lzx_cleanup_bitstream:
 2490|    480|{
 2491|    480|	strm->ds->br.cache_avail = 0;
 2492|    480|	strm->ds->br.have_odd = 0;
 2493|    480|}
archive_read_support_format_cab.c:lzx_decode:
 2506|  1.43k|{
 2507|  1.43k|	struct lzx_dec *ds = strm->ds;
 2508|  1.43k|	size_t avail_in;
 2509|  1.43k|	int r;
 2510|       |
 2511|  1.43k|	if (ds->error)
  ------------------
  |  Branch (2511:6): [True: 0, False: 1.43k]
  ------------------
 2512|      0|		return (ds->error);
 2513|       |
 2514|  1.43k|	avail_in = strm->avail_in;
 2515|  1.43k|	lzx_br_fixup(strm, &(ds->br));
 2516|  1.52k|	do {
 2517|  1.52k|		if (ds->state < ST_MAIN)
  ------------------
  |  |  175|  1.52k|#define ST_MAIN			18
  ------------------
  |  Branch (2517:7): [True: 1.30k, False: 220]
  ------------------
 2518|  1.30k|			r = lzx_read_blocks(strm, last);
 2519|    220|		else {
 2520|    220|			size_t bytes_written = strm->avail_out;
 2521|       |
 2522|    220|			r = lzx_decode_blocks(strm, last);
 2523|    220|			bytes_written -= strm->avail_out;
 2524|    220|			strm->next_out += bytes_written;
 2525|    220|			strm->total_out += bytes_written;
 2526|    220|		}
 2527|  1.52k|	} while (r == 100);
  ------------------
  |  Branch (2527:11): [True: 90, False: 1.43k]
  ------------------
 2528|  1.43k|	strm->total_in += avail_in - strm->avail_in;
 2529|  1.43k|	return (r);
 2530|  1.43k|}
archive_read_support_format_cab.c:lzx_br_fixup:
 2474|  1.43k|{
 2475|  1.43k|	ssize_t n = CACHE_BITS - br->cache_avail;
  ------------------
  |  |  140|  1.43k|#define CACHE_BITS		(8 * sizeof(CACHE_TYPE))
  ------------------
 2476|       |
 2477|  1.43k|	if (br->have_odd && n >= 16 && strm->avail_in > 0) {
  ------------------
  |  Branch (2477:6): [True: 1, False: 1.43k]
  |  Branch (2477:22): [True: 1, False: 0]
  |  Branch (2477:33): [True: 0, False: 1]
  ------------------
 2478|      0|		br->cache_buffer =
 2479|      0|		   (br->cache_buffer << 16) |
 2480|      0|		   ((uint16_t)(*strm->next_in)) << 8 | br->odd;
 2481|      0|		strm->next_in++;
 2482|      0|		strm->avail_in--;
 2483|      0|		br->cache_avail += 16;
 2484|      0|		br->have_odd = 0;
 2485|      0|	}
 2486|  1.43k|}
archive_read_support_format_cab.c:lzx_read_blocks:
 2534|  1.30k|{
 2535|  1.30k|	struct lzx_dec *ds = strm->ds;
 2536|  1.30k|	struct lzx_br *br = &(ds->br);
 2537|  1.30k|	int r;
 2538|  1.30k|	uint16_t i;
 2539|       |
 2540|  1.49k|	for (;;) {
 2541|  1.49k|		switch (ds->state) {
  ------------------
  |  Branch (2541:11): [True: 1.49k, False: 0]
  ------------------
 2542|    319|		case ST_RD_TRANSLATION:
  ------------------
  |  |  157|    319|#define ST_RD_TRANSLATION	0
  ------------------
  |  Branch (2542:3): [True: 319, False: 1.18k]
  ------------------
 2543|    319|			if (!lzx_br_read_ahead(strm, br, 1)) {
  ------------------
  |  | 2375|    319|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2370|    638|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2356|    638|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2356:27): [True: 0, False: 319]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|    319|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2370:28): [True: 291, False: 28]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2356|     28|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2356:27): [True: 24, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2544|      4|				ds->state = ST_RD_TRANSLATION;
  ------------------
  |  |  157|      4|#define ST_RD_TRANSLATION	0
  ------------------
 2545|      4|				if (last)
  ------------------
  |  Branch (2545:9): [True: 2, False: 2]
  ------------------
 2546|      2|					goto failed;
 2547|      2|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2548|      4|			}
 2549|    315|			ds->translation = lzx_br_bits(br, 1);
  ------------------
  |  | 2359|    315|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2360|    315|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2550|    315|			lzx_br_consume(br, 1);
  ------------------
  |  | 2378|    315|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2551|       |			/* FALL THROUGH */
 2552|    315|		case ST_RD_TRANSLATION_SIZE:
  ------------------
  |  |  158|    315|#define ST_RD_TRANSLATION_SIZE	1
  ------------------
  |  Branch (2552:3): [True: 0, False: 1.49k]
  ------------------
 2553|    315|			if (ds->translation) {
  ------------------
  |  Branch (2553:8): [True: 70, False: 245]
  ------------------
 2554|     70|				uint32_t v;
 2555|       |
 2556|     70|				if (!lzx_br_read_ahead(strm, br, 32)) {
  ------------------
  |  | 2375|     70|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2370|    140|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2356|    140|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2356:27): [True: 66, False: 4]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|      4|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2370:28): [True: 0, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2356|      4|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2356:27): [True: 0, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2557|      4|					ds->state = ST_RD_TRANSLATION_SIZE;
  ------------------
  |  |  158|      4|#define ST_RD_TRANSLATION_SIZE	1
  ------------------
 2558|      4|					if (last)
  ------------------
  |  Branch (2558:10): [True: 1, False: 3]
  ------------------
 2559|      1|						goto failed;
 2560|      3|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2561|      4|				}
 2562|     66|				v = lzx_br_bits(br, 16);
  ------------------
  |  | 2359|     66|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2360|     66|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2563|     66|				lzx_br_consume(br, 16);
  ------------------
  |  | 2378|     66|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2564|     66|				v <<= 16;
 2565|     66|				v |= lzx_br_bits(br, 16);
  ------------------
  |  | 2359|     66|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2360|     66|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2566|     66|				if (v > MAX_FILE_SIZE)
  ------------------
  |  |  287|     66|#define MAX_FILE_SIZE		(UINT16_MAX * MAX_UNCOMPRESS_SIZE)
  |  |  ------------------
  |  |  |  |  286|     66|#define MAX_UNCOMPRESS_SIZE	0x8000
  |  |  ------------------
  ------------------
  |  Branch (2566:9): [True: 4, False: 62]
  ------------------
 2567|      4|					goto failed;
 2568|     62|				ds->translation_size = (int32_t)v;
 2569|     62|				lzx_br_consume(br, 16);
  ------------------
  |  | 2378|     62|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2570|     62|			}
 2571|       |			/* FALL THROUGH */
 2572|  1.29k|		case ST_RD_BLOCK_TYPE:
  ------------------
  |  |  159|  1.29k|#define ST_RD_BLOCK_TYPE	2
  ------------------
  |  Branch (2572:3): [True: 985, False: 514]
  ------------------
 2573|  1.29k|			if (!lzx_br_read_ahead(strm, br, 3)) {
  ------------------
  |  | 2375|  1.29k|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2370|  2.58k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2356|  2.58k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2356:27): [True: 321, False: 971]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|    971|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2370:28): [True: 958, False: 13]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2356|     13|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2356:27): [True: 8, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2574|      5|				ds->state = ST_RD_BLOCK_TYPE;
  ------------------
  |  |  159|      5|#define ST_RD_BLOCK_TYPE	2
  ------------------
 2575|      5|				if (last)
  ------------------
  |  Branch (2575:9): [True: 2, False: 3]
  ------------------
 2576|      2|					goto failed;
 2577|      3|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2578|      5|			}
 2579|  1.28k|			ds->block_type = lzx_br_bits(br, 3);
  ------------------
  |  | 2359|  1.28k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2360|  1.28k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2580|  1.28k|			lzx_br_consume(br, 3);
  ------------------
  |  | 2378|  1.28k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2581|       |			/* Check a block type. */
 2582|  1.28k|			switch (ds->block_type) {
 2583|    116|			case VERBATIM_BLOCK:
  ------------------
  |  |  202|    116|#define VERBATIM_BLOCK		1
  ------------------
  |  Branch (2583:4): [True: 116, False: 1.17k]
  ------------------
 2584|    197|			case ALIGNED_OFFSET_BLOCK:
  ------------------
  |  |  203|    197|#define ALIGNED_OFFSET_BLOCK	2
  ------------------
  |  Branch (2584:4): [True: 81, False: 1.20k]
  ------------------
 2585|  1.26k|			case UNCOMPRESSED_BLOCK:
  ------------------
  |  |  204|  1.26k|#define UNCOMPRESSED_BLOCK	3
  ------------------
  |  Branch (2585:4): [True: 1.07k, False: 216]
  ------------------
 2586|  1.26k|				break;
 2587|     19|			default:
  ------------------
  |  Branch (2587:4): [True: 19, False: 1.26k]
  ------------------
 2588|     19|				goto failed;/* Invalid */
 2589|  1.28k|			}
 2590|       |			/* FALL THROUGH */
 2591|  1.26k|		case ST_RD_BLOCK_SIZE:
  ------------------
  |  |  160|  1.26k|#define ST_RD_BLOCK_SIZE	3
  ------------------
  |  Branch (2591:3): [True: 0, False: 1.49k]
  ------------------
 2592|  1.26k|			if (!lzx_br_read_ahead(strm, br, 24)) {
  ------------------
  |  | 2375|  1.26k|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2370|  2.53k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2356|  2.53k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2356:27): [True: 1.25k, False: 16]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|     16|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2370:28): [True: 0, False: 16]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2356|     16|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2356:27): [True: 10, False: 6]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2593|      6|				ds->state = ST_RD_BLOCK_SIZE;
  ------------------
  |  |  160|      6|#define ST_RD_BLOCK_SIZE	3
  ------------------
 2594|      6|				if (last)
  ------------------
  |  Branch (2594:9): [True: 2, False: 4]
  ------------------
 2595|      2|					goto failed;
 2596|      4|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      4|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2597|      6|			}
 2598|  1.26k|			ds->block_size = lzx_br_bits(br, 8);
  ------------------
  |  | 2359|  1.26k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2360|  1.26k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2599|  1.26k|			lzx_br_consume(br, 8);
  ------------------
  |  | 2378|  1.26k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2600|  1.26k|			ds->block_size <<= 16;
 2601|  1.26k|			ds->block_size |= lzx_br_bits(br, 16);
  ------------------
  |  | 2359|  1.26k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2360|  1.26k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2602|  1.26k|			lzx_br_consume(br, 16);
  ------------------
  |  | 2378|  1.26k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2603|  1.26k|			if (ds->block_size == 0)
  ------------------
  |  Branch (2603:8): [True: 1, False: 1.26k]
  ------------------
 2604|      1|				goto failed;
 2605|  1.26k|			ds->block_bytes_avail = ds->block_size;
 2606|  1.26k|			if (ds->block_type != UNCOMPRESSED_BLOCK) {
  ------------------
  |  |  204|  1.26k|#define UNCOMPRESSED_BLOCK	3
  ------------------
  |  Branch (2606:8): [True: 195, False: 1.06k]
  ------------------
 2607|    195|				if (ds->block_type == VERBATIM_BLOCK)
  ------------------
  |  |  202|    195|#define VERBATIM_BLOCK		1
  ------------------
  |  Branch (2607:9): [True: 114, False: 81]
  ------------------
 2608|    114|					ds->state = ST_RD_VERBATIM;
  ------------------
  |  |  168|    114|#define ST_RD_VERBATIM		11
  ------------------
 2609|     81|				else
 2610|     81|					ds->state = ST_RD_ALIGNED_OFFSET;
  ------------------
  |  |  167|     81|#define ST_RD_ALIGNED_OFFSET	10
  ------------------
 2611|    195|				break;
 2612|    195|			}
 2613|       |			/* FALL THROUGH */
 2614|  1.06k|		case ST_RD_ALIGNMENT:
  ------------------
  |  |  161|  1.06k|#define ST_RD_ALIGNMENT		4
  ------------------
  |  Branch (2614:3): [True: 0, False: 1.49k]
  ------------------
 2615|       |			/*
 2616|       |			 * Handle an Uncompressed Block.
 2617|       |			 */
 2618|       |			/* Skip padding to align following field on
 2619|       |			 * 16-bit boundary. */
 2620|  1.06k|			if (lzx_br_is_unaligned(br))
  ------------------
  |  | 2381|  1.06k|#define lzx_br_is_unaligned(br)	((br)->cache_avail & 0x0f)
  |  |  ------------------
  |  |  |  Branch (2381:33): [True: 1.06k, False: 0]
  |  |  ------------------
  ------------------
 2621|  1.06k|				lzx_br_consume_unaligned_bits(br);
  ------------------
  |  | 2379|  1.06k|#define lzx_br_consume_unaligned_bits(br) ((br)->cache_avail &= ~0x0f)
  ------------------
 2622|      0|			else {
 2623|      0|				if (lzx_br_read_ahead(strm, br, 16))
  ------------------
  |  | 2375|      0|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2370|      0|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2356|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2356: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 (2370:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2356|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2356:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2624|      0|					lzx_br_consume(br, 16);
  ------------------
  |  | 2378|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2625|      0|				else {
 2626|      0|					ds->state = ST_RD_ALIGNMENT;
  ------------------
  |  |  161|      0|#define ST_RD_ALIGNMENT		4
  ------------------
 2627|      0|					if (last)
  ------------------
  |  Branch (2627:10): [True: 0, False: 0]
  ------------------
 2628|      0|						goto failed;
 2629|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2630|      0|				}
 2631|      0|			}
 2632|       |			/* Preparation to read repeated offsets R0,R1 and R2. */
 2633|  1.06k|			ds->rbytes_avail = 0;
 2634|  1.06k|			ds->state = ST_RD_R0;
  ------------------
  |  |  162|  1.06k|#define ST_RD_R0		5
  ------------------
 2635|       |			/* FALL THROUGH */
 2636|  1.06k|		case ST_RD_R0:
  ------------------
  |  |  162|  1.06k|#define ST_RD_R0		5
  ------------------
  |  Branch (2636:3): [True: 0, False: 1.49k]
  ------------------
 2637|  1.06k|		case ST_RD_R1:
  ------------------
  |  |  163|  1.06k|#define ST_RD_R1		6
  ------------------
  |  Branch (2637:3): [True: 0, False: 1.49k]
  ------------------
 2638|  1.06k|		case ST_RD_R2:
  ------------------
  |  |  164|  1.06k|#define ST_RD_R2		7
  ------------------
  |  Branch (2638:3): [True: 0, False: 1.49k]
  ------------------
 2639|  3.15k|			do {
 2640|  3.15k|				uint16_t u16;
 2641|       |				/* Drain bits in the cache buffer of
 2642|       |				 * bit-stream. */
 2643|  3.15k|				if (lzx_br_has(br, 32)) {
  ------------------
  |  | 2356|  3.15k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  ------------------
  |  |  |  Branch (2356:27): [True: 1.02k, False: 2.12k]
  |  |  ------------------
  ------------------
 2644|  1.02k|					u16 = lzx_br_bits(br, 16);
  ------------------
  |  | 2359|  1.02k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2360|  1.02k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2645|  1.02k|					lzx_br_consume(br, 16);
  ------------------
  |  | 2378|  1.02k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2646|  1.02k|					archive_le16enc(ds->rbytes, u16);
 2647|  1.02k|					u16 = lzx_br_bits(br, 16);
  ------------------
  |  | 2359|  1.02k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2360|  1.02k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2648|  1.02k|					lzx_br_consume(br, 16);
  ------------------
  |  | 2378|  1.02k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2649|  1.02k|					archive_le16enc(ds->rbytes+2, u16);
 2650|  1.02k|					ds->rbytes_avail = 4;
 2651|  2.12k|				} else if (lzx_br_has(br, 16)) {
  ------------------
  |  | 2356|  2.12k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  ------------------
  |  |  |  Branch (2356:27): [True: 2, False: 2.12k]
  |  |  ------------------
  ------------------
 2652|      2|					u16 = lzx_br_bits(br, 16);
  ------------------
  |  | 2359|      2|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2360|      2|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2653|      2|					lzx_br_consume(br, 16);
  ------------------
  |  | 2378|      2|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2654|      2|					archive_le16enc(ds->rbytes, u16);
 2655|      2|					ds->rbytes_avail = 2;
 2656|      2|				}
 2657|  3.15k|				if (ds->rbytes_avail < 4 && ds->br.have_odd) {
  ------------------
  |  Branch (2657:9): [True: 2.12k, False: 1.02k]
  |  Branch (2657:33): [True: 1, False: 2.12k]
  ------------------
 2658|      1|					ds->rbytes[ds->rbytes_avail++] =
 2659|      1|					    ds->br.odd;
 2660|      1|					ds->br.have_odd = 0;
 2661|      1|				}
 2662|  11.5k|				while (ds->rbytes_avail < 4) {
  ------------------
  |  Branch (2662:12): [True: 8.45k, False: 3.13k]
  ------------------
 2663|  8.45k|					if (strm->avail_in <= 0) {
  ------------------
  |  Branch (2663:10): [True: 19, False: 8.43k]
  ------------------
 2664|     19|						if (last)
  ------------------
  |  Branch (2664:11): [True: 1, False: 18]
  ------------------
 2665|      1|							goto failed;
 2666|     18|						return (ARCHIVE_OK);
  ------------------
  |  |  233|     18|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2667|     19|					}
 2668|  8.43k|					ds->rbytes[ds->rbytes_avail++] =
 2669|  8.43k|					    *strm->next_in++;
 2670|  8.43k|					strm->avail_in--;
 2671|  8.43k|				}
 2672|  3.13k|				ds->rbytes_avail = 0;
 2673|  3.13k|				if (ds->state == ST_RD_R0) {
  ------------------
  |  |  162|  3.13k|#define ST_RD_R0		5
  ------------------
  |  Branch (2673:9): [True: 1.06k, False: 2.07k]
  ------------------
 2674|  1.06k|					ds->r0 = archive_le32dec(ds->rbytes);
 2675|  1.06k|					if (ds->r0 > (size_t)INT32_MAX)
  ------------------
  |  Branch (2675:10): [True: 10, False: 1.05k]
  ------------------
 2676|     10|						goto failed;
 2677|  1.05k|					ds->state = ST_RD_R1;
  ------------------
  |  |  163|  1.05k|#define ST_RD_R1		6
  ------------------
 2678|  2.07k|				} else if (ds->state == ST_RD_R1) {
  ------------------
  |  |  163|  2.07k|#define ST_RD_R1		6
  ------------------
  |  Branch (2678:16): [True: 1.04k, False: 1.02k]
  ------------------
 2679|  1.04k|					ds->r1 = archive_le32dec(ds->rbytes);
 2680|  1.04k|					if (ds->r1 > (size_t)INT32_MAX)
  ------------------
  |  Branch (2680:10): [True: 8, False: 1.03k]
  ------------------
 2681|      8|						goto failed;
 2682|  1.03k|					ds->state = ST_RD_R2;
  ------------------
  |  |  164|  1.03k|#define ST_RD_R2		7
  ------------------
 2683|  1.03k|				} else if (ds->state == ST_RD_R2) {
  ------------------
  |  |  164|  1.02k|#define ST_RD_R2		7
  ------------------
  |  Branch (2683:16): [True: 1.02k, False: 0]
  ------------------
 2684|  1.02k|					ds->r2 = archive_le32dec(ds->rbytes);
 2685|  1.02k|					if (ds->r2 > (size_t)INT32_MAX)
  ------------------
  |  Branch (2685:10): [True: 5, False: 1.02k]
  ------------------
 2686|      5|						goto failed;
 2687|       |					/* We've gotten all repeated offsets. */
 2688|  1.02k|					ds->state = ST_COPY_UNCOMP1;
  ------------------
  |  |  165|  1.02k|#define ST_COPY_UNCOMP1		8
  ------------------
 2689|  1.02k|				}
 2690|  3.13k|			} while (ds->state != ST_COPY_UNCOMP1);
  ------------------
  |  |  165|  3.10k|#define ST_COPY_UNCOMP1		8
  ------------------
  |  Branch (2690:13): [True: 2.08k, False: 1.02k]
  ------------------
 2691|       |			/* FALL THROUGH */
 2692|  1.02k|		case ST_COPY_UNCOMP1:
  ------------------
  |  |  165|  1.02k|#define ST_COPY_UNCOMP1		8
  ------------------
  |  Branch (2692:3): [True: 0, False: 1.49k]
  ------------------
 2693|       |			/*
 2694|       |			 * Copy bytes from next_in to next_out directly.
 2695|       |			 */
 2696|  2.04k|			while (ds->block_bytes_avail) {
  ------------------
  |  Branch (2696:11): [True: 1.07k, False: 967]
  ------------------
 2697|  1.07k|				size_t l;
 2698|       |
 2699|  1.07k|				if (strm->avail_out <= 0)
  ------------------
  |  Branch (2699:9): [True: 30, False: 1.04k]
  ------------------
 2700|       |					/* Output buffer is empty. */
 2701|     30|					return (ARCHIVE_OK);
  ------------------
  |  |  233|     30|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2702|  1.04k|				if (strm->avail_in <= 0) {
  ------------------
  |  Branch (2702:9): [True: 27, False: 1.02k]
  ------------------
 2703|       |					/* Input buffer is empty. */
 2704|     27|					if (last)
  ------------------
  |  Branch (2704:10): [True: 1, False: 26]
  ------------------
 2705|      1|						goto failed;
 2706|     26|					return (ARCHIVE_OK);
  ------------------
  |  |  233|     26|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2707|     27|				}
 2708|  1.02k|				l = ds->block_bytes_avail;
 2709|  1.02k|				if (l > ds->w_size - ds->w_pos)
  ------------------
  |  Branch (2709:9): [True: 49, False: 973]
  ------------------
 2710|     49|					l = ds->w_size - ds->w_pos;
 2711|  1.02k|				if (l > strm->avail_out)
  ------------------
  |  Branch (2711:9): [True: 52, False: 970]
  ------------------
 2712|     52|					l = strm->avail_out;
 2713|  1.02k|				if (l > strm->avail_in)
  ------------------
  |  Branch (2713:9): [True: 25, False: 997]
  ------------------
 2714|     25|					l = strm->avail_in;
 2715|  1.02k|				memcpy(strm->next_out, strm->next_in, l);
 2716|  1.02k|				memcpy(&(ds->w_buff[ds->w_pos]),
 2717|  1.02k|				    strm->next_in, l);
 2718|  1.02k|				strm->next_in += l;
 2719|  1.02k|				strm->avail_in -= l;
 2720|  1.02k|				strm->next_out += l;
 2721|  1.02k|				strm->avail_out -= l;
 2722|  1.02k|				strm->total_out += l;
 2723|  1.02k|				ds->w_pos = (ds->w_pos + l) & ds->w_mask;
 2724|  1.02k|				if (ds->w_filled < ds->w_size) {
  ------------------
  |  Branch (2724:9): [True: 1.02k, False: 0]
  ------------------
 2725|  1.02k|					ds->w_filled += l;
 2726|  1.02k|					if (ds->w_filled > ds->w_size)
  ------------------
  |  Branch (2726:10): [True: 0, False: 1.02k]
  ------------------
 2727|      0|						ds->w_filled = ds->w_size;
 2728|  1.02k|				}
 2729|  1.02k|				ds->block_bytes_avail -= l;
 2730|  1.02k|			}
 2731|       |			/* FALL THROUGH */
 2732|    967|		case ST_COPY_UNCOMP2:
  ------------------
  |  |  166|    967|#define ST_COPY_UNCOMP2		9
  ------------------
  |  Branch (2732:3): [True: 0, False: 1.49k]
  ------------------
 2733|       |			/* Re-align; skip padding byte. */
 2734|    967|			if (ds->block_size & 1) {
  ------------------
  |  Branch (2734:8): [True: 887, False: 80]
  ------------------
 2735|    887|				if (strm->avail_in <= 0) {
  ------------------
  |  Branch (2735:9): [True: 2, False: 885]
  ------------------
 2736|       |					/* Input buffer is empty. */
 2737|      2|					ds->state = ST_COPY_UNCOMP2;
  ------------------
  |  |  166|      2|#define ST_COPY_UNCOMP2		9
  ------------------
 2738|      2|					if (last)
  ------------------
  |  Branch (2738:10): [True: 1, False: 1]
  ------------------
 2739|      1|						goto failed;
 2740|      1|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2741|      2|				}
 2742|    885|				strm->next_in++;
 2743|    885|				strm->avail_in --;
 2744|    885|			}
 2745|       |			/* This block ended. */
 2746|    965|			ds->state = ST_RD_BLOCK_TYPE;
  ------------------
  |  |  159|    965|#define ST_RD_BLOCK_TYPE	2
  ------------------
 2747|    965|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|    965|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2748|       |			/********************/
 2749|     81|		case ST_RD_ALIGNED_OFFSET:
  ------------------
  |  |  167|     81|#define ST_RD_ALIGNED_OFFSET	10
  ------------------
  |  Branch (2749:3): [True: 81, False: 1.41k]
  ------------------
 2750|       |			/*
 2751|       |			 * Read Aligned offset tree.
 2752|       |			 */
 2753|     81|			if (!lzx_br_read_ahead(strm, br, 3 * ds->at.symbol_count)) {
  ------------------
  |  | 2375|     81|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2370|    162|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2356|    162|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2356:27): [True: 70, False: 11]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|     11|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2370:28): [True: 6, False: 5]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2356|      5|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2356:27): [True: 2, False: 3]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2754|      3|				ds->state = ST_RD_ALIGNED_OFFSET;
  ------------------
  |  |  167|      3|#define ST_RD_ALIGNED_OFFSET	10
  ------------------
 2755|      3|				if (last)
  ------------------
  |  Branch (2755:9): [True: 1, False: 2]
  ------------------
 2756|      1|					goto failed;
 2757|      2|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2758|      3|			}
 2759|     78|			memset(ds->at.freq, 0, sizeof(ds->at.freq));
 2760|    702|			for (i = 0; i < ds->at.symbol_count; i++) {
  ------------------
  |  Branch (2760:16): [True: 624, False: 78]
  ------------------
 2761|    624|				ds->at.bitlen[i] = lzx_br_bits(br, 3);
  ------------------
  |  | 2359|    624|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2360|    624|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2762|    624|				ds->at.freq[ds->at.bitlen[i]]++;
 2763|    624|				lzx_br_consume(br, 3);
  ------------------
  |  | 2378|    624|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2764|    624|			}
 2765|     78|			if (lzx_make_huffman_table(&ds->at) < 0)
  ------------------
  |  Branch (2765:8): [True: 3, False: 75]
  ------------------
 2766|      3|				goto failed;
 2767|       |			/* FALL THROUGH */
 2768|    189|		case ST_RD_VERBATIM:
  ------------------
  |  |  168|    189|#define ST_RD_VERBATIM		11
  ------------------
  |  Branch (2768:3): [True: 114, False: 1.38k]
  ------------------
 2769|    189|			ds->loop = 0;
 2770|       |			/* FALL THROUGH */
 2771|    189|		case ST_RD_PRE_MAIN_TREE_256:
  ------------------
  |  |  169|    189|#define ST_RD_PRE_MAIN_TREE_256	12
  ------------------
  |  Branch (2771:3): [True: 0, False: 1.49k]
  ------------------
 2772|       |			/*
 2773|       |			 * Read Pre-tree for first 256 elements of main tree.
 2774|       |			 */
 2775|    189|			if (lzx_read_pre_tree(strm) < 0) {
  ------------------
  |  Branch (2775:8): [True: 0, False: 189]
  ------------------
 2776|      0|				ds->state = ST_RD_PRE_MAIN_TREE_256;
  ------------------
  |  |  169|      0|#define ST_RD_PRE_MAIN_TREE_256	12
  ------------------
 2777|      0|				if (last)
  ------------------
  |  Branch (2777:9): [True: 0, False: 0]
  ------------------
 2778|      0|					goto failed;
 2779|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2780|      0|			}
 2781|    189|			if (lzx_make_huffman_table(&ds->pt) < 0)
  ------------------
  |  Branch (2781:8): [True: 25, False: 164]
  ------------------
 2782|     25|				goto failed;
 2783|    164|			ds->loop = 0;
 2784|       |			/* FALL THROUGH */
 2785|    164|		case ST_MAIN_TREE_256:
  ------------------
  |  |  170|    164|#define ST_MAIN_TREE_256	13
  ------------------
  |  Branch (2785:3): [True: 0, False: 1.49k]
  ------------------
 2786|       |			/*
 2787|       |			 * Get path lengths of first 256 elements of main tree.
 2788|       |			 */
 2789|    164|			r = lzx_read_bitlen(strm, &ds->mt, 256);
 2790|    164|			if (r == ARCHIVE_EOF) {
  ------------------
  |  |  232|    164|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (2790:8): [True: 16, False: 148]
  ------------------
 2791|     16|				ds->state = ST_MAIN_TREE_256;
  ------------------
  |  |  170|     16|#define ST_MAIN_TREE_256	13
  ------------------
 2792|     16|				if (last)
  ------------------
  |  Branch (2792:9): [True: 1, False: 15]
  ------------------
 2793|      1|					goto failed;
 2794|     15|				return (ARCHIVE_OK);
  ------------------
  |  |  233|     15|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2795|    148|			} else if (r < 0)
  ------------------
  |  Branch (2795:15): [True: 13, False: 135]
  ------------------
 2796|     13|				goto failed;
 2797|    135|			ds->loop = 0;
 2798|       |			/* FALL THROUGH */
 2799|    135|		case ST_RD_PRE_MAIN_TREE_REM:
  ------------------
  |  |  171|    135|#define ST_RD_PRE_MAIN_TREE_REM	14
  ------------------
  |  Branch (2799:3): [True: 0, False: 1.49k]
  ------------------
 2800|       |			/*
 2801|       |			 * Read Pre-tree for remaining elements of main tree.
 2802|       |			 */
 2803|    135|			if (lzx_read_pre_tree(strm) < 0) {
  ------------------
  |  Branch (2803:8): [True: 0, False: 135]
  ------------------
 2804|      0|				ds->state = ST_RD_PRE_MAIN_TREE_REM;
  ------------------
  |  |  171|      0|#define ST_RD_PRE_MAIN_TREE_REM	14
  ------------------
 2805|      0|				if (last)
  ------------------
  |  Branch (2805:9): [True: 0, False: 0]
  ------------------
 2806|      0|					goto failed;
 2807|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2808|      0|			}
 2809|    135|			if (lzx_make_huffman_table(&ds->pt) < 0)
  ------------------
  |  Branch (2809:8): [True: 15, False: 120]
  ------------------
 2810|     15|				goto failed;
 2811|    120|			ds->loop = 256;
 2812|       |			/* FALL THROUGH */
 2813|    120|		case ST_MAIN_TREE_REM:
  ------------------
  |  |  172|    120|#define ST_MAIN_TREE_REM	15
  ------------------
  |  Branch (2813:3): [True: 0, False: 1.49k]
  ------------------
 2814|       |			/*
 2815|       |			 * Get path lengths of remaining elements of main tree.
 2816|       |			 */
 2817|    120|			r = lzx_read_bitlen(strm, &ds->mt, 0);
 2818|    120|			if (r == ARCHIVE_EOF) {
  ------------------
  |  |  232|    120|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (2818:8): [True: 5, False: 115]
  ------------------
 2819|      5|				ds->state = ST_MAIN_TREE_REM;
  ------------------
  |  |  172|      5|#define ST_MAIN_TREE_REM	15
  ------------------
 2820|      5|				if (last)
  ------------------
  |  Branch (2820:9): [True: 1, False: 4]
  ------------------
 2821|      1|					goto failed;
 2822|      4|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      4|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2823|    115|			} else if (r < 0)
  ------------------
  |  Branch (2823:15): [True: 4, False: 111]
  ------------------
 2824|      4|				goto failed;
 2825|    111|			if (lzx_make_huffman_table(&ds->mt) < 0)
  ------------------
  |  Branch (2825:8): [True: 3, False: 108]
  ------------------
 2826|      3|				goto failed;
 2827|    108|			ds->loop = 0;
 2828|       |			/* FALL THROUGH */
 2829|    108|		case ST_RD_PRE_LENGTH_TREE:
  ------------------
  |  |  173|    108|#define ST_RD_PRE_LENGTH_TREE	16
  ------------------
  |  Branch (2829:3): [True: 0, False: 1.49k]
  ------------------
 2830|       |			/*
 2831|       |			 * Read Pre-tree for remaining elements of main tree.
 2832|       |			 */
 2833|    108|			if (lzx_read_pre_tree(strm) < 0) {
  ------------------
  |  Branch (2833:8): [True: 0, False: 108]
  ------------------
 2834|      0|				ds->state = ST_RD_PRE_LENGTH_TREE;
  ------------------
  |  |  173|      0|#define ST_RD_PRE_LENGTH_TREE	16
  ------------------
 2835|      0|				if (last)
  ------------------
  |  Branch (2835:9): [True: 0, False: 0]
  ------------------
 2836|      0|					goto failed;
 2837|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2838|      0|			}
 2839|    108|			if (lzx_make_huffman_table(&ds->pt) < 0)
  ------------------
  |  Branch (2839:8): [True: 6, False: 102]
  ------------------
 2840|      6|				goto failed;
 2841|    102|			ds->loop = 0;
 2842|       |			/* FALL THROUGH */
 2843|    102|		case ST_LENGTH_TREE:
  ------------------
  |  |  174|    102|#define ST_LENGTH_TREE		17
  ------------------
  |  Branch (2843:3): [True: 0, False: 1.49k]
  ------------------
 2844|       |			/*
 2845|       |			 * Get path lengths of remaining elements of main tree.
 2846|       |			 */
 2847|    102|			r = lzx_read_bitlen(strm, &ds->lt, 0);
 2848|    102|			if (r == ARCHIVE_EOF) {
  ------------------
  |  |  232|    102|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (2848:8): [True: 5, False: 97]
  ------------------
 2849|      5|				ds->state = ST_LENGTH_TREE;
  ------------------
  |  |  174|      5|#define ST_LENGTH_TREE		17
  ------------------
 2850|      5|				if (last)
  ------------------
  |  Branch (2850:9): [True: 2, False: 3]
  ------------------
 2851|      2|					goto failed;
 2852|      3|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2853|     97|			} else if (r < 0)
  ------------------
  |  Branch (2853:15): [True: 4, False: 93]
  ------------------
 2854|      4|				goto failed;
 2855|     93|			if (lzx_make_huffman_table(&ds->lt) < 0)
  ------------------
  |  Branch (2855:8): [True: 3, False: 90]
  ------------------
 2856|      3|				goto failed;
 2857|     90|			ds->state = ST_MAIN;
  ------------------
  |  |  175|     90|#define ST_MAIN			18
  ------------------
 2858|     90|			return (100);
 2859|  1.49k|		}
 2860|  1.49k|	}
 2861|    138|failed:
 2862|    138|	return (ds->error = ARCHIVE_FAILED);
  ------------------
  |  |  237|    138|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2863|  1.30k|}
archive_read_support_format_cab.c:lzx_br_fillup:
 2404|  2.31k|{
 2405|       |/*
 2406|       | * x86 processor family can read misaligned data without an access error.
 2407|       | */
 2408|  2.31k|	ssize_t n = CACHE_BITS - br->cache_avail;
  ------------------
  |  |  140|  2.31k|#define CACHE_BITS		(8 * sizeof(CACHE_TYPE))
  ------------------
 2409|       |
 2410|  2.50k|	for (;;) {
 2411|  2.50k|		switch (n >> 4) {
 2412|  1.94k|		case 4:
  ------------------
  |  Branch (2412:3): [True: 1.94k, False: 562]
  ------------------
 2413|  1.94k|			if (strm->avail_in >= 8) {
  ------------------
  |  Branch (2413:8): [True: 1.81k, False: 131]
  ------------------
 2414|  1.81k|				br->cache_buffer =
 2415|  1.81k|				    ((uint64_t)strm->next_in[1]) << 56 |
 2416|  1.81k|				    ((uint64_t)strm->next_in[0]) << 48 |
 2417|  1.81k|				    ((uint64_t)strm->next_in[3]) << 40 |
 2418|  1.81k|				    ((uint64_t)strm->next_in[2]) << 32 |
 2419|  1.81k|				    ((uint32_t)strm->next_in[5]) << 24 |
 2420|  1.81k|				    ((uint32_t)strm->next_in[4]) << 16 |
 2421|  1.81k|				    ((uint32_t)strm->next_in[7]) << 8 |
 2422|  1.81k|				     (uint32_t)strm->next_in[6];
 2423|  1.81k|				strm->next_in += 8;
 2424|  1.81k|				strm->avail_in -= 8;
 2425|  1.81k|				br->cache_avail += 8 * 8;
 2426|  1.81k|				return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.81k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2427|  1.81k|			}
 2428|    131|			break;
 2429|    428|		case 3:
  ------------------
  |  Branch (2429:3): [True: 428, False: 2.08k]
  ------------------
 2430|    428|			if (strm->avail_in >= 6) {
  ------------------
  |  Branch (2430:8): [True: 283, False: 145]
  ------------------
 2431|    283|				br->cache_buffer =
 2432|    283|		 		   (br->cache_buffer << 48) |
 2433|    283|				    ((uint64_t)strm->next_in[1]) << 40 |
 2434|    283|				    ((uint64_t)strm->next_in[0]) << 32 |
 2435|    283|				    ((uint64_t)strm->next_in[3]) << 24 |
 2436|    283|				    ((uint64_t)strm->next_in[2]) << 16 |
 2437|    283|				    ((uint64_t)strm->next_in[5]) << 8 |
 2438|    283|				     (uint64_t)strm->next_in[4];
 2439|    283|				strm->next_in += 6;
 2440|    283|				strm->avail_in -= 6;
 2441|    283|				br->cache_avail += 6 * 8;
 2442|    283|				return (ARCHIVE_OK);
  ------------------
  |  |  233|    283|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2443|    283|			}
 2444|    145|			break;
 2445|    145|		case 0:
  ------------------
  |  Branch (2445:3): [True: 10, False: 2.49k]
  ------------------
 2446|       |			/* We have enough compressed data in
 2447|       |			 * the cache buffer.*/
 2448|     10|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|     10|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2449|    124|		default:
  ------------------
  |  Branch (2449:3): [True: 124, False: 2.38k]
  ------------------
 2450|    124|			break;
 2451|  2.50k|		}
 2452|    400|		if (strm->avail_in < 2) {
  ------------------
  |  Branch (2452:7): [True: 210, False: 190]
  ------------------
 2453|       |			/* There is not enough compressed data to
 2454|       |			 * fill up the cache buffer. */
 2455|    210|			if (strm->avail_in == 1) {
  ------------------
  |  Branch (2455:8): [True: 69, False: 141]
  ------------------
 2456|     69|				br->odd = *strm->next_in++;
 2457|     69|				strm->avail_in--;
 2458|     69|				br->have_odd = 1;
 2459|     69|			}
 2460|    210|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|    210|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2461|    210|		}
 2462|    190|		br->cache_buffer =
 2463|    190|		   (br->cache_buffer << 16) |
 2464|    190|		    archive_le16dec(strm->next_in);
 2465|    190|		strm->next_in += 2;
 2466|    190|		strm->avail_in -= 2;
 2467|    190|		br->cache_avail += 16;
 2468|    190|		n -= 16;
 2469|    190|	}
 2470|  2.31k|}
archive_read_support_format_cab.c:lzx_make_huffman_table:
 3292|    714|{
 3293|    714|	uint16_t bitptn[17], weight[17];
 3294|    714|	uint16_t *tbl;
 3295|    714|	const uint8_t *bitlen;
 3296|    714|	uint8_t maxbits = 0;
 3297|    714|	uint32_t ptn;
 3298|    714|	uint16_t i, symbol_count, w;
 3299|       |
 3300|       |	/*
 3301|       |	 * Initialize bit patterns.
 3302|       |	 *
 3303|       |	 * Each bitptn element represents the smallest possible
 3304|       |	 * code sequence allowed. The weight represents the amount
 3305|       |	 * of lookup bit patterns covered by a code of this length.
 3306|       |	 *
 3307|       |	 * Example of a Huffman tree:
 3308|       |	 *
 3309|       |	 * idx | freq[idx]
 3310|       |	 * ----+----------
 3311|       |	 *   1 |         1
 3312|       |	 *   2 |         2
 3313|       |	 *
 3314|       |	 * The result will be:
 3315|       |	 *
 3316|       |	 * idx | bitptn[idx] | weight[idx]
 3317|       |	 * ----+-------------+------------
 3318|       |	 *   1 |      0x0000 |       32768
 3319|       |	 *   2 |      0x8000 |       16384
 3320|       |	 *
 3321|       |	 * This means that a code with bit length 1 will take 32768
 3322|       |	 * possible combinations starting with 0b0. Since one such code exists
 3323|       |	 * (freq[1] = 1), codes with bit length 2 must start with 0b1. Since
 3324|       |	 * two codes with bit length 2 exist (freq[2] = 2), no more codes can
 3325|       |	 * be added.
 3326|       |	 *
 3327|       |	 * In this example, maxbits will be 2 (longest code length is 2).
 3328|       |	 */
 3329|    714|	ptn = 0;
 3330|  12.1k|	for (i = 1, w = 1 << 15; i <= 16; i++, w >>= 1) {
  ------------------
  |  Branch (3330:27): [True: 11.4k, False: 714]
  ------------------
 3331|  11.4k|		bitptn[i] = ptn;
 3332|  11.4k|		weight[i] = w;
 3333|  11.4k|		if (hf->freq[i]) {
  ------------------
  |  Branch (3333:7): [True: 470, False: 10.9k]
  ------------------
 3334|    470|			ptn += hf->freq[i] * w;
 3335|    470|			maxbits = i;
 3336|    470|		}
 3337|  11.4k|	}
 3338|       |	/* Verify Kraft's inequality. */
 3339|    714|	if (ptn != 0 && ptn != 0x10000)
  ------------------
  |  Branch (3339:6): [True: 221, False: 493]
  |  Branch (3339:18): [True: 51, False: 170]
  ------------------
 3340|     51|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     51|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3341|       |
 3342|       |	/*
 3343|       |	 * Shrink codes to smallest size by removing extra bits after
 3344|       |	 * the actual code sequences as good as possible.
 3345|       |	 *
 3346|       |	 * Continuing the example above:
 3347|       |	 *
 3348|       |	 * idx | bitptn[idx] | weight[idx]
 3349|       |	 * ----+-------------+-------------
 3350|       |	 *   1 |      0x0000 |       32768
 3351|       |	 *   2 |      0x8000 |       16384
 3352|       |	 *
 3353|       |	 * As can be seen, a total of 65536 entries must be created even
 3354|       |	 * though 4 would be sufficient (indices 0b00 to 0b11). Right shift
 3355|       |	 * the pattern and divide weight as much as possible:
 3356|       |	 *
 3357|       |	 * idx | bitptn[idx] | weight[idx]
 3358|       |	 * ----+-------------+-------------
 3359|       |	 *   1 |      0x0000 |           2
 3360|       |	 *   2 |      0x0002 |           1
 3361|       |	 *
 3362|       |	 * Thus, the direct, expanded lookup table only needs 4 entries.
 3363|       |	 */
 3364|    663|	if (maxbits < 16) {
  ------------------
  |  Branch (3364:6): [True: 663, False: 0]
  ------------------
 3365|    663|		uint8_t ebits = 16 - maxbits;
 3366|  1.10k|		for (i = 1; i <= maxbits; i++) {
  ------------------
  |  Branch (3366:15): [True: 440, False: 663]
  ------------------
 3367|    440|			bitptn[i] >>= ebits;
 3368|    440|			weight[i] >>= ebits;
 3369|    440|		}
 3370|    663|	}
 3371|       |
 3372|       |	/* Grow table if necessary. */
 3373|    663|	if (maxbits > hf->tbl_bits) {
  ------------------
  |  Branch (3373:6): [True: 0, False: 663]
  ------------------
 3374|      0|		size_t tbl_size;
 3375|       |
 3376|      0|		hf->tbl_bits = 16;
 3377|      0|		tbl_size = (size_t)1 << hf->tbl_bits;
 3378|       |
 3379|      0|		free(hf->tbl);
 3380|      0|		hf->tbl = calloc(tbl_size, sizeof(hf->tbl[0]));
 3381|      0|		if (hf->tbl == NULL)
  ------------------
  |  Branch (3381:7): [True: 0, False: 0]
  ------------------
 3382|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3383|      0|	}
 3384|    663|	hf->lookup_bits = maxbits;
 3385|       |
 3386|       |	/*
 3387|       |	 * Construct the direct, expanded lookup table.
 3388|       |	 *
 3389|       |	 * Store each symbol in table for every possible bit patterns starting
 3390|       |	 * with their code.
 3391|       |	 *
 3392|       |	 * Following the example with len_avail being 4:
 3393|       |	 *
 3394|       |	 * idx | bitlen[idx]
 3395|       |	 * ----+------------
 3396|       |	 *   0 |           0
 3397|       |	 *   1 |           1
 3398|       |	 *   2 |           0
 3399|       |	 *   3 |           2
 3400|       |	 *   4 |           2
 3401|       |	 *
 3402|       |	 * The resulting table contains all used symbols (1, 3, 4) for up to
 3403|       |	 * max_len bit patterns:
 3404|       |	 *
 3405|       |	 *       idx | tbl[idx]
 3406|       |	 * ----------+---------
 3407|       |	 *  0 (0b00) |        1
 3408|       |	 *  1 (0b01) |        1
 3409|       |	 *  2 (0b10) |        3
 3410|       |	 *  3 (0b11) |        4
 3411|       |	 */
 3412|    663|	tbl = hf->tbl;
 3413|    663|	bitlen = hf->bitlen;
 3414|    663|	symbol_count = hf->symbol_count;
 3415|  94.4k|	for (i = 0; i < symbol_count; i++) {
  ------------------
  |  Branch (3415:14): [True: 93.8k, False: 659]
  ------------------
 3416|  93.8k|		uint16_t *p;
 3417|  93.8k|		uint16_t cnt;
 3418|  93.8k|		uint8_t len;
 3419|       |
 3420|  93.8k|		if (bitlen[i] == 0)
  ------------------
  |  Branch (3420:7): [True: 86.7k, False: 7.06k]
  ------------------
 3421|  86.7k|			continue;
 3422|       |		/* Get a bit pattern */
 3423|  7.06k|		len = bitlen[i];
 3424|  7.06k|		if (len > maxbits)
  ------------------
  |  Branch (3424:7): [True: 4, False: 7.06k]
  ------------------
 3425|      4|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3426|  7.06k|		ptn = bitptn[len];
 3427|  7.06k|		cnt = weight[len];
 3428|       |		/* Calculate next bit pattern */
 3429|  7.06k|		bitptn[len] = ptn + cnt;
 3430|       |		/* Update the table */
 3431|  7.06k|		p = tbl + ptn;
 3432|  14.6k|		while (cnt-- > 0)
  ------------------
  |  Branch (3432:10): [True: 7.58k, False: 7.06k]
  ------------------
 3433|  7.58k|			*p++ = i;
 3434|  7.06k|	}
 3435|    659|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    659|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3436|    663|}
archive_read_support_format_cab.c:lzx_read_pre_tree:
 3154|    432|{
 3155|    432|	struct lzx_dec *ds = strm->ds;
 3156|    432|	struct lzx_br *br = &(ds->br);
 3157|    432|	uint16_t i;
 3158|       |
 3159|    432|	if (ds->loop == 0)
  ------------------
  |  Branch (3159:6): [True: 432, False: 0]
  ------------------
 3160|    432|		memset(ds->pt.freq, 0, sizeof(ds->pt.freq));
 3161|  8.05k|	for (i = ds->loop; i < ds->pt.symbol_count; i++) {
  ------------------
  |  Branch (3161:21): [True: 7.68k, False: 366]
  ------------------
 3162|  7.68k|		if (!lzx_br_read_ahead(strm, br, 4)) {
  ------------------
  |  | 2375|  7.68k|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2370|  15.3k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2356|  15.3k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2356:27): [True: 7.12k, False: 563]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|    563|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2370:28): [True: 468, False: 95]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2356|     95|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2356:27): [True: 29, False: 66]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3163|     66|			ds->loop = i;
 3164|     66|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|     66|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3165|     66|		}
 3166|  7.62k|		ds->pt.bitlen[i] = lzx_br_bits(br, 4);
  ------------------
  |  | 2359|  7.62k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2360|  7.62k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3167|  7.62k|		ds->pt.freq[ds->pt.bitlen[i]]++;
 3168|  7.62k|		lzx_br_consume(br, 4);
  ------------------
  |  | 2378|  7.62k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3169|  7.62k|	}
 3170|    366|	ds->loop = i;
 3171|    366|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    366|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3172|    432|}
archive_read_support_format_cab.c:lzx_read_bitlen:
 3179|    386|{
 3180|    386|	struct lzx_dec *ds = strm->ds;
 3181|    386|	struct lzx_br *br = &(ds->br);
 3182|    386|	int ret;
 3183|    386|	uint16_t c, i, j, rbits, same;
 3184|       |
 3185|    386|	i = ds->loop;
 3186|    386|	if (i == 0)
  ------------------
  |  Branch (3186:6): [True: 266, False: 120]
  ------------------
 3187|    266|		memset(d->freq, 0, sizeof(d->freq));
 3188|    386|	ret = ARCHIVE_EOF;
  ------------------
  |  |  232|    386|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3189|    386|	if (end == 0)
  ------------------
  |  Branch (3189:6): [True: 222, False: 164]
  ------------------
 3190|    222|		end = d->symbol_count;
 3191|  86.2k|	while (i < end) {
  ------------------
  |  Branch (3191:9): [True: 85.9k, False: 339]
  ------------------
 3192|  85.9k|		ds->loop = i;
 3193|  85.9k|		if (!lzx_br_read_ahead(strm, br, (unsigned)ds->pt.lookup_bits))
  ------------------
  |  | 2375|  85.9k|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2370|   171k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2356|   171k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2356:27): [True: 85.7k, False: 220]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|    220|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2370:28): [True: 202, False: 18]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2356|     18|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2356:27): [True: 10, False: 8]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3194|      8|			goto getdata;
 3195|  85.9k|		rbits = lzx_br_bits(br, ds->pt.lookup_bits);
  ------------------
  |  | 2359|  85.9k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2360|  85.9k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3196|  85.9k|		c = lzx_decode_huffman(&(ds->pt), rbits);
 3197|  85.9k|		switch (c) {
 3198|  1.54k|		case 17:/* several zero lengths, from 4 to 19. */
  ------------------
  |  Branch (3198:3): [True: 1.54k, False: 84.4k]
  ------------------
 3199|  1.54k|			if (!lzx_br_read_ahead(strm, br, ds->pt.bitlen[c] + 4U))
  ------------------
  |  | 2375|  1.54k|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2370|  3.08k|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2356|  3.08k|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2356:27): [True: 1.41k, False: 126]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|    126|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2370:28): [True: 109, False: 17]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2356|     17|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2356:27): [True: 8, False: 9]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3200|      9|				goto getdata;
 3201|  1.53k|			lzx_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 2378|  1.53k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3202|  1.53k|			same = lzx_br_bits(br, 4) + 4;
  ------------------
  |  | 2359|  1.53k|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2360|  1.53k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3203|  1.53k|			if (same > end - i)
  ------------------
  |  Branch (3203:8): [True: 4, False: 1.52k]
  ------------------
 3204|      4|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3205|  1.52k|			lzx_br_consume(br, 4);
  ------------------
  |  | 2378|  1.52k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3206|  9.65k|			for (j = 0; j < same; j++)
  ------------------
  |  Branch (3206:16): [True: 8.12k, False: 1.52k]
  ------------------
 3207|  8.12k|				d->bitlen[i++] = 0;
 3208|  1.52k|			break;
 3209|    264|		case 18:/* many zero lengths, from 20 to 51. */
  ------------------
  |  Branch (3209:3): [True: 264, False: 85.6k]
  ------------------
 3210|    264|			if (!lzx_br_read_ahead(strm, br, ds->pt.bitlen[c] + 5U))
  ------------------
  |  | 2375|    264|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2370|    528|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2356|    528|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2356:27): [True: 231, False: 33]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|     33|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2370:28): [True: 29, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2356|      4|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2356:27): [True: 2, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3211|      2|				goto getdata;
 3212|    262|			lzx_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 2378|    262|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3213|    262|			same = lzx_br_bits(br, 5) + 20;
  ------------------
  |  | 2359|    262|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2360|    262|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3214|    262|			if (same > end - i)
  ------------------
  |  Branch (3214:8): [True: 5, False: 257]
  ------------------
 3215|      5|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3216|    257|			lzx_br_consume(br, 5);
  ------------------
  |  | 2378|    257|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3217|    257|			memset(d->bitlen + i, 0, same);
 3218|    257|			i += same;
 3219|    257|			break;
 3220|    332|		case 19:/* a few same lengths. */
  ------------------
  |  Branch (3220:3): [True: 332, False: 85.6k]
  ------------------
 3221|    332|			if (!lzx_br_read_ahead(strm, br,
  ------------------
  |  | 2375|    332|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2370|    664|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2356|    664|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2356:27): [True: 291, False: 41]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|     41|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2370:28): [True: 31, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2356|     10|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2356:27): [True: 3, False: 7]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3222|    332|			    ds->pt.bitlen[c] + 1U + ds->pt.lookup_bits))
 3223|      7|				goto getdata;
 3224|    325|			lzx_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 2378|    325|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3225|    325|			same = lzx_br_bits(br, 1) + 4;
  ------------------
  |  | 2359|    325|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2360|    325|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3226|    325|			if (same > end - i)
  ------------------
  |  Branch (3226:8): [True: 2, False: 323]
  ------------------
 3227|      2|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3228|    323|			lzx_br_consume(br, 1);
  ------------------
  |  | 2378|    323|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3229|    323|			rbits = lzx_br_bits(br, ds->pt.lookup_bits);
  ------------------
  |  | 2359|    323|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2360|    323|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3230|    323|			c = lzx_decode_huffman(&(ds->pt), rbits);
 3231|    323|			lzx_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 2378|    323|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3232|    323|			if (c > d->bitlen[i] + 17)
  ------------------
  |  Branch (3232:8): [True: 10, False: 313]
  ------------------
 3233|     10|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     10|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3234|    313|			c = (d->bitlen[i] + 17 - c) % 17;
 3235|  1.66k|			for (j = 0; j < same; j++)
  ------------------
  |  Branch (3235:16): [True: 1.34k, False: 313]
  ------------------
 3236|  1.34k|				d->bitlen[i++] = c;
 3237|    313|			d->freq[c] += same;
 3238|    313|			break;
 3239|  83.8k|		default:
  ------------------
  |  Branch (3239:3): [True: 83.8k, False: 2.13k]
  ------------------
 3240|  83.8k|			lzx_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 2378|  83.8k|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3241|  83.8k|			if (c > d->bitlen[i] + 17)
  ------------------
  |  Branch (3241:8): [True: 0, False: 83.8k]
  ------------------
 3242|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3243|  83.8k|			c = (d->bitlen[i] + 17 - c) % 17;
 3244|  83.8k|			d->freq[c]++;
 3245|  83.8k|			d->bitlen[i++] = c;
 3246|  83.8k|			break;
 3247|  85.9k|		}
 3248|  85.9k|	}
 3249|    339|	ret = ARCHIVE_OK;
  ------------------
  |  |  233|    339|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3250|    365|getdata:
 3251|    365|	ds->loop = i;
 3252|    365|	return (ret);
 3253|    339|}
archive_read_support_format_cab.c:lzx_decode_huffman:
 3440|  5.51M|{
 3441|  5.51M|	return hf->tbl[rbits];
 3442|  5.51M|}
archive_read_support_format_cab.c:lzx_decode_blocks:
 2867|    220|{
 2868|    220|	struct lzx_dec *ds = strm->ds;
 2869|    220|	struct lzx_br bre = ds->br;
 2870|    220|	struct huffman *at = &(ds->at), *lt = &(ds->lt), *mt = &(ds->mt);
 2871|    220|	const struct lzx_pos_tbl *pos_tbl = ds->pos_tbl;
 2872|    220|	unsigned char *noutp = strm->next_out;
 2873|    220|	unsigned char *endp = noutp + strm->avail_out;
 2874|    220|	uint8_t *w_buff = ds->w_buff;
 2875|    220|	uint8_t *at_bitlen = at->bitlen;
 2876|    220|	uint8_t *lt_bitlen = lt->bitlen;
 2877|    220|	uint8_t *mt_bitlen = mt->bitlen;
 2878|    220|	size_t block_bytes_avail = ds->block_bytes_avail;
 2879|    220|	uint8_t at_lookup_bits = at->lookup_bits;
 2880|    220|	uint8_t lt_lookup_bits = lt->lookup_bits;
 2881|    220|	uint8_t mt_lookup_bits = mt->lookup_bits;
 2882|    220|	size_t copy_len = ds->copy_len, copy_pos = ds->copy_pos;
 2883|    220|	size_t w_pos = ds->w_pos, w_mask = ds->w_mask, w_size = ds->w_size;
 2884|    220|	size_t w_filled = ds->w_filled;
 2885|    220|	uint8_t length_header = ds->length_header;
 2886|    220|	uint8_t offset_bits = ds->offset_bits;
 2887|    220|	uint16_t position_slot = ds->position_slot;
 2888|    220|	size_t r0 = ds->r0, r1 = ds->r1, r2 = ds->r2;
 2889|    220|	int state = ds->state;
 2890|    220|	uint16_t c;
 2891|    220|	uint8_t block_type = ds->block_type;
 2892|       |
 2893|    223|	for (;;) {
 2894|    223|		switch (state) {
  ------------------
  |  Branch (2894:11): [True: 223, False: 0]
  ------------------
 2895|    220|		case ST_MAIN:
  ------------------
  |  |  175|    220|#define ST_MAIN			18
  ------------------
  |  Branch (2895:3): [True: 220, False: 3]
  ------------------
 2896|  5.42M|			for (;;) {
 2897|  5.42M|				if (block_bytes_avail == 0) {
  ------------------
  |  Branch (2897:9): [True: 22, False: 5.42M]
  ------------------
 2898|       |					/* This block ended. */
 2899|     22|					ds->state = ST_RD_BLOCK_TYPE;
  ------------------
  |  |  159|     22|#define ST_RD_BLOCK_TYPE	2
  ------------------
 2900|     22|					ds->br = bre;
 2901|     22|					ds->block_bytes_avail =
 2902|     22|					    block_bytes_avail;
 2903|     22|					ds->copy_len = copy_len;
 2904|     22|					ds->copy_pos = copy_pos;
 2905|     22|					ds->length_header = length_header;
 2906|     22|					ds->position_slot = position_slot;
 2907|     22|					ds->r0 = r0; ds->r1 = r1; ds->r2 = r2;
 2908|     22|					ds->w_pos = w_pos;
 2909|     22|					ds->w_filled = w_filled;
 2910|     22|					strm->avail_out = endp - noutp;
 2911|     22|					return (ARCHIVE_EOF);
  ------------------
  |  |  232|     22|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2912|     22|				}
 2913|  5.42M|				if (noutp >= endp)
  ------------------
  |  Branch (2913:9): [True: 178, False: 5.42M]
  ------------------
 2914|       |					/* Output buffer is empty. */
 2915|    178|					goto next_data;
 2916|       |
 2917|  5.42M|				if (!lzx_br_read_ahead(strm, &bre,
  ------------------
  |  | 2375|  5.42M|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2370|  10.8M|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2356|  10.8M|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2356:27): [True: 5.42M, False: 6]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|      6|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2370:28): [True: 2, False: 4]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2356|      4|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2356:27): [True: 3, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2918|  5.42M|				    mt_lookup_bits)) {
 2919|      1|					if (!last)
  ------------------
  |  Branch (2919:10): [True: 1, False: 0]
  ------------------
 2920|      1|						goto next_data;
 2921|       |					/* Remaining bits are less than
 2922|       |					 * maximum bits (mt.lookup_bits) but
 2923|       |					 * maybe it still remains as much as we
 2924|       |					 * need, so we should try to use it
 2925|       |					 * with dummy bits. */
 2926|      0|					c = lzx_decode_huffman(mt,
 2927|      0|					      lzx_br_bits_forced(
  ------------------
  |  | 2362|      0|	(((uint32_t)((br)->cache_buffer <<		\
  |  | 2363|      0|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 2928|      0|					        &bre, mt_lookup_bits));
 2929|      0|					if (!lzx_br_has(&bre, mt_bitlen[c]))
  ------------------
  |  | 2356|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (2929:10): [True: 0, False: 0]
  ------------------
 2930|      0|						goto failed;/* Over read. */
 2931|      0|					lzx_br_consume(&bre, mt_bitlen[c]);
  ------------------
  |  | 2378|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2932|  5.42M|				} else {
 2933|  5.42M|					c = lzx_decode_huffman(mt,
 2934|  5.42M|					      lzx_br_bits(&bre, mt_lookup_bits));
  ------------------
  |  | 2359|  5.42M|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2360|  5.42M|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2935|  5.42M|					lzx_br_consume(&bre, mt_bitlen[c]);
  ------------------
  |  | 2378|  5.42M|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2936|  5.42M|				}
 2937|  5.42M|				if (c > UCHAR_MAX)
  ------------------
  |  Branch (2937:9): [True: 19, False: 5.42M]
  ------------------
 2938|     19|					break;
 2939|       |				/*
 2940|       |				 * 'c' is exactly literal code.
 2941|       |				 */
 2942|       |				/* Save a decoded code to reference it
 2943|       |				 * afterward. */
 2944|  5.42M|				w_buff[w_pos] = c;
 2945|  5.42M|				w_pos = (w_pos + 1) & w_mask;
 2946|  5.42M|				if (w_filled < w_size)
  ------------------
  |  Branch (2946:9): [True: 5.29M, False: 135k]
  ------------------
 2947|  5.29M|					w_filled++;
 2948|       |				/* Store the decoded code to output buffer. */
 2949|  5.42M|				*noutp++ = c;
 2950|  5.42M|				block_bytes_avail--;
 2951|  5.42M|			}
 2952|       |			/*
 2953|       |			 * Get a match code, its length and offset.
 2954|       |			 */
 2955|     19|			c -= UCHAR_MAX + 1;
 2956|     19|			length_header = c & 7;
 2957|     19|			position_slot = c >> 3;
 2958|       |			/* FALL THROUGH */
 2959|     19|		case ST_LENGTH:
  ------------------
  |  |  176|     19|#define ST_LENGTH		19
  ------------------
  |  Branch (2959:3): [True: 0, False: 223]
  ------------------
 2960|       |			/*
 2961|       |			 * Get a length.
 2962|       |			 */
 2963|     19|			if (length_header == 7) {
  ------------------
  |  Branch (2963:8): [True: 5, False: 14]
  ------------------
 2964|      5|				if (!lzx_br_read_ahead(strm, &bre,
  ------------------
  |  | 2375|      5|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2370|     10|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2356|     10|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2356:27): [True: 5, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2370:28): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2356|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2356:27): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2965|      5|				    lt_lookup_bits)) {
 2966|      0|					if (!last) {
  ------------------
  |  Branch (2966:10): [True: 0, False: 0]
  ------------------
 2967|      0|						state = ST_LENGTH;
  ------------------
  |  |  176|      0|#define ST_LENGTH		19
  ------------------
 2968|      0|						goto next_data;
 2969|      0|					}
 2970|      0|					c = lzx_decode_huffman(lt,
 2971|      0|					      lzx_br_bits_forced(
  ------------------
  |  | 2362|      0|	(((uint32_t)((br)->cache_buffer <<		\
  |  | 2363|      0|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 2972|      0|					        &bre, lt_lookup_bits));
 2973|      0|					if (!lzx_br_has(&bre, lt_bitlen[c]))
  ------------------
  |  | 2356|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (2973:10): [True: 0, False: 0]
  ------------------
 2974|      0|						goto failed;/* Over read. */
 2975|      0|					lzx_br_consume(&bre, lt_bitlen[c]);
  ------------------
  |  | 2378|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2976|      5|				} else {
 2977|      5|					c = lzx_decode_huffman(lt,
 2978|      5|					    lzx_br_bits(&bre, lt_lookup_bits));
  ------------------
  |  | 2359|      5|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2360|      5|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2979|      5|					lzx_br_consume(&bre, lt_bitlen[c]);
  ------------------
  |  | 2378|      5|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2980|      5|				}
 2981|      5|				copy_len = c + 7 + 2;
 2982|      5|			} else
 2983|     14|				copy_len = length_header + 2;
 2984|     19|			if (copy_len > block_bytes_avail)
  ------------------
  |  Branch (2984:8): [True: 0, False: 19]
  ------------------
 2985|      0|				goto failed;
 2986|       |			/*
 2987|       |			 * Get an offset.
 2988|       |			 */
 2989|     19|			switch (position_slot) {
 2990|      1|			case 0: /* Use repeated offset 0. */
  ------------------
  |  Branch (2990:4): [True: 1, False: 18]
  ------------------
 2991|      1|				copy_pos = r0;
 2992|      1|				state = ST_REAL_POS;
  ------------------
  |  |  178|      1|#define ST_REAL_POS		21
  ------------------
 2993|      1|				continue;
 2994|      1|			case 1: /* Use repeated offset 1. */
  ------------------
  |  Branch (2994:4): [True: 1, False: 18]
  ------------------
 2995|      1|				copy_pos = r1;
 2996|       |				/* Swap repeated offset. */
 2997|      1|				r1 = r0;
 2998|      1|				r0 = copy_pos;
 2999|      1|				state = ST_REAL_POS;
  ------------------
  |  |  178|      1|#define ST_REAL_POS		21
  ------------------
 3000|      1|				continue;
 3001|      1|			case 2: /* Use repeated offset 2. */
  ------------------
  |  Branch (3001:4): [True: 1, False: 18]
  ------------------
 3002|      1|				copy_pos = r2;
 3003|       |				/* Swap repeated offset. */
 3004|      1|				r2 = r0;
 3005|      1|				r0 = copy_pos;
 3006|      1|				state = ST_REAL_POS;
  ------------------
  |  |  178|      1|#define ST_REAL_POS		21
  ------------------
 3007|      1|				continue;
 3008|     16|			default:
  ------------------
  |  Branch (3008:4): [True: 16, False: 3]
  ------------------
 3009|     16|				offset_bits =
 3010|     16|				    pos_tbl[position_slot].footer_bits;
 3011|     16|				break;
 3012|     19|			}
 3013|       |			/* FALL THROUGH */
 3014|     16|		case ST_OFFSET:
  ------------------
  |  |  177|     16|#define ST_OFFSET		20
  ------------------
  |  Branch (3014:3): [True: 0, False: 223]
  ------------------
 3015|       |			/*
 3016|       |			 * Get the offset, which is a distance from
 3017|       |			 * current window position.
 3018|       |			 */
 3019|     16|			if (block_type == ALIGNED_OFFSET_BLOCK &&
  ------------------
  |  |  203|     32|#define ALIGNED_OFFSET_BLOCK	2
  ------------------
  |  Branch (3019:8): [True: 16, False: 0]
  ------------------
 3020|     16|			    offset_bits >= 3) {
  ------------------
  |  Branch (3020:8): [True: 10, False: 6]
  ------------------
 3021|     10|				unsigned offbits = offset_bits - 3;
 3022|       |
 3023|     10|				if (!lzx_br_read_ahead(strm, &bre, offbits)) {
  ------------------
  |  | 2375|     10|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2370|     20|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2356|     20|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2356:27): [True: 7, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2370:28): [True: 1, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2356|      2|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2356:27): [True: 1, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3024|      1|					state = ST_OFFSET;
  ------------------
  |  |  177|      1|#define ST_OFFSET		20
  ------------------
 3025|      1|					if (last)
  ------------------
  |  Branch (3025:10): [True: 0, False: 1]
  ------------------
 3026|      0|						goto failed;
 3027|      1|					goto next_data;
 3028|      1|				}
 3029|      9|				copy_pos = lzx_br_bits(&bre, offbits) << 3;
  ------------------
  |  | 2359|      9|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2360|      9|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3030|       |
 3031|       |				/* Get an aligned number. */
 3032|      9|				if (!lzx_br_read_ahead(strm, &bre,
  ------------------
  |  | 2375|      9|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2370|     18|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2356|     18|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2356:27): [True: 6, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2370:28): [True: 1, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2356|      2|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2356:27): [True: 1, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3033|      9|				    offbits + at_lookup_bits)) {
 3034|      1|					if (!last) {
  ------------------
  |  Branch (3034:10): [True: 1, False: 0]
  ------------------
 3035|      1|						state = ST_OFFSET;
  ------------------
  |  |  177|      1|#define ST_OFFSET		20
  ------------------
 3036|      1|						goto next_data;
 3037|      1|					}
 3038|      0|					lzx_br_consume(&bre, offbits);
  ------------------
  |  | 2378|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3039|      0|					c = lzx_decode_huffman(at,
 3040|      0|					      lzx_br_bits_forced(&bre,
  ------------------
  |  | 2362|      0|	(((uint32_t)((br)->cache_buffer <<		\
  |  | 2363|      0|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 3041|      0|					        at_lookup_bits));
 3042|      0|					if (!lzx_br_has(&bre, at_bitlen[c]))
  ------------------
  |  | 2356|      0|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (3042:10): [True: 0, False: 0]
  ------------------
 3043|      0|						goto failed;/* Over read. */
 3044|      0|					lzx_br_consume(&bre, at_bitlen[c]);
  ------------------
  |  | 2378|      0|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3045|      8|				} else {
 3046|      8|					lzx_br_consume(&bre, offbits);
  ------------------
  |  | 2378|      8|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3047|      8|					c = lzx_decode_huffman(at,
 3048|      8|					      lzx_br_bits(&bre, at_lookup_bits));
  ------------------
  |  | 2359|      8|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2360|      8|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3049|      8|					lzx_br_consume(&bre, at_bitlen[c]);
  ------------------
  |  | 2378|      8|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3050|      8|				}
 3051|       |				/* Add an aligned number. */
 3052|      8|				copy_pos += c;
 3053|      8|			} else {
 3054|      6|				if (!lzx_br_read_ahead(strm, &bre,
  ------------------
  |  | 2375|      6|	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2370|     12|	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2356|     12|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2356:27): [True: 3, False: 3]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               	(lzx_br_has((br), (n)) || lzx_br_fillup(strm, br) == ARCHIVE_OK)
  |  |  |  |  ------------------
  |  |  |  |  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2370:28): [True: 1, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzx_br_read_ahead_0((strm), (br), (n)) || lzx_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 2356|      2|#define lzx_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2356:27): [True: 1, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3055|      6|				    offset_bits)) {
 3056|      1|					state = ST_OFFSET;
  ------------------
  |  |  177|      1|#define ST_OFFSET		20
  ------------------
 3057|      1|					if (last)
  ------------------
  |  Branch (3057:10): [True: 0, False: 1]
  ------------------
 3058|      0|						goto failed;
 3059|      1|					goto next_data;
 3060|      1|				}
 3061|      5|				copy_pos = lzx_br_bits(&bre, offset_bits);
  ------------------
  |  | 2359|      5|	(((uint32_t)((br)->cache_buffer >>		\
  |  | 2360|      5|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 3062|      5|				lzx_br_consume(&bre, offset_bits);
  ------------------
  |  | 2378|      5|#define lzx_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 3063|      5|			}
 3064|     13|			copy_pos += pos_tbl[position_slot].base - 2;
 3065|       |
 3066|       |			/* Update repeated offset LRU queue. */
 3067|     13|			r2 = r1;
 3068|     13|			r1 = r0;
 3069|     13|			r0 = copy_pos;
 3070|       |			/* FALL THROUGH */
 3071|     16|		case ST_REAL_POS:
  ------------------
  |  |  178|     16|#define ST_REAL_POS		21
  ------------------
  |  Branch (3071:3): [True: 3, False: 220]
  ------------------
 3072|       |			/*
 3073|       |			 * Compute a real position in window.
 3074|       |			 */
 3075|     16|			if (copy_pos == 0 || copy_pos > w_filled)
  ------------------
  |  Branch (3075:8): [True: 0, False: 16]
  |  Branch (3075:25): [True: 16, False: 0]
  ------------------
 3076|     16|				goto failed;
 3077|      0|			copy_pos = (w_pos - copy_pos) & w_mask;
 3078|       |			/* FALL THROUGH */
 3079|      0|		case ST_COPY:
  ------------------
  |  |  179|      0|#define ST_COPY			22
  ------------------
  |  Branch (3079:3): [True: 0, False: 223]
  ------------------
 3080|       |			/*
 3081|       |			 * Copy several bytes as extracted data from the window
 3082|       |			 * into the output buffer.
 3083|       |			 */
 3084|      0|			for (;;) {
 3085|      0|				const uint8_t *s;
 3086|      0|				size_t l;
 3087|       |
 3088|      0|				l = copy_len;
 3089|      0|				if (copy_pos > w_pos) {
  ------------------
  |  Branch (3089:9): [True: 0, False: 0]
  ------------------
 3090|      0|					if (l > w_size - copy_pos)
  ------------------
  |  Branch (3090:10): [True: 0, False: 0]
  ------------------
 3091|      0|						l = w_size - copy_pos;
 3092|      0|				} else {
 3093|      0|					if (l > w_size - w_pos)
  ------------------
  |  Branch (3093:10): [True: 0, False: 0]
  ------------------
 3094|      0|						l = w_size - w_pos;
 3095|      0|				}
 3096|      0|				if (noutp + l >= endp)
  ------------------
  |  Branch (3096:9): [True: 0, False: 0]
  ------------------
 3097|      0|					l = endp - noutp;
 3098|      0|				s = w_buff + copy_pos;
 3099|      0|				if (l >= 8 && ((copy_pos + l < w_pos)
  ------------------
  |  Branch (3099:9): [True: 0, False: 0]
  |  Branch (3099:20): [True: 0, False: 0]
  ------------------
 3100|      0|				  || (w_pos + l < copy_pos))) {
  ------------------
  |  Branch (3100:10): [True: 0, False: 0]
  ------------------
 3101|      0|					memcpy(w_buff + w_pos, s, l);
 3102|      0|					memcpy(noutp, s, l);
 3103|      0|				} else {
 3104|      0|					uint8_t *d;
 3105|      0|					size_t li;
 3106|       |
 3107|      0|					d = w_buff + w_pos;
 3108|      0|					for (li = 0; li < l; li++)
  ------------------
  |  Branch (3108:19): [True: 0, False: 0]
  ------------------
 3109|      0|						noutp[li] = d[li] = s[li];
 3110|      0|				}
 3111|      0|				noutp += l;
 3112|      0|				copy_pos = (copy_pos + l) & w_mask;
 3113|      0|				w_pos = (w_pos + l) & w_mask;
 3114|      0|				if (w_filled < w_size) {
  ------------------
  |  Branch (3114:9): [True: 0, False: 0]
  ------------------
 3115|      0|					w_filled += l;
 3116|      0|					if (w_filled > w_size)
  ------------------
  |  Branch (3116:10): [True: 0, False: 0]
  ------------------
 3117|      0|						w_filled = w_size;
 3118|      0|				}
 3119|      0|				block_bytes_avail -= l;
 3120|      0|				if (copy_len <= l)
  ------------------
  |  Branch (3120:9): [True: 0, False: 0]
  ------------------
 3121|       |					/* A copy of current pattern ended. */
 3122|      0|					break;
 3123|      0|				copy_len -= l;
 3124|      0|				if (noutp >= endp) {
  ------------------
  |  Branch (3124:9): [True: 0, False: 0]
  ------------------
 3125|       |					/* Output buffer is empty. */
 3126|      0|					state = ST_COPY;
  ------------------
  |  |  179|      0|#define ST_COPY			22
  ------------------
 3127|      0|					goto next_data;
 3128|      0|				}
 3129|      0|			}
 3130|      0|			state = ST_MAIN;
  ------------------
  |  |  175|      0|#define ST_MAIN			18
  ------------------
 3131|      0|			break;
 3132|    223|		}
 3133|    223|	}
 3134|     16|failed:
 3135|     16|	return (ds->error = ARCHIVE_FAILED);
  ------------------
  |  |  237|     16|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3136|    182|next_data:
 3137|    182|	ds->br = bre;
 3138|    182|	ds->block_bytes_avail = block_bytes_avail;
 3139|    182|	ds->copy_len = copy_len;
 3140|    182|	ds->copy_pos = copy_pos;
 3141|    182|	ds->length_header = length_header;
 3142|    182|	ds->offset_bits = offset_bits;
 3143|    182|	ds->position_slot = position_slot;
 3144|    182|	ds->r0 = r0; ds->r1 = r1; ds->r2 = r2;
 3145|    182|	ds->state = state;
 3146|    182|	ds->w_pos = w_pos;
 3147|    182|	ds->w_filled = w_filled;
 3148|    182|	strm->avail_out = endp - noutp;
 3149|    182|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    182|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3150|    220|}
archive_read_support_format_cab.c:lzx_translation:
 2321|    221|{
 2322|    221|	struct lzx_dec *ds = strm->ds;
 2323|    221|	unsigned char *p, *end;
 2324|       |
 2325|    221|	if (!ds->translation || offset >= MAX_E8_TRANSLATION || size <= 10)
  ------------------
  |  |  288|    267|#define MAX_E8_TRANSLATION	(0x8000 * MAX_UNCOMPRESS_SIZE)
  |  |  ------------------
  |  |  |  |  286|     46|#define MAX_UNCOMPRESS_SIZE	0x8000
  |  |  ------------------
  ------------------
  |  Branch (2325:6): [True: 175, False: 46]
  |  Branch (2325:26): [True: 0, False: 46]
  |  Branch (2325:58): [True: 16, False: 30]
  ------------------
 2326|    191|		return;
 2327|       |
 2328|     30|	p = buffer;
 2329|     30|	end = buffer + size - 10;
 2330|       |
 2331|  1.24k|	while (p < end && (p = memchr(p, 0xE8, end - p)) != NULL) {
  ------------------
  |  Branch (2331:9): [True: 1.23k, False: 4]
  |  Branch (2331:20): [True: 1.21k, False: 26]
  ------------------
 2332|  1.21k|		int32_t address, position;
 2333|       |
 2334|  1.21k|		address = archive_le32dec(p + 1);
 2335|  1.21k|		position = offset + (p - buffer);
 2336|       |
 2337|  1.21k|		if (address >= -position && address < ds->translation_size) {
  ------------------
  |  Branch (2337:7): [True: 506, False: 707]
  |  Branch (2337:31): [True: 248, False: 258]
  ------------------
 2338|    248|			uint32_t relative;
 2339|       |
 2340|    248|			if (address >= 0)
  ------------------
  |  Branch (2340:8): [True: 152, False: 96]
  ------------------
 2341|    152|				relative = address - position;
 2342|     96|			else
 2343|     96|				relative = address + ds->translation_size;
 2344|       |
 2345|    248|			archive_le32enc(p + 1, relative);
 2346|    248|		}
 2347|       |
 2348|  1.21k|		p += 5;
 2349|  1.21k|	}
 2350|     30|}
archive_read_support_format_cab.c:cab_read_data:
 2043|    616|{
 2044|    616|	struct cab *cab = a->format->data;
 2045|    616|	ssize_t bytes_avail;
 2046|       |
 2047|    616|	if (cab->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (2047:6): [True: 0, False: 616]
  ------------------
 2048|      0|		*buff = NULL;
 2049|      0|		*size = 0;
 2050|      0|		*offset = cab->entry_offset;
 2051|      0|		cab->end_of_entry = 1;
 2052|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2053|      0|	}
 2054|       |
 2055|    616|	*buff = cab_read_ahead_cfdata(a, &bytes_avail);
 2056|    616|	if (bytes_avail <= 0) {
  ------------------
  |  Branch (2056:6): [True: 392, False: 224]
  ------------------
 2057|    392|		*buff = NULL;
 2058|    392|		*size = 0;
 2059|    392|		*offset = 0;
 2060|    392|		if (bytes_avail == 0 &&
  ------------------
  |  Branch (2060:7): [True: 35, False: 357]
  ------------------
 2061|     35|		    cab->entry_cfdata->uncompressed_size == 0) {
  ------------------
  |  Branch (2061:7): [True: 35, False: 0]
  ------------------
 2062|       |			/* All of CFDATA in a folder has been handled. */
 2063|     35|			archive_set_error(&a->archive,
 2064|     35|			    ARCHIVE_ERRNO_FILE_FORMAT, "Invalid CFDATA");
  ------------------
  |  |  192|     35|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2065|     35|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     35|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2066|     35|		} else
 2067|    357|			return ((int)bytes_avail);
 2068|    392|	}
 2069|    224|	if (bytes_avail > cab->entry_bytes_remaining)
  ------------------
  |  Branch (2069:6): [True: 35, False: 189]
  ------------------
 2070|     35|		bytes_avail = (ssize_t)cab->entry_bytes_remaining;
 2071|       |
 2072|    224|	*size = bytes_avail;
 2073|    224|	*offset = cab->entry_offset;
 2074|    224|	cab->entry_offset += bytes_avail;
 2075|    224|	cab->entry_bytes_remaining -= bytes_avail;
 2076|    224|	if (cab->entry_bytes_remaining == 0)
  ------------------
  |  Branch (2076:6): [True: 36, False: 188]
  ------------------
 2077|     36|		cab->end_of_entry = 1;
 2078|    224|	cab->entry_unconsumed = bytes_avail;
 2079|    224|	if (cab->entry_cffolder->comptype == COMPTYPE_NONE) {
  ------------------
  |  |  324|    224|#define COMPTYPE_NONE		0x0000
  ------------------
  |  Branch (2079:6): [True: 17, False: 207]
  ------------------
 2080|       |		/* Don't consume more than current entry used. */
 2081|     17|		if (cab->entry_cfdata->unconsumed > cab->entry_unconsumed)
  ------------------
  |  Branch (2081:7): [True: 11, False: 6]
  ------------------
 2082|     11|			cab->entry_cfdata->unconsumed = cab->entry_unconsumed;
 2083|     17|	}
 2084|    224|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    224|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2085|    616|}
archive_read_support_format_cab.c:archive_read_format_cab_read_data_skip:
 2089|    320|{
 2090|    320|	struct cab *cab = a->format->data;
 2091|    320|	int64_t bytes_skipped;
 2092|    320|	int r;
 2093|       |
 2094|    320|	if (cab->end_of_archive)
  ------------------
  |  Branch (2094:6): [True: 0, False: 320]
  ------------------
 2095|      0|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2096|       |
 2097|    320|	if (!cab->read_data_invoked) {
  ------------------
  |  Branch (2097:6): [True: 29, False: 291]
  ------------------
 2098|     29|		cab->bytes_skipped += cab->entry_bytes_remaining;
 2099|     29|		cab->entry_bytes_remaining = 0;
 2100|       |		/* This entry is finished and done. */
 2101|     29|		cab->end_of_entry_cleanup = cab->end_of_entry = 1;
 2102|     29|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     29|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2103|     29|	}
 2104|       |
 2105|    291|	if (cab->entry_unconsumed) {
  ------------------
  |  Branch (2105:6): [True: 0, False: 291]
  ------------------
 2106|       |		/* Consume as much as the compressor actually used. */
 2107|      0|		r = (int)cab_consume_cfdata(a, cab->entry_unconsumed);
 2108|      0|		cab->entry_unconsumed = 0;
 2109|      0|		if (r < 0)
  ------------------
  |  Branch (2109:7): [True: 0, False: 0]
  ------------------
 2110|      0|			return (r);
 2111|    291|	} else if (cab->entry_cfdata == NULL) {
  ------------------
  |  Branch (2111:13): [True: 32, False: 259]
  ------------------
 2112|     32|		r = cab_next_cfdata(a);
 2113|     32|		if (r < 0)
  ------------------
  |  Branch (2113:7): [True: 12, False: 20]
  ------------------
 2114|     12|			return (r);
 2115|     32|	}
 2116|       |
 2117|       |	/* if we've already read to end of data, we're done. */
 2118|    279|	if (cab->end_of_entry_cleanup)
  ------------------
  |  Branch (2118:6): [True: 266, False: 13]
  ------------------
 2119|    266|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    266|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2120|       |
 2121|       |	/*
 2122|       |	 * If the length is at the beginning, we can skip the
 2123|       |	 * compressed data much more quickly.
 2124|       |	 */
 2125|     13|	bytes_skipped = cab_consume_cfdata(a, cab->entry_bytes_remaining);
 2126|     13|	if (bytes_skipped < 0)
  ------------------
  |  Branch (2126:6): [True: 12, False: 1]
  ------------------
 2127|     12|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2128|       |
 2129|       |	/* If the compression type is none(uncompressed), we've already
 2130|       |	 * consumed data as much as the current entry size. */
 2131|      1|	if (cab->entry_cffolder->comptype == COMPTYPE_NONE &&
  ------------------
  |  |  324|      2|#define COMPTYPE_NONE		0x0000
  ------------------
  |  Branch (2131:6): [True: 0, False: 1]
  ------------------
 2132|      0|	    cab->entry_cfdata != NULL)
  ------------------
  |  Branch (2132:6): [True: 0, False: 0]
  ------------------
 2133|      0|		cab->entry_cfdata->unconsumed = 0;
 2134|       |
 2135|       |	/* This entry is finished and done. */
 2136|      1|	cab->end_of_entry_cleanup = cab->end_of_entry = 1;
 2137|      1|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2138|     13|}
archive_read_support_format_cab.c:archive_read_format_cab_cleanup:
 2142|  16.7k|{
 2143|  16.7k|	struct cab *cab = a->format->data;
 2144|  16.7k|	struct cfheader *hd = &cab->cfheader;
 2145|  16.7k|	uint16_t i;
 2146|       |
 2147|  16.7k|	if (hd->folder_array != NULL) {
  ------------------
  |  Branch (2147:6): [True: 572, False: 16.1k]
  ------------------
 2148|   375k|		for (i = 0; i < hd->folder_count; i++)
  ------------------
  |  Branch (2148:15): [True: 374k, False: 572]
  ------------------
 2149|   374k|			free(hd->folder_array[i].cfdata.memimage);
 2150|    572|		free(hd->folder_array);
 2151|    572|	}
 2152|  16.7k|	if (hd->file_array != NULL) {
  ------------------
  |  Branch (2152:6): [True: 526, False: 16.1k]
  ------------------
 2153|   146k|		for (i = 0; i < cab->cfheader.file_count; i++)
  ------------------
  |  Branch (2153:15): [True: 145k, False: 526]
  ------------------
 2154|   145k|			archive_string_free(&(hd->file_array[i].pathname));
 2155|    526|		free(hd->file_array);
 2156|    526|	}
 2157|  16.7k|#ifdef HAVE_ZLIB_H
 2158|  16.7k|	if (cab->stream_valid)
  ------------------
  |  Branch (2158:6): [True: 32, False: 16.6k]
  ------------------
 2159|     32|		inflateEnd(&cab->stream);
 2160|  16.7k|#endif
 2161|  16.7k|	lzx_decode_free(&cab->xstrm);
 2162|  16.7k|	archive_wstring_free(&cab->ws);
 2163|  16.7k|	free(cab->uncompressed_buffer);
 2164|  16.7k|	free(cab);
 2165|  16.7k|	a->format->data = NULL;
 2166|  16.7k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2167|  16.7k|}
archive_read_support_format_cab.c:lzx_decode_free:
 2301|  16.7k|{
 2302|       |
 2303|  16.7k|	if (strm->ds == NULL)
  ------------------
  |  Branch (2303:6): [True: 16.4k, False: 322]
  ------------------
 2304|  16.4k|		return;
 2305|    322|	free(strm->ds->w_buff);
 2306|    322|	free(strm->ds->pos_tbl);
 2307|    322|	lzx_huffman_free(&(strm->ds->at));
 2308|    322|	lzx_huffman_free(&(strm->ds->pt));
 2309|    322|	lzx_huffman_free(&(strm->ds->mt));
 2310|    322|	lzx_huffman_free(&(strm->ds->lt));
 2311|    322|	free(strm->ds);
 2312|       |	strm->ds = NULL;
 2313|    322|}
archive_read_support_format_cab.c:lzx_huffman_free:
 3281|  1.28k|{
 3282|  1.28k|	free(hf->bitlen);
 3283|  1.28k|	free(hf->tbl);
 3284|  1.28k|}

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

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

archive_read_support_format_iso9660:
  457|  16.7k|{
  458|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
  459|  16.7k|	struct iso9660 *iso9660;
  460|  16.7k|	int r;
  461|       |
  462|  16.7k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
  463|  16.7k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_iso9660");
  464|       |
  465|  16.7k|	iso9660 = calloc(1, sizeof(*iso9660));
  466|  16.7k|	if (iso9660 == NULL) {
  ------------------
  |  Branch (466:6): [True: 0, False: 16.7k]
  ------------------
  467|      0|		archive_set_error(_a, ENOMEM, "Can't allocate iso9660 data");
  468|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  469|      0|	}
  470|  16.7k|	iso9660->magic = ISO9660_MAGIC;
  ------------------
  |  |  324|  16.7k|#define ISO9660_MAGIC   0x96609660
  ------------------
  471|  16.7k|	iso9660->cache_files.first = NULL;
  472|  16.7k|	iso9660->cache_files.last = &(iso9660->cache_files.first);
  473|  16.7k|	iso9660->re_files.first = NULL;
  474|  16.7k|	iso9660->re_files.last = &(iso9660->re_files.first);
  475|       |	/* Enable to support Joliet extensions by default.	*/
  476|  16.7k|	iso9660->opt_support_joliet = 1;
  477|       |	/* Enable to support Rock Ridge extensions by default.	*/
  478|  16.7k|	iso9660->opt_support_rockridge = 1;
  479|       |
  480|  16.7k|	r = __archive_read_register_format(a,
  481|  16.7k|	    iso9660,
  482|  16.7k|	    "iso9660",
  483|  16.7k|	    archive_read_format_iso9660_bid,
  484|  16.7k|	    archive_read_format_iso9660_options,
  485|  16.7k|	    archive_read_format_iso9660_read_header,
  486|  16.7k|	    archive_read_format_iso9660_read_data,
  487|  16.7k|	    archive_read_format_iso9660_read_data_skip,
  488|  16.7k|	    NULL,
  489|  16.7k|	    archive_read_format_iso9660_cleanup,
  490|  16.7k|	    NULL,
  491|  16.7k|	    NULL);
  492|       |
  493|  16.7k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (493:6): [True: 0, False: 16.7k]
  ------------------
  494|      0|		free(iso9660);
  495|  16.7k|	return (r);
  496|  16.7k|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_bid:
  501|  16.4k|{
  502|  16.4k|	struct iso9660 *iso9660 = a->format->data;
  503|  16.4k|	ssize_t bytes_read;
  504|  16.4k|	const unsigned char *h;
  505|  16.4k|	int seenTerminator;
  506|       |
  507|       |	/* If there's already a better bid than we can ever
  508|       |	   make, don't bother testing. */
  509|  16.4k|	if (best_bid > 48)
  ------------------
  |  Branch (509:6): [True: 6.48k, False: 9.93k]
  ------------------
  510|  6.48k|		return (-1);
  511|       |
  512|       |	/*
  513|       |	 * Skip the first 32k (reserved area) and get the first
  514|       |	 * 8 sectors of the volume descriptor table.  Of course,
  515|       |	 * if the I/O layer gives us more, we'll take it.
  516|       |	 */
  517|  9.93k|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  518|  9.93k|	h = __archive_read_ahead(a,
  519|  9.93k|	    RESERVED_AREA + 8 * LOGICAL_BLOCK_SIZE,
  ------------------
  |  |  517|  9.93k|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   83|  9.93k|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|  9.93k|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
              	    RESERVED_AREA + 8 * LOGICAL_BLOCK_SIZE,
  ------------------
  |  |   82|  9.93k|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  520|  9.93k|	    &bytes_read);
  521|  9.93k|	if (h == NULL)
  ------------------
  |  Branch (521:6): [True: 9.26k, False: 674]
  ------------------
  522|  9.26k|	    return (-1);
  523|       |
  524|       |	/* Skip the reserved area. */
  525|    674|	bytes_read -= RESERVED_AREA;
  ------------------
  |  |  517|    674|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   83|    674|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|    674|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
  526|    674|	h += RESERVED_AREA;
  ------------------
  |  |  517|    674|#define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   83|    674|#define	SYSTEM_AREA_BLOCK	16
  |  |  ------------------
  |  |               #define RESERVED_AREA	(SYSTEM_AREA_BLOCK * LOGICAL_BLOCK_SIZE)
  |  |  ------------------
  |  |  |  |   82|    674|#define	LOGICAL_BLOCK_SIZE	2048
  |  |  ------------------
  ------------------
  527|       |
  528|       |	/* Check each volume descriptor. */
  529|    674|	seenTerminator = 0;
  530|    930|	for (; bytes_read > LOGICAL_BLOCK_SIZE;
  ------------------
  |  |   82|    930|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  |  Branch (530:9): [True: 930, False: 0]
  ------------------
  531|    930|	    bytes_read -= LOGICAL_BLOCK_SIZE, h += LOGICAL_BLOCK_SIZE) {
  ------------------
  |  |   82|    256|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
              	    bytes_read -= LOGICAL_BLOCK_SIZE, h += LOGICAL_BLOCK_SIZE) {
  ------------------
  |  |   82|    256|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
  532|       |		/* Do not handle undefined Volume Descriptor Type. */
  533|    930|		if (h[0] >= 4 && h[0] <= 254)
  ------------------
  |  Branch (533:7): [True: 511, False: 419]
  |  Branch (533:20): [True: 357, False: 154]
  ------------------
  534|    357|			return (0);
  535|       |		/* Standard Identifier must be "CD001" */
  536|    573|		if (memcmp(h + 1, "CD001", 5) != 0)
  ------------------
  |  Branch (536:7): [True: 89, False: 484]
  ------------------
  537|     89|			return (0);
  538|    484|		if (isPVD(iso9660, h))
  ------------------
  |  Branch (538:7): [True: 147, False: 337]
  ------------------
  539|    147|			continue;
  540|    337|		if (!iso9660->joliet.location) {
  ------------------
  |  Branch (540:7): [True: 307, False: 30]
  ------------------
  541|    307|			if (isJolietSVD(iso9660, h))
  ------------------
  |  Branch (541:8): [True: 33, False: 274]
  ------------------
  542|     33|				continue;
  543|    307|		}
  544|    304|		if (isBootRecord(h))
  ------------------
  |  Branch (544:7): [True: 8, False: 296]
  ------------------
  545|      8|			continue;
  546|    296|		if (isEVD(h))
  ------------------
  |  Branch (546:7): [True: 0, False: 296]
  ------------------
  547|      0|			continue;
  548|    296|		if (isSVD(h))
  ------------------
  |  Branch (548:7): [True: 68, False: 228]
  ------------------
  549|     68|			continue;
  550|    228|		if (isVolumePartition(iso9660, h))
  ------------------
  |  Branch (550:7): [True: 0, False: 228]
  ------------------
  551|      0|			continue;
  552|    228|		if (isVDSetTerminator(h)) {
  ------------------
  |  Branch (552:7): [True: 124, False: 104]
  ------------------
  553|    124|			seenTerminator = 1;
  554|    124|			break;
  555|    124|		}
  556|    104|		return (0);
  557|    228|	}
  558|       |	/*
  559|       |	 * ISO 9660 format must have Primary Volume Descriptor and
  560|       |	 * Volume Descriptor Set Terminator.
  561|       |	 */
  562|    124|	if (seenTerminator && iso9660->primary.location > 16)
  ------------------
  |  Branch (562:6): [True: 124, False: 0]
  |  Branch (562:24): [True: 123, False: 1]
  ------------------
  563|    123|		return (48);
  564|       |
  565|       |	/* We didn't find a valid PVD; return a bid of zero. */
  566|      1|	return (0);
  567|    124|}
archive_read_support_format_iso9660.c:isPVD:
  860|    484|{
  861|    484|	const unsigned char *p;
  862|    484|	ssize_t logical_block_size;
  863|    484|	int32_t volume_block;
  864|    484|	int32_t location;
  865|    484|	int i;
  866|       |
  867|       |	/* Type of the Primary Volume Descriptor must be 1. */
  868|    484|	if (h[PVD_type_offset] != 1)
  ------------------
  |  |   86|    484|#define PVD_type_offset 0
  ------------------
  |  Branch (868:6): [True: 310, False: 174]
  ------------------
  869|    310|		return (0);
  870|       |
  871|       |	/* PVD version must be 1. */
  872|    174|	if (h[PVD_version_offset] != 1)
  ------------------
  |  |   90|    174|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   88|    174|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   86|    174|#define PVD_type_offset 0
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|    174|#define PVD_type_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   89|    174|#define PVD_id_size 5
  |  |  ------------------
  ------------------
  |  Branch (872:6): [True: 1, False: 173]
  ------------------
  873|      1|		return (0);
  874|       |
  875|       |	/* Reserved field must be 0. */
  876|    173|	if (h[PVD_reserved1_offset] != 0)
  ------------------
  |  |   92|    173|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   90|    173|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|    173|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   86|    173|#define PVD_type_offset 0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   87|    173|#define PVD_type_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|    173|#define PVD_id_size 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   91|    173|#define PVD_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (876:6): [True: 1, False: 172]
  ------------------
  877|      1|		return (0);
  878|       |
  879|       |	/* Reserved field must be 0. */
  880|    172|	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   98|    172|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   96|    172|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|    172|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|    172|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   90|    172|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   88|    172|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    172|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    172|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   89|    172|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|    172|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|    172|#define PVD_reserved1_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|    172|#define PVD_system_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   97|    172|#define PVD_volume_id_size 32
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   99|    172|#define PVD_reserved2_size 8
  ------------------
  |  Branch (880:6): [True: 2, False: 170]
  ------------------
  881|      2|		return (0);
  882|       |
  883|       |	/* Volume space size must be encoded according to 7.3.3 */
  884|    170|	if (!isValid733Integer(h + PVD_volume_space_size_offset)) {
  ------------------
  |  |  100|    170|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|    170|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|    170|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|    170|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|    170|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|    170|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    170|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    170|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    170|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    170|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|    170|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|    170|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|    170|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|    170|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   99|    170|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  |  Branch (884:6): [True: 3, False: 167]
  ------------------
  885|      3|		return (0);
  886|      3|	}
  887|    167|	volume_block = archive_le32dec(h + PVD_volume_space_size_offset);
  ------------------
  |  |  100|    167|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|    167|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|    167|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|    167|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|    167|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|    167|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    167|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    167|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    167|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    167|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|    167|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|    167|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|    167|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|    167|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   99|    167|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  888|    167|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   83|    167|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (888:6): [True: 1, False: 166]
  ------------------
  889|      1|		return (0);
  890|       |
  891|       |	/* Reserved field must be 0. */
  892|    166|	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  102|    166|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  100|    166|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|    166|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|    166|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|    166|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   92|    166|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    166|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    166|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    166|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    166|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    166|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    166|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   93|    166|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|    166|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   97|    166|#define PVD_volume_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|    166|#define PVD_reserved2_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  101|    166|#define PVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  103|    166|#define PVD_reserved3_size 32
  ------------------
  |  Branch (892:6): [True: 1, False: 165]
  ------------------
  893|      1|		return (0);
  894|       |
  895|       |	/* Volume set size must be encoded according to 7.2.3 */
  896|    165|	if (!isValid723Integer(h + PVD_volume_set_size_offset)) {
  ------------------
  |  |  104|    165|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  ------------------
  |  |  |  |  102|    165|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  100|    165|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   98|    165|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   96|    165|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   94|    165|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    165|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    165|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    165|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    165|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    165|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    165|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    165|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    165|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   95|    165|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   97|    165|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   99|    165|#define PVD_reserved2_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  101|    165|#define PVD_volume_space_size_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  ------------------
  |  |  |  |  103|    165|#define PVD_reserved3_size 32
  |  |  ------------------
  ------------------
  |  Branch (896:6): [True: 2, False: 163]
  ------------------
  897|      2|		return (0);
  898|      2|	}
  899|       |
  900|       |	/* Volume sequence number must be encoded according to 7.2.3 */
  901|    163|	if (!isValid723Integer(h + PVD_volume_sequence_number_offset)) {
  ------------------
  |  |  106|    163|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  ------------------
  |  |  |  |  104|    163|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  102|    163|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  100|    163|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   98|    163|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   96|    163|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    163|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    163|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    163|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    163|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    163|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    163|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    163|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    163|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    163|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    163|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   97|    163|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   99|    163|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  101|    163|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  103|    163|#define PVD_reserved3_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  ------------------
  |  |  |  |  105|    163|#define PVD_volume_set_size_size 4
  |  |  ------------------
  ------------------
  |  Branch (901:6): [True: 1, False: 162]
  ------------------
  902|      1|		return (0);
  903|      1|	}
  904|       |
  905|       |	/* Logical block size must be > 0. */
  906|       |	/* I've looked at Ecma 119 and can't find any stronger
  907|       |	 * restriction on this field. */
  908|    162|	if (!isValid723Integer(h + PVD_logical_block_size_offset)) {
  ------------------
  |  |  108|    162|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|    162|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|    162|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|    162|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|    162|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|    162|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    162|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    162|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    162|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    162|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    162|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    162|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    162|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    162|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    162|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    162|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    162|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    162|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   99|    162|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  101|    162|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    162|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    162|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  107|    162|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  |  Branch (908:6): [True: 1, False: 161]
  ------------------
  909|      1|		return (0);
  910|      1|	}
  911|    161|	logical_block_size =
  912|    161|	    archive_le16dec(h + PVD_logical_block_size_offset);
  ------------------
  |  |  108|    161|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|    161|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|    161|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|    161|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|    161|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|    161|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    161|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    161|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    161|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    161|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    161|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    161|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    161|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    161|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    161|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    161|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    161|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    161|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   99|    161|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  101|    161|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|    161|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|    161|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  107|    161|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  913|    161|	if (logical_block_size <= 0)
  ------------------
  |  Branch (913:6): [True: 0, False: 161]
  ------------------
  914|      0|		return (0);
  915|       |
  916|       |	/* Path Table size must be encoded according to 7.3.3 */
  917|    161|	if (!isValid733Integer(h + PVD_path_table_size_offset)) {
  ------------------
  |  |  110|    161|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  ------------------
  |  |  |  |  108|    161|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  106|    161|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  104|    161|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  102|    161|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  100|    161|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    161|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    161|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    161|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    161|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    161|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    161|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    161|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    161|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    161|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    161|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    161|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    161|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    161|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    161|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  101|    161|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  103|    161|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  105|    161|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  107|    161|#define PVD_volume_sequence_number_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  ------------------
  |  |  |  |  109|    161|#define PVD_logical_block_size_size 4
  |  |  ------------------
  ------------------
  |  Branch (917:6): [True: 3, False: 158]
  ------------------
  918|      3|		return (0);
  919|      3|	}
  920|       |
  921|       |	/* File structure version must be 1 for ISO9660/ECMA119. */
  922|    158|	if (h[PVD_file_structure_version_offset] != 1)
  ------------------
  |  |  144|    158|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  142|    158|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|    158|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  138|    158|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|    158|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  134|    158|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    158|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    158|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    158|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    158|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    158|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    158|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    158|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    158|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    158|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    158|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    158|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    158|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    158|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    158|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    158|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    158|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    158|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    158|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    158|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    158|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    158|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    158|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    158|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    158|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    158|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    158|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    158|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    158|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    158|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    158|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    158|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    158|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    158|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    158|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    158|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    158|#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|    158|#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|    158|#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|    158|#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|    158|#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|    158|#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|    158|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    158|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    158|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    158|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    158|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    158|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    158|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  135|    158|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  137|    158|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|    158|#define PVD_modification_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|    158|#define PVD_expiration_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  143|    158|#define PVD_effective_date_size 17
  |  |  ------------------
  ------------------
  |  Branch (922:6): [True: 1, False: 157]
  ------------------
  923|      1|		return (0);
  924|       |
  925|       |	/* Location of Occurrence of Type L Path Table must be
  926|       |	 * available location,
  927|       |	 * > SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  928|    157|	location = archive_le32dec(h+PVD_type_1_path_table_offset);
  ------------------
  |  |  112|    157|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  110|    157|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|    157|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|    157|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  104|    157|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  102|    157|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    157|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    157|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    157|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    157|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    157|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    157|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    157|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    157|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    157|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    157|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    157|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    157|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    157|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    157|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    157|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    157|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  103|    157|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  105|    157|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|    157|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|    157|#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|    157|#define PVD_path_table_size_size 8
  |  |  ------------------
  ------------------
  929|    157|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   83|    157|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (929:6): [True: 1, False: 156]
  |  Branch (929:40): [True: 1, False: 155]
  ------------------
  930|      2|		return (0);
  931|       |
  932|       |	/* The Type M Path Table must also be at a valid location
  933|       |	 * (although ECMA 119 requires a Type M Path Table, WinISO and
  934|       |	 * probably other programs omit it, so we permit a zero here)
  935|       |	 *
  936|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  937|    155|	location = archive_be32dec(h+PVD_type_m_path_table_offset);
  ------------------
  |  |  116|    155|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  ------------------
  |  |  |  |  114|    155|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  112|    155|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|    155|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  108|    155|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  106|    155|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    155|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    155|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    155|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    155|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    155|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    155|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    155|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    155|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    155|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    155|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    155|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    155|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    155|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    155|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    155|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    155|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    155|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    155|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    155|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    155|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  107|    155|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|    155|#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|    155|#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|    155|#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|    155|#define PVD_opt_type_1_path_table_size 4
  |  |  ------------------
  ------------------
  938|    155|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   83|    154|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (938:7): [True: 154, False: 1]
  |  Branch (938:23): [True: 0, False: 154]
  ------------------
  939|    155|	    || location >= volume_block)
  ------------------
  |  Branch (939:9): [True: 0, False: 155]
  ------------------
  940|      0|		return (0);
  941|       |
  942|       |	/* Reserved field must be 0. */
  943|       |	/* But accept NetBSD/FreeBSD "makefs" images with 0x20 here. */
  944|    309|	for (i = 0; i < PVD_reserved4_size; ++i)
  ------------------
  |  |  147|    309|#define PVD_reserved4_size 1
  ------------------
  |  Branch (944:14): [True: 155, False: 154]
  ------------------
  945|    155|		if (h[PVD_reserved4_offset + i] != 0
  ------------------
  |  |  146|    155|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|    155|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|    155|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|    155|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|    155|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|    155|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    155|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    155|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    155|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    155|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    155|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    155|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    155|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    155|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    155|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    155|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    155|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    155|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    155|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    155|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    155|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    155|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    155|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    155|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    155|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    155|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    155|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    155|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    155|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    155|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    155|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    155|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    155|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    155|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    155|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    155|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    155|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    155|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    155|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    155|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    155|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    155|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    155|#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|    155|#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|    155|#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|    155|#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|    155|#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|    155|#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|    155|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    155|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    155|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    155|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    155|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    155|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    155|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|    155|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  137|    155|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|    155|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  141|    155|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|    155|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  145|    155|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (945:7): [True: 65, False: 90]
  ------------------
  946|     65|		    && h[PVD_reserved4_offset + i] != 0x20)
  ------------------
  |  |  146|     65|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|     65|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|     65|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|     65|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|     65|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|     65|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|     65|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|     65|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|     65|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|     65|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|     65|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|     65|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|     65|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|     65|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|     65|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|     65|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|     65|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|     65|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|     65|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|     65|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|     65|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     65|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     65|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     65|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     65|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     65|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     65|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     65|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     65|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     65|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     65|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     65|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     65|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     65|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     65|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     65|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     65|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     65|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     65|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     65|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     65|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|     65|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|     65|#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|     65|#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|     65|#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|     65|#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|     65|#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|     65|#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|     65|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|     65|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|     65|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|     65|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|     65|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|     65|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|     65|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|     65|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  137|     65|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|     65|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  141|     65|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|     65|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  145|     65|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (946:10): [True: 1, False: 64]
  ------------------
  947|      1|			return (0);
  948|       |
  949|       |	/* Reserved field must be 0. */
  950|    154|	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  150|    154|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  148|    154|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|    154|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|    154|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  142|    154|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  140|    154|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|    154|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|    154|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    154|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    154|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    154|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    154|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    154|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    154|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    154|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    154|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    154|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    154|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    154|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    154|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    154|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    154|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    154|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    154|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    154|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    154|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    154|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    154|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    154|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    154|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    154|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    154|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    154|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    154|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    154|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    154|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    154|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    154|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    154|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    154|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    154|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    154|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    154|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    154|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    154|#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|    154|#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|    154|#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|    154|#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|    154|#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|    154|#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|    154|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    154|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    154|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    154|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    154|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    154|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    154|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|    154|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|    154|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|    154|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  141|    154|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  143|    154|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  145|    154|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|    154|#define PVD_reserved4_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  149|    154|#define PVD_application_data_size 512
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  151|    154|#define PVD_reserved5_size (2048 - PVD_reserved5_offset)
  |  |  ------------------
  |  |  |  |  150|    154|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  148|    154|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  146|    154|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  144|    154|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  142|    154|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  140|    154|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|    154|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|    154|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|    154|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|    154|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|    154|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|    154|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|    154|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|    154|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|    154|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|    154|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|    154|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|    154|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|    154|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|    154|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|    154|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    154|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    154|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    154|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    154|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    154|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    154|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    154|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    154|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    154|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    154|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    154|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    154|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    154|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    154|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    154|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    154|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    154|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    154|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    154|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    154|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    154|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    154|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    154|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    154|#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|    154|#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|    154|#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|    154|#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|    154|#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|    154|#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|    154|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|    154|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|    154|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|    154|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|    154|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|    154|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|    154|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|    154|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|    154|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|    154|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  141|    154|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  143|    154|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  145|    154|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|    154|#define PVD_reserved4_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  149|    154|#define PVD_application_data_size 512
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (950:6): [True: 1, False: 153]
  ------------------
  951|      1|		return (0);
  952|       |
  953|       |	/* XXX TODO: Check other values for sanity; reject more
  954|       |	 * malformed PVDs. XXX */
  955|       |
  956|       |	/* Read Root Directory Record in Volume Descriptor. */
  957|    153|	p = h + PVD_root_directory_record_offset;
  ------------------
  |  |  120|    153|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  ------------------
  |  |  |  |  118|    153|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|    153|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  114|    153|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  112|    153|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  110|    153|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|    153|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|    153|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|    153|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|    153|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|    153|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|    153|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|    153|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|    153|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|    153|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|    153|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|    153|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|    153|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|    153|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|    153|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|    153|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|    153|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|    153|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|    153|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|    153|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|    153|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|    153|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|    153|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|    153|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|    153|#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|    153|#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|    153|#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|    153|#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|    153|#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|    153|#define PVD_opt_type_m_path_table_size 4
  |  |  ------------------
  ------------------
  958|    153|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (958:6): [True: 6, False: 147]
  ------------------
  959|      6|		return (0);
  960|      6|	}
  961|       |
  962|    147|	if (!iso9660->primary.location) {
  ------------------
  |  Branch (962:6): [True: 146, False: 1]
  ------------------
  963|    146|		iso9660->logical_block_size = logical_block_size;
  964|    146|		iso9660->volume_block = volume_block;
  965|    146|		iso9660->volume_size =
  966|    146|		    logical_block_size * (uint64_t)volume_block;
  967|    146|		iso9660->primary.location =
  968|    146|		    archive_le32dec(p + DR_extent_offset);
  ------------------
  |  |  200|    146|#define DR_extent_offset 2
  ------------------
  969|    146|		iso9660->primary.size = archive_le32dec(p + DR_size_offset);
  ------------------
  |  |  202|    146|#define DR_size_offset 10
  ------------------
  970|    146|	}
  971|       |
  972|    147|	return (48);
  973|    153|}
archive_read_support_format_iso9660.c:isNull:
  599|  1.56k|{
  600|  1.56k|	if (bytes == 0)
  ------------------
  |  Branch (600:6): [True: 0, False: 1.56k]
  ------------------
  601|      0|		return (1);
  602|       |
  603|       |	/*
  604|       |	 * If the first byte is zero and every byte equals the following
  605|       |	 * byte, the entire range is zero.
  606|       |	 */
  607|  1.56k|	return (h[offset] == 0 &&
  ------------------
  |  Branch (607:10): [True: 1.53k, False: 28]
  ------------------
  608|  1.53k|	    (bytes == 1 ||
  ------------------
  |  Branch (608:7): [True: 289, False: 1.24k]
  ------------------
  609|  1.24k|	    memcmp(h + offset, h + offset + 1, bytes - 1) == 0));
  ------------------
  |  Branch (609:6): [True: 1.19k, False: 51]
  ------------------
  610|  1.56k|}
archive_read_support_format_iso9660.c:isValid733Integer:
 3242|  1.02k|{
 3243|  1.02k|	return (p[0] == p[7]
  ------------------
  |  Branch (3243:10): [True: 1.01k, False: 8]
  ------------------
 3244|  1.01k|		&& p[1] == p[6]
  ------------------
  |  Branch (3244:6): [True: 1.00k, False: 6]
  ------------------
 3245|  1.00k|		&& p[2] == p[5]
  ------------------
  |  Branch (3245:6): [True: 1.00k, False: 8]
  ------------------
 3246|  1.00k|		&& p[3] == p[4]);
  ------------------
  |  Branch (3246:6): [True: 998, False: 3]
  ------------------
 3247|  1.02k|}
archive_read_support_format_iso9660.c:isValid723Integer:
 3236|    818|isValid723Integer(const unsigned char *p) {
 3237|    818|	return (p[0] == p[3] && p[1] == p[2]);
  ------------------
  |  Branch (3237:10): [True: 813, False: 5]
  |  Branch (3237:26): [True: 809, False: 4]
  ------------------
 3238|    818|}
archive_read_support_format_iso9660.c:isRootDirectoryRecord:
  976|    358|isRootDirectoryRecord(const unsigned char *p) {
  977|    358|	int flags;
  978|       |
  979|       |	/* ECMA119/ISO9660 requires that the root directory record be _exactly_ 34 bytes.
  980|       |	 * However, we've seen images that have root directory records up to 68 bytes. */
  981|    358|	if (p[DR_length_offset] < 34 || p[DR_length_offset] > 68) {
  ------------------
  |  |  196|    358|#define DR_length_offset 0
  ------------------
              	if (p[DR_length_offset] < 34 || p[DR_length_offset] > 68) {
  ------------------
  |  |  196|    354|#define DR_length_offset 0
  ------------------
  |  Branch (981:6): [True: 4, False: 354]
  |  Branch (981:34): [True: 4, False: 350]
  ------------------
  982|      8|		return (0);
  983|      8|	}
  984|       |
  985|       |	/* The root directory location must be a 7.3.3 32-bit integer. */
  986|    350|	if (!isValid733Integer(p + DR_extent_offset)) {
  ------------------
  |  |  200|    350|#define DR_extent_offset 2
  ------------------
  |  Branch (986:6): [True: 8, False: 342]
  ------------------
  987|      8|		return (0);
  988|      8|	}
  989|       |
  990|       |	/* The root directory size must be a 7.3.3 integer. */
  991|    342|	if (!isValid733Integer(p + DR_size_offset)) {
  ------------------
  |  |  202|    342|#define DR_size_offset 10
  ------------------
  |  Branch (991:6): [True: 11, False: 331]
  ------------------
  992|     11|		return (0);
  993|     11|	}
  994|       |
  995|       |	/* According to the standard, certain bits must be one or zero:
  996|       |	 * Bit 1: must be 1 (this is a directory)
  997|       |	 * Bit 2: must be 0 (not an associated file)
  998|       |	 * Bit 3: must be 0 (doesn't use extended attribute record)
  999|       |	 * Bit 7: must be 0 (final directory record for this file)
 1000|       |	 */
 1001|    331|	flags = p[DR_flags_offset];
  ------------------
  |  |  206|    331|#define DR_flags_offset 25
  ------------------
 1002|    331|	if ((flags & 0x8E) != 0x02) {
  ------------------
  |  Branch (1002:6): [True: 3, False: 328]
  ------------------
 1003|      3|		return (0);
 1004|      3|	}
 1005|       |
 1006|       |	/* Volume sequence number must be a 7.2.3 integer. */
 1007|    328|	if (!isValid723Integer(p + DR_volume_sequence_number_offset)) {
  ------------------
  |  |  212|    328|#define DR_volume_sequence_number_offset 28
  ------------------
  |  Branch (1007:6): [True: 5, False: 323]
  ------------------
 1008|      5|		return (0);
 1009|      5|	}
 1010|       |
 1011|       |	/* Root directory name is a single zero byte... */
 1012|    323|	if (p[DR_name_len_offset] != 1 || p[DR_name_offset] != 0) {
  ------------------
  |  |  214|    323|#define DR_name_len_offset 32
  ------------------
              	if (p[DR_name_len_offset] != 1 || p[DR_name_offset] != 0) {
  ------------------
  |  |  216|    320|#define DR_name_offset 33
  ------------------
  |  Branch (1012:6): [True: 3, False: 320]
  |  Branch (1012:36): [True: 4, False: 316]
  ------------------
 1013|      7|		return (0);
 1014|      7|	}
 1015|       |
 1016|       |	/* Nothing looked wrong, so let's accept it. */
 1017|    316|	return (1);
 1018|    323|}
archive_read_support_format_iso9660.c:isJolietSVD:
  674|    307|{
  675|    307|	const unsigned char *p;
  676|    307|	ssize_t logical_block_size;
  677|    307|	int32_t volume_block;
  678|       |
  679|       |	/* Check if current sector is a kind of Supplementary Volume
  680|       |	 * Descriptor. */
  681|    307|	if (!isSVD(h))
  ------------------
  |  Branch (681:6): [True: 206, False: 101]
  ------------------
  682|    206|		return (0);
  683|       |
  684|       |	/* FIXME: do more validations according to joliet spec. */
  685|       |
  686|       |	/* check if this SVD contains joliet extension! */
  687|    101|	p = h + SVD_escape_sequences_offset;
  ------------------
  |  |  173|    101|#define SVD_escape_sequences_offset (SVD_volume_space_size_offset + SVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  171|    101|#define SVD_volume_space_size_offset 80
  |  |  ------------------
  |  |               #define SVD_escape_sequences_offset (SVD_volume_space_size_offset + SVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  172|    101|#define SVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
  688|       |	/* N.B. Joliet spec says p[1] == '\\', but.... */
  689|    101|	if (p[0] == '%' && p[1] == '/') {
  ------------------
  |  Branch (689:6): [True: 93, False: 8]
  |  Branch (689:21): [True: 42, False: 51]
  ------------------
  690|     42|		int level = 0;
  691|       |
  692|     42|		if (p[2] == '@')
  ------------------
  |  Branch (692:7): [True: 11, False: 31]
  ------------------
  693|     11|			level = 1;
  694|     31|		else if (p[2] == 'C')
  ------------------
  |  Branch (694:12): [True: 1, False: 30]
  ------------------
  695|      1|			level = 2;
  696|     30|		else if (p[2] == 'E')
  ------------------
  |  Branch (696:12): [True: 21, False: 9]
  ------------------
  697|     21|			level = 3;
  698|      9|		else /* not joliet */
  699|      9|			return (0);
  700|       |
  701|     33|		iso9660->seenJoliet = level;
  702|       |
  703|     33|	} else /* not joliet */
  704|     59|		return (0);
  705|       |
  706|     33|	logical_block_size =
  707|     33|	    archive_le16dec(h + SVD_logical_block_size_offset);
  ------------------
  |  |  176|     33|#define SVD_logical_block_size_offset 128
  ------------------
  708|     33|	volume_block = archive_le32dec(h + SVD_volume_space_size_offset);
  ------------------
  |  |  171|     33|#define SVD_volume_space_size_offset 80
  ------------------
  709|       |
  710|     33|	iso9660->logical_block_size = logical_block_size;
  711|     33|	iso9660->volume_block = volume_block;
  712|     33|	iso9660->volume_size = logical_block_size * (uint64_t)volume_block;
  713|       |	/* Read Root Directory Record in Volume Descriptor. */
  714|     33|	p = h + SVD_root_directory_record_offset;
  ------------------
  |  |  181|     33|#define SVD_root_directory_record_offset 156
  ------------------
  715|     33|	iso9660->joliet.location = archive_le32dec(p + DR_extent_offset);
  ------------------
  |  |  200|     33|#define DR_extent_offset 2
  ------------------
  716|     33|	iso9660->joliet.size = archive_le32dec(p + DR_size_offset);
  ------------------
  |  |  202|     33|#define DR_size_offset 10
  ------------------
  717|       |
  718|     33|	return (48);
  719|    101|}
archive_read_support_format_iso9660.c:isBootRecord:
  614|    304|{
  615|       |
  616|       |	/* Type of the Volume Descriptor Boot Record must be 0. */
  617|    304|	if (h[0] != 0)
  ------------------
  |  Branch (617:6): [True: 295, False: 9]
  ------------------
  618|    295|		return (0);
  619|       |
  620|       |	/* Volume Descriptor Version must be 1. */
  621|      9|	if (h[6] != 1)
  ------------------
  |  Branch (621:6): [True: 1, False: 8]
  ------------------
  622|      1|		return (0);
  623|       |
  624|      8|	return (1);
  625|      9|}
archive_read_support_format_iso9660.c:isEVD:
  782|    296|{
  783|    296|	const unsigned char *p;
  784|    296|	ssize_t logical_block_size;
  785|    296|	int32_t volume_block;
  786|    296|	int32_t location;
  787|       |
  788|       |
  789|       |	/* Type of the Enhanced Volume Descriptor must be 2. */
  790|    296|	if (h[PVD_type_offset] != 2)
  ------------------
  |  |   86|    296|#define PVD_type_offset 0
  ------------------
  |  Branch (790:6): [True: 162, False: 134]
  ------------------
  791|    162|		return (0);
  792|       |
  793|       |	/* EVD version must be 2. */
  794|    134|	if (h[PVD_version_offset] != 2)
  ------------------
  |  |   90|    134|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   88|    134|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   86|    134|#define PVD_type_offset 0
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   87|    134|#define PVD_type_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  ------------------
  |  |  |  |   89|    134|#define PVD_id_size 5
  |  |  ------------------
  ------------------
  |  Branch (794:6): [True: 101, False: 33]
  ------------------
  795|    101|		return (0);
  796|       |
  797|       |	/* Reserved field must be 0. */
  798|     33|	if (h[PVD_reserved1_offset] != 0)
  ------------------
  |  |   92|     33|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   90|     33|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   88|     33|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   86|     33|#define PVD_type_offset 0
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   87|     33|#define PVD_type_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   89|     33|#define PVD_id_size 5
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  ------------------
  |  |  |  |   91|     33|#define PVD_version_size 1
  |  |  ------------------
  ------------------
  |  Branch (798:6): [True: 1, False: 32]
  ------------------
  799|      1|		return (0);
  800|       |
  801|       |	/* Reserved field must be 0. */
  802|     32|	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   98|     32|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   96|     32|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   94|     32|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   92|     32|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   90|     32|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   88|     32|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     32|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     32|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   89|     32|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   91|     32|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   93|     32|#define PVD_reserved1_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   95|     32|#define PVD_system_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  ------------------
  |  |  |  |   97|     32|#define PVD_volume_id_size 32
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved2_offset, PVD_reserved2_size))
  ------------------
  |  |   99|     32|#define PVD_reserved2_size 8
  ------------------
  |  Branch (802:6): [True: 2, False: 30]
  ------------------
  803|      2|		return (0);
  804|       |
  805|       |	/* Reserved field must be 0. */
  806|     30|	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  102|     30|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  100|     30|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   98|     30|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   96|     30|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   94|     30|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   92|     30|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     30|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     30|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     30|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     30|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     30|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     30|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   93|     30|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   95|     30|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   97|     30|#define PVD_volume_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   99|     30|#define PVD_reserved2_size 8
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  ------------------
  |  |  |  |  101|     30|#define PVD_volume_space_size_size 8
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved3_offset, PVD_reserved3_size))
  ------------------
  |  |  103|     30|#define PVD_reserved3_size 32
  ------------------
  |  Branch (806:6): [True: 5, False: 25]
  ------------------
  807|      5|		return (0);
  808|       |
  809|       |	/* Logical block size must be > 0. */
  810|       |	/* I've looked at Ecma 119 and can't find any stronger
  811|       |	 * restriction on this field. */
  812|     25|	logical_block_size =
  813|     25|	    archive_le16dec(h + PVD_logical_block_size_offset);
  ------------------
  |  |  108|     25|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  106|     25|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  104|     25|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  102|     25|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  100|     25|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   98|     25|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     25|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     25|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     25|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     25|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     25|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     25|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     25|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     25|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     25|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     25|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     25|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     25|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   99|     25|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  101|     25|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  103|     25|#define PVD_reserved3_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  105|     25|#define PVD_volume_set_size_size 4
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  ------------------
  |  |  |  |  107|     25|#define PVD_volume_sequence_number_size 4
  |  |  ------------------
  ------------------
  814|     25|	if (logical_block_size <= 0)
  ------------------
  |  Branch (814:6): [True: 1, False: 24]
  ------------------
  815|      1|		return (0);
  816|       |
  817|     24|	volume_block =
  818|     24|	    archive_le32dec(h + PVD_volume_space_size_offset);
  ------------------
  |  |  100|     24|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   98|     24|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   96|     24|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   94|     24|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   92|     24|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   90|     24|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     24|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     24|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     24|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     24|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |   91|     24|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |   93|     24|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |   95|     24|#define PVD_system_id_size 32
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |   97|     24|#define PVD_volume_id_size 32
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  ------------------
  |  |  |  |   99|     24|#define PVD_reserved2_size 8
  |  |  ------------------
  ------------------
  819|     24|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   83|     24|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (819:6): [True: 2, False: 22]
  ------------------
  820|      2|		return (0);
  821|       |
  822|       |	/* File structure version must be 2 for ISO9660:1999. */
  823|     22|	if (h[PVD_file_structure_version_offset] != 2)
  ------------------
  |  |  144|     22|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  142|     22|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  140|     22|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  138|     22|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  136|     22|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  134|     22|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|     22|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|     22|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|     22|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|     22|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|     22|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|     22|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|     22|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|     22|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|     22|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|     22|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|     22|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|     22|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|     22|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|     22|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     22|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     22|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     22|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     22|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     22|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     22|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     22|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     22|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     22|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     22|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     22|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     22|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     22|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     22|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     22|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     22|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     22|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     22|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     22|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     22|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|     22|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|     22|#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|     22|#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|     22|#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|     22|#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|     22|#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|     22|#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|     22|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|     22|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|     22|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|     22|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|     22|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|     22|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|     22|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  135|     22|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  137|     22|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  139|     22|#define PVD_modification_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  141|     22|#define PVD_expiration_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  ------------------
  |  |  |  |  143|     22|#define PVD_effective_date_size 17
  |  |  ------------------
  ------------------
  |  Branch (823:6): [True: 1, False: 21]
  ------------------
  824|      1|		return (0);
  825|       |
  826|       |	/* Location of Occurrence of Type L Path Table must be
  827|       |	 * available location,
  828|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  829|     21|	location = archive_le32dec(h+PVD_type_1_path_table_offset);
  ------------------
  |  |  112|     21|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  ------------------
  |  |  |  |  110|     21|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  108|     21|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  106|     21|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  104|     21|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  102|     21|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     21|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     21|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     21|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     21|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     21|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     21|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     21|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     21|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     21|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     21|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     21|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     21|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     21|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     21|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     21|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     21|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  103|     21|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  105|     21|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  107|     21|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  109|     21|#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|     21|#define PVD_path_table_size_size 8
  |  |  ------------------
  ------------------
  830|     21|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   83|     21|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (830:6): [True: 2, False: 19]
  |  Branch (830:40): [True: 1, False: 18]
  ------------------
  831|      3|		return (0);
  832|       |
  833|       |	/* Location of Occurrence of Type M Path Table must be
  834|       |	 * available location,
  835|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  836|     18|	location = archive_be32dec(h+PVD_type_m_path_table_offset);
  ------------------
  |  |  116|     18|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  ------------------
  |  |  |  |  114|     18|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  112|     18|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  110|     18|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  108|     18|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  106|     18|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     18|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     18|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     18|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     18|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     18|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     18|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     18|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     18|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     18|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     18|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     18|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     18|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     18|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     18|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     18|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     18|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     18|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     18|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     18|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     18|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  107|     18|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  109|     18|#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|     18|#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|     18|#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|     18|#define PVD_opt_type_1_path_table_size 4
  |  |  ------------------
  ------------------
  837|     18|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   83|     11|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (837:7): [True: 11, False: 7]
  |  Branch (837:23): [True: 1, False: 10]
  ------------------
  838|     17|	    || location >= volume_block)
  ------------------
  |  Branch (838:9): [True: 1, False: 16]
  ------------------
  839|      2|		return (0);
  840|       |
  841|       |	/* Reserved field must be 0. */
  842|     16|	if (!isNull(h, PVD_reserved4_offset, PVD_reserved4_size))
  ------------------
  |  |  146|     16|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  144|     16|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  142|     16|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  140|     16|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  138|     16|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  136|     16|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|     16|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|     16|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|     16|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|     16|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|     16|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|     16|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|     16|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|     16|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|     16|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|     16|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|     16|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|     16|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|     16|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|     16|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|     16|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     16|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     16|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     16|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     16|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     16|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     16|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     16|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     16|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     16|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     16|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     16|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     16|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     16|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     16|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     16|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     16|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     16|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     16|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     16|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     16|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|     16|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|     16|#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|     16|#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|     16|#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|     16|#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|     16|#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|     16|#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|     16|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|     16|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|     16|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|     16|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|     16|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|     16|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|     16|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|     16|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  137|     16|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  139|     16|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  141|     16|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  143|     16|#define PVD_effective_date_size 17
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  ------------------
  |  |  |  |  145|     16|#define PVD_file_structure_version_size 1
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved4_offset, PVD_reserved4_size))
  ------------------
  |  |  147|     16|#define PVD_reserved4_size 1
  ------------------
  |  Branch (842:6): [True: 1, False: 15]
  ------------------
  843|      1|		return (0);
  844|       |
  845|       |	/* Reserved field must be 0. */
  846|     15|	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  150|     15|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  148|     15|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  146|     15|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  144|     15|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  142|     15|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  140|     15|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|     15|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|     15|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|     15|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|     15|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|     15|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|     15|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|     15|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|     15|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|     15|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|     15|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|     15|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|     15|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|     15|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|     15|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|     15|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|     15|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|     15|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     15|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     15|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     15|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     15|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     15|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     15|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     15|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     15|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     15|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     15|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     15|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     15|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     15|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     15|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     15|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     15|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     15|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     15|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     15|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     15|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|     15|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|     15|#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|     15|#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|     15|#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|     15|#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|     15|#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|     15|#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|     15|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|     15|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|     15|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|     15|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|     15|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|     15|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|     15|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|     15|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|     15|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|     15|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  141|     15|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  143|     15|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  145|     15|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  147|     15|#define PVD_reserved4_size 1
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  ------------------
  |  |  |  |  149|     15|#define PVD_application_data_size 512
  |  |  ------------------
  ------------------
              	if (!isNull(h, PVD_reserved5_offset, PVD_reserved5_size))
  ------------------
  |  |  151|     15|#define PVD_reserved5_size (2048 - PVD_reserved5_offset)
  |  |  ------------------
  |  |  |  |  150|     15|#define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  148|     15|#define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  146|     15|#define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  144|     15|#define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  142|     15|#define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  140|     15|#define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  138|     15|#define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  136|     15|#define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  134|     15|#define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  132|     15|#define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  130|     15|#define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  128|     15|#define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  126|     15|#define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  124|     15|#define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  122|     15|#define PVD_volume_set_id_offset (PVD_root_directory_record_offset + PVD_root_directory_record_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  120|     15|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  118|     15|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  116|     15|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  114|     15|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  112|     15|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  110|     15|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|     15|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|     15|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|     15|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|     15|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|     15|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|     15|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|     15|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|     15|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|     15|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|     15|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|     15|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|     15|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|     15|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|     15|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|     15|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|     15|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|     15|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|     15|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|     15|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|     15|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|     15|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|     15|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|     15|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|     15|#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|     15|#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|     15|#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|     15|#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|     15|#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|     15|#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|     15|#define PVD_root_directory_record_size 34
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_publisher_id_offset (PVD_volume_set_id_offset + PVD_volume_set_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  123|     15|#define PVD_volume_set_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_preparer_id_offset (PVD_publisher_id_offset + PVD_publisher_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  125|     15|#define PVD_publisher_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_application_id_offset (PVD_preparer_id_offset + PVD_preparer_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  127|     15|#define PVD_preparer_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_copyright_file_id_offset (PVD_application_id_offset + PVD_application_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  129|     15|#define PVD_application_id_size 128
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_abstract_file_id_offset (PVD_copyright_file_id_offset + PVD_copyright_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  131|     15|#define PVD_copyright_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_bibliographic_file_id_offset (PVD_abstract_file_id_offset + PVD_abstract_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  133|     15|#define PVD_abstract_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_creation_date_offset (PVD_bibliographic_file_id_offset + PVD_bibliographic_file_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  135|     15|#define PVD_bibliographic_file_id_size 37
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_modification_date_offset (PVD_creation_date_offset + PVD_creation_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  137|     15|#define PVD_creation_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_expiration_date_offset (PVD_modification_date_offset + PVD_modification_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  139|     15|#define PVD_modification_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_effective_date_offset (PVD_expiration_date_offset + PVD_expiration_date_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  141|     15|#define PVD_expiration_date_size 17
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |               #define PVD_file_structure_version_offset (PVD_effective_date_offset + PVD_effective_date_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  143|     15|#define PVD_effective_date_size 17
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define PVD_reserved4_offset (PVD_file_structure_version_offset + PVD_file_structure_version_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  145|     15|#define PVD_file_structure_version_size 1
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define PVD_application_data_offset (PVD_reserved4_offset + PVD_reserved4_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  147|     15|#define PVD_reserved4_size 1
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define PVD_reserved5_offset (PVD_application_data_offset + PVD_application_data_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  149|     15|#define PVD_application_data_size 512
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (846:6): [True: 7, False: 8]
  ------------------
  847|      7|		return (0);
  848|       |
  849|       |	/* Read Root Directory Record in Volume Descriptor. */
  850|      8|	p = h + PVD_root_directory_record_offset;
  ------------------
  |  |  120|      8|#define PVD_root_directory_record_offset (PVD_opt_type_m_path_table_offset + PVD_opt_type_m_path_table_size)
  |  |  ------------------
  |  |  |  |  118|      8|#define PVD_opt_type_m_path_table_offset (PVD_type_m_path_table_offset + PVD_type_m_path_table_size)
  |  |  |  |  ------------------
  |  |  |  |  |  |  116|      8|#define PVD_type_m_path_table_offset (PVD_opt_type_1_path_table_offset + PVD_opt_type_1_path_table_size)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  114|      8|#define PVD_opt_type_1_path_table_offset (PVD_type_1_path_table_offset + PVD_type_1_path_table_size)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  112|      8|#define PVD_type_1_path_table_offset (PVD_path_table_size_offset + PVD_path_table_size_size)
  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  110|      8|#define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  108|      8|#define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  106|      8|#define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  104|      8|#define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  102|      8|#define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  100|      8|#define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   98|      8|#define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   96|      8|#define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   94|      8|#define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   92|      8|#define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   90|      8|#define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   88|      8|#define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   86|      8|#define PVD_type_offset 0
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_id_offset (PVD_type_offset + PVD_type_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   87|      8|#define PVD_type_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_version_offset (PVD_id_offset + PVD_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   89|      8|#define PVD_id_size 5
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved1_offset (PVD_version_offset + PVD_version_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   91|      8|#define PVD_version_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_system_id_offset (PVD_reserved1_offset + PVD_reserved1_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   93|      8|#define PVD_reserved1_size 1
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_id_offset (PVD_system_id_offset + PVD_system_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   95|      8|#define PVD_system_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved2_offset (PVD_volume_id_offset + PVD_volume_id_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   97|      8|#define PVD_volume_id_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_space_size_offset (PVD_reserved2_offset + PVD_reserved2_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |   99|      8|#define PVD_reserved2_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_reserved3_offset (PVD_volume_space_size_offset + PVD_volume_space_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  101|      8|#define PVD_volume_space_size_size 8
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_set_size_offset (PVD_reserved3_offset + PVD_reserved3_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  103|      8|#define PVD_reserved3_size 32
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_volume_sequence_number_offset (PVD_volume_set_size_offset + PVD_volume_set_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  105|      8|#define PVD_volume_set_size_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_logical_block_size_offset (PVD_volume_sequence_number_offset + PVD_volume_sequence_number_size)
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  |  107|      8|#define PVD_volume_sequence_number_size 4
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |               #define PVD_path_table_size_offset (PVD_logical_block_size_offset + PVD_logical_block_size_size)
  |  |  |  |  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  |  |  |  |  109|      8|#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|      8|#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|      8|#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|      8|#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|      8|#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|      8|#define PVD_opt_type_m_path_table_size 4
  |  |  ------------------
  ------------------
  851|      8|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (851:6): [True: 8, False: 0]
  ------------------
  852|      8|		return (0);
  853|      8|	}
  854|       |
  855|      0|	return (48);
  856|      8|}
archive_read_support_format_iso9660.c:isSVD:
  723|    603|{
  724|    603|	const unsigned char *p;
  725|    603|	ssize_t logical_block_size;
  726|    603|	int32_t volume_block;
  727|    603|	int32_t location;
  728|       |
  729|       |
  730|       |	/* Type 2 means it's a SVD. */
  731|    603|	if (h[SVD_type_offset] != 2)
  ------------------
  |  |  162|    603|#define SVD_type_offset 0
  ------------------
  |  Branch (731:6): [True: 312, False: 291]
  ------------------
  732|    312|		return (0);
  733|       |
  734|       |	/* Reserved field must be 0. */
  735|    291|	if (!isNull(h, SVD_reserved1_offset, SVD_reserved1_size))
  ------------------
  |  |  169|    291|#define SVD_reserved1_offset	72
  ------------------
              	if (!isNull(h, SVD_reserved1_offset, SVD_reserved1_size))
  ------------------
  |  |  170|    291|#define SVD_reserved1_size	8
  ------------------
  |  Branch (735:6): [True: 8, False: 283]
  ------------------
  736|      8|		return (0);
  737|    283|	if (!isNull(h, SVD_reserved2_offset, SVD_reserved2_size))
  ------------------
  |  |  184|    283|#define SVD_reserved2_offset	882
  ------------------
              	if (!isNull(h, SVD_reserved2_offset, SVD_reserved2_size))
  ------------------
  |  |  185|    283|#define SVD_reserved2_size	1
  ------------------
  |  Branch (737:6): [True: 9, False: 274]
  ------------------
  738|      9|		return (0);
  739|    274|	if (!isNull(h, SVD_reserved3_offset, SVD_reserved3_size))
  ------------------
  |  |  186|    274|#define SVD_reserved3_offset	1395
  ------------------
              	if (!isNull(h, SVD_reserved3_offset, SVD_reserved3_size))
  ------------------
  |  |  187|    274|#define SVD_reserved3_size	653
  ------------------
  |  Branch (739:6): [True: 38, False: 236]
  ------------------
  740|     38|		return (0);
  741|       |
  742|       |	/* File structure version must be 1 for ISO9660/ECMA119. */
  743|    236|	if (h[SVD_file_structure_version_offset] != 1)
  ------------------
  |  |  183|    236|#define SVD_file_structure_version_offset 881
  ------------------
  |  Branch (743:6): [True: 19, False: 217]
  ------------------
  744|     19|		return (0);
  745|       |
  746|    217|	logical_block_size =
  747|    217|	    archive_le16dec(h + SVD_logical_block_size_offset);
  ------------------
  |  |  176|    217|#define SVD_logical_block_size_offset 128
  ------------------
  748|    217|	if (logical_block_size <= 0)
  ------------------
  |  Branch (748:6): [True: 3, False: 214]
  ------------------
  749|      3|		return (0);
  750|       |
  751|    214|	volume_block = archive_le32dec(h + SVD_volume_space_size_offset);
  ------------------
  |  |  171|    214|#define SVD_volume_space_size_offset 80
  ------------------
  752|    214|	if (volume_block <= SYSTEM_AREA_BLOCK+4)
  ------------------
  |  |   83|    214|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (752:6): [True: 3, False: 211]
  ------------------
  753|      3|		return (0);
  754|       |
  755|       |	/* Location of Occurrence of Type L Path Table must be
  756|       |	 * available location,
  757|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  758|    211|	location = archive_le32dec(h+SVD_type_L_path_table_offset);
  ------------------
  |  |  178|    211|#define SVD_type_L_path_table_offset 140
  ------------------
  759|    211|	if (location < SYSTEM_AREA_BLOCK+2 || location >= volume_block)
  ------------------
  |  |   83|    211|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (759:6): [True: 2, False: 209]
  |  Branch (759:40): [True: 7, False: 202]
  ------------------
  760|      9|		return (0);
  761|       |
  762|       |	/* The Type M Path Table must be at a valid location (WinISO
  763|       |	 * and probably other programs omit this, so we allow zero)
  764|       |	 *
  765|       |	 * >= SYSTEM_AREA_BLOCK(16) + 2 and < Volume Space Size. */
  766|    202|	location = archive_be32dec(h+SVD_type_M_path_table_offset);
  ------------------
  |  |  179|    202|#define SVD_type_M_path_table_offset 148
  ------------------
  767|    202|	if ((location > 0 && location < SYSTEM_AREA_BLOCK+2)
  ------------------
  |  |   83|    197|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (767:7): [True: 197, False: 5]
  |  Branch (767:23): [True: 2, False: 195]
  ------------------
  768|    200|	    || location >= volume_block)
  ------------------
  |  Branch (768:9): [True: 3, False: 197]
  ------------------
  769|      5|		return (0);
  770|       |
  771|       |	/* Read Root Directory Record in Volume Descriptor. */
  772|    197|	p = h + SVD_root_directory_record_offset;
  ------------------
  |  |  181|    197|#define SVD_root_directory_record_offset 156
  ------------------
  773|    197|	if (!isRootDirectoryRecord(p)) {
  ------------------
  |  Branch (773:6): [True: 28, False: 169]
  ------------------
  774|     28|		return (0);
  775|     28|	}
  776|       |
  777|    169|	return (48);
  778|    197|}
archive_read_support_format_iso9660.c:isVolumePartition:
  629|    228|{
  630|    228|	int32_t location;
  631|       |
  632|       |	/* Type of the Volume Partition Descriptor must be 3. */
  633|    228|	if (h[0] != 3)
  ------------------
  |  Branch (633:6): [True: 224, False: 4]
  ------------------
  634|    224|		return (0);
  635|       |
  636|       |	/* Volume Descriptor Version must be 1. */
  637|      4|	if (h[6] != 1)
  ------------------
  |  Branch (637:6): [True: 1, False: 3]
  ------------------
  638|      1|		return (0);
  639|       |	/* Unused Field */
  640|      3|	if (h[7] != 0)
  ------------------
  |  Branch (640:6): [True: 1, False: 2]
  ------------------
  641|      1|		return (0);
  642|       |
  643|      2|	location = archive_le32dec(h + 72);
  644|      2|	if (location <= SYSTEM_AREA_BLOCK ||
  ------------------
  |  |   83|      4|#define	SYSTEM_AREA_BLOCK	16
  ------------------
  |  Branch (644:6): [True: 1, False: 1]
  ------------------
  645|      1|	    location >= iso9660->volume_block)
  ------------------
  |  Branch (645:6): [True: 1, False: 0]
  ------------------
  646|      2|		return (0);
  647|      0|	if ((uint32_t)location != archive_be32dec(h + 76))
  ------------------
  |  Branch (647:6): [True: 0, False: 0]
  ------------------
  648|      0|		return (0);
  649|       |
  650|      0|	return (1);
  651|      0|}
archive_read_support_format_iso9660.c:isVDSetTerminator:
  655|    228|{
  656|       |
  657|       |	/* Type of the Volume Descriptor Set Terminator must be 255. */
  658|    228|	if (h[0] != 255)
  ------------------
  |  Branch (658:6): [True: 98, False: 130]
  ------------------
  659|     98|		return (0);
  660|       |
  661|       |	/* Volume Descriptor Version must be 1. */
  662|    130|	if (h[6] != 1)
  ------------------
  |  Branch (662:6): [True: 1, False: 129]
  ------------------
  663|      1|		return (0);
  664|       |
  665|       |	/* Reserved field must be 0. */
  666|    129|	if (!isNull(h, 7, 2048-7))
  ------------------
  |  Branch (666:6): [True: 5, False: 124]
  ------------------
  667|      5|		return (0);
  668|       |
  669|    124|	return (1);
  670|    129|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_header:
 1234|    703|{
 1235|    703|	struct iso9660 *iso9660 = a->format->data;
 1236|    703|	struct file_info *file;
 1237|    703|	int r, rd_r = ARCHIVE_OK;
  ------------------
  |  |  233|    703|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1238|       |
 1239|    703|	if (!a->archive.archive_format) {
  ------------------
  |  Branch (1239:6): [True: 123, False: 580]
  ------------------
 1240|    123|		a->archive.archive_format = ARCHIVE_FORMAT_ISO9660;
  ------------------
  |  |  372|    123|#define	ARCHIVE_FORMAT_ISO9660			0x40000
  ------------------
 1241|    123|		a->archive.archive_format_name = "ISO9660";
 1242|    123|	}
 1243|       |
 1244|    703|	if (iso9660->current_position == 0) {
  ------------------
  |  Branch (1244:6): [True: 123, False: 580]
  ------------------
 1245|    123|		r = choose_volume(a, iso9660);
 1246|    123|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    123|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1246:7): [True: 14, False: 109]
  ------------------
 1247|     14|			return (r);
 1248|    123|	}
 1249|       |
 1250|    689|	file = NULL;/* Eliminate a warning. */
 1251|       |	/* Get the next entry that appears after the current offset. */
 1252|    689|	r = next_entry_seek(a, iso9660, &file);
 1253|    689|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    689|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1253:6): [True: 155, False: 534]
  ------------------
 1254|    155|		return (r);
 1255|       |
 1256|    534|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1256:6): [True: 11, False: 523]
  ------------------
 1257|       |		/*
 1258|       |		 * Convert UTF-16BE of a filename to local locale MBS
 1259|       |		 * and store the result into a filename field.
 1260|       |		 */
 1261|     11|		if (iso9660->sconv_utf16be == NULL) {
  ------------------
  |  Branch (1261:7): [True: 7, False: 4]
  ------------------
 1262|      7|			iso9660->sconv_utf16be =
 1263|      7|			    archive_string_conversion_from_charset(
 1264|      7|				&(a->archive), "UTF-16BE", 1);
 1265|      7|			if (iso9660->sconv_utf16be == NULL)
  ------------------
  |  Branch (1265:8): [True: 0, False: 7]
  ------------------
 1266|       |				/* Couldn't allocate memory */
 1267|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1268|      7|		}
 1269|     11|		if (iso9660->utf16be_path == NULL) {
  ------------------
  |  Branch (1269:7): [True: 7, False: 4]
  ------------------
 1270|      7|			iso9660->utf16be_path = malloc(UTF16_NAME_MAX);
  ------------------
  |  |  378|      7|#define UTF16_NAME_MAX	1024
  ------------------
 1271|      7|			if (iso9660->utf16be_path == NULL) {
  ------------------
  |  Branch (1271:8): [True: 0, False: 7]
  ------------------
 1272|      0|				archive_set_error(&a->archive, ENOMEM,
 1273|      0|				    "No memory");
 1274|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1275|      0|			}
 1276|      7|		}
 1277|     11|		if (iso9660->utf16be_previous_path == NULL) {
  ------------------
  |  Branch (1277:7): [True: 7, False: 4]
  ------------------
 1278|      7|			iso9660->utf16be_previous_path = calloc(1, UTF16_NAME_MAX);
  ------------------
  |  |  378|      7|#define UTF16_NAME_MAX	1024
  ------------------
 1279|      7|			if (iso9660->utf16be_previous_path == NULL) {
  ------------------
  |  Branch (1279:8): [True: 0, False: 7]
  ------------------
 1280|      0|				archive_set_error(&a->archive, ENOMEM,
 1281|      0|				    "No memory");
 1282|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1283|      0|			}
 1284|      7|		}
 1285|       |
 1286|     11|		iso9660->utf16be_path_len = 0;
 1287|     11|		if (build_pathname_utf16be(iso9660->utf16be_path,
  ------------------
  |  Branch (1287:7): [True: 0, False: 11]
  ------------------
 1288|     11|		    UTF16_NAME_MAX, &(iso9660->utf16be_path_len), file) != 0) {
  ------------------
  |  |  378|     11|#define UTF16_NAME_MAX	1024
  ------------------
 1289|      0|			archive_set_error(&a->archive,
 1290|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1291|      0|			    "Pathname is too long");
 1292|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1293|      0|		}
 1294|       |
 1295|     11|		r = archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|     11|#define archive_entry_copy_pathname_l	__archive_entry_copy_pathname_l
  ------------------
 1296|     11|		    (const char *)iso9660->utf16be_path,
 1297|     11|		    iso9660->utf16be_path_len,
 1298|     11|		    iso9660->sconv_utf16be);
 1299|     11|		if (r != 0) {
  ------------------
  |  Branch (1299:7): [True: 3, False: 8]
  ------------------
 1300|      3|			if (errno == ENOMEM) {
  ------------------
  |  Branch (1300:8): [True: 0, False: 3]
  ------------------
 1301|      0|				archive_set_error(&a->archive, ENOMEM,
 1302|      0|				    "No memory for Pathname");
 1303|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1304|      0|			}
 1305|      3|			archive_set_error(&a->archive,
 1306|      3|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1307|      3|			    "Pathname cannot be converted "
 1308|      3|			    "from %s to current locale",
 1309|      3|			    archive_string_conversion_charset_name(
 1310|      3|			      iso9660->sconv_utf16be));
 1311|       |
 1312|      3|			rd_r = ARCHIVE_WARN;
  ------------------
  |  |  235|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1313|      3|		}
 1314|    523|	} else {
 1315|    523|		const char *path = build_pathname(&iso9660->pathname, file, 0);
 1316|    523|		if (path == NULL) {
  ------------------
  |  Branch (1316:7): [True: 0, False: 523]
  ------------------
 1317|      0|			archive_set_error(&a->archive,
 1318|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1319|      0|			    "Pathname is too long");
 1320|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1321|    523|		} else {
 1322|    523|			archive_string_empty(&iso9660->pathname);
  ------------------
  |  |  181|    523|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1323|    523|			archive_entry_set_pathname(entry, path);
 1324|    523|		}
 1325|    523|	}
 1326|       |
 1327|    534|	iso9660->entry_bytes_remaining = file->size;
 1328|       |	/* Offset for sparse-file-aware clients. */
 1329|    534|	iso9660->entry_sparse_offset = 0;
 1330|       |
 1331|    534|	if (file->offset + file->size > iso9660->volume_size) {
  ------------------
  |  Branch (1331:6): [True: 71, False: 463]
  ------------------
 1332|     71|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     71|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1333|     71|		    "File is beyond end-of-media: %s",
 1334|     71|		    archive_entry_pathname(entry));
 1335|     71|		iso9660->entry_bytes_remaining = 0;
 1336|     71|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|     71|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1337|     71|	}
 1338|       |
 1339|       |	/* Set up the entry structure with information about this entry. */
 1340|    463|	archive_entry_set_mode(entry, file->mode);
 1341|    463|	archive_entry_set_uid(entry, file->uid);
 1342|    463|	archive_entry_set_gid(entry, file->gid);
 1343|    463|	archive_entry_set_nlink(entry, file->nlinks);
 1344|    463|	if ((file->time_is_set & BIRTHTIME_IS_SET))
  ------------------
  |  |  311|    463|#define BIRTHTIME_IS_SET 1
  ------------------
  |  Branch (1344:6): [True: 1, False: 462]
  ------------------
 1345|      1|		archive_entry_set_birthtime(entry, file->birthtime, 0);
 1346|    462|	else
 1347|    462|		archive_entry_unset_birthtime(entry);
 1348|    463|	if ((file->time_is_set & MTIME_IS_SET))
  ------------------
  |  |  312|    463|#define MTIME_IS_SET 2
  ------------------
  |  Branch (1348:6): [True: 215, False: 248]
  ------------------
 1349|    215|		archive_entry_set_mtime(entry, file->mtime, 0);
 1350|    248|	else
 1351|    248|		archive_entry_unset_mtime(entry);
 1352|    463|	if ((file->time_is_set & CTIME_IS_SET))
  ------------------
  |  |  314|    463|#define CTIME_IS_SET 8
  ------------------
  |  Branch (1352:6): [True: 216, False: 247]
  ------------------
 1353|    216|		archive_entry_set_ctime(entry, file->ctime, 0);
 1354|    247|	else
 1355|    247|		archive_entry_unset_ctime(entry);
 1356|    463|	if ((file->time_is_set & ATIME_IS_SET))
  ------------------
  |  |  313|    463|#define ATIME_IS_SET 4
  ------------------
  |  Branch (1356:6): [True: 215, False: 248]
  ------------------
 1357|    215|		archive_entry_set_atime(entry, file->atime, 0);
 1358|    248|	else
 1359|    248|		archive_entry_unset_atime(entry);
 1360|       |	/* N.B.: Rock Ridge supports 64-bit device numbers. */
 1361|    463|	archive_entry_set_rdev(entry, (dev_t)file->rdev);
 1362|    463|	archive_entry_set_size(entry, iso9660->entry_bytes_remaining);
 1363|    463|	if (file->symlink.s != NULL)
  ------------------
  |  Branch (1363:6): [True: 0, False: 463]
  ------------------
 1364|      0|		archive_entry_copy_symlink(entry, file->symlink.s);
 1365|       |
 1366|       |	/* Note: If the input isn't seekable, we can't rewind to
 1367|       |	 * return the same body again, so if the next entry refers to
 1368|       |	 * the same data, we have to return it as a hardlink to the
 1369|       |	 * original entry. */
 1370|    463|	if (file->number != -1 &&
  ------------------
  |  Branch (1370:6): [True: 340, False: 123]
  ------------------
 1371|    340|	    file->number == iso9660->previous_number) {
  ------------------
  |  Branch (1371:6): [True: 59, False: 281]
  ------------------
 1372|     59|		if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1372:7): [True: 1, False: 58]
  ------------------
 1373|      1|			r = archive_entry_copy_hardlink_l(entry,
  ------------------
  |  |   74|      1|#define archive_entry_copy_hardlink_l	__archive_entry_copy_hardlink_l
  ------------------
 1374|      1|			    (const char *)iso9660->utf16be_previous_path,
 1375|      1|			    iso9660->utf16be_previous_path_len,
 1376|      1|			    iso9660->sconv_utf16be);
 1377|      1|			if (r != 0) {
  ------------------
  |  Branch (1377:8): [True: 0, False: 1]
  ------------------
 1378|      0|				if (errno == ENOMEM) {
  ------------------
  |  Branch (1378:9): [True: 0, False: 0]
  ------------------
 1379|      0|					archive_set_error(&a->archive, ENOMEM,
 1380|      0|					    "No memory for Linkname");
 1381|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1382|      0|				}
 1383|      0|				archive_set_error(&a->archive,
 1384|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1385|      0|				    "Linkname cannot be converted "
 1386|      0|				    "from %s to current locale",
 1387|      0|				    archive_string_conversion_charset_name(
 1388|      0|				      iso9660->sconv_utf16be));
 1389|      0|				rd_r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1390|      0|			}
 1391|      1|		} else
 1392|     58|			archive_entry_set_hardlink(entry,
 1393|     58|			    iso9660->previous_pathname.s);
 1394|     59|		archive_entry_unset_size(entry);
 1395|     59|		iso9660->entry_bytes_remaining = 0;
 1396|     59|		return (rd_r);
 1397|     59|	}
 1398|       |
 1399|    404|	if ((file->mode & AE_IFMT) != AE_IFDIR &&
  ------------------
  |  |  215|    404|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((file->mode & AE_IFMT) != AE_IFDIR &&
  ------------------
  |  |  221|    808|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1399:6): [True: 255, False: 149]
  ------------------
 1400|    255|	    file->offset < iso9660->current_position) {
  ------------------
  |  Branch (1400:6): [True: 79, False: 176]
  ------------------
 1401|     79|		int64_t r64;
 1402|       |
 1403|     79|		r64 = __archive_read_seek(a, file->offset, SEEK_SET);
 1404|     79|		if (r64 != (int64_t)file->offset) {
  ------------------
  |  Branch (1404:7): [True: 0, False: 79]
  ------------------
 1405|       |			/* We can't seek backwards to extract it, so issue
 1406|       |			 * a warning.  Note that this can only happen if
 1407|       |			 * this entry was added to the heap after we passed
 1408|       |			 * this offset, that is, only if the directory
 1409|       |			 * mentioning this entry is later than the body of
 1410|       |			 * the entry. Such layouts are very unusual; most
 1411|       |			 * ISO9660 writers lay out and record all directory
 1412|       |			 * information first, then store all file bodies. */
 1413|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1414|      0|			    "Ignoring out-of-order file @%jx (%s) %jd < %jd",
 1415|      0|			    (uintmax_t)file->number,
 1416|      0|			    iso9660->pathname.s,
 1417|      0|			    (intmax_t)file->offset,
 1418|      0|			    (intmax_t)iso9660->current_position);
 1419|      0|			iso9660->entry_bytes_remaining = 0;
 1420|      0|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1421|      0|		}
 1422|     79|		iso9660->current_position = (uint64_t)r64;
 1423|     79|	}
 1424|       |
 1425|       |	/* Initialize zisofs variables. */
 1426|    404|	iso9660->entry_zisofs.pz = file->pz;
 1427|    404|	if (file->pz) {
  ------------------
  |  Branch (1427:6): [True: 0, False: 404]
  ------------------
 1428|      0|#ifdef HAVE_ZLIB_H
 1429|      0|		struct zisofs  *zisofs;
 1430|       |
 1431|      0|		zisofs = &iso9660->entry_zisofs;
 1432|      0|		zisofs->initialized = 0;
 1433|      0|		zisofs->pz_log2_bs = file->pz_log2_bs;
 1434|      0|		zisofs->pz_uncompressed_size = file->pz_uncompressed_size;
 1435|      0|		zisofs->pz_offset = 0;
 1436|      0|		zisofs->header_avail = 0;
 1437|      0|		zisofs->header_passed = 0;
 1438|      0|		zisofs->block_pointers_avail = 0;
 1439|      0|#endif
 1440|      0|		archive_entry_set_size(entry, file->pz_uncompressed_size);
 1441|      0|	}
 1442|       |
 1443|    404|	iso9660->previous_number = file->number;
 1444|    404|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1444:6): [True: 10, False: 394]
  ------------------
 1445|     10|		memcpy(iso9660->utf16be_previous_path, iso9660->utf16be_path,
 1446|     10|		    iso9660->utf16be_path_len);
 1447|     10|		iso9660->utf16be_previous_path_len = iso9660->utf16be_path_len;
 1448|     10|	} else
 1449|    404|		archive_strcpy(
  ------------------
  |  |  165|    394|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|    788|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 394]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1450|    404|		    &iso9660->previous_pathname, iso9660->pathname.s);
 1451|       |
 1452|       |	/* Reset entry_bytes_remaining if the file is multi extent. */
 1453|    404|	iso9660->entry_content = file->contents.first;
 1454|    404|	if (iso9660->entry_content != NULL)
  ------------------
  |  Branch (1454:6): [True: 26, False: 378]
  ------------------
 1455|     26|		iso9660->entry_bytes_remaining = iso9660->entry_content->size;
 1456|       |
 1457|    404|	if (archive_entry_filetype(entry) == AE_IFDIR) {
  ------------------
  |  |  221|    404|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1457:6): [True: 149, False: 255]
  ------------------
 1458|       |		/* Overwrite nlinks by proper link number which is
 1459|       |		 * calculated from number of sub directories. */
 1460|    149|		archive_entry_set_nlink(entry, 2 + file->subdirs);
 1461|       |		/* Directory data has been read completely. */
 1462|    149|		iso9660->entry_bytes_remaining = 0;
 1463|    149|	}
 1464|       |
 1465|    404|	if (rd_r != ARCHIVE_OK)
  ------------------
  |  |  233|    404|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1465:6): [True: 3, False: 401]
  ------------------
 1466|      3|		return (rd_r);
 1467|    401|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    401|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1468|    404|}
archive_read_support_format_iso9660.c:choose_volume:
 1145|    123|{
 1146|    123|	struct file_info *file;
 1147|    123|	int64_t skipsize;
 1148|    123|	struct vd *vd;
 1149|    123|	const void *block;
 1150|    123|	char seenJoliet;
 1151|       |
 1152|    123|	vd = &(iso9660->primary);
 1153|    123|	if (!iso9660->opt_support_joliet)
  ------------------
  |  Branch (1153:6): [True: 0, False: 123]
  ------------------
 1154|      0|		iso9660->seenJoliet = 0;
 1155|    123|	if (iso9660->seenJoliet &&
  ------------------
  |  Branch (1155:6): [True: 20, False: 103]
  ------------------
 1156|     20|		vd->location > iso9660->joliet.location)
  ------------------
  |  Branch (1156:3): [True: 2, False: 18]
  ------------------
 1157|       |		/* This condition is unlikely; by way of caution. */
 1158|      2|		vd = &(iso9660->joliet);
 1159|       |
 1160|    123|	skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location;
  ------------------
  |  |   82|    123|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
 1161|    123|	skipsize = __archive_read_consume(a, skipsize);
 1162|    123|	if (skipsize < 0)
  ------------------
  |  Branch (1162:6): [True: 2, False: 121]
  ------------------
 1163|      2|		return ((int)skipsize);
 1164|    121|	iso9660->current_position = skipsize;
 1165|       |
 1166|    121|	block = __archive_read_ahead(a, vd->size, NULL);
 1167|    121|	if (block == NULL) {
  ------------------
  |  Branch (1167:6): [True: 1, False: 120]
  ------------------
 1168|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1169|      1|		    "Failed to read full block when scanning "
 1170|      1|		    "ISO9660 directory list");
 1171|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1172|      1|	}
 1173|       |
 1174|       |	/*
 1175|       |	 * While reading Root Directory, flag seenJoliet must be zero to
 1176|       |	 * avoid converting special name 0x00(Current Directory) and
 1177|       |	 * next byte to UCS2.
 1178|       |	 */
 1179|    120|	seenJoliet = iso9660->seenJoliet;/* Save flag. */
 1180|    120|	iso9660->seenJoliet = 0;
 1181|    120|	file = parse_file_info(a, NULL, block, vd->size);
 1182|    120|	if (file == NULL)
  ------------------
  |  Branch (1182:6): [True: 7, False: 113]
  ------------------
 1183|      7|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1184|    113|	iso9660->seenJoliet = seenJoliet;
 1185|       |
 1186|       |	/*
 1187|       |	 * If the iso image has both RockRidge and Joliet, we preferentially
 1188|       |	 * use RockRidge Extensions rather than Joliet ones.
 1189|       |	 */
 1190|    113|	if (vd == &(iso9660->primary) && iso9660->seenRockridge
  ------------------
  |  Branch (1190:6): [True: 112, False: 1]
  |  Branch (1190:35): [True: 21, False: 91]
  ------------------
 1191|     21|	    && iso9660->seenJoliet)
  ------------------
  |  Branch (1191:9): [True: 0, False: 21]
  ------------------
 1192|      0|		iso9660->seenJoliet = 0;
 1193|       |
 1194|    113|	if (vd == &(iso9660->primary) && !iso9660->seenRockridge
  ------------------
  |  Branch (1194:6): [True: 112, False: 1]
  |  Branch (1194:35): [True: 91, False: 21]
  ------------------
 1195|     91|	    && iso9660->seenJoliet) {
  ------------------
  |  Branch (1195:9): [True: 17, False: 74]
  ------------------
 1196|       |		/* Switch reading data from primary to joliet. */
 1197|     17|		vd = &(iso9660->joliet);
 1198|     17|		skipsize = LOGICAL_BLOCK_SIZE * (int64_t)vd->location;
  ------------------
  |  |   82|     17|#define	LOGICAL_BLOCK_SIZE	2048
  ------------------
 1199|     17|		skipsize -= iso9660->current_position;
 1200|     17|		skipsize = __archive_read_consume(a, skipsize);
 1201|     17|		if (skipsize < 0)
  ------------------
  |  Branch (1201:7): [True: 2, False: 15]
  ------------------
 1202|      2|			return ((int)skipsize);
 1203|     15|		iso9660->current_position += skipsize;
 1204|       |
 1205|     15|		block = __archive_read_ahead(a, vd->size, NULL);
 1206|     15|		if (block == NULL) {
  ------------------
  |  Branch (1206:7): [True: 1, False: 14]
  ------------------
 1207|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1208|      1|			    "Failed to read full block when scanning "
 1209|      1|			    "ISO9660 directory list");
 1210|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1211|      1|		}
 1212|     14|		iso9660->seenJoliet = 0;
 1213|     14|		file = parse_file_info(a, NULL, block, vd->size);
 1214|     14|		if (file == NULL)
  ------------------
  |  Branch (1214:7): [True: 1, False: 13]
  ------------------
 1215|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1216|     13|		iso9660->seenJoliet = seenJoliet;
 1217|     13|	}
 1218|       |
 1219|       |	/* Store the root directory in the pending list. */
 1220|    109|	if (add_entry(a, iso9660, file) != ARCHIVE_OK)
  ------------------
  |  |  451|    109|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
              	if (add_entry(a, iso9660, file) != ARCHIVE_OK)
  ------------------
  |  |  233|    109|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1220:6): [True: 0, False: 109]
  ------------------
 1221|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1222|    109|	if (iso9660->seenRockridge) {
  ------------------
  |  Branch (1222:6): [True: 21, False: 88]
  ------------------
 1223|     21|		a->archive.archive_format = ARCHIVE_FORMAT_ISO9660_ROCKRIDGE;
  ------------------
  |  |  373|     21|#define	ARCHIVE_FORMAT_ISO9660_ROCKRIDGE	(ARCHIVE_FORMAT_ISO9660 | 1)
  |  |  ------------------
  |  |  |  |  372|     21|#define	ARCHIVE_FORMAT_ISO9660			0x40000
  |  |  ------------------
  ------------------
 1224|     21|		a->archive.archive_format_name =
 1225|     21|		    "ISO9660 with Rockridge extensions";
 1226|     21|	}
 1227|       |
 1228|    109|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    109|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1229|    109|}
archive_read_support_format_iso9660.c:parse_file_info:
 1821|    888|{
 1822|    888|	struct iso9660 *iso9660 = a->format->data;
 1823|    888|	struct file_info *file, *filep;
 1824|    888|	size_t name_len;
 1825|    888|	const unsigned char *rr_start, *rr_end;
 1826|    888|	const unsigned char *p;
 1827|    888|	size_t dr_len = 0;
 1828|    888|	uint64_t fsize, offset;
 1829|    888|	int32_t location;
 1830|    888|	int flags;
 1831|       |
 1832|    888|	if (reclen != 0)
  ------------------
  |  Branch (1832:6): [True: 887, False: 1]
  ------------------
 1833|    887|		dr_len = (size_t)isodirrec[DR_length_offset];
  ------------------
  |  |  196|    887|#define DR_length_offset 0
  ------------------
 1834|       |	/*
 1835|       |	 * Sanity check that reclen is not zero and dr_len is greater than
 1836|       |	 * reclen but at least 34
 1837|       |	 */
 1838|    888|	if (reclen == 0 || reclen < dr_len || dr_len < 34) {
  ------------------
  |  Branch (1838:6): [True: 1, False: 887]
  |  Branch (1838:21): [True: 0, False: 887]
  |  Branch (1838:40): [True: 8, False: 879]
  ------------------
 1839|      9|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      9|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1840|      9|			"Invalid length of directory record");
 1841|      9|		return (NULL);
 1842|      9|	}
 1843|    879|	name_len = (size_t)isodirrec[DR_name_len_offset];
  ------------------
  |  |  214|    879|#define DR_name_len_offset 32
  ------------------
 1844|    879|	location = archive_le32dec(isodirrec + DR_extent_offset);
  ------------------
  |  |  200|    879|#define DR_extent_offset 2
  ------------------
 1845|    879|	fsize = archive_le32dec(isodirrec + DR_size_offset);
  ------------------
  |  |  202|    879|#define DR_size_offset 10
  ------------------
 1846|       |	/* Sanity check that name_len doesn't exceed dr_len. */
 1847|    879|	if (dr_len - 33 < name_len || name_len == 0) {
  ------------------
  |  Branch (1847:6): [True: 5, False: 874]
  |  Branch (1847:32): [True: 5, False: 869]
  ------------------
 1848|     10|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     10|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1849|     10|		    "Invalid length of file identifier");
 1850|     10|		return (NULL);
 1851|     10|	}
 1852|       |	/* Sanity check that location doesn't exceed volume block.
 1853|       |	 * Don't check lower limit of location; it's possibility
 1854|       |	 * the location has negative value when file type is symbolic
 1855|       |	 * link or file size is zero. As far as I know latest mkisofs
 1856|       |	 * do that.
 1857|       |	 */
 1858|    869|	if (location > 0 &&
  ------------------
  |  Branch (1858:6): [True: 435, False: 434]
  ------------------
 1859|    435|	    (location + ((fsize + iso9660->logical_block_size -1)
  ------------------
  |  Branch (1859:6): [True: 2, False: 433]
  ------------------
 1860|    435|	       / iso9660->logical_block_size))
 1861|    435|			> (uint32_t)iso9660->volume_block) {
 1862|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1863|      2|		    "Invalid location of extent of file");
 1864|      2|		return (NULL);
 1865|      2|	}
 1866|       |	/* Sanity check that location doesn't have a negative value
 1867|       |	 * when the file is not empty. it's too large. */
 1868|    867|	if (fsize != 0 && location < 0) {
  ------------------
  |  Branch (1868:6): [True: 554, False: 313]
  |  Branch (1868:20): [True: 0, False: 554]
  ------------------
 1869|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1870|      0|		    "Invalid location of extent of file");
 1871|      0|		return (NULL);
 1872|      0|	}
 1873|       |
 1874|       |	/* Sanity check that this entry does not create a cycle. */
 1875|    867|	offset = iso9660->logical_block_size * (uint64_t)location;
 1876|  1.79k|	for (filep = parent; filep != NULL; filep = filep->parent) {
  ------------------
  |  Branch (1876:23): [True: 926, False: 865]
  ------------------
 1877|    926|		if (filep->offset == offset) {
  ------------------
  |  Branch (1877:7): [True: 2, False: 924]
  ------------------
 1878|      2|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1879|      2|			    "Directory structure contains loop");
 1880|      2|			return (NULL);
 1881|      2|		}
 1882|    926|	}
 1883|       |
 1884|       |	/* Create a new file entry and copy data from the ISO dir record. */
 1885|    865|	file = calloc(1, sizeof(*file));
 1886|    865|	if (file == NULL) {
  ------------------
  |  Branch (1886:6): [True: 0, False: 865]
  ------------------
 1887|      0|		archive_set_error(&a->archive, ENOMEM,
 1888|      0|		    "No memory for file entry");
 1889|      0|		return (NULL);
 1890|      0|	}
 1891|    865|	file->parent = parent;
 1892|    865|	file->offset = offset;
 1893|    865|	file->size = fsize;
 1894|    865|	if (isodate7_valid(isodirrec + DR_date_offset)) {
  ------------------
  |  |  204|    865|#define DR_date_offset 18
  ------------------
  |  Branch (1894:6): [True: 378, False: 487]
  ------------------
 1895|    378|		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  312|    378|#define MTIME_IS_SET 2
  ------------------
              		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  313|    378|#define ATIME_IS_SET 4
  ------------------
              		file->time_is_set |= MTIME_IS_SET | ATIME_IS_SET | CTIME_IS_SET;
  ------------------
  |  |  314|    378|#define CTIME_IS_SET 8
  ------------------
 1896|    378|		file->mtime = isodate7(isodirrec + DR_date_offset);
  ------------------
  |  |  204|    378|#define DR_date_offset 18
  ------------------
 1897|    378|		file->ctime = file->atime = file->mtime;
 1898|    378|	}
 1899|    865|	file->rede_files.first = NULL;
 1900|    865|	file->rede_files.last = &(file->rede_files.first);
 1901|       |
 1902|    865|	p = isodirrec + DR_name_offset;
  ------------------
  |  |  216|    865|#define DR_name_offset 33
  ------------------
 1903|       |	/* Rockridge extensions (if any) follow name.  Compute this
 1904|       |	 * before fidgeting the name_len below. */
 1905|    865|	rr_start = p + name_len + (name_len & 1 ? 0 : 1);
  ------------------
  |  Branch (1905:29): [True: 231, False: 634]
  ------------------
 1906|    865|	rr_end = isodirrec + dr_len;
 1907|       |
 1908|    865|	if (iso9660->seenJoliet) {
  ------------------
  |  Branch (1908:6): [True: 21, False: 844]
  ------------------
 1909|       |		/* Joliet names are max 64 chars (128 bytes) according to spec,
 1910|       |		 * but genisoimage/mkisofs allows recording longer Joliet
 1911|       |		 * names which are 103 UCS2 characters(206 bytes) by their
 1912|       |		 * option '-joliet-long'.
 1913|       |		 */
 1914|     21|		if (name_len > 206)
  ------------------
  |  Branch (1914:7): [True: 0, False: 21]
  ------------------
 1915|      0|			name_len = 206;
 1916|     21|		name_len &= ~1;
 1917|       |
 1918|       |		/* trim trailing first version and dot from filename.
 1919|       |		 *
 1920|       |		 * Remember we were in UTF-16BE land!
 1921|       |		 * SEPARATOR 1 (.) and SEPARATOR 2 (;) are both
 1922|       |		 * 16 bits big endian characters on Joliet.
 1923|       |		 *
 1924|       |		 * TODO: sanitize filename?
 1925|       |		 *       Joliet allows any UCS-2 char except:
 1926|       |		 *       *, /, :, ;, ? and \.
 1927|       |		 */
 1928|       |		/* Chop off trailing ';1' from files. */
 1929|     21|		if (name_len > 4 && p[name_len-4] == 0 && p[name_len-3] == ';'
  ------------------
  |  Branch (1929:7): [True: 19, False: 2]
  |  Branch (1929:23): [True: 9, False: 10]
  |  Branch (1929:45): [True: 2, False: 7]
  ------------------
 1930|      2|		    && p[name_len-2] == 0 && p[name_len-1] == '1')
  ------------------
  |  Branch (1930:10): [True: 1, False: 1]
  |  Branch (1930:32): [True: 0, False: 1]
  ------------------
 1931|      0|			name_len -= 4;
 1932|       |#if 0 /* XXX: this somehow manages to strip of single-character file extensions, like '.c'. */
 1933|       |		/* Chop off trailing '.' from filenames. */
 1934|       |		if (name_len > 2 && p[name_len-2] == 0 && p[name_len-1] == '.')
 1935|       |			name_len -= 2;
 1936|       |#endif
 1937|     21|		if ((file->utf16be_name = malloc(name_len)) == NULL) {
  ------------------
  |  Branch (1937:7): [True: 0, False: 21]
  ------------------
 1938|      0|			archive_set_error(&a->archive, ENOMEM,
 1939|      0|			    "No memory for file name");
 1940|      0|			goto fail;
 1941|      0|		}
 1942|     21|		memcpy(file->utf16be_name, p, name_len);
 1943|     21|		file->utf16be_bytes = name_len;
 1944|    844|	} else {
 1945|       |		/* Chop off trailing ';1' from files. */
 1946|    844|		if (name_len > 2 && p[name_len - 2] == ';' &&
  ------------------
  |  Branch (1946:7): [True: 665, False: 179]
  |  Branch (1946:23): [True: 342, False: 323]
  ------------------
 1947|    342|				p[name_len - 1] == '1')
  ------------------
  |  Branch (1947:5): [True: 300, False: 42]
  ------------------
 1948|    300|			name_len -= 2;
 1949|       |		/* Chop off trailing '.' from filenames. */
 1950|    844|		if (name_len > 1 && p[name_len - 1] == '.')
  ------------------
  |  Branch (1950:7): [True: 665, False: 179]
  |  Branch (1950:23): [True: 8, False: 657]
  ------------------
 1951|      8|			--name_len;
 1952|       |
 1953|    844|		archive_strncpy(&file->name, (const char *)p, name_len);
  ------------------
  |  |  173|    844|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1954|    844|	}
 1955|       |
 1956|    865|	flags = isodirrec[DR_flags_offset];
  ------------------
  |  |  206|    865|#define DR_flags_offset 25
  ------------------
 1957|    865|	if (flags & 0x02)
  ------------------
  |  Branch (1957:6): [True: 390, False: 475]
  ------------------
 1958|    390|		file->mode = AE_IFDIR | 0700;
  ------------------
  |  |  221|    390|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1959|    475|	else
 1960|    475|		file->mode = AE_IFREG | 0400;
  ------------------
  |  |  216|    475|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1961|    865|	if (flags & 0x80)
  ------------------
  |  Branch (1961:6): [True: 103, False: 762]
  ------------------
 1962|    103|		file->multi_extent = 1;
 1963|    762|	else
 1964|    762|		file->multi_extent = 0;
 1965|       |	/*
 1966|       |	 * Use a location for the file number, which is treated as an inode
 1967|       |	 * number to find out hardlink target. If Rockridge extensions is
 1968|       |	 * being used, the file number will be overwritten by FILE SERIAL
 1969|       |	 * NUMBER of RRIP "PX" extension.
 1970|       |	 * Note: Old mkisofs did not record that FILE SERIAL NUMBER
 1971|       |	 * in ISO images.
 1972|       |	 * Note2: xorriso set 0 to the location of a symlink file.
 1973|       |	 */
 1974|    865|	if (file->size == 0 && location >= 0) {
  ------------------
  |  Branch (1974:6): [True: 313, False: 552]
  |  Branch (1974:25): [True: 221, False: 92]
  ------------------
 1975|       |		/* If file->size is zero, its location points wrong place,
 1976|       |		 * and so we should not use it for the file number.
 1977|       |		 * When the location has negative value, it can be used
 1978|       |		 * for the file number.
 1979|       |		 */
 1980|    221|		file->number = -1;
 1981|       |		/* Do not appear before any directory entries. */
 1982|    221|		file->offset = -1;
 1983|    221|	} else
 1984|    644|		file->number = (int64_t)(uint32_t)location;
 1985|       |
 1986|       |	/* Rockridge extensions overwrite information from above. */
 1987|    865|	if (iso9660->opt_support_rockridge) {
  ------------------
  |  Branch (1987:6): [True: 116, False: 749]
  ------------------
 1988|    116|		if (parent == NULL && rr_end - rr_start >= 7) {
  ------------------
  |  Branch (1988:7): [True: 116, False: 0]
  |  Branch (1988:25): [True: 32, False: 84]
  ------------------
 1989|     32|			p = rr_start;
 1990|     32|			if (memcmp(p, "SP\x07\x01\xbe\xef", 6) == 0) {
  ------------------
  |  Branch (1990:8): [True: 30, False: 2]
  ------------------
 1991|       |				/*
 1992|       |				 * SP extension stores the suspOffset
 1993|       |				 * (Number of bytes to skip between
 1994|       |				 * filename and SUSP records.)
 1995|       |				 * It is mandatory by the SUSP standard
 1996|       |				 * (IEEE 1281).
 1997|       |				 *
 1998|       |				 * It allows SUSP to coexist with
 1999|       |				 * non-SUSP uses of the System
 2000|       |				 * Use Area by placing non-SUSP data
 2001|       |				 * before SUSP data.
 2002|       |				 *
 2003|       |				 * SP extension must be in the root
 2004|       |				 * directory entry, disable all SUSP
 2005|       |				 * processing if not found.
 2006|       |				 */
 2007|     30|				iso9660->suspOffset = p[6];
 2008|     30|				iso9660->seenSUSP = 1;
 2009|     30|				rr_start += 7;
 2010|     30|			}
 2011|     32|		}
 2012|    116|		if (iso9660->seenSUSP) {
  ------------------
  |  Branch (2012:7): [True: 30, False: 86]
  ------------------
 2013|     30|			int r;
 2014|       |
 2015|     30|			file->name_continues = 0;
 2016|     30|			file->symlink_continues = 0;
 2017|     30|			rr_start += iso9660->suspOffset;
 2018|     30|			r = parse_rockridge(a, file, rr_start, rr_end);
 2019|     30|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|     30|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2019:8): [True: 3, False: 27]
  ------------------
 2020|      3|				goto fail;
 2021|       |			/*
 2022|       |			 * A file size of symbolic link files in ISO images
 2023|       |			 * made by makefs is not zero and its location is
 2024|       |			 * the same as those of next regular file. That is
 2025|       |			 * the same as hard like file and it causes unexpected
 2026|       |			 * error.
 2027|       |			 */
 2028|     27|			if (file->size > 0 &&
  ------------------
  |  Branch (2028:8): [True: 1, False: 26]
  ------------------
 2029|      1|			    (file->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  215|      1|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    (file->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  217|      1|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (2029:8): [True: 0, False: 1]
  ------------------
 2030|      0|				file->size = 0;
 2031|      0|				file->number = -1;
 2032|      0|				file->offset = -1;
 2033|      0|			}
 2034|     27|		} else
 2035|       |			/* If there isn't SUSP, disable parsing
 2036|       |			 * rock ridge extensions. */
 2037|     86|			iso9660->opt_support_rockridge = 0;
 2038|    116|	}
 2039|       |
 2040|    862|	file->nlinks = 1;/* Reset nlink. we'll calculate it later. */
 2041|       |	/* Tell file's parent how many children that parent has. */
 2042|    862|	if (parent != NULL && (flags & 0x02))
  ------------------
  |  Branch (2042:6): [True: 736, False: 126]
  |  Branch (2042:24): [True: 294, False: 442]
  ------------------
 2043|    294|		parent->subdirs++;
 2044|       |
 2045|    862|	if (iso9660->seenRockridge) {
  ------------------
  |  Branch (2045:6): [True: 21, False: 841]
  ------------------
 2046|     21|		if (parent != NULL && parent->parent == NULL &&
  ------------------
  |  Branch (2046:7): [True: 0, False: 21]
  |  Branch (2046:25): [True: 0, False: 0]
  ------------------
 2047|      0|		    (flags & 0x02) && iso9660->rr_moved == NULL &&
  ------------------
  |  Branch (2047:7): [True: 0, False: 0]
  |  Branch (2047:25): [True: 0, False: 0]
  ------------------
 2048|      0|		    file->name.s &&
  ------------------
  |  Branch (2048:7): [True: 0, False: 0]
  ------------------
 2049|      0|		    (strcmp(file->name.s, "rr_moved") == 0 ||
  ------------------
  |  Branch (2049:8): [True: 0, False: 0]
  ------------------
 2050|      0|		     strcmp(file->name.s, ".rr_moved") == 0)) {
  ------------------
  |  Branch (2050:8): [True: 0, False: 0]
  ------------------
 2051|      0|			iso9660->rr_moved = file;
 2052|      0|			file->rr_moved = 1;
 2053|      0|			file->rr_moved_has_re_only = 1;
 2054|      0|			file->re = 0;
 2055|      0|			parent->subdirs--;
 2056|     21|		} else if (file->re) {
  ------------------
  |  Branch (2056:14): [True: 0, False: 21]
  ------------------
 2057|       |			/*
 2058|       |			 * Sanity check: file's parent is rr_moved.
 2059|       |			 */
 2060|      0|			if (parent == NULL || parent->rr_moved == 0) {
  ------------------
  |  Branch (2060:8): [True: 0, False: 0]
  |  Branch (2060:26): [True: 0, False: 0]
  ------------------
 2061|      0|				archive_set_error(&a->archive,
 2062|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2063|      0|				    "Invalid Rockridge RE");
 2064|      0|				goto fail;
 2065|      0|			}
 2066|       |			/*
 2067|       |			 * Sanity check: file does not have "CL" extension.
 2068|       |			 */
 2069|      0|			if (file->cl_offset) {
  ------------------
  |  Branch (2069:8): [True: 0, False: 0]
  ------------------
 2070|      0|				archive_set_error(&a->archive,
 2071|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2072|      0|				    "Invalid Rockridge RE and CL");
 2073|      0|				goto fail;
 2074|      0|			}
 2075|       |			/*
 2076|       |			 * Sanity check: The file type must be a directory.
 2077|       |			 */
 2078|      0|			if ((flags & 0x02) == 0) {
  ------------------
  |  Branch (2078:8): [True: 0, False: 0]
  ------------------
 2079|      0|				archive_set_error(&a->archive,
 2080|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2081|      0|				    "Invalid Rockridge RE");
 2082|      0|				goto fail;
 2083|      0|			}
 2084|     21|		} else if (parent != NULL && parent->rr_moved)
  ------------------
  |  Branch (2084:14): [True: 0, False: 21]
  |  Branch (2084:32): [True: 0, False: 0]
  ------------------
 2085|      0|			file->rr_moved_has_re_only = 0;
 2086|     21|		else if (parent != NULL && (flags & 0x02) &&
  ------------------
  |  Branch (2086:12): [True: 0, False: 21]
  |  Branch (2086:30): [True: 0, False: 0]
  ------------------
 2087|      0|		    (parent->re || parent->re_descendant))
  ------------------
  |  Branch (2087:8): [True: 0, False: 0]
  |  Branch (2087:22): [True: 0, False: 0]
  ------------------
 2088|      0|			file->re_descendant = 1;
 2089|     21|		if (file->cl_offset) {
  ------------------
  |  Branch (2089:7): [True: 0, False: 21]
  ------------------
 2090|      0|			struct file_info *r;
 2091|       |
 2092|      0|			if (parent == NULL || parent->parent == NULL) {
  ------------------
  |  Branch (2092:8): [True: 0, False: 0]
  |  Branch (2092:26): [True: 0, False: 0]
  ------------------
 2093|      0|				archive_set_error(&a->archive,
 2094|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2095|      0|				    "Invalid Rockridge CL");
 2096|      0|				goto fail;
 2097|      0|			}
 2098|       |			/*
 2099|       |			 * Sanity check: The file type must be a regular file.
 2100|       |			 */
 2101|      0|			if ((flags & 0x02) != 0) {
  ------------------
  |  Branch (2101:8): [True: 0, False: 0]
  ------------------
 2102|      0|				archive_set_error(&a->archive,
 2103|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2104|      0|				    "Invalid Rockridge CL");
 2105|      0|				goto fail;
 2106|      0|			}
 2107|      0|			parent->subdirs++;
 2108|       |			/* Overwrite an offset and a number of this "CL" entry
 2109|       |			 * to appear before other dirs. "+1" to those is to
 2110|       |			 * make sure to appear after "RE" entry which this
 2111|       |			 * "CL" entry should be connected with. */
 2112|      0|			file->offset = file->number = file->cl_offset + 1;
 2113|       |
 2114|       |			/*
 2115|       |			 * Sanity check: cl_offset does not point at its
 2116|       |			 * the parents or itself.
 2117|       |			 */
 2118|      0|			for (r = parent; r; r = r->parent) {
  ------------------
  |  Branch (2118:21): [True: 0, False: 0]
  ------------------
 2119|      0|				if (r->offset == file->cl_offset) {
  ------------------
  |  Branch (2119:9): [True: 0, False: 0]
  ------------------
 2120|      0|					archive_set_error(&a->archive,
 2121|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2122|      0|					    "Invalid Rockridge CL");
 2123|      0|					goto fail;
 2124|      0|				}
 2125|      0|			}
 2126|      0|			if (file->cl_offset == file->offset ||
  ------------------
  |  Branch (2126:8): [True: 0, False: 0]
  ------------------
 2127|      0|			    parent->rr_moved) {
  ------------------
  |  Branch (2127:8): [True: 0, False: 0]
  ------------------
 2128|      0|				archive_set_error(&a->archive,
 2129|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2130|      0|				    "Invalid Rockridge CL");
 2131|      0|				goto fail;
 2132|      0|			}
 2133|      0|		}
 2134|     21|	}
 2135|       |
 2136|       |#if DEBUG
 2137|       |	/* DEBUGGING: Warn about attributes I don't yet fully support. */
 2138|       |	if ((flags & ~0x02) != 0) {
 2139|       |		fprintf(stderr, "\n ** Unrecognized flag: ");
 2140|       |		dump_isodirrec(stderr, isodirrec);
 2141|       |		fprintf(stderr, "\n");
 2142|       |	} else if (archive_le16dec(isodirrec + DR_volume_sequence_number_offset) != 1) {
 2143|       |		fprintf(stderr, "\n ** Unrecognized sequence number: ");
 2144|       |		dump_isodirrec(stderr, isodirrec);
 2145|       |		fprintf(stderr, "\n");
 2146|       |	} else if (*(isodirrec + DR_file_unit_size_offset) != 0) {
 2147|       |		fprintf(stderr, "\n ** Unexpected file unit size: ");
 2148|       |		dump_isodirrec(stderr, isodirrec);
 2149|       |		fprintf(stderr, "\n");
 2150|       |	} else if (*(isodirrec + DR_interleave_offset) != 0) {
 2151|       |		fprintf(stderr, "\n ** Unexpected interleave: ");
 2152|       |		dump_isodirrec(stderr, isodirrec);
 2153|       |		fprintf(stderr, "\n");
 2154|       |	} else if (*(isodirrec + DR_ext_attr_length_offset) != 0) {
 2155|       |		fprintf(stderr, "\n ** Unexpected extended attribute length: ");
 2156|       |		dump_isodirrec(stderr, isodirrec);
 2157|       |		fprintf(stderr, "\n");
 2158|       |	}
 2159|       |#endif
 2160|    862|	register_file(iso9660, file);
 2161|    862|	return (file);
 2162|      3|fail:
 2163|      3|	archive_string_free(&file->name);
 2164|      3|	free(file);
 2165|       |	return (NULL);
 2166|    862|}
archive_read_support_format_iso9660.c:isodate7_valid:
 3251|    889|{
 3252|    889|	int year = v[0];
 3253|    889|	int month = v[1];
 3254|    889|	int day = v[2];
 3255|    889|	int hour = v[3];
 3256|    889|	int minute = v[4];
 3257|    889|	int second = v[5];
 3258|    889|	int gmt_off = (signed char)v[6];
 3259|       |
 3260|       |	/* ECMA-119 9.1.5 "If all seven values are zero, it shall mean
 3261|       |	 * that the date is unspecified" */
 3262|    889|	if (year == 0
  ------------------
  |  Branch (3262:6): [True: 322, False: 567]
  ------------------
 3263|    322|	    && month == 0
  ------------------
  |  Branch (3263:9): [True: 278, False: 44]
  ------------------
 3264|    278|	    && day == 0
  ------------------
  |  Branch (3264:9): [True: 261, False: 17]
  ------------------
 3265|    261|	    && hour == 0
  ------------------
  |  Branch (3265:9): [True: 256, False: 5]
  ------------------
 3266|    256|	    && minute == 0
  ------------------
  |  Branch (3266:9): [True: 248, False: 8]
  ------------------
 3267|    248|	    && second == 0
  ------------------
  |  Branch (3267:9): [True: 233, False: 15]
  ------------------
 3268|    233|	    && gmt_off == 0)
  ------------------
  |  Branch (3268:9): [True: 198, False: 35]
  ------------------
 3269|    198|		return 0;
 3270|       |	/*
 3271|       |	 * Sanity-test each individual field
 3272|       |	 */
 3273|       |	/* Year can have any value */
 3274|       |	/* Month must be 1-12 */
 3275|    691|	if (month < 1 || month > 12)
  ------------------
  |  Branch (3275:6): [True: 95, False: 596]
  |  Branch (3275:19): [True: 60, False: 536]
  ------------------
 3276|    155|		return 0;
 3277|       |	/* Day must be 1-31 */
 3278|    536|	if (day < 1 || day > 31)
  ------------------
  |  Branch (3278:6): [True: 63, False: 473]
  |  Branch (3278:17): [True: 41, False: 432]
  ------------------
 3279|    104|		return 0;
 3280|       |	/* Hour must be 0-23 */
 3281|    432|	if (hour > 23)
  ------------------
  |  Branch (3281:6): [True: 9, False: 423]
  ------------------
 3282|      9|		return 0;
 3283|       |	/* Minute must be 0-59 */
 3284|    423|	if (minute > 59)
  ------------------
  |  Branch (3284:6): [True: 17, False: 406]
  ------------------
 3285|     17|		return 0;
 3286|       |	/* second must be 0-59 according to ECMA-119 9.1.5 */
 3287|       |	/* BUT: we should probably allow for the time being in UTC, which
 3288|       |	   allows up to 61 seconds in a minute in certain cases */
 3289|    406|	if (second > 61)
  ------------------
  |  Branch (3289:6): [True: 14, False: 392]
  ------------------
 3290|     14|		return 0;
 3291|       |	/* Offset from GMT must be -48 to +52 */
 3292|    392|	if (gmt_off < -48 || gmt_off > +52)
  ------------------
  |  Branch (3292:6): [True: 3, False: 389]
  |  Branch (3292:23): [True: 9, False: 380]
  ------------------
 3293|     12|		return 0;
 3294|       |
 3295|       |	/* All tests pass, this is OK */
 3296|    380|	return 1;
 3297|    392|}
archive_read_support_format_iso9660.c:isodate7:
 3301|    380|{
 3302|    380|	struct tm tm;
 3303|    380|	int offset;
 3304|    380|	time_t t;
 3305|       |
 3306|    380|	memset(&tm, 0, sizeof(tm));
 3307|    380|	tm.tm_year = v[0];
 3308|    380|	tm.tm_mon = v[1] - 1;
 3309|    380|	tm.tm_mday = v[2];
 3310|    380|	tm.tm_hour = v[3];
 3311|    380|	tm.tm_min = v[4];
 3312|    380|	tm.tm_sec = v[5];
 3313|       |	/* v[6] is the signed timezone offset, in 1/4-hour increments. */
 3314|    380|	offset = ((const signed char *)v)[6];
 3315|    380|	if (offset > -48 && offset < 52) {
  ------------------
  |  Branch (3315:6): [True: 380, False: 0]
  |  Branch (3315:22): [True: 377, False: 3]
  ------------------
 3316|    377|		tm.tm_hour -= offset / 4;
 3317|    377|		tm.tm_min -= (offset % 4) * 15;
 3318|    377|	}
 3319|    380|	t = time_from_tm(&tm);
 3320|    380|	if (t == (time_t)-1)
  ------------------
  |  Branch (3320:6): [True: 0, False: 380]
  ------------------
 3321|      0|		return ((time_t)0);
 3322|    380|	return (t);
 3323|    380|}
archive_read_support_format_iso9660.c:time_from_tm:
 3416|    380|{
 3417|       |#if HAVE__MKGMTIME
 3418|       |        return _mkgmtime(t);
 3419|       |#elif HAVE_TIMEGM
 3420|       |        /* Use platform timegm() if available. */
 3421|    380|        return (timegm(t));
 3422|       |#else
 3423|       |        /* Else use direct calculation using POSIX assumptions. */
 3424|       |        /* First, fix up tm_yday based on the year/month/day. */
 3425|       |        if (mktime(t) == (time_t)-1)
 3426|       |                return ((time_t)-1);
 3427|       |        /* Then we can compute timegm() from first principles. */
 3428|       |        return (t->tm_sec
 3429|       |            + t->tm_min * 60
 3430|       |            + t->tm_hour * 3600
 3431|       |            + t->tm_yday * 86400
 3432|       |            + (t->tm_year - 70) * 31536000
 3433|       |            + ((t->tm_year - 69) / 4) * 86400
 3434|       |            - ((t->tm_year - 1) / 100) * 86400
 3435|       |            + ((t->tm_year + 299) / 400) * 86400);
 3436|       |#endif
 3437|    380|}
archive_read_support_format_iso9660.c:parse_rockridge:
 2171|     30|{
 2172|     30|	struct iso9660 *iso9660 = a->format->data;
 2173|     30|	int entry_seen = 0;
 2174|       |
 2175|     60|	while (p + 4 <= end  /* Enough space for another entry. */
  ------------------
  |  Branch (2175:9): [True: 59, False: 1]
  ------------------
 2176|     59|	    && p[0] >= 'A' && p[0] <= 'Z' /* Sanity-check 1st char of name. */
  ------------------
  |  Branch (2176:9): [True: 39, False: 20]
  |  Branch (2176:24): [True: 35, False: 4]
  ------------------
 2177|     35|	    && p[1] >= 'A' && p[1] <= 'Z' /* Sanity-check 2nd char of name. */
  ------------------
  |  Branch (2177:9): [True: 34, False: 1]
  |  Branch (2177:24): [True: 32, False: 2]
  ------------------
 2178|     32|	    && p[2] >= 4 /* Sanity-check length. */
  ------------------
  |  Branch (2178:9): [True: 32, False: 0]
  ------------------
 2179|     32|	    && p + p[2] <= end) { /* Sanity-check length. */
  ------------------
  |  Branch (2179:9): [True: 30, False: 2]
  ------------------
 2180|     30|		const unsigned char *data = p + 4;
 2181|     30|		int data_length = p[2] - 4;
 2182|     30|		int version = p[3];
 2183|       |
 2184|     30|		switch(p[0]) {
 2185|      3|		case 'C':
  ------------------
  |  Branch (2185:3): [True: 3, False: 27]
  ------------------
 2186|      3|			if (p[1] == 'E') {
  ------------------
  |  Branch (2186:8): [True: 0, False: 3]
  ------------------
 2187|      0|				if (version == 1 && data_length == 24) {
  ------------------
  |  Branch (2187:9): [True: 0, False: 0]
  |  Branch (2187:25): [True: 0, False: 0]
  ------------------
 2188|       |					/*
 2189|       |					 * CE extension comprises:
 2190|       |					 *   8 byte sector containing extension
 2191|       |					 *   8 byte offset w/in above sector
 2192|       |					 *   8 byte length of continuation
 2193|       |					 */
 2194|      0|					int32_t location =
 2195|      0|					    archive_le32dec(data);
 2196|      0|					file->ce_offset =
 2197|      0|					    archive_le32dec(data+8);
 2198|      0|					file->ce_size =
 2199|      0|					    archive_le32dec(data+16);
 2200|      0|					if (register_CE(a, location, file)
  ------------------
  |  Branch (2200:10): [True: 0, False: 0]
  ------------------
 2201|      0|					    != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2202|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2203|      0|				}
 2204|      0|			}
 2205|      3|			else if (p[1] == 'L') {
  ------------------
  |  Branch (2205:13): [True: 0, False: 3]
  ------------------
 2206|      0|				if (version == 1 && data_length == 8) {
  ------------------
  |  Branch (2206:9): [True: 0, False: 0]
  |  Branch (2206:25): [True: 0, False: 0]
  ------------------
 2207|      0|					file->cl_offset = (uint64_t)
 2208|      0|					    iso9660->logical_block_size *
 2209|      0|					    (uint64_t)archive_le32dec(data);
 2210|      0|					iso9660->seenRockridge = 1;
 2211|      0|				}
 2212|      0|			}
 2213|      3|			break;
 2214|      3|		case 'N':
  ------------------
  |  Branch (2214:3): [True: 1, False: 29]
  ------------------
 2215|      1|			if (p[1] == 'M') {
  ------------------
  |  Branch (2215:8): [True: 0, False: 1]
  ------------------
 2216|      0|				if (version == 1) {
  ------------------
  |  Branch (2216:9): [True: 0, False: 0]
  ------------------
 2217|      0|					parse_rockridge_NM1(file,
 2218|      0|					    data, data_length);
 2219|      0|					iso9660->seenRockridge = 1;
 2220|      0|				}
 2221|      0|			}
 2222|      1|			break;
 2223|      1|		case 'P':
  ------------------
  |  Branch (2223:3): [True: 1, False: 29]
  ------------------
 2224|       |			/*
 2225|       |			 * PD extension is padding;
 2226|       |			 * contents are always ignored.
 2227|       |			 *
 2228|       |			 * PL extension won't appear;
 2229|       |			 * contents are always ignored.
 2230|       |			 */
 2231|      1|			if (p[1] == 'N') {
  ------------------
  |  Branch (2231:8): [True: 0, False: 1]
  ------------------
 2232|      0|				if (version == 1 && data_length == 16) {
  ------------------
  |  Branch (2232:9): [True: 0, False: 0]
  |  Branch (2232:25): [True: 0, False: 0]
  ------------------
 2233|      0|					file->rdev = archive_le32dec(data);
 2234|      0|					file->rdev <<= 32;
 2235|      0|					file->rdev |=
 2236|      0|					    archive_le32dec(data + 8);
 2237|      0|					iso9660->seenRockridge = 1;
 2238|      0|				}
 2239|      0|			}
 2240|      1|			else if (p[1] == 'X') {
  ------------------
  |  Branch (2240:13): [True: 0, False: 1]
  ------------------
 2241|       |				/*
 2242|       |				 * PX extension comprises:
 2243|       |				 *   8 bytes for mode,
 2244|       |				 *   8 bytes for nlinks,
 2245|       |				 *   8 bytes for uid,
 2246|       |				 *   8 bytes for gid,
 2247|       |				 *   8 bytes for inode.
 2248|       |				 */
 2249|      0|				if (version == 1) {
  ------------------
  |  Branch (2249:9): [True: 0, False: 0]
  ------------------
 2250|      0|					if (data_length >= 8)
  ------------------
  |  Branch (2250:10): [True: 0, False: 0]
  ------------------
 2251|      0|						file->mode = (__LA_MODE_T)
 2252|      0|						    archive_le32dec(data);
 2253|      0|					if (data_length >= 16)
  ------------------
  |  Branch (2253:10): [True: 0, False: 0]
  ------------------
 2254|      0|						file->nlinks =
 2255|      0|						    archive_le32dec(data + 8);
 2256|      0|					if (data_length >= 24)
  ------------------
  |  Branch (2256:10): [True: 0, False: 0]
  ------------------
 2257|      0|						file->uid =
 2258|      0|						    archive_le32dec(data + 16);
 2259|      0|					if (data_length >= 32)
  ------------------
  |  Branch (2259:10): [True: 0, False: 0]
  ------------------
 2260|      0|						file->gid =
 2261|      0|						    archive_le32dec(data + 24);
 2262|      0|					if (data_length >= 40)
  ------------------
  |  Branch (2262:10): [True: 0, False: 0]
  ------------------
 2263|      0|						file->number =
 2264|      0|						    archive_le32dec(data + 32);
 2265|      0|					iso9660->seenRockridge = 1;
 2266|      0|				}
 2267|      0|			}
 2268|      1|			break;
 2269|      1|		case 'R':
  ------------------
  |  Branch (2269:3): [True: 1, False: 29]
  ------------------
 2270|      1|			if (p[1] == 'E' && version == 1) {
  ------------------
  |  Branch (2270:8): [True: 0, False: 1]
  |  Branch (2270:23): [True: 0, False: 0]
  ------------------
 2271|      0|				file->re = 1;
 2272|      0|				iso9660->seenRockridge = 1;
 2273|      0|			}
 2274|      1|			else if (p[1] == 'R' && version == 1) {
  ------------------
  |  Branch (2274:13): [True: 0, False: 1]
  |  Branch (2274:28): [True: 0, False: 0]
  ------------------
 2275|       |				/*
 2276|       |				 * RR extension comprises:
 2277|       |				 *    one byte flag value
 2278|       |				 * This extension is obsolete,
 2279|       |				 * so contents are always ignored.
 2280|       |				 */
 2281|      0|			}
 2282|      1|			break;
 2283|      0|		case 'S':
  ------------------
  |  Branch (2283:3): [True: 0, False: 30]
  ------------------
 2284|      0|			if (p[1] == 'L') {
  ------------------
  |  Branch (2284:8): [True: 0, False: 0]
  ------------------
 2285|      0|				if (version == 1) {
  ------------------
  |  Branch (2285:9): [True: 0, False: 0]
  ------------------
 2286|      0|					parse_rockridge_SL1(file,
 2287|      0|					    data, data_length);
 2288|      0|					iso9660->seenRockridge = 1;
 2289|      0|				}
 2290|      0|			}
 2291|      0|			else if (p[1] == 'T'
  ------------------
  |  Branch (2291:13): [True: 0, False: 0]
  ------------------
 2292|      0|			    && data_length == 0 && version == 1) {
  ------------------
  |  Branch (2292:11): [True: 0, False: 0]
  |  Branch (2292:31): [True: 0, False: 0]
  ------------------
 2293|       |				/*
 2294|       |				 * ST extension marks end of this
 2295|       |				 * block of SUSP entries.
 2296|       |				 *
 2297|       |				 * It allows SUSP to coexist with
 2298|       |				 * non-SUSP uses of the System
 2299|       |				 * Use Area by placing non-SUSP data
 2300|       |				 * after SUSP data.
 2301|       |				 */
 2302|      0|				iso9660->seenSUSP = 0;
 2303|      0|				iso9660->seenRockridge = 0;
 2304|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2305|      0|			}
 2306|      0|			break;
 2307|     22|		case 'T':
  ------------------
  |  Branch (2307:3): [True: 22, False: 8]
  ------------------
 2308|     22|			if (p[1] == 'F') {
  ------------------
  |  Branch (2308:8): [True: 22, False: 0]
  ------------------
 2309|     22|				if (version == 1) {
  ------------------
  |  Branch (2309:9): [True: 21, False: 1]
  ------------------
 2310|     21|					parse_rockridge_TF1(file,
 2311|     21|					    data, data_length);
 2312|     21|					iso9660->seenRockridge = 1;
 2313|     21|				}
 2314|     22|			}
 2315|     22|			break;
 2316|      1|		case 'Z':
  ------------------
  |  Branch (2316:3): [True: 1, False: 29]
  ------------------
 2317|      1|			if (p[1] == 'F') {
  ------------------
  |  Branch (2317:8): [True: 0, False: 1]
  ------------------
 2318|      0|				if (version == 1)
  ------------------
  |  Branch (2318:9): [True: 0, False: 0]
  ------------------
 2319|      0|					parse_rockridge_ZF1(file,
 2320|      0|					    data, data_length);
 2321|      0|			}
 2322|      1|			break;
 2323|      1|		default:
  ------------------
  |  Branch (2323:3): [True: 1, False: 29]
  ------------------
 2324|      1|			break;
 2325|     30|		}
 2326|       |
 2327|     30|		p += p[2];
 2328|     30|		entry_seen = 1;
 2329|     30|	}
 2330|       |
 2331|     30|	if (entry_seen)
  ------------------
  |  Branch (2331:6): [True: 27, False: 3]
  ------------------
 2332|     27|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     27|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2333|      3|	else {
 2334|      3|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2335|      3|				  "Tried to parse Rockridge extensions, but none found");
 2336|      3|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2337|      3|	}
 2338|     30|}
archive_read_support_format_iso9660.c:parse_rockridge_TF1:
 2556|     21|{
 2557|     21|	char flag;
 2558|       |	/*
 2559|       |	 * TF extension comprises:
 2560|       |	 *   one byte flag
 2561|       |	 *   create time (optional)
 2562|       |	 *   modify time (optional)
 2563|       |	 *   access time (optional)
 2564|       |	 *   attribute time (optional)
 2565|       |	 *  Time format and presence of fields
 2566|       |	 *  is controlled by flag bits.
 2567|       |	 */
 2568|     21|	if (data_length < 1)
  ------------------
  |  Branch (2568:6): [True: 1, False: 20]
  ------------------
 2569|      1|		return;
 2570|     20|	flag = data[0];
 2571|     20|	++data;
 2572|     20|	--data_length;
 2573|     20|	if (flag & 0x80) {
  ------------------
  |  Branch (2573:6): [True: 12, False: 8]
  ------------------
 2574|       |		/* Use 17-byte time format. */
 2575|     12|		if ((flag & 1) && data_length >= 17) {
  ------------------
  |  Branch (2575:7): [True: 12, False: 0]
  |  Branch (2575:21): [True: 12, False: 0]
  ------------------
 2576|       |			/* Create time. */
 2577|     12|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2577:8): [True: 0, False: 12]
  ------------------
 2578|      0|				file->time_is_set |= BIRTHTIME_IS_SET;
  ------------------
  |  |  311|      0|#define BIRTHTIME_IS_SET 1
  ------------------
 2579|      0|				file->birthtime = isodate17(data);
 2580|      0|			}
 2581|     12|			data += 17;
 2582|     12|			data_length -= 17;
 2583|     12|		}
 2584|     12|		if ((flag & 2) && data_length >= 17) {
  ------------------
  |  Branch (2584:7): [True: 12, False: 0]
  |  Branch (2584:21): [True: 11, False: 1]
  ------------------
 2585|       |			/* Modify time. */
 2586|     11|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2586:8): [True: 0, False: 11]
  ------------------
 2587|      0|				file->time_is_set |= MTIME_IS_SET;
  ------------------
  |  |  312|      0|#define MTIME_IS_SET 2
  ------------------
 2588|      0|				file->mtime = isodate17(data);
 2589|      0|			}
 2590|     11|			data += 17;
 2591|     11|			data_length -= 17;
 2592|     11|		}
 2593|     12|		if ((flag & 4) && data_length >= 17) {
  ------------------
  |  Branch (2593:7): [True: 12, False: 0]
  |  Branch (2593:21): [True: 11, False: 1]
  ------------------
 2594|       |			/* Access time. */
 2595|     11|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2595:8): [True: 0, False: 11]
  ------------------
 2596|      0|				file->time_is_set |= ATIME_IS_SET;
  ------------------
  |  |  313|      0|#define ATIME_IS_SET 4
  ------------------
 2597|      0|				file->atime = isodate17(data);
 2598|      0|			}
 2599|     11|			data += 17;
 2600|     11|			data_length -= 17;
 2601|     11|		}
 2602|     12|		if ((flag & 8) && data_length >= 17) {
  ------------------
  |  Branch (2602:7): [True: 12, False: 0]
  |  Branch (2602:21): [True: 10, False: 2]
  ------------------
 2603|       |			/* Attribute change time. */
 2604|     10|			if (isodate17_valid(data)) {
  ------------------
  |  Branch (2604:8): [True: 0, False: 10]
  ------------------
 2605|      0|				file->time_is_set |= CTIME_IS_SET;
  ------------------
  |  |  314|      0|#define CTIME_IS_SET 8
  ------------------
 2606|      0|				file->ctime = isodate17(data);
 2607|      0|			}
 2608|     10|		}
 2609|     12|	} else {
 2610|       |		/* Use 7-byte time format. */
 2611|      8|		if ((flag & 1) && data_length >= 7) {
  ------------------
  |  Branch (2611:7): [True: 5, False: 3]
  |  Branch (2611:21): [True: 5, False: 0]
  ------------------
 2612|       |			/* Create time. */
 2613|      5|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2613:8): [True: 1, False: 4]
  ------------------
 2614|      1|				file->time_is_set |= BIRTHTIME_IS_SET;
  ------------------
  |  |  311|      1|#define BIRTHTIME_IS_SET 1
  ------------------
 2615|      1|				file->birthtime = isodate7(data);
 2616|      1|			}
 2617|      5|			data += 7;
 2618|      5|			data_length -= 7;
 2619|      5|		}
 2620|      8|		if ((flag & 2) && data_length >= 7) {
  ------------------
  |  Branch (2620:7): [True: 5, False: 3]
  |  Branch (2620:21): [True: 5, False: 0]
  ------------------
 2621|       |			/* Modify time. */
 2622|      5|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2622:8): [True: 0, False: 5]
  ------------------
 2623|      0|				file->time_is_set |= MTIME_IS_SET;
  ------------------
  |  |  312|      0|#define MTIME_IS_SET 2
  ------------------
 2624|      0|				file->mtime = isodate7(data);
 2625|      0|			}
 2626|      5|			data += 7;
 2627|      5|			data_length -= 7;
 2628|      5|		}
 2629|      8|		if ((flag & 4) && data_length >= 7) {
  ------------------
  |  Branch (2629:7): [True: 7, False: 1]
  |  Branch (2629:21): [True: 7, False: 0]
  ------------------
 2630|       |			/* Access time. */
 2631|      7|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2631:8): [True: 0, False: 7]
  ------------------
 2632|      0|				file->time_is_set |= ATIME_IS_SET;
  ------------------
  |  |  313|      0|#define ATIME_IS_SET 4
  ------------------
 2633|      0|				file->atime = isodate7(data);
 2634|      0|			}
 2635|      7|			data += 7;
 2636|      7|			data_length -= 7;
 2637|      7|		}
 2638|      8|		if ((flag & 8) && data_length >= 7) {
  ------------------
  |  Branch (2638:7): [True: 7, False: 1]
  |  Branch (2638:21): [True: 7, False: 0]
  ------------------
 2639|       |			/* Attribute change time. */
 2640|      7|			if (isodate7_valid(data)) {
  ------------------
  |  Branch (2640:8): [True: 1, False: 6]
  ------------------
 2641|      1|				file->time_is_set |= CTIME_IS_SET;
  ------------------
  |  |  314|      1|#define CTIME_IS_SET 8
  ------------------
 2642|      1|				file->ctime = isodate7(data);
 2643|      1|			}
 2644|      7|		}
 2645|      8|	}
 2646|     20|}
archive_read_support_format_iso9660.c:isodate17_valid:
 3327|     44|{
 3328|       |	/* First 16 bytes are all ASCII digits */
 3329|    219|	for (int i = 0; i < 16; i++) {
  ------------------
  |  Branch (3329:18): [True: 214, False: 5]
  ------------------
 3330|    214|		if (v[i] < '0' || v[i] > '9')
  ------------------
  |  Branch (3330:7): [True: 10, False: 204]
  |  Branch (3330:21): [True: 29, False: 175]
  ------------------
 3331|     39|			return 0;
 3332|    214|	}
 3333|       |
 3334|      5|	int year = (v[0] - '0') * 1000 + (v[1] - '0') * 100
 3335|      5|		+ (v[2] - '0') * 10 + (v[3] - '0');
 3336|      5|	int month = (v[4] - '0') * 10 + (v[5] - '0');
 3337|      5|	int day = (v[6] - '0') * 10 + (v[7] - '0');
 3338|      5|	int hour = (v[8] - '0') * 10 + (v[9] - '0');
 3339|      5|	int minute = (v[10] - '0') * 10 + (v[11] - '0');
 3340|      5|	int second = (v[12] - '0') * 10 + (v[13] - '0');
 3341|      5|	int hundredths = (v[14] - '0') * 10 + (v[15] - '0');
 3342|      5|	int gmt_off = (signed char)v[16];
 3343|       |
 3344|      5|	if (year == 0 && month == 0 && day == 0
  ------------------
  |  Branch (3344:6): [True: 2, False: 3]
  |  Branch (3344:19): [True: 2, False: 0]
  |  Branch (3344:33): [True: 2, False: 0]
  ------------------
 3345|      2|	    && hour == 0 && minute == 0 && second == 0
  ------------------
  |  Branch (3345:9): [True: 2, False: 0]
  |  Branch (3345:22): [True: 2, False: 0]
  |  Branch (3345:37): [True: 2, False: 0]
  ------------------
 3346|      2|	    && hundredths == 0 && gmt_off == 0)
  ------------------
  |  Branch (3346:9): [True: 2, False: 0]
  |  Branch (3346:28): [True: 0, False: 2]
  ------------------
 3347|      0|		return 0;
 3348|       |	/*
 3349|       |	 * Sanity-test each individual field
 3350|       |	 */
 3351|       |
 3352|       |	/* Year must be 1900-2300 */
 3353|       |	/* (Not specified in ECMA-119, but these seem
 3354|       |	   like reasonable limits. */
 3355|      5|	if (year < 1900 || year > 2300)
  ------------------
  |  Branch (3355:6): [True: 2, False: 3]
  |  Branch (3355:21): [True: 1, False: 2]
  ------------------
 3356|      3|		return 0;
 3357|       |	/* Month must be 1-12 */
 3358|      2|	if (month < 1 || month > 12)
  ------------------
  |  Branch (3358:6): [True: 0, False: 2]
  |  Branch (3358:19): [True: 1, False: 1]
  ------------------
 3359|      1|		return 0;
 3360|       |	/* Day must be 1-31 */
 3361|      1|	if (day < 1 || day > 31)
  ------------------
  |  Branch (3361:6): [True: 0, False: 1]
  |  Branch (3361:17): [True: 0, False: 1]
  ------------------
 3362|      0|		return 0;
 3363|       |	/* Hour must be 0-23 */
 3364|      1|	if (hour > 23)
  ------------------
  |  Branch (3364:6): [True: 0, False: 1]
  ------------------
 3365|      0|		return 0;
 3366|       |	/* Minute must be 0-59 */
 3367|      1|	if (minute > 59)
  ------------------
  |  Branch (3367:6): [True: 0, False: 1]
  ------------------
 3368|      0|		return 0;
 3369|       |	/* second must be 0-59 according to ECMA-119 9.1.5 */
 3370|       |	/* BUT: we should probably allow for the time being in UTC, which
 3371|       |	   allows up to 61 seconds in a minute in certain cases */
 3372|      1|	if (second > 61)
  ------------------
  |  Branch (3372:6): [True: 0, False: 1]
  ------------------
 3373|      0|		return 0;
 3374|       |	/* Hundredths must be 0-99 */
 3375|      1|	if (hundredths > 99)
  ------------------
  |  Branch (3375:6): [True: 0, False: 1]
  ------------------
 3376|      0|		return 0;
 3377|       |	/* Offset from GMT must be -48 to +52 */
 3378|      1|	if (gmt_off < -48 || gmt_off > +52)
  ------------------
  |  Branch (3378:6): [True: 1, False: 0]
  |  Branch (3378:23): [True: 0, False: 0]
  ------------------
 3379|      1|		return 0;
 3380|       |
 3381|       |	/* All tests pass, this is OK */
 3382|      0|	return 1;
 3383|       |
 3384|      1|}
archive_read_support_format_iso9660.c:register_file:
 2758|    862|{
 2759|       |
 2760|    862|	file->use_next = iso9660->use_files;
 2761|    862|	iso9660->use_files = file;
 2762|    862|}
archive_read_support_format_iso9660.c:heap_add_entry:
 3117|    768|{
 3118|    768|	uint64_t file_key, parent_key;
 3119|    768|	size_t hole, parent;
 3120|       |
 3121|       |	/* Reserve 16 bits for possible key collisions (needed for linked items) */
 3122|       |	/* For ISO files with more than 65535 entries, reordering will still occur */
 3123|    768|	key <<= 16;
 3124|    768|	key += heap->used & 0xFFFF;
 3125|       |
 3126|       |	/* Expand our pending files list as necessary. */
 3127|    768|	if (heap->used >= heap->allocated) {
  ------------------
  |  Branch (3127:6): [True: 109, False: 659]
  ------------------
 3128|    109|		struct file_info **new_pending_files;
 3129|    109|		size_t new_size;
 3130|       |
 3131|    109|		if (heap->allocated < 1024)
  ------------------
  |  Branch (3131:7): [True: 109, False: 0]
  ------------------
 3132|    109|			new_size = 1024;
 3133|      0|		else if (archive_ckd_mul_size(&new_size, heap->allocated, 2)) {
  ------------------
  |  Branch (3133:12): [True: 0, False: 0]
  ------------------
 3134|       |			/* Overflow keeps us from growing the list. */
 3135|      0|			archive_set_error(&a->archive,
 3136|      0|			    ENOMEM, "Out of memory");
 3137|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3138|      0|		}
 3139|    109|		new_pending_files = (struct file_info **)
 3140|    109|		    calloc(new_size, sizeof(new_pending_files[0]));
 3141|    109|		if (new_pending_files == NULL) {
  ------------------
  |  Branch (3141:7): [True: 0, False: 109]
  ------------------
 3142|      0|			archive_set_error(&a->archive,
 3143|      0|			    ENOMEM, "Out of memory");
 3144|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3145|      0|		}
 3146|    109|		if (heap->allocated)
  ------------------
  |  Branch (3146:7): [True: 0, False: 109]
  ------------------
 3147|      0|			memcpy(new_pending_files, heap->files,
 3148|      0|			    heap->allocated * sizeof(new_pending_files[0]));
 3149|    109|		free(heap->files);
 3150|    109|		heap->files = new_pending_files;
 3151|    109|		heap->allocated = new_size;
 3152|    109|	}
 3153|       |
 3154|    768|	file_key = file->key = key;
 3155|       |
 3156|       |	/*
 3157|       |	 * Start with hole at end, walk it up tree to find insertion point.
 3158|       |	 */
 3159|    768|	hole = heap->used++;
 3160|  1.13k|	while (hole > 0) {
  ------------------
  |  Branch (3160:9): [True: 853, False: 283]
  ------------------
 3161|    853|		parent = (hole - 1) / 2;
 3162|    853|		parent_key = heap->files[parent]->key;
 3163|    853|		if (file_key >= parent_key) {
  ------------------
  |  Branch (3163:7): [True: 485, False: 368]
  ------------------
 3164|    485|			heap->files[hole] = file;
 3165|    485|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    485|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3166|    485|		}
 3167|       |		/* Move parent into hole <==> move hole up tree. */
 3168|    368|		heap->files[hole] = heap->files[parent];
 3169|    368|		hole = parent;
 3170|    368|	}
 3171|    283|	heap->files[0] = file;
 3172|       |
 3173|    283|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    283|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3174|    768|}
archive_read_support_format_iso9660.c:next_entry_seek:
 2791|    689|{
 2792|    689|	struct file_info *file;
 2793|    689|	int r;
 2794|       |
 2795|    689|	r = next_cache_entry(a, iso9660, pfile);
 2796|    689|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    689|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2796:6): [True: 138, False: 551]
  ------------------
 2797|    138|		return (r);
 2798|    551|	file = *pfile;
 2799|       |
 2800|       |	/* Don't waste time seeking for zero-length bodies. */
 2801|    551|	if (file->size == 0)
  ------------------
  |  Branch (2801:6): [True: 170, False: 381]
  ------------------
 2802|    170|		file->offset = iso9660->current_position;
 2803|       |
 2804|       |	/* flush any remaining bytes from the last round to ensure
 2805|       |	 * we're positioned */
 2806|    551|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (2806:6): [True: 0, False: 551]
  ------------------
 2807|      0|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 2808|      0|		iso9660->entry_bytes_unconsumed = 0;
 2809|      0|	}
 2810|       |
 2811|       |	/* Seek forward to the start of the entry. */
 2812|    551|	if (iso9660->current_position < file->offset) {
  ------------------
  |  Branch (2812:6): [True: 36, False: 515]
  ------------------
 2813|     36|		int64_t step;
 2814|       |
 2815|     36|		step = file->offset - iso9660->current_position;
 2816|     36|		step = __archive_read_consume(a, step);
 2817|     36|		if (step < 0)
  ------------------
  |  Branch (2817:7): [True: 17, False: 19]
  ------------------
 2818|     17|			return ((int)step);
 2819|     19|		iso9660->current_position = file->offset;
 2820|     19|	}
 2821|       |
 2822|       |	/* We found body of file; handle it now. */
 2823|    534|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    534|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2824|    551|}
archive_read_support_format_iso9660.c:next_cache_entry:
 2829|    689|{
 2830|    689|	struct file_info *file;
 2831|    689|	struct {
 2832|    689|		struct file_info	*first;
 2833|    689|		struct file_info	**last;
 2834|    689|	}	empty_files;
 2835|    689|	int64_t number;
 2836|    689|	int count;
 2837|       |
 2838|    689|	file = cache_get_entry(iso9660);
 2839|    689|	if (file != NULL) {
  ------------------
  |  Branch (2839:6): [True: 216, False: 473]
  ------------------
 2840|    216|		*pfile = file;
 2841|    216|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    216|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2842|    216|	}
 2843|       |
 2844|    473|	for (;;) {
 2845|    473|		struct file_info *re, *d;
 2846|       |
 2847|    473|		*pfile = file = next_entry(iso9660);
  ------------------
  |  |  453|    473|	heap_get_entry(&((iso9660)->pending_files))
  ------------------
 2848|    473|		if (file == NULL) {
  ------------------
  |  Branch (2848:7): [True: 58, False: 415]
  ------------------
 2849|       |			/*
 2850|       |			 * If directory entries all which are descendant of
 2851|       |			 * rr_moved are still remaining, expose their.
 2852|       |			 */
 2853|     58|			if (iso9660->re_files.first != NULL &&
  ------------------
  |  Branch (2853:8): [True: 0, False: 58]
  ------------------
 2854|      0|			    iso9660->rr_moved != NULL &&
  ------------------
  |  Branch (2854:8): [True: 0, False: 0]
  ------------------
 2855|      0|			    iso9660->rr_moved->rr_moved_has_re_only)
  ------------------
  |  Branch (2855:8): [True: 0, False: 0]
  ------------------
 2856|       |				/* Expose "rr_moved" entry. */
 2857|      0|				cache_add_entry(iso9660, iso9660->rr_moved);
 2858|     58|			while ((re = re_get_entry(iso9660)) != NULL) {
  ------------------
  |  Branch (2858:11): [True: 0, False: 58]
  ------------------
 2859|       |				/* Expose its descendant dirs. */
 2860|      0|				while ((d = rede_get_entry(re)) != NULL)
  ------------------
  |  Branch (2860:12): [True: 0, False: 0]
  ------------------
 2861|      0|					cache_add_entry(iso9660, d);
 2862|      0|			}
 2863|     58|			if (iso9660->cache_files.first != NULL)
  ------------------
  |  Branch (2863:8): [True: 0, False: 58]
  ------------------
 2864|      0|				return (next_cache_entry(a, iso9660, pfile));
 2865|     58|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|     58|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2866|     58|		}
 2867|       |
 2868|    415|		if (file->cl_offset) {
  ------------------
  |  Branch (2868:7): [True: 0, False: 415]
  ------------------
 2869|      0|			struct file_info *first_re = NULL;
 2870|      0|			int nexted_re = 0;
 2871|       |
 2872|       |			/*
 2873|       |			 * Find "RE" dir for the current file, which
 2874|       |			 * has "CL" flag.
 2875|       |			 */
 2876|      0|			while ((re = re_get_entry(iso9660))
  ------------------
  |  Branch (2876:11): [True: 0, False: 0]
  ------------------
 2877|      0|			    != first_re) {
 2878|      0|				if (first_re == NULL)
  ------------------
  |  Branch (2878:9): [True: 0, False: 0]
  ------------------
 2879|      0|					first_re = re;
 2880|      0|				if (re->offset == file->cl_offset) {
  ------------------
  |  Branch (2880:9): [True: 0, False: 0]
  ------------------
 2881|      0|					re->parent->subdirs--;
 2882|      0|					re->parent = file->parent;
 2883|      0|					re->re = 0;
 2884|      0|					if (re->parent->re_descendant) {
  ------------------
  |  Branch (2884:10): [True: 0, False: 0]
  ------------------
 2885|      0|						nexted_re = 1;
 2886|      0|						re->re_descendant = 1;
 2887|      0|						if (rede_add_entry(re) < 0)
  ------------------
  |  Branch (2887:11): [True: 0, False: 0]
  ------------------
 2888|      0|							goto fatal_rr;
 2889|       |						/* Move a list of descendants
 2890|       |						 * to a new ancestor. */
 2891|      0|						while ((d = rede_get_entry(
  ------------------
  |  Branch (2891:14): [True: 0, False: 0]
  ------------------
 2892|      0|						    re)) != NULL)
 2893|      0|							if (rede_add_entry(d)
  ------------------
  |  Branch (2893:12): [True: 0, False: 0]
  ------------------
 2894|      0|							    < 0)
 2895|      0|								goto fatal_rr;
 2896|      0|						break;
 2897|      0|					}
 2898|       |					/* Replace the current file
 2899|       |					 * with "RE" dir */
 2900|      0|					*pfile = file = re;
 2901|       |					/* Expose its descendant */
 2902|      0|					while ((d = rede_get_entry(
  ------------------
  |  Branch (2902:13): [True: 0, False: 0]
  ------------------
 2903|      0|					    file)) != NULL)
 2904|      0|						cache_add_entry(
 2905|      0|						    iso9660, d);
 2906|      0|					break;
 2907|      0|				} else
 2908|      0|					re_add_entry(iso9660, re);
 2909|      0|			}
 2910|      0|			if (nexted_re) {
  ------------------
  |  Branch (2910:8): [True: 0, False: 0]
  ------------------
 2911|       |				/*
 2912|       |				 * Do not expose this at this time
 2913|       |				 * because we have not gotten its full-path
 2914|       |				 * name yet.
 2915|       |				 */
 2916|      0|				continue;
 2917|      0|			}
 2918|    415|		} else if ((file->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  215|    415|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              		} else if ((file->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  221|    415|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (2918:14): [True: 216, False: 199]
  ------------------
 2919|    216|			int r;
 2920|       |
 2921|       |			/* Read file entries in this dir. */
 2922|    216|			r = read_children(a, file);
 2923|    216|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    216|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2923:8): [True: 80, False: 136]
  ------------------
 2924|     80|				return (r);
 2925|       |
 2926|       |			/*
 2927|       |			 * Handle a special dir of Rockridge extensions,
 2928|       |			 * "rr_moved".
 2929|       |			 */
 2930|    136|			if (file->rr_moved) {
  ------------------
  |  Branch (2930:8): [True: 0, False: 136]
  ------------------
 2931|       |				/*
 2932|       |				 * If this has only the subdirectories which
 2933|       |				 * have "RE" flags, do not expose at this time.
 2934|       |				 */
 2935|      0|				if (file->rr_moved_has_re_only)
  ------------------
  |  Branch (2935:9): [True: 0, False: 0]
  ------------------
 2936|      0|					continue;
 2937|       |				/* Otherwise expose "rr_moved" entry. */
 2938|    136|			} else if (file->re) {
  ------------------
  |  Branch (2938:15): [True: 0, False: 136]
  ------------------
 2939|       |				/*
 2940|       |				 * Do not expose this at this time
 2941|       |				 * because we have not gotten its full-path
 2942|       |				 * name yet.
 2943|       |				 */
 2944|      0|				re_add_entry(iso9660, file);
 2945|      0|				continue;
 2946|    136|			} else if (file->re_descendant) {
  ------------------
  |  Branch (2946:15): [True: 0, False: 136]
  ------------------
 2947|       |				/*
 2948|       |				 * If the top level "RE" entry of this entry
 2949|       |				 * is not exposed, we, accordingly, should not
 2950|       |				 * expose this entry at this time because
 2951|       |				 * we cannot make its proper full-path name.
 2952|       |				 */
 2953|      0|				if (rede_add_entry(file) == 0)
  ------------------
  |  Branch (2953:9): [True: 0, False: 0]
  ------------------
 2954|      0|					continue;
 2955|       |				/* Otherwise we can expose this entry because
 2956|       |				 * it seems its top level "RE" has already been
 2957|       |				 * exposed. */
 2958|      0|			}
 2959|    136|		}
 2960|    335|		break;
 2961|    415|	}
 2962|       |
 2963|    335|	if ((file->mode & AE_IFMT) != AE_IFREG || file->number == -1)
  ------------------
  |  |  215|    335|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((file->mode & AE_IFMT) != AE_IFREG || file->number == -1)
  ------------------
  |  |  216|    670|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (2963:6): [True: 136, False: 199]
  |  Branch (2963:44): [True: 27, False: 172]
  ------------------
 2964|    163|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    163|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2965|       |
 2966|    172|	count = 0;
 2967|    172|	number = file->number;
 2968|    172|	iso9660->cache_files.first = NULL;
 2969|    172|	iso9660->cache_files.last = &(iso9660->cache_files.first);
 2970|    172|	empty_files.first = NULL;
 2971|    172|	empty_files.last = &empty_files.first;
 2972|       |	/* Collect files which has the same file serial number.
 2973|       |	 * Peek pending_files so that file which number is different
 2974|       |	 * is not put back. */
 2975|    422|	while (iso9660->pending_files.used > 0 &&
  ------------------
  |  Branch (2975:9): [True: 360, False: 62]
  ------------------
 2976|    360|	    (iso9660->pending_files.files[0]->number == -1 ||
  ------------------
  |  Branch (2976:7): [True: 110, False: 250]
  ------------------
 2977|    250|	     iso9660->pending_files.files[0]->number == number)) {
  ------------------
  |  Branch (2977:7): [True: 140, False: 110]
  ------------------
 2978|    250|		if (file->number == -1) {
  ------------------
  |  Branch (2978:7): [True: 82, False: 168]
  ------------------
 2979|       |			/* This file has the same offset
 2980|       |			 * but it's wrong offset which empty files
 2981|       |			 * and symlink files have.
 2982|       |			 * NOTE: This wrong offset was recorded by
 2983|       |			 * old mkisofs utility. If ISO images is
 2984|       |			 * created by latest mkisofs, this does not
 2985|       |			 * happen.
 2986|       |			 */
 2987|     82|			file->next = NULL;
 2988|     82|			*empty_files.last = file;
 2989|     82|			empty_files.last = &(file->next);
 2990|    168|		} else {
 2991|    168|			count++;
 2992|    168|			cache_add_entry(iso9660, file);
 2993|    168|		}
 2994|    250|		file = next_entry(iso9660);
  ------------------
  |  |  453|    250|	heap_get_entry(&((iso9660)->pending_files))
  ------------------
 2995|    250|	}
 2996|       |
 2997|    172|	if (count == 0) {
  ------------------
  |  Branch (2997:6): [True: 89, False: 83]
  ------------------
 2998|     89|		*pfile = file;
 2999|     89|		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|     89|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2999:11): [True: 0, False: 89]
  ------------------
 3000|     89|	}
 3001|     83|	if (file->number == -1) {
  ------------------
  |  Branch (3001:6): [True: 28, False: 55]
  ------------------
 3002|     28|		file->next = NULL;
 3003|     28|		*empty_files.last = file;
 3004|     28|		empty_files.last = &(file->next);
 3005|     55|	} else {
 3006|     55|		count++;
 3007|     55|		cache_add_entry(iso9660, file);
 3008|     55|	}
 3009|       |
 3010|     83|	if (count > 1) {
  ------------------
  |  Branch (3010:6): [True: 65, False: 18]
  ------------------
 3011|       |		/* The count is the same as number of hardlink,
 3012|       |		 * so much so that each nlinks of files in cache_file
 3013|       |		 * is overwritten by value of the count.
 3014|       |		 */
 3015|     65|		for (file = iso9660->cache_files.first;
 3016|    270|		    file != NULL; file = file->next)
  ------------------
  |  Branch (3016:7): [True: 205, False: 65]
  ------------------
 3017|    205|			file->nlinks = count;
 3018|     65|	}
 3019|       |	/* If there are empty files, that files are added
 3020|       |	 * to the tail of the cache_files. */
 3021|     83|	if (empty_files.first != NULL) {
  ------------------
  |  Branch (3021:6): [True: 28, False: 55]
  ------------------
 3022|     28|		*iso9660->cache_files.last = empty_files.first;
 3023|     28|		iso9660->cache_files.last = empty_files.last;
 3024|     28|	}
 3025|     83|	*pfile = cache_get_entry(iso9660);
 3026|     83|	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|     83|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3026:10): [True: 0, False: 83]
  ------------------
 3027|       |
 3028|      0|fatal_rr:
 3029|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3030|      0|	    "Failed to connect 'CL' pointer to 'RE' rr_moved pointer of "
 3031|      0|	    "Rockridge extensions: current position = %jd, CL offset = %jd",
 3032|      0|	    (intmax_t)iso9660->current_position, (intmax_t)file->cl_offset);
 3033|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3034|    172|}
archive_read_support_format_iso9660.c:cache_get_entry:
 3102|    772|{
 3103|    772|	struct file_info *file;
 3104|       |
 3105|    772|	if ((file = iso9660->cache_files.first) != NULL) {
  ------------------
  |  Branch (3105:6): [True: 299, False: 473]
  ------------------
 3106|    299|		iso9660->cache_files.first = file->next;
 3107|    299|		if (iso9660->cache_files.first == NULL)
  ------------------
  |  Branch (3107:7): [True: 64, False: 235]
  ------------------
 3108|     64|			iso9660->cache_files.last =
 3109|     64|			    &(iso9660->cache_files.first);
 3110|    299|	}
 3111|    772|	return (file);
 3112|    772|}
archive_read_support_format_iso9660.c:heap_get_entry:
 3178|    723|{
 3179|    723|	uint64_t a_key, b_key, c_key;
 3180|    723|	size_t a, b, c;
 3181|    723|	struct file_info *r, *tmp;
 3182|       |
 3183|    723|	if (heap->used < 1)
  ------------------
  |  Branch (3183:6): [True: 58, False: 665]
  ------------------
 3184|     58|		return (NULL);
 3185|       |
 3186|       |	/*
 3187|       |	 * The first file in the list is the earliest; we'll return this.
 3188|       |	 */
 3189|    665|	r = heap->files[0];
 3190|       |
 3191|       |	/*
 3192|       |	 * Move the last item in the heap to the root of the tree
 3193|       |	 */
 3194|    665|	heap->files[0] = heap->files[--(heap->used)];
 3195|       |
 3196|       |	/*
 3197|       |	 * Rebalance the heap.
 3198|       |	 */
 3199|    665|	a = 0; /* Starting element and its heap key */
 3200|    665|	a_key = heap->files[a]->key;
 3201|  1.41k|	for (;;) {
 3202|  1.41k|		b = a + a + 1; /* First child */
 3203|  1.41k|		if (b >= heap->used)
  ------------------
  |  Branch (3203:7): [True: 554, False: 856]
  ------------------
 3204|    554|			return (r);
 3205|    856|		b_key = heap->files[b]->key;
 3206|    856|		c = b + 1; /* Use second child if it is smaller. */
 3207|    856|		if (c < heap->used) {
  ------------------
  |  Branch (3207:7): [True: 709, False: 147]
  ------------------
 3208|    709|			c_key = heap->files[c]->key;
 3209|    709|			if (c_key < b_key) {
  ------------------
  |  Branch (3209:8): [True: 288, False: 421]
  ------------------
 3210|    288|				b = c;
 3211|    288|				b_key = c_key;
 3212|    288|			}
 3213|    709|		}
 3214|    856|		if (a_key <= b_key)
  ------------------
  |  Branch (3214:7): [True: 111, False: 745]
  ------------------
 3215|    111|			return (r);
 3216|    745|		tmp = heap->files[a];
 3217|    745|		heap->files[a] = heap->files[b];
 3218|    745|		heap->files[b] = tmp;
 3219|    745|		a = b;
 3220|    745|	}
 3221|    665|}
archive_read_support_format_iso9660.c:cache_add_entry:
 3094|    223|{
 3095|       |	file->next = NULL;
 3096|    223|	*iso9660->cache_files.last = file;
 3097|    223|	iso9660->cache_files.last = &(file->next);
 3098|    223|}
archive_read_support_format_iso9660.c:re_get_entry:
 3046|     58|{
 3047|     58|	struct file_info *file;
 3048|       |
 3049|     58|	if ((file = iso9660->re_files.first) != NULL) {
  ------------------
  |  Branch (3049:6): [True: 0, False: 58]
  ------------------
 3050|      0|		iso9660->re_files.first = file->re_next;
 3051|      0|		if (iso9660->re_files.first == NULL)
  ------------------
  |  Branch (3051:7): [True: 0, False: 0]
  ------------------
 3052|      0|			iso9660->re_files.last =
 3053|      0|			    &(iso9660->re_files.first);
 3054|      0|	}
 3055|     58|	return (file);
 3056|     58|}
archive_read_support_format_iso9660.c:read_children:
 1022|    216|{
 1023|    216|	struct iso9660 *iso9660 = a->format->data;
 1024|    216|	const unsigned char *b, *p;
 1025|    216|	struct file_info *multi;
 1026|    216|	size_t step, skip_size;
 1027|       |
 1028|       |	/* flush any remaining bytes from the last round to ensure
 1029|       |	 * we're positioned */
 1030|    216|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (1030:6): [True: 0, False: 216]
  ------------------
 1031|      0|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 1032|      0|		iso9660->entry_bytes_unconsumed = 0;
 1033|      0|	}
 1034|    216|	if (iso9660->current_position > parent->offset) {
  ------------------
  |  Branch (1034:6): [True: 19, False: 197]
  ------------------
 1035|     19|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     19|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1036|     19|		    "Ignoring out-of-order directory (%s) %jd > %jd",
 1037|     19|		    parent->name.s,
 1038|     19|		    (intmax_t)iso9660->current_position,
 1039|     19|		    (intmax_t)parent->offset);
 1040|     19|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|     19|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1041|     19|	}
 1042|    197|	if (parent->offset + parent->size > iso9660->volume_size) {
  ------------------
  |  Branch (1042:6): [True: 35, False: 162]
  ------------------
 1043|     35|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     35|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1044|     35|		    "Directory is beyond end-of-media: %s",
 1045|     35|		    parent->name.s);
 1046|     35|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|     35|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1047|     35|	}
 1048|    162|	if (iso9660->current_position < parent->offset) {
  ------------------
  |  Branch (1048:6): [True: 77, False: 85]
  ------------------
 1049|     77|		int64_t skipsize;
 1050|       |
 1051|     77|		skipsize = parent->offset - iso9660->current_position;
 1052|     77|		skipsize = __archive_read_consume(a, skipsize);
 1053|     77|		if (skipsize < 0)
  ------------------
  |  Branch (1053:7): [True: 6, False: 71]
  ------------------
 1054|      6|			return ((int)skipsize);
 1055|     71|		iso9660->current_position = parent->offset;
 1056|     71|	}
 1057|       |
 1058|    156|	step = (size_t)(((parent->size + iso9660->logical_block_size -1) /
 1059|    156|	    iso9660->logical_block_size) * iso9660->logical_block_size);
 1060|    156|	b = __archive_read_ahead(a, step, NULL);
 1061|    156|	if (b == NULL) {
  ------------------
  |  Branch (1061:6): [True: 2, False: 154]
  ------------------
 1062|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1063|      2|		    "Failed to read full block when scanning "
 1064|      2|		    "ISO9660 directory list");
 1065|      2|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1066|      2|	}
 1067|    154|	iso9660->current_position += step;
 1068|    154|	multi = NULL;
 1069|    154|	skip_size = step;
 1070|    512|	while (step) {
  ------------------
  |  Branch (1070:9): [True: 376, False: 136]
  ------------------
 1071|    376|		p = b;
 1072|    376|		b += iso9660->logical_block_size;
 1073|    376|		step -= iso9660->logical_block_size;
 1074|   210k|		for (; p < b && b - p > DR_name_offset && *p != 0 && *p <= b - p;
  ------------------
  |  |  216|   421k|#define DR_name_offset 33
  ------------------
  |  Branch (1074:10): [True: 210k, False: 0]
  |  Branch (1074:19): [True: 210k, False: 102]
  |  Branch (1074:45): [True: 210k, False: 256]
  |  Branch (1074:56): [True: 210k, False: 0]
  ------------------
 1075|   210k|			p += *p) {
 1076|   210k|			struct file_info *child;
 1077|       |
 1078|       |			/* N.B.: these special directory identifiers
 1079|       |			 * are 8 bit "values" even on a
 1080|       |			 * Joliet CD with UCS-2 (16bit) encoding.
 1081|       |			 */
 1082|       |
 1083|       |			/* Skip '.' entry. */
 1084|   210k|			if (*(p + DR_name_len_offset) == 1
  ------------------
  |  |  214|   210k|#define DR_name_len_offset 32
  ------------------
  |  Branch (1084:8): [True: 209k, False: 664]
  ------------------
 1085|   209k|			    && *(p + DR_name_offset) == '\0')
  ------------------
  |  |  216|   209k|#define DR_name_offset 33
  ------------------
  |  Branch (1085:11): [True: 82, False: 209k]
  ------------------
 1086|     82|				continue;
 1087|       |			/* Skip '..' entry. */
 1088|   210k|			if (*(p + DR_name_len_offset) == 1
  ------------------
  |  |  214|   210k|#define DR_name_len_offset 32
  ------------------
  |  Branch (1088:8): [True: 209k, False: 664]
  ------------------
 1089|   209k|			    && *(p + DR_name_offset) == '\001')
  ------------------
  |  |  216|   209k|#define DR_name_offset 33
  ------------------
  |  Branch (1089:11): [True: 209k, False: 90]
  ------------------
 1090|   209k|				continue;
 1091|    754|			child = parse_file_info(a, parent, p, b - p);
 1092|    754|			if (child == NULL) {
  ------------------
  |  Branch (1092:8): [True: 18, False: 736]
  ------------------
 1093|     18|				__archive_read_consume(a, skip_size);
 1094|     18|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     18|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1095|     18|			}
 1096|    736|			if (child->cl_offset == 0 &&
  ------------------
  |  Branch (1096:8): [True: 736, False: 0]
  ------------------
 1097|    736|			    (child->multi_extent || multi != NULL)) {
  ------------------
  |  Branch (1097:9): [True: 103, False: 633]
  |  Branch (1097:32): [True: 44, False: 589]
  ------------------
 1098|    147|				struct content *con;
 1099|       |
 1100|    147|				if (multi == NULL) {
  ------------------
  |  Branch (1100:9): [True: 70, False: 77]
  ------------------
 1101|     70|					multi = child;
 1102|     70|					multi->contents.first = NULL;
 1103|     70|					multi->contents.last =
 1104|     70|					    &(multi->contents.first);
 1105|     70|				}
 1106|    147|				con = malloc(sizeof(struct content));
 1107|    147|				if (con == NULL) {
  ------------------
  |  Branch (1107:9): [True: 0, False: 147]
  ------------------
 1108|      0|					archive_set_error(
 1109|      0|					    &a->archive, ENOMEM,
 1110|      0|					    "No memory for multi extent");
 1111|      0|					__archive_read_consume(a, skip_size);
 1112|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1113|      0|				}
 1114|    147|				con->offset = child->offset;
 1115|    147|				con->size = child->size;
 1116|    147|				con->next = NULL;
 1117|    147|				*multi->contents.last = con;
 1118|    147|				multi->contents.last = &(con->next);
 1119|    147|				if (multi == child) {
  ------------------
  |  Branch (1119:9): [True: 70, False: 77]
  ------------------
 1120|     70|					if (add_entry(a, iso9660, child)
  ------------------
  |  |  451|     70|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
  |  Branch (1120:10): [True: 0, False: 70]
  ------------------
 1121|     70|					    != ARCHIVE_OK)
  ------------------
  |  |  233|     70|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1122|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1123|     77|				} else {
 1124|     77|					multi->size += child->size;
 1125|     77|					if (!child->multi_extent)
  ------------------
  |  Branch (1125:10): [True: 44, False: 33]
  ------------------
 1126|     44|						multi = NULL;
 1127|     77|				}
 1128|    147|			} else
 1129|    589|				if (add_entry(a, iso9660, child) != ARCHIVE_OK)
  ------------------
  |  |  451|    589|	heap_add_entry(arch, &((iso9660)->pending_files), file, file->offset)
  ------------------
              				if (add_entry(a, iso9660, child) != ARCHIVE_OK)
  ------------------
  |  |  233|    589|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1129:9): [True: 0, False: 589]
  ------------------
 1130|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1131|    736|		}
 1132|    376|	}
 1133|       |
 1134|    136|	__archive_read_consume(a, skip_size);
 1135|       |
 1136|       |	/* Read data which recorded by RRIP "CE" extension. */
 1137|    136|	if (read_CE(a, iso9660) != ARCHIVE_OK)
  ------------------
  |  |  233|    136|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1137:6): [True: 0, False: 136]
  ------------------
 1138|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1139|       |
 1140|    136|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    136|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1141|    136|}
archive_read_support_format_iso9660.c:read_CE:
 2454|    136|{
 2455|    136|	struct read_ce_queue *heap;
 2456|    136|	const unsigned char *b, *p, *end;
 2457|    136|	struct file_info *file;
 2458|    136|	size_t step;
 2459|    136|	uint64_t ce_start, ce_end;
 2460|    136|	int r;
 2461|       |
 2462|       |	/* Read data which RRIP "CE" extension points. */
 2463|    136|	heap = &(iso9660->read_ce_req);
 2464|    136|	step = iso9660->logical_block_size;
 2465|    136|	while (heap->cnt &&
  ------------------
  |  Branch (2465:9): [True: 0, False: 136]
  ------------------
 2466|      0|	    heap->reqs[0].offset == iso9660->current_position) {
  ------------------
  |  Branch (2466:6): [True: 0, False: 0]
  ------------------
 2467|      0|		b = __archive_read_ahead(a, step, NULL);
 2468|      0|		if (b == NULL) {
  ------------------
  |  Branch (2468:7): [True: 0, False: 0]
  ------------------
 2469|      0|			archive_set_error(&a->archive,
 2470|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2471|      0|			    "Failed to read full block when scanning "
 2472|      0|			    "ISO9660 directory list");
 2473|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2474|      0|		}
 2475|      0|		do {
 2476|      0|			file = heap->reqs[0].file;
 2477|      0|			if (file->ce_offset + file->ce_size > step) {
  ------------------
  |  Branch (2477:8): [True: 0, False: 0]
  ------------------
 2478|      0|				archive_set_error(&a->archive,
 2479|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2480|      0|				    "Malformed CE information");
 2481|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2482|      0|			}
 2483|      0|			ce_start = heap->reqs[0].offset + file->ce_offset;
 2484|      0|			ce_end = ce_start + file->ce_size;
 2485|      0|			if (ce_start < file->ce_processed_end) {
  ------------------
  |  Branch (2485:8): [True: 0, False: 0]
  ------------------
 2486|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2487|      0|				    "Invalid parameter in SUSP \"CE\" extension");
 2488|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2489|      0|			}
 2490|      0|			p = b + file->ce_offset;
 2491|      0|			end = p + file->ce_size;
 2492|      0|			file->ce_processed_end = ce_end;
 2493|      0|			next_CE(heap);
 2494|      0|			r = parse_rockridge(a, file, p, end);
 2495|      0|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2495:8): [True: 0, False: 0]
  ------------------
 2496|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2497|      0|		} while (heap->cnt &&
  ------------------
  |  Branch (2497:12): [True: 0, False: 0]
  ------------------
 2498|      0|		    heap->reqs[0].offset == iso9660->current_position);
  ------------------
  |  Branch (2498:7): [True: 0, False: 0]
  ------------------
 2499|       |		/* NOTE: Do not move this consume's code to front of
 2500|       |		 * do-while loop. Registration of nested CE extension
 2501|       |		 * might cause error because of current position. */
 2502|      0|		__archive_read_consume(a, step);
 2503|      0|		iso9660->current_position += step;
 2504|      0|	}
 2505|    136|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    136|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2506|    136|}
archive_read_support_format_iso9660.c:build_pathname_utf16be:
 3463|     11|{
 3464|     11|	if (file->parent != NULL && file->parent->utf16be_bytes > 0) {
  ------------------
  |  Branch (3464:6): [True: 4, False: 7]
  |  Branch (3464:30): [True: 0, False: 4]
  ------------------
 3465|      0|		if (build_pathname_utf16be(p, max, len, file->parent) != 0)
  ------------------
  |  Branch (3465:7): [True: 0, False: 0]
  ------------------
 3466|      0|			return (-1);
 3467|      0|		if (*len + 2 > max)
  ------------------
  |  Branch (3467:7): [True: 0, False: 0]
  ------------------
 3468|      0|			return (-1);/* Path is too long! */
 3469|      0|		p[*len] = 0;
 3470|      0|		p[*len + 1] = '/';
 3471|      0|		*len += 2;
 3472|      0|	}
 3473|     11|	if (file->utf16be_bytes == 0) {
  ------------------
  |  Branch (3473:6): [True: 8, False: 3]
  ------------------
 3474|      8|		if (*len + 2 > max)
  ------------------
  |  Branch (3474:7): [True: 0, False: 8]
  ------------------
 3475|      0|			return (-1);/* Path is too long! */
 3476|      8|		p[*len] = 0;
 3477|      8|		p[*len + 1] = '.';
 3478|      8|		*len += 2;
 3479|      8|	} else {
 3480|      3|		if (*len + file->utf16be_bytes > max)
  ------------------
  |  Branch (3480:7): [True: 0, False: 3]
  ------------------
 3481|      0|			return (-1);/* Path is too long! */
 3482|      3|		memcpy(p + *len, file->utf16be_name, file->utf16be_bytes);
 3483|      3|		*len += file->utf16be_bytes;
 3484|      3|	}
 3485|     11|	return (0);
 3486|     11|}
archive_read_support_format_iso9660.c:build_pathname:
 3441|    675|{
 3442|       |	// Plain ISO9660 only allows 8 dir levels; if we get
 3443|       |	// to 1000, then something is very, very wrong.
 3444|    675|	if (depth > 1000) {
  ------------------
  |  Branch (3444:6): [True: 0, False: 675]
  ------------------
 3445|      0|		return NULL;
 3446|      0|	}
 3447|    675|	if (file->parent != NULL && archive_strlen(&file->parent->name) > 0) {
  ------------------
  |  |  178|    550|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (3447:6): [True: 550, False: 125]
  |  Branch (3447:30): [True: 152, False: 398]
  ------------------
 3448|    152|		if (build_pathname(as, file->parent, depth + 1) == NULL) {
  ------------------
  |  Branch (3448:7): [True: 0, False: 152]
  ------------------
 3449|      0|			return NULL;
 3450|      0|		}
 3451|    152|		archive_strcat(as, "/");
 3452|    152|	}
 3453|    675|	if (archive_strlen(&file->name) == 0)
  ------------------
  |  |  178|    675|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (3453:6): [True: 63, False: 612]
  ------------------
 3454|     63|		archive_strcat(as, ".");
 3455|    612|	else
 3456|    612|		archive_string_concat(as, &file->name);
 3457|    675|	return (as->s);
 3458|    675|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_data_skip:
 1472|    580|{
 1473|       |	/* Because read_next_header always does an explicit skip
 1474|       |	 * to the next entry, we don't need to do anything here. */
 1475|    580|	(void)a; /* UNUSED */
 1476|    580|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    580|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1477|    580|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_read_data:
 1722|    805|{
 1723|    805|	struct iso9660 *iso9660 = a->format->data;
 1724|    805|	ssize_t bytes_read;
 1725|       |
 1726|    805|	if (iso9660->entry_bytes_unconsumed) {
  ------------------
  |  Branch (1726:6): [True: 109, False: 696]
  ------------------
 1727|    109|		__archive_read_consume(a, iso9660->entry_bytes_unconsumed);
 1728|    109|		iso9660->entry_bytes_unconsumed = 0;
 1729|    109|	}
 1730|       |
 1731|    805|	if (iso9660->entry_bytes_remaining <= 0) {
  ------------------
  |  Branch (1731:6): [True: 699, False: 106]
  ------------------
 1732|    699|		if (iso9660->entry_content != NULL)
  ------------------
  |  Branch (1732:7): [True: 34, False: 665]
  ------------------
 1733|     34|			iso9660->entry_content = iso9660->entry_content->next;
 1734|    699|		if (iso9660->entry_content == NULL) {
  ------------------
  |  Branch (1734:7): [True: 681, False: 18]
  ------------------
 1735|    681|			*buff = NULL;
 1736|    681|			*size = 0;
 1737|    681|			*offset = iso9660->entry_sparse_offset;
 1738|    681|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|    681|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1739|    681|		}
 1740|       |		/* Seek forward to the start of the entry. */
 1741|     18|		if (iso9660->current_position < iso9660->entry_content->offset) {
  ------------------
  |  Branch (1741:7): [True: 11, False: 7]
  ------------------
 1742|     11|			int64_t step;
 1743|       |
 1744|     11|			step = iso9660->entry_content->offset -
 1745|     11|			    iso9660->current_position;
 1746|     11|			step = __archive_read_consume(a, step);
 1747|     11|			if (step < 0)
  ------------------
  |  Branch (1747:8): [True: 1, False: 10]
  ------------------
 1748|      1|				return ((int)step);
 1749|     10|			iso9660->current_position =
 1750|     10|			    iso9660->entry_content->offset;
 1751|     10|		}
 1752|     17|		if (iso9660->entry_content->offset < iso9660->current_position) {
  ------------------
  |  Branch (1752:7): [True: 7, False: 10]
  ------------------
 1753|      7|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      7|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1754|      7|			    "Ignoring out-of-order file (%s) %jd < %jd",
 1755|      7|			    iso9660->pathname.s,
 1756|      7|			    (intmax_t)iso9660->entry_content->offset,
 1757|      7|			    (intmax_t)iso9660->current_position);
 1758|      7|			*buff = NULL;
 1759|      7|			*size = 0;
 1760|      7|			*offset = iso9660->entry_sparse_offset;
 1761|      7|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      7|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1762|      7|		}
 1763|     10|		iso9660->entry_bytes_remaining = iso9660->entry_content->size;
 1764|     10|	}
 1765|    116|	if (iso9660->entry_zisofs.pz)
  ------------------
  |  Branch (1765:6): [True: 0, False: 116]
  ------------------
 1766|      0|		return (zisofs_read_data(a, buff, size, offset));
 1767|       |
 1768|    116|	*buff = __archive_read_ahead(a, 1, &bytes_read);
 1769|    116|	if (bytes_read == 0)
  ------------------
  |  Branch (1769:6): [True: 7, False: 109]
  ------------------
 1770|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      7|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1771|      7|		    "Truncated input file");
 1772|    116|	if (*buff == NULL)
  ------------------
  |  Branch (1772:6): [True: 7, False: 109]
  ------------------
 1773|      7|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1774|    109|	if (bytes_read > iso9660->entry_bytes_remaining)
  ------------------
  |  Branch (1774:6): [True: 102, False: 7]
  ------------------
 1775|    102|		bytes_read = (ssize_t)iso9660->entry_bytes_remaining;
 1776|    109|	*size = bytes_read;
 1777|    109|	*offset = iso9660->entry_sparse_offset;
 1778|    109|	iso9660->entry_sparse_offset += bytes_read;
 1779|    109|	iso9660->entry_bytes_remaining -= bytes_read;
 1780|    109|	iso9660->entry_bytes_unconsumed = bytes_read;
 1781|    109|	iso9660->current_position += bytes_read;
 1782|    109|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    109|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1783|    116|}
archive_read_support_format_iso9660.c:archive_read_format_iso9660_cleanup:
 1787|  16.7k|{
 1788|  16.7k|	struct iso9660 *iso9660 = a->format->data;
 1789|  16.7k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1790|       |
 1791|  16.7k|	release_files(iso9660);
 1792|  16.7k|	free(iso9660->read_ce_req.reqs);
 1793|  16.7k|	archive_string_free(&iso9660->pathname);
 1794|  16.7k|	archive_string_free(&iso9660->previous_pathname);
 1795|  16.7k|	free(iso9660->pending_files.files);
 1796|  16.7k|#ifdef HAVE_ZLIB_H
 1797|  16.7k|	free(iso9660->entry_zisofs.uncompressed_buffer);
 1798|  16.7k|	free(iso9660->entry_zisofs.block_pointers);
 1799|  16.7k|	if (iso9660->entry_zisofs.stream_valid) {
  ------------------
  |  Branch (1799:6): [True: 0, False: 16.7k]
  ------------------
 1800|      0|		if (inflateEnd(&iso9660->entry_zisofs.stream) != Z_OK) {
  ------------------
  |  Branch (1800:7): [True: 0, False: 0]
  ------------------
 1801|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1802|      0|			    "Failed to clean up zlib decompressor");
 1803|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1804|      0|		}
 1805|      0|	}
 1806|  16.7k|#endif
 1807|  16.7k|	free(iso9660->utf16be_path);
 1808|  16.7k|	free(iso9660->utf16be_previous_path);
 1809|  16.7k|	free(iso9660);
 1810|       |	a->format->data = NULL;
 1811|  16.7k|	return (r);
 1812|  16.7k|}
archive_read_support_format_iso9660.c:release_files:
 2766|  16.7k|{
 2767|  16.7k|	struct content *con, *connext;
 2768|  16.7k|	struct file_info *file;
 2769|       |
 2770|  16.7k|	file = iso9660->use_files;
 2771|  17.5k|	while (file != NULL) {
  ------------------
  |  Branch (2771:9): [True: 862, False: 16.7k]
  ------------------
 2772|    862|		struct file_info *next = file->use_next;
 2773|       |
 2774|    862|		archive_string_free(&file->name);
 2775|    862|		archive_string_free(&file->symlink);
 2776|    862|		free(file->utf16be_name);
 2777|    862|		con = file->contents.first;
 2778|  1.00k|		while (con != NULL) {
  ------------------
  |  Branch (2778:10): [True: 147, False: 862]
  ------------------
 2779|    147|			connext = con->next;
 2780|    147|			free(con);
 2781|    147|			con = connext;
 2782|    147|		}
 2783|    862|		free(file);
 2784|    862|		file = next;
 2785|    862|	}
 2786|  16.7k|}

archive_read_support_format_lha:
  259|  16.7k|{
  260|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
  261|  16.7k|	struct lha *lha;
  262|  16.7k|	int r;
  263|       |
  264|  16.7k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
  265|  16.7k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_lha");
  266|       |
  267|  16.7k|	lha = calloc(1, sizeof(*lha));
  268|  16.7k|	if (lha == NULL) {
  ------------------
  |  Branch (268:6): [True: 0, False: 16.7k]
  ------------------
  269|      0|		archive_set_error(_a, ENOMEM, "Can't allocate lha data");
  270|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  271|      0|	}
  272|  16.7k|	archive_string_init(&lha->ws);
  ------------------
  |  |   71|  16.7k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
  273|       |
  274|  16.7k|	r = __archive_read_register_format(a,
  275|  16.7k|	    lha,
  276|  16.7k|	    "lha",
  277|  16.7k|	    archive_read_format_lha_bid,
  278|  16.7k|	    archive_read_format_lha_options,
  279|  16.7k|	    archive_read_format_lha_read_header,
  280|  16.7k|	    archive_read_format_lha_read_data,
  281|  16.7k|	    archive_read_format_lha_read_data_skip,
  282|  16.7k|	    NULL,
  283|  16.7k|	    archive_read_format_lha_cleanup,
  284|  16.7k|	    NULL,
  285|  16.7k|	    NULL);
  286|       |
  287|  16.7k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (287:6): [True: 0, False: 16.7k]
  ------------------
  288|      0|		free(lha);
  289|  16.7k|	return (r);
  290|  16.7k|}
archive_read_support_format_lha.c:archive_read_format_lha_bid:
  346|  16.4k|{
  347|  16.4k|	const char *h;
  348|       |
  349|       |	/* If there's already a better bid than we can ever
  350|       |	   make, don't bother testing. */
  351|  16.4k|	if (best_bid > 30)
  ------------------
  |  Branch (351:6): [True: 806, False: 15.6k]
  ------------------
  352|    806|		return (-1);
  353|       |
  354|  15.6k|	if ((h = __archive_read_ahead(a, H_SIZE, NULL)) == NULL)
  ------------------
  |  |  211|  15.6k|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (354:6): [True: 85, False: 15.5k]
  ------------------
  355|     85|		return (-1);
  356|       |
  357|  15.5k|	if (lha_check_header_format(h) == 0)
  ------------------
  |  Branch (357:6): [True: 508, False: 15.0k]
  ------------------
  358|    508|		return (30);
  359|       |
  360|  15.0k|	if (h[0] == 'M' && h[1] == 'Z') {
  ------------------
  |  Branch (360:6): [True: 1.15k, False: 13.8k]
  |  Branch (360:21): [True: 608, False: 549]
  ------------------
  361|    608|		ssize_t offset, window;
  362|       |
  363|       |		/* PE file */
  364|    608|		offset = 0;
  365|    608|		window = 4096;
  366|  1.42k|		while (offset + window <= SFX_MAX_READAHEAD) {
  ------------------
  |  |  213|  1.42k|#define SFX_MAX_READAHEAD	(1024 * 24)
  ------------------
  |  Branch (366:10): [True: 1.35k, False: 71]
  ------------------
  367|  1.35k|			ssize_t bytes_avail;
  368|       |
  369|  1.35k|			h = __archive_read_ahead(a, offset + window,
  370|  1.35k|			    &bytes_avail);
  371|  1.35k|			if (h == NULL) {
  ------------------
  |  Branch (371:8): [True: 736, False: 618]
  ------------------
  372|    736|				if (bytes_avail >= offset + H_SIZE) {
  ------------------
  |  |  211|    736|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (372:9): [True: 454, False: 282]
  ------------------
  373|       |					/* Remaining bytes are less than window. */
  374|    454|					window = bytes_avail - offset;
  375|    454|					continue;
  376|    454|				}
  377|    282|				return (0);
  378|    736|			}
  379|    618|			if (bytes_avail > SFX_MAX_READAHEAD)
  ------------------
  |  |  213|    618|#define SFX_MAX_READAHEAD	(1024 * 24)
  ------------------
  |  Branch (379:8): [True: 74, False: 544]
  ------------------
  380|     74|				bytes_avail = SFX_MAX_READAHEAD;
  ------------------
  |  |  213|     74|#define SFX_MAX_READAHEAD	(1024 * 24)
  ------------------
  381|   556k|			while (offset <= bytes_avail - H_SIZE) {
  ------------------
  |  |  211|   556k|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (381:11): [True: 555k, False: 363]
  ------------------
  382|   555k|				size_t next = lha_check_header_format(h + offset);
  383|   555k|				if (next == 0)
  ------------------
  |  Branch (383:9): [True: 255, False: 555k]
  ------------------
  384|    255|					return (30);
  385|   555k|				offset += next;
  386|   555k|			}
  387|    618|		}
  388|    608|	}
  389|  14.4k|	return (0);
  390|  15.0k|}
archive_read_support_format_lha.c:lha_check_header_format:
  294|   590k|{
  295|   590k|	size_t next_skip_bytes;
  296|       |
  297|   590k|	switch (h[H_METHOD_OFFSET + 3]) {
  ------------------
  |  |  208|   590k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  298|       |	/*
  299|       |	 * "-lh0-" ... "-lh7-" "-lhd-"
  300|       |	 * "-lzs-" "-lz5-"
  301|       |	 */
  302|  35.5k|	case '0': case '1': case '2': case '3':
  ------------------
  |  Branch (302:2): [True: 19.2k, False: 571k]
  |  Branch (302:12): [True: 10.8k, False: 579k]
  |  Branch (302:22): [True: 2.96k, False: 587k]
  |  Branch (302:32): [True: 2.50k, False: 587k]
  ------------------
  303|  53.0k|	case '4': case '5': case '6': case '7':
  ------------------
  |  Branch (303:2): [True: 2.13k, False: 588k]
  |  Branch (303:12): [True: 8.21k, False: 582k]
  |  Branch (303:22): [True: 2.83k, False: 587k]
  |  Branch (303:32): [True: 4.38k, False: 585k]
  ------------------
  304|  95.1k|	case 'd':
  ------------------
  |  Branch (304:2): [True: 42.1k, False: 548k]
  ------------------
  305|   105k|	case 's':
  ------------------
  |  Branch (305:2): [True: 9.93k, False: 580k]
  ------------------
  306|   105k|		next_skip_bytes = 4;
  307|       |
  308|       |		/* 0 means the end of an LHa archive file. */
  309|   105k|		if (h[0] == 0)
  ------------------
  |  Branch (309:7): [True: 3.81k, False: 101k]
  ------------------
  310|  3.81k|			break;
  311|   101k|		if (h[H_METHOD_OFFSET] != '-' || h[H_METHOD_OFFSET + 1] != 'l'
  ------------------
  |  |  208|   101k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
              		if (h[H_METHOD_OFFSET] != '-' || h[H_METHOD_OFFSET + 1] != 'l'
  ------------------
  |  |  208|  15.7k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (311:7): [True: 85.5k, False: 15.7k]
  |  Branch (311:36): [True: 1.11k, False: 14.6k]
  ------------------
  312|  14.6k|		    ||  h[H_METHOD_OFFSET + 4] != '-')
  ------------------
  |  |  208|  14.6k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (312:11): [True: 653, False: 14.0k]
  ------------------
  313|  87.2k|			break;
  314|       |
  315|  14.0k|		if (h[H_METHOD_OFFSET + 2] == 'h') {
  ------------------
  |  |  208|  14.0k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (315:7): [True: 12.7k, False: 1.26k]
  ------------------
  316|       |			/* "-lh?-" */
  317|  12.7k|			if (h[H_METHOD_OFFSET + 3] == 's')
  ------------------
  |  |  208|  12.7k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (317:8): [True: 2.79k, False: 9.97k]
  ------------------
  318|  2.79k|				break;
  319|  9.97k|			if (h[H_LEVEL_OFFSET] == 0)
  ------------------
  |  |  210|  9.97k|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  |  Branch (319:8): [True: 410, False: 9.56k]
  ------------------
  320|    410|				return (0);
  321|  9.56k|			if (h[H_LEVEL_OFFSET] <= 3 && h[H_ATTR_OFFSET] == 0x20)
  ------------------
  |  |  210|  9.56k|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
              			if (h[H_LEVEL_OFFSET] <= 3 && h[H_ATTR_OFFSET] == 0x20)
  ------------------
  |  |  209|  7.03k|#define H_ATTR_OFFSET	19	/* DOS attribute. */
  ------------------
  |  Branch (321:8): [True: 7.03k, False: 2.52k]
  |  Branch (321:34): [True: 6.76k, False: 273]
  ------------------
  322|  6.76k|				return (0);
  323|  9.56k|		}
  324|  4.06k|		if (h[H_METHOD_OFFSET + 2] == 'z') {
  ------------------
  |  |  208|  4.06k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (324:7): [True: 961, False: 3.10k]
  ------------------
  325|       |			/* LArc extensions: -lzs-,-lz4- and -lz5- */
  326|    961|			if (h[H_LEVEL_OFFSET] != 0)
  ------------------
  |  |  210|    961|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  |  Branch (326:8): [True: 727, False: 234]
  ------------------
  327|    727|				break;
  328|    234|			if (h[H_METHOD_OFFSET + 3] == 's'
  ------------------
  |  |  208|    234|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (328:8): [True: 11, False: 223]
  ------------------
  329|    223|			    || h[H_METHOD_OFFSET + 3] == '4'
  ------------------
  |  |  208|    223|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (329:11): [True: 15, False: 208]
  ------------------
  330|    208|			    || h[H_METHOD_OFFSET + 3] == '5')
  ------------------
  |  |  208|    208|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  |  Branch (330:11): [True: 3, False: 205]
  ------------------
  331|     29|				return (0);
  332|    234|		}
  333|  3.31k|		break;
  334|  3.31k|	case 'h': next_skip_bytes = 1; break;
  ------------------
  |  Branch (334:2): [True: 2.85k, False: 587k]
  ------------------
  335|  4.61k|	case 'z': next_skip_bytes = 1; break;
  ------------------
  |  Branch (335:2): [True: 4.61k, False: 585k]
  ------------------
  336|  13.4k|	case 'l': next_skip_bytes = 2; break;
  ------------------
  |  Branch (336:2): [True: 13.4k, False: 576k]
  ------------------
  337|  2.40k|	case '-': next_skip_bytes = 3; break;
  ------------------
  |  Branch (337:2): [True: 2.40k, False: 587k]
  ------------------
  338|   461k|	default : next_skip_bytes = 4; break;
  ------------------
  |  Branch (338:2): [True: 461k, False: 128k]
  ------------------
  339|   590k|	}
  340|       |
  341|   583k|	return (next_skip_bytes);
  342|   590k|}
archive_read_support_format_lha.c:archive_read_format_lha_read_header:
  476|  6.39k|{
  477|  6.39k|	struct lha *lha = a->format->data;
  478|  6.39k|	struct archive_wstring linkname;
  479|  6.39k|	struct archive_wstring pathname;
  480|  6.39k|	const char *p;
  481|  6.39k|	const char *signature;
  482|  6.39k|	int err;
  483|  6.39k|	struct archive_mstring conv_buffer;
  484|  6.39k|	const wchar_t *conv_buffer_p;
  485|       |
  486|  6.39k|	a->archive.archive_format = ARCHIVE_FORMAT_LHA;
  ------------------
  |  |  382|  6.39k|#define	ARCHIVE_FORMAT_LHA			0xB0000
  ------------------
  487|  6.39k|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (487:6): [True: 743, False: 5.65k]
  ------------------
  488|    743|		a->archive.archive_format_name = "lha";
  489|       |
  490|  6.39k|	lha->decompress_init = 0;
  491|  6.39k|	lha->end_of_entry = 0;
  492|  6.39k|	lha->end_of_entry_cleanup = 0;
  493|  6.39k|	lha->entry_unconsumed = 0;
  494|       |
  495|  6.39k|	if ((p = __archive_read_ahead(a, H_SIZE, NULL)) == NULL) {
  ------------------
  |  |  211|  6.39k|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (495:6): [True: 106, False: 6.28k]
  ------------------
  496|       |		/*
  497|       |		 * LHa archiver added 0 to the tail of its archive file as
  498|       |		 * the mark of the end of the archive.
  499|       |		 */
  500|    106|		signature = __archive_read_ahead(a, sizeof(signature[0]), NULL);
  501|    106|		if (signature == NULL || signature[0] == 0)
  ------------------
  |  Branch (501:7): [True: 11, False: 95]
  |  Branch (501:28): [True: 8, False: 87]
  ------------------
  502|     19|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|     19|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  503|     87|		return (truncated_error(a));
  504|    106|	}
  505|       |
  506|  6.28k|	signature = p;
  507|  6.28k|	if (lha->found_first_header == 0 &&
  ------------------
  |  Branch (507:6): [True: 742, False: 5.54k]
  ------------------
  508|    742|	    signature[0] == 'M' && signature[1] == 'Z') {
  ------------------
  |  Branch (508:6): [True: 242, False: 500]
  |  Branch (508:29): [True: 235, False: 7]
  ------------------
  509|       |                /* This is an executable?  Must be self-extracting... 	*/
  510|    235|		err = lha_skip_sfx(a);
  511|    235|		if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|    235|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (511:7): [True: 0, False: 235]
  ------------------
  512|      0|			return (err);
  513|       |
  514|    235|		if ((p = __archive_read_ahead(a, sizeof(*p), NULL)) == NULL)
  ------------------
  |  Branch (514:7): [True: 0, False: 235]
  ------------------
  515|      0|			return (truncated_error(a));
  516|    235|		signature = p;
  517|    235|	}
  518|       |	/* signature[0] == 0 means the end of an LHa archive file. */
  519|  6.28k|	if (signature[0] == 0)
  ------------------
  |  Branch (519:6): [True: 16, False: 6.27k]
  ------------------
  520|     16|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|     16|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  521|       |
  522|       |	/*
  523|       |	 * Check the header format and method type.
  524|       |	 */
  525|  6.27k|	if (lha_check_header_format(p) != 0) {
  ------------------
  |  Branch (525:6): [True: 71, False: 6.20k]
  ------------------
  526|     71|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     71|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  527|     71|		    "Bad LHa file");
  528|     71|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     71|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  529|     71|	}
  530|       |
  531|       |	/* We've found the first header. */
  532|  6.20k|	lha->found_first_header = 1;
  533|       |	/* Set a default value and common data */
  534|  6.20k|	lha->header_size = 0;
  535|  6.20k|	lha->level = p[H_LEVEL_OFFSET];
  ------------------
  |  |  210|  6.20k|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  536|  6.20k|	lha->method[0] = p[H_METHOD_OFFSET+1];
  ------------------
  |  |  208|  6.20k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  537|  6.20k|	lha->method[1] = p[H_METHOD_OFFSET+2];
  ------------------
  |  |  208|  6.20k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  538|  6.20k|	lha->method[2] = p[H_METHOD_OFFSET+3];
  ------------------
  |  |  208|  6.20k|#define H_METHOD_OFFSET	2	/* Compress type. */
  ------------------
  539|  6.20k|	if (memcmp(lha->method, "lhd", 3) == 0)
  ------------------
  |  Branch (539:6): [True: 380, False: 5.82k]
  ------------------
  540|    380|		lha->directory = 1;
  541|  5.82k|	else
  542|  5.82k|		lha->directory = 0;
  543|  6.20k|	if (memcmp(lha->method, "lh0", 3) == 0 ||
  ------------------
  |  Branch (543:6): [True: 552, False: 5.65k]
  ------------------
  544|  5.65k|	    memcmp(lha->method, "lz4", 3) == 0)
  ------------------
  |  Branch (544:6): [True: 5, False: 5.64k]
  ------------------
  545|    557|		lha->entry_is_compressed = 0;
  546|  5.64k|	else
  547|  5.64k|		lha->entry_is_compressed = 1;
  548|       |
  549|  6.20k|	lha->compsize = 0;
  550|  6.20k|	lha->origsize = 0;
  551|  6.20k|	lha->setflag = 0;
  552|  6.20k|	lha->birthtime = 0;
  553|  6.20k|	lha->birthtime_tv_nsec = 0;
  554|  6.20k|	lha->mtime = 0;
  555|  6.20k|	lha->mtime_tv_nsec = 0;
  556|  6.20k|	lha->atime = 0;
  557|  6.20k|	lha->atime_tv_nsec = 0;
  558|  6.20k|	lha->mode = (lha->directory)? 0777 : 0666;
  ------------------
  |  Branch (558:14): [True: 380, False: 5.82k]
  ------------------
  559|  6.20k|	lha->uid = 0;
  560|  6.20k|	lha->gid = 0;
  561|  6.20k|	archive_string_empty(&lha->dirname);
  ------------------
  |  |  181|  6.20k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  562|  6.20k|	archive_string_empty(&lha->filename);
  ------------------
  |  |  181|  6.20k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  563|  6.20k|	lha->dos_attr = 0;
  564|  6.20k|	if (lha->opt_sconv != NULL) {
  ------------------
  |  Branch (564:6): [True: 0, False: 6.20k]
  ------------------
  565|      0|		lha->sconv_dir = lha->opt_sconv;
  566|      0|		lha->sconv_fname = lha->opt_sconv;
  567|  6.20k|	} else {
  568|  6.20k|		lha->sconv_dir = NULL;
  569|  6.20k|		lha->sconv_fname = NULL;
  570|  6.20k|	}
  571|       |
  572|  6.20k|	switch (p[H_LEVEL_OFFSET]) {
  ------------------
  |  |  210|  6.20k|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  573|    327|	case 0:
  ------------------
  |  Branch (573:2): [True: 327, False: 5.87k]
  ------------------
  574|    327|		err = lha_read_file_header_0(a, lha);
  575|    327|		break;
  576|    144|	case 1:
  ------------------
  |  Branch (576:2): [True: 144, False: 6.05k]
  ------------------
  577|    144|		err = lha_read_file_header_1(a, lha);
  578|    144|		break;
  579|  5.66k|	case 2:
  ------------------
  |  Branch (579:2): [True: 5.66k, False: 539]
  ------------------
  580|  5.66k|		err = lha_read_file_header_2(a, lha);
  581|  5.66k|		break;
  582|     66|	case 3:
  ------------------
  |  Branch (582:2): [True: 66, False: 6.13k]
  ------------------
  583|     66|		err = lha_read_file_header_3(a, lha);
  584|     66|		break;
  585|      2|	default:
  ------------------
  |  Branch (585:2): [True: 2, False: 6.20k]
  ------------------
  586|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  587|      2|		    "Unsupported LHa header level %d", p[H_LEVEL_OFFSET]);
  ------------------
  |  |  210|      2|#define H_LEVEL_OFFSET	20	/* Header Level.  */
  ------------------
  588|      2|		err = ARCHIVE_FATAL;
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  589|      2|		break;
  590|  6.20k|	}
  591|  6.20k|	if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|  6.20k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (591:6): [True: 313, False: 5.88k]
  ------------------
  592|    313|		return (err);
  593|       |
  594|       |
  595|  5.88k|	if (!lha->directory && archive_strlen(&lha->filename) == 0)
  ------------------
  |  |  178|  5.54k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (595:6): [True: 5.54k, False: 343]
  |  Branch (595:25): [True: 1, False: 5.54k]
  ------------------
  596|       |		/* The filename has not been set */
  597|      1|		return (truncated_error(a));
  598|       |
  599|       |	/*
  600|       |	 * Make a pathname from a dirname and a filename, after converting to Unicode.
  601|       |	 * This is because codepages might differ between dirname and filename.
  602|       |	*/
  603|  5.88k|	archive_string_init(&pathname);
  ------------------
  |  |   71|  5.88k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 5.88k]
  |  |  ------------------
  ------------------
  604|  5.88k|	archive_string_init(&linkname);
  ------------------
  |  |   71|  5.88k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 5.88k]
  |  |  ------------------
  ------------------
  605|  5.88k|	archive_string_init(&conv_buffer.aes_mbs);
  ------------------
  |  |   71|  5.88k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 5.88k]
  |  |  ------------------
  ------------------
  606|  5.88k|	archive_string_init(&conv_buffer.aes_mbs_in_locale);
  ------------------
  |  |   71|  5.88k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 5.88k]
  |  |  ------------------
  ------------------
  607|  5.88k|	archive_string_init(&conv_buffer.aes_utf8);
  ------------------
  |  |   71|  5.88k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 5.88k]
  |  |  ------------------
  ------------------
  608|  5.88k|	archive_string_init(&conv_buffer.aes_wcs);
  ------------------
  |  |   71|  5.88k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 5.88k]
  |  |  ------------------
  ------------------
  609|  5.88k|	if (0 != archive_mstring_copy_mbs_len_l(&conv_buffer, lha->dirname.s, lha->dirname.length, lha->sconv_dir)) {
  ------------------
  |  Branch (609:6): [True: 3, False: 5.88k]
  ------------------
  610|      3|		archive_set_error(&a->archive,
  611|      3|			ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  612|      3|			"Pathname cannot be converted "
  613|      3|			"from %s to Unicode",
  614|      3|			archive_string_conversion_charset_name(lha->sconv_dir));
  615|      3|		err = ARCHIVE_FATAL;
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  616|  5.88k|	} else if (0 != archive_mstring_get_wcs(&a->archive, &conv_buffer, &conv_buffer_p))
  ------------------
  |  Branch (616:13): [True: 1, False: 5.88k]
  ------------------
  617|      1|		err = ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  618|  5.88k|	if (err == ARCHIVE_FATAL) {
  ------------------
  |  |  239|  5.88k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (618:6): [True: 4, False: 5.88k]
  ------------------
  619|      4|		archive_mstring_clean(&conv_buffer);
  620|      4|		archive_wstring_free(&pathname);
  621|      4|		archive_wstring_free(&linkname);
  622|      4|		return (err);
  623|      4|	}
  624|  5.88k|	archive_wstring_copy(&pathname, &conv_buffer.aes_wcs);
  ------------------
  |  |  135|  5.88k|	((dest)->length = 0, archive_wstring_concat((dest), (src)))
  ------------------
  625|       |
  626|  5.88k|	archive_string_empty(&conv_buffer.aes_mbs);
  ------------------
  |  |  181|  5.88k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  627|  5.88k|	archive_string_empty(&conv_buffer.aes_mbs_in_locale);
  ------------------
  |  |  181|  5.88k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  628|  5.88k|	archive_string_empty(&conv_buffer.aes_utf8);
  ------------------
  |  |  181|  5.88k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  629|  5.88k|	archive_wstring_empty(&conv_buffer.aes_wcs);
  ------------------
  |  |  182|  5.88k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
  630|  5.88k|	if (0 != archive_mstring_copy_mbs_len_l(&conv_buffer, lha->filename.s, lha->filename.length, lha->sconv_fname)) {
  ------------------
  |  Branch (630:6): [True: 12, False: 5.87k]
  ------------------
  631|     12|		archive_set_error(&a->archive,
  632|     12|			ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     12|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  633|     12|			"Pathname cannot be converted "
  634|     12|			"from %s to Unicode",
  635|     12|			archive_string_conversion_charset_name(lha->sconv_fname));
  636|     12|		err = ARCHIVE_FATAL;
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  637|     12|	}
  638|  5.87k|	else if (0 != archive_mstring_get_wcs(&a->archive, &conv_buffer, &conv_buffer_p))
  ------------------
  |  Branch (638:11): [True: 2, False: 5.87k]
  ------------------
  639|      2|		err = ARCHIVE_FATAL;
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  640|  5.88k|	if (err == ARCHIVE_FATAL) {
  ------------------
  |  |  239|  5.88k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (640:6): [True: 14, False: 5.87k]
  ------------------
  641|     14|		archive_mstring_clean(&conv_buffer);
  642|     14|		archive_wstring_free(&pathname);
  643|     14|		archive_wstring_free(&linkname);
  644|     14|		return (err);
  645|     14|	}
  646|  5.87k|	archive_wstring_concat(&pathname, &conv_buffer.aes_wcs);
  647|  5.87k|	archive_mstring_clean(&conv_buffer);
  648|       |
  649|  5.87k|	if ((lha->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  215|  5.87k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((lha->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  217|  5.87k|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (649:6): [True: 28, False: 5.84k]
  ------------------
  650|       |		/*
  651|       |	 	 * Extract the symlink-name if it's included in the pathname.
  652|       |	 	 */
  653|     28|		if (!lha_parse_linkname(&linkname, &pathname)) {
  ------------------
  |  Branch (653:7): [True: 0, False: 28]
  ------------------
  654|       |			/* We couldn't get the symlink-name. */
  655|      0|			archive_set_error(&a->archive,
  656|      0|		    	    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  657|      0|			    "Unknown symlink-name");
  658|      0|			archive_wstring_free(&pathname);
  659|      0|			archive_wstring_free(&linkname);
  660|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  661|      0|		}
  662|  5.84k|	} else {
  663|       |		/*
  664|       |		 * Make sure a file-type is set.
  665|       |		 * The mode has been overridden if it is in the extended data.
  666|       |		 */
  667|  5.84k|		lha->mode = (lha->mode & ~AE_IFMT) |
  ------------------
  |  |  215|  5.84k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  668|  5.84k|		    ((lha->directory)? AE_IFDIR: AE_IFREG);
  ------------------
  |  |  221|    341|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
              		    ((lha->directory)? AE_IFDIR: AE_IFREG);
  ------------------
  |  |  216|  5.50k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (668:8): [True: 341, False: 5.50k]
  ------------------
  669|  5.84k|	}
  670|  5.87k|	if ((lha->setflag & UNIX_MODE_IS_SET) == 0 &&
  ------------------
  |  |  163|  5.87k|#define UNIX_MODE_IS_SET	4
  ------------------
  |  Branch (670:6): [True: 5.83k, False: 37]
  ------------------
  671|  5.83k|	    (lha->dos_attr & 1) != 0)
  ------------------
  |  Branch (671:6): [True: 27, False: 5.80k]
  ------------------
  672|     27|		lha->mode &= ~(0222);/* read only. */
  673|       |
  674|       |	/*
  675|       |	 * Set basic file parameters.
  676|       |	 */
  677|  5.87k|	archive_entry_copy_pathname_w(entry, pathname.s);
  678|  5.87k|	archive_wstring_free(&pathname);
  679|  5.87k|	if (archive_strlen(&linkname) > 0) {
  ------------------
  |  |  178|  5.87k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (679:6): [True: 28, False: 5.84k]
  ------------------
  680|     28|		archive_entry_copy_symlink_w(entry, linkname.s);
  681|     28|	} else
  682|  5.84k|		archive_entry_set_symlink(entry, NULL);
  683|  5.87k|	archive_wstring_free(&linkname);
  684|       |	/*
  685|       |	 * When a header level is 0, there is a possibility that
  686|       |	 * a pathname and a symlink has '\' character, a directory
  687|       |	 * separator in DOS/Windows. So we should convert it to '/'.
  688|       |	 */
  689|  5.87k|	if (lha->level == 0)
  ------------------
  |  Branch (689:6): [True: 290, False: 5.58k]
  ------------------
  690|    290|		lha_replace_path_separator(lha, entry);
  691|       |
  692|  5.87k|	archive_entry_set_mode(entry, lha->mode);
  693|  5.87k|	archive_entry_set_uid(entry, lha->uid);
  694|  5.87k|	archive_entry_set_gid(entry, lha->gid);
  695|  5.87k|	if (archive_strlen(&lha->uname) > 0)
  ------------------
  |  |  178|  5.87k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (695:6): [True: 151, False: 5.71k]
  ------------------
  696|    151|		archive_entry_set_uname(entry, lha->uname.s);
  697|  5.87k|	if (archive_strlen(&lha->gname) > 0)
  ------------------
  |  |  178|  5.87k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (697:6): [True: 468, False: 5.40k]
  ------------------
  698|    468|		archive_entry_set_gname(entry, lha->gname.s);
  699|  5.87k|	if (lha->setflag & BIRTHTIME_IS_SET) {
  ------------------
  |  |  161|  5.87k|#define BIRTHTIME_IS_SET	1
  ------------------
  |  Branch (699:6): [True: 1, False: 5.86k]
  ------------------
  700|      1|		archive_entry_set_birthtime(entry, lha->birthtime,
  701|      1|		    lha->birthtime_tv_nsec);
  702|      1|		archive_entry_set_ctime(entry, lha->birthtime,
  703|      1|		    lha->birthtime_tv_nsec);
  704|  5.86k|	} else {
  705|  5.86k|		archive_entry_unset_birthtime(entry);
  706|  5.86k|		archive_entry_unset_ctime(entry);
  707|  5.86k|	}
  708|  5.87k|	archive_entry_set_mtime(entry, lha->mtime, lha->mtime_tv_nsec);
  709|  5.87k|	if (lha->setflag & ATIME_IS_SET)
  ------------------
  |  |  162|  5.87k|#define ATIME_IS_SET		2
  ------------------
  |  Branch (709:6): [True: 1, False: 5.86k]
  ------------------
  710|      1|		archive_entry_set_atime(entry, lha->atime,
  711|      1|		    lha->atime_tv_nsec);
  712|  5.86k|	else
  713|  5.86k|		archive_entry_unset_atime(entry);
  714|  5.87k|	if (lha->directory || archive_entry_symlink(entry) != NULL)
  ------------------
  |  Branch (714:6): [True: 341, False: 5.52k]
  |  Branch (714:24): [True: 28, False: 5.50k]
  ------------------
  715|    369|		archive_entry_unset_size(entry);
  716|  5.50k|	else
  717|  5.50k|		archive_entry_set_size(entry, lha->origsize);
  718|       |
  719|       |	/*
  720|       |	 * Prepare variables used to read a file content.
  721|       |	 */
  722|  5.87k|	lha->entry_bytes_remaining = lha->compsize;
  723|  5.87k|	if (lha->entry_bytes_remaining < 0) {
  ------------------
  |  Branch (723:6): [True: 0, False: 5.87k]
  ------------------
  724|      0|		archive_set_error(&a->archive,
  725|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  726|      0|		    "Invalid LHa entry size");
  727|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  728|      0|	}
  729|  5.87k|	lha->entry_offset = 0;
  730|  5.87k|	lha->entry_crc_calculated = 0;
  731|       |
  732|       |	/*
  733|       |	 * This file does not have a content.
  734|       |	 */
  735|  5.87k|	if (lha->directory || lha->compsize == 0)
  ------------------
  |  Branch (735:6): [True: 341, False: 5.52k]
  |  Branch (735:24): [True: 28, False: 5.50k]
  ------------------
  736|    369|		lha->end_of_entry = 1;
  737|       |
  738|  5.87k|	snprintf(lha->format_name, sizeof(lha->format_name), "lha -%c%c%c-",
  739|  5.87k|	    lha->method[0], lha->method[1], lha->method[2]);
  740|  5.87k|	a->archive.archive_format_name = lha->format_name;
  741|       |
  742|  5.87k|	return (err);
  743|  5.87k|}
archive_read_support_format_lha.c:truncated_error:
  467|    256|{
  468|    256|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    256|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  469|    256|	    "Truncated LHa header");
  470|    256|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    256|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  471|    256|}
archive_read_support_format_lha.c:lha_skip_sfx:
  423|    235|{
  424|    235|	const void *h;
  425|    235|	const char *p, *q;
  426|    235|	size_t next, skip;
  427|    235|	ssize_t bytes, window;
  428|       |
  429|    235|	window = 4096;
  430|    941|	for (;;) {
  431|    941|		h = __archive_read_ahead(a, window, &bytes);
  432|    941|		if (h == NULL) {
  ------------------
  |  Branch (432:7): [True: 706, False: 235]
  ------------------
  433|       |			/* Remaining bytes are less than window. */
  434|    706|			window >>= 1;
  435|    706|			if (window < (H_SIZE + 3))
  ------------------
  |  |  211|    706|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (435:8): [True: 0, False: 706]
  ------------------
  436|      0|				goto fatal;
  437|    706|			continue;
  438|    706|		}
  439|    235|		if (bytes < H_SIZE)
  ------------------
  |  |  211|    235|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (439:7): [True: 0, False: 235]
  ------------------
  440|      0|			goto fatal;
  441|    235|		p = h;
  442|    235|		q = p + bytes;
  443|       |
  444|       |		/*
  445|       |		 * Scan ahead until we find something that looks
  446|       |		 * like the lha header.
  447|       |		 */
  448|  12.6k|		while (p + H_SIZE < q) {
  ------------------
  |  |  211|  12.6k|#define H_SIZE		22	/* Minimum header size. */
  ------------------
  |  Branch (448:10): [True: 12.6k, False: 0]
  ------------------
  449|  12.6k|			if ((next = lha_check_header_format(p)) == 0) {
  ------------------
  |  Branch (449:8): [True: 235, False: 12.4k]
  ------------------
  450|    235|				skip = p - (const char *)h;
  451|    235|				__archive_read_consume(a, skip);
  452|    235|				return (ARCHIVE_OK);
  ------------------
  |  |  233|    235|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  453|    235|			}
  454|  12.4k|			p += next;
  455|  12.4k|		}
  456|      0|		skip = p - (const char *)h;
  457|      0|		__archive_read_consume(a, skip);
  458|      0|	}
  459|      0|fatal:
  460|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  461|      0|	    "Couldn't find out LHa header");
  462|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  463|    235|}
archive_read_support_format_lha.c:lha_read_file_header_0:
  807|    327|{
  808|    327|	const unsigned char *p;
  809|    327|	int extdsize, namelen;
  810|    327|	unsigned char headersum, sum_calculated;
  811|       |
  812|    327|	if ((p = __archive_read_ahead(a, H0_FIXED_SIZE, NULL)) == NULL)
  ------------------
  |  |  804|    327|#define H0_FIXED_SIZE		24
  ------------------
  |  Branch (812:6): [True: 3, False: 324]
  ------------------
  813|      3|		return (truncated_error(a));
  814|    324|	lha->header_size = p[H0_HEADER_SIZE_OFFSET] + 2;
  ------------------
  |  |  797|    324|#define H0_HEADER_SIZE_OFFSET	0
  ------------------
  815|    324|	headersum = p[H0_HEADER_SUM_OFFSET];
  ------------------
  |  |  798|    324|#define H0_HEADER_SUM_OFFSET	1
  ------------------
  816|    324|	lha->compsize = archive_le32dec(p + H0_COMP_SIZE_OFFSET);
  ------------------
  |  |  799|    324|#define H0_COMP_SIZE_OFFSET	7
  ------------------
  817|    324|	lha->origsize = archive_le32dec(p + H0_ORIG_SIZE_OFFSET);
  ------------------
  |  |  800|    324|#define H0_ORIG_SIZE_OFFSET	11
  ------------------
  818|    324|	lha->mtime = __archive_dos_to_unix(archive_le32dec(p + H0_DOS_TIME_OFFSET));
  ------------------
  |  |  801|    324|#define H0_DOS_TIME_OFFSET	15
  ------------------
  819|    324|	namelen = p[H0_NAME_LEN_OFFSET];
  ------------------
  |  |  802|    324|#define H0_NAME_LEN_OFFSET	21
  ------------------
  820|    324|	extdsize = (int)lha->header_size - H0_FIXED_SIZE - namelen;
  ------------------
  |  |  804|    324|#define H0_FIXED_SIZE		24
  ------------------
  821|    324|	if ((namelen > 221 || extdsize < 0) && extdsize != -2) {
  ------------------
  |  Branch (821:7): [True: 6, False: 318]
  |  Branch (821:24): [True: 229, False: 89]
  |  Branch (821:41): [True: 13, False: 222]
  ------------------
  822|     13|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     13|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  823|     13|		    "Invalid LHa header");
  824|     13|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     13|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  825|     13|	}
  826|    311|	if ((p = __archive_read_ahead(a, lha->header_size, NULL)) == NULL)
  ------------------
  |  Branch (826:6): [True: 5, False: 306]
  ------------------
  827|      5|		return (truncated_error(a));
  828|       |
  829|    306|	archive_strncpy(&lha->filename, p + H0_FILE_NAME_OFFSET, namelen);
  ------------------
  |  |  173|    306|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
  830|       |	/* When extdsize == -2, A CRC16 value is not present in the header. */
  831|    306|	if (extdsize >= 0) {
  ------------------
  |  Branch (831:6): [True: 84, False: 222]
  ------------------
  832|     84|		lha->crc = archive_le16dec(p + H0_FILE_NAME_OFFSET + namelen);
  ------------------
  |  |  803|     84|#define H0_FILE_NAME_OFFSET	22
  ------------------
  833|     84|		lha->setflag |= CRC_IS_SET;
  ------------------
  |  |  164|     84|#define CRC_IS_SET		8
  ------------------
  834|     84|	}
  835|    306|	sum_calculated = lha_calcsum(0, p, 2, lha->header_size - 2);
  836|       |
  837|       |	/* Read an extended header */
  838|    306|	if (extdsize > 0) {
  ------------------
  |  Branch (838:6): [True: 84, False: 222]
  ------------------
  839|       |		/* This extended data is set by 'LHa for UNIX' only.
  840|       |		 * Maybe fixed size.
  841|       |		 */
  842|     84|		p += H0_FILE_NAME_OFFSET + namelen + 2;
  ------------------
  |  |  803|     84|#define H0_FILE_NAME_OFFSET	22
  ------------------
  843|     84|		if (p[0] == 'U' && extdsize == 12) {
  ------------------
  |  Branch (843:7): [True: 12, False: 72]
  |  Branch (843:22): [True: 10, False: 2]
  ------------------
  844|       |			/* p[1] is a minor version. */
  845|     10|			lha->mtime = archive_le32dec(&p[2]);
  846|     10|			lha->mode = archive_le16dec(&p[6]);
  847|     10|			lha->uid = archive_le16dec(&p[8]);
  848|     10|			lha->gid = archive_le16dec(&p[10]);
  849|     10|			lha->setflag |= UNIX_MODE_IS_SET;
  ------------------
  |  |  163|     10|#define UNIX_MODE_IS_SET	4
  ------------------
  850|     10|		}
  851|     84|	}
  852|    306|	__archive_read_consume(a, lha->header_size);
  853|       |
  854|    306|	if (sum_calculated != headersum) {
  ------------------
  |  Branch (854:6): [True: 15, False: 291]
  ------------------
  855|     15|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     15|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  856|     15|		    "LHa header sum error");
  857|     15|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     15|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  858|     15|	}
  859|       |
  860|    291|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    291|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  861|    306|}
archive_read_support_format_lha.c:lha_calcsum:
 1720|    448|{
 1721|    448|	unsigned char const *p = (unsigned char const *)pp;
 1722|       |
 1723|    448|	p += offset;
 1724|  13.2k|	for (;size > 0; --size)
  ------------------
  |  Branch (1724:8): [True: 12.8k, False: 448]
  ------------------
 1725|  12.8k|		sum += *p++;
 1726|    448|	return (sum);
 1727|    448|}
archive_read_support_format_lha.c:lha_read_file_header_1:
  901|    144|{
  902|    144|	const unsigned char *p;
  903|    144|	size_t extdsize;
  904|    144|	int err, err2;
  905|    144|	int namelen, padding;
  906|    144|	unsigned char headersum, sum_calculated;
  907|       |
  908|    144|	err = ARCHIVE_OK;
  ------------------
  |  |  233|    144|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  909|       |
  910|    144|	if ((p = __archive_read_ahead(a, H1_FIXED_SIZE, NULL)) == NULL)
  ------------------
  |  |  898|    144|#define H1_FIXED_SIZE		27
  ------------------
  |  Branch (910:6): [True: 0, False: 144]
  ------------------
  911|      0|		return (truncated_error(a));
  912|       |
  913|    144|	lha->header_size = p[H1_HEADER_SIZE_OFFSET] + 2;
  ------------------
  |  |  891|    144|#define H1_HEADER_SIZE_OFFSET	0
  ------------------
  914|    144|	headersum = p[H1_HEADER_SUM_OFFSET];
  ------------------
  |  |  892|    144|#define H1_HEADER_SUM_OFFSET	1
  ------------------
  915|       |	/* Note: An extended header size is included in a compsize. */
  916|    144|	lha->compsize = archive_le32dec(p + H1_COMP_SIZE_OFFSET);
  ------------------
  |  |  893|    144|#define H1_COMP_SIZE_OFFSET	7
  ------------------
  917|    144|	lha->origsize = archive_le32dec(p + H1_ORIG_SIZE_OFFSET);
  ------------------
  |  |  894|    144|#define H1_ORIG_SIZE_OFFSET	11
  ------------------
  918|    144|	lha->mtime = __archive_dos_to_unix(archive_le32dec(p + H1_DOS_TIME_OFFSET));
  ------------------
  |  |  895|    144|#define H1_DOS_TIME_OFFSET	15
  ------------------
  919|    144|	namelen = p[H1_NAME_LEN_OFFSET];
  ------------------
  |  |  896|    144|#define H1_NAME_LEN_OFFSET	21
  ------------------
  920|       |	/* Calculate a padding size. The result will be normally 0 only(?) */
  921|    144|	padding = ((int)lha->header_size) - H1_FIXED_SIZE - namelen;
  ------------------
  |  |  898|    144|#define H1_FIXED_SIZE		27
  ------------------
  922|       |
  923|    144|	if (namelen > 230 || padding < 0)
  ------------------
  |  Branch (923:6): [True: 0, False: 144]
  |  Branch (923:23): [True: 0, False: 144]
  ------------------
  924|      0|		goto invalid;
  925|       |
  926|    144|	if ((p = __archive_read_ahead(a, lha->header_size, NULL)) == NULL)
  ------------------
  |  Branch (926:6): [True: 2, False: 142]
  ------------------
  927|      2|		return (truncated_error(a));
  928|       |
  929|    142|	if (memchr(p + H1_FILE_NAME_OFFSET, 0xff,
  ------------------
  |  |  897|    142|#define H1_FILE_NAME_OFFSET	22
  ------------------
  |  Branch (929:6): [True: 0, False: 142]
  ------------------
  930|    142|	    (size_t)namelen) != NULL)
  931|      0|		goto invalid; /* Invalid filename. */
  932|    142|	archive_strncpy(&lha->filename, p + H1_FILE_NAME_OFFSET, namelen);
  ------------------
  |  |  173|    142|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
  933|    142|	lha->crc = archive_le16dec(p + H1_FILE_NAME_OFFSET + namelen);
  ------------------
  |  |  897|    142|#define H1_FILE_NAME_OFFSET	22
  ------------------
  934|    142|	lha->setflag |= CRC_IS_SET;
  ------------------
  |  |  164|    142|#define CRC_IS_SET		8
  ------------------
  935|       |
  936|    142|	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|    142|	__archive_read_consume(a, lha->header_size - 2);
  940|       |
  941|       |	/* Read extended headers */
  942|    142|	err2 = lha_read_file_extended_header(a, lha, NULL, 2,
  943|    142|	    (uint64_t)(lha->compsize + 2), &extdsize);
  944|    142|	if (err2 < ARCHIVE_WARN)
  ------------------
  |  |  235|    142|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (944:6): [True: 73, False: 69]
  ------------------
  945|     73|		return (err2);
  946|     69|	if (err2 < err)
  ------------------
  |  Branch (946:6): [True: 0, False: 69]
  ------------------
  947|      0|		err = err2;
  948|       |	/* Get a real compressed file size. */
  949|     69|	lha->compsize -= extdsize - 2;
  950|       |
  951|     69|	if (lha->compsize < 0)
  ------------------
  |  Branch (951:6): [True: 1, False: 68]
  ------------------
  952|      1|		goto invalid;	/* Invalid compressed file size */
  953|       |
  954|     68|	if (sum_calculated != headersum) {
  ------------------
  |  Branch (954:6): [True: 16, False: 52]
  ------------------
  955|     16|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     16|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  956|     16|		    "LHa header sum error");
  957|     16|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     16|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  958|     16|	}
  959|     52|	return (err);
  960|      1|invalid:
  961|      1|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  962|      1|	    "Invalid LHa header");
  963|      1|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  964|     68|}
archive_read_support_format_lha.c:lha_read_file_extended_header:
 1144|  5.86k|{
 1145|  5.86k|	const void *h;
 1146|  5.86k|	const unsigned char *extdheader;
 1147|  5.86k|	size_t	extdsize;
 1148|  5.86k|	size_t	datasize;
 1149|  5.86k|	unsigned int i;
 1150|  5.86k|	unsigned char extdtype;
 1151|       |
 1152|  5.86k|#define EXT_HEADER_CRC		0x00		/* Header CRC and information*/
 1153|  5.86k|#define EXT_FILENAME		0x01		/* Filename 		    */
 1154|  5.86k|#define EXT_DIRECTORY		0x02		/* Directory name	    */
 1155|  5.86k|#define EXT_DOS_ATTR		0x40		/* MS-DOS attribute	    */
 1156|  5.86k|#define EXT_TIMESTAMP		0x41		/* Windows time stamp	    */
 1157|  5.86k|#define EXT_FILESIZE		0x42		/* Large file size	    */
 1158|  5.86k|#define EXT_TIMEZONE		0x43		/* Time zone		    */
 1159|  5.86k|#define EXT_UTF16_FILENAME	0x44		/* UTF-16 filename 	    */
 1160|  5.86k|#define EXT_UTF16_DIRECTORY	0x45		/* UTF-16 directory name    */
 1161|  5.86k|#define EXT_CODEPAGE		0x46		/* Codepage		    */
 1162|  5.86k|#define EXT_UNIX_MODE		0x50		/* File permission	    */
 1163|  5.86k|#define EXT_UNIX_GID_UID	0x51		/* gid,uid		    */
 1164|  5.86k|#define EXT_UNIX_GNAME		0x52		/* Group name		    */
 1165|  5.86k|#define EXT_UNIX_UNAME		0x53		/* User name		    */
 1166|  5.86k|#define EXT_UNIX_MTIME		0x54		/* Modified time	    */
 1167|  5.86k|#define EXT_OS2_NEW_ATTR	0x7f		/* new attribute(OS/2 only) */
 1168|  5.86k|#define EXT_NEW_ATTR		0xff		/* new attribute	    */
 1169|       |
 1170|  5.86k|	*total_size = sizefield_length;
 1171|       |
 1172|  28.7k|	for (;;) {
 1173|       |		/* Read an extended header size. */
 1174|  28.7k|		if ((h =
  ------------------
  |  Branch (1174:7): [True: 46, False: 28.7k]
  ------------------
 1175|  28.7k|		    __archive_read_ahead(a, sizefield_length, NULL)) == NULL)
 1176|     46|			return (truncated_error(a));
 1177|       |		/* Check if the size is the zero indicates the end of the
 1178|       |		 * extended header. */
 1179|  28.7k|		if (sizefield_length == sizeof(uint16_t))
  ------------------
  |  Branch (1179:7): [True: 28.6k, False: 62]
  ------------------
 1180|  28.6k|			extdsize = archive_le16dec(h);
 1181|     62|		else
 1182|     62|			extdsize = archive_le32dec(h);
 1183|  28.7k|		if (extdsize == 0) {
  ------------------
  |  Branch (1183:7): [True: 5.62k, False: 23.1k]
  ------------------
 1184|       |			/* End of extended header */
 1185|  5.62k|			if (crc != NULL)
  ------------------
  |  Branch (1185:8): [True: 5.55k, False: 69]
  ------------------
 1186|  5.55k|				*crc = lha_crc16(*crc, h, sizefield_length);
 1187|  5.62k|			__archive_read_consume(a, sizefield_length);
 1188|  5.62k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  5.62k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1189|  5.62k|		}
 1190|       |
 1191|       |		/* Sanity check to the extended header size. */
 1192|  23.1k|		if (((uint64_t)*total_size + extdsize) > limitsize ||
  ------------------
  |  Branch (1192:7): [True: 50, False: 23.0k]
  ------------------
 1193|  23.0k|		    extdsize <= (size_t)sizefield_length)
  ------------------
  |  Branch (1193:7): [True: 0, False: 23.0k]
  ------------------
 1194|     50|			goto invalid;
 1195|       |
 1196|       |		/* Read the extended header. */
 1197|  23.0k|		if ((h = __archive_read_ahead(a, extdsize, NULL)) == NULL)
  ------------------
  |  Branch (1197:7): [True: 104, False: 22.9k]
  ------------------
 1198|    104|			return (truncated_error(a));
 1199|  22.9k|		*total_size += extdsize;
 1200|       |
 1201|  22.9k|		extdheader = (const unsigned char *)h;
 1202|       |		/* Get the extended header type. */
 1203|  22.9k|		extdtype = extdheader[sizefield_length];
 1204|       |		/* Calculate an extended data size. */
 1205|  22.9k|		datasize = extdsize - (1 + sizefield_length);
 1206|       |		/* Skip an extended header size field and type field. */
 1207|  22.9k|		extdheader += sizefield_length + 1;
 1208|       |
 1209|  22.9k|		if (crc != NULL && extdtype != EXT_HEADER_CRC)
  ------------------
  |  | 1152|  20.0k|#define EXT_HEADER_CRC		0x00		/* Header CRC and information*/
  ------------------
  |  Branch (1209:7): [True: 20.0k, False: 2.94k]
  |  Branch (1209:22): [True: 14.6k, False: 5.36k]
  ------------------
 1210|  14.6k|			*crc = lha_crc16(*crc, h, extdsize);
 1211|  22.9k|		switch (extdtype) {
 1212|  6.57k|		case EXT_HEADER_CRC:
  ------------------
  |  | 1152|  6.57k|#define EXT_HEADER_CRC		0x00		/* Header CRC and information*/
  ------------------
  |  Branch (1212:3): [True: 6.57k, False: 16.3k]
  ------------------
 1213|       |			/* We only use a header CRC. Following data will not
 1214|       |			 * be used. */
 1215|  6.57k|			if (datasize >= 2) {
  ------------------
  |  Branch (1215:8): [True: 6.53k, False: 42]
  ------------------
 1216|  6.53k|				lha->header_crc = archive_le16dec(extdheader);
 1217|  6.53k|				if (crc != NULL) {
  ------------------
  |  Branch (1217:9): [True: 5.33k, False: 1.19k]
  ------------------
 1218|  5.33k|					static const char zeros[2] = {0, 0};
 1219|  5.33k|					*crc = lha_crc16(*crc, h,
 1220|  5.33k|					    extdsize - datasize);
 1221|       |					/* CRC value itself as zero */
 1222|  5.33k|					*crc = lha_crc16(*crc, zeros, 2);
 1223|  5.33k|					*crc = lha_crc16(*crc,
 1224|  5.33k|					    extdheader+2, datasize - 2);
 1225|  5.33k|				}
 1226|  6.53k|			}
 1227|  6.57k|			break;
 1228|  6.83k|		case EXT_FILENAME:
  ------------------
  |  | 1153|  6.83k|#define EXT_FILENAME		0x01		/* Filename 		    */
  ------------------
  |  Branch (1228:3): [True: 6.83k, False: 16.1k]
  ------------------
 1229|  6.83k|			if (datasize == 0) {
  ------------------
  |  Branch (1229:8): [True: 1.19k, False: 5.63k]
  ------------------
 1230|       |				/* maybe directory header */
 1231|  1.19k|				archive_string_empty(&lha->filename);
  ------------------
  |  |  181|  1.19k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1232|  1.19k|				break;
 1233|  1.19k|			}
 1234|  5.63k|			if (extdheader[0] == '\0')
  ------------------
  |  Branch (1234:8): [True: 1, False: 5.63k]
  ------------------
 1235|      1|				goto invalid;
 1236|  5.63k|			archive_strncpy(&lha->filename,
  ------------------
  |  |  173|  5.63k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1237|  5.63k|			    (const char *)extdheader, datasize);
 1238|  5.63k|			break;
 1239|  1.32k|		case EXT_UTF16_FILENAME:
  ------------------
  |  | 1159|  1.32k|#define EXT_UTF16_FILENAME	0x44		/* UTF-16 filename 	    */
  ------------------
  |  Branch (1239:3): [True: 1.32k, False: 21.6k]
  ------------------
 1240|  1.32k|			if (datasize == 0) {
  ------------------
  |  Branch (1240:8): [True: 670, False: 655]
  ------------------
 1241|       |				/* maybe directory header */
 1242|    670|				archive_string_empty(&lha->filename);
  ------------------
  |  |  181|    670|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1243|    670|				break;
 1244|    670|			} else if (datasize & 1) {
  ------------------
  |  Branch (1244:15): [True: 1, False: 654]
  ------------------
 1245|       |				/* UTF-16 characters take always 2 or 4 bytes */
 1246|      1|				goto invalid;
 1247|      1|			}
 1248|    654|			if (extdheader[0] == '\0')
  ------------------
  |  Branch (1248:8): [True: 0, False: 654]
  ------------------
 1249|      0|				goto invalid;
 1250|    654|			archive_string_empty(&lha->filename);
  ------------------
  |  |  181|    654|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1251|    654|			archive_array_append(&lha->filename,
 1252|    654|				(const char *)extdheader, datasize);
 1253|       |			/* Setup a string conversion for a filename. */
 1254|    654|			lha->sconv_fname =
 1255|    654|			    archive_string_conversion_from_charset(&a->archive,
 1256|    654|			        "UTF-16LE", 1);
 1257|    654|			if (lha->sconv_fname == NULL)
  ------------------
  |  Branch (1257:8): [True: 0, False: 654]
  ------------------
 1258|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1259|    654|			break;
 1260|    654|		case EXT_DIRECTORY:
  ------------------
  |  | 1154|     99|#define EXT_DIRECTORY		0x02		/* Directory name	    */
  ------------------
  |  Branch (1260:3): [True: 99, False: 22.8k]
  ------------------
 1261|     99|			if (datasize == 0 || extdheader[0] == '\0')
  ------------------
  |  Branch (1261:8): [True: 1, False: 98]
  |  Branch (1261:25): [True: 0, False: 98]
  ------------------
 1262|       |				/* no directory name data. exit this case. */
 1263|      1|				goto invalid;
 1264|       |
 1265|     98|			archive_strncpy(&lha->dirname,
  ------------------
  |  |  173|     98|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1266|     98|		  	    (const char *)extdheader, datasize);
 1267|       |			/*
 1268|       |			 * Convert directory delimiter from 0xFF
 1269|       |			 * to '/' for local system.
 1270|       |	 		 */
 1271|    800|			for (i = 0; i < lha->dirname.length; i++) {
  ------------------
  |  Branch (1271:16): [True: 702, False: 98]
  ------------------
 1272|    702|				if ((unsigned char)lha->dirname.s[i] == 0xFF)
  ------------------
  |  Branch (1272:9): [True: 404, False: 298]
  ------------------
 1273|    404|					lha->dirname.s[i] = '/';
 1274|    702|			}
 1275|       |			/* Is last character directory separator? */
 1276|     98|			if (lha->dirname.s[lha->dirname.length-1] != '/')
  ------------------
  |  Branch (1276:8): [True: 6, False: 92]
  ------------------
 1277|       |				/* invalid directory data */
 1278|      6|				goto invalid;
 1279|     92|			break;
 1280|     92|		case EXT_UTF16_DIRECTORY:
  ------------------
  |  | 1160|     32|#define EXT_UTF16_DIRECTORY	0x45		/* UTF-16 directory name    */
  ------------------
  |  Branch (1280:3): [True: 32, False: 22.9k]
  ------------------
 1281|       |			/* UTF-16 characters take always 2 or 4 bytes */
 1282|     32|			if (datasize == 0 || (datasize & 1) ||
  ------------------
  |  Branch (1282:8): [True: 1, False: 31]
  |  Branch (1282:25): [True: 0, False: 31]
  ------------------
 1283|     31|			    extdheader[0] == '\0') {
  ------------------
  |  Branch (1283:8): [True: 0, False: 31]
  ------------------
 1284|       |				/* no directory name data. exit this case. */
 1285|      1|				goto invalid;
 1286|      1|			}
 1287|       |
 1288|     31|			archive_string_empty(&lha->dirname);
  ------------------
  |  |  181|     31|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1289|     31|			archive_array_append(&lha->dirname,
 1290|     31|				(const char *)extdheader, datasize);
 1291|     31|			lha->sconv_dir =
 1292|     31|			    archive_string_conversion_from_charset(&a->archive,
 1293|     31|			        "UTF-16LE", 1);
 1294|     31|			if (lha->sconv_dir == NULL)
  ------------------
  |  Branch (1294:8): [True: 0, False: 31]
  ------------------
 1295|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1296|     31|			else {
 1297|       |				/*
 1298|       |				 * Convert directory delimiter from 0xFFFF
 1299|       |				 * to '/' for local system.
 1300|       |				 */
 1301|     31|				uint16_t dirSep;
 1302|     31|				uint16_t d = 1;
 1303|     31|				if (archive_be16dec(&d) == 1)
  ------------------
  |  Branch (1303:9): [True: 0, False: 31]
  ------------------
 1304|      0|					dirSep = 0x2F00;
 1305|     31|				else
 1306|     31|					dirSep = 0x002F;
 1307|       |
 1308|       |				/* UTF-16LE character */
 1309|     31|				uint16_t *utf16name =
 1310|     31|				    (uint16_t *)lha->dirname.s;
 1311|  1.75k|				for (i = 0; i < lha->dirname.length / 2; i++) {
  ------------------
  |  Branch (1311:17): [True: 1.72k, False: 31]
  ------------------
 1312|  1.72k|					if (utf16name[i] == 0xFFFF) {
  ------------------
  |  Branch (1312:10): [True: 211, False: 1.51k]
  ------------------
 1313|    211|						utf16name[i] = dirSep;
 1314|    211|					}
 1315|  1.72k|				}
 1316|       |				/* Is last character directory separator? */
 1317|     31|				if (utf16name[lha->dirname.length / 2 - 1] !=
  ------------------
  |  Branch (1317:9): [True: 12, False: 19]
  ------------------
 1318|     31|				    dirSep) {
 1319|       |					/* invalid directory data */
 1320|     12|					goto invalid;
 1321|     12|				}
 1322|     31|			}
 1323|     19|			break;
 1324|  1.41k|		case EXT_DOS_ATTR:
  ------------------
  |  | 1155|  1.41k|#define EXT_DOS_ATTR		0x40		/* MS-DOS attribute	    */
  ------------------
  |  Branch (1324:3): [True: 1.41k, False: 21.5k]
  ------------------
 1325|  1.41k|			if (datasize == 2)
  ------------------
  |  Branch (1325:8): [True: 299, False: 1.11k]
  ------------------
 1326|    299|				lha->dos_attr = (unsigned char)
 1327|    299|				    (archive_le16dec(extdheader) & 0xff);
 1328|  1.41k|			break;
 1329|    151|		case EXT_TIMESTAMP:
  ------------------
  |  | 1156|    151|#define EXT_TIMESTAMP		0x41		/* Windows time stamp	    */
  ------------------
  |  Branch (1329:3): [True: 151, False: 22.8k]
  ------------------
 1330|    151|			if (datasize == (sizeof(uint64_t) * 3)) {
  ------------------
  |  Branch (1330:8): [True: 79, False: 72]
  ------------------
 1331|     79|				__archive_ntfs_to_unix(archive_le64dec(extdheader),
 1332|     79|					&lha->birthtime,
 1333|     79|				    &lha->birthtime_tv_nsec);
 1334|     79|				extdheader += sizeof(uint64_t);
 1335|     79|				__archive_ntfs_to_unix(archive_le64dec(extdheader),
 1336|     79|					&lha->mtime,
 1337|     79|				    &lha->mtime_tv_nsec);
 1338|     79|				extdheader += sizeof(uint64_t);
 1339|     79|				__archive_ntfs_to_unix(archive_le64dec(extdheader),
 1340|     79|					&lha->atime,
 1341|     79|				    &lha->atime_tv_nsec);
 1342|     79|				lha->setflag |= BIRTHTIME_IS_SET |
  ------------------
  |  |  161|     79|#define BIRTHTIME_IS_SET	1
  ------------------
 1343|     79|				    ATIME_IS_SET;
  ------------------
  |  |  162|     79|#define ATIME_IS_SET		2
  ------------------
 1344|     79|			}
 1345|    151|			break;
 1346|    309|		case EXT_FILESIZE:
  ------------------
  |  | 1157|    309|#define EXT_FILESIZE		0x42		/* Large file size	    */
  ------------------
  |  Branch (1346:3): [True: 309, False: 22.6k]
  ------------------
 1347|    309|			if (datasize == sizeof(uint64_t) * 2) {
  ------------------
  |  Branch (1347:8): [True: 237, False: 72]
  ------------------
 1348|    237|				lha->compsize = archive_le64dec(extdheader);
 1349|    237|				extdheader += sizeof(uint64_t);
 1350|    237|				lha->origsize = archive_le64dec(extdheader);
 1351|    237|				if (lha->compsize < 0 || lha->origsize < 0)
  ------------------
  |  Branch (1351:9): [True: 11, False: 226]
  |  Branch (1351:30): [True: 11, False: 215]
  ------------------
 1352|     22|					goto invalid;
 1353|    237|			}
 1354|    287|			break;
 1355|    676|		case EXT_CODEPAGE:
  ------------------
  |  | 1161|    676|#define EXT_CODEPAGE		0x46		/* Codepage		    */
  ------------------
  |  Branch (1355:3): [True: 676, False: 22.2k]
  ------------------
 1356|       |			/* Get an archived filename charset from codepage.
 1357|       |			 * This overwrites the charset specified by
 1358|       |			 * hdrcharset option. */
 1359|    676|			if (datasize == sizeof(uint32_t)) {
  ------------------
  |  Branch (1359:8): [True: 585, False: 91]
  ------------------
 1360|    585|				struct archive_string cp;
 1361|    585|				const char *charset;
 1362|       |
 1363|    585|				archive_string_init(&cp);
  ------------------
  |  |   71|    585|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 585]
  |  |  ------------------
  ------------------
 1364|    585|				switch (archive_le32dec(extdheader)) {
 1365|    178|				case 65001: /* UTF-8 */
  ------------------
  |  Branch (1365:5): [True: 178, False: 407]
  ------------------
 1366|    178|					charset = "UTF-8";
 1367|    178|					break;
 1368|    407|				default:
  ------------------
  |  Branch (1368:5): [True: 407, False: 178]
  ------------------
 1369|    407|					archive_string_sprintf(&cp, "CP%d",
 1370|    407|					    (int)archive_le32dec(extdheader));
 1371|    407|					charset = cp.s;
 1372|    407|					break;
 1373|    585|				}
 1374|    585|				lha->sconv_dir =
 1375|    585|				    archive_string_conversion_from_charset(
 1376|    585|					&(a->archive), charset, 1);
 1377|    585|				lha->sconv_fname =
 1378|    585|				    archive_string_conversion_from_charset(
 1379|    585|					&(a->archive), charset, 1);
 1380|    585|				archive_string_free(&cp);
 1381|    585|				if (lha->sconv_dir == NULL)
  ------------------
  |  Branch (1381:9): [True: 0, False: 585]
  ------------------
 1382|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1383|    585|				if (lha->sconv_fname == NULL)
  ------------------
  |  Branch (1383:9): [True: 0, False: 585]
  ------------------
 1384|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1385|    585|			}
 1386|    676|			break;
 1387|  2.12k|		case EXT_UNIX_MODE:
  ------------------
  |  | 1162|  2.12k|#define EXT_UNIX_MODE		0x50		/* File permission	    */
  ------------------
  |  Branch (1387:3): [True: 2.12k, False: 20.8k]
  ------------------
 1388|  2.12k|			if (datasize == sizeof(uint16_t)) {
  ------------------
  |  Branch (1388:8): [True: 1.84k, False: 284]
  ------------------
 1389|  1.84k|				lha->mode = archive_le16dec(extdheader);
 1390|  1.84k|				lha->setflag |= UNIX_MODE_IS_SET;
  ------------------
  |  |  163|  1.84k|#define UNIX_MODE_IS_SET	4
  ------------------
 1391|  1.84k|			}
 1392|  2.12k|			break;
 1393|    351|		case EXT_UNIX_GID_UID:
  ------------------
  |  | 1163|    351|#define EXT_UNIX_GID_UID	0x51		/* gid,uid		    */
  ------------------
  |  Branch (1393:3): [True: 351, False: 22.6k]
  ------------------
 1394|    351|			if (datasize == (sizeof(uint16_t) * 2)) {
  ------------------
  |  Branch (1394:8): [True: 267, False: 84]
  ------------------
 1395|    267|				lha->gid = archive_le16dec(extdheader);
 1396|    267|				lha->uid = archive_le16dec(extdheader+2);
 1397|    267|			}
 1398|    351|			break;
 1399|    797|		case EXT_UNIX_GNAME:
  ------------------
  |  | 1164|    797|#define EXT_UNIX_GNAME		0x52		/* Group name		    */
  ------------------
  |  Branch (1399:3): [True: 797, False: 22.1k]
  ------------------
 1400|    797|			if (datasize > 0)
  ------------------
  |  Branch (1400:8): [True: 260, False: 537]
  ------------------
 1401|    260|				archive_strncpy(&lha->gname,
  ------------------
  |  |  173|    260|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1402|    797|				    (const char *)extdheader, datasize);
 1403|    797|			break;
 1404|    502|		case EXT_UNIX_UNAME:
  ------------------
  |  | 1165|    502|#define EXT_UNIX_UNAME		0x53		/* User name		    */
  ------------------
  |  Branch (1404:3): [True: 502, False: 22.4k]
  ------------------
 1405|    502|			if (datasize > 0)
  ------------------
  |  Branch (1405:8): [True: 66, False: 436]
  ------------------
 1406|     66|				archive_strncpy(&lha->uname,
  ------------------
  |  |  173|     66|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1407|    502|				    (const char *)extdheader, datasize);
 1408|    502|			break;
 1409|     80|		case EXT_UNIX_MTIME:
  ------------------
  |  | 1166|     80|#define EXT_UNIX_MTIME		0x54		/* Modified time	    */
  ------------------
  |  Branch (1409:3): [True: 80, False: 22.8k]
  ------------------
 1410|     80|			if (datasize == sizeof(uint32_t))
  ------------------
  |  Branch (1410:8): [True: 80, False: 0]
  ------------------
 1411|     80|				lha->mtime = archive_le32dec(extdheader);
 1412|     80|			break;
 1413|    313|		case EXT_OS2_NEW_ATTR:
  ------------------
  |  | 1167|    313|#define EXT_OS2_NEW_ATTR	0x7f		/* new attribute(OS/2 only) */
  ------------------
  |  Branch (1413:3): [True: 313, False: 22.6k]
  ------------------
 1414|       |			/* This extended header is OS/2 depend. */
 1415|    313|			if (datasize == 16) {
  ------------------
  |  Branch (1415:8): [True: 19, False: 294]
  ------------------
 1416|     19|				lha->dos_attr = (unsigned char)
 1417|     19|				    (archive_le16dec(extdheader) & 0xff);
 1418|     19|				lha->mode = archive_le16dec(extdheader+2);
 1419|     19|				lha->gid = archive_le16dec(extdheader+4);
 1420|     19|				lha->uid = archive_le16dec(extdheader+6);
 1421|     19|				lha->birthtime = archive_le32dec(extdheader+8);
 1422|     19|				lha->atime = archive_le32dec(extdheader+12);
 1423|     19|				lha->setflag |= UNIX_MODE_IS_SET
  ------------------
  |  |  163|     19|#define UNIX_MODE_IS_SET	4
  ------------------
 1424|     19|				    | BIRTHTIME_IS_SET | ATIME_IS_SET;
  ------------------
  |  |  161|     19|#define BIRTHTIME_IS_SET	1
  ------------------
              				    | BIRTHTIME_IS_SET | ATIME_IS_SET;
  ------------------
  |  |  162|     19|#define ATIME_IS_SET		2
  ------------------
 1425|     19|			}
 1426|    313|			break;
 1427|     86|		case EXT_NEW_ATTR:
  ------------------
  |  | 1168|     86|#define EXT_NEW_ATTR		0xff		/* new attribute	    */
  ------------------
  |  Branch (1427:3): [True: 86, False: 22.8k]
  ------------------
 1428|     86|			if (datasize == 20) {
  ------------------
  |  Branch (1428:8): [True: 68, False: 18]
  ------------------
 1429|     68|				lha->mode = (mode_t)archive_le32dec(extdheader);
 1430|     68|				lha->gid = archive_le32dec(extdheader+4);
 1431|     68|				lha->uid = archive_le32dec(extdheader+8);
 1432|     68|				lha->birthtime = archive_le32dec(extdheader+12);
 1433|     68|				lha->atime = archive_le32dec(extdheader+16);
 1434|     68|				lha->setflag |= UNIX_MODE_IS_SET
  ------------------
  |  |  163|     68|#define UNIX_MODE_IS_SET	4
  ------------------
 1435|     68|				    | BIRTHTIME_IS_SET | ATIME_IS_SET;
  ------------------
  |  |  161|     68|#define BIRTHTIME_IS_SET	1
  ------------------
              				    | BIRTHTIME_IS_SET | ATIME_IS_SET;
  ------------------
  |  |  162|     68|#define ATIME_IS_SET		2
  ------------------
 1436|     68|			}
 1437|     86|			break;
 1438|      0|		case EXT_TIMEZONE:		/* Not supported */
  ------------------
  |  | 1158|      0|#define EXT_TIMEZONE		0x43		/* Time zone		    */
  ------------------
  |  Branch (1438:3): [True: 0, False: 22.9k]
  ------------------
 1439|      0|			break;
 1440|  1.29k|		default:
  ------------------
  |  Branch (1440:3): [True: 1.29k, False: 21.6k]
  ------------------
 1441|  1.29k|			break;
 1442|  22.9k|		}
 1443|       |
 1444|  22.9k|		__archive_read_consume(a, extdsize);
 1445|  22.9k|	}
 1446|     94|invalid:
 1447|     94|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     94|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1448|     94|	    "Invalid extended LHa header");
 1449|     94|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     94|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1450|  5.86k|}
archive_read_support_format_lha.c:lha_crc16:
 1812|  60.9k|{
 1813|  60.9k|	const unsigned char *p = (const unsigned char *)pp;
 1814|  60.9k|	const uint16_t *buff;
 1815|  60.9k|	const union {
 1816|  60.9k|		uint32_t i;
 1817|  60.9k|		char c[4];
 1818|  60.9k|	} u = { 0x01020304 };
 1819|       |
 1820|  60.9k|	if (len == 0)
  ------------------
  |  Branch (1820:6): [True: 5.31k, False: 55.6k]
  ------------------
 1821|  5.31k|		return crc;
 1822|       |
 1823|       |	/* Process unaligned address. */
 1824|  55.6k|	if (((uintptr_t)p) & (uintptr_t)0x1) {
  ------------------
  |  Branch (1824:6): [True: 19.6k, False: 35.9k]
  ------------------
 1825|  19.6k|		crc = (crc >> 8) ^ crc16tbl[0][(crc ^ *p++) & 0xff];
 1826|  19.6k|		len--;
 1827|  19.6k|	}
 1828|  55.6k|	buff = (const uint16_t *)p;
 1829|       |	/*
 1830|       |	 * Modern C compiler such as GCC does not unroll automatically yet
 1831|       |	 * without unrolling pragma, and Clang is so. So we should
 1832|       |	 * unroll this loop for its performance.
 1833|       |	 */
 1834|   296M|	for (;len >= 8; len -= 8) {
  ------------------
  |  Branch (1834:8): [True: 296M, False: 55.6k]
  ------------------
 1835|       |		/* This if statement expects compiler optimization will
 1836|       |		 * remove the statement which will not be executed. */
 1837|   296M|#undef bswap16
 1838|       |#ifndef __has_builtin
 1839|       |#define __has_builtin(x) 0
 1840|       |#endif
 1841|       |#if defined(_MSC_VER) && _MSC_VER >= 1400  /* Visual Studio */
 1842|       |#  define bswap16(x) _byteswap_ushort(x)
 1843|       |#elif defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 8) || __GNUC__ > 4)
 1844|       |/* GCC 4.8 and later has __builtin_bswap16() */
 1845|       |#  define bswap16(x) __builtin_bswap16(x)
 1846|       |#elif defined(__clang__) && __has_builtin(__builtin_bswap16)
 1847|       |/* Newer clang versions have __builtin_bswap16() */
 1848|   296M|#  define bswap16(x) __builtin_bswap16(x)
 1849|       |#else
 1850|       |#  define bswap16(x) ((((x) >> 8) & 0xff) | ((x) << 8))
 1851|       |#endif
 1852|   296M|#define CRC16W	do { 	\
 1853|   296M|		if(u.c[0] == 1) { /* Big endian */		\
 1854|   296M|			crc ^= bswap16(*buff); buff++;		\
 1855|   296M|		} else						\
 1856|   296M|			crc ^= *buff++;				\
 1857|   296M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
 1858|   296M|} while (0)
 1859|   296M|		CRC16W;
  ------------------
  |  | 1852|   296M|#define CRC16W	do { 	\
  |  | 1853|   296M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1853:6): [True: 0, False: 296M]
  |  |  ------------------
  |  | 1854|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1848|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1855|      0|		} else						\
  |  | 1856|   296M|			crc ^= *buff++;				\
  |  | 1857|   296M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1858|   296M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1858:10): [Folded, False: 296M]
  |  |  ------------------
  ------------------
 1860|   296M|		CRC16W;
  ------------------
  |  | 1852|   296M|#define CRC16W	do { 	\
  |  | 1853|   296M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1853:6): [True: 0, False: 296M]
  |  |  ------------------
  |  | 1854|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1848|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1855|      0|		} else						\
  |  | 1856|   296M|			crc ^= *buff++;				\
  |  | 1857|   296M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1858|   296M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1858:10): [Folded, False: 296M]
  |  |  ------------------
  ------------------
 1861|   296M|		CRC16W;
  ------------------
  |  | 1852|   296M|#define CRC16W	do { 	\
  |  | 1853|   296M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1853:6): [True: 0, False: 296M]
  |  |  ------------------
  |  | 1854|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1848|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1855|      0|		} else						\
  |  | 1856|   296M|			crc ^= *buff++;				\
  |  | 1857|   296M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1858|   296M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1858:10): [Folded, False: 296M]
  |  |  ------------------
  ------------------
 1862|   296M|		CRC16W;
  ------------------
  |  | 1852|   296M|#define CRC16W	do { 	\
  |  | 1853|   296M|		if(u.c[0] == 1) { /* Big endian */		\
  |  |  ------------------
  |  |  |  Branch (1853:6): [True: 0, False: 296M]
  |  |  ------------------
  |  | 1854|      0|			crc ^= bswap16(*buff); buff++;		\
  |  |  ------------------
  |  |  |  | 1848|      0|#  define bswap16(x) __builtin_bswap16(x)
  |  |  ------------------
  |  | 1855|      0|		} else						\
  |  | 1856|   296M|			crc ^= *buff++;				\
  |  | 1857|   296M|		crc = crc16tbl[1][crc & 0xff] ^ crc16tbl[0][crc >> 8];\
  |  | 1858|   296M|} while (0)
  |  |  ------------------
  |  |  |  Branch (1858:10): [Folded, False: 296M]
  |  |  ------------------
  ------------------
 1863|   296M|#undef CRC16W
 1864|   296M|#undef bswap16
 1865|   296M|	}
 1866|       |
 1867|  55.6k|	p = (const unsigned char *)buff;
 1868|   171k|	for (;len; len--) {
  ------------------
  |  Branch (1868:8): [True: 115k, False: 55.6k]
  ------------------
 1869|   115k|		crc = (crc >> 8) ^ crc16tbl[0][(crc ^ *p++) & 0xff];
 1870|   115k|	}
 1871|  55.6k|	return crc;
 1872|  60.9k|}
archive_read_support_format_lha.c:lha_read_file_header_2:
  996|  5.66k|{
  997|  5.66k|	const unsigned char *p;
  998|  5.66k|	size_t extdsize;
  999|  5.66k|	int err, padding;
 1000|  5.66k|	uint16_t header_crc;
 1001|       |
 1002|  5.66k|	if ((p = __archive_read_ahead(a, H2_FIXED_SIZE, NULL)) == NULL)
  ------------------
  |  |  993|  5.66k|#define H2_FIXED_SIZE		24
  ------------------
  |  Branch (1002:6): [True: 2, False: 5.66k]
  ------------------
 1003|      2|		return (truncated_error(a));
 1004|       |
 1005|  5.66k|	lha->header_size =archive_le16dec(p + H2_HEADER_SIZE_OFFSET);
  ------------------
  |  |  988|  5.66k|#define H2_HEADER_SIZE_OFFSET	0
  ------------------
 1006|  5.66k|	lha->compsize = archive_le32dec(p + H2_COMP_SIZE_OFFSET);
  ------------------
  |  |  989|  5.66k|#define H2_COMP_SIZE_OFFSET	7
  ------------------
 1007|  5.66k|	lha->origsize = archive_le32dec(p + H2_ORIG_SIZE_OFFSET);
  ------------------
  |  |  990|  5.66k|#define H2_ORIG_SIZE_OFFSET	11
  ------------------
 1008|  5.66k|	lha->mtime = archive_le32dec(p + H2_TIME_OFFSET);
  ------------------
  |  |  991|  5.66k|#define H2_TIME_OFFSET		15
  ------------------
 1009|  5.66k|	lha->crc = archive_le16dec(p + H2_CRC_OFFSET);
  ------------------
  |  |  992|  5.66k|#define H2_CRC_OFFSET		21
  ------------------
 1010|  5.66k|	lha->setflag |= CRC_IS_SET;
  ------------------
  |  |  164|  5.66k|#define CRC_IS_SET		8
  ------------------
 1011|       |
 1012|  5.66k|	if (lha->header_size < H2_FIXED_SIZE) {
  ------------------
  |  |  993|  5.66k|#define H2_FIXED_SIZE		24
  ------------------
  |  Branch (1012:6): [True: 0, False: 5.66k]
  ------------------
 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|  5.66k|	header_crc = lha_crc16(0, p, H2_FIXED_SIZE);
  ------------------
  |  |  993|  5.66k|#define H2_FIXED_SIZE		24
  ------------------
 1019|  5.66k|	__archive_read_consume(a, H2_FIXED_SIZE);
  ------------------
  |  |  993|  5.66k|#define H2_FIXED_SIZE		24
  ------------------
 1020|       |
 1021|       |	/* Read extended headers */
 1022|  5.66k|	err = lha_read_file_extended_header(a, lha, &header_crc, 2,
 1023|  5.66k|		  lha->header_size - H2_FIXED_SIZE, &extdsize);
  ------------------
  |  |  993|  5.66k|#define H2_FIXED_SIZE		24
  ------------------
 1024|  5.66k|	if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|  5.66k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1024:6): [True: 170, False: 5.49k]
  ------------------
 1025|    170|		return (err);
 1026|       |
 1027|       |	/* Calculate a padding size. The result will be normally 0 or 1. */
 1028|  5.49k|	padding = (int)lha->header_size - (int)(H2_FIXED_SIZE + extdsize);
  ------------------
  |  |  993|  5.49k|#define H2_FIXED_SIZE		24
  ------------------
 1029|  5.49k|	if (padding > 0) {
  ------------------
  |  Branch (1029:6): [True: 64, False: 5.42k]
  ------------------
 1030|     64|		if ((p = __archive_read_ahead(a, padding, NULL)) == NULL)
  ------------------
  |  Branch (1030:7): [True: 6, False: 58]
  ------------------
 1031|      6|			return (truncated_error(a));
 1032|     58|		header_crc = lha_crc16(header_crc, p, padding);
 1033|     58|		__archive_read_consume(a, padding);
 1034|     58|	}
 1035|       |
 1036|  5.48k|	if (header_crc != lha->header_crc) {
  ------------------
  |  Branch (1036:6): [True: 2.99k, False: 2.48k]
  ------------------
 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|  2.99k|	}
 1043|  5.48k|	return (err);
 1044|  5.49k|}
archive_read_support_format_lha.c:lha_read_file_header_3:
 1077|     66|{
 1078|     66|	const unsigned char *p;
 1079|     66|	size_t extdsize;
 1080|     66|	int err;
 1081|     66|	uint16_t header_crc;
 1082|       |
 1083|     66|	if ((p = __archive_read_ahead(a, H3_FIXED_SIZE, NULL)) == NULL)
  ------------------
  |  | 1074|     66|#define H3_FIXED_SIZE		28
  ------------------
  |  Branch (1083:6): [True: 0, False: 66]
  ------------------
 1084|      0|		return (truncated_error(a));
 1085|       |
 1086|     66|	if (archive_le16dec(p + H3_FIELD_LEN_OFFSET) != 4)
  ------------------
  |  | 1068|     66|#define H3_FIELD_LEN_OFFSET	0
  ------------------
  |  Branch (1086:6): [True: 0, False: 66]
  ------------------
 1087|      0|		goto invalid;
 1088|     66|	lha->header_size = archive_le32dec(p + H3_HEADER_SIZE_OFFSET);
  ------------------
  |  | 1073|     66|#define H3_HEADER_SIZE_OFFSET	24
  ------------------
 1089|     66|	lha->compsize = archive_le32dec(p + H3_COMP_SIZE_OFFSET);
  ------------------
  |  | 1069|     66|#define H3_COMP_SIZE_OFFSET	7
  ------------------
 1090|     66|	lha->origsize = archive_le32dec(p + H3_ORIG_SIZE_OFFSET);
  ------------------
  |  | 1070|     66|#define H3_ORIG_SIZE_OFFSET	11
  ------------------
 1091|     66|	lha->mtime = archive_le32dec(p + H3_TIME_OFFSET);
  ------------------
  |  | 1071|     66|#define H3_TIME_OFFSET		15
  ------------------
 1092|     66|	lha->crc = archive_le16dec(p + H3_CRC_OFFSET);
  ------------------
  |  | 1072|     66|#define H3_CRC_OFFSET		21
  ------------------
 1093|     66|	lha->setflag |= CRC_IS_SET;
  ------------------
  |  |  164|     66|#define CRC_IS_SET		8
  ------------------
 1094|       |
 1095|     66|	if (lha->header_size < H3_FIXED_SIZE + 4)
  ------------------
  |  | 1074|     66|#define H3_FIXED_SIZE		28
  ------------------
  |  Branch (1095:6): [True: 0, False: 66]
  ------------------
 1096|      0|		goto invalid;
 1097|     66|	header_crc = lha_crc16(0, p, H3_FIXED_SIZE);
  ------------------
  |  | 1074|     66|#define H3_FIXED_SIZE		28
  ------------------
 1098|     66|	__archive_read_consume(a, H3_FIXED_SIZE);
  ------------------
  |  | 1074|     66|#define H3_FIXED_SIZE		28
  ------------------
 1099|       |
 1100|       |	/* Reject ridiculously large header */
 1101|     66|	if (lha->header_size > 65536) {
  ------------------
  |  Branch (1101:6): [True: 4, False: 62]
  ------------------
 1102|      4|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1103|      4|		    "LHa header size too large");
 1104|      4|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1105|      4|	}
 1106|       |
 1107|       |	/* Read extended headers */
 1108|     62|	err = lha_read_file_extended_header(a, lha, &header_crc, 4,
 1109|     62|		  lha->header_size - H3_FIXED_SIZE, &extdsize);
  ------------------
  |  | 1074|     62|#define H3_FIXED_SIZE		28
  ------------------
 1110|     62|	if (err < ARCHIVE_WARN)
  ------------------
  |  |  235|     62|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (1110:6): [True: 1, False: 61]
  ------------------
 1111|      1|		return (err);
 1112|       |
 1113|     61|	if (header_crc != lha->header_crc) {
  ------------------
  |  Branch (1113:6): [True: 61, 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|     61|	}
 1120|     61|	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|     62|}
archive_read_support_format_lha.c:lha_parse_linkname:
 1701|     28|{
 1702|     28|	wchar_t *	linkptr;
 1703|     28|	size_t 	symlen;
 1704|       |
 1705|     28|	linkptr = wcschr(pathname->s, L'|');
 1706|     28|	if (linkptr != NULL) {
  ------------------
  |  Branch (1706:6): [True: 28, False: 0]
  ------------------
 1707|     28|		symlen = wcslen(linkptr + 1);
 1708|     28|		archive_wstrncpy(linkname, linkptr+1, symlen);
  ------------------
  |  |  175|     28|	((as)->length = 0, archive_wstrncat((as), (p), (l)))
  ------------------
 1709|       |
 1710|     28|		*linkptr = 0;
 1711|     28|		pathname->length = wcslen(pathname->s);
 1712|       |
 1713|     28|		return (1);
 1714|     28|	}
 1715|      0|	return (0);
 1716|     28|}
archive_read_support_format_lha.c:lha_replace_path_separator:
  751|    290|{
  752|    290|	const wchar_t *wp;
  753|    290|	size_t i;
  754|       |
  755|    290|	if ((wp = archive_entry_pathname_w(entry)) != NULL) {
  ------------------
  |  Branch (755:6): [True: 290, False: 0]
  ------------------
  756|    290|		archive_wstrcpy(&(lha->ws), wp);
  ------------------
  |  |  167|    290|	archive_wstrncpy((as), (p), ((p) == NULL ? 0 : wcslen(p)))
  |  |  ------------------
  |  |  |  |  175|    580|	((as)->length = 0, archive_wstrncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (175:50): [True: 0, False: 290]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  757|    568|		for (i = 0; i < archive_strlen(&(lha->ws)); i++) {
  ------------------
  |  |  178|    568|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (757:15): [True: 278, False: 290]
  ------------------
  758|    278|			if (lha->ws.s[i] == L'\\')
  ------------------
  |  Branch (758:8): [True: 79, False: 199]
  ------------------
  759|     79|				lha->ws.s[i] = L'/';
  760|    278|		}
  761|    290|		archive_entry_copy_pathname_w(entry, lha->ws.s);
  762|    290|	}
  763|       |
  764|    290|	if ((wp = archive_entry_symlink_w(entry)) != NULL) {
  ------------------
  |  Branch (764:6): [True: 0, False: 290]
  ------------------
  765|      0|		archive_wstrcpy(&(lha->ws), wp);
  ------------------
  |  |  167|      0|	archive_wstrncpy((as), (p), ((p) == NULL ? 0 : wcslen(p)))
  |  |  ------------------
  |  |  |  |  175|      0|	((as)->length = 0, archive_wstrncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (175:50): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  766|      0|		for (i = 0; i < archive_strlen(&(lha->ws)); i++) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (766:15): [True: 0, False: 0]
  ------------------
  767|      0|			if (lha->ws.s[i] == L'\\')
  ------------------
  |  Branch (767:8): [True: 0, False: 0]
  ------------------
  768|      0|				lha->ws.s[i] = L'/';
  769|      0|		}
  770|      0|		archive_entry_copy_symlink_w(entry, lha->ws.s);
  771|      0|	}
  772|    290|}
archive_read_support_format_lha.c:archive_read_format_lha_read_data:
 1475|  24.9k|{
 1476|  24.9k|	struct lha *lha = a->format->data;
 1477|  24.9k|	int r;
 1478|       |
 1479|  24.9k|	if (lha->entry_unconsumed) {
  ------------------
  |  Branch (1479:6): [True: 1.39k, False: 23.5k]
  ------------------
 1480|       |		/* Consume as much as the decompressor actually used. */
 1481|  1.39k|		__archive_read_consume(a, lha->entry_unconsumed);
 1482|  1.39k|		lha->entry_unconsumed = 0;
 1483|  1.39k|	}
 1484|  24.9k|	if (lha->end_of_entry) {
  ------------------
  |  Branch (1484:6): [True: 836, False: 24.1k]
  ------------------
 1485|    836|		*offset = lha->entry_offset;
 1486|    836|		*size = 0;
 1487|    836|		*buff = NULL;
 1488|    836|		return (lha_end_of_entry(a));
 1489|    836|	}
 1490|       |
 1491|  24.1k|	if (lha->entry_is_compressed)
  ------------------
  |  Branch (1491:6): [True: 23.6k, False: 463]
  ------------------
 1492|  23.6k|		r =  lha_read_data_lzh(a, buff, size, offset);
 1493|    463|	else
 1494|       |		/* No compression. */
 1495|    463|		r =  lha_read_data_none(a, buff, size, offset);
 1496|  24.1k|	return (r);
 1497|  24.9k|}
archive_read_support_format_lha.c:lha_end_of_entry:
 1454|  1.25k|{
 1455|  1.25k|	struct lha *lha = a->format->data;
 1456|  1.25k|	int r = ARCHIVE_EOF;
  ------------------
  |  |  232|  1.25k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1457|       |
 1458|  1.25k|	if (!lha->end_of_entry_cleanup) {
  ------------------
  |  Branch (1458:6): [True: 1.21k, False: 32]
  ------------------
 1459|  1.21k|		if ((lha->setflag & CRC_IS_SET) &&
  ------------------
  |  |  164|  1.21k|#define CRC_IS_SET		8
  ------------------
  |  Branch (1459:7): [True: 998, False: 221]
  ------------------
 1460|    998|		    lha->crc != lha->entry_crc_calculated) {
  ------------------
  |  Branch (1460:7): [True: 948, False: 50]
  ------------------
 1461|    948|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    948|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1462|    948|			    "LHa data CRC error");
 1463|    948|			r = ARCHIVE_WARN;
  ------------------
  |  |  235|    948|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1464|    948|		}
 1465|       |
 1466|       |		/* End-of-entry cleanup done. */
 1467|  1.21k|		lha->end_of_entry_cleanup = 1;
 1468|  1.21k|	}
 1469|  1.25k|	return (r);
 1470|  1.25k|}
archive_read_support_format_lha.c:lha_read_data_lzh:
 1555|  23.6k|{
 1556|  23.6k|	struct lha *lha = a->format->data;
 1557|  23.6k|	ssize_t bytes_avail;
 1558|  23.6k|	int r;
 1559|       |
 1560|       |	/* If we haven't yet read any data, initialize the decompressor. */
 1561|  23.6k|	if (!lha->decompress_init) {
  ------------------
  |  Branch (1561:6): [True: 5.05k, False: 18.5k]
  ------------------
 1562|  5.05k|		r = lzh_decode_init(&(lha->strm), lha->method);
 1563|  5.05k|		switch (r) {
 1564|  4.72k|		case ARCHIVE_OK:
  ------------------
  |  |  233|  4.72k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1564:3): [True: 4.72k, False: 326]
  ------------------
 1565|  4.72k|			break;
 1566|    326|		case ARCHIVE_FAILED:
  ------------------
  |  |  237|    326|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (1566:3): [True: 326, False: 4.72k]
  ------------------
 1567|       |        		/* Unsupported compression. */
 1568|    326|			*buff = NULL;
 1569|    326|			*size = 0;
 1570|    326|			*offset = 0;
 1571|    326|			archive_set_error(&a->archive,
 1572|    326|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    326|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1573|    326|			    "Unsupported lzh compression method -%c%c%c-",
 1574|    326|			    lha->method[0], lha->method[1], lha->method[2]);
 1575|       |			/* We know compressed size; just skip it. */
 1576|    326|			archive_read_format_lha_read_data_skip(a);
 1577|    326|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|    326|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1578|      0|		default:
  ------------------
  |  Branch (1578:3): [True: 0, False: 5.05k]
  ------------------
 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|  5.05k|		}
 1584|       |		/* We've initialized decompression for this stream. */
 1585|  4.72k|		lha->decompress_init = 1;
 1586|  4.72k|		lha->strm.avail_out = 0;
 1587|  4.72k|	}
 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|  23.3k|	lha->strm.next_in = __archive_read_ahead(a, 1, &bytes_avail);
 1596|  23.3k|	if (bytes_avail <= 0) {
  ------------------
  |  Branch (1596:6): [True: 127, False: 23.1k]
  ------------------
 1597|    127|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    127|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1598|    127|		    "Truncated LHa file body");
 1599|    127|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    127|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1600|    127|	}
 1601|  23.1k|	if (bytes_avail > lha->entry_bytes_remaining)
  ------------------
  |  Branch (1601:6): [True: 22.5k, False: 610]
  ------------------
 1602|  22.5k|		bytes_avail = (ssize_t)lha->entry_bytes_remaining;
 1603|       |
 1604|  23.1k|	lha->strm.avail_in = (int)bytes_avail;
 1605|  23.1k|	lha->strm.total_in = 0;
 1606|  23.1k|	lha->strm.avail_out = 0;
 1607|       |
 1608|  23.1k|	r = lzh_decode(&(lha->strm), bytes_avail == lha->entry_bytes_remaining);
 1609|  23.1k|	switch (r) {
 1610|  18.5k|	case ARCHIVE_OK:
  ------------------
  |  |  233|  18.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1610:2): [True: 18.5k, False: 4.59k]
  ------------------
 1611|  18.5k|		break;
 1612|    415|	case ARCHIVE_EOF:
  ------------------
  |  |  232|    415|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (1612:2): [True: 415, False: 22.7k]
  ------------------
 1613|    415|		lha->end_of_entry = 1;
 1614|    415|		break;
 1615|  4.18k|	default:
  ------------------
  |  Branch (1615:2): [True: 4.18k, False: 19.0k]
  ------------------
 1616|  4.18k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  4.18k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1617|  4.18k|		    "Bad lzh data");
 1618|  4.18k|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  4.18k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1619|  23.1k|	}
 1620|  19.0k|	lha->entry_unconsumed = lha->strm.total_in;
 1621|  19.0k|	lha->entry_bytes_remaining -= lha->strm.total_in;
 1622|       |
 1623|  19.0k|	if (lha->strm.avail_out) {
  ------------------
  |  Branch (1623:6): [True: 18.4k, False: 539]
  ------------------
 1624|  18.4k|		*offset = lha->entry_offset;
 1625|  18.4k|		*size = lha->strm.avail_out;
 1626|  18.4k|		*buff = lha->strm.ref_ptr;
 1627|  18.4k|		lha->entry_crc_calculated =
 1628|  18.4k|		    lha_crc16(lha->entry_crc_calculated, *buff, *size);
 1629|  18.4k|		lha->entry_offset += *size;
 1630|  18.4k|	} else {
 1631|    539|		*offset = lha->entry_offset;
 1632|    539|		*size = 0;
 1633|    539|		*buff = NULL;
 1634|    539|		if (lha->end_of_entry)
  ------------------
  |  Branch (1634:7): [True: 415, False: 124]
  ------------------
 1635|    415|			return (lha_end_of_entry(a));
 1636|    539|	}
 1637|  18.5k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  18.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1638|  19.0k|}
archive_read_support_format_lha.c:lzh_decode_init:
 1884|  5.05k|{
 1885|  5.05k|	struct lzh_dec *ds;
 1886|  5.05k|	int w_bits, w_size;
 1887|       |
 1888|  5.05k|	if (strm->ds == NULL) {
  ------------------
  |  Branch (1888:6): [True: 408, False: 4.64k]
  ------------------
 1889|    408|		strm->ds = calloc(1, sizeof(*strm->ds));
 1890|    408|		if (strm->ds == NULL)
  ------------------
  |  Branch (1890:7): [True: 0, False: 408]
  ------------------
 1891|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1892|    408|	}
 1893|  5.05k|	ds = strm->ds;
 1894|  5.05k|	ds->error = ARCHIVE_FAILED;
  ------------------
  |  |  237|  5.05k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1895|  5.05k|	if (method == NULL || method[0] != 'l' || method[1] != 'h')
  ------------------
  |  Branch (1895:6): [True: 0, False: 5.05k]
  |  Branch (1895:24): [True: 0, False: 5.05k]
  |  Branch (1895:44): [True: 6, False: 5.04k]
  ------------------
 1896|      6|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      6|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1897|  5.04k|	switch (method[2]) {
 1898|  4.55k|	case '5':
  ------------------
  |  Branch (1898:2): [True: 4.55k, False: 490]
  ------------------
 1899|  4.55k|		w_bits = 13;/* 8KiB for window */
 1900|  4.55k|		break;
 1901|    125|	case '6':
  ------------------
  |  Branch (1901:2): [True: 125, False: 4.92k]
  ------------------
 1902|    125|		w_bits = 15;/* 32KiB for window */
 1903|    125|		break;
 1904|     45|	case '7':
  ------------------
  |  Branch (1904:2): [True: 45, False: 5.00k]
  ------------------
 1905|     45|		w_bits = 16;/* 64KiB for window */
 1906|     45|		break;
 1907|    320|	default:
  ------------------
  |  Branch (1907:2): [True: 320, False: 4.72k]
  ------------------
 1908|    320|		return (ARCHIVE_FAILED);/* Not supported. */
  ------------------
  |  |  237|    320|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1909|  5.04k|	}
 1910|  4.72k|	ds->error = ARCHIVE_FATAL;
  ------------------
  |  |  239|  4.72k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1911|       |	/* Expand a window size up to 128 KiB for decompressing process
 1912|       |	 * performance whatever its original window size is. */
 1913|  4.72k|	ds->w_size = 1U << 17;
 1914|  4.72k|	ds->w_mask = ds->w_size -1;
 1915|  4.72k|	if (ds->w_buff == NULL) {
  ------------------
  |  Branch (1915:6): [True: 387, False: 4.33k]
  ------------------
 1916|    387|		ds->w_buff = malloc(ds->w_size);
 1917|    387|		if (ds->w_buff == NULL)
  ------------------
  |  Branch (1917:7): [True: 0, False: 387]
  ------------------
 1918|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1919|    387|	}
 1920|  4.72k|	w_size = 1U << w_bits;
 1921|  4.72k|	memset(ds->w_buff + ds->w_size - w_size, 0x20, w_size);
 1922|  4.72k|	ds->w_pos = 0;
 1923|  4.72k|	ds->state = 0;
 1924|  4.72k|	ds->pos_pt_len_size = w_bits + 1;
 1925|  4.72k|	ds->pos_pt_len_bits = (w_bits == 15 || w_bits == 16)? 5: 4;
  ------------------
  |  Branch (1925:25): [True: 125, False: 4.60k]
  |  Branch (1925:41): [True: 45, False: 4.55k]
  ------------------
 1926|  4.72k|	ds->literal_pt_len_size = PT_BITLEN_SIZE;
  ------------------
  |  |   65|  4.72k|#define PT_BITLEN_SIZE		(3 + 16)
  ------------------
 1927|  4.72k|	ds->literal_pt_len_bits = 5;
 1928|  4.72k|	ds->br.cache_buffer = 0;
 1929|  4.72k|	ds->br.cache_avail = 0;
 1930|       |
 1931|  4.72k|	if (lzh_huffman_init(&(ds->lt), LT_BITLEN_SIZE, 16)
  ------------------
  |  |   62|  4.72k|#define LT_BITLEN_SIZE		(UCHAR_MAX + 1 + MAXMATCH - MINMATCH + 1)
  |  |  ------------------
  |  |  |  |   50|  4.72k|#define MAXMATCH		256	/* Maximum match length. */
  |  |  ------------------
  |  |               #define LT_BITLEN_SIZE		(UCHAR_MAX + 1 + MAXMATCH - MINMATCH + 1)
  |  |  ------------------
  |  |  |  |   51|  4.72k|#define MINMATCH		3	/* Minimum match length. */
  |  |  ------------------
  ------------------
  |  Branch (1931:6): [True: 0, False: 4.72k]
  ------------------
 1932|  4.72k|	    != ARCHIVE_OK)
  ------------------
  |  |  233|  4.72k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1933|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1934|  4.72k|	ds->lt.len_bits = 9;
 1935|  4.72k|	if (lzh_huffman_init(&(ds->pt), PT_BITLEN_SIZE, 16)
  ------------------
  |  |   65|  4.72k|#define PT_BITLEN_SIZE		(3 + 16)
  ------------------
  |  Branch (1935:6): [True: 0, False: 4.72k]
  ------------------
 1936|  4.72k|	    != ARCHIVE_OK)
  ------------------
  |  |  233|  4.72k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1937|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1938|  4.72k|	ds->error = 0;
 1939|       |
 1940|  4.72k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.72k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1941|  4.72k|}
archive_read_support_format_lha.c:lzh_huffman_init:
 2565|  9.45k|{
 2566|  9.45k|	int bits;
 2567|       |
 2568|  9.45k|	if (hf->bitlen == NULL) {
  ------------------
  |  Branch (2568:6): [True: 774, False: 8.67k]
  ------------------
 2569|    774|		hf->bitlen = malloc(len_size * sizeof(hf->bitlen[0]));
 2570|    774|		if (hf->bitlen == NULL)
  ------------------
  |  Branch (2570:7): [True: 0, False: 774]
  ------------------
 2571|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2572|    774|	}
 2573|  9.45k|	if (hf->tbl == NULL) {
  ------------------
  |  Branch (2573:6): [True: 774, False: 8.67k]
  ------------------
 2574|    774|		if (tbl_bits < HTBL_BITS)
  ------------------
  |  |  114|    774|#define HTBL_BITS	10
  ------------------
  |  Branch (2574:7): [True: 0, False: 774]
  ------------------
 2575|      0|			bits = tbl_bits;
 2576|    774|		else
 2577|    774|			bits = HTBL_BITS;
  ------------------
  |  |  114|    774|#define HTBL_BITS	10
  ------------------
 2578|    774|		hf->tbl = malloc(((size_t)1 << bits) * sizeof(hf->tbl[0]));
 2579|    774|		if (hf->tbl == NULL)
  ------------------
  |  Branch (2579:7): [True: 0, False: 774]
  ------------------
 2580|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2581|    774|	}
 2582|  9.45k|	if (hf->tree == NULL && tbl_bits > HTBL_BITS) {
  ------------------
  |  |  114|    774|#define HTBL_BITS	10
  ------------------
  |  Branch (2582:6): [True: 774, False: 8.67k]
  |  Branch (2582:26): [True: 774, False: 0]
  ------------------
 2583|    774|		hf->tree_avail = 1 << (tbl_bits - HTBL_BITS + 4);
  ------------------
  |  |  114|    774|#define HTBL_BITS	10
  ------------------
 2584|    774|		hf->tree = malloc(hf->tree_avail * sizeof(hf->tree[0]));
 2585|    774|		if (hf->tree == NULL)
  ------------------
  |  Branch (2585:7): [True: 0, False: 774]
  ------------------
 2586|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2587|    774|	}
 2588|  9.45k|	hf->len_size = (int)len_size;
 2589|  9.45k|	hf->tbl_bits = tbl_bits;
 2590|  9.45k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  9.45k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2591|  9.45k|}
archive_read_support_format_lha.c:lzh_decode:
 2112|  23.1k|{
 2113|  23.1k|	struct lzh_dec *ds = strm->ds;
 2114|  23.1k|	int avail_in;
 2115|  23.1k|	int r;
 2116|       |
 2117|  23.1k|	if (ds->error)
  ------------------
  |  Branch (2117:6): [True: 0, False: 23.1k]
  ------------------
 2118|      0|		return (ds->error);
 2119|       |
 2120|  23.1k|	avail_in = strm->avail_in;
 2121|  31.5k|	do {
 2122|  31.5k|		if (ds->state < ST_GET_LITERAL)
  ------------------
  |  | 2105|  31.5k|#define ST_GET_LITERAL		9
  ------------------
  |  Branch (2122:7): [True: 8.97k, False: 22.5k]
  ------------------
 2123|  8.97k|			r = lzh_read_blocks(strm, last);
 2124|  22.5k|		else
 2125|  22.5k|			r = lzh_decode_blocks(strm, last);
 2126|  31.5k|	} while (r == 100);
  ------------------
  |  Branch (2126:11): [True: 8.34k, False: 23.1k]
  ------------------
 2127|  23.1k|	strm->total_in += avail_in - strm->avail_in;
 2128|  23.1k|	return (r);
 2129|  23.1k|}
archive_read_support_format_lha.c:lzh_read_blocks:
 2140|  8.97k|{
 2141|  8.97k|	struct lzh_dec *ds = strm->ds;
 2142|  8.97k|	struct lzh_br *br = &(ds->br);
 2143|  8.97k|	int c = 0, i;
 2144|  8.97k|	unsigned rbits;
 2145|       |
 2146|  25.9k|	for (;;) {
 2147|  25.9k|		switch (ds->state) {
  ------------------
  |  Branch (2147:11): [True: 25.9k, False: 0]
  ------------------
 2148|  8.97k|		case ST_RD_BLOCK:
  ------------------
  |  | 2096|  8.97k|#define ST_RD_BLOCK		0
  ------------------
  |  Branch (2148:3): [True: 8.97k, False: 16.9k]
  ------------------
 2149|       |			/*
 2150|       |			 * Read a block number indicates how many blocks
 2151|       |			 * we will handle. The block is composed of a
 2152|       |			 * literal and a match, sometimes a literal only
 2153|       |			 * in particular, there are no reference data at
 2154|       |			 * the beginning of the decompression.
 2155|       |			 */
 2156|  8.97k|			if (!lzh_br_read_ahead_0(strm, br, 16)) {
  ------------------
  |  | 1977|  8.97k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  ------------------
  |  |  |  | 1963|  17.9k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1963:27): [True: 3.25k, False: 5.71k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (1977:26): [True: 4.80k, False: 910]
  |  |  ------------------
  ------------------
 2157|    910|				if (!last)
  ------------------
  |  Branch (2157:9): [True: 19, False: 891]
  ------------------
 2158|       |					/* We need following data. */
 2159|     19|					return (ARCHIVE_OK);
  ------------------
  |  |  233|     19|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2160|    891|				if (lzh_br_has(br, 8)) {
  ------------------
  |  | 1963|    891|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  ------------------
  |  |  |  Branch (1963:27): [True: 60, False: 831]
  |  |  ------------------
  ------------------
 2161|       |					/*
 2162|       |					 * It seems there are extra bits.
 2163|       |					 *  1. Compressed data is broken.
 2164|       |					 *  2. `last' flag does not properly
 2165|       |					 *     set.
 2166|       |					 */
 2167|     60|					goto failed;
 2168|     60|				}
 2169|    831|				if (ds->w_pos > 0) {
  ------------------
  |  Branch (2169:9): [True: 416, False: 415]
  ------------------
 2170|    416|					lzh_emit_window(strm, ds->w_pos);
 2171|    416|					ds->w_pos = 0;
 2172|    416|					return (ARCHIVE_OK);
  ------------------
  |  |  233|    416|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2173|    416|				}
 2174|       |				/* End of compressed data; we have completely
 2175|       |				 * handled all compressed data. */
 2176|    415|				return (ARCHIVE_EOF);
  ------------------
  |  |  232|    415|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2177|    831|			}
 2178|  8.06k|			ds->blocks_avail = lzh_br_bits(br, 16);
  ------------------
  |  | 1966|  8.06k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1967|  8.06k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2179|  8.06k|			if (ds->blocks_avail == 0)
  ------------------
  |  Branch (2179:8): [True: 68, False: 7.99k]
  ------------------
 2180|     68|				goto failed;
 2181|  7.99k|			lzh_br_consume(br, 16);
  ------------------
  |  | 1985|  7.99k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2182|       |			/*
 2183|       |			 * Read a literal table compressed in huffman
 2184|       |			 * coding.
 2185|       |			 */
 2186|  7.99k|			ds->pt.len_size = ds->literal_pt_len_size;
 2187|  7.99k|			ds->pt.len_bits = ds->literal_pt_len_bits;
 2188|  7.99k|			ds->reading_position = 0;
 2189|       |			/* FALL THROUGH */
 2190|  13.1k|		case ST_RD_PT_1:
  ------------------
  |  | 2097|  13.1k|#define ST_RD_PT_1		1
  ------------------
  |  Branch (2190:3): [True: 5.16k, False: 20.7k]
  ------------------
 2191|       |			/* Note: ST_RD_PT_1, ST_RD_PT_2 and ST_RD_PT_4 are
 2192|       |			 * used in reading both a literal table and a
 2193|       |			 * position table. */
 2194|  13.1k|			if (!lzh_br_read_ahead(strm, br, ds->pt.len_bits)) {
  ------------------
  |  | 1982|  13.1k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1977|  26.3k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1963|  26.3k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1963:27): [True: 13.0k, False: 134]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1977:26): [True: 50, False: 84]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1963|     84|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1963:27): [True: 72, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2195|     12|				if (last)
  ------------------
  |  Branch (2195:9): [True: 11, False: 1]
  ------------------
 2196|     11|					goto failed;/* Truncated data. */
 2197|      1|				ds->state = ST_RD_PT_1;
  ------------------
  |  | 2097|      1|#define ST_RD_PT_1		1
  ------------------
 2198|      1|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2199|     12|			}
 2200|  13.1k|			ds->pt.len_avail = lzh_br_bits(br, ds->pt.len_bits);
  ------------------
  |  | 1966|  13.1k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1967|  13.1k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2201|  13.1k|			lzh_br_consume(br, ds->pt.len_bits);
  ------------------
  |  | 1985|  13.1k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2202|       |			/* FALL THROUGH */
 2203|  13.1k|		case ST_RD_PT_2:
  ------------------
  |  | 2098|  13.1k|#define ST_RD_PT_2		2
  ------------------
  |  Branch (2203:3): [True: 0, False: 25.9k]
  ------------------
 2204|  13.1k|			if (ds->pt.len_avail == 0) {
  ------------------
  |  Branch (2204:8): [True: 2.48k, False: 10.6k]
  ------------------
 2205|       |				/* There is no bitlen. */
 2206|  2.48k|				if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 1982|  2.48k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1977|  4.96k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1963|  4.96k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1963:27): [True: 2.43k, False: 50]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1977:26): [True: 5, False: 45]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1963|     45|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1963:27): [True: 35, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2207|  2.48k|				    ds->pt.len_bits)) {
 2208|     10|					if (last)
  ------------------
  |  Branch (2208:10): [True: 10, False: 0]
  ------------------
 2209|     10|						goto failed;/* Truncated data.*/
 2210|      0|					ds->state = ST_RD_PT_2;
  ------------------
  |  | 2098|      0|#define ST_RD_PT_2		2
  ------------------
 2211|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2212|     10|				}
 2213|  2.47k|				if (!lzh_make_fake_table(&(ds->pt),
  ------------------
  |  Branch (2213:9): [True: 67, False: 2.40k]
  ------------------
 2214|  2.47k|				    lzh_br_bits(br, ds->pt.len_bits)))
  ------------------
  |  | 1966|  2.47k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1967|  2.47k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2215|     67|					goto failed;/* Invalid data. */
 2216|  2.40k|				lzh_br_consume(br, ds->pt.len_bits);
  ------------------
  |  | 1985|  2.40k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2217|  2.40k|				if (ds->reading_position)
  ------------------
  |  Branch (2217:9): [True: 822, False: 1.58k]
  ------------------
 2218|    822|					ds->state = ST_GET_LITERAL;
  ------------------
  |  | 2105|    822|#define ST_GET_LITERAL		9
  ------------------
 2219|  1.58k|				else
 2220|  1.58k|					ds->state = ST_RD_LITERAL_1;
  ------------------
  |  | 2101|  1.58k|#define ST_RD_LITERAL_1		5
  ------------------
 2221|  2.40k|				break;
 2222|  10.6k|			} else if (ds->pt.len_avail > ds->pt.len_size)
  ------------------
  |  Branch (2222:15): [True: 200, False: 10.4k]
  ------------------
 2223|    200|				goto failed;/* Invalid data. */
 2224|  10.4k|			ds->loop = 0;
 2225|  10.4k|			memset(ds->pt.freq, 0, sizeof(ds->pt.freq));
 2226|  10.4k|			if (ds->pt.len_avail < 3 ||
  ------------------
  |  Branch (2226:8): [True: 37, False: 10.4k]
  ------------------
 2227|  10.4k|			    ds->pt.len_size == ds->pos_pt_len_size) {
  ------------------
  |  Branch (2227:8): [True: 4.30k, False: 6.11k]
  ------------------
 2228|  4.34k|				ds->state = ST_RD_PT_4;
  ------------------
  |  | 2100|  4.34k|#define ST_RD_PT_4		4
  ------------------
 2229|  4.34k|				break;
 2230|  4.34k|			}
 2231|       |			/* FALL THROUGH */
 2232|  6.11k|		case ST_RD_PT_3:
  ------------------
  |  | 2099|  6.11k|#define ST_RD_PT_3		3
  ------------------
  |  Branch (2232:3): [True: 0, False: 25.9k]
  ------------------
 2233|  6.11k|			ds->loop = lzh_read_pt_bitlen(strm, ds->loop, 3);
 2234|  6.11k|			if (ds->loop < 3) {
  ------------------
  |  Branch (2234:8): [True: 18, False: 6.09k]
  ------------------
 2235|     18|				if (ds->loop < 0 || last)
  ------------------
  |  Branch (2235:9): [True: 9, False: 9]
  |  Branch (2235:25): [True: 9, False: 0]
  ------------------
 2236|     18|					goto failed;/* Invalid data. */
 2237|       |				/* Not completed, get following data. */
 2238|      0|				ds->state = ST_RD_PT_3;
  ------------------
  |  | 2099|      0|#define ST_RD_PT_3		3
  ------------------
 2239|      0|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2240|     18|			}
 2241|       |			/* There are some null in bitlen of the literal. */
 2242|  6.09k|			if (!lzh_br_read_ahead(strm, br, 2)) {
  ------------------
  |  | 1982|  6.09k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1977|  12.1k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1963|  12.1k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1963:27): [True: 5.98k, False: 118]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1977:26): [True: 11, False: 107]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1963|    107|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1963:27): [True: 105, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2243|      2|				if (last)
  ------------------
  |  Branch (2243:9): [True: 1, False: 1]
  ------------------
 2244|      1|					goto failed;/* Truncated data. */
 2245|      1|				ds->state = ST_RD_PT_3;
  ------------------
  |  | 2099|      1|#define ST_RD_PT_3		3
  ------------------
 2246|      1|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2247|      2|			}
 2248|  6.09k|			c = lzh_br_bits(br, 2);
  ------------------
  |  | 1966|  6.09k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1967|  6.09k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2249|  6.09k|			lzh_br_consume(br, 2);
  ------------------
  |  | 1985|  6.09k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2250|  6.09k|			if (c > ds->pt.len_avail - 3)
  ------------------
  |  Branch (2250:8): [True: 9, False: 6.08k]
  ------------------
 2251|      9|				goto failed;/* Invalid data. */
 2252|  16.2k|			for (i = 3; c-- > 0 ;)
  ------------------
  |  Branch (2252:16): [True: 10.1k, False: 6.08k]
  ------------------
 2253|  10.1k|				ds->pt.bitlen[i++] = 0;
 2254|  6.08k|			ds->loop = i;
 2255|       |			/* FALL THROUGH */
 2256|  10.4k|		case ST_RD_PT_4:
  ------------------
  |  | 2100|  10.4k|#define ST_RD_PT_4		4
  ------------------
  |  Branch (2256:3): [True: 4.34k, False: 21.5k]
  ------------------
 2257|  10.4k|			ds->loop = lzh_read_pt_bitlen(strm, ds->loop,
 2258|  10.4k|			    ds->pt.len_avail);
 2259|  10.4k|			if (ds->loop < ds->pt.len_avail) {
  ------------------
  |  Branch (2259:8): [True: 647, False: 9.78k]
  ------------------
 2260|    647|				if (ds->loop < 0 || last)
  ------------------
  |  Branch (2260:9): [True: 358, False: 289]
  |  Branch (2260:25): [True: 284, False: 5]
  ------------------
 2261|    642|					goto failed;/* Invalid data. */
 2262|       |				/* Not completed, get following data. */
 2263|      5|				ds->state = ST_RD_PT_4;
  ------------------
  |  | 2100|      5|#define ST_RD_PT_4		4
  ------------------
 2264|      5|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      5|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2265|    647|			}
 2266|  9.78k|			if (!lzh_make_huffman_table(&(ds->pt)))
  ------------------
  |  Branch (2266:8): [True: 1.74k, False: 8.04k]
  ------------------
 2267|  1.74k|				goto failed;/* Invalid data */
 2268|  8.04k|			if (ds->reading_position) {
  ------------------
  |  Branch (2268:8): [True: 3.69k, False: 4.35k]
  ------------------
 2269|  3.69k|				ds->state = ST_GET_LITERAL;
  ------------------
  |  | 2105|  3.69k|#define ST_GET_LITERAL		9
  ------------------
 2270|  3.69k|				break;
 2271|  3.69k|			}
 2272|       |			/* FALL THROUGH */
 2273|  5.93k|		case ST_RD_LITERAL_1:
  ------------------
  |  | 2101|  5.93k|#define ST_RD_LITERAL_1		5
  ------------------
  |  Branch (2273:3): [True: 1.58k, False: 24.3k]
  ------------------
 2274|  5.93k|			if (!lzh_br_read_ahead(strm, br, ds->lt.len_bits)) {
  ------------------
  |  | 1982|  5.93k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1977|  11.8k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1963|  11.8k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1963:27): [True: 5.39k, False: 545]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1977:26): [True: 6, False: 539]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1963|    539|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1963:27): [True: 457, False: 82]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2275|     82|				if (last)
  ------------------
  |  Branch (2275:9): [True: 81, False: 1]
  ------------------
 2276|     81|					goto failed;/* Truncated data. */
 2277|      1|				ds->state = ST_RD_LITERAL_1;
  ------------------
  |  | 2101|      1|#define ST_RD_LITERAL_1		5
  ------------------
 2278|      1|				return (ARCHIVE_OK);
  ------------------
  |  |  233|      1|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2279|     82|			}
 2280|  5.85k|			ds->lt.len_avail = lzh_br_bits(br, ds->lt.len_bits);
  ------------------
  |  | 1966|  5.85k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1967|  5.85k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2281|  5.85k|			lzh_br_consume(br, ds->lt.len_bits);
  ------------------
  |  | 1985|  5.85k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2282|       |			/* FALL THROUGH */
 2283|  5.85k|		case ST_RD_LITERAL_2:
  ------------------
  |  | 2102|  5.85k|#define ST_RD_LITERAL_2		6
  ------------------
  |  Branch (2283:3): [True: 0, False: 25.9k]
  ------------------
 2284|  5.85k|			if (ds->lt.len_avail == 0) {
  ------------------
  |  Branch (2284:8): [True: 1.36k, False: 4.48k]
  ------------------
 2285|       |				/* There is no bitlen. */
 2286|  1.36k|				if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 1982|  1.36k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1977|  2.73k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1963|  2.73k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1963:27): [True: 642, False: 725]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1977:26): [True: 245, False: 480]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1963|    480|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1963:27): [True: 479, False: 1]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2287|  1.36k|				    ds->lt.len_bits)) {
 2288|      1|					if (last)
  ------------------
  |  Branch (2288:10): [True: 1, False: 0]
  ------------------
 2289|      1|						goto failed;/* Truncated data.*/
 2290|      0|					ds->state = ST_RD_LITERAL_2;
  ------------------
  |  | 2102|      0|#define ST_RD_LITERAL_2		6
  ------------------
 2291|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2292|      1|				}
 2293|  1.36k|				if (!lzh_make_fake_table(&(ds->lt),
  ------------------
  |  Branch (2293:9): [True: 17, False: 1.34k]
  ------------------
 2294|  1.36k|				    lzh_br_bits(br, ds->lt.len_bits)))
  ------------------
  |  | 1966|  1.36k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1967|  1.36k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2295|     17|					goto failed;/* Invalid data */
 2296|  1.34k|				lzh_br_consume(br, ds->lt.len_bits);
  ------------------
  |  | 1985|  1.34k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2297|  1.34k|				ds->state = ST_RD_POS_DATA_1;
  ------------------
  |  | 2104|  1.34k|#define ST_RD_POS_DATA_1	8
  ------------------
 2298|  1.34k|				break;
 2299|  4.48k|			} else if (ds->lt.len_avail > ds->lt.len_size)
  ------------------
  |  Branch (2299:15): [True: 44, False: 4.44k]
  ------------------
 2300|     44|				goto failed;/* Invalid data */
 2301|  4.44k|			ds->loop = 0;
 2302|  4.44k|			memset(ds->lt.freq, 0, sizeof(ds->lt.freq));
 2303|       |			/* FALL THROUGH */
 2304|  4.44k|		case ST_RD_LITERAL_3:
  ------------------
  |  | 2103|  4.44k|#define ST_RD_LITERAL_3		7
  ------------------
  |  Branch (2304:3): [True: 0, False: 25.9k]
  ------------------
 2305|  4.44k|			i = ds->loop;
 2306|   217k|			while (i < ds->lt.len_avail) {
  ------------------
  |  Branch (2306:11): [True: 213k, False: 3.92k]
  ------------------
 2307|   213k|				if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 1982|   213k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1977|   426k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1963|   426k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1963:27): [True: 200k, False: 12.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1977:26): [True: 12.3k, False: 300]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1963|    300|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1963:27): [True: 135, False: 165]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2308|   213k|				    ds->pt.max_bits)) {
 2309|    165|					if (last)
  ------------------
  |  Branch (2309:10): [True: 151, False: 14]
  ------------------
 2310|    151|						goto failed;/* Truncated data.*/
 2311|     14|					ds->loop = i;
 2312|     14|					ds->state = ST_RD_LITERAL_3;
  ------------------
  |  | 2103|     14|#define ST_RD_LITERAL_3		7
  ------------------
 2313|     14|					return (ARCHIVE_OK);
  ------------------
  |  |  233|     14|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2314|    165|				}
 2315|   213k|				rbits = lzh_br_bits(br, ds->pt.max_bits);
  ------------------
  |  | 1966|   213k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1967|   213k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2316|   213k|				c = lzh_decode_huffman(&(ds->pt), rbits);
 2317|   213k|				if (c > 2) {
  ------------------
  |  Branch (2317:9): [True: 143k, False: 69.5k]
  ------------------
 2318|       |					/* Note: 'c' will never be more than
 2319|       |					 * eighteen since it's limited by
 2320|       |					 * PT_BITLEN_SIZE, which is being set
 2321|       |					 * to ds->pt.len_size through
 2322|       |					 * ds->literal_pt_len_size. */
 2323|   143k|					lzh_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 1985|   143k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2324|   143k|					c -= 2;
 2325|   143k|					ds->lt.freq[c]++;
 2326|   143k|					ds->lt.bitlen[i++] = c;
 2327|   143k|				} else if (c == 0) {
  ------------------
  |  Branch (2327:16): [True: 26.6k, False: 42.8k]
  ------------------
 2328|  26.6k|					lzh_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 1985|  26.6k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2329|  26.6k|					ds->lt.bitlen[i++] = 0;
 2330|  42.8k|				} else {
 2331|       |					/* c == 1 or c == 2 */
 2332|  42.8k|					int n = (c == 1)?4:9;
  ------------------
  |  Branch (2332:14): [True: 34.4k, False: 8.36k]
  ------------------
 2333|  42.8k|					if (!lzh_br_read_ahead(strm, br,
  ------------------
  |  | 1982|  42.8k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1977|  85.7k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1963|  85.7k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1963:27): [True: 42.5k, False: 298]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1977:26): [True: 130, False: 168]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1963|    168|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1963:27): [True: 85, False: 83]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2334|  42.8k|					     ds->pt.bitlen[c] + n)) {
 2335|     83|						if (last) /* Truncated data. */
  ------------------
  |  Branch (2335:11): [True: 80, False: 3]
  ------------------
 2336|     80|							goto failed;
 2337|      3|						ds->loop = i;
 2338|      3|						ds->state = ST_RD_LITERAL_3;
  ------------------
  |  | 2103|      3|#define ST_RD_LITERAL_3		7
  ------------------
 2339|      3|						return (ARCHIVE_OK);
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2340|     83|					}
 2341|  42.7k|					lzh_br_consume(br, ds->pt.bitlen[c]);
  ------------------
  |  | 1985|  42.7k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2342|  42.7k|					c = lzh_br_bits(br, n);
  ------------------
  |  | 1966|  42.7k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1967|  42.7k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2343|  42.7k|					lzh_br_consume(br, n);
  ------------------
  |  | 1985|  42.7k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2344|  42.7k|					c += (n == 4)?3:20;
  ------------------
  |  Branch (2344:11): [True: 34.4k, False: 8.33k]
  ------------------
 2345|  42.7k|					if (i + c > ds->lt.len_avail)
  ------------------
  |  Branch (2345:10): [True: 266, False: 42.5k]
  ------------------
 2346|    266|						goto failed;/* Invalid data */
 2347|  42.5k|					memset(&(ds->lt.bitlen[i]), 0, c);
 2348|  42.5k|					i += c;
 2349|  42.5k|				}
 2350|   213k|			}
 2351|  3.92k|			if (i > ds->lt.len_avail ||
  ------------------
  |  Branch (2351:8): [True: 0, False: 3.92k]
  ------------------
 2352|  3.92k|			    !lzh_make_huffman_table(&(ds->lt)))
  ------------------
  |  Branch (2352:8): [True: 112, False: 3.81k]
  ------------------
 2353|    112|				goto failed;/* Invalid data */
 2354|       |			/* FALL THROUGH */
 2355|  5.16k|		case ST_RD_POS_DATA_1:
  ------------------
  |  | 2104|  5.16k|#define ST_RD_POS_DATA_1	8
  ------------------
  |  Branch (2355:3): [True: 1.34k, False: 24.5k]
  ------------------
 2356|       |			/*
 2357|       |			 * Read a position table compressed in huffman
 2358|       |			 * coding.
 2359|       |			 */
 2360|  5.16k|			ds->pt.len_size = ds->pos_pt_len_size;
 2361|  5.16k|			ds->pt.len_bits = ds->pos_pt_len_bits;
 2362|  5.16k|			ds->reading_position = 1;
 2363|  5.16k|			ds->state = ST_RD_PT_1;
  ------------------
  |  | 2097|  5.16k|#define ST_RD_PT_1		1
  ------------------
 2364|  5.16k|			break;
 2365|  4.51k|		case ST_GET_LITERAL:
  ------------------
  |  | 2105|  4.51k|#define ST_GET_LITERAL		9
  ------------------
  |  Branch (2365:3): [True: 4.51k, False: 21.4k]
  ------------------
 2366|  4.51k|			return (100);
 2367|  25.9k|		}
 2368|  25.9k|	}
 2369|  3.57k|failed:
 2370|  3.57k|	return (ds->error = ARCHIVE_FAILED);
  ------------------
  |  |  237|  3.57k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2371|  8.97k|}
archive_read_support_format_lha.c:lzh_br_fillup:
 2005|  56.0k|{
 2006|  56.0k|	int n = CACHE_BITS - br->cache_avail;
  ------------------
  |  |   92|  56.0k|#define CACHE_BITS		(8 * sizeof(CACHE_TYPE))
  ------------------
 2007|       |
 2008|  67.0k|	for (;;) {
 2009|  67.0k|		const int x = n >> 3;
 2010|  67.0k|		if (strm->avail_in >= x) {
  ------------------
  |  Branch (2010:7): [True: 48.9k, False: 18.0k]
  ------------------
 2011|  48.9k|			switch (x) {
 2012|  9.65k|			case 8:
  ------------------
  |  Branch (2012:4): [True: 9.65k, False: 39.3k]
  ------------------
 2013|  9.65k|				br->cache_buffer =
 2014|  9.65k|				    ((uint64_t)strm->next_in[0]) << 56 |
 2015|  9.65k|				    ((uint64_t)strm->next_in[1]) << 48 |
 2016|  9.65k|				    ((uint64_t)strm->next_in[2]) << 40 |
 2017|  9.65k|				    ((uint64_t)strm->next_in[3]) << 32 |
 2018|  9.65k|				    ((uint32_t)strm->next_in[4]) << 24 |
 2019|  9.65k|				    ((uint32_t)strm->next_in[5]) << 16 |
 2020|  9.65k|				    ((uint32_t)strm->next_in[6]) << 8 |
 2021|  9.65k|				     (uint32_t)strm->next_in[7];
 2022|  9.65k|				strm->next_in += 8;
 2023|  9.65k|				strm->avail_in -= 8;
 2024|  9.65k|				br->cache_avail += 8 * 8;
 2025|  9.65k|				return (1);
 2026|  38.9k|			case 7:
  ------------------
  |  Branch (2026:4): [True: 38.9k, False: 10.0k]
  ------------------
 2027|  38.9k|				br->cache_buffer =
 2028|  38.9k|		 		   (br->cache_buffer << 56) |
 2029|  38.9k|				    ((uint64_t)strm->next_in[0]) << 48 |
 2030|  38.9k|				    ((uint64_t)strm->next_in[1]) << 40 |
 2031|  38.9k|				    ((uint64_t)strm->next_in[2]) << 32 |
 2032|  38.9k|				    ((uint64_t)strm->next_in[3]) << 24 |
 2033|  38.9k|				    ((uint64_t)strm->next_in[4]) << 16 |
 2034|  38.9k|				    ((uint64_t)strm->next_in[5]) << 8 |
 2035|  38.9k|				     (uint64_t)strm->next_in[6];
 2036|  38.9k|				strm->next_in += 7;
 2037|  38.9k|				strm->avail_in -= 7;
 2038|  38.9k|				br->cache_avail += 7 * 8;
 2039|  38.9k|				return (1);
 2040|    423|			case 6:
  ------------------
  |  Branch (2040:4): [True: 423, False: 48.5k]
  ------------------
 2041|    423|				br->cache_buffer =
 2042|    423|		 		   (br->cache_buffer << 48) |
 2043|    423|				    ((uint64_t)strm->next_in[0]) << 40 |
 2044|    423|				    ((uint64_t)strm->next_in[1]) << 32 |
 2045|    423|				    ((uint64_t)strm->next_in[2]) << 24 |
 2046|    423|				    ((uint64_t)strm->next_in[3]) << 16 |
 2047|    423|				    ((uint64_t)strm->next_in[4]) << 8 |
 2048|    423|				     (uint64_t)strm->next_in[5];
 2049|    423|				strm->next_in += 6;
 2050|    423|				strm->avail_in -= 6;
 2051|    423|				br->cache_avail += 6 * 8;
 2052|    423|				return (1);
 2053|      0|			case 0:
  ------------------
  |  Branch (2053:4): [True: 0, False: 48.9k]
  ------------------
 2054|       |				/* We have enough compressed data in
 2055|       |				 * the cache buffer.*/
 2056|      0|				return (1);
 2057|      0|			default:
  ------------------
  |  Branch (2057:4): [True: 0, False: 48.9k]
  ------------------
 2058|      0|				break;
 2059|  48.9k|			}
 2060|  48.9k|		}
 2061|  18.0k|		if (strm->avail_in == 0) {
  ------------------
  |  Branch (2061:7): [True: 7.04k, False: 11.0k]
  ------------------
 2062|       |			/* There is not enough compressed data to fill up the
 2063|       |			 * cache buffer. */
 2064|  7.04k|			return (0);
 2065|  7.04k|		}
 2066|  11.0k|		br->cache_buffer =
 2067|  11.0k|		   (br->cache_buffer << 8) | *strm->next_in++;
 2068|  11.0k|		strm->avail_in--;
 2069|  11.0k|		br->cache_avail += 8;
 2070|  11.0k|		n -= 8;
 2071|  11.0k|	}
 2072|  56.0k|}
archive_read_support_format_lha.c:lzh_emit_window:
 2133|  18.4k|{
 2134|  18.4k|	strm->ref_ptr = strm->ds->w_buff;
 2135|  18.4k|	strm->avail_out = (int)s;
 2136|  18.4k|}
archive_read_support_format_lha.c:lzh_make_fake_table:
 2707|  3.84k|{
 2708|  3.84k|	if (c >= hf->len_size)
  ------------------
  |  Branch (2708:6): [True: 84, False: 3.75k]
  ------------------
 2709|     84|		return (0);
 2710|  3.75k|	hf->tbl[0] = c;
 2711|  3.75k|	hf->max_bits = 0;
 2712|  3.75k|	hf->shift_bits = 0;
 2713|  3.75k|	hf->bitlen[hf->tbl[0]] = 0;
 2714|  3.75k|	return (1);
 2715|  3.84k|}
archive_read_support_format_lha.c:lzh_read_pt_bitlen:
 2669|  16.5k|{
 2670|  16.5k|	struct lzh_dec *ds = strm->ds;
 2671|  16.5k|	struct lzh_br *br = &(ds->br);
 2672|  16.5k|	int c, i;
 2673|       |
 2674|  99.1k|	for (i = start; i < end; ) {
  ------------------
  |  Branch (2674:18): [True: 83.2k, False: 15.8k]
  ------------------
 2675|       |		/*
 2676|       |		 *  bit pattern     the number we need
 2677|       |		 *     000           ->  0
 2678|       |		 *     001           ->  1
 2679|       |		 *     010           ->  2
 2680|       |		 *     ...
 2681|       |		 *     110           ->  6
 2682|       |		 *     1110          ->  7
 2683|       |		 *     11110         ->  8
 2684|       |		 *     ...
 2685|       |		 *     1111111111110 ->  16
 2686|       |		 */
 2687|  83.2k|		if (!lzh_br_read_ahead(strm, br, 3))
  ------------------
  |  | 1982|  83.2k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1977|   166k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1963|   166k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1963:27): [True: 78.2k, False: 5.03k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1977:26): [True: 3.81k, False: 1.22k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1963|  1.22k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1963:27): [True: 1.08k, False: 143]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2688|    143|			return (i);
 2689|  83.1k|		if ((c = lzh_br_bits(br, 3)) == 7) {
  ------------------
  |  | 1966|  83.1k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1967|  83.1k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
  |  Branch (2689:7): [True: 1.63k, False: 81.4k]
  ------------------
 2690|  1.63k|			if (!lzh_br_read_ahead(strm, br, 13))
  ------------------
  |  | 1982|  1.63k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1977|  3.26k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1963|  3.26k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1963:27): [True: 964, False: 668]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1977:26): [True: 154, False: 514]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1963|    514|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1963:27): [True: 359, False: 155]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2691|    155|				return (i);
 2692|  1.47k|			c = bitlen_tbl[lzh_br_bits(br, 13) & 0x3FF];
  ------------------
  |  | 1966|  1.47k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1967|  1.47k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2693|  1.47k|			if (c)
  ------------------
  |  Branch (2693:8): [True: 1.11k, False: 367]
  ------------------
 2694|  1.11k|				lzh_br_consume(br, c - 3);
  ------------------
  |  | 1985|  1.11k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2695|    367|			else
 2696|    367|				return (-1);/* Invalid data. */
 2697|  1.47k|		} else
 2698|  81.4k|			lzh_br_consume(br, 3);
  ------------------
  |  | 1985|  81.4k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2699|  82.6k|		ds->pt.bitlen[i++] = c;
 2700|  82.6k|		ds->pt.freq[c]++;
 2701|  82.6k|	}
 2702|  15.8k|	return (i);
 2703|  16.5k|}
archive_read_support_format_lha.c:lzh_make_huffman_table:
 2722|  13.7k|{
 2723|  13.7k|	uint16_t *tbl;
 2724|  13.7k|	const unsigned char *bitlen;
 2725|  13.7k|	int bitptn[17], weight[17];
 2726|  13.7k|	int i, maxbits = 0, ptn, tbl_size, w;
 2727|  13.7k|	int diffbits, len_avail;
 2728|       |
 2729|       |	/*
 2730|       |	 * Initialize bit patterns.
 2731|       |	 */
 2732|  13.7k|	ptn = 0;
 2733|   233k|	for (i = 1, w = 1 << 15; i <= 16; i++, w >>= 1) {
  ------------------
  |  Branch (2733:27): [True: 219k, False: 13.7k]
  ------------------
 2734|   219k|		bitptn[i] = ptn;
 2735|   219k|		weight[i] = w;
 2736|   219k|		if (hf->freq[i]) {
  ------------------
  |  Branch (2736:7): [True: 46.1k, False: 173k]
  ------------------
 2737|  46.1k|			ptn += hf->freq[i] * w;
 2738|  46.1k|			maxbits = i;
 2739|  46.1k|		}
 2740|   219k|	}
 2741|  13.7k|	if (ptn != 0x10000 || maxbits > hf->tbl_bits)
  ------------------
  |  Branch (2741:6): [True: 1.85k, False: 11.8k]
  |  Branch (2741:24): [True: 0, False: 11.8k]
  ------------------
 2742|  1.85k|		return (0);/* Invalid */
 2743|       |
 2744|  11.8k|	hf->max_bits = maxbits;
 2745|       |
 2746|       |	/*
 2747|       |	 * Cut out extra bits which we won't house in the table.
 2748|       |	 * This preparation reduces the same calculation in the for-loop
 2749|       |	 * making the table.
 2750|       |	 */
 2751|  11.8k|	if (maxbits < 16) {
  ------------------
  |  Branch (2751:6): [True: 11.8k, False: 0]
  ------------------
 2752|  11.8k|		int ebits = 16 - maxbits;
 2753|  67.3k|		for (i = 1; i <= maxbits; i++) {
  ------------------
  |  Branch (2753:15): [True: 55.4k, False: 11.8k]
  ------------------
 2754|  55.4k|			bitptn[i] >>= ebits;
 2755|  55.4k|			weight[i] >>= ebits;
 2756|  55.4k|		}
 2757|  11.8k|	}
 2758|  11.8k|	if (maxbits > HTBL_BITS) {
  ------------------
  |  |  114|  11.8k|#define HTBL_BITS	10
  ------------------
  |  Branch (2758:6): [True: 0, False: 11.8k]
  ------------------
 2759|      0|		unsigned htbl_max;
 2760|      0|		uint16_t *p;
 2761|       |
 2762|      0|		diffbits = maxbits - HTBL_BITS;
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
 2763|      0|		for (i = 1; i <= HTBL_BITS; i++) {
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
  |  Branch (2763:15): [True: 0, False: 0]
  ------------------
 2764|      0|			bitptn[i] >>= diffbits;
 2765|      0|			weight[i] >>= diffbits;
 2766|      0|		}
 2767|      0|		htbl_max = bitptn[HTBL_BITS] +
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
 2768|      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
  ------------------
 2769|      0|		p = &(hf->tbl[htbl_max]);
 2770|      0|		while (p < &hf->tbl[1U<<HTBL_BITS])
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
  |  Branch (2770:10): [True: 0, False: 0]
  ------------------
 2771|      0|			*p++ = 0;
 2772|      0|	} else
 2773|  11.8k|		diffbits = 0;
 2774|  11.8k|	hf->shift_bits = diffbits;
 2775|       |
 2776|       |	/*
 2777|       |	 * Make the table.
 2778|       |	 */
 2779|  11.8k|	tbl_size = 1 << HTBL_BITS;
  ------------------
  |  |  114|  11.8k|#define HTBL_BITS	10
  ------------------
 2780|  11.8k|	tbl = hf->tbl;
 2781|  11.8k|	bitlen = hf->bitlen;
 2782|  11.8k|	len_avail = hf->len_avail;
 2783|  11.8k|	hf->tree_used = 0;
 2784|  1.07M|	for (i = 0; i < len_avail; i++) {
  ------------------
  |  Branch (2784:14): [True: 1.06M, False: 11.8k]
  ------------------
 2785|  1.06M|		uint16_t *p;
 2786|  1.06M|		int len, cnt;
 2787|  1.06M|		uint16_t bit;
 2788|  1.06M|		int extlen;
 2789|  1.06M|		struct htree_t *ht;
 2790|       |
 2791|  1.06M|		if (bitlen[i] == 0)
  ------------------
  |  Branch (2791:7): [True: 890k, False: 171k]
  ------------------
 2792|   890k|			continue;
 2793|       |		/* Get a bit pattern */
 2794|   171k|		len = bitlen[i];
 2795|   171k|		ptn = bitptn[len];
 2796|   171k|		cnt = weight[len];
 2797|   171k|		if (len <= HTBL_BITS) {
  ------------------
  |  |  114|   171k|#define HTBL_BITS	10
  ------------------
  |  Branch (2797:7): [True: 171k, False: 0]
  ------------------
 2798|       |			/* Calculate next bit pattern */
 2799|   171k|			if ((bitptn[len] = ptn + cnt) > tbl_size)
  ------------------
  |  Branch (2799:8): [True: 0, False: 171k]
  ------------------
 2800|      0|				return (0);/* Invalid */
 2801|       |			/* Update the table */
 2802|   171k|			p = &(tbl[ptn]);
 2803|   171k|			if (cnt > 7) {
  ------------------
  |  Branch (2803:8): [True: 27.1k, False: 144k]
  ------------------
 2804|  27.1k|				uint16_t *pc;
 2805|       |
 2806|  27.1k|				cnt -= 8;
 2807|  27.1k|				pc = &p[cnt];
 2808|  27.1k|				pc[0] = (uint16_t)i;
 2809|  27.1k|				pc[1] = (uint16_t)i;
 2810|  27.1k|				pc[2] = (uint16_t)i;
 2811|  27.1k|				pc[3] = (uint16_t)i;
 2812|  27.1k|				pc[4] = (uint16_t)i;
 2813|  27.1k|				pc[5] = (uint16_t)i;
 2814|  27.1k|				pc[6] = (uint16_t)i;
 2815|  27.1k|				pc[7] = (uint16_t)i;
 2816|  27.1k|				if (cnt > 7) {
  ------------------
  |  Branch (2816:9): [True: 11.8k, False: 15.2k]
  ------------------
 2817|  11.8k|					cnt -= 8;
 2818|  11.8k|					memcpy(&p[cnt], pc,
 2819|  11.8k|						8 * sizeof(uint16_t));
 2820|  11.8k|					pc = &p[cnt];
 2821|  11.9k|					while (cnt > 15) {
  ------------------
  |  Branch (2821:13): [True: 69, False: 11.8k]
  ------------------
 2822|     69|						cnt -= 16;
 2823|     69|						memcpy(&p[cnt], pc,
 2824|     69|							16 * sizeof(uint16_t));
 2825|     69|					}
 2826|  11.8k|				}
 2827|  27.1k|				if (cnt)
  ------------------
  |  Branch (2827:9): [True: 0, False: 27.1k]
  ------------------
 2828|      0|					memcpy(p, pc, cnt * sizeof(uint16_t));
 2829|   144k|			} else {
 2830|   295k|				while (cnt > 1) {
  ------------------
  |  Branch (2830:12): [True: 151k, False: 144k]
  ------------------
 2831|   151k|					p[--cnt] = (uint16_t)i;
 2832|   151k|					p[--cnt] = (uint16_t)i;
 2833|   151k|				}
 2834|   144k|				if (cnt)
  ------------------
  |  Branch (2834:9): [True: 24.2k, False: 119k]
  ------------------
 2835|  24.2k|					p[--cnt] = (uint16_t)i;
 2836|   144k|			}
 2837|   171k|			continue;
 2838|   171k|		}
 2839|       |
 2840|       |		/*
 2841|       |		 * A bit length is too big to be housed to a direct table,
 2842|       |		 * so we use a tree model for its extra bits.
 2843|       |		 */
 2844|      0|		bitptn[len] = ptn + cnt;
 2845|      0|		bit = 1U << (diffbits -1);
 2846|      0|		extlen = len - HTBL_BITS;
  ------------------
  |  |  114|      0|#define HTBL_BITS	10
  ------------------
 2847|       |		
 2848|      0|		p = &(tbl[ptn >> diffbits]);
 2849|      0|		if (*p == 0) {
  ------------------
  |  Branch (2849:7): [True: 0, False: 0]
  ------------------
 2850|      0|			*p = len_avail + hf->tree_used;
 2851|      0|			ht = &(hf->tree[hf->tree_used++]);
 2852|      0|			if (hf->tree_used > hf->tree_avail)
  ------------------
  |  Branch (2852:8): [True: 0, False: 0]
  ------------------
 2853|      0|				return (0);/* Invalid */
 2854|      0|			ht->left = 0;
 2855|      0|			ht->right = 0;
 2856|      0|		} else {
 2857|      0|			if (*p < len_avail ||
  ------------------
  |  Branch (2857:8): [True: 0, False: 0]
  ------------------
 2858|      0|			    *p >= (len_avail + hf->tree_used))
  ------------------
  |  Branch (2858:8): [True: 0, False: 0]
  ------------------
 2859|      0|				return (0);/* Invalid */
 2860|      0|			ht = &(hf->tree[*p - len_avail]);
 2861|      0|		}
 2862|      0|		while (--extlen > 0) {
  ------------------
  |  Branch (2862:10): [True: 0, False: 0]
  ------------------
 2863|      0|			if (ptn & bit) {
  ------------------
  |  Branch (2863:8): [True: 0, False: 0]
  ------------------
 2864|      0|				if (ht->left < len_avail) {
  ------------------
  |  Branch (2864:9): [True: 0, False: 0]
  ------------------
 2865|      0|					ht->left = len_avail + hf->tree_used;
 2866|      0|					ht = &(hf->tree[hf->tree_used++]);
 2867|      0|					if (hf->tree_used > hf->tree_avail)
  ------------------
  |  Branch (2867:10): [True: 0, False: 0]
  ------------------
 2868|      0|						return (0);/* Invalid */
 2869|      0|					ht->left = 0;
 2870|      0|					ht->right = 0;
 2871|      0|				} else {
 2872|      0|					ht = &(hf->tree[ht->left - len_avail]);
 2873|      0|				}
 2874|      0|			} else {
 2875|      0|				if (ht->right < len_avail) {
  ------------------
  |  Branch (2875:9): [True: 0, False: 0]
  ------------------
 2876|      0|					ht->right = len_avail + hf->tree_used;
 2877|      0|					ht = &(hf->tree[hf->tree_used++]);
 2878|      0|					if (hf->tree_used > hf->tree_avail)
  ------------------
  |  Branch (2878:10): [True: 0, False: 0]
  ------------------
 2879|      0|						return (0);/* Invalid */
 2880|      0|					ht->left = 0;
 2881|      0|					ht->right = 0;
 2882|      0|				} else {
 2883|      0|					ht = &(hf->tree[ht->right - len_avail]);
 2884|      0|				}
 2885|      0|			}
 2886|      0|			bit >>= 1;
 2887|      0|		}
 2888|      0|		if (ptn & bit) {
  ------------------
  |  Branch (2888:7): [True: 0, False: 0]
  ------------------
 2889|      0|			if (ht->left != 0)
  ------------------
  |  Branch (2889:8): [True: 0, False: 0]
  ------------------
 2890|      0|				return (0);/* Invalid */
 2891|      0|			ht->left = (uint16_t)i;
 2892|      0|		} else {
 2893|      0|			if (ht->right != 0)
  ------------------
  |  Branch (2893:8): [True: 0, False: 0]
  ------------------
 2894|      0|				return (0);/* Invalid */
 2895|      0|			ht->right = (uint16_t)i;
 2896|      0|		}
 2897|      0|	}
 2898|  11.8k|	return (1);
 2899|  11.8k|}
archive_read_support_format_lha.c:lzh_decode_huffman:
 2923|  43.6M|{
 2924|  43.6M|	int c;
 2925|       |	/*
 2926|       |	 * At first search an index table for a bit pattern.
 2927|       |	 * If it fails, search a huffman tree for.
 2928|       |	 */
 2929|  43.6M|	c = hf->tbl[rbits >> hf->shift_bits];
 2930|  43.6M|	if (c < hf->len_avail || hf->len_avail == 0)
  ------------------
  |  Branch (2930:6): [True: 584k, False: 43.0M]
  |  Branch (2930:27): [True: 43.0M, False: 0]
  ------------------
 2931|  43.6M|		return (c);
 2932|       |	/* This bit pattern needs to be found out at a huffman tree. */
 2933|      0|	return (lzh_decode_huffman_tree(hf, rbits, c));
 2934|  43.6M|}
archive_read_support_format_lha.c:lzh_decode_blocks:
 2375|  22.5k|{
 2376|  22.5k|	struct lzh_dec *ds = strm->ds;
 2377|  22.5k|	struct lzh_br bre = ds->br;
 2378|  22.5k|	struct huffman *lt = &(ds->lt);
 2379|  22.5k|	struct huffman *pt = &(ds->pt);
 2380|  22.5k|	unsigned char *w_buff = ds->w_buff;
 2381|  22.5k|	unsigned char *lt_bitlen = lt->bitlen;
 2382|  22.5k|	unsigned char *pt_bitlen = pt->bitlen;
 2383|  22.5k|	int blocks_avail = ds->blocks_avail, c = 0;
 2384|  22.5k|	int copy_len = ds->copy_len, copy_pos = ds->copy_pos;
 2385|  22.5k|	int w_pos = ds->w_pos, w_mask = ds->w_mask, w_size = ds->w_size;
 2386|  22.5k|	int lt_max_bits = lt->max_bits, pt_max_bits = pt->max_bits;
 2387|  22.5k|	int state = ds->state;
 2388|       |
 2389|  16.7M|	for (;;) {
 2390|  16.7M|		switch (state) {
  ------------------
  |  Branch (2390:11): [True: 16.7M, False: 0]
  ------------------
 2391|  16.7M|		case ST_GET_LITERAL:
  ------------------
  |  | 2105|  16.7M|#define ST_GET_LITERAL		9
  ------------------
  |  Branch (2391:3): [True: 16.7M, False: 17.7k]
  ------------------
 2392|  26.7M|			for (;;) {
 2393|  26.7M|				if (blocks_avail == 0) {
  ------------------
  |  Branch (2393:9): [True: 3.82k, False: 26.7M]
  ------------------
 2394|       |					/* We have decoded all blocks.
 2395|       |					 * Let's handle next blocks. */
 2396|  3.82k|					ds->state = ST_RD_BLOCK;
  ------------------
  |  | 2096|  3.82k|#define ST_RD_BLOCK		0
  ------------------
 2397|  3.82k|					ds->br = bre;
 2398|  3.82k|					ds->blocks_avail = 0;
 2399|  3.82k|					ds->w_pos = w_pos;
 2400|  3.82k|					ds->copy_pos = 0;
 2401|  3.82k|					return (100);
 2402|  3.82k|				}
 2403|       |
 2404|       |				/* lzh_br_read_ahead() always tries to fill the
 2405|       |				 * cache buffer up. In specific situation we
 2406|       |				 * are close to the end of the data, the cache
 2407|       |				 * buffer will not be full and thus we have to
 2408|       |				 * determine if the cache buffer has some bits
 2409|       |				 * as much as we need after lzh_br_read_ahead()
 2410|       |				 * failed. */
 2411|  26.7M|				if (!lzh_br_read_ahead(strm, &bre,
  ------------------
  |  | 1982|  26.7M|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1977|  53.4M|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1963|  53.4M|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1963:27): [True: 26.7M, False: 26.6k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1977:26): [True: 24.2k, False: 2.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1963|  2.40k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1963:27): [True: 725, False: 1.68k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2412|  26.7M|				    lt_max_bits)) {
 2413|  1.68k|					if (!last)
  ------------------
  |  Branch (2413:10): [True: 40, False: 1.64k]
  ------------------
 2414|     40|						goto next_data;
 2415|       |					/* Remaining bits are less than
 2416|       |					 * maximum bits(lt.max_bits) but maybe
 2417|       |					 * it still remains as much as we need,
 2418|       |					 * so we should try to use it with
 2419|       |					 * dummy bits. */
 2420|  1.64k|					c = lzh_decode_huffman(lt,
 2421|  1.64k|					      lzh_br_bits_forced(&bre,
  ------------------
  |  | 1969|  1.64k|	(((uint16_t)((br)->cache_buffer <<		\
  |  | 1970|  1.64k|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 2422|  1.64k|					        lt_max_bits));
 2423|  1.64k|					lzh_br_consume(&bre, lt_bitlen[c]);
  ------------------
  |  | 1985|  1.64k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2424|  1.64k|					if (!lzh_br_has(&bre, 0))
  ------------------
  |  | 1963|  1.64k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (2424:10): [True: 533, False: 1.10k]
  ------------------
 2425|    533|						goto failed;/* Over read. */
 2426|  26.7M|				} else {
 2427|  26.7M|					c = lzh_decode_huffman(lt,
 2428|  26.7M|					      lzh_br_bits(&bre, lt_max_bits));
  ------------------
  |  | 1966|  26.7M|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1967|  26.7M|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2429|  26.7M|					lzh_br_consume(&bre, lt_bitlen[c]);
  ------------------
  |  | 1985|  26.7M|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2430|  26.7M|				}
 2431|  26.7M|				blocks_avail--;
 2432|  26.7M|				if ((unsigned int)c > UCHAR_MAX)
  ------------------
  |  Branch (2432:9): [True: 16.7M, False: 9.99M]
  ------------------
 2433|       |					/* Current block is a match data. */
 2434|  16.7M|					break;
 2435|       |				/*
 2436|       |				 * 'c' is exactly a literal code.
 2437|       |				 */
 2438|       |				/* Save a decoded code to reference it
 2439|       |				 * afterward. */
 2440|  9.99M|				w_buff[w_pos] = c;
 2441|  9.99M|				if (++w_pos >= w_size) {
  ------------------
  |  Branch (2441:9): [True: 11, False: 9.99M]
  ------------------
 2442|     11|					w_pos = 0;
 2443|     11|					lzh_emit_window(strm, w_size);
 2444|     11|					goto next_data;
 2445|     11|				}
 2446|  9.99M|			}
 2447|       |			/* 'c' is the length of a match pattern we have
 2448|       |			 * already extracted, which has be stored in
 2449|       |			 * window(ds->w_buff). */
 2450|  16.7M|			copy_len = c - (UCHAR_MAX + 1) + MINMATCH;
  ------------------
  |  |   51|  16.7M|#define MINMATCH		3	/* Minimum match length. */
  ------------------
 2451|       |			/* FALL THROUGH */
 2452|  16.7M|		case ST_GET_POS_1:
  ------------------
  |  | 2106|  16.7M|#define ST_GET_POS_1		10
  ------------------
  |  Branch (2452:3): [True: 0, False: 16.7M]
  ------------------
 2453|       |			/*
 2454|       |			 * Get a reference position. 
 2455|       |			 */
 2456|  16.7M|			if (!lzh_br_read_ahead(strm, &bre, pt_max_bits)) {
  ------------------
  |  | 1982|  16.7M|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1977|  33.4M|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1963|  33.4M|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1963:27): [True: 16.7M, False: 974]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1977:26): [True: 815, False: 159]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1963|    159|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1963:27): [True: 93, False: 66]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2457|     66|				if (!last) {
  ------------------
  |  Branch (2457:9): [True: 14, False: 52]
  ------------------
 2458|     14|					state = ST_GET_POS_1;
  ------------------
  |  | 2106|     14|#define ST_GET_POS_1		10
  ------------------
 2459|     14|					ds->copy_len = copy_len;
 2460|     14|					goto next_data;
 2461|     14|				}
 2462|     52|				copy_pos = lzh_decode_huffman(pt,
 2463|     52|				    lzh_br_bits_forced(&bre, pt_max_bits));
  ------------------
  |  | 1969|     52|	(((uint16_t)((br)->cache_buffer <<		\
  |  | 1970|     52|		((n) - (br)->cache_avail))) & cache_masks[n])
  ------------------
 2464|     52|				lzh_br_consume(&bre, pt_bitlen[copy_pos]);
  ------------------
  |  | 1985|     52|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2465|     52|				if (!lzh_br_has(&bre, 0))
  ------------------
  |  | 1963|     52|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  ------------------
  |  Branch (2465:9): [True: 43, False: 9]
  ------------------
 2466|     43|					goto failed;/* Over read. */
 2467|  16.7M|			} else {
 2468|  16.7M|				copy_pos = lzh_decode_huffman(pt,
 2469|  16.7M|				    lzh_br_bits(&bre, pt_max_bits));
  ------------------
  |  | 1966|  16.7M|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1967|  16.7M|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2470|  16.7M|				lzh_br_consume(&bre, pt_bitlen[copy_pos]);
  ------------------
  |  | 1985|  16.7M|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2471|  16.7M|			}
 2472|       |			/* FALL THROUGH */
 2473|  16.7M|		case ST_GET_POS_2:
  ------------------
  |  | 2107|  16.7M|#define ST_GET_POS_2		11
  ------------------
  |  Branch (2473:3): [True: 0, False: 16.7M]
  ------------------
 2474|  16.7M|			if (copy_pos > 1) {
  ------------------
  |  Branch (2474:8): [True: 59.2k, False: 16.6M]
  ------------------
 2475|       |				/* We need an additional adjustment number to
 2476|       |				 * the position. */
 2477|  59.2k|				int p = copy_pos - 1;
 2478|  59.2k|				if (!lzh_br_read_ahead(strm, &bre, p)) {
  ------------------
  |  | 1982|  59.2k|	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1977|   118k|	(lzh_br_has(br, (n)) || lzh_br_fillup(strm, br))
  |  |  |  |  ------------------
  |  |  |  |  |  | 1963|   118k|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1963:27): [True: 56.7k, False: 2.47k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1977:26): [True: 2.37k, False: 104]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               	(lzh_br_read_ahead_0((strm), (br), (n)) || lzh_br_has((br), (n)))
  |  |  ------------------
  |  |  |  | 1963|    104|#define lzh_br_has(br, n)	((br)->cache_avail >= n)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1963:27): [True: 49, False: 55]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2479|     55|					if (last)
  ------------------
  |  Branch (2479:10): [True: 29, False: 26]
  ------------------
 2480|     29|						goto failed;/* Truncated data.*/
 2481|     26|					state = ST_GET_POS_2;
  ------------------
  |  | 2107|     26|#define ST_GET_POS_2		11
  ------------------
 2482|     26|					ds->copy_len = copy_len;
 2483|     26|					ds->copy_pos = copy_pos;
 2484|     26|					goto next_data;
 2485|     55|				}
 2486|  59.1k|				copy_pos = (1 << p) + lzh_br_bits(&bre, p);
  ------------------
  |  | 1966|  59.1k|	(((uint16_t)((br)->cache_buffer >>		\
  |  | 1967|  59.1k|		((br)->cache_avail - (n)))) & cache_masks[n])
  ------------------
 2487|  59.1k|				lzh_br_consume(&bre, p);
  ------------------
  |  | 1985|  59.1k|#define lzh_br_consume(br, n)	((br)->cache_avail -= (n))
  ------------------
 2488|  59.1k|			}
 2489|       |			/* The position is actually a distance from the last
 2490|       |			 * code we had extracted and thus we have to convert
 2491|       |			 * it to a position of the window. */
 2492|  16.7M|			copy_pos = (w_pos - copy_pos - 1) & w_mask;
 2493|       |			/* FALL THROUGH */
 2494|  16.7M|		case ST_COPY_DATA:
  ------------------
  |  | 2108|  16.7M|#define ST_COPY_DATA		12
  ------------------
  |  Branch (2494:3): [True: 17.7k, False: 16.7M]
  ------------------
 2495|       |			/*
 2496|       |			 * Copy `copy_len' bytes as extracted data from
 2497|       |			 * the window into the output buffer.
 2498|       |			 */
 2499|  16.7M|			for (;;) {
 2500|  16.7M|				int l;
 2501|       |
 2502|  16.7M|				l = copy_len;
 2503|  16.7M|				if (copy_pos > w_pos) {
  ------------------
  |  Branch (2503:9): [True: 20.7k, False: 16.7M]
  ------------------
 2504|  20.7k|					if (l > w_size - copy_pos)
  ------------------
  |  Branch (2504:10): [True: 18.7k, False: 1.99k]
  ------------------
 2505|  18.7k|						l = w_size - copy_pos;
 2506|  16.7M|				} else {
 2507|  16.7M|					if (l > w_size - w_pos)
  ------------------
  |  Branch (2507:10): [True: 17.7k, False: 16.7M]
  ------------------
 2508|  17.7k|						l = w_size - w_pos;
 2509|  16.7M|				}
 2510|  16.7M|				if ((copy_pos + l < w_pos)
  ------------------
  |  Branch (2510:9): [True: 9.29k, False: 16.7M]
  ------------------
 2511|  16.7M|				    || (w_pos + l < copy_pos)) {
  ------------------
  |  Branch (2511:12): [True: 20.7k, False: 16.7M]
  ------------------
 2512|       |					/* No overlap. */
 2513|  30.0k|					memcpy(w_buff + w_pos,
 2514|  30.0k|					    w_buff + copy_pos, l);
 2515|  16.7M|				} else {
 2516|  16.7M|					const unsigned char *s;
 2517|  16.7M|					unsigned char *d;
 2518|  16.7M|					int li;
 2519|       |
 2520|  16.7M|					d = w_buff + w_pos;
 2521|  16.7M|					s = w_buff + copy_pos;
 2522|  1.19G|					for (li = 0; li < l-1;) {
  ------------------
  |  Branch (2522:19): [True: 1.18G, False: 16.7M]
  ------------------
 2523|  1.18G|						d[li] = s[li];li++;
 2524|  1.18G|						d[li] = s[li];li++;
 2525|  1.18G|					}
 2526|  16.7M|					if (li < l)
  ------------------
  |  Branch (2526:10): [True: 16.6M, False: 63.0k]
  ------------------
 2527|  16.6M|						d[li] = s[li];
 2528|  16.7M|				}
 2529|  16.7M|				w_pos += l;
 2530|  16.7M|				if (w_pos == w_size) {
  ------------------
  |  Branch (2530:9): [True: 18.0k, False: 16.7M]
  ------------------
 2531|  18.0k|					w_pos = 0;
 2532|  18.0k|					lzh_emit_window(strm, w_size);
 2533|  18.0k|					if (copy_len <= l)
  ------------------
  |  Branch (2533:10): [True: 298, False: 17.7k]
  ------------------
 2534|    298|						state = ST_GET_LITERAL;
  ------------------
  |  | 2105|    298|#define ST_GET_LITERAL		9
  ------------------
 2535|  17.7k|					else {
 2536|  17.7k|						state = ST_COPY_DATA;
  ------------------
  |  | 2108|  17.7k|#define ST_COPY_DATA		12
  ------------------
 2537|  17.7k|						ds->copy_len = copy_len - l;
 2538|  17.7k|						ds->copy_pos =
 2539|  17.7k|						    (copy_pos + l) & w_mask;
 2540|  17.7k|					}
 2541|  18.0k|					goto next_data;
 2542|  18.0k|				}
 2543|  16.7M|				if (copy_len <= l)
  ------------------
  |  Branch (2543:9): [True: 16.7M, False: 18.7k]
  ------------------
 2544|       |					/* A copy of current pattern ended. */
 2545|  16.7M|					break;
 2546|  18.7k|				copy_len -= l;
 2547|  18.7k|				copy_pos = (copy_pos + l) & w_mask;
 2548|  18.7k|			}
 2549|  16.7M|			state = ST_GET_LITERAL;
  ------------------
  |  | 2105|  16.7M|#define ST_GET_LITERAL		9
  ------------------
 2550|  16.7M|			break;
 2551|  16.7M|		}
 2552|  16.7M|	}
 2553|    605|failed:
 2554|    605|	return (ds->error = ARCHIVE_FAILED);
  ------------------
  |  |  237|    605|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2555|  18.1k|next_data:
 2556|  18.1k|	ds->br = bre;
 2557|  18.1k|	ds->blocks_avail = blocks_avail;
 2558|  18.1k|	ds->state = state;
 2559|  18.1k|	ds->w_pos = w_pos;
 2560|  18.1k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  18.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2561|  22.5k|}
archive_read_support_format_lha.c:lha_read_data_none:
 1508|    463|{
 1509|    463|	struct lha *lha = a->format->data;
 1510|    463|	ssize_t bytes_avail;
 1511|       |
 1512|    463|	if (lha->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (1512:6): [True: 0, False: 463]
  ------------------
 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|    463|	*buff = __archive_read_ahead(a, 1, &bytes_avail);
 1526|    463|	if (bytes_avail <= 0) {
  ------------------
  |  Branch (1526:6): [True: 14, False: 449]
  ------------------
 1527|     14|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     14|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1528|     14|		    "Truncated LHa file data");
 1529|     14|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     14|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1530|     14|	}
 1531|    449|	if (bytes_avail > lha->entry_bytes_remaining)
  ------------------
  |  Branch (1531:6): [True: 434, False: 15]
  ------------------
 1532|    434|		bytes_avail = (ssize_t)lha->entry_bytes_remaining;
 1533|    449|	lha->entry_crc_calculated =
 1534|    449|	    lha_crc16(lha->entry_crc_calculated, *buff, bytes_avail);
 1535|    449|	*size = bytes_avail;
 1536|    449|	*offset = lha->entry_offset;
 1537|    449|	lha->entry_offset += bytes_avail;
 1538|    449|	lha->entry_bytes_remaining -= bytes_avail;
 1539|    449|	if (lha->entry_bytes_remaining == 0)
  ------------------
  |  Branch (1539:6): [True: 435, False: 14]
  ------------------
 1540|    435|		lha->end_of_entry = 1;
 1541|    449|	lha->entry_unconsumed = bytes_avail;
 1542|    449|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    449|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1543|    463|}
archive_read_support_format_lha.c:archive_read_format_lha_read_data_skip:
 1645|  6.05k|{
 1646|  6.05k|	struct lha *lha = a->format->data;
 1647|  6.05k|	int64_t bytes_skipped;
 1648|       |
 1649|  6.05k|	if (lha->entry_unconsumed) {
  ------------------
  |  Branch (1649:6): [True: 0, False: 6.05k]
  ------------------
 1650|       |		/* Consume as much as the decompressor actually used. */
 1651|      0|		__archive_read_consume(a, lha->entry_unconsumed);
 1652|      0|		lha->entry_unconsumed = 0;
 1653|      0|	}
 1654|       |
 1655|       |	/* if we've already read to end of data, we're done. */
 1656|  6.05k|	if (lha->end_of_entry_cleanup)
  ------------------
  |  Branch (1656:6): [True: 1.53k, False: 4.52k]
  ------------------
 1657|  1.53k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.53k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1658|       |
 1659|       |	/*
 1660|       |	 * If the length is at the beginning, we can skip the
 1661|       |	 * compressed data much more quickly.
 1662|       |	 */
 1663|  4.52k|	bytes_skipped = __archive_read_consume(a, lha->entry_bytes_remaining);
 1664|  4.52k|	if (bytes_skipped < 0)
  ------------------
  |  Branch (1664:6): [True: 92, False: 4.43k]
  ------------------
 1665|     92|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     92|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1666|       |
 1667|       |	/* This entry is finished and done. */
 1668|  4.43k|	lha->end_of_entry_cleanup = lha->end_of_entry = 1;
 1669|  4.43k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.43k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1670|  4.52k|}
archive_read_support_format_lha.c:archive_read_format_lha_cleanup:
 1674|  16.7k|{
 1675|  16.7k|	struct lha *lha = a->format->data;
 1676|       |
 1677|  16.7k|	lzh_decode_free(&(lha->strm));
 1678|  16.7k|	archive_string_free(&(lha->dirname));
 1679|  16.7k|	archive_string_free(&(lha->filename));
 1680|  16.7k|	archive_string_free(&(lha->uname));
 1681|  16.7k|	archive_string_free(&(lha->gname));
 1682|  16.7k|	archive_wstring_free(&(lha->ws));
 1683|  16.7k|	free(lha);
 1684|  16.7k|	a->format->data = NULL;
 1685|  16.7k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1686|  16.7k|}
archive_read_support_format_lha.c:lzh_decode_free:
 1948|  16.7k|{
 1949|       |
 1950|  16.7k|	if (strm->ds == NULL)
  ------------------
  |  Branch (1950:6): [True: 16.3k, False: 408]
  ------------------
 1951|  16.3k|		return;
 1952|    408|	free(strm->ds->w_buff);
 1953|    408|	lzh_huffman_free(&(strm->ds->lt));
 1954|    408|	lzh_huffman_free(&(strm->ds->pt));
 1955|    408|	free(strm->ds);
 1956|       |	strm->ds = NULL;
 1957|    408|}
archive_read_support_format_lha.c:lzh_huffman_free:
 2595|    816|{
 2596|    816|	free(hf->bitlen);
 2597|    816|	free(hf->tbl);
 2598|    816|	free(hf->tree);
 2599|    816|}

archive_read_support_format_mtree:
  214|  16.7k|{
  215|  16.7k|	static const struct archive_rb_tree_ops rb_ops = {
  216|  16.7k|		mtree_cmp_node, mtree_cmp_key,
  217|  16.7k|	};
  218|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
  219|  16.7k|	struct mtree *mtree;
  220|  16.7k|	int r;
  221|       |
  222|  16.7k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
  223|  16.7k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_mtree");
  224|       |
  225|  16.7k|	mtree = calloc(1, sizeof(*mtree));
  226|  16.7k|	if (mtree == NULL) {
  ------------------
  |  Branch (226:6): [True: 0, False: 16.7k]
  ------------------
  227|      0|		archive_set_error(_a, ENOMEM, "Can't allocate mtree data");
  228|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  229|      0|	}
  230|  16.7k|	mtree->checkfs = 0;
  231|  16.7k|	mtree->fd = -1;
  232|       |
  233|  16.7k|	__archive_rb_tree_init(&mtree->rbtree, &rb_ops);
  234|       |
  235|  16.7k|	r = __archive_read_register_format(a,
  236|  16.7k|	    mtree,
  237|  16.7k|	    "mtree",
  238|  16.7k|	    mtree_bid,
  239|  16.7k|	    archive_read_format_mtree_options,
  240|  16.7k|	    read_header,
  241|  16.7k|	    read_data,
  242|  16.7k|	    skip,
  243|  16.7k|	    NULL,
  244|  16.7k|	    cleanup,
  245|  16.7k|	    NULL,
  246|  16.7k|	    NULL);
  247|       |
  248|  16.7k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (248:6): [True: 0, False: 16.7k]
  ------------------
  249|      0|		free(mtree);
  250|  16.7k|	return (r);
  251|  16.7k|}
archive_read_support_format_mtree.c:mtree_cmp_node:
  197|  15.0k|{
  198|  15.0k|	const struct mtree_entry *e1 = (const struct mtree_entry *)n1;
  199|  15.0k|	const struct mtree_entry *e2 = (const struct mtree_entry *)n2;
  200|       |
  201|  15.0k|	return (strcmp(e1->name, e2->name));
  202|  15.0k|}
archive_read_support_format_mtree.c:mtree_cmp_key:
  206|  16.0k|{
  207|  16.0k|	const struct mtree_entry *e = (const struct mtree_entry *)n;
  208|       |
  209|  16.0k|	return (strcmp(e->name, key));
  210|  16.0k|}
archive_read_support_format_mtree.c:cleanup:
  255|  16.7k|{
  256|  16.7k|	struct mtree *mtree = a->format->data;
  257|  16.7k|	struct mtree_entry *p, *q;
  258|       |
  259|       |	/* Close any dangling file descriptor before freeing */
  260|  16.7k|    if (mtree->fd >= 0) {
  ------------------
  |  Branch (260:9): [True: 0, False: 16.7k]
  ------------------
  261|      0|        close(mtree->fd);
  262|      0|        mtree->fd = -1;
  263|      0|    }
  264|  16.7k|	p = mtree->entries;
  265|  64.6k|	while (p != NULL) {
  ------------------
  |  Branch (265:9): [True: 47.9k, False: 16.7k]
  ------------------
  266|  47.9k|		q = p->next;
  267|  47.9k|		free(p->name);
  268|  47.9k|		free_options(p->options);
  269|  47.9k|		free(p);
  270|  47.9k|		p = q;
  271|  47.9k|	}
  272|  16.7k|	archive_string_free(&mtree->line);
  273|  16.7k|	archive_string_free(&mtree->current_dir);
  274|  16.7k|	archive_string_free(&mtree->contents_name);
  275|  16.7k|	archive_entry_linkresolver_free(mtree->resolver);
  276|       |
  277|  16.7k|	free(mtree->buff);
  278|  16.7k|	free(mtree);
  279|  16.7k|	a->format->data = NULL;
  280|  16.7k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  281|  16.7k|}
archive_read_support_format_mtree.c:free_options:
  184|  49.7k|{
  185|  49.7k|	struct mtree_option *next;
  186|       |
  187|   141k|	for (; head != NULL; head = next) {
  ------------------
  |  Branch (187:9): [True: 91.8k, False: 49.7k]
  ------------------
  188|  91.8k|		next = head->next;
  189|  91.8k|		free(head->value);
  190|  91.8k|		free(head);
  191|  91.8k|	}
  192|  49.7k|}
archive_read_support_format_mtree.c:mtree_bid:
  630|  16.4k|{
  631|  16.4k|	const char *signature = "#mtree";
  632|  16.4k|	const void *h;
  633|       |
  634|  16.4k|	(void)best_bid; /* UNUSED */
  635|       |
  636|       |	/* Now let's look at the actual header and see if it matches. */
  637|  16.4k|	h = __archive_read_ahead(a, strlen(signature), NULL);
  638|  16.4k|	if (h == NULL)
  ------------------
  |  Branch (638:6): [True: 50, False: 16.3k]
  ------------------
  639|     50|		return (-1);
  640|       |
  641|  16.3k|	if (memcmp(h, signature, strlen(signature)) == 0)
  ------------------
  |  Branch (641:6): [True: 40, False: 16.3k]
  ------------------
  642|     40|		return (8 * (int)strlen(signature));
  643|       |
  644|       |	/*
  645|       |	 * There is not a mtree signature. Let's try to detect mtree format.
  646|       |	 */
  647|  16.3k|	return (detect_form(a, NULL));
  648|  16.3k|}
archive_read_support_format_mtree.c:detect_form:
  652|  17.4k|{
  653|  17.4k|	const char *p;
  654|  17.4k|	ssize_t avail, ravail;
  655|  17.4k|	ssize_t len, nl;
  656|  17.4k|	int entry_cnt = 0, multiline = 0;
  657|  17.4k|	int form_D = 0;/* The archive is generated by `NetBSD mtree -D'
  658|       |			* (In this source we call it `form D') . */
  659|       |
  660|  17.4k|	if (is_form_d != NULL)
  ------------------
  |  Branch (660:6): [True: 1.11k, False: 16.3k]
  ------------------
  661|  1.11k|		*is_form_d = 0;
  662|  17.4k|	p = __archive_read_ahead(a, 1, &avail);
  663|  17.4k|	if (p == NULL)
  ------------------
  |  Branch (663:6): [True: 5, False: 17.4k]
  ------------------
  664|      5|		return (-1);
  665|  17.4k|	ravail = avail;
  666|  38.1M|	for (;;) {
  667|  38.1M|		len = next_line(a, &p, &avail, &ravail, &nl);
  668|       |		/* The terminal character of the line should be
  669|       |		 * a new line character, '\r\n' or '\n'. */
  670|  38.1M|		if (len <= 0 || nl == 0)
  ------------------
  |  Branch (670:7): [True: 14.3k, False: 38.1M]
  |  Branch (670:19): [True: 11, False: 38.1M]
  ------------------
  671|  14.3k|			break;
  672|  38.1M|		if (!multiline) {
  ------------------
  |  Branch (672:7): [True: 38.1M, False: 1.62k]
  ------------------
  673|       |			/* Leading whitespace is never significant,
  674|       |			 * ignore it. */
  675|  38.1M|			while (len > 0 && (*p == ' ' || *p == '\t')) {
  ------------------
  |  Branch (675:11): [True: 38.1M, False: 0]
  |  Branch (675:23): [True: 2.00k, False: 38.1M]
  |  Branch (675:36): [True: 397, False: 38.1M]
  ------------------
  676|  2.40k|				++p;
  677|  2.40k|				--avail;
  678|  2.40k|				--len;
  679|  2.40k|			}
  680|       |			/* Skip comment or empty line. */ 
  681|  38.1M|			if (p[0] == '#' || p[0] == '\n' || p[0] == '\r') {
  ------------------
  |  Branch (681:8): [True: 1.93k, False: 38.1M]
  |  Branch (681:23): [True: 9.82M, False: 28.3M]
  |  Branch (681:39): [True: 28.3M, False: 13.0k]
  ------------------
  682|  38.1M|				p += len;
  683|  38.1M|				avail -= len;
  684|  38.1M|				continue;
  685|  38.1M|			}
  686|  38.1M|		} else {
  687|       |			/* A continuance line; the terminal
  688|       |			 * character of previous line was '\' character. */
  689|  1.62k|			if (bid_keyword_list(p, len, 0, 0) <= 0)
  ------------------
  |  Branch (689:8): [True: 7, False: 1.61k]
  ------------------
  690|      7|				break;
  691|  1.61k|			if (p[len-nl-1] != '\\') {
  ------------------
  |  Branch (691:8): [True: 599, False: 1.01k]
  ------------------
  692|    599|				if (multiline == 1 &&
  ------------------
  |  Branch (692:9): [True: 29, False: 570]
  ------------------
  693|     29|				    ++entry_cnt >= MAX_BID_ENTRY)
  ------------------
  |  |  626|     29|#define MAX_BID_ENTRY	3
  ------------------
  |  Branch (693:9): [True: 2, False: 27]
  ------------------
  694|      2|					break;
  695|    597|				multiline = 0;
  696|    597|			}
  697|  1.61k|			p += len;
  698|  1.61k|			avail -= len;
  699|  1.61k|			continue;
  700|  1.61k|		}
  701|  13.0k|		if (p[0] != '/') {
  ------------------
  |  Branch (701:7): [True: 8.30k, False: 4.71k]
  ------------------
  702|  8.30k|			int last_is_path, keywords;
  703|       |
  704|  8.30k|			keywords = bid_entry(p, len, nl, &last_is_path);
  705|  8.30k|			if (keywords >= 0) {
  ------------------
  |  Branch (705:8): [True: 7.30k, False: 1.00k]
  ------------------
  706|  7.30k|				if (form_D == 0) {
  ------------------
  |  Branch (706:9): [True: 6.59k, False: 709]
  ------------------
  707|  6.59k|					if (last_is_path)
  ------------------
  |  Branch (707:10): [True: 86, False: 6.50k]
  ------------------
  708|     86|						form_D = 1;
  709|  6.50k|					else if (keywords > 0)
  ------------------
  |  Branch (709:15): [True: 567, False: 5.94k]
  ------------------
  710|       |						/* This line is not `form D'. */
  711|    567|						form_D = -1;
  712|  6.59k|				} else if (form_D == 1) {
  ------------------
  |  Branch (712:16): [True: 86, False: 623]
  ------------------
  713|     86|					if (!last_is_path && keywords > 0)
  ------------------
  |  Branch (713:10): [True: 48, False: 38]
  |  Branch (713:27): [True: 0, False: 48]
  ------------------
  714|       |						/* This this is not `form D'
  715|       |						 * and we cannot accept mixed
  716|       |						 * format. */
  717|      0|						break;
  718|     86|				}
  719|  7.30k|				if (!last_is_path && p[len-nl-1] == '\\')
  ------------------
  |  Branch (719:9): [True: 7.16k, False: 140]
  |  Branch (719:26): [True: 45, False: 7.11k]
  ------------------
  720|       |					/* This line continues. */
  721|     45|					multiline = 1;
  722|  7.25k|				else {
  723|       |					/* We've got plenty of correct lines
  724|       |					 * to assume that this file is an mtree
  725|       |					 * format. */
  726|  7.25k|					if (++entry_cnt >= MAX_BID_ENTRY)
  ------------------
  |  |  626|  7.25k|#define MAX_BID_ENTRY	3
  ------------------
  |  Branch (726:10): [True: 1.95k, False: 5.30k]
  ------------------
  727|  1.95k|						break;
  728|  7.25k|				}
  729|  7.30k|			} else
  730|  1.00k|				break;
  731|  8.30k|		} else if (len > 4 && strncmp(p, "/set", 4) == 0) {
  ------------------
  |  Branch (731:14): [True: 4.67k, False: 36]
  |  Branch (731:25): [True: 1.94k, False: 2.73k]
  ------------------
  732|  1.94k|			if (bid_keyword_list(p+4, len-4, 0, 0) <= 0)
  ------------------
  |  Branch (732:8): [True: 27, False: 1.91k]
  ------------------
  733|     27|				break;
  734|       |			/* This line continues. */
  735|  1.91k|			if (p[len-nl-1] == '\\')
  ------------------
  |  Branch (735:8): [True: 59, False: 1.85k]
  ------------------
  736|     59|				multiline = 2;
  737|  2.76k|		} else if (len > 6 && strncmp(p, "/unset", 6) == 0) {
  ------------------
  |  Branch (737:14): [True: 2.73k, False: 37]
  |  Branch (737:25): [True: 2.66k, False: 69]
  ------------------
  738|  2.66k|			if (bid_keyword_list(p+6, len-6, 1, 0) <= 0)
  ------------------
  |  Branch (738:8): [True: 7, False: 2.65k]
  ------------------
  739|      7|				break;
  740|       |			/* This line continues. */
  741|  2.65k|			if (p[len-nl-1] == '\\')
  ------------------
  |  Branch (741:8): [True: 517, False: 2.13k]
  ------------------
  742|    517|				multiline = 2;
  743|  2.65k|		} else
  744|    106|			break;
  745|       |
  746|       |		/* Test next line. */
  747|  9.92k|		p += len;
  748|  9.92k|		avail -= len;
  749|  9.92k|	}
  750|  17.4k|	if (entry_cnt >= MAX_BID_ENTRY || (entry_cnt > 0 && len == 0)) {
  ------------------
  |  |  626|  34.8k|#define MAX_BID_ENTRY	3
  ------------------
  |  Branch (750:6): [True: 1.95k, False: 15.4k]
  |  Branch (750:37): [True: 1.15k, False: 14.3k]
  |  Branch (750:54): [True: 272, False: 883]
  ------------------
  751|  2.22k|		if (is_form_d != NULL) {
  ------------------
  |  Branch (751:7): [True: 1.07k, False: 1.15k]
  ------------------
  752|  1.07k|			if (form_D == 1)
  ------------------
  |  Branch (752:8): [True: 43, False: 1.03k]
  ------------------
  753|     43|				*is_form_d = 1;
  754|  1.07k|		}
  755|  2.22k|		return (32);
  756|  2.22k|	}
  757|       |
  758|  15.2k|	return (0);
  759|  17.4k|}
archive_read_support_format_mtree.c:next_line:
  329|  38.1M|{
  330|  38.1M|	ssize_t len;
  331|  38.1M|	int quit;
  332|       |	
  333|  38.1M|	quit = 0;
  334|  38.1M|	if (*avail == 0) {
  ------------------
  |  Branch (334:6): [True: 186, False: 38.1M]
  ------------------
  335|    186|		*nl = 0;
  336|    186|		len = 0;
  337|    186|	} else
  338|  38.1M|		len = get_line_size(*b, *avail, nl);
  339|       |	/*
  340|       |	 * Read bytes more while it does not reach the end of line.
  341|       |	 */
  342|  38.1M|	while (*nl == 0 && len == *avail && !quit) {
  ------------------
  |  Branch (342:9): [True: 14.7k, False: 38.1M]
  |  Branch (342:21): [True: 1.03k, False: 13.6k]
  |  Branch (342:38): [True: 1.02k, False: 11]
  ------------------
  343|  1.02k|		ssize_t diff = *ravail - *avail;
  344|  1.02k|		size_t nbytes_req = ((size_t)*ravail + 1023) & ~1023U;
  345|  1.02k|		ssize_t tested;
  346|       |
  347|       |		/*
  348|       |		 * Place an arbitrary limit on the line length.
  349|       |		 * mtree is almost free-form input and without line length limits,
  350|       |		 * it can consume a lot of memory.
  351|       |		 */
  352|  1.02k|		if (len >= MAX_LINE_LEN)
  ------------------
  |  |   84|  1.02k|#define	MAX_LINE_LEN		(1024 * 1024)
  ------------------
  |  Branch (352:7): [True: 62, False: 959]
  ------------------
  353|     62|			return (-1);
  354|       |
  355|       |		/* Increase reading bytes if it is not enough for at least
  356|       |		 * two new lines. */
  357|    959|		if (nbytes_req < (size_t)*ravail + 160)
  ------------------
  |  Branch (357:7): [True: 401, False: 558]
  ------------------
  358|    401|			nbytes_req <<= 1;
  359|       |
  360|    959|		*b = __archive_read_ahead(a, nbytes_req, avail);
  361|    959|		if (*b == NULL) {
  ------------------
  |  Branch (361:7): [True: 595, False: 364]
  ------------------
  362|    595|			if (*ravail >= *avail)
  ------------------
  |  Branch (362:8): [True: 569, False: 26]
  ------------------
  363|    569|				return (0);
  364|       |			/* Reading bytes reaches the end of file. */
  365|     26|			*b = __archive_read_ahead(a, *avail, avail);
  366|     26|			quit = 1;
  367|     26|		}
  368|    390|		*ravail = *avail;
  369|    390|		*b += diff;
  370|    390|		*avail -= diff;
  371|    390|		tested = len;/* Skip some bytes we already determined. */
  372|    390|		len = get_line_size(*b + len, *avail - len, nl);
  373|    390|		if (len >= 0)
  ------------------
  |  Branch (373:7): [True: 365, False: 25]
  ------------------
  374|    365|			len += tested;
  375|    390|	}
  376|  38.1M|	return (len);
  377|  38.1M|}
archive_read_support_format_mtree.c:get_line_size:
  285|  38.1M|{
  286|  38.1M|	ssize_t len;
  287|       |
  288|  38.1M|	len = 0;
  289|   126M|	while (len < avail) {
  ------------------
  |  Branch (289:9): [True: 126M, False: 846]
  ------------------
  290|   126M|		switch (*b) {
  291|  13.6k|		case '\0':/* Non-ascii character or control character. */
  ------------------
  |  Branch (291:3): [True: 13.6k, False: 126M]
  ------------------
  292|  13.6k|			if (nlsize != NULL)
  ------------------
  |  Branch (292:8): [True: 13.6k, False: 0]
  ------------------
  293|  13.6k|				*nlsize = 0;
  294|  13.6k|			return (-1);
  295|  28.3M|		case '\r':
  ------------------
  |  Branch (295:3): [True: 28.3M, False: 97.9M]
  ------------------
  296|  28.3M|			if (avail-len > 1 && b[1] == '\n') {
  ------------------
  |  Branch (296:8): [True: 28.3M, False: 36]
  |  Branch (296:25): [True: 2.56k, False: 28.3M]
  ------------------
  297|  2.56k|				if (nlsize != NULL)
  ------------------
  |  Branch (297:9): [True: 2.56k, False: 0]
  ------------------
  298|  2.56k|					*nlsize = 2;
  299|  2.56k|				return (len+2);
  300|  2.56k|			}
  301|       |			/* FALL THROUGH */
  302|  38.1M|		case '\n':
  ------------------
  |  Branch (302:3): [True: 9.83M, False: 116M]
  ------------------
  303|  38.1M|			if (nlsize != NULL)
  ------------------
  |  Branch (303:8): [True: 38.1M, False: 0]
  ------------------
  304|  38.1M|				*nlsize = 1;
  305|  38.1M|			return (len+1);
  306|  88.0M|		default:
  ------------------
  |  Branch (306:3): [True: 88.0M, False: 38.1M]
  ------------------
  307|  88.0M|			b++;
  308|  88.0M|			len++;
  309|  88.0M|			break;
  310|   126M|		}
  311|   126M|	}
  312|    846|	if (nlsize != NULL)
  ------------------
  |  Branch (312:6): [True: 846, False: 0]
  ------------------
  313|    846|		*nlsize = 0;
  314|    846|	return (avail);
  315|  38.1M|}
archive_read_support_format_mtree.c:bid_keyword_list:
  486|  13.6k|{
  487|  13.6k|	int l;
  488|  13.6k|	int keycnt = 0;
  489|       |
  490|  19.7k|	while (len > 0 && *p) {
  ------------------
  |  Branch (490:9): [True: 17.6k, False: 2.07k]
  |  Branch (490:20): [True: 17.6k, False: 0]
  ------------------
  491|  17.6k|		int blank = 0;
  492|       |
  493|       |		/* Test whether there are blank characters in the line. */
  494|  33.2k|		while (len >0 && (*p == ' ' || *p == '\t')) {
  ------------------
  |  Branch (494:10): [True: 33.1k, False: 140]
  |  Branch (494:21): [True: 11.4k, False: 21.6k]
  |  Branch (494:34): [True: 4.14k, False: 17.4k]
  ------------------
  495|  15.6k|			++p;
  496|  15.6k|			--len;
  497|  15.6k|			blank = 1;
  498|  15.6k|		}
  499|  17.6k|		if (*p == '\n' || *p == '\r')
  ------------------
  |  Branch (499:7): [True: 6.19k, False: 11.4k]
  |  Branch (499:21): [True: 1.49k, False: 9.94k]
  ------------------
  500|  7.68k|			break;
  501|  9.94k|		if (p[0] == '\\' && (p[1] == '\n' || p[1] == '\r'))
  ------------------
  |  Branch (501:7): [True: 1.01k, False: 8.93k]
  |  Branch (501:24): [True: 566, False: 449]
  |  Branch (501:40): [True: 449, False: 0]
  ------------------
  502|  1.01k|			break;
  503|  8.93k|		if (!blank && !last_is_path) /* No blank character. */
  ------------------
  |  Branch (503:7): [True: 148, False: 8.78k]
  |  Branch (503:17): [True: 3, False: 145]
  ------------------
  504|      3|			return (-1);
  505|  8.93k|		if (last_is_path && len == 0)
  ------------------
  |  Branch (505:7): [True: 305, False: 8.62k]
  |  Branch (505:23): [True: 140, False: 165]
  ------------------
  506|    140|				return (keycnt);
  507|       |
  508|  8.79k|		if (unset) {
  ------------------
  |  Branch (508:7): [True: 2.82k, False: 5.96k]
  ------------------
  509|  2.82k|			l = bid_keycmp(p, "all", len);
  510|  2.82k|			if (l > 0)
  ------------------
  |  Branch (510:8): [True: 2.57k, False: 251]
  ------------------
  511|  2.57k|				return (1);
  512|  2.82k|		}
  513|       |		/* Test whether there is a correct key in the line. */
  514|  6.21k|		l = bid_keyword(p, len);
  515|  6.21k|		if (l == 0)
  ------------------
  |  Branch (515:7): [True: 204, False: 6.01k]
  ------------------
  516|    204|			return (-1);/* Unknown keyword was found. */
  517|  6.01k|		p += l;
  518|  6.01k|		len -= l;
  519|  6.01k|		keycnt++;
  520|       |
  521|       |		/* Skip value */
  522|  6.01k|		if (*p == '=') {
  ------------------
  |  Branch (522:7): [True: 3.12k, False: 2.88k]
  ------------------
  523|  3.12k|			int value = 0;
  524|  3.12k|			++p;
  525|  3.12k|			--len;
  526|  45.4k|			while (len > 0 && *p != ' ' && *p != '\t') {
  ------------------
  |  Branch (526:11): [True: 43.3k, False: 2.07k]
  |  Branch (526:22): [True: 42.8k, False: 555]
  |  Branch (526:35): [True: 42.3k, False: 497]
  ------------------
  527|  42.3k|				++p;
  528|  42.3k|				--len;
  529|  42.3k|				value = 1;
  530|  42.3k|			}
  531|       |			/* A keyword should have a value unless this is
  532|       |			 * an "/unset" operation. */ 
  533|  3.12k|			if (!unset && value == 0)
  ------------------
  |  Branch (533:8): [True: 2.88k, False: 240]
  |  Branch (533:18): [True: 0, False: 2.88k]
  ------------------
  534|      0|				return (-1);
  535|  3.12k|		}
  536|  6.01k|	}
  537|  10.7k|	return (keycnt);
  538|  13.6k|}
archive_read_support_format_mtree.c:bid_keycmp:
  386|  11.7k|{
  387|  11.7k|	int match_len = 0;
  388|       |
  389|  52.2k|	while (len > 0 && *p && *key) {
  ------------------
  |  Branch (389:9): [True: 52.2k, False: 0]
  |  Branch (389:20): [True: 52.2k, False: 0]
  |  Branch (389:26): [True: 43.4k, False: 8.80k]
  ------------------
  390|  43.4k|		if (*p == *key) {
  ------------------
  |  Branch (390:7): [True: 40.4k, False: 2.97k]
  ------------------
  391|  40.4k|			--len;
  392|  40.4k|			++p;
  393|  40.4k|			++key;
  394|  40.4k|			++match_len;
  395|  40.4k|			continue;
  396|  40.4k|		}
  397|  2.97k|		return (0);/* Not match */
  398|  43.4k|	}
  399|  8.80k|	if (*key != '\0')
  ------------------
  |  Branch (399:6): [True: 0, False: 8.80k]
  ------------------
  400|      0|		return (0);/* Not match */
  401|       |
  402|       |	/* A following character should be specified characters */
  403|  8.80k|	if (p[0] == '=' || p[0] == ' ' || p[0] == '\t' ||
  ------------------
  |  Branch (403:6): [True: 3.42k, False: 5.38k]
  |  Branch (403:21): [True: 426, False: 4.95k]
  |  Branch (403:36): [True: 878, False: 4.08k]
  ------------------
  404|  4.08k|	    p[0] == '\n' || p[0] == '\r' ||
  ------------------
  |  Branch (404:6): [True: 1.48k, False: 2.59k]
  |  Branch (404:22): [True: 843, False: 1.75k]
  ------------------
  405|  1.75k|	   (p[0] == '\\' && (p[1] == '\n' || p[1] == '\r')))
  ------------------
  |  Branch (405:6): [True: 1.53k, False: 220]
  |  Branch (405:23): [True: 1.05k, False: 479]
  |  Branch (405:39): [True: 477, False: 2]
  ------------------
  406|  8.58k|		return (match_len);
  407|    222|	return (0);/* Not match */
  408|  8.80k|}
archive_read_support_format_mtree.c:bid_keyword:
  417|  6.21k|{
  418|  6.21k|	static const char * const keys_c[] = {
  419|  6.21k|		"content", "contents", "cksum", NULL
  420|  6.21k|	};
  421|  6.21k|	static const char * const keys_df[] = {
  422|  6.21k|		"device", "flags", NULL
  423|  6.21k|	};
  424|  6.21k|	static const char * const keys_g[] = {
  425|  6.21k|		"gid", "gname", NULL
  426|  6.21k|	};
  427|  6.21k|	static const char * const keys_il[] = {
  428|  6.21k|		"ignore", "inode", "link", NULL
  429|  6.21k|	};
  430|  6.21k|	static const char * const keys_m[] = {
  431|  6.21k|		"md5", "md5digest", "mode", NULL
  432|  6.21k|	};
  433|  6.21k|	static const char * const keys_no[] = {
  434|  6.21k|		"nlink", "nochange", "optional", NULL
  435|  6.21k|	};
  436|  6.21k|	static const char * const keys_r[] = {
  437|  6.21k|		"resdevice", "rmd160", "rmd160digest", NULL
  438|  6.21k|	};
  439|  6.21k|	static const char * const keys_s[] = {
  440|  6.21k|		"sha1", "sha1digest",
  441|  6.21k|		"sha256", "sha256digest",
  442|  6.21k|		"sha384", "sha384digest",
  443|  6.21k|		"sha512", "sha512digest",
  444|  6.21k|		"size", NULL
  445|  6.21k|	};
  446|  6.21k|	static const char * const keys_t[] = {
  447|  6.21k|		"tags", "time", "type", NULL
  448|  6.21k|	};
  449|  6.21k|	static const char * const keys_u[] = {
  450|  6.21k|		"uid", "uname",	NULL
  451|  6.21k|	};
  452|  6.21k|	const char * const *keys;
  453|  6.21k|	int i;
  454|       |
  455|  6.21k|	switch (*p) {
  456|    140|	case 'c': keys = keys_c; break;
  ------------------
  |  Branch (456:2): [True: 140, False: 6.07k]
  ------------------
  457|    848|	case 'd': case 'f': keys = keys_df; break;
  ------------------
  |  Branch (457:2): [True: 719, False: 5.49k]
  |  Branch (457:12): [True: 129, False: 6.08k]
  ------------------
  458|  3.04k|	case 'g': keys = keys_g; break;
  ------------------
  |  Branch (458:2): [True: 3.04k, False: 3.17k]
  ------------------
  459|    279|	case 'i': case 'l': keys = keys_il; break;
  ------------------
  |  Branch (459:2): [True: 241, False: 5.97k]
  |  Branch (459:12): [True: 38, False: 6.17k]
  ------------------
  460|    148|	case 'm': keys = keys_m; break;
  ------------------
  |  Branch (460:2): [True: 148, False: 6.06k]
  ------------------
  461|     80|	case 'n': case 'o': keys = keys_no; break;
  ------------------
  |  Branch (461:2): [True: 60, False: 6.15k]
  |  Branch (461:12): [True: 20, False: 6.19k]
  ------------------
  462|    556|	case 'r': keys = keys_r; break;
  ------------------
  |  Branch (462:2): [True: 556, False: 5.66k]
  ------------------
  463|    363|	case 's': keys = keys_s; break;
  ------------------
  |  Branch (463:2): [True: 363, False: 5.85k]
  ------------------
  464|    394|	case 't': keys = keys_t; break;
  ------------------
  |  Branch (464:2): [True: 394, False: 5.82k]
  ------------------
  465|    214|	case 'u': keys = keys_u; break;
  ------------------
  |  Branch (465:2): [True: 214, False: 6.00k]
  ------------------
  466|    148|	default: return (0);/* Unknown key */
  ------------------
  |  Branch (466:2): [True: 148, False: 6.06k]
  ------------------
  467|  6.21k|	}
  468|       |
  469|  9.01k|	for (i = 0; keys[i] != NULL; i++) {
  ------------------
  |  Branch (469:14): [True: 8.95k, False: 56]
  ------------------
  470|  8.95k|		int l = bid_keycmp(p, keys[i], len);
  471|  8.95k|		if (l > 0)
  ------------------
  |  Branch (471:7): [True: 6.01k, False: 2.94k]
  ------------------
  472|  6.01k|			return (l);
  473|  8.95k|	}
  474|     56|	return (0);/* Unknown key */
  475|  6.06k|}
archive_read_support_format_mtree.c:bid_entry:
  542|  8.30k|{
  543|  8.30k|	int f = 0;
  544|  8.30k|	static const unsigned char safe_char[256] = {
  545|  8.30k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 00 - 0F */
  546|  8.30k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 10 - 1F */
  547|       |		/* !"$%&'()*+,-./  EXCLUSION:( )(#) */
  548|  8.30k|		0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 20 - 2F */
  549|       |		/* 0123456789:;<>?  EXCLUSION:(=) */
  550|  8.30k|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, /* 30 - 3F */
  551|       |		/* @ABCDEFGHIJKLMNO */
  552|  8.30k|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 40 - 4F */
  553|       |		/* PQRSTUVWXYZ[\]^_  */
  554|  8.30k|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 50 - 5F */
  555|       |		/* `abcdefghijklmno */
  556|  8.30k|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 60 - 6F */
  557|       |		/* pqrstuvwxyz{|}~ */
  558|  8.30k|		1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, /* 70 - 7F */
  559|  8.30k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 80 - 8F */
  560|  8.30k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 90 - 9F */
  561|  8.30k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A0 - AF */
  562|  8.30k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* B0 - BF */
  563|  8.30k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* C0 - CF */
  564|  8.30k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* D0 - DF */
  565|  8.30k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* E0 - EF */
  566|  8.30k|		0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* F0 - FF */
  567|  8.30k|	};
  568|  8.30k|	ssize_t ll;
  569|  8.30k|	const char *pp = p;
  570|  8.30k|	const char * const pp_end = pp + len;
  571|       |
  572|  8.30k|	*last_is_path = 0;
  573|       |	/*
  574|       |	 * Skip the path-name which is quoted.
  575|       |	 */
  576|  1.67M|	for (;pp < pp_end; ++pp) {
  ------------------
  |  Branch (576:8): [True: 1.67M, False: 0]
  ------------------
  577|  1.67M|		if (!safe_char[*(const unsigned char *)pp]) {
  ------------------
  |  Branch (577:7): [True: 8.30k, False: 1.66M]
  ------------------
  578|  8.30k|			if (*pp != ' ' && *pp != '\t' && *pp != '\r'
  ------------------
  |  Branch (578:8): [True: 7.72k, False: 578]
  |  Branch (578:22): [True: 6.99k, False: 733]
  |  Branch (578:37): [True: 6.02k, False: 970]
  ------------------
  579|  6.02k|			    && *pp != '\n')
  ------------------
  |  Branch (579:11): [True: 979, False: 5.04k]
  ------------------
  580|    979|				f = 0;
  581|  8.30k|			break;
  582|  8.30k|		}
  583|  1.66M|		f = 1;
  584|  1.66M|	}
  585|  8.30k|	ll = pp_end - pp;
  586|       |
  587|       |	/* If a path-name was not found at the first, try to check
  588|       |	 * a mtree format(a.k.a form D) ``NetBSD's mtree -D'' creates,
  589|       |	 * which places the path-name at the last. */
  590|  8.30k|	if (f == 0) {
  ------------------
  |  Branch (590:6): [True: 979, False: 7.32k]
  ------------------
  591|    979|		const char *pb = p + len - nl;
  592|    979|		int name_len = 0;
  593|    979|		int slash;
  594|       |
  595|       |		/* The form D accepts only a single line for an entry. */
  596|    979|		if (pb-2 >= p &&
  ------------------
  |  Branch (596:7): [True: 971, False: 8]
  ------------------
  597|    971|		    pb[-1] == '\\' && (pb[-2] == ' ' || pb[-2] == '\t'))
  ------------------
  |  Branch (597:7): [True: 3, False: 968]
  |  Branch (597:26): [True: 0, False: 3]
  |  Branch (597:43): [True: 0, False: 3]
  ------------------
  598|      0|			return (-1);
  599|    979|		if (pb-1 >= p && pb[-1] == '\\')
  ------------------
  |  Branch (599:7): [True: 979, False: 0]
  |  Branch (599:20): [True: 3, False: 976]
  ------------------
  600|      3|			return (-1);
  601|       |
  602|    976|		slash = 0;
  603|  1.58M|		while (p <= --pb && *pb != ' ' && *pb != '\t') {
  ------------------
  |  Branch (603:10): [True: 1.58M, False: 0]
  |  Branch (603:23): [True: 1.58M, False: 52]
  |  Branch (603:37): [True: 1.58M, False: 139]
  ------------------
  604|  1.58M|			if (!safe_char[*(const unsigned char *)pb])
  ------------------
  |  Branch (604:8): [True: 785, False: 1.58M]
  ------------------
  605|    785|				return (-1);
  606|  1.58M|			name_len++;
  607|       |			/* The pathname should have a slash in this
  608|       |			 * format. */
  609|  1.58M|			if (*pb == '/')
  ------------------
  |  Branch (609:8): [True: 513, False: 1.58M]
  ------------------
  610|    513|				slash = 1;
  611|  1.58M|		}
  612|    191|		if (name_len == 0 || slash == 0)
  ------------------
  |  Branch (612:7): [True: 26, False: 165]
  |  Branch (612:24): [True: 20, False: 145]
  ------------------
  613|     46|			return (-1);
  614|       |		/* If '/' is placed at the first in this field, this is not
  615|       |		 * a valid filename. */
  616|    145|		if (pb[1] == '/')
  ------------------
  |  Branch (616:7): [True: 0, False: 145]
  ------------------
  617|      0|			return (-1);
  618|    145|		ll = len - nl - name_len;
  619|    145|		pp = p;
  620|    145|		*last_is_path = 1;
  621|    145|	}
  622|       |
  623|  7.47k|	return (bid_keyword_list(pp, ll, 0, *last_is_path));
  624|  8.30k|}
archive_read_support_format_mtree.c:read_header:
 1077|  40.5k|{
 1078|  40.5k|	struct mtree *mtree = a->format->data;
 1079|  40.5k|	int r, use_next;
 1080|       |
 1081|  40.5k|	if (mtree->fd >= 0) {
  ------------------
  |  Branch (1081:6): [True: 0, False: 40.5k]
  ------------------
 1082|      0|		close(mtree->fd);
 1083|      0|		mtree->fd = -1;
 1084|      0|	}
 1085|       |
 1086|  40.5k|	if (mtree->entries == NULL) {
  ------------------
  |  Branch (1086:6): [True: 1.11k, False: 39.3k]
  ------------------
 1087|  1.11k|		mtree->resolver = archive_entry_linkresolver_new();
 1088|  1.11k|		if (mtree->resolver == NULL)
  ------------------
  |  Branch (1088:7): [True: 0, False: 1.11k]
  ------------------
 1089|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1090|  1.11k|		archive_entry_linkresolver_set_strategy(mtree->resolver,
 1091|  1.11k|		    ARCHIVE_FORMAT_MTREE);
  ------------------
  |  |  379|  1.11k|#define	ARCHIVE_FORMAT_MTREE			0x80000
  ------------------
 1092|  1.11k|		r = read_mtree(a, mtree);
 1093|  1.11k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  1.11k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1093:7): [True: 71, False: 1.04k]
  ------------------
 1094|     71|			return (r);
 1095|  1.11k|	}
 1096|       |
 1097|  40.4k|	a->archive.archive_format = mtree->archive_format;
 1098|  40.4k|	a->archive.archive_format_name = mtree->archive_format_name;
 1099|       |
 1100|  86.4k|	for (;;) {
 1101|  86.4k|		if (mtree->this_entry == NULL)
  ------------------
  |  Branch (1101:7): [True: 1.04k, False: 85.3k]
  ------------------
 1102|  1.04k|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|  1.04k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1103|  85.3k|		if (strcmp(mtree->this_entry->name, "..") == 0) {
  ------------------
  |  Branch (1103:7): [True: 2.79k, False: 82.5k]
  ------------------
 1104|  2.79k|			mtree->this_entry->used = 1;
 1105|  2.79k|			if (archive_strlen(&mtree->current_dir) > 0) {
  ------------------
  |  |  178|  2.79k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1105:8): [True: 2.39k, False: 406]
  ------------------
 1106|       |				/* Roll back current path. */
 1107|  2.39k|				archive_string_dirname(&mtree->current_dir);
 1108|  2.39k|				if (strcmp(mtree->current_dir.s, ".") == 0)
  ------------------
  |  Branch (1108:9): [True: 1.16k, False: 1.22k]
  ------------------
 1109|  1.16k|					archive_string_empty(&mtree->current_dir);
  ------------------
  |  |  181|  1.16k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1110|  2.39k|			}
 1111|  2.79k|		}
 1112|  85.3k|		if (!mtree->this_entry->used) {
  ------------------
  |  Branch (1112:7): [True: 39.3k, False: 45.9k]
  ------------------
 1113|  39.3k|			use_next = 0;
 1114|  39.3k|			r = parse_file(a, entry, mtree, mtree->this_entry,
 1115|  39.3k|				&use_next);
 1116|  39.3k|			if (use_next == 0)
  ------------------
  |  Branch (1116:8): [True: 39.3k, False: 0]
  ------------------
 1117|  39.3k|				return (r);
 1118|  39.3k|		}
 1119|  45.9k|		mtree->this_entry = mtree->this_entry->next;
 1120|  45.9k|	}
 1121|  40.4k|}
archive_read_support_format_mtree.c:read_mtree:
  996|  1.11k|{
  997|  1.11k|	ssize_t len;
  998|  1.11k|	uintmax_t counter;
  999|  1.11k|	char *p, *s;
 1000|  1.11k|	struct mtree_option *global;
 1001|  1.11k|	struct mtree_entry *last_entry;
 1002|  1.11k|	int r, is_form_d;
 1003|       |
 1004|  1.11k|	mtree->archive_format = ARCHIVE_FORMAT_MTREE;
  ------------------
  |  |  379|  1.11k|#define	ARCHIVE_FORMAT_MTREE			0x80000
  ------------------
 1005|  1.11k|	mtree->archive_format_name = "mtree";
 1006|       |
 1007|  1.11k|	global = NULL;
 1008|  1.11k|	last_entry = NULL;
 1009|       |
 1010|  1.11k|	(void)detect_form(a, &is_form_d);
 1011|       |
 1012|   587k|	for (counter = 1; ; ++counter) {
 1013|   587k|		r = ARCHIVE_OK;
  ------------------
  |  |  233|   587k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1014|   587k|		len = readline(a, mtree, &p, 65536);
 1015|   587k|		if (len == 0) {
  ------------------
  |  Branch (1015:7): [True: 1.04k, False: 586k]
  ------------------
 1016|  1.04k|			mtree->this_entry = mtree->entries;
 1017|  1.04k|			free_options(global);
 1018|  1.04k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.04k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1019|  1.04k|		}
 1020|   586k|		if (len < 0) {
  ------------------
  |  Branch (1020:7): [True: 8, False: 586k]
  ------------------
 1021|      8|			free_options(global);
 1022|      8|			return ((int)len);
 1023|      8|		}
 1024|       |		/* Leading whitespace is never significant, ignore it. */
 1025|   688k|		while (*p == ' ' || *p == '\t') {
  ------------------
  |  Branch (1025:10): [True: 101k, False: 586k]
  |  Branch (1025:23): [True: 385, False: 586k]
  ------------------
 1026|   102k|			++p;
 1027|   102k|			--len;
 1028|   102k|		}
 1029|       |		/* Skip content lines and blank lines. */
 1030|   586k|		if (*p == '#')
  ------------------
  |  Branch (1030:7): [True: 998, False: 585k]
  ------------------
 1031|    998|			continue;
 1032|   585k|		if (*p == '\r' || *p == '\n' || *p == '\0')
  ------------------
  |  Branch (1032:7): [True: 40, False: 585k]
  |  Branch (1032:21): [True: 533k, False: 51.4k]
  |  Branch (1032:35): [True: 0, False: 51.4k]
  ------------------
 1033|   533k|			continue;
 1034|       |		/* Non-printable characters are not allowed */
 1035|  15.7M|		for (s = p;s < p + len - 1; s++) {
  ------------------
  |  Branch (1035:14): [True: 15.6M, False: 51.4k]
  ------------------
 1036|  15.6M|			if (!isprint((unsigned char)*s) && *s != '\t') {
  ------------------
  |  Branch (1036:8): [True: 12.6k, False: 15.6M]
  |  Branch (1036:39): [True: 44, False: 12.5k]
  ------------------
 1037|     44|				archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     44|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1038|     44|					"Non-printable character 0x%02X", (unsigned char)(*s));
 1039|     44|				r = ARCHIVE_FATAL;
  ------------------
  |  |  239|     44|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1040|     44|				break;
 1041|     44|			}
 1042|  15.6M|		}
 1043|  51.4k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  51.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1043:7): [True: 44, False: 51.4k]
  ------------------
 1044|     44|			break;
 1045|  51.4k|		if (*p != '/') {
  ------------------
  |  Branch (1045:7): [True: 47.9k, False: 3.52k]
  ------------------
 1046|  47.9k|			r = process_add_entry(a, mtree, &global, p, len,
 1047|  47.9k|			    &last_entry, is_form_d);
 1048|  47.9k|		} else if (len > 4 && strncmp(p, "/set", 4) == 0) {
  ------------------
  |  Branch (1048:14): [True: 3.52k, False: 1]
  |  Branch (1048:25): [True: 2.25k, False: 1.26k]
  ------------------
 1049|  2.25k|			if (p[4] != ' ' && p[4] != '\t')
  ------------------
  |  Branch (1049:8): [True: 803, False: 1.45k]
  |  Branch (1049:23): [True: 0, False: 803]
  ------------------
 1050|      0|				break;
 1051|  2.25k|			r = process_global_set(a, &global, p);
 1052|  2.25k|		} else if (len > 6 && strncmp(p, "/unset", 6) == 0) {
  ------------------
  |  Branch (1052:14): [True: 1.26k, False: 2]
  |  Branch (1052:25): [True: 1.25k, False: 10]
  ------------------
 1053|  1.25k|			if (p[6] != ' ' && p[6] != '\t')
  ------------------
  |  Branch (1053:8): [True: 133, False: 1.12k]
  |  Branch (1053:23): [True: 0, False: 133]
  ------------------
 1054|      0|				break;
 1055|  1.25k|			r = process_global_unset(a, &global, p);
 1056|  1.25k|		} else
 1057|     12|			break;
 1058|       |
 1059|  51.4k|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|  51.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1059:7): [True: 7, False: 51.4k]
  ------------------
 1060|      7|			free_options(global);
 1061|      7|			return r;
 1062|      7|		}
 1063|  51.4k|	}
 1064|       |
 1065|     56|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     56|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1066|     56|	    "Can't parse line %ju", counter);
 1067|     56|	free_options(global);
 1068|     56|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     56|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1069|  1.11k|}
archive_read_support_format_mtree.c:readline:
 2041|   587k|{
 2042|   587k|	ssize_t bytes_read;
 2043|   587k|	ssize_t total_size = 0;
 2044|   587k|	ssize_t find_off = 0;
 2045|   587k|	const void *nl, *t;
 2046|   587k|	char *u;
 2047|       |
 2048|       |	/* Accumulate line in a line buffer. */
 2049|   658k|	for (;;) {
 2050|       |		/* Read some more. */
 2051|   658k|		t = __archive_read_ahead(a, 1, &bytes_read);
 2052|   658k|		if (t == NULL)
  ------------------
  |  Branch (2052:7): [True: 1.04k, False: 657k]
  ------------------
 2053|  1.04k|			return (0);
 2054|   657k|		if (bytes_read < 0)
  ------------------
  |  Branch (2054:7): [True: 0, False: 657k]
  ------------------
 2055|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2056|   657k|		nl = memchr(t, '\n', bytes_read);
 2057|       |		/* If we found '\n', trim the read to end exactly there. */
 2058|   657k|		if (nl != NULL) {
  ------------------
  |  Branch (2058:7): [True: 656k, False: 899]
  ------------------
 2059|   656k|			bytes_read = ((const char *)nl) - ((const char *)t) + 1;
 2060|   656k|		}
 2061|   657k|		if (total_size + bytes_read + 1 > limit) {
  ------------------
  |  Branch (2061:7): [True: 8, False: 657k]
  ------------------
 2062|      8|			archive_set_error(&a->archive,
 2063|      8|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      8|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2064|      8|			    "Line too long");
 2065|      8|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2066|      8|		}
 2067|   657k|		if (archive_string_ensure(&mtree->line,
  ------------------
  |  Branch (2067:7): [True: 0, False: 657k]
  ------------------
 2068|   657k|			total_size + bytes_read + 1) == NULL) {
 2069|      0|			archive_set_error(&a->archive, ENOMEM,
 2070|      0|			    "Can't allocate working buffer");
 2071|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2072|      0|		}
 2073|       |		/* Append new bytes to string. */
 2074|   657k|		memcpy(mtree->line.s + total_size, t, bytes_read);
 2075|   657k|		__archive_read_consume(a, bytes_read);
 2076|   657k|		total_size += bytes_read;
 2077|   657k|		mtree->line.s[total_size] = '\0';
 2078|       |
 2079|  17.7M|		for (u = mtree->line.s + find_off; *u; ++u) {
  ------------------
  |  Branch (2079:38): [True: 17.7M, False: 70.5k]
  ------------------
 2080|  17.7M|			if (u[0] == '\n') {
  ------------------
  |  Branch (2080:8): [True: 586k, False: 17.1M]
  ------------------
 2081|       |				/* Ends with unescaped newline. */
 2082|       |				/* Check if preceded by '\r' for CRLF handling */
 2083|   586k|				if (u > mtree->line.s && u[-1] == '\r') {
  ------------------
  |  Branch (2083:9): [True: 52.5k, False: 533k]
  |  Branch (2083:30): [True: 549, False: 52.0k]
  ------------------
 2084|       |					/* CRLF ending - remove the '\r' */
 2085|    549|					u[-1] = '\n';
 2086|    549|					u[0] = '\0';
 2087|    549|					total_size--;
 2088|    549|				}
 2089|   586k|				*start = mtree->line.s;
 2090|   586k|				return total_size;
 2091|  17.1M|			} else if (u[0] == '#') {
  ------------------
  |  Branch (2091:15): [True: 989k, False: 16.1M]
  ------------------
 2092|       |				/* Ends with comment sequence #...\n */
 2093|   989k|				if (nl == NULL) {
  ------------------
  |  Branch (2093:9): [True: 20, False: 989k]
  ------------------
 2094|       |					/* But we've not found the \n yet */
 2095|     20|					break;
 2096|     20|				}
 2097|  16.1M|			} else if (u[0] == '\\') {
  ------------------
  |  Branch (2097:15): [True: 8.61k, False: 16.1M]
  ------------------
 2098|  8.61k|				if (u[1] == '\n') {
  ------------------
  |  Branch (2098:9): [True: 603, False: 8.01k]
  ------------------
 2099|       |					/* Trim escaped newline. */
 2100|    603|					total_size -= 2;
 2101|    603|					mtree->line.s[total_size] = '\0';
 2102|    603|					break;
 2103|  8.01k|				} else if (u[1] == '\r' && u[2] == '\n') {
  ------------------
  |  Branch (2103:16): [True: 557, False: 7.45k]
  |  Branch (2103:32): [True: 265, False: 292]
  ------------------
 2104|       |					/* Trim escaped CRLF. */
 2105|    265|					total_size -= 3;
 2106|    265|					mtree->line.s[total_size] = '\0';
 2107|    265|					break;
 2108|  7.74k|				} else if (u[1] != '\0') {
  ------------------
  |  Branch (2108:16): [True: 7.73k, False: 10]
  ------------------
 2109|       |					/* Skip the two-char escape sequence */
 2110|  7.73k|					++u;
 2111|  7.73k|				}
 2112|  8.61k|			}
 2113|  17.7M|		}
 2114|  71.4k|		find_off = u - mtree->line.s;
 2115|  71.4k|	}
 2116|   587k|}
archive_read_support_format_mtree.c:process_add_entry:
  882|  47.9k|{
  883|  47.9k|	struct mtree_entry *entry;
  884|  47.9k|	struct mtree_option *iter;
  885|  47.9k|	const char *next, *eq, *name, *end;
  886|  47.9k|	size_t name_len, len;
  887|  47.9k|	int r, i;
  888|       |
  889|  47.9k|	if ((entry = malloc(sizeof(*entry))) == NULL) {
  ------------------
  |  Branch (889:6): [True: 0, False: 47.9k]
  ------------------
  890|      0|		archive_set_error(&a->archive, errno, "Can't allocate memory");
  891|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  892|      0|	}
  893|  47.9k|	entry->next = NULL;
  894|  47.9k|	entry->options = NULL;
  895|  47.9k|	entry->name = NULL;
  896|  47.9k|	entry->used = 0;
  897|  47.9k|	entry->full = 0;
  898|       |
  899|       |	/* Add this entry to list. */
  900|  47.9k|	if (*last_entry == NULL)
  ------------------
  |  Branch (900:6): [True: 1.07k, False: 46.8k]
  ------------------
  901|  1.07k|		mtree->entries = entry;
  902|  46.8k|	else
  903|  46.8k|		(*last_entry)->next = entry;
  904|  47.9k|	*last_entry = entry;
  905|       |
  906|  47.9k|	if (is_form_d) {
  ------------------
  |  Branch (906:6): [True: 1.25k, False: 46.6k]
  ------------------
  907|       |		/* Filename is last item on line. */
  908|       |		/* Adjust line_len to trim trailing whitespace */
  909|  2.82k|		while (line_len > 0) {
  ------------------
  |  Branch (909:10): [True: 2.82k, False: 0]
  ------------------
  910|  2.82k|			char last_character = line[line_len - 1];
  911|  2.82k|			if (last_character == '\r'
  ------------------
  |  Branch (911:8): [True: 0, False: 2.82k]
  ------------------
  912|  2.82k|			    || last_character == '\n'
  ------------------
  |  Branch (912:11): [True: 1.25k, False: 1.57k]
  ------------------
  913|  1.57k|			    || last_character == '\t'
  ------------------
  |  Branch (913:11): [True: 171, False: 1.40k]
  ------------------
  914|  1.57k|			    || last_character == ' ') {
  ------------------
  |  Branch (914:11): [True: 158, False: 1.25k]
  ------------------
  915|  1.57k|				line_len--;
  916|  1.57k|			} else {
  917|  1.25k|				break;
  918|  1.25k|			}
  919|  2.82k|		}
  920|       |		/* Name starts after the last whitespace separator */
  921|  1.25k|		name = line;
  922|  11.1k|		for (i = 0; i < line_len; i++) {
  ------------------
  |  Branch (922:15): [True: 9.94k, False: 1.25k]
  ------------------
  923|  9.94k|			if (line[i] == '\r'
  ------------------
  |  Branch (923:8): [True: 0, False: 9.94k]
  ------------------
  924|  9.94k|			    || line[i] == '\n'
  ------------------
  |  Branch (924:11): [True: 0, False: 9.94k]
  ------------------
  925|  9.94k|			    || line[i] == '\t'
  ------------------
  |  Branch (925:11): [True: 660, False: 9.28k]
  ------------------
  926|  9.28k|			    || line[i] == ' ') {
  ------------------
  |  Branch (926:11): [True: 1.11k, False: 8.17k]
  ------------------
  927|  1.77k|				name = line + i + 1;
  928|  1.77k|			}
  929|  9.94k|		}
  930|  1.25k|		name_len = line + line_len - name;
  931|  1.25k|		end = name;
  932|  46.6k|	} else {
  933|       |		/* Filename is first item on line */
  934|  46.6k|		name_len = strcspn(line, " \t\r\n");
  935|  46.6k|		name = line;
  936|  46.6k|		line += name_len;
  937|  46.6k|		end = line + line_len;
  938|  46.6k|	}
  939|       |	/* name/name_len is the name within the line. */
  940|       |	/* line..end brackets the entire line except the name */
  941|       |
  942|  47.9k|	if ((entry->name = malloc(name_len + 1)) == NULL) {
  ------------------
  |  Branch (942:6): [True: 0, False: 47.9k]
  ------------------
  943|      0|		archive_set_error(&a->archive, errno, "Can't allocate memory");
  944|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  945|      0|	}
  946|       |
  947|  47.9k|	memcpy(entry->name, name, name_len);
  948|  47.9k|	entry->name[name_len] = '\0';
  949|  47.9k|	parse_escapes(entry->name, entry);
  950|       |
  951|  47.9k|	entry->next_dup = NULL;
  952|  47.9k|	if (entry->full) {
  ------------------
  |  Branch (952:6): [True: 6.45k, False: 41.4k]
  ------------------
  953|  6.45k|		if (!__archive_rb_tree_insert_node(&mtree->rbtree, &entry->rbnode)) {
  ------------------
  |  Branch (953:7): [True: 3.97k, False: 2.48k]
  ------------------
  954|  3.97k|			struct mtree_entry *alt;
  955|  3.97k|			alt = (struct mtree_entry *)__archive_rb_tree_find_node(
  956|  3.97k|			    &mtree->rbtree, entry->name);
  957|  3.97k|			if (alt != NULL) {
  ------------------
  |  Branch (957:8): [True: 3.97k, False: 0]
  ------------------
  958|   197k|				while (alt->next_dup)
  ------------------
  |  Branch (958:12): [True: 193k, False: 3.97k]
  ------------------
  959|   193k|					alt = alt->next_dup;
  960|  3.97k|				alt->next_dup = entry;
  961|  3.97k|			}
  962|  3.97k|		}
  963|  6.45k|	}
  964|       |
  965|   117k|	for (iter = *global; iter != NULL; iter = iter->next) {
  ------------------
  |  Branch (965:23): [True: 69.9k, False: 47.9k]
  ------------------
  966|  69.9k|		r = add_option(a, &entry->options, iter->value,
  967|  69.9k|		    strlen(iter->value));
  968|  69.9k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  69.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (968:7): [True: 0, False: 69.9k]
  ------------------
  969|      0|			return (r);
  970|  69.9k|	}
  971|       |
  972|  76.0k|	for (;;) {
  973|  76.0k|		next = line + strspn(line, " \t\r\n");
  974|  76.0k|		if (*next == '\0')
  ------------------
  |  Branch (974:7): [True: 46.6k, False: 29.4k]
  ------------------
  975|  46.6k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  46.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  976|  29.4k|		if (next >= end)
  ------------------
  |  Branch (976:7): [True: 1.25k, False: 28.1k]
  ------------------
  977|  1.25k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.25k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  978|  28.1k|		line = next;
  979|  28.1k|		next = line + strcspn(line, " \t\r\n");
  980|  28.1k|		eq = strchr(line, '=');
  981|  28.1k|		if (eq == NULL || eq > next)
  ------------------
  |  Branch (981:7): [True: 19.4k, False: 8.73k]
  |  Branch (981:21): [True: 1.14k, False: 7.58k]
  ------------------
  982|  20.5k|			len = next - line;
  983|  7.58k|		else
  984|  7.58k|			len = eq - line;
  985|       |
  986|  28.1k|		remove_option(&entry->options, line, len);
  987|  28.1k|		r = add_option(a, &entry->options, line, next - line);
  988|  28.1k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  28.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (988:7): [True: 0, False: 28.1k]
  ------------------
  989|      0|			return (r);
  990|  28.1k|		line = next;
  991|  28.1k|	}
  992|  47.9k|}
archive_read_support_format_mtree.c:parse_escapes:
 1898|  49.6k|{
 1899|  49.6k|	char *dest = src;
 1900|  49.6k|	char c;
 1901|       |
 1902|  49.6k|	if (mentry != NULL && strcmp(src, ".") == 0)
  ------------------
  |  Branch (1902:6): [True: 47.9k, False: 1.70k]
  |  Branch (1902:24): [True: 863, False: 47.0k]
  ------------------
 1903|    863|		mentry->full = 1;
 1904|       |
 1905|  9.59M|	while (*src != '\0') {
  ------------------
  |  Branch (1905:9): [True: 9.54M, False: 49.6k]
  ------------------
 1906|  9.54M|		c = *src++;
 1907|  9.54M|		if (c == '/' && mentry != NULL)
  ------------------
  |  Branch (1907:7): [True: 7.74k, False: 9.53M]
  |  Branch (1907:19): [True: 7.51k, False: 225]
  ------------------
 1908|  7.51k|			mentry->full = 1;
 1909|  9.54M|		if (c == '\\') {
  ------------------
  |  Branch (1909:7): [True: 6.96k, False: 9.53M]
  ------------------
 1910|  6.96k|			switch (src[0]) {
  ------------------
  |  Branch (1910:12): [True: 5.76k, False: 1.20k]
  ------------------
 1911|  2.59k|			case '0':
  ------------------
  |  Branch (1911:4): [True: 2.59k, False: 4.37k]
  ------------------
 1912|  2.59k|				if (src[1] < '0' || src[1] > '7') {
  ------------------
  |  Branch (1912:9): [True: 212, False: 2.37k]
  |  Branch (1912:25): [True: 722, False: 1.65k]
  ------------------
 1913|    934|					c = 0;
 1914|    934|					++src;
 1915|    934|					break;
 1916|    934|				}
 1917|       |				/* FALLTHROUGH */
 1918|  2.03k|			case '1':
  ------------------
  |  Branch (1918:4): [True: 382, False: 6.58k]
  ------------------
 1919|  2.37k|			case '2':
  ------------------
  |  Branch (1919:4): [True: 338, False: 6.62k]
  ------------------
 1920|  3.04k|			case '3':
  ------------------
  |  Branch (1920:4): [True: 672, False: 6.29k]
  ------------------
 1921|  3.04k|				if (src[1] >= '0' && src[1] <= '7' &&
  ------------------
  |  Branch (1921:9): [True: 2.78k, False: 261]
  |  Branch (1921:26): [True: 2.06k, False: 724]
  ------------------
 1922|  2.06k|				    src[2] >= '0' && src[2] <= '7') {
  ------------------
  |  Branch (1922:9): [True: 1.71k, False: 353]
  |  Branch (1922:26): [True: 408, False: 1.30k]
  ------------------
 1923|    408|					c = (src[0] - '0') << 6;
 1924|    408|					c |= (src[1] - '0') << 3;
 1925|    408|					c |= (src[2] - '0');
 1926|    408|					src += 3;
 1927|    408|				}
 1928|  3.04k|				break;
 1929|     41|			case 'a':
  ------------------
  |  Branch (1929:4): [True: 41, False: 6.92k]
  ------------------
 1930|     41|				c = '\a';
 1931|     41|				++src;
 1932|     41|				break;
 1933|    229|			case 'b':
  ------------------
  |  Branch (1933:4): [True: 229, False: 6.73k]
  ------------------
 1934|    229|				c = '\b';
 1935|    229|				++src;
 1936|    229|				break;
 1937|    204|			case 'f':
  ------------------
  |  Branch (1937:4): [True: 204, False: 6.76k]
  ------------------
 1938|    204|				c = '\f';
 1939|    204|				++src;
 1940|    204|				break;
 1941|    234|			case 'n':
  ------------------
  |  Branch (1941:4): [True: 234, False: 6.73k]
  ------------------
 1942|    234|				c = '\n';
 1943|    234|				++src;
 1944|    234|				break;
 1945|    496|			case 'r':
  ------------------
  |  Branch (1945:4): [True: 496, False: 6.47k]
  ------------------
 1946|    496|				c = '\r';
 1947|    496|				++src;
 1948|    496|				break;
 1949|     63|			case 's':
  ------------------
  |  Branch (1949:4): [True: 63, False: 6.90k]
  ------------------
 1950|     63|				c = ' ';
 1951|     63|				++src;
 1952|     63|				break;
 1953|     72|			case 't':
  ------------------
  |  Branch (1953:4): [True: 72, False: 6.89k]
  ------------------
 1954|     72|				c = '\t';
 1955|     72|				++src;
 1956|     72|				break;
 1957|     39|			case 'v':
  ------------------
  |  Branch (1957:4): [True: 39, False: 6.92k]
  ------------------
 1958|     39|				c = '\v';
 1959|     39|				++src;
 1960|     39|				break;
 1961|    406|			case '\\':
  ------------------
  |  Branch (1961:4): [True: 406, False: 6.56k]
  ------------------
 1962|    406|				c = '\\';
 1963|    406|				++src;
 1964|    406|				break;
 1965|  6.96k|			}
 1966|  6.96k|		}
 1967|  9.54M|		*dest++ = c;
 1968|  9.54M|	}
 1969|  49.6k|	*dest = '\0';
 1970|  49.6k|}
archive_read_support_format_mtree.c:add_option:
  775|   107k|{
  776|   107k|	struct mtree_option *opt;
  777|       |
  778|   107k|	if ((opt = malloc(sizeof(*opt))) == NULL) {
  ------------------
  |  Branch (778:6): [True: 0, False: 107k]
  ------------------
  779|      0|		archive_set_error(&a->archive, errno, "Can't allocate memory");
  780|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  781|      0|	}
  782|   107k|	if ((opt->value = malloc(len + 1)) == NULL) {
  ------------------
  |  Branch (782:6): [True: 0, False: 107k]
  ------------------
  783|      0|		free(opt);
  784|      0|		archive_set_error(&a->archive, errno, "Can't allocate memory");
  785|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  786|      0|	}
  787|   107k|	memcpy(opt->value, value, len);
  788|   107k|	opt->value[len] = '\0';
  789|   107k|	opt->next = *global;
  790|   107k|	*global = opt;
  791|   107k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|   107k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  792|   107k|}
archive_read_support_format_mtree.c:remove_option:
  796|  42.7k|{
  797|  42.7k|	struct mtree_option *iter, *last;
  798|       |
  799|  42.7k|	last = NULL;
  800|   169k|	for (iter = *global; iter != NULL; last = iter, iter = iter->next) {
  ------------------
  |  Branch (800:23): [True: 142k, False: 27.6k]
  ------------------
  801|   142k|		if (strncmp(iter->value, value, len) == 0 &&
  ------------------
  |  Branch (801:7): [True: 23.5k, False: 118k]
  ------------------
  802|  23.5k|		    (iter->value[len] == '\0' ||
  ------------------
  |  Branch (802:8): [True: 12.8k, False: 10.6k]
  ------------------
  803|  10.6k|		     iter->value[len] == '='))
  ------------------
  |  Branch (803:8): [True: 2.32k, False: 8.36k]
  ------------------
  804|  15.1k|			break;
  805|   142k|	}
  806|  42.7k|	if (iter == NULL)
  ------------------
  |  Branch (806:6): [True: 27.6k, False: 15.1k]
  ------------------
  807|  27.6k|		return;
  808|  15.1k|	if (last == NULL)
  ------------------
  |  Branch (808:6): [True: 4.70k, False: 10.4k]
  ------------------
  809|  4.70k|		*global = iter->next;
  810|  10.4k|	else
  811|  10.4k|		last->next = iter->next;
  812|       |
  813|  15.1k|	free(iter->value);
  814|  15.1k|	free(iter);
  815|  15.1k|}
archive_read_support_format_mtree.c:process_global_set:
  820|  2.25k|{
  821|  2.25k|	const char *next, *eq;
  822|  2.25k|	size_t len;
  823|  2.25k|	int r;
  824|       |
  825|  2.25k|	line += 4;
  826|  11.1k|	for (;;) {
  827|  11.1k|		next = line + strspn(line, " \t\r\n");
  828|  11.1k|		if (*next == '\0')
  ------------------
  |  Branch (828:7): [True: 2.25k, False: 8.90k]
  ------------------
  829|  2.25k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.25k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  830|  8.90k|		line = next;
  831|  8.90k|		next = line + strcspn(line, " \t\r\n");
  832|  8.90k|		eq = strchr(line, '=');
  833|  8.90k|		if (eq == NULL || eq > next)
  ------------------
  |  Branch (833:7): [True: 6.37k, False: 2.52k]
  |  Branch (833:21): [True: 896, False: 1.62k]
  ------------------
  834|  7.27k|			len = next - line;
  835|  1.62k|		else
  836|  1.62k|			len = eq - line;
  837|       |
  838|  8.90k|		remove_option(global, line, len);
  839|  8.90k|		r = add_option(a, global, line, next - line);
  840|  8.90k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  8.90k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (840:7): [True: 0, False: 8.90k]
  ------------------
  841|      0|			return (r);
  842|  8.90k|		line = next;
  843|  8.90k|	}
  844|  2.25k|}
archive_read_support_format_mtree.c:process_global_unset:
  849|  1.25k|{
  850|  1.25k|	const char *next;
  851|  1.25k|	size_t len;
  852|       |
  853|  1.25k|	line += 6;
  854|  1.25k|	if (strchr(line, '=') != NULL) {
  ------------------
  |  Branch (854:6): [True: 7, False: 1.25k]
  ------------------
  855|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      7|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  856|      7|		    "/unset shall not contain `='");
  857|      7|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  858|      7|	}
  859|       |
  860|  7.65k|	for (;;) {
  861|  7.65k|		next = line + strspn(line, " \t\r\n");
  862|  7.65k|		if (*next == '\0')
  ------------------
  |  Branch (862:7): [True: 1.25k, False: 6.40k]
  ------------------
  863|  1.25k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.25k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  864|  6.40k|		line = next;
  865|  6.40k|		len = strcspn(line, " \t\r\n");
  866|       |
  867|  6.40k|		if (len == 3 && strncmp(line, "all", 3) == 0) {
  ------------------
  |  Branch (867:7): [True: 1.50k, False: 4.90k]
  |  Branch (867:19): [True: 731, False: 770]
  ------------------
  868|    731|			free_options(*global);
  869|    731|			*global = NULL;
  870|  5.67k|		} else {
  871|  5.67k|			remove_option(global, line, len);
  872|  5.67k|		}
  873|       |
  874|  6.40k|		line += len;
  875|  6.40k|	}
  876|  1.25k|}
archive_read_support_format_mtree.c:parse_file:
 1131|  39.3k|{
 1132|  39.3k|	const char *path;
 1133|  39.3k|	la_seek_stat_t st_storage, *st;
 1134|  39.3k|	struct mtree_entry *mp;
 1135|  39.3k|	struct archive_entry *sparse_entry;
 1136|  39.3k|	int r = ARCHIVE_OK, r1, parsed_kws;
  ------------------
  |  |  233|  39.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1137|       |
 1138|  39.3k|	mentry->used = 1;
 1139|       |
 1140|       |	/* Initialize reasonable defaults. */
 1141|  39.3k|	archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  39.3k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1142|  39.3k|	archive_entry_set_size(entry, 0);
 1143|  39.3k|	archive_string_empty(&mtree->contents_name);
  ------------------
  |  |  181|  39.3k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1144|       |
 1145|       |	/* Parse options from this line. */
 1146|  39.3k|	parsed_kws = 0;
 1147|  39.3k|	r = parse_line(a, entry, mtree, mentry, &parsed_kws);
 1148|       |
 1149|  39.3k|	if (mentry->full) {
  ------------------
  |  Branch (1149:6): [True: 2.36k, False: 37.0k]
  ------------------
 1150|  2.36k|		archive_entry_copy_pathname(entry, mentry->name);
 1151|       |		/*
 1152|       |		 * "Full" entries are allowed to have multiple lines
 1153|       |		 * and those lines aren't required to be adjacent.  We
 1154|       |		 * don't support multiple lines for "relative" entries
 1155|       |		 * nor do we make any attempt to merge data from
 1156|       |		 * separate "relative" and "full" entries.  (Merging
 1157|       |		 * "relative" and "full" entries would require dealing
 1158|       |		 * with pathname canonicalization, which is a very
 1159|       |		 * tricky subject.)
 1160|       |		 */
 1161|  2.36k|		mp = (struct mtree_entry *)__archive_rb_tree_find_node(
 1162|  2.36k|		    &mtree->rbtree, mentry->name);
 1163|  8.53k|		for (; mp; mp = mp->next_dup) {
  ------------------
  |  Branch (1163:10): [True: 6.16k, False: 2.36k]
  ------------------
 1164|  6.16k|			if (mp->full && !mp->used) {
  ------------------
  |  Branch (1164:8): [True: 6.16k, False: 0]
  |  Branch (1164:20): [True: 3.80k, False: 2.36k]
  ------------------
 1165|       |				/* Later lines override earlier ones. */
 1166|  3.80k|				mp->used = 1;
 1167|  3.80k|				r1 = parse_line(a, entry, mtree, mp, &parsed_kws);
 1168|  3.80k|				if (r1 < r)
  ------------------
  |  Branch (1168:9): [True: 16, False: 3.78k]
  ------------------
 1169|     16|					r = r1;
 1170|  3.80k|			}
 1171|  6.16k|		}
 1172|  37.0k|	} else {
 1173|       |		/*
 1174|       |		 * Relative entries require us to construct
 1175|       |		 * the full path and possibly update the
 1176|       |		 * current directory.
 1177|       |		 */
 1178|  37.0k|		size_t n = archive_strlen(&mtree->current_dir);
  ------------------
  |  |  178|  37.0k|#define	archive_strlen(a) ((a)->length)
  ------------------
 1179|  37.0k|		if (n > 0)
  ------------------
  |  Branch (1179:7): [True: 2.13k, False: 34.8k]
  ------------------
 1180|  2.13k|			archive_strcat(&mtree->current_dir, "/");
 1181|  37.0k|		archive_strcat(&mtree->current_dir, mentry->name);
 1182|  37.0k|		archive_entry_copy_pathname(entry, mtree->current_dir.s);
 1183|  37.0k|		if (archive_entry_filetype(entry) != AE_IFDIR)
  ------------------
  |  |  221|  37.0k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1183:7): [True: 34.1k, False: 2.87k]
  ------------------
 1184|  34.1k|			mtree->current_dir.length = n;
 1185|  37.0k|	}
 1186|       |
 1187|  39.3k|	if (mtree->checkfs) {
  ------------------
  |  Branch (1187:6): [True: 0, False: 39.3k]
  ------------------
 1188|       |		/*
 1189|       |		 * Try to open and stat the file to get the real size
 1190|       |		 * and other file info.  It would be nice to avoid
 1191|       |		 * this here so that getting a listing of an mtree
 1192|       |		 * wouldn't require opening every referenced contents
 1193|       |		 * file.  But then we wouldn't know the actual
 1194|       |		 * contents size, so I don't see a really viable way
 1195|       |		 * around this.  (Also, we may want to someday pull
 1196|       |		 * other unspecified info from the contents file on
 1197|       |		 * disk.)
 1198|       |		 */
 1199|      0|		mtree->fd = -1;
 1200|      0|		if (archive_strlen(&mtree->contents_name) > 0)
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1200:7): [True: 0, False: 0]
  ------------------
 1201|      0|			path = mtree->contents_name.s;
 1202|      0|		else
 1203|      0|			path = archive_entry_pathname(entry);
 1204|       |
 1205|      0|		if (archive_entry_filetype(entry) == AE_IFREG ||
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (1205:7): [True: 0, False: 0]
  ------------------
 1206|      0|				archive_entry_filetype(entry) == AE_IFDIR) {
  ------------------
  |  |  221|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1206:5): [True: 0, False: 0]
  ------------------
 1207|      0|			mtree->fd = open(path, O_RDONLY | O_BINARY | O_CLOEXEC);
  ------------------
  |  |   63|      0|#define	O_BINARY 0
  ------------------
 1208|      0|			__archive_ensure_cloexec_flag(mtree->fd);
 1209|      0|			if (mtree->fd == -1 && (
  ------------------
  |  Branch (1209:8): [True: 0, False: 0]
  ------------------
 1210|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1211|       |        /*
 1212|       |         * On Windows, attempting to open a file with an
 1213|       |         * invalid name result in EINVAL (Error 22)
 1214|       |         */
 1215|       |				(errno != ENOENT && errno != EINVAL)
 1216|       |#else
 1217|      0|				errno != ENOENT
  ------------------
  |  Branch (1217:5): [True: 0, False: 0]
  ------------------
 1218|      0|#endif
 1219|      0|        || archive_strlen(&mtree->contents_name) > 0)) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1219:12): [True: 0, False: 0]
  ------------------
 1220|      0|				archive_set_error(&a->archive, errno,
 1221|      0|						"Can't open %s", path);
 1222|      0|				r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1223|      0|			}
 1224|      0|		}
 1225|       |
 1226|      0|		st = &st_storage;
 1227|      0|		if (mtree->fd >= 0) {
  ------------------
  |  Branch (1227:7): [True: 0, False: 0]
  ------------------
 1228|      0|			if (la_seek_fstat(mtree->fd, st) == -1) {
  ------------------
  |  |   41|      0|#define la_seek_fstat(fd, st)	fstat((fd), (st))
  ------------------
  |  Branch (1228:8): [True: 0, False: 0]
  ------------------
 1229|      0|				archive_set_error(&a->archive, errno,
 1230|      0|						"Could not fstat %s", path);
 1231|      0|				r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1232|       |				/* If we can't stat it, don't keep it open. */
 1233|      0|				close(mtree->fd);
 1234|      0|				mtree->fd = -1;
 1235|      0|				st = NULL;
 1236|      0|			}
 1237|      0|		}
 1238|      0|#ifdef HAVE_LSTAT
 1239|      0|		else if (lstat(path, st) == -1)
  ------------------
  |  Branch (1239:12): [True: 0, False: 0]
  ------------------
 1240|       |#else
 1241|       |		else if (la_seek_stat(path, st) == -1)
 1242|       |#endif
 1243|      0|		{
 1244|      0|			st = NULL;
 1245|      0|		}
 1246|       |
 1247|       |		/*
 1248|       |		 * Check for a mismatch between the type in the specification
 1249|       |		 * and the type of the contents object on disk.
 1250|       |		 */
 1251|      0|		if (st != NULL) {
  ------------------
  |  Branch (1251:7): [True: 0, False: 0]
  ------------------
 1252|      0|			if (((st->st_mode & S_IFMT) == S_IFREG &&
  ------------------
  |  Branch (1252:9): [True: 0, False: 0]
  ------------------
 1253|      0|			      archive_entry_filetype(entry) == AE_IFREG)
  ------------------
  |  |  216|      0|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (1253:10): [True: 0, False: 0]
  ------------------
 1254|      0|#ifdef S_IFLNK
 1255|      0|			  ||((st->st_mode & S_IFMT) == S_IFLNK &&
  ------------------
  |  Branch (1255:9): [True: 0, False: 0]
  ------------------
 1256|      0|			      archive_entry_filetype(entry) == AE_IFLNK)
  ------------------
  |  |  217|      0|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (1256:10): [True: 0, False: 0]
  ------------------
 1257|      0|#endif
 1258|      0|#ifdef S_IFSOCK
 1259|      0|			  ||((st->st_mode & S_IFSOCK) == S_IFSOCK &&
  ------------------
  |  Branch (1259:9): [True: 0, False: 0]
  ------------------
 1260|      0|			      archive_entry_filetype(entry) == AE_IFSOCK)
  ------------------
  |  |  218|      0|#define AE_IFSOCK	((__LA_MODE_T)0140000)
  ------------------
  |  Branch (1260:10): [True: 0, False: 0]
  ------------------
 1261|      0|#endif
 1262|      0|#ifdef S_IFCHR
 1263|      0|			  ||((st->st_mode & S_IFMT) == S_IFCHR &&
  ------------------
  |  Branch (1263:9): [True: 0, False: 0]
  ------------------
 1264|      0|			      archive_entry_filetype(entry) == AE_IFCHR)
  ------------------
  |  |  219|      0|#define AE_IFCHR	((__LA_MODE_T)0020000)
  ------------------
  |  Branch (1264:10): [True: 0, False: 0]
  ------------------
 1265|      0|#endif
 1266|      0|#ifdef S_IFBLK
 1267|      0|			  ||((st->st_mode & S_IFMT) == S_IFBLK &&
  ------------------
  |  Branch (1267:9): [True: 0, False: 0]
  ------------------
 1268|      0|			      archive_entry_filetype(entry) == AE_IFBLK)
  ------------------
  |  |  220|      0|#define AE_IFBLK	((__LA_MODE_T)0060000)
  ------------------
  |  Branch (1268:10): [True: 0, False: 0]
  ------------------
 1269|      0|#endif
 1270|      0|			  ||((st->st_mode & S_IFMT) == S_IFDIR &&
  ------------------
  |  Branch (1270:9): [True: 0, False: 0]
  ------------------
 1271|      0|			      archive_entry_filetype(entry) == AE_IFDIR)
  ------------------
  |  |  221|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1271:10): [True: 0, False: 0]
  ------------------
 1272|      0|#ifdef S_IFIFO
 1273|      0|			  ||((st->st_mode & S_IFMT) == S_IFIFO &&
  ------------------
  |  Branch (1273:9): [True: 0, False: 0]
  ------------------
 1274|      0|			      archive_entry_filetype(entry) == AE_IFIFO)
  ------------------
  |  |  222|      0|#define AE_IFIFO	((__LA_MODE_T)0010000)
  ------------------
  |  Branch (1274:10): [True: 0, False: 0]
  ------------------
 1275|      0|#endif
 1276|      0|			) {
 1277|       |				/* Types match. */
 1278|      0|			} else {
 1279|       |				/* Types don't match; bail out gracefully. */
 1280|      0|				if (mtree->fd >= 0)
  ------------------
  |  Branch (1280:9): [True: 0, False: 0]
  ------------------
 1281|      0|					close(mtree->fd);
 1282|      0|				mtree->fd = -1;
 1283|      0|				if (parsed_kws & MTREE_HAS_OPTIONAL) {
  ------------------
  |  |   81|      0|#define	MTREE_HAS_OPTIONAL	0x0800
  ------------------
  |  Branch (1283:9): [True: 0, False: 0]
  ------------------
 1284|       |					/* It's not an error for an optional
 1285|       |					 * entry to not match disk. */
 1286|      0|					*use_next = 1;
 1287|      0|				} else if (r == ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1287:16): [True: 0, False: 0]
  ------------------
 1288|      0|					archive_set_error(&a->archive,
 1289|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1290|      0|					    "mtree specification has different"
 1291|      0|					    " type for %s",
 1292|      0|					    archive_entry_pathname(entry));
 1293|      0|					r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1294|      0|				}
 1295|      0|				return (r);
 1296|      0|			}
 1297|      0|		}
 1298|       |
 1299|       |		/*
 1300|       |		 * If there is a contents file on disk, pick some of the
 1301|       |		 * metadata from that file.  For most of these, we only
 1302|       |		 * set it from the contents if it wasn't already parsed
 1303|       |		 * from the specification.
 1304|       |		 */
 1305|      0|		if (st != NULL) {
  ------------------
  |  Branch (1305:7): [True: 0, False: 0]
  ------------------
 1306|      0|			if (((parsed_kws & MTREE_HAS_DEVICE) == 0 ||
  ------------------
  |  |   69|      0|#define	MTREE_HAS_DEVICE	0x0001
  ------------------
  |  Branch (1306:9): [True: 0, False: 0]
  ------------------
 1307|      0|				(parsed_kws & MTREE_HAS_NOCHANGE) != 0) &&
  ------------------
  |  |   82|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1307:5): [True: 0, False: 0]
  ------------------
 1308|      0|				(archive_entry_filetype(entry) == AE_IFCHR ||
  ------------------
  |  |  219|      0|#define AE_IFCHR	((__LA_MODE_T)0020000)
  ------------------
  |  Branch (1308:6): [True: 0, False: 0]
  ------------------
 1309|      0|				 archive_entry_filetype(entry) == AE_IFBLK))
  ------------------
  |  |  220|      0|#define AE_IFBLK	((__LA_MODE_T)0060000)
  ------------------
  |  Branch (1309:6): [True: 0, False: 0]
  ------------------
 1310|      0|				archive_entry_set_rdev(entry, st->st_rdev);
 1311|      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 (1311:8): [True: 0, False: 0]
  ------------------
 1312|      0|				== 0 ||
 1313|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0)
  ------------------
  |  |   82|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1313:8): [True: 0, False: 0]
  ------------------
 1314|      0|				archive_entry_set_gid(entry, st->st_gid);
 1315|      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 (1315:8): [True: 0, False: 0]
  ------------------
 1316|      0|				== 0 ||
 1317|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0)
  ------------------
  |  |   82|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1317:8): [True: 0, False: 0]
  ------------------
 1318|      0|				archive_entry_set_uid(entry, st->st_uid);
 1319|      0|			if ((parsed_kws & MTREE_HAS_MTIME) == 0 ||
  ------------------
  |  |   73|      0|#define	MTREE_HAS_MTIME		0x0010
  ------------------
  |  Branch (1319:8): [True: 0, False: 0]
  ------------------
 1320|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0) {
  ------------------
  |  |   82|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1320:8): [True: 0, False: 0]
  ------------------
 1321|       |#if HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
 1322|       |				archive_entry_set_mtime(entry, st->st_mtime,
 1323|       |						st->st_mtimespec.tv_nsec);
 1324|       |#elif HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
 1325|      0|				archive_entry_set_mtime(entry, st->st_mtime,
 1326|      0|						st->st_mtim.tv_nsec);
 1327|       |#elif HAVE_STRUCT_STAT_ST_MTIME_N
 1328|       |				archive_entry_set_mtime(entry, st->st_mtime,
 1329|       |						st->st_mtime_n);
 1330|       |#elif HAVE_STRUCT_STAT_ST_UMTIME
 1331|       |				archive_entry_set_mtime(entry, st->st_mtime,
 1332|       |						st->st_umtime*1000);
 1333|       |#elif HAVE_STRUCT_STAT_ST_MTIME_USEC
 1334|       |				archive_entry_set_mtime(entry, st->st_mtime,
 1335|       |						st->st_mtime_usec*1000);
 1336|       |#else
 1337|       |				archive_entry_set_mtime(entry, st->st_mtime, 0);
 1338|       |#endif
 1339|      0|			}
 1340|      0|			if ((parsed_kws & MTREE_HAS_NLINK) == 0 ||
  ------------------
  |  |   74|      0|#define	MTREE_HAS_NLINK		0x0020
  ------------------
  |  Branch (1340:8): [True: 0, False: 0]
  ------------------
 1341|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0)
  ------------------
  |  |   82|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1341:8): [True: 0, False: 0]
  ------------------
 1342|      0|				archive_entry_set_nlink(entry, st->st_nlink);
 1343|      0|			if ((parsed_kws & MTREE_HAS_PERM) == 0 ||
  ------------------
  |  |   75|      0|#define	MTREE_HAS_PERM		0x0040
  ------------------
  |  Branch (1343:8): [True: 0, False: 0]
  ------------------
 1344|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0)
  ------------------
  |  |   82|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1344:8): [True: 0, False: 0]
  ------------------
 1345|      0|				archive_entry_set_perm(entry, st->st_mode);
 1346|      0|			if ((parsed_kws & MTREE_HAS_SIZE) == 0 ||
  ------------------
  |  |   76|      0|#define	MTREE_HAS_SIZE		0x0080
  ------------------
  |  Branch (1346:8): [True: 0, False: 0]
  ------------------
 1347|      0|			    (parsed_kws & MTREE_HAS_NOCHANGE) != 0)
  ------------------
  |  |   82|      0|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
  |  Branch (1347:8): [True: 0, False: 0]
  ------------------
 1348|      0|				archive_entry_set_size(entry, st->st_size);
 1349|      0|			archive_entry_set_ino(entry, st->st_ino);
 1350|      0|			archive_entry_set_dev(entry, st->st_dev);
 1351|       |
 1352|      0|			archive_entry_linkify(mtree->resolver, &entry,
 1353|      0|				&sparse_entry);
 1354|      0|		} else if (parsed_kws & MTREE_HAS_OPTIONAL) {
  ------------------
  |  |   81|      0|#define	MTREE_HAS_OPTIONAL	0x0800
  ------------------
  |  Branch (1354:14): [True: 0, False: 0]
  ------------------
 1355|       |			/*
 1356|       |			 * Couldn't open the entry, stat it or the on-disk type
 1357|       |			 * didn't match.  If this entry is optional, just
 1358|       |			 * ignore it and read the next header entry.
 1359|       |			 */
 1360|      0|			*use_next = 1;
 1361|      0|			return ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1362|      0|		}
 1363|      0|	}
 1364|       |
 1365|  39.3k|	mtree->cur_size = archive_entry_size(entry);
 1366|  39.3k|	mtree->offset = 0;
 1367|       |
 1368|  39.3k|	return r;
 1369|  39.3k|}
archive_read_support_format_mtree.c:parse_line:
 1377|  43.1k|{
 1378|  43.1k|	struct mtree_option *iter;
 1379|  43.1k|	int r = ARCHIVE_OK, r1;
  ------------------
  |  |  233|  43.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1380|       |
 1381|   120k|	for (iter = mp->options; iter != NULL; iter = iter->next) {
  ------------------
  |  Branch (1381:27): [True: 76.9k, False: 43.1k]
  ------------------
 1382|  76.9k|		r1 = parse_keyword(a, mtree, entry, iter, parsed_kws);
 1383|  76.9k|		if (r1 < r)
  ------------------
  |  Branch (1383:7): [True: 25.9k, False: 50.9k]
  ------------------
 1384|  25.9k|			r = r1;
 1385|  76.9k|	}
 1386|  43.1k|	if (r == ARCHIVE_OK && (*parsed_kws & MTREE_HAS_TYPE) == 0) {
  ------------------
  |  |  233|  86.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	if (r == ARCHIVE_OK && (*parsed_kws & MTREE_HAS_TYPE) == 0) {
  ------------------
  |  |   77|  17.1k|#define	MTREE_HAS_TYPE		0x0100
  ------------------
  |  Branch (1386:6): [True: 17.1k, False: 25.9k]
  |  Branch (1386:25): [True: 15.0k, False: 2.12k]
  ------------------
 1387|  15.0k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  15.0k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1388|  15.0k|		    "Missing type keyword in mtree specification");
 1389|  15.0k|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|  15.0k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1390|  15.0k|	}
 1391|  28.1k|	return (r);
 1392|  43.1k|}
archive_read_support_format_mtree.c:parse_keyword:
 1558|  76.9k|{
 1559|  76.9k|	char *val, *key;
 1560|       |
 1561|  76.9k|	key = opt->value;
 1562|       |
 1563|  76.9k|	if (*key == '\0')
  ------------------
  |  Branch (1563:6): [True: 0, False: 76.9k]
  ------------------
 1564|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1565|       |
 1566|  76.9k|	if (strcmp(key, "nochange") == 0) {
  ------------------
  |  Branch (1566:6): [True: 288, False: 76.7k]
  ------------------
 1567|    288|		*parsed_kws |= MTREE_HAS_NOCHANGE;
  ------------------
  |  |   82|    288|#define	MTREE_HAS_NOCHANGE	0x1000 /* FreeBSD specific */
  ------------------
 1568|    288|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    288|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1569|    288|	}
 1570|  76.7k|	if (strcmp(key, "optional") == 0) {
  ------------------
  |  Branch (1570:6): [True: 412, False: 76.2k]
  ------------------
 1571|    412|		*parsed_kws |= MTREE_HAS_OPTIONAL;
  ------------------
  |  |   81|    412|#define	MTREE_HAS_OPTIONAL	0x0800
  ------------------
 1572|    412|		return (ARCHIVE_OK);
  ------------------
  |  |  233|    412|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1573|    412|	}
 1574|  76.2k|	if (strcmp(key, "ignore") == 0) {
  ------------------
  |  Branch (1574:6): [True: 90, False: 76.2k]
  ------------------
 1575|       |		/*
 1576|       |		 * The mtree processing is not recursive, so
 1577|       |		 * recursion will only happen for explicitly listed
 1578|       |		 * entries.
 1579|       |		 */
 1580|     90|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     90|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1581|     90|	}
 1582|       |
 1583|  76.2k|	val = strchr(key, '=');
 1584|  76.2k|	if (val == NULL) {
  ------------------
  |  Branch (1584:6): [True: 33.5k, False: 42.6k]
  ------------------
 1585|  33.5k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  33.5k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1586|  33.5k|		    "Malformed attribute \"%s\" (%d)", key, key[0]);
 1587|  33.5k|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|  33.5k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1588|  33.5k|	}
 1589|       |
 1590|  42.6k|	*val = '\0';
 1591|  42.6k|	++val;
 1592|       |
 1593|  42.6k|	switch (key[0]) {
 1594|  1.25k|	case 'c':
  ------------------
  |  Branch (1594:2): [True: 1.25k, False: 41.3k]
  ------------------
 1595|  1.25k|		if (strcmp(key, "content") == 0
  ------------------
  |  Branch (1595:7): [True: 419, False: 835]
  ------------------
 1596|    835|		    || strcmp(key, "contents") == 0) {
  ------------------
  |  Branch (1596:10): [True: 247, False: 588]
  ------------------
 1597|    666|			parse_escapes(val, NULL);
 1598|    666|			archive_strcpy(&mtree->contents_name, val);
  ------------------
  |  |  165|    666|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|  1.33k|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 666]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1599|    666|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    666|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1600|    666|		}
 1601|    588|		if (strcmp(key, "cksum") == 0)
  ------------------
  |  Branch (1601:7): [True: 256, False: 332]
  ------------------
 1602|    256|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    256|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1603|    332|		break;
 1604|  8.05k|	case 'd':
  ------------------
  |  Branch (1604:2): [True: 8.05k, False: 34.5k]
  ------------------
 1605|  8.05k|		if (strcmp(key, "device") == 0) {
  ------------------
  |  Branch (1605:7): [True: 6.94k, False: 1.10k]
  ------------------
 1606|       |			/* stat(2) st_rdev field, e.g. the major/minor IDs
 1607|       |			 * of a char/block special file */
 1608|  6.94k|			int r;
 1609|  6.94k|			dev_t dev;
 1610|       |
 1611|  6.94k|			*parsed_kws |= MTREE_HAS_DEVICE;
  ------------------
  |  |   69|  6.94k|#define	MTREE_HAS_DEVICE	0x0001
  ------------------
 1612|  6.94k|			r = parse_device(&dev, &a->archive, val);
 1613|  6.94k|			if (r == ARCHIVE_OK)
  ------------------
  |  |  233|  6.94k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1613:8): [True: 1.65k, False: 5.29k]
  ------------------
 1614|  1.65k|				archive_entry_set_rdev(entry, dev);
 1615|  6.94k|			return r;
 1616|  6.94k|		}
 1617|  1.10k|		break;
 1618|  2.05k|	case 'f':
  ------------------
  |  Branch (1618:2): [True: 2.05k, False: 40.5k]
  ------------------
 1619|  2.05k|		if (strcmp(key, "flags") == 0) {
  ------------------
  |  Branch (1619:7): [True: 1.17k, False: 875]
  ------------------
 1620|  1.17k|			*parsed_kws |= MTREE_HAS_FFLAGS;
  ------------------
  |  |   70|  1.17k|#define	MTREE_HAS_FFLAGS	0x0002
  ------------------
 1621|  1.17k|			archive_entry_copy_fflags_text(entry, val);
 1622|  1.17k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.17k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1623|  1.17k|		}
 1624|    875|		break;
 1625|  2.48k|	case 'g':
  ------------------
  |  Branch (1625:2): [True: 2.48k, False: 40.1k]
  ------------------
 1626|  2.48k|		if (strcmp(key, "gid") == 0) {
  ------------------
  |  Branch (1626:7): [True: 542, False: 1.94k]
  ------------------
 1627|    542|			*parsed_kws |= MTREE_HAS_GID;
  ------------------
  |  |   71|    542|#define	MTREE_HAS_GID		0x0004
  ------------------
 1628|    542|			archive_entry_set_gid(entry, mtree_atol(&val, 10));
 1629|    542|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    542|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1630|    542|		}
 1631|  1.94k|		if (strcmp(key, "gname") == 0) {
  ------------------
  |  Branch (1631:7): [True: 216, False: 1.72k]
  ------------------
 1632|    216|			*parsed_kws |= MTREE_HAS_GNAME;
  ------------------
  |  |   72|    216|#define	MTREE_HAS_GNAME		0x0008
  ------------------
 1633|    216|			archive_entry_copy_gname(entry, val);
 1634|    216|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    216|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1635|    216|		}
 1636|  1.72k|		break;
 1637|  2.57k|	case 'i':
  ------------------
  |  Branch (1637:2): [True: 2.57k, False: 40.0k]
  ------------------
 1638|  2.57k|		if (strcmp(key, "inode") == 0) {
  ------------------
  |  Branch (1638:7): [True: 760, False: 1.81k]
  ------------------
 1639|    760|			archive_entry_set_ino(entry, mtree_atol(&val, 10));
 1640|    760|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    760|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1641|    760|		}
 1642|  1.81k|		break;
 1643|  1.81k|	case 'l':
  ------------------
  |  Branch (1643:2): [True: 1.41k, False: 41.2k]
  ------------------
 1644|  1.41k|		if (strcmp(key, "link") == 0) {
  ------------------
  |  Branch (1644:7): [True: 1.04k, False: 378]
  ------------------
 1645|  1.04k|			parse_escapes(val, NULL);
 1646|  1.04k|			archive_entry_copy_symlink(entry, val);
 1647|  1.04k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.04k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1648|  1.04k|		}
 1649|    378|		break;
 1650|  2.60k|	case 'm':
  ------------------
  |  Branch (1650:2): [True: 2.60k, False: 40.0k]
  ------------------
 1651|  2.60k|		if (strcmp(key, "md5") == 0 || strcmp(key, "md5digest") == 0) {
  ------------------
  |  Branch (1651:7): [True: 1.29k, False: 1.31k]
  |  Branch (1651:34): [True: 273, False: 1.03k]
  ------------------
 1652|  1.56k|			return parse_digest(a, entry, val,
 1653|  1.56k|			    ARCHIVE_ENTRY_DIGEST_MD5);
  ------------------
  |  |  444|  1.56k|#define ARCHIVE_ENTRY_DIGEST_MD5              0x00000001
  ------------------
 1654|  1.56k|		}
 1655|  1.03k|		if (strcmp(key, "mode") == 0) {
  ------------------
  |  Branch (1655:7): [True: 477, False: 562]
  ------------------
 1656|    477|			if (val[0] < '0' || val[0] > '7') {
  ------------------
  |  Branch (1656:8): [True: 197, False: 280]
  |  Branch (1656:24): [True: 56, False: 224]
  ------------------
 1657|    253|				archive_set_error(&a->archive,
 1658|    253|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    253|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1659|    253|				    "Symbolic or non-octal mode \"%s\" unsupported", val);
 1660|    253|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|    253|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1661|    253|			}
 1662|    224|			*parsed_kws |= MTREE_HAS_PERM;
  ------------------
  |  |   75|    224|#define	MTREE_HAS_PERM		0x0040
  ------------------
 1663|    224|			archive_entry_set_perm(entry, (mode_t)mtree_atol(&val, 8));
 1664|    224|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    224|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1665|    477|		}
 1666|    562|		break;
 1667|    618|	case 'n':
  ------------------
  |  Branch (1667:2): [True: 618, False: 42.0k]
  ------------------
 1668|    618|		if (strcmp(key, "nlink") == 0) {
  ------------------
  |  Branch (1668:7): [True: 483, False: 135]
  ------------------
 1669|    483|			*parsed_kws |= MTREE_HAS_NLINK;
  ------------------
  |  |   74|    483|#define	MTREE_HAS_NLINK		0x0020
  ------------------
 1670|    483|			archive_entry_set_nlink(entry,
 1671|    483|				(unsigned int)mtree_atol(&val, 10));
 1672|    483|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    483|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1673|    483|		}
 1674|    135|		break;
 1675|  6.57k|	case 'r':
  ------------------
  |  Branch (1675:2): [True: 6.57k, False: 36.0k]
  ------------------
 1676|  6.57k|		if (strcmp(key, "resdevice") == 0) {
  ------------------
  |  Branch (1676:7): [True: 5.22k, False: 1.34k]
  ------------------
 1677|       |			/* stat(2) st_dev field, e.g. the device ID where the
 1678|       |			 * inode resides */
 1679|  5.22k|			int r;
 1680|  5.22k|			dev_t dev;
 1681|       |
 1682|  5.22k|			r = parse_device(&dev, &a->archive, val);
 1683|  5.22k|			if (r == ARCHIVE_OK)
  ------------------
  |  |  233|  5.22k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1683:8): [True: 934, False: 4.29k]
  ------------------
 1684|    934|				archive_entry_set_dev(entry, dev);
 1685|  5.22k|			return r;
 1686|  5.22k|		}
 1687|  1.34k|		if (strcmp(key, "rmd160") == 0 ||
  ------------------
  |  Branch (1687:7): [True: 317, False: 1.03k]
  ------------------
 1688|  1.03k|		    strcmp(key, "rmd160digest") == 0) {
  ------------------
  |  Branch (1688:7): [True: 318, False: 713]
  ------------------
 1689|    635|			return parse_digest(a, entry, val,
 1690|    635|			    ARCHIVE_ENTRY_DIGEST_RMD160);
  ------------------
  |  |  445|    635|#define ARCHIVE_ENTRY_DIGEST_RMD160           0x00000002
  ------------------
 1691|    635|		}
 1692|    713|		break;
 1693|  4.88k|	case 's':
  ------------------
  |  Branch (1693:2): [True: 4.88k, False: 37.7k]
  ------------------
 1694|  4.88k|		if (strcmp(key, "sha1") == 0 ||
  ------------------
  |  Branch (1694:7): [True: 1.20k, False: 3.68k]
  ------------------
 1695|  3.68k|		    strcmp(key, "sha1digest") == 0) {
  ------------------
  |  Branch (1695:7): [True: 274, False: 3.40k]
  ------------------
 1696|  1.47k|			return parse_digest(a, entry, val,
 1697|  1.47k|			    ARCHIVE_ENTRY_DIGEST_SHA1);
  ------------------
  |  |  446|  1.47k|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
 1698|  1.47k|		}
 1699|  3.40k|		if (strcmp(key, "sha256") == 0 ||
  ------------------
  |  Branch (1699:7): [True: 265, False: 3.14k]
  ------------------
 1700|  3.14k|		    strcmp(key, "sha256digest") == 0) {
  ------------------
  |  Branch (1700:7): [True: 281, False: 2.86k]
  ------------------
 1701|    546|			return parse_digest(a, entry, val,
 1702|    546|			    ARCHIVE_ENTRY_DIGEST_SHA256);
  ------------------
  |  |  447|    546|#define ARCHIVE_ENTRY_DIGEST_SHA256           0x00000004
  ------------------
 1703|    546|		}
 1704|  2.86k|		if (strcmp(key, "sha384") == 0 ||
  ------------------
  |  Branch (1704:7): [True: 52, False: 2.80k]
  ------------------
 1705|  2.80k|		    strcmp(key, "sha384digest") == 0) {
  ------------------
  |  Branch (1705:7): [True: 220, False: 2.58k]
  ------------------
 1706|    272|			return parse_digest(a, entry, val,
 1707|    272|			    ARCHIVE_ENTRY_DIGEST_SHA384);
  ------------------
  |  |  448|    272|#define ARCHIVE_ENTRY_DIGEST_SHA384           0x00000005
  ------------------
 1708|    272|		}
 1709|  2.58k|		if (strcmp(key, "sha512") == 0 ||
  ------------------
  |  Branch (1709:7): [True: 612, False: 1.97k]
  ------------------
 1710|  1.97k|		    strcmp(key, "sha512digest") == 0) {
  ------------------
  |  Branch (1710:7): [True: 388, False: 1.58k]
  ------------------
 1711|  1.00k|			return parse_digest(a, entry, val,
 1712|  1.00k|			    ARCHIVE_ENTRY_DIGEST_SHA512);
  ------------------
  |  |  449|  1.00k|#define ARCHIVE_ENTRY_DIGEST_SHA512           0x00000006
  ------------------
 1713|  1.00k|		}
 1714|  1.58k|		if (strcmp(key, "size") == 0) {
  ------------------
  |  Branch (1714:7): [True: 271, False: 1.31k]
  ------------------
 1715|    271|			archive_entry_set_size(entry, mtree_atol(&val, 10));
 1716|    271|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    271|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1717|    271|		}
 1718|  1.31k|		break;
 1719|  7.86k|	case 't':
  ------------------
  |  Branch (1719:2): [True: 7.86k, False: 34.7k]
  ------------------
 1720|  7.86k|		if (strcmp(key, "tags") == 0) {
  ------------------
  |  Branch (1720:7): [True: 229, False: 7.64k]
  ------------------
 1721|       |			/*
 1722|       |			 * Comma delimited list of tags.
 1723|       |			 * Ignore the tags for now, but the interface
 1724|       |			 * should be extended to allow inclusion/exclusion.
 1725|       |			 */
 1726|    229|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    229|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1727|    229|		}
 1728|  7.64k|		if (strcmp(key, "time") == 0) {
  ------------------
  |  Branch (1728:7): [True: 710, False: 6.93k]
  ------------------
 1729|    710|			int64_t m;
 1730|    710|			long ns = 0;
 1731|       |
 1732|    710|			*parsed_kws |= MTREE_HAS_MTIME;
  ------------------
  |  |   73|    710|#define	MTREE_HAS_MTIME		0x0010
  ------------------
 1733|    710|			m = mtree_atol(&val, 10);
 1734|       |			/* Replicate an old mtree bug:
 1735|       |			 * 123456789.1 represents 123456789
 1736|       |			 * seconds and 1 nanosecond. */
 1737|    710|			if (*val == '.') {
  ------------------
  |  Branch (1737:8): [True: 501, False: 209]
  ------------------
 1738|    501|				int64_t v;
 1739|       |
 1740|    501|				++val;
 1741|    501|				v = mtree_atol(&val, 10);
 1742|    501|				if (v < 0)
  ------------------
  |  Branch (1742:9): [True: 193, False: 308]
  ------------------
 1743|    193|					ns = 0;
 1744|    308|				else if (v > 999999999)
  ------------------
  |  Branch (1744:14): [True: 106, False: 202]
  ------------------
 1745|    106|					ns = 999999999;
 1746|    202|				else
 1747|    202|					ns = (long)v;
 1748|    501|			}
 1749|    710|			if (m > TIME_MAX)
  ------------------
  |  |  251|    710|#define TIME_MAX (((time_t)0 < (time_t)-1) ? (time_t)~0 :		\
  |  |  ------------------
  |  |  |  Branch (251:19): [Folded, False: 710]
  |  |  ------------------
  |  |  252|    710|	    sizeof(time_t) == sizeof(long long) ? (time_t)LLONG_MAX :	\
  |  |  ------------------
  |  |  |  Branch (252:6): [True: 710, Folded]
  |  |  ------------------
  |  |  253|    710|	    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 (1749:8): [True: 0, False: 710]
  ------------------
 1750|      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 */)
  ------------------
 1751|    710|			else if (m < TIME_MIN)
  ------------------
  |  |  259|    710|#define TIME_MIN (((time_t)0 < (time_t)-1) ? (time_t)0 :		\
  |  |  ------------------
  |  |  |  Branch (259:19): [Folded, False: 710]
  |  |  ------------------
  |  |  260|    710|	    sizeof(time_t) == sizeof(long long) ? (time_t)LLONG_MIN :	\
  |  |  ------------------
  |  |  |  Branch (260:6): [True: 710, Folded]
  |  |  ------------------
  |  |  261|    710|	    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 (1751:13): [True: 0, False: 710]
  ------------------
 1752|      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 */)
  ------------------
 1753|    710|			archive_entry_set_mtime(entry, (time_t)m, ns);
 1754|    710|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    710|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1755|    710|		}
 1756|  6.93k|		if (strcmp(key, "type") == 0) {
  ------------------
  |  Branch (1756:7): [True: 6.24k, False: 681]
  ------------------
 1757|  6.24k|			switch (val[0]) {
 1758|    265|			case 'b':
  ------------------
  |  Branch (1758:4): [True: 265, False: 5.98k]
  ------------------
 1759|    265|				if (strcmp(val, "block") == 0) {
  ------------------
  |  Branch (1759:9): [True: 0, False: 265]
  ------------------
 1760|      0|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   77|      0|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1761|      0|					archive_entry_set_filetype(entry,
 1762|      0|						AE_IFBLK);
  ------------------
  |  |  220|      0|#define AE_IFBLK	((__LA_MODE_T)0060000)
  ------------------
 1763|      0|					return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1764|      0|				}
 1765|    265|				break;
 1766|    492|			case 'c':
  ------------------
  |  Branch (1766:4): [True: 492, False: 5.75k]
  ------------------
 1767|    492|				if (strcmp(val, "char") == 0) {
  ------------------
  |  Branch (1767:9): [True: 250, False: 242]
  ------------------
 1768|    250|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   77|    250|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1769|    250|					archive_entry_set_filetype(entry,
 1770|    250|						AE_IFCHR);
  ------------------
  |  |  219|    250|#define AE_IFCHR	((__LA_MODE_T)0020000)
  ------------------
 1771|    250|					return (ARCHIVE_OK);
  ------------------
  |  |  233|    250|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1772|    250|				}
 1773|    242|				break;
 1774|  3.42k|			case 'd':
  ------------------
  |  Branch (1774:4): [True: 3.42k, False: 2.82k]
  ------------------
 1775|  3.42k|				if (strcmp(val, "dir") == 0) {
  ------------------
  |  Branch (1775:9): [True: 3.03k, False: 391]
  ------------------
 1776|  3.03k|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   77|  3.03k|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1777|  3.03k|					archive_entry_set_filetype(entry,
 1778|  3.03k|						AE_IFDIR);
  ------------------
  |  |  221|  3.03k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1779|  3.03k|					return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.03k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1780|  3.03k|				}
 1781|    391|				break;
 1782|  1.13k|			case 'f':
  ------------------
  |  Branch (1782:4): [True: 1.13k, False: 5.11k]
  ------------------
 1783|  1.13k|				if (strcmp(val, "fifo") == 0) {
  ------------------
  |  Branch (1783:9): [True: 536, False: 602]
  ------------------
 1784|    536|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   77|    536|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1785|    536|					archive_entry_set_filetype(entry,
 1786|    536|						AE_IFIFO);
  ------------------
  |  |  222|    536|#define AE_IFIFO	((__LA_MODE_T)0010000)
  ------------------
 1787|    536|					return (ARCHIVE_OK);
  ------------------
  |  |  233|    536|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1788|    536|				}
 1789|    602|				if (strcmp(val, "file") == 0) {
  ------------------
  |  Branch (1789:9): [True: 86, False: 516]
  ------------------
 1790|     86|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   77|     86|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1791|     86|					archive_entry_set_filetype(entry,
 1792|     86|						AE_IFREG);
  ------------------
  |  |  216|     86|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1793|     86|					return (ARCHIVE_OK);
  ------------------
  |  |  233|     86|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1794|     86|				}
 1795|    516|				break;
 1796|    516|			case 'l':
  ------------------
  |  Branch (1796:4): [True: 474, False: 5.77k]
  ------------------
 1797|    474|				if (strcmp(val, "link") == 0) {
  ------------------
  |  Branch (1797:9): [True: 234, False: 240]
  ------------------
 1798|    234|					*parsed_kws |= MTREE_HAS_TYPE;
  ------------------
  |  |   77|    234|#define	MTREE_HAS_TYPE		0x0100
  ------------------
 1799|    234|					archive_entry_set_filetype(entry,
 1800|    234|						AE_IFLNK);
  ------------------
  |  |  217|    234|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
 1801|    234|					return (ARCHIVE_OK);
  ------------------
  |  |  233|    234|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1802|    234|				}
 1803|    240|				break;
 1804|    455|			default:
  ------------------
  |  Branch (1804:4): [True: 455, False: 5.79k]
  ------------------
 1805|    455|				break;
 1806|  6.24k|			}
 1807|  2.10k|			archive_set_error(&a->archive,
 1808|  2.10k|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  2.10k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1809|  2.10k|			    "Unrecognized file type \"%s\"; "
 1810|  2.10k|			    "assuming \"file\"", val);
 1811|  2.10k|			archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  2.10k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1812|  2.10k|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|  2.10k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1813|  6.24k|		}
 1814|    681|		break;
 1815|  1.32k|	case 'u':
  ------------------
  |  Branch (1815:2): [True: 1.32k, False: 41.3k]
  ------------------
 1816|  1.32k|		if (strcmp(key, "uid") == 0) {
  ------------------
  |  Branch (1816:7): [True: 622, False: 698]
  ------------------
 1817|    622|			*parsed_kws |= MTREE_HAS_UID;
  ------------------
  |  |   78|    622|#define	MTREE_HAS_UID		0x0200
  ------------------
 1818|    622|			archive_entry_set_uid(entry, mtree_atol(&val, 10));
 1819|    622|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    622|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1820|    622|		}
 1821|    698|		if (strcmp(key, "uname") == 0) {
  ------------------
  |  Branch (1821:7): [True: 267, False: 431]
  ------------------
 1822|    267|			*parsed_kws |= MTREE_HAS_UNAME;
  ------------------
  |  |   79|    267|#define	MTREE_HAS_UNAME		0x0400
  ------------------
 1823|    267|			archive_entry_copy_uname(entry, val);
 1824|    267|			return (ARCHIVE_OK);
  ------------------
  |  |  233|    267|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1825|    267|		}
 1826|    431|		break;
 1827|    924|	default:
  ------------------
  |  Branch (1827:2): [True: 924, False: 41.7k]
  ------------------
 1828|    924|		break;
 1829|  42.6k|	}
 1830|  10.9k|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  10.9k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1831|  10.9k|	    "Unrecognized key %s=%s", key, val);
 1832|  10.9k|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|  10.9k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1833|  42.6k|}
archive_read_support_format_mtree.c:parse_device:
 1419|  12.1k|{
 1420|  12.1k|#define MAX_PACK_ARGS 3
 1421|  12.1k|	unsigned long numbers[MAX_PACK_ARGS];
 1422|  12.1k|	char *p, *dev;
 1423|  12.1k|	int argc;
 1424|  12.1k|	pack_t *pack;
 1425|  12.1k|	dev_t result;
 1426|  12.1k|	const char *error = NULL;
 1427|       |
 1428|  12.1k|	memset(pdev, 0, sizeof(*pdev));
 1429|  12.1k|	if ((dev = strchr(val, ',')) != NULL) {
  ------------------
  |  Branch (1429:6): [True: 11.1k, False: 1.04k]
  ------------------
 1430|       |		/*
 1431|       |		 * Device's major/minor are given in a specified format.
 1432|       |		 * Decode and pack it accordingly.
 1433|       |		 */
 1434|  11.1k|		*dev++ = '\0';
 1435|  11.1k|		if ((pack = __archive_pack_find(val)) == NULL) {
  ------------------
  |  Branch (1435:7): [True: 668, False: 10.4k]
  ------------------
 1436|    668|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    668|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1437|    668|			    "Unknown format `%s'", val);
 1438|    668|			return ARCHIVE_WARN;
  ------------------
  |  |  235|    668|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1439|    668|		}
 1440|  10.4k|		argc = 0;
 1441|  30.5k|		while ((p = la_strsep(&dev, ",")) != NULL) {
  ------------------
  |  Branch (1441:10): [True: 22.2k, False: 8.29k]
  ------------------
 1442|  22.2k|			if (*p == '\0') {
  ------------------
  |  Branch (1442:8): [True: 1.73k, False: 20.5k]
  ------------------
 1443|  1.73k|				archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.73k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1444|  1.73k|				    "Missing number");
 1445|  1.73k|				return ARCHIVE_WARN;
  ------------------
  |  |  235|  1.73k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1446|  1.73k|			}
 1447|  20.5k|			if (argc >= MAX_PACK_ARGS) {
  ------------------
  |  | 1420|  20.5k|#define MAX_PACK_ARGS 3
  ------------------
  |  Branch (1447:8): [True: 431, False: 20.1k]
  ------------------
 1448|    431|				archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    431|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1449|    431|				    "Too many arguments");
 1450|    431|				return ARCHIVE_WARN;
  ------------------
  |  |  235|    431|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1451|    431|			}
 1452|  20.1k|			numbers[argc++] = (unsigned long)mtree_atol(&p, 0);
 1453|  20.1k|		}
 1454|  8.29k|		if (argc < 2) {
  ------------------
  |  Branch (1454:7): [True: 773, False: 7.52k]
  ------------------
 1455|    773|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    773|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1456|    773|			    "Not enough arguments");
 1457|    773|			return ARCHIVE_WARN;
  ------------------
  |  |  235|    773|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1458|    773|		}
 1459|  7.52k|		result = (*pack)(argc, numbers, &error);
 1460|  7.52k|		if (error != NULL) {
  ------------------
  |  Branch (1460:7): [True: 5.98k, False: 1.54k]
  ------------------
 1461|  5.98k|			archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  5.98k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1462|  5.98k|			    "%s", error);
 1463|  5.98k|			return ARCHIVE_WARN;
  ------------------
  |  |  235|  5.98k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1464|  5.98k|		}
 1465|  7.52k|	} else {
 1466|       |		/* file system raw value. */
 1467|  1.04k|		result = (dev_t)mtree_atol(&val, 0);
 1468|  1.04k|	}
 1469|  2.58k|	*pdev = result;
 1470|  2.58k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.58k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1471|  12.1k|#undef MAX_PACK_ARGS
 1472|  12.1k|}
archive_read_support_format_mtree.c:la_strsep:
 1405|  30.5k|{
 1406|  30.5k|	char *p, *s;
 1407|  30.5k|	if (sp == NULL || *sp == NULL || **sp == '\0')
  ------------------
  |  Branch (1407:6): [True: 0, False: 30.5k]
  |  Branch (1407:20): [True: 0, False: 30.5k]
  |  Branch (1407:35): [True: 8.29k, False: 22.2k]
  ------------------
 1408|  8.29k|		return(NULL);
 1409|  22.2k|	s = *sp;
 1410|  22.2k|	p = s + strcspn(s, sep);
 1411|  22.2k|	if (*p != '\0')
  ------------------
  |  Branch (1411:6): [True: 14.7k, False: 7.51k]
  ------------------
 1412|  14.7k|		*p++ = '\0';
 1413|  22.2k|	*sp = p;
 1414|  22.2k|	return(s);
 1415|  30.5k|}
archive_read_support_format_mtree.c:mtree_atol:
 1993|  25.2k|{
 1994|  25.2k|	int64_t l;
 1995|  25.2k|	int digit;
 1996|       |
 1997|  25.2k|	if (base == 0) {
  ------------------
  |  Branch (1997:6): [True: 21.1k, False: 4.11k]
  ------------------
 1998|  21.1k|		if (**p != '0')
  ------------------
  |  Branch (1998:7): [True: 19.7k, False: 1.43k]
  ------------------
 1999|  19.7k|			base = 10;
 2000|  1.43k|		else if ((*p)[1] == 'x' || (*p)[1] == 'X') {
  ------------------
  |  Branch (2000:12): [True: 197, False: 1.23k]
  |  Branch (2000:30): [True: 494, False: 742]
  ------------------
 2001|    691|			*p += 2;
 2002|    691|			base = 16;
 2003|    742|		} else {
 2004|    742|			base = 8;
 2005|    742|		}
 2006|  21.1k|	}
 2007|       |
 2008|  25.2k|	if (**p == '-') {
  ------------------
  |  Branch (2008:6): [True: 11.5k, False: 13.6k]
  ------------------
 2009|  11.5k|		++(*p);
 2010|       |
 2011|  11.5k|		l = 0;
 2012|  11.5k|		digit = parsedigit(**p);
 2013|  53.3k|		while (digit >= 0 && digit < base) {
  ------------------
  |  Branch (2013:10): [True: 45.3k, False: 7.98k]
  |  Branch (2013:24): [True: 42.3k, False: 3.04k]
  ------------------
 2014|  42.3k|			if (archive_ckd_mul_i64(&l, l, base) ||
  ------------------
  |  Branch (2014:8): [True: 341, False: 41.9k]
  ------------------
 2015|  41.9k|			    archive_ckd_sub_i64(&l, l, digit))
  ------------------
  |  Branch (2015:8): [True: 218, False: 41.7k]
  ------------------
 2016|    559|				return INT64_MIN;
 2017|  41.7k|			digit = parsedigit(*++(*p));
 2018|  41.7k|		}
 2019|  11.0k|		return l;
 2020|  13.6k|	} else {
 2021|  13.6k|		l = 0;
 2022|  13.6k|		digit = parsedigit(**p);
 2023|  48.7k|		while (digit >= 0 && digit < base) {
  ------------------
  |  Branch (2023:10): [True: 39.8k, False: 8.89k]
  |  Branch (2023:24): [True: 35.9k, False: 3.88k]
  ------------------
 2024|  35.9k|			if (archive_ckd_mul_i64(&l, l, base) ||
  ------------------
  |  Branch (2024:8): [True: 656, False: 35.3k]
  ------------------
 2025|  35.3k|			    archive_ckd_add_i64(&l, l, digit))
  ------------------
  |  Branch (2025:8): [True: 233, False: 35.0k]
  ------------------
 2026|    889|				return INT64_MAX;
 2027|  35.0k|			digit = parsedigit(*++(*p));
 2028|  35.0k|		}
 2029|  12.7k|		return l;
 2030|  13.6k|	}
 2031|  25.2k|}
archive_read_support_format_mtree.c:parsedigit:
 1975|   102k|{
 1976|   102k|	if (c >= '0' && c <= '9')
  ------------------
  |  Branch (1976:6): [True: 92.3k, False: 9.76k]
  |  Branch (1976:18): [True: 78.1k, False: 14.2k]
  ------------------
 1977|  78.1k|		return c - '0';
 1978|  24.0k|	else if (c >= 'a' && c <= 'f')
  ------------------
  |  Branch (1978:11): [True: 7.97k, False: 16.0k]
  |  Branch (1978:23): [True: 4.17k, False: 3.79k]
  ------------------
 1979|  4.17k|		return 10 + c - 'a';
 1980|  19.8k|	else if (c >= 'A' && c <= 'F')
  ------------------
  |  Branch (1980:11): [True: 8.81k, False: 11.0k]
  |  Branch (1980:23): [True: 2.95k, False: 5.86k]
  ------------------
 1981|  2.95k|		return 10 + c - 'A';
 1982|  16.8k|	else
 1983|  16.8k|		return -1;
 1984|   102k|}
archive_read_support_format_mtree.c:parse_digest:
 1493|  5.49k|{
 1494|  5.49k|	unsigned char digest_buf[64];
 1495|  5.49k|	int high, low;
 1496|  5.49k|	size_t i, j, len;
 1497|       |
 1498|  5.49k|	switch (type) {
 1499|  1.56k|	case ARCHIVE_ENTRY_DIGEST_MD5:
  ------------------
  |  |  444|  1.56k|#define ARCHIVE_ENTRY_DIGEST_MD5              0x00000001
  ------------------
  |  Branch (1499:2): [True: 1.56k, False: 3.92k]
  ------------------
 1500|  1.56k|		len = sizeof(entry->digest.md5);
 1501|  1.56k|		break;
 1502|    635|	case ARCHIVE_ENTRY_DIGEST_RMD160:
  ------------------
  |  |  445|    635|#define ARCHIVE_ENTRY_DIGEST_RMD160           0x00000002
  ------------------
  |  Branch (1502:2): [True: 635, False: 4.85k]
  ------------------
 1503|    635|		len = sizeof(entry->digest.rmd160);
 1504|    635|		break;
 1505|  1.47k|	case ARCHIVE_ENTRY_DIGEST_SHA1:
  ------------------
  |  |  446|  1.47k|#define ARCHIVE_ENTRY_DIGEST_SHA1             0x00000003
  ------------------
  |  Branch (1505:2): [True: 1.47k, False: 4.01k]
  ------------------
 1506|  1.47k|		len = sizeof(entry->digest.sha1);
 1507|  1.47k|		break;
 1508|    546|	case ARCHIVE_ENTRY_DIGEST_SHA256:
  ------------------
  |  |  447|    546|#define ARCHIVE_ENTRY_DIGEST_SHA256           0x00000004
  ------------------
  |  Branch (1508:2): [True: 546, False: 4.94k]
  ------------------
 1509|    546|		len = sizeof(entry->digest.sha256);
 1510|    546|		break;
 1511|    272|	case ARCHIVE_ENTRY_DIGEST_SHA384:
  ------------------
  |  |  448|    272|#define ARCHIVE_ENTRY_DIGEST_SHA384           0x00000005
  ------------------
  |  Branch (1511:2): [True: 272, False: 5.22k]
  ------------------
 1512|    272|		len = sizeof(entry->digest.sha384);
 1513|    272|		break;
 1514|  1.00k|	case ARCHIVE_ENTRY_DIGEST_SHA512:
  ------------------
  |  |  449|  1.00k|#define ARCHIVE_ENTRY_DIGEST_SHA512           0x00000006
  ------------------
  |  Branch (1514:2): [True: 1.00k, False: 4.49k]
  ------------------
 1515|  1.00k|		len = sizeof(entry->digest.sha512);
 1516|  1.00k|		break;
 1517|      0|	default:
  ------------------
  |  Branch (1517:2): [True: 0, False: 5.49k]
  ------------------
 1518|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1519|      0|			"Internal error: Unknown digest type");
 1520|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1521|  5.49k|	}
 1522|       |
 1523|  5.49k|	if (len > sizeof(digest_buf)) {
  ------------------
  |  Branch (1523:6): [True: 0, False: 5.49k]
  ------------------
 1524|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1525|      0|			"Internal error: Digest storage too large");
 1526|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1527|      0|	}
 1528|       |
 1529|  5.49k|	len *= 2;
 1530|       |
 1531|  5.49k|	if (mtree_strnlen(digest, len+1) != len) {
  ------------------
  |  |  145|  5.49k|#define mtree_strnlen(a,b) strnlen(a,b)
  ------------------
  |  Branch (1531:6): [True: 3.56k, False: 1.93k]
  ------------------
 1532|  3.56k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  3.56k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1533|  3.56k|				  "incorrect digest length, ignoring");
 1534|  3.56k|		return ARCHIVE_WARN;
  ------------------
  |  |  235|  3.56k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1535|  3.56k|	}
 1536|       |
 1537|  39.0k|	for (i = 0, j = 0; i < len; i += 2, j++) {
  ------------------
  |  Branch (1537:21): [True: 38.1k, False: 958]
  ------------------
 1538|  38.1k|		high = parse_hex_nibble(digest[i]);
 1539|  38.1k|		low = parse_hex_nibble(digest[i+1]);
 1540|  38.1k|		if (high == -1 || low == -1) {
  ------------------
  |  Branch (1540:7): [True: 550, False: 37.5k]
  |  Branch (1540:21): [True: 423, False: 37.1k]
  ------------------
 1541|    973|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    973|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1542|    973|					  "invalid digest data, ignoring");
 1543|    973|			return ARCHIVE_WARN;
  ------------------
  |  |  235|    973|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1544|    973|		}
 1545|       |
 1546|  37.1k|		digest_buf[j] = high << 4 | low;
 1547|  37.1k|	}
 1548|       |
 1549|    958|	return archive_entry_set_digest(entry, type, digest_buf);
 1550|  1.93k|}
archive_read_support_format_mtree.c:parse_hex_nibble:
 1476|  76.2k|{
 1477|  76.2k|	if (c >= '0' && c <= '9')
  ------------------
  |  Branch (1477:6): [True: 75.7k, False: 493]
  |  Branch (1477:18): [True: 33.0k, False: 42.6k]
  ------------------
 1478|  33.0k|		return c - '0';
 1479|  43.1k|	if (c >= 'a' && c <= 'f')
  ------------------
  |  Branch (1479:6): [True: 42.4k, False: 629]
  |  Branch (1479:18): [True: 41.8k, False: 601]
  ------------------
 1480|  41.8k|		return 10 + c - 'a';
 1481|       |#if 0
 1482|       |	/* XXX: Is uppercase something we should support? */
 1483|       |	if (c >= 'A' && c <= 'F')
 1484|       |		return 10 + c - 'A';
 1485|       |#endif
 1486|       |
 1487|  1.23k|	return -1;
 1488|  43.1k|}
archive_read_support_format_mtree.c:read_data:
 1838|  39.3k|{
 1839|  39.3k|	struct mtree *mtree = a->format->data;
 1840|  39.3k|	size_t bytes_to_read;
 1841|  39.3k|	ssize_t bytes_read;
 1842|       |
 1843|  39.3k|	if (mtree->fd < 0) {
  ------------------
  |  Branch (1843:6): [True: 39.3k, False: 0]
  ------------------
 1844|  39.3k|		*buff = NULL;
 1845|  39.3k|		*offset = 0;
 1846|  39.3k|		*size = 0;
 1847|  39.3k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  39.3k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1848|  39.3k|	}
 1849|      0|	if (mtree->buff == NULL) {
  ------------------
  |  Branch (1849:6): [True: 0, False: 0]
  ------------------
 1850|      0|		mtree->buffsize = 64 * 1024;
 1851|      0|		mtree->buff = malloc(mtree->buffsize);
 1852|      0|		if (mtree->buff == NULL) {
  ------------------
  |  Branch (1852:7): [True: 0, False: 0]
  ------------------
 1853|      0|			archive_set_error(&a->archive, ENOMEM,
 1854|      0|			    "Can't allocate memory");
 1855|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1856|      0|		}
 1857|      0|	}
 1858|       |
 1859|      0|	*buff = mtree->buff;
 1860|      0|	*offset = mtree->offset;
 1861|      0|	if ((int64_t)mtree->buffsize > mtree->cur_size - mtree->offset)
  ------------------
  |  Branch (1861:6): [True: 0, False: 0]
  ------------------
 1862|      0|		bytes_to_read = (size_t)(mtree->cur_size - mtree->offset);
 1863|      0|	else
 1864|      0|		bytes_to_read = mtree->buffsize;
 1865|      0|	bytes_read = read(mtree->fd, mtree->buff, bytes_to_read);
 1866|      0|	if (bytes_read < 0) {
  ------------------
  |  Branch (1866:6): [True: 0, False: 0]
  ------------------
 1867|      0|		archive_set_error(&a->archive, errno, "Can't read");
 1868|      0|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1869|      0|	}
 1870|      0|	if (bytes_read == 0) {
  ------------------
  |  Branch (1870:6): [True: 0, False: 0]
  ------------------
 1871|      0|		*size = 0;
 1872|      0|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1873|      0|	}
 1874|      0|	mtree->offset += bytes_read;
 1875|      0|	*size = bytes_read;
 1876|      0|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1877|      0|}
archive_read_support_format_mtree.c:skip:
 1882|  39.3k|{
 1883|  39.3k|	struct mtree *mtree = a->format->data;
 1884|       |
 1885|  39.3k|	if (mtree->fd >= 0) {
  ------------------
  |  Branch (1885:6): [True: 0, False: 39.3k]
  ------------------
 1886|      0|		close(mtree->fd);
 1887|      0|		mtree->fd = -1;
 1888|      0|	}
 1889|  39.3k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  39.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1890|  39.3k|}

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

archive_read_support_format_rar5:
 4532|  16.7k|int archive_read_support_format_rar5(struct archive *_a) {
 4533|  16.7k|	struct archive_read* ar = (struct archive_read*)_a;
 4534|  16.7k|	struct rar5 *rar5;
 4535|  16.7k|	int r;
 4536|       |
 4537|  16.7k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
 4538|  16.7k|	    "archive_read_support_format_rar5");
 4539|       |
 4540|  16.7k|	rar5 = malloc(sizeof(*rar5));
 4541|  16.7k|	if(rar5 == NULL) {
  ------------------
  |  Branch (4541:5): [True: 0, False: 16.7k]
  ------------------
 4542|      0|		archive_set_error(&ar->archive, ENOMEM,
 4543|      0|		    "Can't allocate rar5 data");
 4544|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4545|      0|	}
 4546|       |
 4547|  16.7k|	if(ARCHIVE_OK != rar5_init(rar5)) {
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4547:5): [True: 0, False: 16.7k]
  ------------------
 4548|      0|		archive_set_error(&ar->archive, ENOMEM,
 4549|      0|		    "Can't allocate rar5 filter buffer");
 4550|      0|		free(rar5);
 4551|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4552|      0|	}
 4553|       |
 4554|  16.7k|	r = __archive_read_register_format(ar,
 4555|  16.7k|	    rar5,
 4556|  16.7k|	    "rar5",
 4557|  16.7k|	    rar5_bid,
 4558|  16.7k|	    rar5_options,
 4559|  16.7k|	    rar5_read_header,
 4560|  16.7k|	    rar5_read_data,
 4561|  16.7k|	    rar5_read_data_skip,
 4562|  16.7k|	    rar5_seek_data,
 4563|  16.7k|	    rar5_cleanup,
 4564|  16.7k|	    rar5_capabilities,
 4565|  16.7k|	    rar5_has_encrypted_entries);
 4566|       |
 4567|  16.7k|	if(r != ARCHIVE_OK) {
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4567:5): [True: 0, False: 16.7k]
  ------------------
 4568|      0|		rar5_deinit(rar5);
 4569|      0|		free(rar5);
 4570|      0|	}
 4571|  16.7k|	return r;
 4572|  16.7k|}
archive_read_support_format_rar5.c:rar5_init:
 4512|  16.7k|static int rar5_init(struct rar5 *rar5) {
 4513|  16.7k|	memset(rar5, 0, sizeof(struct rar5));
 4514|       |
 4515|  16.7k|	if(CDE_OK != cdeque_init(&rar5->cstate.filters, 8192))
  ------------------
  |  Branch (4515:5): [True: 0, False: 16.7k]
  ------------------
 4516|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4517|       |
 4518|       |	/*
 4519|       |	 * Until enough data has been read, we cannot tell about
 4520|       |	 * any encrypted entries yet.
 4521|       |	 */
 4522|  16.7k|	rar5->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|  16.7k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4523|       |
 4524|  16.7k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4525|  16.7k|}
archive_read_support_format_rar5.c:cdeque_init:
  406|  16.7k|static int cdeque_init(struct cdeque* d, int max_capacity_power_of_2) {
  407|  16.7k|	if(d == NULL || max_capacity_power_of_2 == 0)
  ------------------
  |  Branch (407:5): [True: 0, False: 16.7k]
  |  Branch (407:18): [True: 0, False: 16.7k]
  ------------------
  408|      0|		return CDE_PARAM;
  409|       |
  410|  16.7k|	d->cap_mask = max_capacity_power_of_2 - 1;
  411|  16.7k|	d->arr = NULL;
  412|       |
  413|  16.7k|	if((max_capacity_power_of_2 & d->cap_mask) != 0)
  ------------------
  |  Branch (413:5): [True: 0, False: 16.7k]
  ------------------
  414|      0|		return CDE_PARAM;
  415|       |
  416|  16.7k|	cdeque_clear(d);
  417|  16.7k|	d->arr = malloc(sizeof(void*) * max_capacity_power_of_2);
  418|       |
  419|  16.7k|	return d->arr ? CDE_OK : CDE_ALLOC;
  ------------------
  |  Branch (419:9): [True: 16.7k, False: 0]
  ------------------
  420|  16.7k|}
archive_read_support_format_rar5.c:cdeque_clear:
  397|  39.4k|static void cdeque_clear(struct cdeque* d) {
  398|  39.4k|	d->size = 0;
  399|  39.4k|	d->beg_pos = 0;
  400|  39.4k|	d->end_pos = 0;
  401|  39.4k|}
archive_read_support_format_rar5.c:rar5_bid:
 1166|  16.4k|static int rar5_bid(struct archive_read* a, int best_bid) {
 1167|  16.4k|	int my_bid;
 1168|       |
 1169|  16.4k|	if(best_bid >= RAR5_SIGNATURE_BID)
  ------------------
  |  |   96|  16.4k|#define RAR5_SIGNATURE_BID ((int)(8 * sizeof(rar5_signature_xor)))
  ------------------
  |  Branch (1169:5): [True: 2.81k, False: 13.6k]
  ------------------
 1170|  2.81k|		return -1;
 1171|       |
 1172|  13.6k|	my_bid = bid_standard(a);
 1173|  13.6k|	if(my_bid > -1) {
  ------------------
  |  Branch (1173:5): [True: 2.01k, False: 11.5k]
  ------------------
 1174|  2.01k|		return my_bid;
 1175|  2.01k|	}
 1176|  11.5k|	my_bid = bid_sfx(a);
 1177|  11.5k|	if (my_bid > -1) {
  ------------------
  |  Branch (1177:6): [True: 11.4k, False: 173]
  ------------------
 1178|  11.4k|		return my_bid;
 1179|  11.4k|	}
 1180|       |
 1181|    173|	return -1;
 1182|  11.5k|}
archive_read_support_format_rar5.c:bid_standard:
 1110|  13.6k|static int bid_standard(struct archive_read* a) {
 1111|  13.6k|	const uint8_t* h;
 1112|  13.6k|	char signature[sizeof(rar5_signature_xor)];
 1113|       |
 1114|  13.6k|	rar5_signature(signature);
 1115|       |
 1116|  13.6k|	if(!read_ahead(a, sizeof(rar5_signature_xor), &h))
  ------------------
  |  Branch (1116:5): [True: 173, False: 13.4k]
  ------------------
 1117|    173|		return -1;
 1118|       |
 1119|  13.4k|	if(!memcmp(h, signature, sizeof(rar5_signature_xor)))
  ------------------
  |  Branch (1119:5): [True: 2.01k, False: 11.4k]
  ------------------
 1120|  2.01k|		return RAR5_SIGNATURE_BID;
  ------------------
  |  |   96|  2.01k|#define RAR5_SIGNATURE_BID ((int)(8 * sizeof(rar5_signature_xor)))
  ------------------
 1121|       |
 1122|  11.4k|	return -1;
 1123|  13.4k|}
archive_read_support_format_rar5.c:rar5_signature:
 4334|  20.0k|static void rar5_signature(char *buf) {
 4335|  20.0k|		size_t i;
 4336|       |
 4337|   180k|		for(i = 0; i < sizeof(rar5_signature_xor); i++) {
  ------------------
  |  Branch (4337:14): [True: 160k, False: 20.0k]
  ------------------
 4338|   160k|			buf[i] = rar5_signature_xor[i] ^ 0xA1;
 4339|   160k|		}
 4340|  20.0k|}
archive_read_support_format_rar5.c:read_ahead:
  904|   484k|{
  905|   484k|	if(!ptr)
  ------------------
  |  Branch (905:5): [True: 0, False: 484k]
  ------------------
  906|      0|		return 0;
  907|       |
  908|   484k|	*ptr = __archive_read_ahead(a, how_many, NULL);
  909|   484k|	if(*ptr == NULL) {
  ------------------
  |  Branch (909:5): [True: 2.65k, False: 481k]
  ------------------
  910|  2.65k|		return 0;
  911|  2.65k|	}
  912|       |
  913|   481k|	return 1;
  914|   484k|}
archive_read_support_format_rar5.c:bid_sfx:
 1126|  11.5k|{
 1127|  11.5k|	const char *h;
 1128|       |
 1129|  11.5k|	if ((h = __archive_read_ahead(a, 7, NULL)) == NULL)
  ------------------
  |  Branch (1129:6): [True: 173, False: 11.4k]
  ------------------
 1130|    173|		return -1;
 1131|       |
 1132|  11.4k|	if ((h[0] == 'M' && h[1] == 'Z') || memcmp(h, "\x7F\x45LF", 4) == 0) {
  ------------------
  |  Branch (1132:7): [True: 537, False: 10.8k]
  |  Branch (1132:22): [True: 446, False: 91]
  |  Branch (1132:38): [True: 198, False: 10.7k]
  ------------------
 1133|       |		/* This is a PE file */
 1134|    644|		char signature[sizeof(rar5_signature_xor)];
 1135|    644|		ssize_t offset = 0x10000;
 1136|    644|		ssize_t window = 4096;
 1137|       |
 1138|    644|		rar5_signature(signature);
 1139|       |
 1140|  1.02k|		while (offset + window <= SFX_MAX_READAHEAD) {
  ------------------
  |  |  163|  1.02k|#define	SFX_MAX_READAHEAD	(1024 * 512)
  ------------------
  |  Branch (1140:10): [True: 1.01k, False: 9]
  ------------------
 1141|  1.01k|			ssize_t bytes_avail;
 1142|       |
 1143|  1.01k|			h = __archive_read_ahead(a, offset + window, &bytes_avail);
 1144|  1.01k|			if (h == NULL) {
  ------------------
  |  Branch (1144:8): [True: 635, False: 381]
  ------------------
 1145|    635|				if (bytes_avail >= offset + 0x10) {
  ------------------
  |  Branch (1145:9): [True: 16, False: 619]
  ------------------
 1146|       |					/* Remaining bytes are less than window. */
 1147|     16|					window = bytes_avail - offset;
 1148|     16|					continue;
 1149|     16|				}
 1150|    619|				return 0;
 1151|    635|			}
 1152|    381|			if (bytes_avail > SFX_MAX_READAHEAD)
  ------------------
  |  |  163|    381|#define	SFX_MAX_READAHEAD	(1024 * 512)
  ------------------
  |  Branch (1152:8): [True: 8, False: 373]
  ------------------
 1153|      8|				bytes_avail = SFX_MAX_READAHEAD;
  ------------------
  |  |  163|      8|#define	SFX_MAX_READAHEAD	(1024 * 512)
  ------------------
 1154|   618k|			while (offset <= bytes_avail - 8) {
  ------------------
  |  Branch (1154:11): [True: 617k, False: 365]
  ------------------
 1155|   617k|				if (memcmp(h + offset, signature,
  ------------------
  |  Branch (1155:9): [True: 16, False: 617k]
  ------------------
 1156|   617k|				    sizeof(signature)) == 0)
 1157|     16|					return 30;
 1158|   617k|				offset += 0x10;
 1159|   617k|			}
 1160|    381|		}
 1161|    644|	}
 1162|       |
 1163|  10.7k|	return 0;
 1164|  11.4k|}
archive_read_support_format_rar5.c:rar5_read_header:
 2585|  4.72k|{
 2586|  4.72k|	struct rar5 *rar5 = a->format->data;
 2587|  4.72k|	int ret;
 2588|       |
 2589|       |	/*
 2590|       |	 * It should be sufficient to call archive_read_next_header() for
 2591|       |	 * a reader to determine if an entry is encrypted or not.
 2592|       |	 */
 2593|  4.72k|	if (rar5->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|  4.72k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (2593:6): [True: 2.02k, False: 2.70k]
  ------------------
 2594|  2.02k|		rar5->has_encrypted_entries = 0;
 2595|  2.02k|	}
 2596|       |
 2597|  4.72k|	if(rar5->header_initialized == 0) {
  ------------------
  |  Branch (2597:5): [True: 2.02k, False: 2.70k]
  ------------------
 2598|  2.02k|		init_header(a);
 2599|  2.02k|		if ((ret = try_skip_sfx(a)) < ARCHIVE_WARN)
  ------------------
  |  |  235|  2.02k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (2599:7): [True: 0, False: 2.02k]
  ------------------
 2600|      0|			return ret;
 2601|  2.02k|		rar5->header_initialized = 1;
 2602|  2.02k|	}
 2603|       |
 2604|  4.72k|	if(rar5->skipped_magic == 0) {
  ------------------
  |  Branch (2604:5): [True: 2.02k, False: 2.70k]
  ------------------
 2605|  2.02k|		if(ARCHIVE_OK != consume(a, sizeof(rar5_signature_xor))) {
  ------------------
  |  |  233|  2.02k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2605:6): [True: 0, False: 2.02k]
  ------------------
 2606|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2607|      0|		}
 2608|       |
 2609|  2.02k|		rar5->skipped_magic = 1;
 2610|  2.02k|	}
 2611|       |
 2612|  8.24k|	do {
 2613|  8.24k|		ret = process_base_block(a, entry);
 2614|  8.24k|	} while(ret == ARCHIVE_RETRY ||
  ------------------
  |  |  234|  16.4k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (2614:10): [True: 2.76k, False: 5.48k]
  ------------------
 2615|  5.48k|			(rar5->main.endarc > 0 && ret == ARCHIVE_OK));
  ------------------
  |  |  233|    771|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2615:5): [True: 771, False: 4.71k]
  |  Branch (2615:30): [True: 760, False: 11]
  ------------------
 2616|       |
 2617|  4.72k|	return ret;
 2618|  4.72k|}
archive_read_support_format_rar5.c:init_header:
 1197|  2.02k|static void init_header(struct archive_read* a) {
 1198|  2.02k|	a->archive.archive_format = ARCHIVE_FORMAT_RAR_V5;
  ------------------
  |  |  387|  2.02k|#define	ARCHIVE_FORMAT_RAR_V5			0x100000
  ------------------
 1199|  2.02k|	a->archive.archive_format_name = "RAR5";
 1200|  2.02k|}
archive_read_support_format_rar5.c:try_skip_sfx:
 2528|  2.02k|{
 2529|  2.02k|	const char *p;
 2530|       |
 2531|  2.02k|	if ((p = __archive_read_ahead(a, 7, NULL)) == NULL)
  ------------------
  |  Branch (2531:6): [True: 0, False: 2.02k]
  ------------------
 2532|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2533|       |
 2534|  2.02k|	if ((p[0] == 'M' && p[1] == 'Z') || memcmp(p, "\x7F\x45LF", 4) == 0)
  ------------------
  |  Branch (2534:7): [True: 7, False: 2.01k]
  |  Branch (2534:22): [True: 7, False: 0]
  |  Branch (2534:38): [True: 3, False: 2.01k]
  ------------------
 2535|     10|	{
 2536|     10|		char signature[sizeof(rar5_signature_xor)];
 2537|     10|		const void *h;
 2538|     10|		const char *q;
 2539|     10|		size_t skip, total = 0;
 2540|     10|		ssize_t bytes, window = 4096;
 2541|       |
 2542|     10|		rar5_signature(signature);
 2543|       |
 2544|     10|		while (total + window <= (1024 * 512)) {
  ------------------
  |  Branch (2544:10): [True: 10, False: 0]
  ------------------
 2545|     10|			h = __archive_read_ahead(a, window, &bytes);
 2546|     10|			if (h == NULL) {
  ------------------
  |  Branch (2546:8): [True: 0, False: 10]
  ------------------
 2547|       |				/* Remaining bytes are less than window. */
 2548|      0|				window >>= 1;
 2549|      0|				if (window < 0x40)
  ------------------
  |  Branch (2549:9): [True: 0, False: 0]
  ------------------
 2550|      0|					goto fatal;
 2551|      0|				continue;
 2552|      0|			}
 2553|     10|			if (bytes < 0x40)
  ------------------
  |  Branch (2553:8): [True: 0, False: 10]
  ------------------
 2554|      0|				goto fatal;
 2555|     10|			p = h;
 2556|     10|			q = p + bytes;
 2557|       |
 2558|       |			/*
 2559|       |			 * Scan ahead until we find something that looks
 2560|       |			 * like the RAR header.
 2561|       |			 */
 2562|  6.86k|			while (p + 8 < q) {
  ------------------
  |  Branch (2562:11): [True: 6.86k, False: 0]
  ------------------
 2563|  6.86k|				if (memcmp(p, signature, sizeof(signature)) == 0) {
  ------------------
  |  Branch (2563:9): [True: 10, False: 6.85k]
  ------------------
 2564|     10|					skip = p - (const char *)h;
 2565|     10|					__archive_read_consume(a, skip);
 2566|     10|					return (ARCHIVE_OK);
  ------------------
  |  |  233|     10|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2567|     10|				}
 2568|  6.85k|				p += 0x10;
 2569|  6.85k|			}
 2570|      0|			skip = p - (const char *)h;
 2571|      0|			__archive_read_consume(a, skip);
 2572|      0|			total += skip;
 2573|      0|		}
 2574|     10|	}
 2575|       |
 2576|  2.01k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.01k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2577|      0|fatal:
 2578|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2579|      0|			"Couldn't find out RAR header");
 2580|      0|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2581|  2.02k|}
archive_read_support_format_rar5.c:consume:
  916|   444k|static int consume(struct archive_read* a, int64_t how_many) {
  917|   444k|	if(__archive_read_consume(a, how_many) < 0)
  ------------------
  |  Branch (917:5): [True: 1.02k, False: 443k]
  ------------------
  918|  1.02k|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|  1.02k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  919|       |
  920|   443k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|   443k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  921|   444k|}
archive_read_support_format_rar5.c:process_base_block:
 2320|  25.6k|{
 2321|  25.6k|	const size_t SMALLEST_RAR5_BLOCK_SIZE = 3;
 2322|       |
 2323|  25.6k|	struct rar5 *rar5 = a->format->data;
 2324|  25.6k|	uint32_t hdr_crc, computed_crc;
 2325|  25.6k|	size_t raw_hdr_size = 0, hdr_size_len, hdr_size;
 2326|  25.6k|	size_t header_id = 0;
 2327|  25.6k|	size_t header_flags = 0;
 2328|  25.6k|	const uint8_t* p;
 2329|  25.6k|	const uint8_t* body_start;
 2330|  25.6k|	int ret;
 2331|       |
 2332|  25.6k|	enum HEADER_TYPE {
 2333|  25.6k|		HEAD_MARK    = 0x00, HEAD_MAIN  = 0x01, HEAD_FILE   = 0x02,
 2334|  25.6k|		HEAD_SERVICE = 0x03, HEAD_CRYPT = 0x04, HEAD_ENDARC = 0x05,
 2335|  25.6k|		HEAD_UNKNOWN = 0xff,
 2336|  25.6k|	};
 2337|       |
 2338|       |	/* Skip any unprocessed data for this file. */
 2339|  25.6k|	ret = skip_unprocessed_bytes(a);
 2340|  25.6k|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  25.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2340:5): [True: 438, False: 25.2k]
  ------------------
 2341|    438|		return ret;
 2342|       |
 2343|       |	/* Read the expected CRC32 checksum. */
 2344|  25.2k|	if(!read_u32(a, &hdr_crc)) {
  ------------------
  |  Branch (2344:5): [True: 100, False: 25.1k]
  ------------------
 2345|    100|		return ARCHIVE_EOF;
  ------------------
  |  |  232|    100|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2346|    100|	}
 2347|       |
 2348|       |	/* Read header size. */
 2349|  25.1k|	if(!read_var_sized(a, &raw_hdr_size, &hdr_size_len)) {
  ------------------
  |  Branch (2349:5): [True: 263, False: 24.8k]
  ------------------
 2350|    263|		return ARCHIVE_EOF;
  ------------------
  |  |  232|    263|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2351|    263|	}
 2352|       |
 2353|       |	/* Sanity check, maximum header size for RAR5 is 2MB.  Bounding
 2354|       |	 * raw_hdr_size (instead of the sum) also ensures that adding
 2355|       |	 * hdr_size_len below cannot wrap hdr_size around SIZE_MAX. */
 2356|  24.8k|	if(raw_hdr_size > (2 * 1024 * 1024) - hdr_size_len) {
  ------------------
  |  Branch (2356:5): [True: 38, False: 24.8k]
  ------------------
 2357|     38|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     38|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2358|     38|		    "Base block header is too large");
 2359|       |
 2360|     38|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     38|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2361|     38|	}
 2362|       |
 2363|  24.8k|	hdr_size = raw_hdr_size + hdr_size_len;
 2364|       |
 2365|       |	/* Additional sanity checks to weed out invalid files. */
 2366|  24.8k|	if(raw_hdr_size == 0 || hdr_size_len == 0 ||
  ------------------
  |  Branch (2366:5): [True: 61, False: 24.7k]
  |  Branch (2366:26): [True: 0, False: 24.7k]
  ------------------
 2367|  24.7k|		hdr_size < SMALLEST_RAR5_BLOCK_SIZE)
  ------------------
  |  Branch (2367:3): [True: 17, False: 24.7k]
  ------------------
 2368|     78|	{
 2369|     78|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     78|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2370|     78|		    "Too small block encountered (%zu bytes)",
 2371|     78|		    raw_hdr_size);
 2372|       |
 2373|     78|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     78|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2374|     78|	}
 2375|       |
 2376|       |	/* Read the whole header data into memory, maximum memory use here is
 2377|       |	 * 2MB. */
 2378|  24.7k|	if(!read_ahead(a, hdr_size, &p)) {
  ------------------
  |  Branch (2378:5): [True: 179, False: 24.5k]
  ------------------
 2379|    179|		return ARCHIVE_EOF;
  ------------------
  |  |  232|    179|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2380|    179|	}
 2381|       |
 2382|       |	/* Verify the CRC32 of the header data. */
 2383|  24.5k|	computed_crc = (uint32_t) __archive_crc32(0, p, (int) hdr_size);
 2384|  24.5k|	if(computed_crc != hdr_crc) {
  ------------------
  |  Branch (2384:5): [True: 23.4k, False: 1.11k]
  ------------------
 2385|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 2386|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 2387|       |		    "Header CRC error");
 2388|       |
 2389|       |		return ARCHIVE_FATAL;
 2390|       |#endif
 2391|  23.4k|	}
 2392|       |
 2393|       |	/* Remember the first byte of the block body so we can later skip
 2394|       |	 * any bytes the sub-parser leaves unconsumed. */
 2395|  24.5k|	body_start = p + hdr_size_len;
 2396|       |
 2397|       |	/* If the checksum is OK, we proceed with parsing. */
 2398|  24.5k|	if(ARCHIVE_OK != consume(a, hdr_size_len)) {
  ------------------
  |  |  233|  24.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2398:5): [True: 0, False: 24.5k]
  ------------------
 2399|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2400|      0|	}
 2401|       |
 2402|  24.5k|	if(!read_var_sized(a, &header_id, NULL))
  ------------------
  |  Branch (2402:5): [True: 11, False: 24.5k]
  ------------------
 2403|     11|		return ARCHIVE_EOF;
  ------------------
  |  |  232|     11|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2404|       |
 2405|  24.5k|	if(!read_var_sized(a, &header_flags, NULL))
  ------------------
  |  Branch (2405:5): [True: 7, False: 24.5k]
  ------------------
 2406|      7|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      7|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2407|       |
 2408|  24.5k|	rar5->generic.split_after = (header_flags & HFL_SPLIT_AFTER) > 0;
 2409|  24.5k|	rar5->generic.split_before = (header_flags & HFL_SPLIT_BEFORE) > 0;
 2410|  24.5k|	rar5->generic.size = (int)hdr_size;
 2411|  24.5k|	rar5->generic.last_header_id = (int)header_id;
 2412|  24.5k|	rar5->main.endarc = 0;
 2413|       |
 2414|       |	/* Those are possible header ids in RARv5. */
 2415|  24.5k|	switch(header_id) {
 2416|  2.55k|		case HEAD_MAIN:
  ------------------
  |  Branch (2416:3): [True: 2.55k, False: 21.9k]
  ------------------
 2417|  2.55k|			ret = process_head_main(a, rar5, entry, header_flags);
 2418|       |
 2419|       |			/* Main header doesn't have any files in it, so it's
 2420|       |			 * pointless to return to the caller. Retry to next
 2421|       |			 * header, which should be HEAD_FILE/HEAD_SERVICE. */
 2422|  2.55k|			if(ret == ARCHIVE_OK) {
  ------------------
  |  |  233|  2.55k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2422:7): [True: 2.50k, False: 45]
  ------------------
 2423|  2.50k|				rar5_skip_remaining_block(a, body_start,
 2424|  2.50k|				    raw_hdr_size);
 2425|  2.50k|				return ARCHIVE_RETRY;
  ------------------
  |  |  234|  2.50k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2426|  2.50k|			}
 2427|       |
 2428|     45|			return ret;
 2429|  1.57k|		case HEAD_SERVICE:
  ------------------
  |  Branch (2429:3): [True: 1.57k, False: 22.9k]
  ------------------
 2430|  1.57k|			ret = process_head_service(a, rar5, entry, header_flags);
 2431|  1.57k|			return ret;
 2432|  10.1k|		case HEAD_FILE:
  ------------------
  |  Branch (2432:3): [True: 10.1k, False: 14.3k]
  ------------------
 2433|  10.1k|			ret = process_head_file(a, rar5, entry, header_flags);
 2434|  10.1k|			return ret;
 2435|      4|		case HEAD_CRYPT:
  ------------------
  |  Branch (2435:3): [True: 4, False: 24.5k]
  ------------------
 2436|      4|			archive_entry_set_is_metadata_encrypted(entry, 1);
 2437|      4|			archive_entry_set_is_data_encrypted(entry, 1);
 2438|      4|			rar5->has_encrypted_entries = 1;
 2439|      4|			rar5->headers_are_encrypted = 1;
 2440|      4|			archive_set_error(&a->archive,
 2441|      4|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2442|      4|			    "Encryption is not supported");
 2443|      4|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2444|  5.83k|		case HEAD_ENDARC:
  ------------------
  |  Branch (2444:3): [True: 5.83k, False: 18.7k]
  ------------------
 2445|  5.83k|			rar5->main.endarc = 1;
 2446|       |
 2447|       |			/* After encountering an end of file marker, we need
 2448|       |			 * to take into consideration if this archive is
 2449|       |			 * continued in another file (i.e. is it part01.rar:
 2450|       |			 * is there a part02.rar?) */
 2451|  5.83k|			if(rar5->main.volume) {
  ------------------
  |  Branch (2451:7): [True: 5.82k, False: 13]
  ------------------
 2452|       |				/* In case there is part02.rar, position the
 2453|       |				 * read pointer in a proper place, so we can
 2454|       |				 * resume parsing. */
 2455|  5.82k|				ret = scan_for_signature(a);
 2456|  5.82k|				if(ret == ARCHIVE_FATAL) {
  ------------------
  |  |  239|  5.82k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2456:8): [True: 0, False: 5.82k]
  ------------------
 2457|      0|					return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2458|  5.82k|				} else {
 2459|  5.82k|					if(rar5->vol.expected_vol_no ==
  ------------------
  |  Branch (2459:9): [True: 1, False: 5.82k]
  ------------------
 2460|  5.82k|					    UINT_MAX) {
 2461|      1|						archive_set_error(&a->archive,
 2462|      1|						    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2463|      1|						    "Header error");
 2464|      1|							return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2465|      1|					}
 2466|       |
 2467|  5.82k|					rar5->vol.expected_vol_no =
 2468|  5.82k|					    rar5->main.vol_no + 1;
 2469|  5.82k|					return ARCHIVE_OK;
  ------------------
  |  |  233|  5.82k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2470|  5.82k|				}
 2471|  5.82k|			} else {
 2472|     13|				return ARCHIVE_EOF;
  ------------------
  |  |  232|     13|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2473|     13|			}
 2474|     19|		case HEAD_MARK:
  ------------------
  |  Branch (2474:3): [True: 19, False: 24.5k]
  ------------------
 2475|     19|			return ARCHIVE_EOF;
  ------------------
  |  |  232|     19|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2476|  4.39k|		default:
  ------------------
  |  Branch (2476:3): [True: 4.39k, False: 20.1k]
  ------------------
 2477|  4.39k|			if((header_flags & HFL_SKIP_IF_UNKNOWN) == 0) {
  ------------------
  |  Branch (2477:7): [True: 68, False: 4.33k]
  ------------------
 2478|     68|				archive_set_error(&a->archive,
 2479|     68|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     68|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2480|     68|				    "Header type error");
 2481|     68|				return ARCHIVE_FATAL;
  ------------------
  |  |  239|     68|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2482|  4.33k|			} else {
 2483|       |				/* If the block is marked as 'skip if unknown',
 2484|       |				 * do as the flag says: skip the block
 2485|       |				 * instead on failing on it. */
 2486|  4.33k|				rar5_skip_remaining_block(a, body_start,
 2487|  4.33k|				    raw_hdr_size);
 2488|  4.33k|				return ARCHIVE_RETRY;
  ------------------
  |  |  234|  4.33k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2489|  4.33k|			}
 2490|  24.5k|	}
 2491|       |
 2492|      0|#if !defined WIN32
 2493|       |	// Not reached.
 2494|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 2495|      0|	    "Internal unpacker error");
 2496|      0|	return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2497|  24.5k|#endif
 2498|  24.5k|}
archive_read_support_format_rar5.c:skip_unprocessed_bytes:
 2210|  25.6k|static int skip_unprocessed_bytes(struct archive_read* a) {
 2211|  25.6k|	struct rar5 *rar5 = a->format->data;
 2212|  25.6k|	int ret;
 2213|       |
 2214|  25.6k|	if(rar5->file.bytes_remaining) {
  ------------------
  |  Branch (2214:5): [True: 1.69k, False: 23.9k]
  ------------------
 2215|       |		/* Use different skipping method in block merging mode than in
 2216|       |		 * normal mode. If merge mode is active, rar5_read_data_skip
 2217|       |		 * can't be used, because it could allow recursive use of
 2218|       |		 * merge_block() * function, and this function doesn't support
 2219|       |		 * recursive use. */
 2220|  1.69k|		if(rar5->merge_mode) {
  ------------------
  |  Branch (2220:6): [True: 584, False: 1.11k]
  ------------------
 2221|       |			/* Discard whole merged block. This is valid in solid
 2222|       |			 * mode as well, because the code will discard blocks
 2223|       |			 * only if those blocks are safe to discard (i.e.
 2224|       |			 * they're not FILE blocks).  */
 2225|    584|			ret = consume(a, rar5->file.bytes_remaining);
 2226|    584|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|    584|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2226:7): [True: 11, False: 573]
  ------------------
 2227|     11|				return ret;
 2228|     11|			}
 2229|    573|			rar5->file.bytes_remaining = 0;
 2230|  1.11k|		} else {
 2231|       |			/* If we're not in merge mode, use safe skipping code.
 2232|       |			 * This will ensure we'll handle solid archives
 2233|       |			 * properly. */
 2234|  1.11k|			ret = rar5_read_data_skip(a);
 2235|  1.11k|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.11k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2235:7): [True: 427, False: 685]
  ------------------
 2236|    427|				return ret;
 2237|    427|			}
 2238|  1.11k|		}
 2239|  1.69k|	}
 2240|       |
 2241|  25.2k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  25.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2242|  25.6k|}
archive_read_support_format_rar5.c:read_u32:
 1092|  42.8k|static char read_u32(struct archive_read* a, uint32_t* pvalue) {
 1093|  42.8k|	const uint8_t* p;
 1094|  42.8k|	if(!read_ahead(a, 4, &p))
  ------------------
  |  Branch (1094:5): [True: 110, False: 42.7k]
  ------------------
 1095|    110|		return 0;
 1096|       |
 1097|  42.7k|	*pvalue = archive_le32dec(p);
 1098|  42.7k|	return ARCHIVE_OK == consume(a, 4);
  ------------------
  |  |  233|  42.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1099|  42.8k|}
archive_read_support_format_rar5.c:read_var_sized:
 1006|   215k|{
 1007|   215k|	uint64_t v;
 1008|   215k|	uint64_t v_size = 0;
 1009|       |
 1010|   215k|	const int ret = pvalue_len ? read_var(a, &v, &v_size)
  ------------------
  |  Branch (1010:18): [True: 92.4k, False: 123k]
  ------------------
 1011|   215k|				   : read_var(a, &v, NULL);
 1012|       |
 1013|   215k|	if(ret == 1 && pvalue) {
  ------------------
  |  Branch (1013:5): [True: 213k, False: 2.58k]
  |  Branch (1013:17): [True: 213k, False: 0]
  ------------------
 1014|   213k|		*pvalue = (size_t) v;
 1015|   213k|	}
 1016|       |
 1017|   215k|	if(pvalue_len) {
  ------------------
  |  Branch (1017:5): [True: 92.4k, False: 123k]
  ------------------
 1018|       |		/* Possible data truncation should be safe. */
 1019|  92.4k|		*pvalue_len = (size_t) v_size;
 1020|  92.4k|	}
 1021|       |
 1022|   215k|	return ret;
 1023|   215k|}
archive_read_support_format_rar5.c:read_var:
  942|   346k|{
  943|   346k|	uint64_t multiplier;
  944|   346k|	uint64_t result = 0;
  945|   346k|	size_t i;
  946|   346k|	const uint8_t* p;
  947|       |
  948|       |	/* We will read maximum of 10 bytes. We don't have to handle the
  949|       |	 * situation to read the RAR5 variable-sized value stored at the end of
  950|       |	 * the file, because such situation will never happen. */
  951|   346k|	if(!read_ahead(a, 10, &p))
  ------------------
  |  Branch (951:5): [True: 640, False: 345k]
  ------------------
  952|    640|		return 0;
  953|       |
  954|   451k|	for(multiplier = 1, i = 0; i < 10; i++, multiplier *= 128) {
  ------------------
  |  Branch (954:29): [True: 450k, False: 498]
  ------------------
  955|   450k|		uint64_t val;
  956|   450k|		uint8_t b;
  957|       |
  958|   450k|		b = p[i];
  959|       |
  960|       |		/* Strip the MSB from the input byte and add the resulting
  961|       |		 * number to the `result`. */
  962|   450k|		if(archive_ckd_mul_u64(&val, b & 0x7F, multiplier) ||
  ------------------
  |  Branch (962:6): [True: 2.78k, False: 448k]
  ------------------
  963|   448k|		   archive_ckd_add_u64(&result, result, val)) {
  ------------------
  |  Branch (963:6): [True: 0, False: 448k]
  ------------------
  964|       |			/* Integer overflow occurred. */
  965|  2.78k|			return 0;
  966|  2.78k|		}
  967|       |
  968|       |		/* MSB set to 1 means we need to continue decoding process.
  969|       |		 * MSB set to 0 means we're done.
  970|       |		 *
  971|       |		 * This conditional checks for the second case. */
  972|   448k|		if((b & 0x80) == 0) {
  ------------------
  |  Branch (972:6): [True: 342k, False: 105k]
  ------------------
  973|   342k|			if(pvalue) {
  ------------------
  |  Branch (973:7): [True: 342k, False: 0]
  ------------------
  974|   342k|				*pvalue = result;
  975|   342k|			}
  976|       |
  977|       |			/* If the caller has passed the `pvalue_len` pointer,
  978|       |			 * store the number of consumed bytes in it and do NOT
  979|       |			 * consume those bytes, since the caller has all the
  980|       |			 * information it needs to perform */
  981|   342k|			if(pvalue_len) {
  ------------------
  |  Branch (981:7): [True: 195k, False: 146k]
  ------------------
  982|   195k|				*pvalue_len = 1 + i;
  983|   195k|			} else {
  984|       |				/* If the caller did not provide the
  985|       |				 * `pvalue_len` pointer, it will not have the
  986|       |				 * possibility to advance the file pointer,
  987|       |				 * because it will not know how many bytes it
  988|       |				 * needs to consume. This is why we handle
  989|       |				 * such situation here automatically. */
  990|   146k|				if(ARCHIVE_OK != consume(a, 1 + i)) {
  ------------------
  |  |  233|   146k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (990:8): [True: 0, False: 146k]
  ------------------
  991|      0|					return 0;
  992|      0|				}
  993|   146k|			}
  994|       |
  995|       |			/* End of decoding process, return success. */
  996|   342k|			return 1;
  997|   342k|		}
  998|   448k|	}
  999|       |
 1000|       |	/* All continuation bits were set. This is an error. */
 1001|    498|	return 0;
 1002|   345k|}
archive_read_support_format_rar5.c:process_head_main:
 2104|  2.55k|{
 2105|  2.55k|	int ret;
 2106|  2.55k|	uint64_t extra_data_size = 0;
 2107|  2.55k|	size_t extra_field_size = 0;
 2108|  2.55k|	size_t extra_field_id = 0;
 2109|  2.55k|	size_t archive_flags = 0;
 2110|       |
 2111|  2.55k|	enum MAIN_FLAGS {
 2112|  2.55k|		VOLUME = 0x0001,         /* multi-volume archive */
 2113|  2.55k|		VOLUME_NUMBER = 0x0002,  /* volume number, first vol doesn't
 2114|       |					  * have it */
 2115|  2.55k|		SOLID = 0x0004,          /* solid archive */
 2116|  2.55k|		PROTECT = 0x0008,        /* contains Recovery info */
 2117|  2.55k|		LOCK = 0x0010,           /* readonly flag, not used */
 2118|  2.55k|	};
 2119|       |
 2120|  2.55k|	enum MAIN_EXTRA {
 2121|       |		// Just one attribute here.
 2122|  2.55k|		LOCATOR = 0x01,
 2123|  2.55k|	};
 2124|       |
 2125|  2.55k|	(void) entry;
 2126|       |
 2127|  2.55k|	if(block_flags & HFL_EXTRA_DATA) {
  ------------------
  |  Branch (2127:5): [True: 2.10k, False: 444]
  ------------------
 2128|  2.10k|		if(!read_var(a, &extra_data_size, NULL))
  ------------------
  |  Branch (2128:6): [True: 2, False: 2.10k]
  ------------------
 2129|      2|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2130|  2.10k|	} else {
 2131|    444|		extra_data_size = 0;
 2132|    444|	}
 2133|       |
 2134|  2.55k|	if(!read_var_sized(a, &archive_flags, NULL)) {
  ------------------
  |  Branch (2134:5): [True: 2, False: 2.54k]
  ------------------
 2135|      2|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2136|      2|	}
 2137|       |
 2138|  2.54k|	rar5->main.volume = (archive_flags & VOLUME) > 0;
 2139|  2.54k|	rar5->main.solid = (archive_flags & SOLID) > 0;
 2140|       |
 2141|  2.54k|	if(archive_flags & VOLUME_NUMBER) {
  ------------------
  |  Branch (2141:5): [True: 646, False: 1.90k]
  ------------------
 2142|    646|		size_t v = 0;
 2143|    646|		if(!read_var_sized(a, &v, NULL)) {
  ------------------
  |  Branch (2143:6): [True: 1, False: 645]
  ------------------
 2144|      1|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2145|      1|		}
 2146|       |
 2147|    645|		if (v > UINT_MAX) {
  ------------------
  |  Branch (2147:7): [True: 3, False: 642]
  ------------------
 2148|      3|			archive_set_error(&a->archive,
 2149|      3|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2150|      3|			    "Invalid volume number");
 2151|      3|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2152|      3|		}
 2153|       |
 2154|    642|		rar5->main.vol_no = (unsigned int) v;
 2155|  1.90k|	} else {
 2156|  1.90k|		rar5->main.vol_no = 0;
 2157|  1.90k|	}
 2158|       |
 2159|  2.54k|	if(rar5->vol.expected_vol_no > 0 &&
  ------------------
  |  Branch (2159:5): [True: 11, False: 2.53k]
  ------------------
 2160|     11|		rar5->main.vol_no != rar5->vol.expected_vol_no)
  ------------------
  |  Branch (2160:3): [True: 7, False: 4]
  ------------------
 2161|      7|	{
 2162|       |		/* Returning EOF instead of FATAL because of strange
 2163|       |		 * libarchive behavior. When opening multiple files via
 2164|       |		 * archive_read_open_filenames(), after reading up the whole
 2165|       |		 * last file, the __archive_read_ahead function wraps up to
 2166|       |		 * the first archive instead of returning EOF. */
 2167|      7|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      7|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2168|      7|	}
 2169|       |
 2170|  2.53k|	if(extra_data_size == 0) {
  ------------------
  |  Branch (2170:5): [True: 439, False: 2.09k]
  ------------------
 2171|       |		/* Early return. */
 2172|    439|		return ARCHIVE_OK;
  ------------------
  |  |  233|    439|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2173|    439|	}
 2174|       |
 2175|  2.09k|	if(!read_var_sized(a, &extra_field_size, NULL)) {
  ------------------
  |  Branch (2175:5): [True: 3, False: 2.09k]
  ------------------
 2176|      3|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      3|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2177|      3|	}
 2178|       |
 2179|  2.09k|	if(!read_var_sized(a, &extra_field_id, NULL)) {
  ------------------
  |  Branch (2179:5): [True: 2, False: 2.09k]
  ------------------
 2180|      2|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2181|      2|	}
 2182|       |
 2183|  2.09k|	if(extra_field_size == 0) {
  ------------------
  |  Branch (2183:5): [True: 0, False: 2.09k]
  ------------------
 2184|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2185|      0|		    "Invalid extra field size");
 2186|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2187|      0|	}
 2188|       |
 2189|  2.09k|	switch(extra_field_id) {
 2190|  2.07k|		case LOCATOR:
  ------------------
  |  Branch (2190:3): [True: 2.07k, False: 21]
  ------------------
 2191|  2.07k|			ret = process_main_locator_extra_block(a, rar5);
 2192|  2.07k|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  2.07k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2192:7): [True: 4, False: 2.06k]
  ------------------
 2193|       |				/* Error while parsing main locator extra
 2194|       |				 * block. */
 2195|      4|				return ret;
 2196|      4|			}
 2197|       |
 2198|  2.06k|			break;
 2199|  2.06k|		default:
  ------------------
  |  Branch (2199:3): [True: 21, False: 2.07k]
  ------------------
 2200|     21|			archive_set_error(&a->archive,
 2201|     21|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     21|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2202|     21|			    "Unsupported extra type (0x%jx)",
 2203|     21|			    (uintmax_t)extra_field_id);
 2204|     21|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|     21|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2205|  2.09k|	}
 2206|       |
 2207|  2.06k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.06k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2208|  2.09k|}
archive_read_support_format_rar5.c:process_main_locator_extra_block:
 1221|  2.07k|{
 1222|  2.07k|	uint64_t locator_flags;
 1223|       |
 1224|  2.07k|	enum LOCATOR_FLAGS {
 1225|  2.07k|		QLIST = 0x01, RECOVERY = 0x02,
 1226|  2.07k|	};
 1227|       |
 1228|  2.07k|	if(!read_var(a, &locator_flags, NULL)) {
  ------------------
  |  Branch (1228:5): [True: 3, False: 2.06k]
  ------------------
 1229|      3|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      3|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1230|      3|	}
 1231|       |
 1232|  2.06k|	if(locator_flags & QLIST) {
  ------------------
  |  Branch (1232:5): [True: 318, False: 1.75k]
  ------------------
 1233|    318|		if(!read_var(a, &rar5->qlist_offset, NULL)) {
  ------------------
  |  Branch (1233:6): [True: 0, False: 318]
  ------------------
 1234|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1235|      0|		}
 1236|       |
 1237|       |		/* qlist is not used */
 1238|    318|	}
 1239|       |
 1240|  2.06k|	if(locator_flags & RECOVERY) {
  ------------------
  |  Branch (1240:5): [True: 213, False: 1.85k]
  ------------------
 1241|    213|		if(!read_var(a, &rar5->rr_offset, NULL)) {
  ------------------
  |  Branch (1241:6): [True: 1, False: 212]
  ------------------
 1242|      1|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1243|      1|		}
 1244|       |
 1245|       |		/* rr is not used */
 1246|    213|	}
 1247|       |
 1248|  2.06k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.06k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1249|  2.06k|}
archive_read_support_format_rar5.c:rar5_skip_remaining_block:
 2307|  6.83k|{
 2308|  6.83k|	const uint8_t* cur;
 2309|       |
 2310|  6.83k|	if(read_ahead(a, 1, &cur)) {
  ------------------
  |  Branch (2310:5): [True: 6.83k, False: 0]
  ------------------
 2311|  6.83k|		size_t body_used = (size_t)(cur - body_start);
 2312|       |
 2313|  6.83k|		if(body_used < raw_hdr_size)
  ------------------
  |  Branch (2313:6): [True: 4.44k, False: 2.39k]
  ------------------
 2314|  4.44k|			(void)consume(a, raw_hdr_size - body_used);
 2315|  6.83k|	}
 2316|  6.83k|}
archive_read_support_format_rar5.c:process_head_service:
 2083|  1.57k|{
 2084|       |	/* Process this SERVICE block the same way as FILE blocks. */
 2085|  1.57k|	int ret = process_head_file(a, rar5, entry, block_flags);
 2086|  1.57k|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  1.57k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2086:5): [True: 622, False: 948]
  ------------------
 2087|    622|		return ret;
 2088|       |
 2089|    948|	rar5->file.service = 1;
 2090|       |
 2091|       |	/* But skip the data part automatically. It's no use for the user
 2092|       |	 * anyway.  It contains only service data, not even needed to
 2093|       |	 * properly unpack the file. */
 2094|    948|	ret = rar5_read_data_skip(a);
 2095|    948|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|    948|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2095:5): [True: 10, False: 938]
  ------------------
 2096|     10|		return ret;
 2097|       |
 2098|       |	/* After skipping, try parsing another block automatically. */
 2099|    938|	return ARCHIVE_RETRY;
  ------------------
  |  |  234|    938|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2100|    948|}
archive_read_support_format_rar5.c:process_head_file:
 1755|  11.7k|{
 1756|  11.7k|	int64_t extra_data_size = 0;
 1757|  11.7k|	size_t data_size = 0;
 1758|  11.7k|	size_t file_flags = 0;
 1759|  11.7k|	size_t file_attr = 0;
 1760|  11.7k|	size_t compression_info = 0;
 1761|  11.7k|	size_t host_os = 0;
 1762|  11.7k|	size_t name_size = 0;
 1763|  11.7k|	uint64_t unpacked_size, window_size;
 1764|  11.7k|	uint32_t mtime = 0, crc = 0;
 1765|  11.7k|	int c_method = 0, c_version = 0;
 1766|  11.7k|	char name_utf8_buf[MAX_NAME_IN_BYTES];
 1767|  11.7k|	const uint8_t* p;
 1768|  11.7k|	int sanity_ret;
 1769|       |
 1770|  11.7k|	enum FILE_FLAGS {
 1771|  11.7k|		DIRECTORY = 0x0001, UTIME = 0x0002, CRC32 = 0x0004,
 1772|  11.7k|		UNKNOWN_UNPACKED_SIZE = 0x0008,
 1773|  11.7k|	};
 1774|       |
 1775|  11.7k|	enum FILE_ATTRS {
 1776|  11.7k|		ATTR_READONLY = 0x1, ATTR_HIDDEN = 0x2, ATTR_SYSTEM = 0x4,
 1777|  11.7k|		ATTR_DIRECTORY = 0x10,
 1778|  11.7k|	};
 1779|       |
 1780|  11.7k|	enum COMP_INFO_FLAGS {
 1781|  11.7k|		SOLID = 0x0040,
 1782|  11.7k|	};
 1783|       |
 1784|  11.7k|	enum HOST_OS {
 1785|  11.7k|		HOST_WINDOWS = 0,
 1786|  11.7k|		HOST_UNIX = 1,
 1787|  11.7k|	};
 1788|       |
 1789|  11.7k|	archive_entry_clear(entry);
 1790|       |
 1791|       |	/* Do not reset file context if we're switching archives. */
 1792|  11.7k|	if(!rar5->cstate.switch_multivolume) {
  ------------------
  |  Branch (1792:5): [True: 6.01k, False: 5.71k]
  ------------------
 1793|  6.01k|		reset_file_context(rar5);
 1794|  6.01k|	}
 1795|       |
 1796|  11.7k|	if(block_flags & HFL_EXTRA_DATA) {
  ------------------
  |  Branch (1796:5): [True: 8.92k, False: 2.80k]
  ------------------
 1797|  8.92k|		uint64_t edata_size = 0;
 1798|  8.92k|		if(!read_var(a, &edata_size, NULL))
  ------------------
  |  Branch (1798:6): [True: 2, False: 8.92k]
  ------------------
 1799|      2|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1800|       |
 1801|       |		/* Intentional type cast from unsigned to signed. */
 1802|  8.92k|		extra_data_size = (int64_t) edata_size;
 1803|  8.92k|	}
 1804|       |
 1805|  11.7k|	if(block_flags & HFL_DATA) {
  ------------------
  |  Branch (1805:5): [True: 11.3k, False: 352]
  ------------------
 1806|  11.3k|		if(!read_var_sized(a, &data_size, NULL))
  ------------------
  |  Branch (1806:6): [True: 10, False: 11.3k]
  ------------------
 1807|     10|			return ARCHIVE_EOF;
  ------------------
  |  |  232|     10|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1808|       |
 1809|  11.3k|		if(data_size > SSIZE_MAX) {
  ------------------
  |  Branch (1809:6): [True: 1, False: 11.3k]
  ------------------
 1810|      1|			archive_set_error(&a->archive,
 1811|      1|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1812|      1|			    "File data size is too large");
 1813|      1|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1814|      1|		}
 1815|       |
 1816|  11.3k|		rar5->file.bytes_remaining = data_size;
 1817|  11.3k|	} else {
 1818|    352|		rar5->file.bytes_remaining = 0;
 1819|    352|	}
 1820|       |
 1821|  11.7k|	if(!read_var_sized(a, &file_flags, NULL))
  ------------------
  |  Branch (1821:5): [True: 20, False: 11.6k]
  ------------------
 1822|     20|		return ARCHIVE_EOF;
  ------------------
  |  |  232|     20|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1823|       |
 1824|  11.6k|	if(!read_var(a, &unpacked_size, NULL))
  ------------------
  |  Branch (1824:5): [True: 97, False: 11.6k]
  ------------------
 1825|     97|		return ARCHIVE_EOF;
  ------------------
  |  |  232|     97|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1826|       |
 1827|  11.6k|	if(file_flags & UNKNOWN_UNPACKED_SIZE) {
  ------------------
  |  Branch (1827:5): [True: 7, False: 11.5k]
  ------------------
 1828|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      7|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1829|      7|		    "Files with unknown unpacked size are not supported");
 1830|      7|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1831|      7|	}
 1832|       |
 1833|  11.5k|	rar5->file.dir = (uint8_t) ((file_flags & DIRECTORY) > 0);
 1834|       |
 1835|  11.5k|	sanity_ret = file_entry_sanity_checks(a, block_flags, rar5->file.dir,
 1836|  11.5k|		unpacked_size, data_size);
 1837|       |
 1838|  11.5k|	if (sanity_ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  11.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1838:6): [True: 14, False: 11.5k]
  ------------------
 1839|     14|		return sanity_ret;
 1840|     14|	}
 1841|       |
 1842|  11.5k|	if(!read_var_sized(a, &file_attr, NULL))
  ------------------
  |  Branch (1842:5): [True: 510, False: 11.0k]
  ------------------
 1843|    510|		return ARCHIVE_EOF;
  ------------------
  |  |  232|    510|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1844|       |
 1845|  11.0k|	if(file_flags & UTIME) {
  ------------------
  |  Branch (1845:5): [True: 4.45k, False: 6.61k]
  ------------------
 1846|  4.45k|		if(!read_u32(a, &mtime))
  ------------------
  |  Branch (1846:6): [True: 1, False: 4.44k]
  ------------------
 1847|      1|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1848|  4.45k|	}
 1849|       |
 1850|  11.0k|	if(file_flags & CRC32) {
  ------------------
  |  Branch (1850:5): [True: 7.78k, False: 3.28k]
  ------------------
 1851|  7.78k|		if(!read_u32(a, &crc))
  ------------------
  |  Branch (1851:6): [True: 2, False: 7.78k]
  ------------------
 1852|      2|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1853|  7.78k|	}
 1854|       |
 1855|  11.0k|	if(!read_var_sized(a, &compression_info, NULL))
  ------------------
  |  Branch (1855:5): [True: 395, False: 10.6k]
  ------------------
 1856|    395|		return ARCHIVE_EOF;
  ------------------
  |  |  232|    395|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1857|       |
 1858|  10.6k|	c_method = (int) (compression_info >> 7) & 0x7;
 1859|  10.6k|	c_version = (int) (compression_info & 0x3f);
 1860|       |
 1861|       |	/* RAR5 seems to limit the dictionary size to 64MB. */
 1862|  10.6k|	window_size = (rar5->file.dir > 0) ?
  ------------------
  |  Branch (1862:16): [True: 590, False: 10.0k]
  ------------------
 1863|    590|		0 :
 1864|  10.6k|		g_unpack_window_size << ((compression_info >> 10) & 15);
 1865|  10.6k|	rar5->cstate.method = c_method;
 1866|  10.6k|	rar5->cstate.version = c_version + 50;
 1867|  10.6k|	rar5->file.solid = (compression_info & SOLID) > 0;
 1868|       |
 1869|       |	/* Archives which declare solid files without initializing the window
 1870|       |	 * buffer first are invalid, unless previous data was encrypted, in
 1871|       |	 * which case we may never have had the chance */
 1872|       |
 1873|  10.6k|	if(rar5->file.solid > 0 && rar5->cstate.data_encrypted == 0 &&
  ------------------
  |  Branch (1873:5): [True: 666, False: 10.0k]
  |  Branch (1873:29): [True: 109, False: 557]
  ------------------
 1874|    109|	    rar5->cstate.window_buf == NULL) {
  ------------------
  |  Branch (1874:6): [True: 2, False: 107]
  ------------------
 1875|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1876|      2|				  "Declared solid file, but no window buffer "
 1877|      2|				  "initialized yet");
 1878|      2|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1879|      2|	}
 1880|       |
 1881|       |	/* Check if window_size is a sane value. Also, if the file is not
 1882|       |	 * declared as a directory, disallow window_size == 0. */
 1883|  10.6k|	if(window_size > (64 * 1024 * 1024) ||
  ------------------
  |  Branch (1883:5): [True: 1, False: 10.6k]
  ------------------
 1884|  10.6k|	    (rar5->file.dir == 0 && window_size == 0))
  ------------------
  |  Branch (1884:7): [True: 10.0k, False: 589]
  |  Branch (1884:30): [True: 0, False: 10.0k]
  ------------------
 1885|      1|	{
 1886|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1887|      1|		    "Declared dictionary size is not supported");
 1888|      1|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1889|      1|	}
 1890|       |
 1891|  10.6k|	if(rar5->file.solid > 0) {
  ------------------
  |  Branch (1891:5): [True: 664, False: 10.0k]
  ------------------
 1892|       |		/* Re-check if current window size is the same as previous
 1893|       |		 * window size (for solid files only). */
 1894|    664|		if(rar5->file.solid_window_size > 0 &&
  ------------------
  |  Branch (1894:6): [True: 361, False: 303]
  ------------------
 1895|    361|		    rar5->file.solid_window_size != (ssize_t) window_size)
  ------------------
  |  Branch (1895:7): [True: 2, False: 359]
  ------------------
 1896|      2|		{
 1897|      2|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1898|      2|			    "Window size for this solid file doesn't match "
 1899|      2|			    "the window size used in previous solid file");
 1900|      2|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1901|      2|		}
 1902|    664|	}
 1903|  10.0k|	else
 1904|  10.0k|		rar5->cstate.data_encrypted = 0; /* Reset for new buffer */
 1905|       |
 1906|  10.6k|	if(rar5->cstate.window_size < (ssize_t) window_size &&
  ------------------
  |  Branch (1906:5): [True: 2.18k, False: 8.48k]
  ------------------
 1907|  2.18k|	    rar5->cstate.window_buf)
  ------------------
  |  Branch (1907:6): [True: 168, False: 2.01k]
  ------------------
 1908|    168|	{
 1909|       |		/* The `data_ready` stack contains pointers to the `window_buf` or
 1910|       |		 * `filtered_buf` buffers.  Since we're about to reallocate the first
 1911|       |		 * buffer, some of those pointers could become invalid. Therefore, we
 1912|       |		 * need to dispose of all entries from the stack before attempting the
 1913|       |		 * realloc. */
 1914|    168|		clear_data_ready_stack(rar5);
 1915|       |
 1916|       |		/* If window_buf has been allocated before, reallocate it, so
 1917|       |		 * that its size will match new window_size. */
 1918|       |
 1919|    168|		uint8_t* new_window_buf =
 1920|    168|			realloc(rar5->cstate.window_buf, (size_t) window_size);
 1921|       |
 1922|    168|		if(!new_window_buf) {
  ------------------
  |  Branch (1922:6): [True: 0, False: 168]
  ------------------
 1923|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1924|      0|				"Not enough memory when trying to realloc the window "
 1925|      0|				"buffer");
 1926|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1927|      0|		}
 1928|       |
 1929|    168|		rar5->cstate.window_buf = new_window_buf;
 1930|    168|	}
 1931|       |
 1932|       |	/* Values up to 64M should fit into ssize_t on every
 1933|       |	 * architecture. */
 1934|  10.6k|	rar5->cstate.window_size = (ssize_t) window_size;
 1935|       |
 1936|  10.6k|	if(rar5->file.solid > 0 && rar5->file.solid_window_size == 0) {
  ------------------
  |  Branch (1936:5): [True: 662, False: 10.0k]
  |  Branch (1936:29): [True: 303, False: 359]
  ------------------
 1937|       |		/* Solid files have to have the same window_size across
 1938|       |		   whole archive. Remember the window_size parameter
 1939|       |		   for first solid file found. */
 1940|    303|		rar5->file.solid_window_size = rar5->cstate.window_size;
 1941|    303|	}
 1942|       |
 1943|  10.6k|	init_window_mask(rar5);
 1944|       |
 1945|  10.6k|	rar5->file.service = 0;
 1946|       |
 1947|  10.6k|	if(!read_var_sized(a, &host_os, NULL))
  ------------------
  |  Branch (1947:5): [True: 171, False: 10.4k]
  ------------------
 1948|    171|		return ARCHIVE_EOF;
  ------------------
  |  |  232|    171|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1949|       |
 1950|  10.4k|	if(host_os == HOST_WINDOWS) {
  ------------------
  |  Branch (1950:5): [True: 8.18k, False: 2.30k]
  ------------------
 1951|       |		/* Host OS is Windows */
 1952|       |
 1953|  8.18k|		__LA_MODE_T mode;
  ------------------
  |  |  102|  8.18k|# define	__LA_MODE_T	mode_t
  ------------------
 1954|       |
 1955|  8.18k|		if(file_attr & ATTR_DIRECTORY) {
  ------------------
  |  Branch (1955:6): [True: 1.90k, False: 6.28k]
  ------------------
 1956|  1.90k|			if (file_attr & ATTR_READONLY) {
  ------------------
  |  Branch (1956:8): [True: 970, False: 933]
  ------------------
 1957|    970|				mode = 0555 | AE_IFDIR;
  ------------------
  |  |  221|    970|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1958|    970|			} else {
 1959|    933|				mode = 0755 | AE_IFDIR;
  ------------------
  |  |  221|    933|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1960|    933|			}
 1961|  6.28k|		} else {
 1962|  6.28k|			if (file_attr & ATTR_READONLY) {
  ------------------
  |  Branch (1962:8): [True: 3.06k, False: 3.22k]
  ------------------
 1963|  3.06k|				mode = 0444 | AE_IFREG;
  ------------------
  |  |  216|  3.06k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1964|  3.22k|			} else {
 1965|  3.22k|				mode = 0644 | AE_IFREG;
  ------------------
  |  |  216|  3.22k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1966|  3.22k|			}
 1967|  6.28k|		}
 1968|       |
 1969|  8.18k|		archive_entry_set_mode(entry, mode);
 1970|       |
 1971|  8.18k|		if (file_attr & (ATTR_READONLY | ATTR_HIDDEN | ATTR_SYSTEM)) {
  ------------------
  |  Branch (1971:7): [True: 5.34k, False: 2.84k]
  ------------------
 1972|  5.34k|			char buf[sizeof(",rdonly,hidden,system")];
 1973|  5.34k|			const char *fflags[3] = { "", "", "" };
 1974|  5.34k|			const char **flag = fflags;
 1975|       |
 1976|  5.34k|			if (file_attr & ATTR_READONLY)
  ------------------
  |  Branch (1976:8): [True: 4.03k, False: 1.31k]
  ------------------
 1977|  4.03k|				*flag++ = ",rdonly";
 1978|  5.34k|			if (file_attr & ATTR_HIDDEN)
  ------------------
  |  Branch (1978:8): [True: 2.31k, False: 3.03k]
  ------------------
 1979|  2.31k|				*flag++ = ",hidden";
 1980|  5.34k|			if (file_attr & ATTR_SYSTEM)
  ------------------
  |  Branch (1980:8): [True: 1.37k, False: 3.97k]
  ------------------
 1981|  1.37k|				*flag++ = ",system";
 1982|       |
 1983|  5.34k|			snprintf(buf, sizeof(buf), "%s%s%s",
 1984|  5.34k|			    fflags[0], fflags[1], fflags[2]);
 1985|  5.34k|			archive_entry_copy_fflags_text(entry, buf + 1);
 1986|  5.34k|		}
 1987|  8.18k|	} else if(host_os == HOST_UNIX) {
  ------------------
  |  Branch (1987:12): [True: 2.27k, False: 30]
  ------------------
 1988|       |		/* Host OS is Unix */
 1989|  2.27k|		archive_entry_set_mode(entry, (__LA_MODE_T) file_attr);
 1990|  2.27k|	} else {
 1991|       |		/* Unknown host OS */
 1992|     30|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     30|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1993|     30|				"Unsupported Host OS: 0x%jx",
 1994|     30|				(uintmax_t)host_os);
 1995|       |
 1996|     30|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     30|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1997|     30|	}
 1998|       |
 1999|  10.4k|	if(!read_var_sized(a, &name_size, NULL))
  ------------------
  |  Branch (1999:5): [True: 761, False: 9.70k]
  ------------------
 2000|    761|		return ARCHIVE_EOF;
  ------------------
  |  |  232|    761|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2001|       |
 2002|  9.70k|	if(name_size > (MAX_NAME_IN_CHARS - 1)) {
  ------------------
  |  |  100|  9.70k|#define MAX_NAME_IN_CHARS 2048
  ------------------
  |  Branch (2002:5): [True: 5, False: 9.69k]
  ------------------
 2003|      5|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      5|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2004|      5|				"Filename is too long");
 2005|       |
 2006|      5|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2007|      5|	}
 2008|       |
 2009|  9.69k|	if(name_size == 0) {
  ------------------
  |  Branch (2009:5): [True: 7, False: 9.69k]
  ------------------
 2010|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      7|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2011|      7|				"No filename specified");
 2012|       |
 2013|      7|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2014|      7|	}
 2015|       |
 2016|  9.69k|	if(!read_ahead(a, name_size, &p))
  ------------------
  |  Branch (2016:5): [True: 34, False: 9.65k]
  ------------------
 2017|     34|		return ARCHIVE_EOF;
  ------------------
  |  |  232|     34|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2018|       |
 2019|  9.65k|	memcpy(name_utf8_buf, p, name_size);
 2020|  9.65k|	name_utf8_buf[name_size] = 0;
 2021|  9.65k|	if(ARCHIVE_OK != consume(a, name_size)) {
  ------------------
  |  |  233|  9.65k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2021:5): [True: 0, False: 9.65k]
  ------------------
 2022|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 2023|      0|	}
 2024|       |
 2025|  9.65k|	archive_entry_update_pathname_utf8(entry, name_utf8_buf);
 2026|       |
 2027|  9.65k|	if(extra_data_size > 0) {
  ------------------
  |  Branch (2027:5): [True: 5.41k, False: 4.23k]
  ------------------
 2028|  5.41k|		int ret = process_head_file_extra(a, entry, rar5,
 2029|  5.41k|		    extra_data_size);
 2030|       |
 2031|       |		/*
 2032|       |		 * TODO: rewrite or remove useless sanity check
 2033|       |		 *       as extra_data_size is not passed as a pointer
 2034|       |		 *
 2035|       |		if(extra_data_size < 0) {
 2036|       |			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
 2037|       |			    "File extra data size is not zero");
 2038|       |			return ARCHIVE_FATAL;
 2039|       |		}
 2040|       |		 */
 2041|       |
 2042|  5.41k|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  5.41k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2042:6): [True: 2.46k, False: 2.95k]
  ------------------
 2043|  2.46k|			return ret;
 2044|  5.41k|	}
 2045|       |
 2046|  7.19k|	if((file_flags & UNKNOWN_UNPACKED_SIZE) == 0) {
  ------------------
  |  Branch (2046:5): [True: 7.19k, False: 0]
  ------------------
 2047|  7.19k|		rar5->file.unpacked_size = (ssize_t) unpacked_size;
 2048|  7.19k|		if(rar5->file.redir_type == REDIR_TYPE_NONE)
  ------------------
  |  Branch (2048:6): [True: 6.10k, False: 1.09k]
  ------------------
 2049|  6.10k|			archive_entry_set_size(entry, unpacked_size);
 2050|  7.19k|	}
 2051|       |
 2052|  7.19k|	if(file_flags & UTIME) {
  ------------------
  |  Branch (2052:5): [True: 1.29k, False: 5.90k]
  ------------------
 2053|  1.29k|		archive_entry_set_mtime(entry, (time_t) mtime, 0);
 2054|  1.29k|	}
 2055|       |
 2056|  7.19k|	if(file_flags & CRC32) {
  ------------------
  |  Branch (2056:5): [True: 4.60k, False: 2.59k]
  ------------------
 2057|  4.60k|		rar5->file.stored_crc32 = crc;
 2058|  4.60k|	}
 2059|       |
 2060|  7.19k|	if(!rar5->cstate.switch_multivolume) {
  ------------------
  |  Branch (2060:5): [True: 5.24k, False: 1.94k]
  ------------------
 2061|       |		/* Do not reinitialize unpacking state if we're switching
 2062|       |		 * archives. */
 2063|  5.24k|		rar5->cstate.block_parsing_finished = 1;
 2064|  5.24k|		rar5->cstate.all_filters_applied = 1;
 2065|  5.24k|		rar5->cstate.initialized = 0;
 2066|  5.24k|	}
 2067|       |
 2068|  7.19k|	if(rar5->generic.split_before > 0) {
  ------------------
  |  Branch (2068:5): [True: 1.08k, False: 6.11k]
  ------------------
 2069|       |		/* If now we're standing on a header that has a 'split before'
 2070|       |		 * mark, it means we're standing on a 'continuation' file
 2071|       |		 * header. Signal the caller that if it wants to move to
 2072|       |		 * another file, it must call rar5_read_header() function
 2073|       |		 * again. */
 2074|       |
 2075|  1.08k|		return ARCHIVE_RETRY;
  ------------------
  |  |  234|  1.08k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2076|  6.11k|	} else {
 2077|  6.11k|		return ARCHIVE_OK;
  ------------------
  |  |  233|  6.11k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2078|  6.11k|	}
 2079|  7.19k|}
archive_read_support_format_rar5.c:reset_file_context:
  882|  6.01k|static void reset_file_context(struct rar5 *rar5) {
  883|  6.01k|	memset(&rar5->file, 0, sizeof(rar5->file));
  884|  6.01k|	blake2sp_init(&rar5->file.b2state, 32);
  ------------------
  |  |   30|  6.01k|#define blake2sp_init __archive_blake2sp_init
  ------------------
  885|       |
  886|  6.01k|	if(rar5->main.solid) {
  ------------------
  |  Branch (886:5): [True: 2.56k, False: 3.45k]
  ------------------
  887|  2.56k|		rar5->cstate.solid_offset += rar5->cstate.write_ptr;
  888|  3.45k|	} else {
  889|  3.45k|		rar5->cstate.solid_offset = 0;
  890|  3.45k|	}
  891|       |
  892|  6.01k|	rar5->cstate.write_ptr = 0;
  893|  6.01k|	rar5->cstate.last_write_ptr = 0;
  894|  6.01k|	rar5->cstate.last_unstore_ptr = 0;
  895|       |
  896|  6.01k|	rar5->file.redir_type = REDIR_TYPE_NONE;
  897|  6.01k|	rar5->file.redir_flags = 0;
  898|       |
  899|  6.01k|	free_filters(rar5);
  900|  6.01k|}
archive_read_support_format_rar5.c:free_filters:
  857|  22.7k|static void free_filters(struct rar5 *rar5) {
  858|  22.7k|	struct cdeque* d = &rar5->cstate.filters;
  859|       |
  860|       |	/* Free any remaining filters. All filters should be naturally
  861|       |	 * consumed by the unpacking function, so remaining filters after
  862|       |	 * unpacking normally mean that unpacking wasn't successful.
  863|       |	 * But still of course we shouldn't leak memory in such case. */
  864|       |
  865|       |	/* cdeque_size() is a fast operation, so we can use it as a loop
  866|       |	 * expression. */
  867|  23.5k|	while(cdeque_size(d) > 0) {
  ------------------
  |  Branch (867:8): [True: 796, False: 22.7k]
  ------------------
  868|    796|		struct filter_info* f = NULL;
  869|       |
  870|       |		/* Pop_front will also decrease the collection's size. */
  871|    796|		if (CDE_OK == cdeque_pop_front(d, cdeque_filter_p(&f)))
  ------------------
  |  Branch (871:7): [True: 796, False: 0]
  ------------------
  872|    796|			free(f);
  873|    796|	}
  874|       |
  875|  22.7k|	cdeque_clear(d);
  876|       |
  877|       |	/* Also clear out the variables needed for sanity checking. */
  878|  22.7k|	rar5->cstate.last_block_start = 0;
  879|  22.7k|	rar5->cstate.last_block_length = 0;
  880|  22.7k|}
archive_read_support_format_rar5.c:cdeque_size:
  423|  37.5k|static size_t cdeque_size(struct cdeque* d) {
  424|  37.5k|	return d->size;
  425|  37.5k|}
archive_read_support_format_rar5.c:cdeque_pop_front:
  469|  3.40k|static int cdeque_pop_front(struct cdeque* d, void** value) {
  470|  3.40k|	if(!d || !value)
  ------------------
  |  Branch (470:5): [True: 0, False: 3.40k]
  |  Branch (470:11): [True: 0, False: 3.40k]
  ------------------
  471|      0|		return CDE_PARAM;
  472|       |
  473|  3.40k|	if(d->size == 0)
  ------------------
  |  Branch (473:5): [True: 0, False: 3.40k]
  ------------------
  474|      0|		return CDE_OUT_OF_BOUNDS;
  475|       |
  476|  3.40k|	cdeque_pop_front_fast(d, value);
  477|  3.40k|	return CDE_OK;
  478|  3.40k|}
archive_read_support_format_rar5.c:cdeque_pop_front_fast:
  461|  3.40k|static void cdeque_pop_front_fast(struct cdeque* d, void** value) {
  462|  3.40k|	*value = (void*) d->arr[d->beg_pos];
  463|  3.40k|	d->beg_pos = (d->beg_pos + 1) & d->cap_mask;
  464|  3.40k|	d->size--;
  465|  3.40k|}
archive_read_support_format_rar5.c:cdeque_filter_p:
  481|  23.6k|static void** cdeque_filter_p(struct filter_info** f) {
  482|  23.6k|	return (void**) (size_t) f;
  483|  23.6k|}
archive_read_support_format_rar5.c:file_entry_sanity_checks:
 1729|  11.5k|{
 1730|  11.5k|	if (is_dir) {
  ------------------
  |  Branch (1730:6): [True: 601, False: 10.9k]
  ------------------
 1731|    601|		const int declares_data_size =
 1732|    601|			(int) (unpacked_size != 0 || packed_size != 0);
  ------------------
  |  Branch (1732:11): [True: 9, False: 592]
  |  Branch (1732:33): [True: 1, False: 591]
  ------------------
 1733|       |
 1734|       |		/* FILE entries for directories still declare HFL_DATA in block flags,
 1735|       |		   even though attaching data to such blocks doesn't make much sense. */
 1736|    601|		if (declares_data_size) {
  ------------------
  |  Branch (1736:7): [True: 10, False: 591]
  ------------------
 1737|     10|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     10|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1738|     10|				"directory entries cannot have any data");
 1739|     10|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|     10|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1740|     10|		}
 1741|  10.9k|	} else {
 1742|  10.9k|		const int declares_hfl_data = (int) ((block_flags & HFL_DATA) != 0);
 1743|  10.9k|		if (!declares_hfl_data) {
  ------------------
  |  Branch (1743:7): [True: 4, False: 10.9k]
  ------------------
 1744|      4|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1745|      4|					"no data found in file/service block");
 1746|      4|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1747|      4|		}
 1748|  10.9k|	}
 1749|       |
 1750|  11.5k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  11.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1751|  11.5k|}
archive_read_support_format_rar5.c:clear_data_ready_stack:
 3896|  20.6k|static void clear_data_ready_stack(struct rar5 *rar5) {
 3897|  20.6k|	memset(&rar5->cstate.dready, 0, sizeof(rar5->cstate.dready));
 3898|  20.6k|}
archive_read_support_format_rar5.c:init_window_mask:
 1202|  11.8k|static void init_window_mask(struct rar5 *rar5) {
 1203|  11.8k|	if (rar5->cstate.window_size)
  ------------------
  |  Branch (1203:6): [True: 11.2k, False: 590]
  ------------------
 1204|  11.2k|		rar5->cstate.window_mask = rar5->cstate.window_size - 1;
 1205|    590|	else
 1206|    590|		rar5->cstate.window_mask = 0;
 1207|  11.8k|}
archive_read_support_format_rar5.c:process_head_file_extra:
 1639|  5.41k|{
 1640|  5.41k|	uint64_t extra_field_size;
 1641|  5.41k|	uint64_t extra_field_id = 0;
 1642|  5.41k|	uint64_t var_size;
 1643|       |
 1644|  48.0k|	while(extra_data_size > 0) {
  ------------------
  |  Branch (1644:8): [True: 45.0k, False: 2.99k]
  ------------------
 1645|       |		/* Make sure we won't fail if the file declares only unsupported
 1646|       |		attributes. */
 1647|  45.0k|		int ret = ARCHIVE_OK;
  ------------------
  |  |  233|  45.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1648|       |
 1649|  45.0k|		if(!read_var(a, &extra_field_size, &var_size))
  ------------------
  |  Branch (1649:6): [True: 280, False: 44.8k]
  ------------------
 1650|    280|			return ARCHIVE_EOF;
  ------------------
  |  |  232|    280|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1651|       |
 1652|  44.8k|		extra_data_size -= var_size;
 1653|  44.8k|		if(ARCHIVE_OK != consume(a, var_size)) {
  ------------------
  |  |  233|  44.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1653:6): [True: 0, False: 44.8k]
  ------------------
 1654|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1655|      0|		}
 1656|       |
 1657|  44.8k|		if(!read_var(a, &extra_field_id, &var_size))
  ------------------
  |  Branch (1657:6): [True: 490, False: 44.3k]
  ------------------
 1658|    490|			return ARCHIVE_EOF;
  ------------------
  |  |  232|    490|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1659|       |
 1660|  44.3k|		extra_field_size -= var_size;
 1661|  44.3k|		extra_data_size -= var_size;
 1662|  44.3k|		if(ARCHIVE_OK != consume(a, var_size)) {
  ------------------
  |  |  233|  44.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1662:6): [True: 0, False: 44.3k]
  ------------------
 1663|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1664|      0|		}
 1665|       |
 1666|  44.3k|		switch(extra_field_id) {
 1667|    996|			case EX_HASH:
  ------------------
  |  Branch (1667:4): [True: 996, False: 43.3k]
  ------------------
 1668|    996|				ret = parse_file_extra_hash(a, rar5,
 1669|    996|				    &extra_data_size);
 1670|    996|				break;
 1671|  3.37k|			case EX_HTIME:
  ------------------
  |  Branch (1671:4): [True: 3.37k, False: 40.9k]
  ------------------
 1672|  3.37k|				ret = parse_file_extra_htime(a, e, rar5,
 1673|  3.37k|				    &extra_data_size);
 1674|  3.37k|				break;
 1675|  6.40k|			case EX_REDIR:
  ------------------
  |  Branch (1675:4): [True: 6.40k, False: 37.9k]
  ------------------
 1676|  6.40k|				ret = parse_file_extra_redir(a, e, rar5,
 1677|  6.40k|				    &extra_data_size);
 1678|  6.40k|				break;
 1679|  1.43k|			case EX_UOWNER:
  ------------------
  |  Branch (1679:4): [True: 1.43k, False: 42.8k]
  ------------------
 1680|  1.43k|				ret = parse_file_extra_owner(a, e,
 1681|  1.43k|				    &extra_data_size);
 1682|  1.43k|				break;
 1683|  27.6k|			case EX_VERSION:
  ------------------
  |  Branch (1683:4): [True: 27.6k, False: 16.6k]
  ------------------
 1684|  27.6k|				ret = parse_file_extra_version(a, e,
 1685|  27.6k|				    &extra_data_size);
 1686|  27.6k|				break;
 1687|    605|			case EX_CRYPT:
  ------------------
  |  Branch (1687:4): [True: 605, False: 43.7k]
  ------------------
 1688|       |				/* Mark the entry as encrypted */
 1689|    605|				archive_entry_set_is_data_encrypted(e, 1);
 1690|    605|				rar5->has_encrypted_entries = 1;
 1691|    605|				rar5->cstate.data_encrypted = 1;
 1692|       |				/* fallthrough */
 1693|    743|			case EX_SUBDATA:
  ------------------
  |  Branch (1693:4): [True: 138, False: 44.1k]
  ------------------
 1694|       |				/* fallthrough */
 1695|  4.45k|			default:
  ------------------
  |  Branch (1695:4): [True: 3.70k, False: 40.6k]
  ------------------
 1696|       |				/* Skip unsupported entry. */
 1697|  4.45k|				extra_data_size -= extra_field_size;
 1698|  4.45k|				if (ARCHIVE_OK != consume(a, extra_field_size)) {
  ------------------
  |  |  233|  4.45k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1698:9): [True: 676, False: 3.77k]
  ------------------
 1699|    676|					return ARCHIVE_EOF;
  ------------------
  |  |  232|    676|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1700|    676|				}
 1701|       |
 1702|       |				/* Don't fail on unsupported attribute -- we've handled it
 1703|       |				   by skipping over it. */
 1704|  3.77k|				ret = ARCHIVE_OK;
  ------------------
  |  |  233|  3.77k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1705|  44.3k|		}
 1706|       |
 1707|  43.6k|		if (ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  43.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1707:7): [True: 979, False: 42.6k]
  ------------------
 1708|       |			/* Forward any errors signalled by the attribute parsing
 1709|       |			   functions. */
 1710|    979|			return ret;
 1711|    979|		}
 1712|  43.6k|	}
 1713|       |
 1714|  2.99k|	if (extra_data_size != 0) {
  ------------------
  |  Branch (1714:6): [True: 36, False: 2.95k]
  ------------------
 1715|       |		/* We didn't skip everything, or we skipped too much; either way,
 1716|       |		   there's an error in this parsing function. */
 1717|       |
 1718|     36|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|     36|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1719|     36|				"unsupported structure of file header extra data");
 1720|     36|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     36|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1721|     36|	}
 1722|       |
 1723|  2.95k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.95k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1724|  2.99k|}
archive_read_support_format_rar5.c:parse_file_extra_hash:
 1253|    996|{
 1254|    996|	size_t hash_type = 0;
 1255|    996|	size_t value_len;
 1256|       |
 1257|    996|	enum HASH_TYPE {
 1258|    996|		BLAKE2sp = 0x00
 1259|    996|	};
 1260|       |
 1261|    996|	if(!read_var_sized(a, &hash_type, &value_len))
  ------------------
  |  Branch (1261:5): [True: 1, False: 995]
  ------------------
 1262|      1|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1263|       |
 1264|    995|	*extra_data_size -= value_len;
 1265|    995|	if(ARCHIVE_OK != consume(a, value_len)) {
  ------------------
  |  |  233|    995|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1265:5): [True: 0, False: 995]
  ------------------
 1266|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1267|      0|	}
 1268|       |
 1269|       |	/* The file uses BLAKE2sp checksum algorithm instead of plain old
 1270|       |	 * CRC32. */
 1271|    995|	if(hash_type == BLAKE2sp) {
  ------------------
  |  Branch (1271:5): [True: 984, False: 11]
  ------------------
 1272|    984|		const uint8_t* p;
 1273|    984|		const int hash_size = sizeof(rar5->file.blake2sp);
  ------------------
  |  |   28|    984|#define blake2sp __archive_blake2sp
  ------------------
 1274|       |
 1275|    984|		if(!read_ahead(a, hash_size, &p))
  ------------------
  |  Branch (1275:6): [True: 3, False: 981]
  ------------------
 1276|      3|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      3|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1277|       |
 1278|    981|		rar5->file.has_blake2 = 1;
 1279|    981|		memcpy(&rar5->file.blake2sp, p, hash_size);
  ------------------
  |  |   28|    981|#define blake2sp __archive_blake2sp
  ------------------
 1280|       |
 1281|    981|		if(ARCHIVE_OK != consume(a, hash_size)) {
  ------------------
  |  |  233|    981|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1281:6): [True: 0, False: 981]
  ------------------
 1282|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1283|      0|		}
 1284|       |
 1285|    981|		*extra_data_size -= hash_size;
 1286|    981|	} else {
 1287|     11|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     11|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1288|     11|		    "Unsupported hash type (0x%jx)", (uintmax_t)hash_type);
 1289|     11|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     11|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1290|     11|	}
 1291|       |
 1292|    981|	return ARCHIVE_OK;
  ------------------
  |  |  233|    981|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1293|    995|}
archive_read_support_format_rar5.c:parse_file_extra_htime:
 1373|  3.37k|{
 1374|  3.37k|	char unix_time, has_unix_ns, has_mtime, has_ctime, has_atime;
 1375|  3.37k|	size_t flags = 0;
 1376|  3.37k|	size_t value_len;
 1377|  3.37k|	int ret;
 1378|       |
 1379|  3.37k|	enum HTIME_FLAGS {
 1380|  3.37k|		IS_UNIX       = 0x01,
 1381|  3.37k|		HAS_MTIME     = 0x02,
 1382|  3.37k|		HAS_CTIME     = 0x04,
 1383|  3.37k|		HAS_ATIME     = 0x08,
 1384|  3.37k|		HAS_UNIX_NS   = 0x10,
 1385|  3.37k|	};
 1386|       |
 1387|  3.37k|	if(!read_var_sized(a, &flags, &value_len))
  ------------------
  |  Branch (1387:5): [True: 3, False: 3.37k]
  ------------------
 1388|      3|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      3|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1389|       |
 1390|  3.37k|	*extra_data_size -= value_len;
 1391|  3.37k|	if(ARCHIVE_OK != consume(a, value_len)) {
  ------------------
  |  |  233|  3.37k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1391:5): [True: 0, False: 3.37k]
  ------------------
 1392|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1393|      0|	}
 1394|       |
 1395|  3.37k|	unix_time = flags & IS_UNIX;
 1396|  3.37k|	has_unix_ns = unix_time && (flags & HAS_UNIX_NS);
  ------------------
  |  Branch (1396:16): [True: 2.71k, False: 654]
  |  Branch (1396:29): [True: 2.10k, False: 614]
  ------------------
 1397|  3.37k|	has_mtime = flags & HAS_MTIME;
 1398|  3.37k|	has_atime = flags & HAS_ATIME;
 1399|  3.37k|	has_ctime = flags & HAS_CTIME;
 1400|  3.37k|	rar5->file.e_atime_ns = rar5->file.e_ctime_ns = rar5->file.e_mtime_ns = 0;
 1401|       |
 1402|  3.37k|	if(has_mtime) {
  ------------------
  |  Branch (1402:5): [True: 2.74k, False: 626]
  ------------------
 1403|  2.74k|		ret = parse_htime_item(a, unix_time, &rar5->file.e_mtime,
 1404|  2.74k|		    &rar5->file.e_mtime_ns, extra_data_size);
 1405|  2.74k|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  2.74k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1405:6): [True: 2, False: 2.74k]
  ------------------
 1406|      2|			return ret;
 1407|  2.74k|	}
 1408|       |
 1409|  3.37k|	if(has_ctime) {
  ------------------
  |  Branch (1409:5): [True: 511, False: 2.85k]
  ------------------
 1410|    511|		ret = parse_htime_item(a, unix_time, &rar5->file.e_ctime,
 1411|    511|		    &rar5->file.e_ctime_ns, extra_data_size);
 1412|    511|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|    511|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1412:6): [True: 3, False: 508]
  ------------------
 1413|      3|			return ret;
 1414|    511|	}
 1415|       |
 1416|  3.36k|	if(has_atime) {
  ------------------
  |  Branch (1416:5): [True: 442, False: 2.92k]
  ------------------
 1417|    442|		ret = parse_htime_item(a, unix_time, &rar5->file.e_atime,
 1418|    442|		    &rar5->file.e_atime_ns, extra_data_size);
 1419|    442|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|    442|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1419:6): [True: 5, False: 437]
  ------------------
 1420|      5|			return ret;
 1421|    442|	}
 1422|       |
 1423|  3.36k|	if(has_mtime && has_unix_ns) {
  ------------------
  |  Branch (1423:5): [True: 2.73k, False: 626]
  |  Branch (1423:18): [True: 1.92k, False: 815]
  ------------------
 1424|  1.92k|		if(!read_u32(a, &rar5->file.e_mtime_ns))
  ------------------
  |  Branch (1424:6): [True: 0, False: 1.92k]
  ------------------
 1425|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1426|       |
 1427|  1.92k|		*extra_data_size -= 4;
 1428|  1.92k|	}
 1429|       |
 1430|  3.36k|	if(has_ctime && has_unix_ns) {
  ------------------
  |  Branch (1430:5): [True: 503, False: 2.85k]
  |  Branch (1430:18): [True: 223, False: 280]
  ------------------
 1431|    223|		if(!read_u32(a, &rar5->file.e_ctime_ns))
  ------------------
  |  Branch (1431:6): [True: 1, False: 222]
  ------------------
 1432|      1|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1433|       |
 1434|    222|		*extra_data_size -= 4;
 1435|    222|	}
 1436|       |
 1437|  3.36k|	if(has_atime && has_unix_ns) {
  ------------------
  |  Branch (1437:5): [True: 436, False: 2.92k]
  |  Branch (1437:18): [True: 219, False: 217]
  ------------------
 1438|    219|		if(!read_u32(a, &rar5->file.e_atime_ns))
  ------------------
  |  Branch (1438:6): [True: 1, False: 218]
  ------------------
 1439|      1|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      1|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1440|       |
 1441|    218|		*extra_data_size -= 4;
 1442|    218|	}
 1443|       |
 1444|       |	/* The seconds and nanoseconds are either together, or separated in two
 1445|       |	 * fields so we parse them, then set the archive_entry's times. */
 1446|  3.36k|	if(has_mtime) {
  ------------------
  |  Branch (1446:5): [True: 2.73k, False: 626]
  ------------------
 1447|  2.73k|		archive_entry_set_mtime(e, rar5->file.e_mtime, rar5->file.e_mtime_ns);
 1448|  2.73k|	}
 1449|       |
 1450|  3.36k|	if(has_ctime) {
  ------------------
  |  Branch (1450:5): [True: 501, False: 2.85k]
  ------------------
 1451|    501|		archive_entry_set_ctime(e, rar5->file.e_ctime, rar5->file.e_ctime_ns);
 1452|    501|	}
 1453|       |
 1454|  3.36k|	if(has_atime) {
  ------------------
  |  Branch (1454:5): [True: 435, False: 2.92k]
  ------------------
 1455|    435|		archive_entry_set_atime(e, rar5->file.e_atime, rar5->file.e_atime_ns);
 1456|    435|	}
 1457|       |
 1458|  3.36k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  3.36k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1459|  3.36k|}
archive_read_support_format_rar5.c:parse_htime_item:
 1297|  3.69k|{
 1298|  3.69k|	if(unix_time) {
  ------------------
  |  Branch (1298:5): [True: 2.99k, False: 702]
  ------------------
 1299|  2.99k|		uint32_t time_val;
 1300|  2.99k|		if(!read_u32(a, &time_val))
  ------------------
  |  Branch (1300:6): [True: 5, False: 2.99k]
  ------------------
 1301|      5|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      5|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1302|       |
 1303|  2.99k|		*extra_data_size -= 4;
 1304|  2.99k|		*sec = (int64_t) time_val;
 1305|  2.99k|	} else {
 1306|    702|		uint64_t windows_time;
 1307|    702|		if(!read_u64(a, &windows_time))
  ------------------
  |  Branch (1307:6): [True: 5, False: 697]
  ------------------
 1308|      5|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      5|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1309|       |
 1310|    697|		__archive_ntfs_to_unix(windows_time, sec, nsec);
 1311|    697|		*extra_data_size -= 8;
 1312|    697|	}
 1313|       |
 1314|  3.68k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  3.68k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1315|  3.69k|}
archive_read_support_format_rar5.c:read_u64:
 1101|    702|static char read_u64(struct archive_read* a, uint64_t* pvalue) {
 1102|    702|	const uint8_t* p;
 1103|    702|	if(!read_ahead(a, 8, &p))
  ------------------
  |  Branch (1103:5): [True: 5, False: 697]
  ------------------
 1104|      5|		return 0;
 1105|       |
 1106|    697|	*pvalue = archive_le64dec(p);
 1107|    697|	return ARCHIVE_OK == consume(a, 8);
  ------------------
  |  |  233|    697|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1108|    702|}
archive_read_support_format_rar5.c:parse_file_extra_redir:
 1463|  6.40k|{
 1464|  6.40k|	uint64_t value_size = 0;
 1465|  6.40k|	size_t varint_len = 0;
 1466|  6.40k|	size_t target_size = 0;
 1467|  6.40k|	char target_utf8_buf[MAX_NAME_IN_BYTES];
 1468|  6.40k|	const uint8_t* p;
 1469|       |
 1470|  6.40k|	if(!read_var(a, &rar5->file.redir_type, &value_size))
  ------------------
  |  Branch (1470:5): [True: 394, False: 6.00k]
  ------------------
 1471|    394|		return ARCHIVE_EOF;
  ------------------
  |  |  232|    394|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1472|  6.00k|	if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|  6.00k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1472:5): [True: 0, False: 6.00k]
  ------------------
 1473|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1474|  6.00k|	*extra_data_size -= value_size;
 1475|       |
 1476|  6.00k|	if(!read_var(a, &rar5->file.redir_flags, &value_size))
  ------------------
  |  Branch (1476:5): [True: 15, False: 5.99k]
  ------------------
 1477|     15|		return ARCHIVE_EOF;
  ------------------
  |  |  232|     15|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1478|  5.99k|	if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|  5.99k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1478:5): [True: 0, False: 5.99k]
  ------------------
 1479|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1480|  5.99k|	*extra_data_size -= value_size;
 1481|       |
 1482|  5.99k|	if(!read_var_sized(a, &target_size, &varint_len))
  ------------------
  |  Branch (1482:5): [True: 69, False: 5.92k]
  ------------------
 1483|     69|		return ARCHIVE_EOF;
  ------------------
  |  |  232|     69|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1484|  5.92k|	if(ARCHIVE_OK != consume(a, (int64_t)varint_len))
  ------------------
  |  |  233|  5.92k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1484:5): [True: 0, False: 5.92k]
  ------------------
 1485|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1486|  5.92k|	*extra_data_size -= (int64_t)(target_size + varint_len);
 1487|       |
 1488|  5.92k|	if(target_size > (MAX_NAME_IN_CHARS - 1)) {
  ------------------
  |  |  100|  5.92k|#define MAX_NAME_IN_CHARS 2048
  ------------------
  |  Branch (1488:5): [True: 2, False: 5.92k]
  ------------------
 1489|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1490|      2|		    "Link target is too long");
 1491|      2|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1492|      2|	}
 1493|       |
 1494|  5.92k|	if(target_size == 0) {
  ------------------
  |  Branch (1494:5): [True: 2, False: 5.92k]
  ------------------
 1495|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1496|      2|		    "No link target specified");
 1497|      2|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1498|      2|	}
 1499|       |
 1500|  5.92k|	if(!read_ahead(a, target_size, &p))
  ------------------
  |  Branch (1500:5): [True: 3, False: 5.91k]
  ------------------
 1501|      3|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      3|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1502|       |
 1503|  5.91k|	memcpy(target_utf8_buf, p, target_size);
 1504|  5.91k|	target_utf8_buf[target_size] = 0;
 1505|       |
 1506|  5.91k|	if(ARCHIVE_OK != consume(a, (int64_t)target_size))
  ------------------
  |  |  233|  5.91k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1506:5): [True: 0, False: 5.91k]
  ------------------
 1507|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1508|       |
 1509|  5.91k|	switch(rar5->file.redir_type) {
 1510|  1.25k|		case REDIR_TYPE_UNIXSYMLINK:
  ------------------
  |  Branch (1510:3): [True: 1.25k, False: 4.65k]
  ------------------
 1511|  2.18k|		case REDIR_TYPE_WINSYMLINK:
  ------------------
  |  Branch (1511:3): [True: 930, False: 4.98k]
  ------------------
 1512|  2.18k|			archive_entry_set_filetype(e, AE_IFLNK);
  ------------------
  |  |  217|  2.18k|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
 1513|  2.18k|			archive_entry_update_symlink_utf8(e, target_utf8_buf);
 1514|  2.18k|			if (rar5->file.redir_flags & REDIR_SYMLINK_IS_DIR) {
  ------------------
  |  |  146|  2.18k|#define REDIR_SYMLINK_IS_DIR	1
  ------------------
  |  Branch (1514:8): [True: 1.33k, False: 850]
  ------------------
 1515|  1.33k|				archive_entry_set_symlink_type(e,
 1516|  1.33k|					AE_SYMLINK_TYPE_DIRECTORY);
  ------------------
  |  |  229|  1.33k|#define AE_SYMLINK_TYPE_DIRECTORY	2
  ------------------
 1517|  1.33k|			} else {
 1518|    850|				archive_entry_set_symlink_type(e,
 1519|    850|				AE_SYMLINK_TYPE_FILE);
  ------------------
  |  |  228|    850|#define AE_SYMLINK_TYPE_FILE		1
  ------------------
 1520|    850|			}
 1521|  2.18k|			break;
 1522|       |
 1523|  1.36k|		case REDIR_TYPE_HARDLINK:
  ------------------
  |  Branch (1523:3): [True: 1.36k, False: 4.55k]
  ------------------
 1524|  1.36k|			archive_entry_set_filetype(e, AE_IFREG);
  ------------------
  |  |  216|  1.36k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1525|  1.36k|			archive_entry_update_hardlink_utf8(e, target_utf8_buf);
 1526|  1.36k|			break;
 1527|       |
 1528|  2.36k|		default:
  ------------------
  |  Branch (1528:3): [True: 2.36k, False: 3.55k]
  ------------------
 1529|       |			/* Unknown redir type, skip it. */
 1530|  2.36k|			break;
 1531|  5.91k|	}
 1532|  5.91k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  5.91k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1533|  5.91k|}
archive_read_support_format_rar5.c:parse_file_extra_owner:
 1537|  1.43k|{
 1538|  1.43k|	uint64_t flags = 0;
 1539|  1.43k|	uint64_t value_size = 0;
 1540|  1.43k|	uint64_t id = 0;
 1541|  1.43k|	size_t name_len = 0;
 1542|  1.43k|	size_t name_size = 0;
 1543|  1.43k|	size_t varint_len = 0;
 1544|  1.43k|	char namebuf[OWNER_MAXNAMELEN];
 1545|  1.43k|	const uint8_t* p;
 1546|       |
 1547|  1.43k|	if(!read_var(a, &flags, &value_size))
  ------------------
  |  Branch (1547:5): [True: 3, False: 1.43k]
  ------------------
 1548|      3|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      3|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1549|  1.43k|	if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|  1.43k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1549:5): [True: 0, False: 1.43k]
  ------------------
 1550|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1551|  1.43k|	*extra_data_size -= value_size;
 1552|       |
 1553|  1.43k|	if ((flags & OWNER_USER_NAME) != 0) {
  ------------------
  |  |  157|  1.43k|#define	OWNER_USER_NAME		0x01
  ------------------
  |  Branch (1553:6): [True: 400, False: 1.03k]
  ------------------
 1554|    400|		if(!read_var_sized(a, &name_size, &varint_len))
  ------------------
  |  Branch (1554:6): [True: 36, False: 364]
  ------------------
 1555|     36|			return ARCHIVE_EOF;
  ------------------
  |  |  232|     36|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1556|       |
 1557|       |		/* The name cannot be larger than the remaining extra data of
 1558|       |		 * this field. Rejecting an oversized length here also avoids
 1559|       |		 * requesting a huge allocation from read_ahead() below. */
 1560|    364|		if(*extra_data_size < 0 ||
  ------------------
  |  Branch (1560:6): [True: 1, False: 363]
  ------------------
 1561|    363|		    name_size > (uint64_t)*extra_data_size) {
  ------------------
  |  Branch (1561:7): [True: 11, False: 352]
  ------------------
 1562|     12|			archive_set_error(&a->archive,
 1563|     12|			    ARCHIVE_ERRNO_FILE_FORMAT, "Owner name is too long");
  ------------------
  |  |  192|     12|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1564|     12|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1565|     12|		}
 1566|    352|		if(ARCHIVE_OK != consume(a, (int64_t)varint_len))
  ------------------
  |  |  233|    352|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1566:6): [True: 0, False: 352]
  ------------------
 1567|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1568|    352|		*extra_data_size -= (int64_t)(name_size + varint_len);
 1569|       |
 1570|    352|		if(!read_ahead(a, name_size, &p))
  ------------------
  |  Branch (1570:6): [True: 2, False: 350]
  ------------------
 1571|      2|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      2|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1572|       |
 1573|    350|		if (name_size >= OWNER_MAXNAMELEN) {
  ------------------
  |  |  161|    350|#define	OWNER_MAXNAMELEN	256
  ------------------
  |  Branch (1573:7): [True: 10, False: 340]
  ------------------
 1574|     10|			name_len = OWNER_MAXNAMELEN - 1;
  ------------------
  |  |  161|     10|#define	OWNER_MAXNAMELEN	256
  ------------------
 1575|    340|		} else {
 1576|    340|			name_len = name_size;
 1577|    340|		}
 1578|       |
 1579|    350|		memcpy(namebuf, p, name_len);
 1580|    350|		namebuf[name_len] = 0;
 1581|    350|		if(ARCHIVE_OK != consume(a, (int64_t)name_size))
  ------------------
  |  |  233|    350|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1581:6): [True: 0, False: 350]
  ------------------
 1582|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1583|       |
 1584|    350|		archive_entry_set_uname(e, namebuf);
 1585|    350|	}
 1586|  1.38k|	if ((flags & OWNER_GROUP_NAME) != 0) {
  ------------------
  |  |  158|  1.38k|#define	OWNER_GROUP_NAME	0x02
  ------------------
  |  Branch (1586:6): [True: 1.24k, False: 138]
  ------------------
 1587|  1.24k|		if(!read_var_sized(a, &name_size, &varint_len))
  ------------------
  |  Branch (1587:6): [True: 240, False: 1.00k]
  ------------------
 1588|    240|			return ARCHIVE_EOF;
  ------------------
  |  |  232|    240|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1589|       |
 1590|  1.00k|		if(*extra_data_size < 0 ||
  ------------------
  |  Branch (1590:6): [True: 0, False: 1.00k]
  ------------------
 1591|  1.00k|		    name_size > (uint64_t)*extra_data_size) {
  ------------------
  |  Branch (1591:7): [True: 34, False: 970]
  ------------------
 1592|     34|			archive_set_error(&a->archive,
 1593|     34|			    ARCHIVE_ERRNO_FILE_FORMAT, "Group name is too long");
  ------------------
  |  |  192|     34|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1594|     34|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|     34|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1595|     34|		}
 1596|    970|		if(ARCHIVE_OK != consume(a, (int64_t)varint_len))
  ------------------
  |  |  233|    970|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1596:6): [True: 0, False: 970]
  ------------------
 1597|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1598|    970|		*extra_data_size -= (int64_t)(name_size + varint_len);
 1599|       |
 1600|    970|		if(!read_ahead(a, name_size, &p))
  ------------------
  |  Branch (1600:6): [True: 8, False: 962]
  ------------------
 1601|      8|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      8|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1602|       |
 1603|    962|		if (name_size >= OWNER_MAXNAMELEN) {
  ------------------
  |  |  161|    962|#define	OWNER_MAXNAMELEN	256
  ------------------
  |  Branch (1603:7): [True: 341, False: 621]
  ------------------
 1604|    341|			name_len = OWNER_MAXNAMELEN - 1;
  ------------------
  |  |  161|    341|#define	OWNER_MAXNAMELEN	256
  ------------------
 1605|    621|		} else {
 1606|    621|			name_len = name_size;
 1607|    621|		}
 1608|       |
 1609|    962|		memcpy(namebuf, p, name_len);
 1610|    962|		namebuf[name_len] = 0;
 1611|    962|		if(ARCHIVE_OK != consume(a, (int64_t)name_size))
  ------------------
  |  |  233|    962|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1611:6): [True: 0, False: 962]
  ------------------
 1612|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1613|       |
 1614|    962|		archive_entry_set_gname(e, namebuf);
 1615|    962|	}
 1616|  1.10k|	if ((flags & OWNER_USER_UID) != 0) {
  ------------------
  |  |  159|  1.10k|#define	OWNER_USER_UID		0x04
  ------------------
  |  Branch (1616:6): [True: 941, False: 159]
  ------------------
 1617|    941|		if(!read_var(a, &id, &value_size))
  ------------------
  |  Branch (1617:6): [True: 16, False: 925]
  ------------------
 1618|     16|			return ARCHIVE_EOF;
  ------------------
  |  |  232|     16|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1619|    925|		if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|    925|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1619:6): [True: 0, False: 925]
  ------------------
 1620|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1621|    925|		*extra_data_size -= value_size;
 1622|       |
 1623|    925|		archive_entry_set_uid(e, (la_int64_t)id);
 1624|    925|	}
 1625|  1.08k|	if ((flags & OWNER_GROUP_GID) != 0) {
  ------------------
  |  |  160|  1.08k|#define	OWNER_GROUP_GID		0x08
  ------------------
  |  Branch (1625:6): [True: 344, False: 740]
  ------------------
 1626|    344|		if(!read_var(a, &id, &value_size))
  ------------------
  |  Branch (1626:6): [True: 38, False: 306]
  ------------------
 1627|     38|			return ARCHIVE_EOF;
  ------------------
  |  |  232|     38|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1628|    306|		if(ARCHIVE_OK != consume(a, (int64_t)value_size))
  ------------------
  |  |  233|    306|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1628:6): [True: 0, False: 306]
  ------------------
 1629|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1630|    306|		*extra_data_size -= value_size;
 1631|       |
 1632|    306|		archive_entry_set_gid(e, (la_int64_t)id);
 1633|    306|	}
 1634|  1.04k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.04k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1635|  1.08k|}
archive_read_support_format_rar5.c:parse_file_extra_version:
 1319|  27.6k|{
 1320|  27.6k|	size_t flags = 0;
 1321|  27.6k|	size_t version = 0;
 1322|  27.6k|	size_t value_len = 0;
 1323|  27.6k|	struct archive_string version_string;
 1324|  27.6k|	struct archive_string name_utf8_string;
 1325|  27.6k|	const char* cur_filename;
 1326|       |
 1327|       |	/* Flags are ignored. */
 1328|  27.6k|	if(!read_var_sized(a, &flags, &value_len))
  ------------------
  |  Branch (1328:5): [True: 43, False: 27.6k]
  ------------------
 1329|     43|		return ARCHIVE_EOF;
  ------------------
  |  |  232|     43|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1330|       |
 1331|  27.6k|	*extra_data_size -= value_len;
 1332|  27.6k|	if(ARCHIVE_OK != consume(a, value_len))
  ------------------
  |  |  233|  27.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1332:5): [True: 0, False: 27.6k]
  ------------------
 1333|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1334|       |
 1335|  27.6k|	if(!read_var_sized(a, &version, &value_len))
  ------------------
  |  Branch (1335:5): [True: 32, False: 27.5k]
  ------------------
 1336|     32|		return ARCHIVE_EOF;
  ------------------
  |  |  232|     32|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1337|       |
 1338|  27.5k|	*extra_data_size -= value_len;
 1339|  27.5k|	if(ARCHIVE_OK != consume(a, value_len))
  ------------------
  |  |  233|  27.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1339:5): [True: 0, False: 27.5k]
  ------------------
 1340|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 1341|       |
 1342|       |	/* extra_data_size should be zero here. */
 1343|       |
 1344|  27.5k|	cur_filename = archive_entry_pathname_utf8(e);
 1345|  27.5k|	if(cur_filename == NULL) {
  ------------------
  |  Branch (1345:5): [True: 0, False: 27.5k]
  ------------------
 1346|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1347|      0|		    "Version entry without file name");
 1348|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1349|      0|	}
 1350|       |
 1351|  27.5k|	archive_string_init(&version_string);
  ------------------
  |  |   71|  27.5k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
 1352|  27.5k|	archive_string_init(&name_utf8_string);
  ------------------
  |  |   71|  27.5k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 27.5k]
  |  |  ------------------
  ------------------
 1353|       |
 1354|       |	/* Prepare a ;123 suffix for the filename, where '123' is the version
 1355|       |	 * value of this file. */
 1356|  27.5k|	archive_string_sprintf(&version_string, ";%zu", version);
 1357|       |
 1358|       |	/* Build the new filename. */
 1359|  27.5k|	archive_strcat(&name_utf8_string, cur_filename);
 1360|  27.5k|	archive_strcat(&name_utf8_string, version_string.s);
 1361|       |
 1362|       |	/* Apply the new filename into this file's context. */
 1363|  27.5k|	archive_entry_update_pathname_utf8(e, name_utf8_string.s);
 1364|       |
 1365|       |	/* Free buffers. */
 1366|  27.5k|	archive_string_free(&version_string);
 1367|  27.5k|	archive_string_free(&name_utf8_string);
 1368|  27.5k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  27.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1369|  27.5k|}
archive_read_support_format_rar5.c:scan_for_signature:
 3446|  5.82k|static int scan_for_signature(struct archive_read* a) {
 3447|  5.82k|	const uint8_t* p;
 3448|  5.82k|	const int chunk_size = 512;
 3449|  5.82k|	ssize_t i;
 3450|  5.82k|	char signature[sizeof(rar5_signature_xor)];
 3451|       |
 3452|       |	/* If we're here, it means we're on an 'unknown territory' data.
 3453|       |	 * There's no indication what kind of data we're reading here.
 3454|       |	 * It could be some text comment, any kind of binary data,
 3455|       |	 * digital sign, dragons, etc.
 3456|       |	 *
 3457|       |	 * We want to find a valid RARv5 magic header inside this unknown
 3458|       |	 * data. */
 3459|       |
 3460|       |	/* Is it possible in libarchive to just skip everything until the
 3461|       |	 * end of the file? If so, it would be a better approach than the
 3462|       |	 * current implementation of this function. */
 3463|       |
 3464|  5.82k|	rar5_signature(signature);
 3465|       |
 3466|  7.76k|	while(1) {
  ------------------
  |  Branch (3466:8): [True: 7.76k, Folded]
  ------------------
 3467|  7.76k|		if(!read_ahead(a, chunk_size, &p))
  ------------------
  |  Branch (3467:6): [True: 675, False: 7.09k]
  ------------------
 3468|    675|			return ARCHIVE_EOF;
  ------------------
  |  |  232|    675|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3469|       |
 3470|  1.86M|		for(i = 0; i < chunk_size - (int)sizeof(rar5_signature_xor);
  ------------------
  |  Branch (3470:14): [True: 1.86M, False: 1.94k]
  ------------------
 3471|  1.86M|		    i++) {
 3472|  1.86M|			if(memcmp(&p[i], signature,
  ------------------
  |  Branch (3472:7): [True: 5.14k, False: 1.85M]
  ------------------
 3473|  1.86M|			    sizeof(rar5_signature_xor)) == 0) {
 3474|       |				/* Consume the number of bytes we've used to
 3475|       |				 * search for the signature, as well as the
 3476|       |				 * number of bytes used by the signature
 3477|       |				 * itself. After this we should be standing
 3478|       |				 * on a valid base block header. */
 3479|  5.14k|				(void) consume(a,
 3480|  5.14k|				    i + sizeof(rar5_signature_xor));
 3481|  5.14k|				return ARCHIVE_OK;
  ------------------
  |  |  233|  5.14k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3482|  5.14k|			}
 3483|  1.86M|		}
 3484|       |
 3485|  1.94k|		consume(a, chunk_size);
 3486|  1.94k|	}
 3487|       |
 3488|      0|	return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3489|  5.82k|}
archive_read_support_format_rar5.c:rar5_read_data:
 4343|  51.1k|    size_t *size, int64_t *offset) {
 4344|  51.1k|	struct rar5 *rar5 = a->format->data;
 4345|  51.1k|	int ret;
 4346|       |
 4347|  51.1k|	if (size)
  ------------------
  |  Branch (4347:6): [True: 48.8k, False: 2.28k]
  ------------------
 4348|  48.8k|		*size = 0;
 4349|       |
 4350|  51.1k|	if (rar5->has_encrypted_entries == ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|  51.1k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
  |  Branch (4350:6): [True: 0, False: 51.1k]
  ------------------
 4351|      0|		rar5->has_encrypted_entries = 0;
 4352|      0|	}
 4353|       |
 4354|  51.1k|	if (rar5->headers_are_encrypted || rar5->cstate.data_encrypted) {
  ------------------
  |  Branch (4354:6): [True: 0, False: 51.1k]
  |  Branch (4354:37): [True: 218, False: 50.9k]
  ------------------
 4355|    218|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    218|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4356|    218|		    "Reading encrypted data is not currently supported");
 4357|    218|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|    218|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 4358|    218|	}
 4359|       |
 4360|  50.9k|	if(rar5->file.dir > 0) {
  ------------------
  |  Branch (4360:5): [True: 2, False: 50.9k]
  ------------------
 4361|       |		/* Don't process any data if this file entry was declared
 4362|       |		 * as a directory. This is needed, because entries marked as
 4363|       |		 * directory doesn't have any dictionary buffer allocated, so
 4364|       |		 * it's impossible to perform any decompression. */
 4365|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4366|      2|		    "Can't decompress an entry marked as a directory");
 4367|      2|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4368|      2|	}
 4369|       |
 4370|  50.9k|	if(!rar5->skip_mode && (rar5->cstate.last_write_ptr > rar5->file.unpacked_size)) {
  ------------------
  |  Branch (4370:5): [True: 48.6k, False: 2.28k]
  |  Branch (4370:25): [True: 0, False: 48.6k]
  ------------------
 4371|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 4372|      0|		    "Unpacker has written too many bytes");
 4373|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4374|      0|	}
 4375|       |
 4376|  50.9k|	ret = use_data(rar5, buff, size, offset);
 4377|  50.9k|	if(ret == ARCHIVE_OK) {
  ------------------
  |  |  233|  50.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4377:5): [True: 21.6k, False: 29.3k]
  ------------------
 4378|  21.6k|		return ret;
 4379|  21.6k|	}
 4380|       |
 4381|  29.3k|	if(rar5->file.eof == 1) {
  ------------------
  |  Branch (4381:5): [True: 2.08k, False: 27.2k]
  ------------------
 4382|  2.08k|		return ARCHIVE_EOF;
  ------------------
  |  |  232|  2.08k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4383|  2.08k|	}
 4384|       |
 4385|  27.2k|	ret = do_unpack(a, rar5, buff, size, offset);
 4386|  27.2k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  27.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4386:5): [True: 3.64k, False: 23.5k]
  ------------------
 4387|  3.64k|		return ret;
 4388|  3.64k|	}
 4389|       |
 4390|  23.5k|	if(rar5->file.bytes_remaining == 0 &&
  ------------------
  |  Branch (4390:5): [True: 6.33k, False: 17.2k]
  ------------------
 4391|  6.33k|			rar5->cstate.last_write_ptr == rar5->file.unpacked_size)
  ------------------
  |  Branch (4391:4): [True: 1.20k, False: 5.12k]
  ------------------
 4392|  1.20k|	{
 4393|       |		/* If all bytes of current file were processed, run
 4394|       |		 * finalization.
 4395|       |		 *
 4396|       |		 * Finalization will check checksum against proper values. If
 4397|       |		 * some of the checksums will not match, we'll return an error
 4398|       |		 * value in the last `archive_read_data` call to signal an error
 4399|       |		 * to the user. */
 4400|       |
 4401|  1.20k|		rar5->file.eof = 1;
 4402|  1.20k|		return verify_global_checksums(a);
 4403|  1.20k|	}
 4404|       |
 4405|  22.3k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  22.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4406|  23.5k|}
archive_read_support_format_rar5.c:use_data:
 3877|  50.9k|{
 3878|  50.9k|	int i;
 3879|       |
 3880|   113k|	for(i = 0; i < rar5_countof(rar5->cstate.dready); i++) {
  ------------------
  |  |   62|   113k|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (3880:13): [True: 84.6k, False: 29.3k]
  ------------------
 3881|  84.6k|		struct data_ready *d = &rar5->cstate.dready[i];
 3882|       |
 3883|  84.6k|		if(d->used) {
  ------------------
  |  Branch (3883:6): [True: 21.6k, False: 62.9k]
  ------------------
 3884|  21.6k|			if(buf)    *buf = d->buf;
  ------------------
  |  Branch (3884:7): [True: 21.6k, False: 0]
  ------------------
 3885|  21.6k|			if(size)   *size = d->size;
  ------------------
  |  Branch (3885:7): [True: 21.6k, False: 0]
  ------------------
 3886|  21.6k|			if(offset) *offset = d->offset;
  ------------------
  |  Branch (3886:7): [True: 21.6k, False: 0]
  ------------------
 3887|       |
 3888|  21.6k|			d->used = 0;
 3889|  21.6k|			return ARCHIVE_OK;
  ------------------
  |  |  233|  21.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3890|  21.6k|		}
 3891|  84.6k|	}
 3892|       |
 3893|  29.3k|	return ARCHIVE_RETRY;
  ------------------
  |  |  234|  29.3k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 3894|  50.9k|}
archive_read_support_format_rar5.c:do_unpack:
 4182|  27.2k|{
 4183|  27.2k|	enum COMPRESSION_METHOD {
 4184|  27.2k|		STORE = 0, FASTEST = 1, FAST = 2, NORMAL = 3, GOOD = 4,
 4185|  27.2k|		BEST = 5
 4186|  27.2k|	};
 4187|       |
 4188|  27.2k|	if(rar5->file.service > 0) {
  ------------------
  |  Branch (4188:5): [True: 203, False: 27.0k]
  ------------------
 4189|    203|		return do_unstore_file(a, rar5, buf, size, offset);
 4190|  27.0k|	} else {
 4191|  27.0k|		switch(rar5->cstate.method) {
 4192|  5.37k|			case STORE:
  ------------------
  |  Branch (4192:4): [True: 5.37k, False: 21.6k]
  ------------------
 4193|  5.37k|				return do_unstore_file(a, rar5, buf, size,
 4194|  5.37k|				    offset);
 4195|  5.37k|			case FASTEST:
  ------------------
  |  Branch (4195:4): [True: 5.37k, False: 21.6k]
  ------------------
 4196|       |				/* fallthrough */
 4197|  8.40k|			case FAST:
  ------------------
  |  Branch (4197:4): [True: 3.02k, False: 23.9k]
  ------------------
 4198|       |				/* fallthrough */
 4199|  13.2k|			case NORMAL:
  ------------------
  |  Branch (4199:4): [True: 4.82k, False: 22.1k]
  ------------------
 4200|       |				/* fallthrough */
 4201|  14.2k|			case GOOD:
  ------------------
  |  Branch (4201:4): [True: 1.00k, False: 26.0k]
  ------------------
 4202|       |				/* fallthrough */
 4203|  21.6k|			case BEST:
  ------------------
  |  Branch (4203:4): [True: 7.41k, False: 19.6k]
  ------------------
 4204|       |				/* No data is returned here. But because a sparse-file aware
 4205|       |				 * caller (like archive_read_data_into_fd) may treat zero-size
 4206|       |				 * as a sparse file block, we need to update the offset
 4207|       |				 * accordingly. At this point the decoder doesn't have any
 4208|       |				 * pending uncompressed data blocks, so the current position in
 4209|       |				 * the output file should be last_write_ptr. */
 4210|  21.6k|				if (offset) *offset = rar5->cstate.last_write_ptr;
  ------------------
  |  Branch (4210:9): [True: 19.5k, False: 2.07k]
  ------------------
 4211|  21.6k|				return uncompress_file(a);
 4212|      1|			default:
  ------------------
  |  Branch (4212:4): [True: 1, False: 27.0k]
  ------------------
 4213|      1|				archive_set_error(&a->archive,
 4214|      1|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4215|      1|				    "Compression method not supported: 0x%x",
 4216|      1|				    (unsigned int)rar5->cstate.method);
 4217|       |
 4218|      1|				return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4219|  27.0k|		}
 4220|  27.0k|	}
 4221|       |
 4222|      0|#if !defined WIN32
 4223|       |	/* Not reached. */
 4224|      0|	return ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4225|  27.2k|#endif
 4226|  27.2k|}
archive_read_support_format_rar5.c:do_unstore_file:
 4125|  5.57k|{
 4126|  5.57k|	size_t to_read;
 4127|  5.57k|	const uint8_t* p;
 4128|       |
 4129|  5.57k|	if(rar5->file.bytes_remaining == 0 && rar5->main.volume > 0 &&
  ------------------
  |  Branch (4129:5): [True: 4.05k, False: 1.51k]
  |  Branch (4129:40): [True: 3.59k, False: 467]
  ------------------
 4130|  3.59k|	    rar5->generic.split_after > 0)
  ------------------
  |  Branch (4130:6): [True: 3.56k, False: 25]
  ------------------
 4131|  3.56k|	{
 4132|  3.56k|		int ret;
 4133|       |
 4134|  3.56k|		rar5->cstate.switch_multivolume = 1;
 4135|  3.56k|		ret = advance_multivolume(a);
 4136|  3.56k|		rar5->cstate.switch_multivolume = 0;
 4137|       |
 4138|  3.56k|		if(ret == ARCHIVE_EOF) {
  ------------------
  |  |  232|  3.56k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (4138:6): [True: 69, False: 3.49k]
  ------------------
 4139|       |			/* We only reach this advance because 'split after' was
 4140|       |			 * set, i.e. the file is promised to continue in a
 4141|       |			 * following volume, but the input ended before we could
 4142|       |			 * reach it (for example, only the first volume of the
 4143|       |			 * set was supplied).  The data decoded so far is
 4144|       |			 * incomplete, so report truncation rather than silently
 4145|       |			 * returning a short read as a clean end of file. */
 4146|     69|			return truncated_multivolume_error(a);
 4147|  3.49k|		} else if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  3.49k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4147:13): [True: 57, False: 3.44k]
  ------------------
 4148|       |			/* Failed to advance to next multivolume archive
 4149|       |			 * file. */
 4150|     57|			return ret;
 4151|     57|		}
 4152|  3.56k|	}
 4153|       |
 4154|  5.45k|	to_read = rar5_min(rar5->file.bytes_remaining, 64 * 1024);
  ------------------
  |  |   60|  5.45k|#define rar5_min(a, b) (((a) > (b)) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (60:25): [True: 20, False: 5.43k]
  |  |  ------------------
  ------------------
 4155|  5.45k|	if(to_read == 0) {
  ------------------
  |  Branch (4155:5): [True: 502, False: 4.95k]
  ------------------
 4156|    502|		return ARCHIVE_EOF;
  ------------------
  |  |  232|    502|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4157|    502|	}
 4158|       |
 4159|  4.95k|	if(!read_ahead(a, to_read, &p)) {
  ------------------
  |  Branch (4159:5): [True: 31, False: 4.91k]
  ------------------
 4160|     31|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     31|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4161|     31|		    "I/O error when unstoring file");
 4162|     31|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     31|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4163|     31|	}
 4164|       |
 4165|  4.91k|	if(ARCHIVE_OK != consume(a, to_read)) {
  ------------------
  |  |  233|  4.91k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4165:5): [True: 0, False: 4.91k]
  ------------------
 4166|      0|		return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4167|      0|	}
 4168|       |
 4169|  4.91k|	if(buf)    *buf = p;
  ------------------
  |  Branch (4169:5): [True: 4.71k, False: 201]
  ------------------
 4170|  4.91k|	if(size)   *size = to_read;
  ------------------
  |  Branch (4170:5): [True: 4.71k, False: 201]
  ------------------
 4171|  4.91k|	if(offset) *offset = rar5->cstate.last_unstore_ptr;
  ------------------
  |  Branch (4171:5): [True: 4.71k, False: 201]
  ------------------
 4172|       |
 4173|  4.91k|	rar5->file.bytes_remaining -= to_read;
 4174|  4.91k|	rar5->cstate.last_unstore_ptr += to_read;
 4175|       |
 4176|  4.91k|	update_crc(rar5, p, to_read);
 4177|  4.91k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  4.91k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4178|  4.91k|}
archive_read_support_format_rar5.c:advance_multivolume:
 3505|  5.28k|static int advance_multivolume(struct archive_read* a) {
 3506|  5.28k|	struct rar5 *rar5 = a->format->data;
 3507|  5.28k|	int lret;
 3508|       |
 3509|       |	/* A small state machine that will skip unnecessary data, needed to
 3510|       |	 * switch from one multivolume to another. Such skipping is needed if
 3511|       |	 * we want to be an stream-oriented (instead of file-oriented)
 3512|       |	 * unpacker.
 3513|       |	 *
 3514|       |	 * The state machine starts with `rar5->main.endarc` == 0. It also
 3515|       |	 * assumes that current stream pointer points to some base block
 3516|       |	 * header.
 3517|       |	 *
 3518|       |	 * The `endarc` field is being set when the base block parsing
 3519|       |	 * function encounters the 'end of archive' marker.
 3520|       |	 */
 3521|       |
 3522|  15.2k|	while(1) {
  ------------------
  |  Branch (3522:8): [True: 15.2k, Folded]
  ------------------
 3523|  15.2k|		if(rar5->main.endarc == 1) {
  ------------------
  |  Branch (3523:6): [True: 4.09k, False: 11.1k]
  ------------------
 3524|  4.09k|			int looping = 1;
 3525|       |
 3526|  4.09k|			rar5->main.endarc = 0;
 3527|       |
 3528|  10.0k|			while(looping) {
  ------------------
  |  Branch (3528:10): [True: 6.21k, False: 3.87k]
  ------------------
 3529|  6.21k|				lret = skip_base_block(a);
 3530|  6.21k|				switch(lret) {
 3531|  2.11k|					case ARCHIVE_RETRY:
  ------------------
  |  |  234|  2.11k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (3531:6): [True: 2.11k, False: 4.09k]
  ------------------
 3532|       |						/* Continue looping. */
 3533|  2.11k|						break;
 3534|  3.87k|					case ARCHIVE_OK:
  ------------------
  |  |  233|  3.87k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3534:6): [True: 3.87k, False: 2.33k]
  ------------------
 3535|       |						/* Break loop. */
 3536|  3.87k|						looping = 0;
 3537|  3.87k|						break;
 3538|    216|					default:
  ------------------
  |  Branch (3538:6): [True: 216, False: 5.99k]
  ------------------
 3539|       |						/* Forward any errors to the
 3540|       |						 * caller. */
 3541|    216|						return lret;
 3542|  6.21k|				}
 3543|  6.21k|			}
 3544|       |
 3545|  3.87k|			break;
 3546|  11.1k|		} else {
 3547|       |			/* Skip current base block. In order to properly skip
 3548|       |			 * it, we really need to simply parse it and discard
 3549|       |			 * the results. */
 3550|       |
 3551|  11.1k|			lret = skip_base_block(a);
 3552|  11.1k|			if(lret == ARCHIVE_FATAL || lret == ARCHIVE_FAILED)
  ------------------
  |  |  239|  22.3k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              			if(lret == ARCHIVE_FATAL || lret == ARCHIVE_FAILED)
  ------------------
  |  |  237|  11.1k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3552:7): [True: 69, False: 11.1k]
  |  Branch (3552:32): [True: 267, False: 10.8k]
  ------------------
 3553|    336|				return lret;
 3554|       |
 3555|       |			/* The `skip_base_block` function tells us if we
 3556|       |			 * should continue with skipping, or we should stop
 3557|       |			 * skipping. We're trying to skip everything up to
 3558|       |			 * a base FILE block. */
 3559|       |
 3560|  10.8k|			if(lret != ARCHIVE_RETRY) {
  ------------------
  |  |  234|  10.8k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (3560:7): [True: 865, False: 9.99k]
  ------------------
 3561|       |				/* If there was an error during skipping, or we
 3562|       |				 * have just skipped a FILE base block... */
 3563|       |
 3564|    865|				if(rar5->main.endarc == 0) {
  ------------------
  |  Branch (3564:8): [True: 854, False: 11]
  ------------------
 3565|    854|					return lret;
 3566|    854|				} else {
 3567|     11|					continue;
 3568|     11|				}
 3569|    865|			}
 3570|  10.8k|		}
 3571|  15.2k|	}
 3572|       |
 3573|  3.87k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  3.87k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3574|  5.28k|}
archive_read_support_format_rar5.c:skip_base_block:
 2500|  17.4k|static int skip_base_block(struct archive_read* a) {
 2501|  17.4k|	struct rar5 *rar5 = a->format->data;
 2502|  17.4k|	int ret;
 2503|       |
 2504|       |	/* Create a new local archive_entry structure that will be operated on
 2505|       |	 * by header reader; operations on this archive_entry will be discarded.
 2506|       |	 */
 2507|  17.4k|	struct archive_entry* entry = archive_entry_new();
 2508|  17.4k|	if (entry == NULL)
  ------------------
  |  Branch (2508:6): [True: 0, False: 17.4k]
  ------------------
 2509|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2510|       |
 2511|  17.4k|	ret = process_base_block(a, entry);
 2512|       |
 2513|       |	/* Discard operations on this archive_entry structure. */
 2514|  17.4k|	archive_entry_free(entry);
 2515|  17.4k|	if(ret == ARCHIVE_FATAL)
  ------------------
  |  |  239|  17.4k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2515:5): [True: 183, False: 17.2k]
  ------------------
 2516|    183|		return ret;
 2517|       |
 2518|  17.2k|	if(rar5->generic.last_header_id == 2 && rar5->generic.split_before > 0)
  ------------------
  |  Branch (2518:5): [True: 6.61k, False: 10.6k]
  |  Branch (2518:42): [True: 4.51k, False: 2.09k]
  ------------------
 2519|  4.51k|		return ARCHIVE_OK;
  ------------------
  |  |  233|  4.51k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2520|       |
 2521|  12.7k|	if(ret == ARCHIVE_OK)
  ------------------
  |  |  233|  12.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2521:5): [True: 6.72k, False: 5.98k]
  ------------------
 2522|  6.72k|		return ARCHIVE_RETRY;
  ------------------
  |  |  234|  6.72k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 2523|  5.98k|	else
 2524|  5.98k|		return ret;
 2525|  12.7k|}
archive_read_support_format_rar5.c:truncated_multivolume_error:
 3496|    198|static int truncated_multivolume_error(struct archive_read* a) {
 3497|    198|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    198|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3498|    198|	    "Truncated RAR5 archive: file continues in a subsequent volume "
 3499|    198|	    "that is not available");
 3500|    198|	return ARCHIVE_FATAL;
  ------------------
  |  |  239|    198|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3501|    198|}
archive_read_support_format_rar5.c:update_crc:
 2653|  26.5k|static void update_crc(struct rar5 *rar5, const uint8_t* p, size_t to_read) {
 2654|  26.5k|    int verify_crc;
 2655|       |
 2656|  26.5k|	if(rar5->skip_mode) {
  ------------------
  |  Branch (2656:5): [True: 201, False: 26.3k]
  ------------------
 2657|       |#if defined CHECK_CRC_ON_SOLID_SKIP
 2658|       |		verify_crc = 1;
 2659|       |#else
 2660|    201|		verify_crc = 0;
 2661|    201|#endif
 2662|    201|	} else
 2663|  26.3k|		verify_crc = 1;
 2664|       |
 2665|  26.5k|	if(verify_crc) {
  ------------------
  |  Branch (2665:5): [True: 26.3k, False: 201]
  ------------------
 2666|       |		/* Don't update CRC32 if the file doesn't have the
 2667|       |		 * `stored_crc32` info filled in. */
 2668|  26.3k|		if(rar5->file.stored_crc32 > 0) {
  ------------------
  |  Branch (2668:6): [True: 5.45k, False: 20.8k]
  ------------------
 2669|  5.45k|			rar5->file.calculated_crc32 =
 2670|  5.45k|				__archive_crc32(rar5->file.calculated_crc32, p,
 2671|  5.45k|				    (unsigned int)to_read);
 2672|  5.45k|		}
 2673|       |
 2674|       |		/* Check if the file uses an optional BLAKE2sp checksum
 2675|       |		 * algorithm. */
 2676|  26.3k|		if(rar5->file.has_blake2 > 0) {
  ------------------
  |  Branch (2676:6): [True: 11.2k, False: 15.0k]
  ------------------
 2677|       |			/* Return value of the `update` function is always 0,
 2678|       |			 * so we can explicitly ignore it here. */
 2679|  11.2k|			(void) blake2sp_update(&rar5->file.b2state, p,
  ------------------
  |  |   32|  11.2k|#define blake2sp_update __archive_blake2sp_update
  ------------------
 2680|  11.2k|			    to_read);
 2681|  11.2k|		}
 2682|  26.3k|	}
 2683|  26.5k|}
archive_read_support_format_rar5.c:uncompress_file:
 4109|  21.6k|static int uncompress_file(struct archive_read* a) {
 4110|  21.6k|	int ret;
 4111|       |
 4112|  22.1k|	while(1) {
  ------------------
  |  Branch (4112:8): [True: 22.1k, Folded]
  ------------------
 4113|       |		/* Sometimes the uncompression function will return a
 4114|       |		 * 'retry' signal. If this will happen, we have to retry
 4115|       |		 * the function. */
 4116|  22.1k|		ret = do_uncompress_file(a);
 4117|  22.1k|		if(ret != ARCHIVE_RETRY)
  ------------------
  |  |  234|  22.1k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (4117:6): [True: 21.6k, False: 494]
  ------------------
 4118|  21.6k|			return ret;
 4119|  22.1k|	}
 4120|  21.6k|}
archive_read_support_format_rar5.c:do_uncompress_file:
 3996|  22.1k|static int do_uncompress_file(struct archive_read* a) {
 3997|  22.1k|	struct rar5 *rar5 = a->format->data;
 3998|  22.1k|	int ret;
 3999|  22.1k|	int64_t max_end_pos;
 4000|       |
 4001|  22.1k|	if(!rar5->cstate.initialized) {
  ------------------
  |  Branch (4001:5): [True: 2.44k, False: 19.7k]
  ------------------
 4002|       |		/* Don't perform full context reinitialization if we're
 4003|       |		 * processing a solid archive. */
 4004|  2.44k|		if(!rar5->main.solid || !rar5->cstate.window_buf) {
  ------------------
  |  Branch (4004:6): [True: 843, False: 1.59k]
  |  Branch (4004:27): [True: 317, False: 1.28k]
  ------------------
 4005|  1.16k|			if((ret = init_unpack(rar5)) != ARCHIVE_OK)
  ------------------
  |  |  233|  1.16k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4005:7): [True: 0, False: 1.16k]
  ------------------
 4006|      0|				return ret;
 4007|  1.16k|		}
 4008|       |
 4009|  2.44k|		rar5->cstate.initialized = 1;
 4010|  2.44k|	}
 4011|       |
 4012|       |	/* Don't allow extraction if window_size is invalid. */
 4013|  22.1k|	if(rar5->cstate.window_size == 0) {
  ------------------
  |  Branch (4013:5): [True: 1, False: 22.1k]
  ------------------
 4014|      1|		archive_set_error(&a->archive,
 4015|      1|			ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4016|      1|			"Invalid window size declaration in this file");
 4017|       |
 4018|       |		/* This should never happen in valid files. */
 4019|      1|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 4020|      1|	}
 4021|       |
 4022|  22.1k|	if(rar5->cstate.all_filters_applied == 1) {
  ------------------
  |  Branch (4022:5): [True: 16.9k, False: 5.17k]
  ------------------
 4023|       |		/* We use while(1) here, but standard case allows for just 1
 4024|       |		 * iteration. The loop will iterate if process_block() didn't
 4025|       |		 * generate any data at all. This can happen if the block
 4026|       |		 * contains only filter definitions (this is common in big
 4027|       |		 * files). */
 4028|  19.0k|		while(1) {
  ------------------
  |  Branch (4028:9): [True: 19.0k, Folded]
  ------------------
 4029|  19.0k|			ret = process_block(a);
 4030|  19.0k|			if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  19.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4030:7): [True: 2.84k, False: 16.1k]
  ------------------
 4031|  2.84k|				return ret;
 4032|       |
 4033|  16.1k|			if(rar5->cstate.last_write_ptr ==
  ------------------
  |  Branch (4033:7): [True: 2.15k, False: 14.0k]
  ------------------
 4034|  16.1k|			    rar5->cstate.write_ptr) {
 4035|       |				/* The block didn't generate any new data,
 4036|       |				 * so just process a new block if this one
 4037|       |				 * wasn't the last block in the file. */
 4038|  2.15k|				if (bf_is_last_block(&rar5->last_block_hdr)) {
  ------------------
  |  Branch (4038:9): [True: 110, False: 2.04k]
  ------------------
 4039|    110|					return ARCHIVE_EOF;
  ------------------
  |  |  232|    110|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4040|    110|				}
 4041|       |
 4042|  2.04k|				continue;
 4043|  2.15k|			}
 4044|       |
 4045|       |			/* The block has generated some new data, so break
 4046|       |			 * the loop. */
 4047|  14.0k|			break;
 4048|  16.1k|		}
 4049|  16.9k|	}
 4050|       |
 4051|       |	/* Try to run filters. If filters won't be applied, it means that
 4052|       |	 * insufficient data was generated. */
 4053|  19.1k|	ret = apply_filters(a);
 4054|  19.1k|	if(ret == ARCHIVE_RETRY) {
  ------------------
  |  |  234|  19.1k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  |  Branch (4054:5): [True: 5.17k, False: 14.0k]
  ------------------
 4055|  5.17k|		return ARCHIVE_OK;
  ------------------
  |  |  233|  5.17k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4056|  14.0k|	} else if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  14.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4056:12): [True: 25, False: 13.9k]
  ------------------
 4057|     25|		return ret;
 4058|     25|	}
 4059|       |
 4060|  13.9k|	if(cdeque_size(&rar5->cstate.filters) > 0) {
  ------------------
  |  Branch (4060:5): [True: 1.04k, False: 12.9k]
  ------------------
 4061|       |		/* Check if we can write something before hitting first
 4062|       |		 * filter. */
 4063|  1.04k|		struct filter_info* flt;
 4064|       |
 4065|       |		/* Get the block_start offset from the first filter. */
 4066|  1.04k|		if(CDE_OK != cdeque_front(&rar5->cstate.filters,
  ------------------
  |  Branch (4066:6): [True: 0, False: 1.04k]
  ------------------
 4067|  1.04k|		    cdeque_filter_p(&flt)))
 4068|      0|		{
 4069|      0|			archive_set_error(&a->archive,
 4070|      0|			    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 4071|      0|			    "Can't read first filter");
 4072|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4073|      0|		}
 4074|       |
 4075|  1.04k|		max_end_pos = rar5_min(flt->block_start,
  ------------------
  |  |   60|  1.04k|#define rar5_min(a, b) (((a) > (b)) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (60:25): [True: 470, False: 579]
  |  |  ------------------
  ------------------
 4076|  1.04k|		    rar5->cstate.write_ptr);
 4077|  12.9k|	} else {
 4078|       |		/* There are no filters defined, or all filters were applied.
 4079|       |		 * This means we can just store the data without any
 4080|       |		 * postprocessing. */
 4081|  12.9k|		max_end_pos = rar5->cstate.write_ptr;
 4082|  12.9k|	}
 4083|       |
 4084|  13.9k|	if(max_end_pos == rar5->cstate.last_write_ptr) {
  ------------------
  |  Branch (4084:5): [True: 494, False: 13.4k]
  ------------------
 4085|       |		/* We can't write anything yet. The block uncompression
 4086|       |		 * function did not generate enough data, and no filter can be
 4087|       |		 * applied. At the same time we don't have any data that can be
 4088|       |		 *  stored without filter postprocessing. This means we need to
 4089|       |		 *  wait for more data to be generated, so we can apply the
 4090|       |		 * filters.
 4091|       |		 *
 4092|       |		 * Signal the caller that we need more data to be able to do
 4093|       |		 * anything.
 4094|       |		 */
 4095|    494|		return ARCHIVE_RETRY;
  ------------------
  |  |  234|    494|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
 4096|  13.4k|	} else {
 4097|       |		/* We can write the data before hitting the first filter.
 4098|       |		 * So let's do it. The push_window_data() function will
 4099|       |		 * effectively return the selected data block to the user
 4100|       |		 * application. */
 4101|  13.4k|		push_window_data(a, rar5, rar5->cstate.last_write_ptr,
 4102|  13.4k|		    max_end_pos);
 4103|  13.4k|		rar5->cstate.last_write_ptr = max_end_pos;
 4104|  13.4k|	}
 4105|       |
 4106|  13.4k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  13.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4107|  13.9k|}
archive_read_support_format_rar5.c:init_unpack:
 2620|  1.16k|static int init_unpack(struct rar5 *rar5) {
 2621|  1.16k|	rar5->file.calculated_crc32 = 0;
 2622|  1.16k|	init_window_mask(rar5);
 2623|       |
 2624|  1.16k|	free(rar5->cstate.window_buf);
 2625|  1.16k|	free(rar5->cstate.filtered_buf);
 2626|       |
 2627|  1.16k|	rar5->cstate.window_buf = NULL;
 2628|  1.16k|	rar5->cstate.filtered_buf = NULL;
 2629|       |
 2630|  1.16k|	if(rar5->cstate.window_size > 0) {
  ------------------
  |  Branch (2630:5): [True: 1.15k, False: 1]
  ------------------
 2631|  1.15k|		rar5->cstate.window_buf = calloc(1, rar5->cstate.window_size);
 2632|  1.15k|		if(rar5->cstate.window_buf == NULL)
  ------------------
  |  Branch (2632:6): [True: 0, False: 1.15k]
  ------------------
 2633|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2634|  1.15k|		rar5->cstate.filtered_buf = calloc(1,
 2635|  1.15k|		    rar5->cstate.window_size);
 2636|  1.15k|		if(rar5->cstate.filtered_buf == NULL)
  ------------------
  |  Branch (2636:6): [True: 0, False: 1.15k]
  ------------------
 2637|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2638|  1.15k|	}
 2639|       |
 2640|  1.16k|	clear_data_ready_stack(rar5);
 2641|       |
 2642|  1.16k|	rar5->cstate.write_ptr = 0;
 2643|  1.16k|	rar5->cstate.last_write_ptr = 0;
 2644|       |
 2645|  1.16k|	memset(&rar5->cstate.bd, 0, sizeof(rar5->cstate.bd));
 2646|  1.16k|	memset(&rar5->cstate.ld, 0, sizeof(rar5->cstate.ld));
 2647|  1.16k|	memset(&rar5->cstate.dd, 0, sizeof(rar5->cstate.dd));
 2648|  1.16k|	memset(&rar5->cstate.ldd, 0, sizeof(rar5->cstate.ldd));
 2649|  1.16k|	memset(&rar5->cstate.rd, 0, sizeof(rar5->cstate.rd));
 2650|  1.16k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.16k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2651|  1.16k|}
archive_read_support_format_rar5.c:process_block:
 3709|  19.0k|static int process_block(struct archive_read* a) {
 3710|  19.0k|	struct rar5 *rar5 = a->format->data;
 3711|  19.0k|	const uint8_t* p;
 3712|  19.0k|	int ret;
 3713|       |
 3714|       |	/* If we don't have any data to be processed, this most probably means
 3715|       |	 * we need to switch to the next volume. */
 3716|  19.0k|	if(rar5->main.volume && rar5->file.bytes_remaining == 0) {
  ------------------
  |  Branch (3716:5): [True: 7.23k, False: 11.7k]
  |  Branch (3716:26): [True: 615, False: 6.62k]
  ------------------
 3717|       |		/* Capture 'split after' before advancing: advance_multivolume()
 3718|       |		 * parses following headers and overwrites this flag. */
 3719|    615|		int split_after = rar5->generic.split_after > 0;
 3720|    615|		ret = advance_multivolume(a);
 3721|    615|		if(ret == ARCHIVE_EOF && split_after) {
  ------------------
  |  |  232|  1.23k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (3721:6): [True: 190, False: 425]
  |  Branch (3721:28): [True: 29, False: 161]
  ------------------
 3722|       |			/* The file is promised to continue in a following
 3723|       |			 * volume, but the input ended first. */
 3724|     29|			return truncated_multivolume_error(a);
 3725|     29|		}
 3726|    586|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|    586|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3726:6): [True: 501, False: 85]
  ------------------
 3727|    501|			return ret;
 3728|    586|	}
 3729|       |
 3730|  18.4k|	if(rar5->cstate.block_parsing_finished) {
  ------------------
  |  Branch (3730:5): [True: 9.14k, False: 9.33k]
  ------------------
 3731|  9.14k|		ssize_t block_size;
 3732|  9.14k|		ssize_t to_skip;
 3733|  9.14k|		ssize_t cur_block_size;
 3734|       |
 3735|       |		/* The header size won't be bigger than 6 bytes. */
 3736|  9.14k|		if(!read_ahead(a, 6, &p)) {
  ------------------
  |  Branch (3736:6): [True: 176, False: 8.96k]
  ------------------
 3737|       |			/* Failed to prefetch data block header. */
 3738|    176|			return ARCHIVE_EOF;
  ------------------
  |  |  232|    176|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3739|    176|		}
 3740|       |
 3741|       |		/*
 3742|       |		 * Read block_size by parsing block header. Validate the header
 3743|       |		 * by calculating CRC byte stored inside the header. Size of
 3744|       |		 * the header is not constant (block size can be stored either
 3745|       |		 * in 1 or 2 bytes), that's why block size is left out from the
 3746|       |		 * `compressed_block_header` structure and returned by
 3747|       |		 * `parse_block_header` as the second argument. */
 3748|       |
 3749|  8.96k|		ret = parse_block_header(a, p, &block_size,
 3750|  8.96k|		    &rar5->last_block_hdr);
 3751|  8.96k|		if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  8.96k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3751:6): [True: 263, False: 8.70k]
  ------------------
 3752|    263|			return ret;
 3753|    263|		}
 3754|       |
 3755|       |		/* Skip block header. Next data is huffman tables,
 3756|       |		 * if present. */
 3757|  8.70k|		to_skip = sizeof(struct compressed_block_header) +
 3758|  8.70k|			bf_byte_count(&rar5->last_block_hdr) + 1;
 3759|       |
 3760|       |		/* If the block header's to_skip value exceeds the declared
 3761|       |		 * remaining data, the archive is malformed. */
 3762|  8.70k|		if(to_skip > rar5->file.bytes_remaining) {
  ------------------
  |  Branch (3762:6): [True: 32, False: 8.67k]
  ------------------
 3763|     32|			archive_set_error(&a->archive,
 3764|     32|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     32|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3765|     32|			    "Block header size exceeds remaining file data");
 3766|     32|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|     32|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3767|     32|		}
 3768|       |
 3769|  8.67k|		if(ARCHIVE_OK != consume(a, to_skip))
  ------------------
  |  |  233|  8.67k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3769:6): [True: 0, False: 8.67k]
  ------------------
 3770|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3771|       |
 3772|  8.67k|		rar5->file.bytes_remaining -= to_skip;
 3773|       |
 3774|       |		/* The block size gives information about the whole block size,
 3775|       |		 * but the block could be stored in split form when using
 3776|       |		 * multi-volume archives. In this case, the block size will be
 3777|       |		 * bigger than the actual data stored in this file. Remaining
 3778|       |		 * part of the data will be in another file. */
 3779|       |
 3780|  8.67k|		cur_block_size =
 3781|  8.67k|			rar5_min(rar5->file.bytes_remaining, block_size);
  ------------------
  |  |   60|  8.67k|#define rar5_min(a, b) (((a) > (b)) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (60:25): [True: 6.95k, False: 1.71k]
  |  |  ------------------
  ------------------
 3782|       |
 3783|  8.67k|		if(block_size > rar5->file.bytes_remaining) {
  ------------------
  |  Branch (3783:6): [True: 167, False: 8.50k]
  ------------------
 3784|       |			/* If current blocks' size is bigger than our data
 3785|       |			 * size, this means we have a multivolume archive.
 3786|       |			 * In this case, skip all base headers until the end
 3787|       |			 * of the file, proceed to next "partXXX.rar" volume,
 3788|       |			 * find its signature, skip all headers up to the first
 3789|       |			 * FILE base header, and continue from there.
 3790|       |			 *
 3791|       |			 * Note that `merge_block` will update the `rar`
 3792|       |			 * context structure quite extensively. */
 3793|       |
 3794|    167|			ret = merge_block(a, block_size, &p);
 3795|    167|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|    167|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3795:7): [True: 161, False: 6]
  ------------------
 3796|    161|				return ret;
 3797|    161|			}
 3798|       |
 3799|      6|			cur_block_size = block_size;
 3800|       |
 3801|       |			/* Current stream pointer should be now directly
 3802|       |			 * *after* the block that spanned through multiple
 3803|       |			 * archive files. `p` pointer should have the data of
 3804|       |			 * the *whole* block (merged from partial blocks
 3805|       |			 * stored in multiple archives files). */
 3806|  8.50k|		} else {
 3807|  8.50k|			rar5->cstate.switch_multivolume = 0;
 3808|       |
 3809|       |			/* Read the whole block size into memory. This can take
 3810|       |			 * up to  8 megabytes of memory in theoretical cases.
 3811|       |			 * Might be worth to optimize this and use a standard
 3812|       |			 * chunk of 4kb's. */
 3813|  8.50k|			if(!read_ahead(a, 4 + cur_block_size, &p)) {
  ------------------
  |  Branch (3813:7): [True: 574, False: 7.92k]
  ------------------
 3814|       |				/* Failed to prefetch block data. */
 3815|    574|				return ARCHIVE_EOF;
  ------------------
  |  |  232|    574|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3816|    574|			}
 3817|  8.50k|		}
 3818|       |
 3819|  7.93k|		rar5->cstate.block_buf = p;
 3820|  7.93k|		rar5->cstate.cur_block_size = cur_block_size;
 3821|  7.93k|		rar5->cstate.block_parsing_finished = 0;
 3822|       |
 3823|  7.93k|		rar5->bits.in_addr = 0;
 3824|  7.93k|		rar5->bits.bit_addr = 0;
 3825|       |
 3826|  7.93k|		if(bf_is_table_present(&rar5->last_block_hdr)) {
  ------------------
  |  Branch (3826:6): [True: 1.89k, False: 6.04k]
  ------------------
 3827|       |			/* Load Huffman tables. */
 3828|  1.89k|			ret = parse_tables(a, rar5, p);
 3829|  1.89k|			if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.89k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3829:7): [True: 694, False: 1.19k]
  ------------------
 3830|       |				/* Error during decompression of Huffman
 3831|       |				 * tables. */
 3832|    694|				return ret;
 3833|    694|			}
 3834|  1.89k|		}
 3835|  9.33k|	} else {
 3836|       |		/* Block parsing not finished, reuse previous memory buffer. */
 3837|  9.33k|		p = rar5->cstate.block_buf;
 3838|  9.33k|	}
 3839|       |
 3840|       |	/* Uncompress the block, or a part of it, depending on how many bytes
 3841|       |	 * will be generated by uncompressing the block.
 3842|       |	 *
 3843|       |	 * In case too many bytes will be generated, calling this function
 3844|       |	 * again will resume the uncompression operation. */
 3845|  16.5k|	ret = do_uncompress_block(a, p);
 3846|  16.5k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  16.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3846:5): [True: 419, False: 16.1k]
  ------------------
 3847|    419|		return ret;
 3848|    419|	}
 3849|       |
 3850|  16.1k|	if(rar5->cstate.block_parsing_finished &&
  ------------------
  |  Branch (3850:5): [True: 7.52k, False: 8.62k]
  ------------------
 3851|  7.52k|	    rar5->cstate.switch_multivolume == 0 &&
  ------------------
  |  Branch (3851:6): [True: 7.52k, False: 1]
  ------------------
 3852|  7.52k|	    rar5->cstate.cur_block_size > 0)
  ------------------
  |  Branch (3852:6): [True: 4.96k, False: 2.56k]
  ------------------
 3853|  4.96k|	{
 3854|       |		/* If we're processing a normal block, consume the whole
 3855|       |		 * block. We can do this because we've already read the whole
 3856|       |		 * block to memory. */
 3857|  4.96k|		if(ARCHIVE_OK != consume(a, rar5->cstate.cur_block_size))
  ------------------
  |  |  233|  4.96k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3857:6): [True: 0, False: 4.96k]
  ------------------
 3858|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3859|       |
 3860|  4.96k|		rar5->file.bytes_remaining -= rar5->cstate.cur_block_size;
 3861|  11.1k|	} else if(rar5->cstate.switch_multivolume) {
  ------------------
  |  Branch (3861:12): [True: 1, False: 11.1k]
  ------------------
 3862|       |		/* Don't consume the block if we're doing multivolume
 3863|       |		 * processing. The volume switching function will consume
 3864|       |		 * the proper count of bytes instead. */
 3865|      1|		rar5->cstate.switch_multivolume = 0;
 3866|      1|	}
 3867|       |
 3868|  16.1k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  16.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3869|  16.1k|}
archive_read_support_format_rar5.c:parse_block_header:
 2980|  8.96k|{
 2981|  8.96k|	uint8_t calculated_cksum;
 2982|  8.96k|	memcpy(hdr, p, sizeof(struct compressed_block_header));
 2983|       |
 2984|  8.96k|	if(bf_byte_count(hdr) > 2) {
  ------------------
  |  Branch (2984:5): [True: 263, False: 8.70k]
  ------------------
 2985|    263|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    263|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2986|    263|		    "Unsupported block header size (was %d, max is 2)",
 2987|    263|		    bf_byte_count(hdr));
 2988|    263|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|    263|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2989|    263|	}
 2990|       |
 2991|       |	/* This should probably use bit reader interface in order to be more
 2992|       |	 * future-proof. */
 2993|  8.70k|	*block_size = 0;
 2994|  8.70k|	switch(bf_byte_count(hdr)) {
 2995|       |		/* 1-byte block size */
 2996|  8.08k|		case 0:
  ------------------
  |  Branch (2996:3): [True: 8.08k, False: 621]
  ------------------
 2997|  8.08k|			*block_size = *(const uint8_t*) &p[2];
 2998|  8.08k|			break;
 2999|       |
 3000|       |		/* 2-byte block size */
 3001|    525|		case 1:
  ------------------
  |  Branch (3001:3): [True: 525, False: 8.17k]
  ------------------
 3002|    525|			*block_size = archive_le16dec(&p[2]);
 3003|    525|			break;
 3004|       |
 3005|       |		/* 3-byte block size */
 3006|     96|		case 2:
  ------------------
  |  Branch (3006:3): [True: 96, False: 8.60k]
  ------------------
 3007|     96|			*block_size = archive_le32dec(&p[2]);
 3008|     96|			*block_size &= 0x00FFFFFF;
 3009|     96|			break;
 3010|       |
 3011|       |		/* Other block sizes are not supported. This case is not
 3012|       |		 * reached, because we have an 'if' guard before the switch
 3013|       |		 * that makes sure of it. */
 3014|      0|		default:
  ------------------
  |  Branch (3014:3): [True: 0, False: 8.70k]
  ------------------
 3015|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3016|  8.70k|	}
 3017|       |
 3018|       |	/* Verify the block header checksum. 0x5A is a magic value and is
 3019|       |	 * always * constant. */
 3020|  8.70k|	calculated_cksum = 0x5A
 3021|  8.70k|	    ^ (uint8_t) hdr->block_flags_u8
 3022|  8.70k|	    ^ (uint8_t) *block_size
 3023|  8.70k|	    ^ (uint8_t) (*block_size >> 8)
 3024|  8.70k|	    ^ (uint8_t) (*block_size >> 16);
 3025|       |
 3026|  8.70k|	if(calculated_cksum != hdr->block_cksum) {
  ------------------
  |  Branch (3026:5): [True: 7.21k, False: 1.49k]
  ------------------
 3027|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 3028|       |		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
 3029|       |		    "Block checksum error: got 0x%x, expected 0x%x",
 3030|       |		    hdr->block_cksum, calculated_cksum);
 3031|       |
 3032|       |		return ARCHIVE_FAILED;
 3033|       |#endif
 3034|  7.21k|	}
 3035|       |
 3036|  8.70k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  8.70k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3037|  8.70k|}
archive_read_support_format_rar5.c:bf_byte_count:
  514|  26.6k|uint8_t bf_byte_count(const struct compressed_block_header* hdr) {
  515|  26.6k|	return (hdr->block_flags_u8 >> 3) & 7;
  516|  26.6k|}
archive_read_support_format_rar5.c:merge_block:
 3582|    167|{
 3583|    167|	struct rar5 *rar5 = a->format->data;
 3584|    167|	ssize_t cur_block_size, partial_offset = 0;
 3585|    167|	const uint8_t* lp;
 3586|    167|	int ret;
 3587|       |
 3588|    167|	if(rar5->merge_mode) {
  ------------------
  |  Branch (3588:5): [True: 0, False: 167]
  ------------------
 3589|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3590|      0|		    "Recursive merge is not allowed");
 3591|       |
 3592|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3593|      0|	}
 3594|       |
 3595|       |	/* Set a flag that we're in the switching mode. */
 3596|    167|	rar5->cstate.switch_multivolume = 1;
 3597|       |
 3598|       |	/* Reallocate the memory which will hold the whole block. */
 3599|    167|	if(rar5->vol.push_buf)
  ------------------
  |  Branch (3599:5): [True: 0, False: 167]
  ------------------
 3600|      0|		free((void*) rar5->vol.push_buf);
 3601|       |
 3602|       |	/* Increasing the allocation block by 8 is due to bit reading functions,
 3603|       |	 * which are using additional 2 or 4 bytes. Allocating the block size
 3604|       |	 * by exact value would make bit reader perform reads from invalid
 3605|       |	 * memory block when reading the last byte from the buffer. */
 3606|    167|	rar5->vol.push_buf = malloc(block_size + 8);
 3607|    167|	if(!rar5->vol.push_buf) {
  ------------------
  |  Branch (3607:5): [True: 0, False: 167]
  ------------------
 3608|      0|		archive_set_error(&a->archive, ENOMEM,
 3609|      0|		    "Can't allocate memory for a merge block buffer");
 3610|      0|		rar5->cstate.switch_multivolume = 0;
 3611|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3612|      0|	}
 3613|       |
 3614|       |	/* Valgrind complains if the extension block for bit reader is not
 3615|       |	 * initialized, so initialize it. */
 3616|    167|	memset(&rar5->vol.push_buf[block_size], 0, 8);
 3617|       |
 3618|       |	/* A single block can span across multiple multivolume archive files,
 3619|       |	 * so we use a loop here. This loop will consume enough multivolume
 3620|       |	 * archive files until the whole block is read. */
 3621|       |
 3622|  1.15k|	while(1) {
  ------------------
  |  Branch (3622:8): [True: 1.15k, Folded]
  ------------------
 3623|       |		/* Get the size of current block chunk in this multivolume
 3624|       |		 * archive file and read it. */
 3625|  1.15k|		cur_block_size = rar5_min(rar5->file.bytes_remaining,
  ------------------
  |  |   60|  1.15k|#define rar5_min(a, b) (((a) > (b)) ? (b) : (a))
  |  |  ------------------
  |  |  |  Branch (60:25): [True: 7, False: 1.14k]
  |  |  ------------------
  ------------------
 3626|  1.15k|		    block_size - partial_offset);
 3627|       |
 3628|  1.15k|		if(cur_block_size < 1) {
  ------------------
  |  Branch (3628:6): [True: 7, False: 1.14k]
  ------------------
 3629|       |			/* bytes_remaining is less than 1 at the wrong point in
 3630|       |			 * the merge loop, indicating corrupt volume
 3631|       |			 * accounting. */
 3632|      7|			archive_set_error(&a->archive,
 3633|      7|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      7|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3634|      7|			    "Encountered invalid block size during block merge");
 3635|      7|			rar5->cstate.switch_multivolume = 0;
 3636|      7|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3637|      7|		}
 3638|       |
 3639|  1.14k|		if(!read_ahead(a, cur_block_size, &lp)) {
  ------------------
  |  Branch (3639:6): [True: 38, False: 1.10k]
  ------------------
 3640|       |			/* We are in the middle of merging a block that spans
 3641|       |			 * volumes, so more data must follow; running out of
 3642|       |			 * input here means the following volume is missing. */
 3643|     38|			rar5->cstate.switch_multivolume = 0;
 3644|     38|			return truncated_multivolume_error(a);
 3645|     38|		}
 3646|       |
 3647|       |		/* Sanity check; there should never be a situation where this
 3648|       |		 * function reads more data than the block's size. */
 3649|  1.10k|		if(partial_offset + cur_block_size > block_size) {
  ------------------
  |  Branch (3649:6): [True: 0, False: 1.10k]
  ------------------
 3650|      0|			archive_set_error(&a->archive,
 3651|      0|			    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3652|      0|			    "Consumed too much data when merging blocks");
 3653|      0|			rar5->cstate.switch_multivolume = 0;
 3654|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3655|      0|		}
 3656|       |
 3657|       |		/* Merge previous block chunk with current block chunk,
 3658|       |		 * or create first block chunk if this is our first
 3659|       |		 * iteration. */
 3660|  1.10k|		memcpy(&rar5->vol.push_buf[partial_offset], lp, cur_block_size);
 3661|       |
 3662|       |		/* Advance the stream read pointer by this block chunk size. */
 3663|  1.10k|		if(ARCHIVE_OK != consume(a, cur_block_size)) {
  ------------------
  |  |  233|  1.10k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3663:6): [True: 0, False: 1.10k]
  ------------------
 3664|       |			/* Data was copied but stream pointer didn't advance;
 3665|       |			 * stream position is unrecoverable. */
 3666|      0|			rar5->cstate.switch_multivolume = 0;
 3667|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3668|      0|		}
 3669|       |
 3670|       |		/* Update the pointers. `partial_offset` contains information
 3671|       |		 * about the sum of merged block chunks. */
 3672|  1.10k|		partial_offset += cur_block_size;
 3673|  1.10k|		rar5->file.bytes_remaining -= cur_block_size;
 3674|       |
 3675|       |		/* If `partial_offset` is the same as `block_size`, this means
 3676|       |		 * we've merged all block chunks and we have a valid full
 3677|       |		 * block. */
 3678|  1.10k|		if(partial_offset == block_size) {
  ------------------
  |  Branch (3678:6): [True: 6, False: 1.10k]
  ------------------
 3679|      6|			break;
 3680|      6|		}
 3681|       |
 3682|       |		/* If we don't have any bytes to read, this means we should
 3683|       |		 * switch to another multivolume archive file. */
 3684|  1.10k|		if(rar5->file.bytes_remaining == 0) {
  ------------------
  |  Branch (3684:6): [True: 1.10k, False: 0]
  ------------------
 3685|  1.10k|			rar5->merge_mode++;
 3686|  1.10k|			ret = advance_multivolume(a);
 3687|  1.10k|			rar5->merge_mode--;
 3688|  1.10k|			if(ret == ARCHIVE_EOF) {
  ------------------
  |  |  232|  1.10k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (3688:7): [True: 62, False: 1.04k]
  ------------------
 3689|       |				/* The block is only partially merged but the
 3690|       |				 * input ended, so the volume that holds the rest
 3691|       |				 * of it is missing. */
 3692|     62|				rar5->cstate.switch_multivolume = 0;
 3693|     62|				return truncated_multivolume_error(a);
 3694|  1.04k|			} else if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.04k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3694:14): [True: 54, False: 987]
  ------------------
 3695|     54|				rar5->cstate.switch_multivolume = 0;
 3696|     54|				return ret;
 3697|     54|			}
 3698|  1.10k|		}
 3699|  1.10k|	}
 3700|       |
 3701|      6|	*p = rar5->vol.push_buf;
 3702|       |
 3703|       |	/* If we're here, we can resume unpacking by processing the block
 3704|       |	 * pointed to by the `*p` memory pointer. */
 3705|       |
 3706|      6|	return ARCHIVE_OK;
  ------------------
  |  |  233|      6|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3707|    167|}
archive_read_support_format_rar5.c:bf_is_table_present:
  519|  7.93k|uint8_t bf_is_table_present(const struct compressed_block_header* hdr) {
  520|  7.93k|	return (hdr->block_flags_u8 >> 7) & 1;
  521|  7.93k|}
archive_read_support_format_rar5.c:parse_tables:
 2807|  1.89k|{
 2808|  1.89k|	int ret, value, i, w, idx = 0;
 2809|  1.89k|	uint8_t bit_length[HUFF_BC],
 2810|  1.89k|		table[HUFF_TABLE_SIZE],
 2811|  1.89k|		nibble_mask = 0xF0,
 2812|  1.89k|		nibble_shift = 4;
 2813|       |
 2814|  1.89k|	enum { ESCAPE = 15 };
 2815|       |
 2816|       |	/* The data for table generation is compressed using a simple RLE-like
 2817|       |	 * algorithm when storing zeroes, so we need to unpack it first. */
 2818|  23.5k|	for(w = 0, i = 0; w < HUFF_BC;) {
  ------------------
  |  |  259|  23.5k|#define HUFF_BC 20
  ------------------
  |  Branch (2818:20): [True: 21.6k, False: 1.86k]
  ------------------
 2819|  21.6k|		if(i >= rar5->cstate.cur_block_size) {
  ------------------
  |  Branch (2819:6): [True: 32, False: 21.6k]
  ------------------
 2820|       |			/* Truncated data, can't continue. */
 2821|     32|			archive_set_error(&a->archive,
 2822|     32|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     32|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2823|     32|			    "Truncated data in huffman tables");
 2824|     32|			return ARCHIVE_FAILED;
  ------------------
  |  |  237|     32|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2825|     32|		}
 2826|       |
 2827|  21.6k|		value = (p[i] & nibble_mask) >> nibble_shift;
 2828|       |
 2829|  21.6k|		if(nibble_mask == 0x0F)
  ------------------
  |  Branch (2829:6): [True: 10.7k, False: 10.8k]
  ------------------
 2830|  10.7k|			++i;
 2831|       |
 2832|  21.6k|		nibble_mask ^= 0xFF;
 2833|  21.6k|		nibble_shift ^= 4;
 2834|       |
 2835|       |		/* Values smaller than 15 is data, so we write it directly.
 2836|       |		 * Value 15 is a flag telling us that we need to unpack more
 2837|       |		 * bytes. */
 2838|  21.6k|		if(value == ESCAPE) {
  ------------------
  |  Branch (2838:6): [True: 1.83k, False: 19.8k]
  ------------------
 2839|  1.83k|			value = (p[i] & nibble_mask) >> nibble_shift;
 2840|  1.83k|			if(nibble_mask == 0x0F)
  ------------------
  |  Branch (2840:7): [True: 194, False: 1.64k]
  ------------------
 2841|    194|				++i;
 2842|  1.83k|			nibble_mask ^= 0xFF;
 2843|  1.83k|			nibble_shift ^= 4;
 2844|       |
 2845|  1.83k|			if(value == 0) {
  ------------------
  |  Branch (2845:7): [True: 167, False: 1.67k]
  ------------------
 2846|       |				/* We sometimes need to write the actual value
 2847|       |				 * of 15, so this case handles that. */
 2848|    167|				bit_length[w++] = ESCAPE;
 2849|  1.67k|			} else {
 2850|  1.67k|				int k;
 2851|       |
 2852|       |				/* Fill zeroes. */
 2853|  19.0k|				for(k = 0; (k < value + 2) && (w < HUFF_BC);
  ------------------
  |  |  259|  17.4k|#define HUFF_BC 20
  ------------------
  |  Branch (2853:16): [True: 17.4k, False: 1.55k]
  |  Branch (2853:35): [True: 17.3k, False: 120]
  ------------------
 2854|  17.3k|				    k++) {
 2855|  17.3k|					bit_length[w++] = 0;
 2856|  17.3k|				}
 2857|  1.67k|			}
 2858|  19.8k|		} else {
 2859|  19.8k|			bit_length[w++] = value;
 2860|  19.8k|		}
 2861|  21.6k|	}
 2862|       |
 2863|  1.86k|	rar5->bits.in_addr = i;
 2864|  1.86k|	rar5->bits.bit_addr = nibble_shift ^ 4;
 2865|       |
 2866|  1.86k|	ret = create_decode_tables(bit_length, &rar5->cstate.bd, HUFF_BC);
  ------------------
  |  |  259|  1.86k|#define HUFF_BC 20
  ------------------
 2867|  1.86k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.86k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2867:5): [True: 124, False: 1.73k]
  ------------------
 2868|    124|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    124|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2869|    124|		    "Decoding huffman tables failed");
 2870|    124|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|    124|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2871|    124|	}
 2872|       |
 2873|   128k|	for(i = 0; i < HUFF_TABLE_SIZE;) {
  ------------------
  |  |  269|   128k|#define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  261|   128k|#define HUFF_NC 306
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  263|   128k|#define HUFF_DC 64
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  267|   128k|#define HUFF_RC 44
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  265|   128k|#define HUFF_LDC 16
  |  |  ------------------
  ------------------
  |  Branch (2873:13): [True: 126k, False: 1.60k]
  ------------------
 2874|   126k|		uint16_t num;
 2875|       |
 2876|   126k|		ret = decode_number(a, &rar5->cstate.bd, p, &num);
 2877|   126k|		if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|   126k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2877:6): [True: 112, False: 126k]
  ------------------
 2878|    112|			archive_set_error(&a->archive,
 2879|    112|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    112|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2880|    112|			    "Decoding huffman tables failed");
 2881|    112|			return ARCHIVE_FAILED;
  ------------------
  |  |  237|    112|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2882|    112|		}
 2883|       |
 2884|   126k|		if(num < 16) {
  ------------------
  |  Branch (2884:6): [True: 105k, False: 20.9k]
  ------------------
 2885|       |			/* 0..15: store directly */
 2886|   105k|			table[i] = (uint8_t) num;
 2887|   105k|			i++;
 2888|   105k|		} else if(num < 18) {
  ------------------
  |  Branch (2888:13): [True: 1.25k, False: 19.7k]
  ------------------
 2889|       |			/* 16..17: repeat previous code */
 2890|  1.25k|			uint16_t n;
 2891|       |
 2892|  1.25k|			if(ARCHIVE_OK != (ret = read_bits_16(a, rar5, p, &n)))
  ------------------
  |  |  233|  1.25k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2892:7): [True: 3, False: 1.24k]
  ------------------
 2893|      3|				return ret;
 2894|       |
 2895|  1.24k|			if(num == 16) {
  ------------------
  |  Branch (2895:7): [True: 510, False: 737]
  ------------------
 2896|    510|				n >>= 13;
 2897|    510|				n += 3;
 2898|    510|				skip_bits(rar5, 3);
 2899|    737|			} else {
 2900|    737|				n >>= 9;
 2901|    737|				n += 11;
 2902|    737|				skip_bits(rar5, 7);
 2903|    737|			}
 2904|       |
 2905|  1.24k|			if(i > 0) {
  ------------------
  |  Branch (2905:7): [True: 1.23k, False: 10]
  ------------------
 2906|  54.0k|				while(n-- > 0 && i < HUFF_TABLE_SIZE) {
  ------------------
  |  |  269|  52.9k|#define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  261|  52.9k|#define HUFF_NC 306
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  263|  52.9k|#define HUFF_DC 64
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  267|  52.9k|#define HUFF_RC 44
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  265|  52.9k|#define HUFF_LDC 16
  |  |  ------------------
  ------------------
  |  Branch (2906:11): [True: 52.9k, False: 1.12k]
  |  Branch (2906:22): [True: 52.8k, False: 117]
  ------------------
 2907|  52.8k|					table[i] = table[i - 1];
 2908|  52.8k|					i++;
 2909|  52.8k|				}
 2910|  1.23k|			} else {
 2911|     10|				archive_set_error(&a->archive,
 2912|     10|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     10|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2913|     10|				    "Unexpected error when decoding "
 2914|     10|				    "huffman tables");
 2915|     10|				return ARCHIVE_FAILED;
  ------------------
  |  |  237|     10|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2916|     10|			}
 2917|  19.7k|		} else {
 2918|       |			/* other codes: fill with zeroes `n` times */
 2919|  19.7k|			uint16_t n;
 2920|       |
 2921|  19.7k|			if(ARCHIVE_OK != (ret = read_bits_16(a, rar5, p, &n)))
  ------------------
  |  |  233|  19.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2921:7): [True: 4, False: 19.7k]
  ------------------
 2922|      4|				return ret;
 2923|       |
 2924|  19.7k|			if(num == 18) {
  ------------------
  |  Branch (2924:7): [True: 11.5k, False: 8.14k]
  ------------------
 2925|  11.5k|				n >>= 13;
 2926|  11.5k|				n += 3;
 2927|  11.5k|				skip_bits(rar5, 3);
 2928|  11.5k|			} else {
 2929|  8.14k|				n >>= 9;
 2930|  8.14k|				n += 11;
 2931|  8.14k|				skip_bits(rar5, 7);
 2932|  8.14k|			}
 2933|       |
 2934|   570k|			while(n-- > 0 && i < HUFF_TABLE_SIZE)
  ------------------
  |  |  269|   552k|#define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  261|   552k|#define HUFF_NC 306
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  263|   552k|#define HUFF_DC 64
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  267|   552k|#define HUFF_RC 44
  |  |  ------------------
  |  |               #define HUFF_TABLE_SIZE (HUFF_NC + HUFF_DC + HUFF_RC + HUFF_LDC)
  |  |  ------------------
  |  |  |  |  265|   552k|#define HUFF_LDC 16
  |  |  ------------------
  ------------------
  |  Branch (2934:10): [True: 552k, False: 18.4k]
  |  Branch (2934:21): [True: 550k, False: 1.22k]
  ------------------
 2935|   550k|				table[i++] = 0;
 2936|  19.7k|		}
 2937|   126k|	}
 2938|       |
 2939|  1.60k|	ret = create_decode_tables(&table[idx], &rar5->cstate.ld, HUFF_NC);
  ------------------
  |  |  261|  1.60k|#define HUFF_NC 306
  ------------------
 2940|  1.60k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.60k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2940:5): [True: 294, False: 1.31k]
  ------------------
 2941|    294|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    294|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2942|    294|		     "Failed to create literal table");
 2943|    294|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|    294|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2944|    294|	}
 2945|       |
 2946|  1.31k|	idx += HUFF_NC;
  ------------------
  |  |  261|  1.31k|#define HUFF_NC 306
  ------------------
 2947|       |
 2948|  1.31k|	ret = create_decode_tables(&table[idx], &rar5->cstate.dd, HUFF_DC);
  ------------------
  |  |  263|  1.31k|#define HUFF_DC 64
  ------------------
 2949|  1.31k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.31k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2949:5): [True: 46, False: 1.26k]
  ------------------
 2950|     46|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     46|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2951|     46|		    "Failed to create distance table");
 2952|     46|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|     46|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2953|     46|	}
 2954|       |
 2955|  1.26k|	idx += HUFF_DC;
  ------------------
  |  |  263|  1.26k|#define HUFF_DC 64
  ------------------
 2956|       |
 2957|  1.26k|	ret = create_decode_tables(&table[idx], &rar5->cstate.ldd, HUFF_LDC);
  ------------------
  |  |  265|  1.26k|#define HUFF_LDC 16
  ------------------
 2958|  1.26k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.26k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2958:5): [True: 9, False: 1.25k]
  ------------------
 2959|      9|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      9|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2960|      9|		    "Failed to create lower bits of distances table");
 2961|      9|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      9|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2962|      9|	}
 2963|       |
 2964|  1.25k|	idx += HUFF_LDC;
  ------------------
  |  |  265|  1.25k|#define HUFF_LDC 16
  ------------------
 2965|       |
 2966|  1.25k|	ret = create_decode_tables(&table[idx], &rar5->cstate.rd, HUFF_RC);
  ------------------
  |  |  267|  1.25k|#define HUFF_RC 44
  ------------------
 2967|  1.25k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.25k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2967:5): [True: 60, False: 1.19k]
  ------------------
 2968|     60|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     60|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2969|     60|		    "Failed to create repeating distances table");
 2970|     60|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|     60|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2971|     60|	}
 2972|       |
 2973|  1.19k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.19k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2974|  1.25k|}
archive_read_support_format_rar5.c:create_decode_tables:
 2687|  7.30k|{
 2688|  7.30k|	int code, upper_limit = 0, i, lc[16];
 2689|  7.30k|	uint32_t decode_pos_clone[rar5_countof(table->decode_pos)];
 2690|  7.30k|	ssize_t cur_len, quick_data_size;
 2691|       |
 2692|  7.30k|	memset(&lc, 0, sizeof(lc));
 2693|  7.30k|	memset(table->decode_num, 0, sizeof(table->decode_num));
 2694|  7.30k|	table->size = size;
 2695|  7.30k|	table->quick_bits = size == HUFF_NC ? 10 : 7;
  ------------------
  |  |  261|  7.30k|#define HUFF_NC 306
  ------------------
  |  Branch (2695:22): [True: 1.60k, False: 5.69k]
  ------------------
 2696|       |
 2697|   695k|	for(i = 0; i < size; i++) {
  ------------------
  |  Branch (2697:13): [True: 688k, False: 7.30k]
  ------------------
 2698|   688k|		lc[bit_length[i] & 15]++;
 2699|   688k|	}
 2700|       |
 2701|  7.30k|	lc[0] = 0;
 2702|  7.30k|	table->decode_pos[0] = 0;
 2703|  7.30k|	table->decode_len[0] = 0;
 2704|       |
 2705|   116k|	for(i = 1; i < 16; i++) {
  ------------------
  |  Branch (2705:13): [True: 109k, False: 7.30k]
  ------------------
 2706|   109k|		upper_limit += lc[i];
 2707|       |
 2708|   109k|		table->decode_len[i] = upper_limit << (16 - i);
 2709|   109k|		table->decode_pos[i] = table->decode_pos[i - 1] + lc[i - 1];
 2710|       |
 2711|   109k|		upper_limit <<= 1;
 2712|   109k|	}
 2713|       |
 2714|       |	/* Verify the code-length distribution is not over-subscribed.
 2715|       |	 * After the loop above, upper_limit == sum(lc[i] * 2^(16-i)).
 2716|       |	 * For a valid prefix-free code this must be <= 2^16 = 65536.
 2717|       |	 * An over-subscribed table (> 65536) cannot produce a valid
 2718|       |	 * decode table and must be rejected. */
 2719|  7.30k|	if(upper_limit > 65536) {
  ------------------
  |  Branch (2719:5): [True: 533, False: 6.77k]
  ------------------
 2720|    533|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|    533|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2721|    533|	}
 2722|       |
 2723|  6.77k|	memcpy(decode_pos_clone, table->decode_pos, sizeof(decode_pos_clone));
 2724|       |
 2725|   597k|	for(i = 0; i < size; i++) {
  ------------------
  |  Branch (2725:13): [True: 590k, False: 6.77k]
  ------------------
 2726|   590k|		uint8_t clen = bit_length[i] & 15;
 2727|   590k|		if(clen > 0) {
  ------------------
  |  Branch (2727:6): [True: 110k, False: 479k]
  ------------------
 2728|   110k|			int last_pos = decode_pos_clone[clen];
 2729|   110k|			table->decode_num[last_pos] = i;
 2730|   110k|			decode_pos_clone[clen]++;
 2731|   110k|		}
 2732|   590k|	}
 2733|       |
 2734|  6.77k|	quick_data_size = (int64_t)1 << table->quick_bits;
 2735|  6.77k|	cur_len = 1;
 2736|  2.05M|	for(code = 0; code < quick_data_size; code++) {
  ------------------
  |  Branch (2736:16): [True: 2.04M, False: 6.77k]
  ------------------
 2737|  2.04M|		int bit_field = code << (16 - table->quick_bits);
 2738|  2.04M|		int dist, pos;
 2739|       |
 2740|  2.14M|		while(cur_len < rar5_countof(table->decode_len) &&
  ------------------
  |  |   62|  4.28M|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (2740:9): [True: 1.15M, False: 989k]
  ------------------
 2741|  1.15M|				bit_field >= table->decode_len[cur_len]) {
  ------------------
  |  Branch (2741:5): [True: 99.2k, False: 1.05M]
  ------------------
 2742|  99.2k|			cur_len++;
 2743|  99.2k|		}
 2744|       |
 2745|  2.04M|		table->quick_len[code] = (uint8_t) cur_len;
 2746|       |
 2747|  2.04M|		dist = bit_field - table->decode_len[cur_len - 1];
 2748|  2.04M|		dist >>= (16 - cur_len);
 2749|       |
 2750|  2.04M|		pos = table->decode_pos[cur_len & 15] + dist;
 2751|  2.04M|		if(cur_len < rar5_countof(table->decode_pos) && pos < size) {
  ------------------
  |  |   62|  4.08M|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (2751:6): [True: 1.05M, False: 989k]
  |  Branch (2751:51): [True: 1.05M, False: 0]
  ------------------
 2752|  1.05M|			table->quick_num[code] = table->decode_num[pos];
 2753|  1.05M|		} else {
 2754|   989k|			table->quick_num[code] = 0;
 2755|   989k|		}
 2756|  2.04M|	}
 2757|       |
 2758|  6.77k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  6.77k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2759|  7.30k|}
archive_read_support_format_rar5.c:decode_number:
 2763|  1.84M|{
 2764|  1.84M|	struct rar5 *rar5 = a->format->data;
 2765|  1.84M|	int i, bits, dist, ret;
 2766|  1.84M|	uint16_t bitfield;
 2767|  1.84M|	uint32_t pos;
 2768|       |
 2769|  1.84M|	if(ARCHIVE_OK != (ret = read_bits_16(a, rar5, p, &bitfield))) {
  ------------------
  |  |  233|  1.84M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2769:5): [True: 154, False: 1.84M]
  ------------------
 2770|    154|		return ret;
 2771|    154|	}
 2772|       |
 2773|  1.84M|	bitfield &= 0xfffe;
 2774|       |
 2775|  1.84M|	if(bitfield < table->decode_len[table->quick_bits]) {
  ------------------
  |  Branch (2775:5): [True: 1.62M, False: 220k]
  ------------------
 2776|  1.62M|		int code = bitfield >> (16 - table->quick_bits);
 2777|  1.62M|		skip_bits(rar5, table->quick_len[code]);
 2778|  1.62M|		*num = table->quick_num[code];
 2779|  1.62M|		return ARCHIVE_OK;
  ------------------
  |  |  233|  1.62M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2780|  1.62M|	}
 2781|       |
 2782|   220k|	bits = 15;
 2783|       |
 2784|  1.39M|	for(i = table->quick_bits + 1; i < 15; i++) {
  ------------------
  |  Branch (2784:33): [True: 1.17M, False: 212k]
  ------------------
 2785|  1.17M|		if(bitfield < table->decode_len[i]) {
  ------------------
  |  Branch (2785:6): [True: 8.25k, False: 1.17M]
  ------------------
 2786|  8.25k|			bits = i;
 2787|  8.25k|			break;
 2788|  8.25k|		}
 2789|  1.17M|	}
 2790|       |
 2791|   220k|	skip_bits(rar5, bits);
 2792|       |
 2793|   220k|	dist = bitfield - table->decode_len[bits - 1];
 2794|   220k|	dist >>= (16 - bits);
 2795|   220k|	pos = table->decode_pos[bits] + dist;
 2796|       |
 2797|   220k|	if(pos >= table->size)
  ------------------
  |  Branch (2797:5): [True: 210k, False: 10.5k]
  ------------------
 2798|   210k|		pos = 0;
 2799|       |
 2800|   220k|	*num = table->decode_num[pos];
 2801|   220k|	return ARCHIVE_OK;
  ------------------
  |  |  233|   220k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2802|  1.84M|}
archive_read_support_format_rar5.c:read_bits_16:
 1044|  1.96M|{
 1045|  1.96M|	if(rar5->bits.in_addr >= rar5->cstate.cur_block_size) {
  ------------------
  |  Branch (1045:5): [True: 207, False: 1.96M]
  ------------------
 1046|    207|		archive_set_error(&a->archive,
 1047|    207|			ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|    207|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1048|    207|			"Premature end of stream during extraction of data (#2)");
 1049|    207|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|    207|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1050|    207|	}
 1051|       |
 1052|  1.96M|	uint32_t bits = archive_be24dec(p + (unsigned)rar5->bits.in_addr);
 1053|  1.96M|	bits >>= (8 - rar5->bits.bit_addr);
 1054|  1.96M|	*value = bits & 0xffff;
 1055|  1.96M|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.96M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1056|  1.96M|}
archive_read_support_format_rar5.c:skip_bits:
 1058|  1.97M|static void skip_bits(struct rar5 *rar5, int bits) {
 1059|  1.97M|	const int new_bits = rar5->bits.bit_addr + bits;
 1060|  1.97M|	rar5->bits.in_addr += new_bits >> 3;
 1061|  1.97M|	rar5->bits.bit_addr = new_bits & 7;
 1062|  1.97M|}
archive_read_support_format_rar5.c:do_uncompress_block:
 3216|  16.5k|static int do_uncompress_block(struct archive_read* a, const uint8_t* p) {
 3217|  16.5k|	struct rar5 *rar5 = a->format->data;
 3218|  16.5k|	uint16_t num;
 3219|  16.5k|	int ret;
 3220|       |
 3221|  16.5k|	const uint64_t cmask = rar5->cstate.window_mask;
 3222|  16.5k|	const struct compressed_block_header* hdr = &rar5->last_block_hdr;
 3223|  16.5k|	const uint8_t bit_size = 1 + bf_bit_size(hdr);
 3224|       |
 3225|  1.63M|	while(1) {
  ------------------
  |  Branch (3225:8): [True: 1.63M, Folded]
  ------------------
 3226|  1.63M|		if(rar5->cstate.write_ptr - rar5->cstate.last_write_ptr >
  ------------------
  |  Branch (3226:6): [True: 8.62k, False: 1.62M]
  ------------------
 3227|  1.63M|		    (rar5->cstate.window_size >> 1)) {
 3228|       |			/* Don't allow growing data by more than half of the
 3229|       |			 * window size at a time. In such case, break the loop;
 3230|       |			 *  next call to this function will continue processing
 3231|       |			 *  from this moment. */
 3232|  8.62k|			break;
 3233|  8.62k|		}
 3234|       |
 3235|  1.62M|		if(rar5->bits.in_addr > rar5->cstate.cur_block_size - 1 ||
  ------------------
  |  Branch (3235:6): [True: 5.36k, False: 1.62M]
  ------------------
 3236|  1.62M|		    (rar5->bits.in_addr == rar5->cstate.cur_block_size - 1 &&
  ------------------
  |  Branch (3236:8): [True: 5.00k, False: 1.61M]
  ------------------
 3237|  5.00k|		    rar5->bits.bit_addr >= bit_size))
  ------------------
  |  Branch (3237:7): [True: 2.16k, False: 2.83k]
  ------------------
 3238|  7.52k|		{
 3239|       |			/* If the program counter is here, it means the
 3240|       |			 * function has finished processing the block. */
 3241|  7.52k|			rar5->cstate.block_parsing_finished = 1;
 3242|  7.52k|			break;
 3243|  7.52k|		}
 3244|       |
 3245|       |		/* Decode the next literal. */
 3246|  1.62M|		if(ARCHIVE_OK != decode_number(a, &rar5->cstate.ld, p, &num)) {
  ------------------
  |  |  233|  1.62M|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3246:6): [True: 0, False: 1.62M]
  ------------------
 3247|      0|			return ARCHIVE_EOF;
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3248|      0|		}
 3249|       |
 3250|       |		/* Num holds a decompression literal, or 'command code'.
 3251|       |		 *
 3252|       |		 * - Values lower than 256 are just bytes. Those codes
 3253|       |		 *   can be stored in the output buffer directly.
 3254|       |		 *
 3255|       |		 * - Code 256 defines a new filter, which is later used to
 3256|       |		 *   transform the data block accordingly to the filter type.
 3257|       |		 *   The data block needs to be fully uncompressed first.
 3258|       |		 *
 3259|       |		 * - Code bigger than 257 and smaller than 262 define
 3260|       |		 *   a repetition pattern that should be copied from
 3261|       |		 *   an already uncompressed chunk of data.
 3262|       |		 */
 3263|       |
 3264|  1.62M|		if(num < 256) {
  ------------------
  |  Branch (3264:6): [True: 1.20M, False: 413k]
  ------------------
 3265|       |			/* Directly store the byte. */
 3266|  1.20M|			int64_t write_idx;
 3267|       |
 3268|       |			/* A literal write emits one byte; copy_string() checks len. */
 3269|  1.20M|			if(rar5->cstate.write_ptr >= rar5->file.unpacked_size) {
  ------------------
  |  Branch (3269:7): [True: 65, False: 1.20M]
  ------------------
 3270|     65|				archive_set_error(&a->archive,
 3271|     65|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     65|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3272|     65|				    "Uncompressed data exceeds declared size");
 3273|     65|				return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  239|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              				return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  237|     59|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3273:12): [True: 6, False: 59]
  ------------------
 3274|     65|			}
 3275|       |
 3276|  1.20M|			write_idx = rar5->cstate.solid_offset +
 3277|  1.20M|			    rar5->cstate.write_ptr++;
 3278|       |
 3279|  1.20M|			rar5->cstate.window_buf[write_idx & cmask] =
 3280|  1.20M|			    (uint8_t) num;
 3281|  1.20M|			continue;
 3282|  1.20M|		} else if(num >= 262) {
  ------------------
  |  Branch (3282:13): [True: 35.9k, False: 377k]
  ------------------
 3283|  35.9k|			uint16_t dist_slot;
 3284|  35.9k|			int len = decode_code_length(a, rar5, p, num - 262),
 3285|  35.9k|				dbits,
 3286|  35.9k|				dist = 1;
 3287|       |
 3288|  35.9k|			if(len == -1) {
  ------------------
  |  Branch (3288:7): [True: 7, False: 35.9k]
  ------------------
 3289|      7|				archive_set_error(&a->archive,
 3290|      7|				    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      7|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3291|      7|				    "Failed to decode the code length");
 3292|       |
 3293|      7|				return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              				return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  237|      5|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3293:12): [True: 2, False: 5]
  ------------------
 3294|      7|			}
 3295|       |
 3296|  35.9k|			if(ARCHIVE_OK != decode_number(a, &rar5->cstate.dd, p,
  ------------------
  |  |  233|  35.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3296:7): [True: 10, False: 35.9k]
  ------------------
 3297|  35.9k|			    &dist_slot))
 3298|     10|			{
 3299|     10|				archive_set_error(&a->archive,
 3300|     10|				    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|     10|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3301|     10|				    "Failed to decode the distance slot");
 3302|       |
 3303|     10|				return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              				return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  237|      9|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3303:12): [True: 1, False: 9]
  ------------------
 3304|     10|			}
 3305|       |
 3306|  35.9k|			if(dist_slot < 4) {
  ------------------
  |  Branch (3306:7): [True: 7.62k, False: 28.3k]
  ------------------
 3307|  7.62k|				dbits = 0;
 3308|  7.62k|				dist += dist_slot;
 3309|  28.3k|			} else {
 3310|  28.3k|				dbits = dist_slot / 2 - 1;
 3311|       |
 3312|       |				/* Cast to uint32_t will make sure the shift
 3313|       |				 * left operation won't produce undefined
 3314|       |				 * result. Then, the uint32_t type will
 3315|       |				 * be implicitly casted to int. */
 3316|  28.3k|				dist += (uint32_t) (2 |
 3317|  28.3k|				    (dist_slot & 1)) << dbits;
 3318|  28.3k|			}
 3319|       |
 3320|  35.9k|			if(dbits > 0) {
  ------------------
  |  Branch (3320:7): [True: 28.3k, False: 7.62k]
  ------------------
 3321|  28.3k|				if(dbits >= 4) {
  ------------------
  |  Branch (3321:8): [True: 20.2k, False: 8.07k]
  ------------------
 3322|  20.2k|					uint32_t add = 0;
 3323|  20.2k|					uint16_t low_dist;
 3324|       |
 3325|  20.2k|					if(dbits > 4) {
  ------------------
  |  Branch (3325:9): [True: 18.4k, False: 1.81k]
  ------------------
 3326|  18.4k|						if(ARCHIVE_OK != (ret = read_bits_32(
  ------------------
  |  |  233|  18.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3326:10): [True: 8, False: 18.4k]
  ------------------
 3327|  18.4k|						    a, rar5, p, &add))) {
 3328|       |							/* Return EOF if we
 3329|       |							 * can't read more
 3330|       |							 * data. */
 3331|      8|							return ret;
 3332|      8|						}
 3333|       |
 3334|  18.4k|						skip_bits(rar5, dbits - 4);
 3335|  18.4k|						add = (add >> (
 3336|  18.4k|						    36 - dbits)) << 4;
 3337|  18.4k|						dist += add;
 3338|  18.4k|					}
 3339|       |
 3340|  20.2k|					if(ARCHIVE_OK != decode_number(a,
  ------------------
  |  |  233|  20.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3340:9): [True: 20, False: 20.2k]
  ------------------
 3341|  20.2k|					    &rar5->cstate.ldd, p, &low_dist))
 3342|     20|					{
 3343|     20|						archive_set_error(&a->archive,
 3344|     20|						    ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|     20|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3345|     20|						    "Failed to decode the "
 3346|     20|						    "distance slot");
 3347|       |
 3348|     20|						return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              						return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  237|     17|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3348:14): [True: 3, False: 17]
  ------------------
 3349|     20|					}
 3350|       |
 3351|  20.2k|					if(dist >= INT_MAX - low_dist - 1) {
  ------------------
  |  Branch (3351:9): [True: 1, False: 20.2k]
  ------------------
 3352|       |						/* This only happens in
 3353|       |						 * invalid archives. */
 3354|      1|						archive_set_error(&a->archive,
 3355|      1|						    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3356|      1|						    "Distance pointer "
 3357|      1|						    "overflow");
 3358|      1|						return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              						return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3358:14): [True: 1, False: 0]
  ------------------
 3359|      1|					}
 3360|       |
 3361|  20.2k|					dist += low_dist;
 3362|  20.2k|				} else {
 3363|       |					/* dbits is one of [0,1,2,3] */
 3364|  8.07k|					int add;
 3365|       |
 3366|  8.07k|					if(ARCHIVE_OK != (ret = read_consume_bits(a, rar5,
  ------------------
  |  |  233|  8.07k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3366:9): [True: 5, False: 8.07k]
  ------------------
 3367|  8.07k|					     p, dbits, &add))) {
 3368|       |						/* Return EOF if we can't read
 3369|       |						 * more data. */
 3370|      5|						return ret;
 3371|      5|					}
 3372|       |
 3373|  8.07k|					dist += add;
 3374|  8.07k|				}
 3375|  28.3k|			}
 3376|       |
 3377|  35.9k|			if(dist > 0x100) {
  ------------------
  |  Branch (3377:7): [True: 11.4k, False: 24.4k]
  ------------------
 3378|  11.4k|				len++;
 3379|       |
 3380|  11.4k|				if(dist > 0x2000) {
  ------------------
  |  Branch (3380:8): [True: 9.81k, False: 1.64k]
  ------------------
 3381|  9.81k|					len++;
 3382|       |
 3383|  9.81k|					if(dist > 0x40000) {
  ------------------
  |  Branch (3383:9): [True: 7.52k, False: 2.29k]
  ------------------
 3384|  7.52k|						len++;
 3385|  7.52k|					}
 3386|  9.81k|				}
 3387|  11.4k|			}
 3388|       |
 3389|  35.9k|			dist_cache_push(rar5, dist);
 3390|  35.9k|			rar5->cstate.last_len = len;
 3391|       |
 3392|  35.9k|			ret = copy_string(a, len, dist);
 3393|  35.9k|			if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  35.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3393:7): [True: 73, False: 35.8k]
  ------------------
 3394|     73|				return ret;
 3395|       |
 3396|  35.8k|			continue;
 3397|   377k|		} else if(num == 256) {
  ------------------
  |  Branch (3397:13): [True: 3.59k, False: 373k]
  ------------------
 3398|       |			/* Create a filter. */
 3399|  3.59k|			ret = parse_filter(a, p);
 3400|  3.59k|			if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  3.59k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3400:7): [True: 185, False: 3.40k]
  ------------------
 3401|    185|				return ret;
 3402|       |
 3403|  3.40k|			continue;
 3404|   373k|		} else if(num == 257) {
  ------------------
  |  Branch (3404:13): [True: 332k, False: 40.8k]
  ------------------
 3405|   332k|			if(rar5->cstate.last_len != 0) {
  ------------------
  |  Branch (3405:7): [True: 328k, False: 3.94k]
  ------------------
 3406|   328k|				ret = copy_string(a,
 3407|   328k|				    rar5->cstate.last_len,
 3408|   328k|				    rar5->cstate.dist_cache[0]);
 3409|   328k|				if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|   328k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3409:8): [True: 7, False: 328k]
  ------------------
 3410|      7|					return ret;
 3411|   328k|			}
 3412|       |
 3413|   332k|			continue;
 3414|   332k|		} else {
 3415|       |			/* num < 262 */
 3416|  40.8k|			const int idx = num - 258;
 3417|  40.8k|			const int dist = dist_cache_touch(rar5, idx);
 3418|       |
 3419|  40.8k|			uint16_t len_slot;
 3420|  40.8k|			int len;
 3421|       |
 3422|  40.8k|			if(ARCHIVE_OK != decode_number(a, &rar5->cstate.rd, p,
  ------------------
  |  |  233|  40.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3422:7): [True: 12, False: 40.8k]
  ------------------
 3423|  40.8k|			    &len_slot)) {
 3424|     12|				return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              				return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  237|      9|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3424:12): [True: 3, False: 9]
  ------------------
 3425|     12|			}
 3426|       |
 3427|  40.8k|			len = decode_code_length(a, rar5, p, len_slot);
 3428|  40.8k|			if (len == -1) {
  ------------------
  |  Branch (3428:8): [True: 8, False: 40.8k]
  ------------------
 3429|      8|				return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              				return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  237|      7|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3429:12): [True: 1, False: 7]
  ------------------
 3430|      8|			}
 3431|       |
 3432|  40.8k|			rar5->cstate.last_len = len;
 3433|       |
 3434|  40.8k|			ret = copy_string(a, len, dist);
 3435|  40.8k|			if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  40.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3435:7): [True: 18, False: 40.8k]
  ------------------
 3436|     18|				return ret;
 3437|       |
 3438|  40.8k|			continue;
 3439|  40.8k|		}
 3440|  1.62M|	}
 3441|       |
 3442|  16.1k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  16.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3443|  16.5k|}
archive_read_support_format_rar5.c:bf_bit_size:
  509|  16.5k|uint8_t bf_bit_size(const struct compressed_block_header* hdr) {
  510|  16.5k|	return hdr->block_flags_u8 & 7;
  511|  16.5k|}
archive_read_support_format_rar5.c:decode_code_length:
 3158|  76.8k|{
 3159|  76.8k|	int lbits, length = 2;
 3160|       |
 3161|  76.8k|	if(code < 8) {
  ------------------
  |  Branch (3161:5): [True: 8.67k, False: 68.1k]
  ------------------
 3162|  8.67k|		lbits = 0;
 3163|  8.67k|		length += code;
 3164|  68.1k|	} else {
 3165|  68.1k|		lbits = code / 4 - 1;
 3166|  68.1k|		length += (4 | (code & 3)) << lbits;
 3167|  68.1k|	}
 3168|       |
 3169|  76.8k|	if(lbits > 0) {
  ------------------
  |  Branch (3169:5): [True: 68.1k, False: 8.67k]
  ------------------
 3170|  68.1k|		int add;
 3171|       |
 3172|  68.1k|		if(ARCHIVE_OK != read_consume_bits(a, rar5, p, lbits, &add))
  ------------------
  |  |  233|  68.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3172:6): [True: 15, False: 68.1k]
  ------------------
 3173|     15|			return -1;
 3174|       |
 3175|  68.1k|		length += add;
 3176|  68.1k|	}
 3177|       |
 3178|  76.8k|	return length;
 3179|  76.8k|}
archive_read_support_format_rar5.c:read_bits_32:
 1027|  18.4k|{
 1028|  18.4k|	if(rar5->bits.in_addr >= rar5->cstate.cur_block_size) {
  ------------------
  |  Branch (1028:5): [True: 8, False: 18.4k]
  ------------------
 1029|      8|		archive_set_error(&a->archive,
 1030|      8|			ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      8|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 1031|      8|			"Premature end of stream during extraction of data (#1)");
 1032|      8|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      8|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1033|      8|	}
 1034|       |
 1035|  18.4k|	uint32_t bits = archive_be32dec(p + rar5->bits.in_addr);
 1036|  18.4k|	bits <<= rar5->bits.bit_addr;
 1037|  18.4k|	bits |= p[rar5->bits.in_addr + 4] >> (8 - rar5->bits.bit_addr);
 1038|  18.4k|	*value = bits;
 1039|  18.4k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  18.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1040|  18.4k|}
archive_read_support_format_rar5.c:read_consume_bits:
 1067|  83.9k|{
 1068|  83.9k|	uint16_t v;
 1069|  83.9k|	int ret, num;
 1070|       |
 1071|  83.9k|	if(n == 0 || n > 16) {
  ------------------
  |  Branch (1071:5): [True: 0, False: 83.9k]
  |  Branch (1071:15): [True: 0, False: 83.9k]
  ------------------
 1072|       |		/* This is a programmer error and should never happen
 1073|       |		 * in runtime. */
 1074|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1075|      0|	}
 1076|       |
 1077|  83.9k|	ret = read_bits_16(a, rar5, p, &v);
 1078|  83.9k|	if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  83.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1078:5): [True: 25, False: 83.8k]
  ------------------
 1079|     25|		return ret;
 1080|       |
 1081|  83.8k|	num = (int) v;
 1082|  83.8k|	num >>= 16 - n;
 1083|       |
 1084|  83.8k|	skip_bits(rar5, n);
 1085|       |
 1086|  83.8k|	if(value)
  ------------------
  |  Branch (1086:5): [True: 83.8k, False: 0]
  ------------------
 1087|  83.8k|		*value = num;
 1088|       |
 1089|  83.8k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  83.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1090|  83.9k|}
archive_read_support_format_rar5.c:dist_cache_push:
  837|  35.9k|static void dist_cache_push(struct rar5 *rar5, int value) {
  838|  35.9k|	int* q = rar5->cstate.dist_cache;
  839|       |
  840|  35.9k|	q[3] = q[2];
  841|  35.9k|	q[2] = q[1];
  842|  35.9k|	q[1] = q[0];
  843|  35.9k|	q[0] = value;
  844|  35.9k|}
archive_read_support_format_rar5.c:copy_string:
 3181|   405k|static int copy_string(struct archive_read* a, int len, int dist) {
 3182|   405k|	struct rar5 *rar5 = a->format->data;
 3183|   405k|	const ssize_t cmask = rar5->cstate.window_mask;
 3184|   405k|	const uint64_t write_ptr = rar5->cstate.write_ptr +
 3185|   405k|	    rar5->cstate.solid_offset;
 3186|   405k|	int i;
 3187|       |
 3188|   405k|	if (rar5->cstate.window_buf == NULL)
  ------------------
  |  Branch (3188:6): [True: 0, False: 405k]
  ------------------
 3189|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3190|       |
 3191|   405k|	if (rar5->cstate.write_ptr > rar5->file.unpacked_size ||
  ------------------
  |  Branch (3191:6): [True: 0, False: 405k]
  ------------------
 3192|   405k|	    len > rar5->file.unpacked_size - rar5->cstate.write_ptr) {
  ------------------
  |  Branch (3192:6): [True: 98, False: 405k]
  ------------------
 3193|     98|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     98|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3194|     98|		    "Uncompressed data exceeds declared size");
 3195|     98|		return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  239|     10|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
              		return rar5->main.solid ? ARCHIVE_FATAL : ARCHIVE_FAILED;
  ------------------
  |  |  237|     88|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (3195:10): [True: 10, False: 88]
  ------------------
 3196|     98|	}
 3197|       |
 3198|       |	/* The unpacker spends most of the time in this function. It would be
 3199|       |	 * a good idea to introduce some optimizations here.
 3200|       |	 *
 3201|       |	 * Just remember that this loop treats buffers that overlap differently
 3202|       |	 * than buffers that do not overlap. This is why a simple memcpy(3)
 3203|       |	 * call will not be enough. */
 3204|       |
 3205|   606M|	for(i = 0; i < len; i++) {
  ------------------
  |  Branch (3205:13): [True: 605M, False: 405k]
  ------------------
 3206|   605M|		const ssize_t write_idx = (write_ptr + i) & cmask;
 3207|   605M|		const ssize_t read_idx = (write_ptr + i - dist) & cmask;
 3208|   605M|		rar5->cstate.window_buf[write_idx] =
 3209|   605M|		    rar5->cstate.window_buf[read_idx];
 3210|   605M|	}
 3211|       |
 3212|   405k|	rar5->cstate.write_ptr += len;
 3213|   405k|	return ARCHIVE_OK;
  ------------------
  |  |  233|   405k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3214|   405k|}
archive_read_support_format_rar5.c:parse_filter:
 3093|  3.59k|static int parse_filter(struct archive_read* ar, const uint8_t* p) {
 3094|  3.59k|	struct rar5 *rar5 = ar->format->data;
 3095|  3.59k|	uint32_t block_start, block_length;
 3096|  3.59k|	uint16_t filter_type;
 3097|  3.59k|	struct filter_info* filt = NULL;
 3098|  3.59k|	int ret;
 3099|       |
 3100|       |	/* Read the parameters from the input stream. */
 3101|  3.59k|	if(ARCHIVE_OK != (ret = parse_filter_data(ar, rar5, p, &block_start)))
  ------------------
  |  |  233|  3.59k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3101:5): [True: 4, False: 3.58k]
  ------------------
 3102|      4|		return ret;
 3103|       |
 3104|  3.58k|	if(ARCHIVE_OK != (ret = parse_filter_data(ar, rar5, p, &block_length)))
  ------------------
  |  |  233|  3.58k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3104:5): [True: 16, False: 3.57k]
  ------------------
 3105|     16|		return ret;
 3106|       |
 3107|  3.57k|	if(ARCHIVE_OK != (ret = read_bits_16(ar, rar5, p, &filter_type)))
  ------------------
  |  |  233|  3.57k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3107:5): [True: 5, False: 3.56k]
  ------------------
 3108|      5|		return ret;
 3109|       |
 3110|  3.56k|	filter_type >>= 13;
 3111|  3.56k|	skip_bits(rar5, 3);
 3112|       |
 3113|       |	/* Perform some sanity checks on this filter parameters. */
 3114|       |
 3115|  3.56k|	if(block_length < 4 ||
  ------------------
  |  Branch (3115:5): [True: 50, False: 3.51k]
  ------------------
 3116|  3.51k|	    block_length > 0x400000 ||
  ------------------
  |  Branch (3116:6): [True: 45, False: 3.47k]
  ------------------
 3117|  3.47k|	    !is_valid_filter_block_start(rar5, block_start) ||
  ------------------
  |  Branch (3117:6): [True: 52, False: 3.41k]
  ------------------
 3118|  3.41k|	    (rar5->cstate.window_size > 0 &&
  ------------------
  |  Branch (3118:7): [True: 3.41k, False: 0]
  ------------------
 3119|  3.41k|	     (ssize_t)block_length > rar5->cstate.window_size >> 1))
  ------------------
  |  Branch (3119:7): [True: 12, False: 3.40k]
  ------------------
 3120|    159|	{
 3121|    159|		archive_set_error(&ar->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    159|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3122|    159|		    "Invalid filter encountered");
 3123|    159|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|    159|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3124|    159|	}
 3125|       |
 3126|       |	/* Allocate a new filter. */
 3127|  3.40k|	filt = add_new_filter(rar5);
 3128|  3.40k|	if(filt == NULL) {
  ------------------
  |  Branch (3128:5): [True: 0, False: 3.40k]
  ------------------
 3129|      0|		archive_set_error(&ar->archive, ENOMEM,
 3130|      0|		    "Can't allocate memory for a filter descriptor");
 3131|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3132|      0|	}
 3133|       |
 3134|  3.40k|	filt->type = filter_type;
 3135|  3.40k|	filt->block_start = rar5->cstate.write_ptr + block_start;
 3136|  3.40k|	filt->block_length = block_length;
 3137|       |
 3138|  3.40k|	rar5->cstate.last_block_start = filt->block_start;
 3139|  3.40k|	rar5->cstate.last_block_length = filt->block_length;
 3140|       |
 3141|       |	/* Read some more data in case this is a DELTA filter. Other filter
 3142|       |	 * types don't require any additional data over what was already
 3143|       |	 * read. */
 3144|  3.40k|	if(filter_type == FILTER_DELTA) {
  ------------------
  |  Branch (3144:5): [True: 502, False: 2.90k]
  ------------------
 3145|    502|		int channels;
 3146|       |
 3147|    502|		if(ARCHIVE_OK != (ret = read_consume_bits(ar, rar5, p, 5, &channels)))
  ------------------
  |  |  233|    502|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3147:6): [True: 1, False: 501]
  ------------------
 3148|      1|			return ret;
 3149|       |
 3150|    501|		filt->channels = channels + 1;
 3151|    501|	}
 3152|       |
 3153|  3.40k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  3.40k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3154|  3.40k|}
archive_read_support_format_rar5.c:parse_filter_data:
 3042|  7.17k|{
 3043|  7.17k|	int i, bytes, ret;
 3044|  7.17k|	uint32_t data = 0;
 3045|       |
 3046|  7.17k|	if(ARCHIVE_OK != (ret = read_consume_bits(a, rar5, p, 2, &bytes)))
  ------------------
  |  |  233|  7.17k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3046:5): [True: 4, False: 7.17k]
  ------------------
 3047|      4|		return ret;
 3048|       |
 3049|  7.17k|	bytes++;
 3050|       |
 3051|  16.1k|	for(i = 0; i < bytes; i++) {
  ------------------
  |  Branch (3051:13): [True: 9.02k, False: 7.15k]
  ------------------
 3052|  9.02k|		uint16_t byte;
 3053|       |
 3054|  9.02k|		if(ARCHIVE_OK != (ret = read_bits_16(a, rar5, p, &byte))) {
  ------------------
  |  |  233|  9.02k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3054:6): [True: 16, False: 9.00k]
  ------------------
 3055|     16|			return ret;
 3056|     16|		}
 3057|       |
 3058|       |		/* Cast to uint32_t will ensure the shift operation will not
 3059|       |		 * produce undefined result. */
 3060|  9.00k|		data += ((uint32_t) byte >> 8) << (i * 8);
 3061|  9.00k|		skip_bits(rar5, 8);
 3062|  9.00k|	}
 3063|       |
 3064|  7.15k|	*filter_data = data;
 3065|  7.15k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  7.15k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3066|  7.17k|}
archive_read_support_format_rar5.c:is_valid_filter_block_start:
 3071|  3.47k|{
 3072|  3.47k|	const int64_t block_start = (ssize_t) start + rar5->cstate.write_ptr;
 3073|  3.47k|	const int64_t last_bs = rar5->cstate.last_block_start;
 3074|  3.47k|	const ssize_t last_bl = rar5->cstate.last_block_length;
 3075|       |
 3076|  3.47k|	if(last_bs == 0 || last_bl == 0) {
  ------------------
  |  Branch (3076:5): [True: 341, False: 3.12k]
  |  Branch (3076:21): [True: 0, False: 3.12k]
  ------------------
 3077|       |		/* We didn't have any filters yet, so accept this offset. */
 3078|    341|		return 1;
 3079|    341|	}
 3080|       |
 3081|  3.12k|	if(block_start >= last_bs + last_bl) {
  ------------------
  |  Branch (3081:5): [True: 3.07k, False: 52]
  ------------------
 3082|       |		/* Current offset is bigger than last block's end offset, so
 3083|       |		 * accept current offset. */
 3084|  3.07k|		return 1;
 3085|  3.07k|	}
 3086|       |
 3087|       |	/* Any other case is not a normal situation and we should fail. */
 3088|     52|	return 0;
 3089|  3.12k|}
archive_read_support_format_rar5.c:add_new_filter:
  557|  3.40k|static struct filter_info* add_new_filter(struct rar5 *rar5) {
  558|  3.40k|	struct filter_info* f = calloc(1, sizeof(*f));
  559|       |
  560|  3.40k|	if(!f) {
  ------------------
  |  Branch (560:5): [True: 0, False: 3.40k]
  ------------------
  561|      0|		return NULL;
  562|      0|	}
  563|       |
  564|  3.40k|	if (CDE_OK != cdeque_push_back(&rar5->cstate.filters, cdeque_filter(f))) {
  ------------------
  |  Branch (564:6): [True: 0, False: 3.40k]
  ------------------
  565|      0|		free(f);
  566|      0|		return NULL;
  567|      0|	}
  568|       |
  569|  3.40k|	return f;
  570|  3.40k|}
archive_read_support_format_rar5.c:cdeque_push_back:
  445|  3.40k|static int cdeque_push_back(struct cdeque* d, void* item) {
  446|  3.40k|	if(d == NULL)
  ------------------
  |  Branch (446:5): [True: 0, False: 3.40k]
  ------------------
  447|      0|		return CDE_PARAM;
  448|       |
  449|  3.40k|	if(d->size == d->cap_mask + 1)
  ------------------
  |  Branch (449:5): [True: 0, False: 3.40k]
  ------------------
  450|      0|		return CDE_OUT_OF_BOUNDS;
  451|       |
  452|  3.40k|	d->arr[d->end_pos] = (size_t) item;
  453|  3.40k|	d->end_pos = (d->end_pos + 1) & d->cap_mask;
  454|  3.40k|	d->size++;
  455|       |
  456|  3.40k|	return CDE_OK;
  457|  3.40k|}
archive_read_support_format_rar5.c:cdeque_filter:
  486|  3.40k|static void* cdeque_filter(struct filter_info* f) {
  487|  3.40k|	return (void**) (size_t) f;
  488|  3.40k|}
archive_read_support_format_rar5.c:dist_cache_touch:
  846|  40.8k|static int dist_cache_touch(struct rar5 *rar5, int idx) {
  847|  40.8k|	int* q = rar5->cstate.dist_cache;
  848|  40.8k|	int i, dist = q[idx];
  849|       |
  850|   158k|	for(i = idx; i > 0; i--)
  ------------------
  |  Branch (850:15): [True: 117k, False: 40.8k]
  ------------------
  851|   117k|		q[i] = q[i - 1];
  852|       |
  853|  40.8k|	q[0] = dist;
  854|  40.8k|	return dist;
  855|  40.8k|}
archive_read_support_format_rar5.c:bf_is_last_block:
  524|  2.15k|uint8_t bf_is_last_block(const struct compressed_block_header* hdr) {
  525|  2.15k|	return (hdr->block_flags_u8 >> 6) & 1;
  526|  2.15k|}
archive_read_support_format_rar5.c:apply_filters:
  785|  19.1k|static int apply_filters(struct archive_read* a) {
  786|  19.1k|	struct rar5 *rar5 = a->format->data;
  787|  19.1k|	struct filter_info* flt;
  788|  19.1k|	int ret;
  789|       |
  790|  19.1k|	rar5->cstate.all_filters_applied = 0;
  791|       |
  792|       |	/* Get the first filter that can be applied to our data. The data
  793|       |	 * needs to be fully unpacked before the filter can be run. */
  794|  19.1k|	if(CDE_OK == cdeque_front(&rar5->cstate.filters,
  ------------------
  |  Branch (794:5): [True: 6.24k, False: 12.9k]
  ------------------
  795|  19.1k|	    cdeque_filter_p(&flt))) {
  796|       |		/* Check if our unpacked data fully covers this filter's
  797|       |		 * range. */
  798|  6.24k|		if(rar5->cstate.write_ptr > flt->block_start &&
  ------------------
  |  Branch (798:6): [True: 5.77k, False: 471]
  ------------------
  799|  5.77k|		    rar5->cstate.write_ptr >= flt->block_start +
  ------------------
  |  Branch (799:7): [True: 5.20k, False: 578]
  ------------------
  800|  5.77k|		    flt->block_length) {
  801|       |			/* Check if we have some data pending to be written
  802|       |			 * right before the filter's start offset. */
  803|  5.20k|			if(rar5->cstate.last_write_ptr == flt->block_start) {
  ------------------
  |  Branch (803:7): [True: 2.63k, False: 2.56k]
  ------------------
  804|       |				/* Run the filter specified by descriptor
  805|       |				 * `flt`. */
  806|  2.63k|				ret = run_filter(a, flt);
  807|  2.63k|				if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  2.63k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (807:8): [True: 25, False: 2.61k]
  ------------------
  808|       |					/* Filter failure, return error. */
  809|     25|					return ret;
  810|     25|				}
  811|       |
  812|       |				/* Filter descriptor won't be needed anymore
  813|       |				 * after it's used, * so remove it from the
  814|       |				 * filter list and free its memory. */
  815|  2.61k|				(void) cdeque_pop_front(&rar5->cstate.filters,
  816|  2.61k|				    cdeque_filter_p(&flt));
  817|       |
  818|  2.61k|				free(flt);
  819|  2.61k|			} else {
  820|       |				/* We can't run filters yet, dump the memory
  821|       |				 * right before the filter. */
  822|  2.56k|				push_window_data(a, rar5,
  823|  2.56k|				    rar5->cstate.last_write_ptr,
  824|  2.56k|				    flt->block_start);
  825|  2.56k|			}
  826|       |
  827|       |			/* Return 'filter applied or not needed' state to the
  828|       |			 * caller. */
  829|  5.17k|			return ARCHIVE_RETRY;
  ------------------
  |  |  234|  5.17k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  830|  5.20k|		}
  831|  6.24k|	}
  832|       |
  833|  13.9k|	rar5->cstate.all_filters_applied = 1;
  834|  13.9k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  13.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  835|  19.1k|}
archive_read_support_format_rar5.c:run_filter:
  675|  2.63k|static int run_filter(struct archive_read* a, struct filter_info* flt) {
  676|  2.63k|	struct rar5 *rar5 = a->format->data;
  677|  2.63k|	int ret;
  678|       |
  679|  2.63k|	clear_data_ready_stack(rar5);
  680|  2.63k|	free(rar5->cstate.filtered_buf);
  681|       |
  682|  2.63k|	rar5->cstate.filtered_buf = malloc(flt->block_length);
  683|  2.63k|	if(!rar5->cstate.filtered_buf) {
  ------------------
  |  Branch (683:5): [True: 0, False: 2.63k]
  ------------------
  684|      0|		archive_set_error(&a->archive, ENOMEM,
  685|      0|		    "Can't allocate memory for filter data");
  686|      0|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  687|      0|	}
  688|       |
  689|  2.63k|	switch(flt->type) {
  690|    294|		case FILTER_DELTA:
  ------------------
  |  Branch (690:3): [True: 294, False: 2.34k]
  ------------------
  691|    294|			ret = run_delta_filter(rar5, flt);
  692|    294|			break;
  693|       |
  694|    130|		case FILTER_E8:
  ------------------
  |  Branch (694:3): [True: 130, False: 2.50k]
  ------------------
  695|       |			/* fallthrough */
  696|    237|		case FILTER_E8E9:
  ------------------
  |  Branch (696:3): [True: 107, False: 2.52k]
  ------------------
  697|    237|			ret = run_e8e9_filter(rar5, flt,
  698|    237|			    flt->type == FILTER_E8E9);
  699|    237|			break;
  700|       |
  701|  2.08k|		case FILTER_ARM:
  ------------------
  |  Branch (701:3): [True: 2.08k, False: 555]
  ------------------
  702|  2.08k|			ret = run_arm_filter(rar5, flt);
  703|  2.08k|			break;
  704|       |
  705|     24|		default:
  ------------------
  |  Branch (705:3): [True: 24, False: 2.61k]
  ------------------
  706|     24|			archive_set_error(&a->archive,
  707|     24|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     24|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  708|     24|			    "Unsupported filter type: 0x%x",
  709|     24|			    (unsigned int)flt->type);
  710|     24|			return ARCHIVE_FAILED;
  ------------------
  |  |  237|     24|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  711|  2.63k|	}
  712|       |
  713|  2.61k|	if(ret != ARCHIVE_OK) {
  ------------------
  |  |  233|  2.61k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (713:5): [True: 0, False: 2.61k]
  ------------------
  714|       |		/* Filter has failed. */
  715|      0|		return ret;
  716|      0|	}
  717|       |
  718|  2.61k|	if(ARCHIVE_OK != push_data_ready(a, rar5, rar5->cstate.filtered_buf,
  ------------------
  |  |  233|  2.61k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (718:5): [True: 1, False: 2.61k]
  ------------------
  719|  2.61k|	    flt->block_length, rar5->cstate.last_write_ptr))
  720|      1|	{
  721|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      1|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
  722|      1|		    "Stack overflow when submitting unpacked data");
  723|       |
  724|      1|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  725|      1|	}
  726|       |
  727|  2.61k|	rar5->cstate.last_write_ptr += flt->block_length;
  728|  2.61k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.61k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  729|  2.61k|}
archive_read_support_format_rar5.c:run_delta_filter:
  572|    294|static int run_delta_filter(struct rar5 *rar5, struct filter_info* flt) {
  573|    294|	int i;
  574|    294|	ssize_t dest_pos, src_pos = 0;
  575|       |
  576|  1.40k|	for(i = 0; i < flt->channels; i++) {
  ------------------
  |  Branch (576:13): [True: 1.11k, False: 294]
  ------------------
  577|  1.11k|		uint8_t prev_byte = 0;
  578|  1.11k|		for(dest_pos = i;
  579|   809k|				dest_pos < flt->block_length;
  ------------------
  |  Branch (579:5): [True: 808k, False: 1.11k]
  ------------------
  580|   808k|				dest_pos += flt->channels)
  581|   808k|		{
  582|   808k|			uint8_t byte;
  583|       |
  584|   808k|			byte = rar5->cstate.window_buf[
  585|   808k|			    (rar5->cstate.solid_offset + flt->block_start +
  586|   808k|			    src_pos) & rar5->cstate.window_mask];
  587|       |
  588|   808k|			prev_byte -= byte;
  589|   808k|			rar5->cstate.filtered_buf[dest_pos] = prev_byte;
  590|   808k|			src_pos++;
  591|   808k|		}
  592|  1.11k|	}
  593|       |
  594|    294|	return ARCHIVE_OK;
  ------------------
  |  |  233|    294|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  595|    294|}
archive_read_support_format_rar5.c:run_e8e9_filter:
  599|    237|{
  600|    237|	const uint32_t file_size = 0x1000000;
  601|    237|	ssize_t i;
  602|       |
  603|    237|	circular_memcpy(rar5->cstate.filtered_buf,
  604|    237|	    rar5->cstate.window_buf, rar5->cstate.window_mask,
  605|    237|	    rar5->cstate.solid_offset + flt->block_start,
  606|    237|	    rar5->cstate.solid_offset + flt->block_start + flt->block_length);
  607|       |
  608|   720k|	for(i = 0; i < flt->block_length - 4;) {
  ------------------
  |  Branch (608:13): [True: 720k, False: 237]
  ------------------
  609|   720k|		uint8_t b = rar5->cstate.window_buf[
  610|   720k|		    (rar5->cstate.solid_offset + flt->block_start +
  611|   720k|		    i++) & rar5->cstate.window_mask];
  612|       |
  613|       |		/*
  614|       |		 * 0xE8 = x86's call <relative_addr_uint32> (function call)
  615|       |		 * 0xE9 = x86's jmp <relative_addr_uint32> (unconditional jump)
  616|       |		 */
  617|   720k|		if(b == 0xE8 || (extended && b == 0xE9)) {
  ------------------
  |  Branch (617:6): [True: 334, False: 719k]
  |  Branch (617:20): [True: 513k, False: 206k]
  |  Branch (617:32): [True: 74.6k, False: 438k]
  ------------------
  618|       |
  619|  74.9k|			uint32_t addr;
  620|  74.9k|			uint32_t offset = (i + flt->block_start) % file_size;
  621|       |
  622|  74.9k|			addr = read_filter_data(rar5,
  623|  74.9k|			    (uint32_t)(rar5->cstate.solid_offset +
  624|  74.9k|			    flt->block_start + i) & rar5->cstate.window_mask);
  625|       |
  626|  74.9k|			if(addr & 0x80000000) {
  ------------------
  |  Branch (626:7): [True: 32.6k, False: 42.3k]
  ------------------
  627|  32.6k|				if(((addr + offset) & 0x80000000) == 0) {
  ------------------
  |  Branch (627:8): [True: 1.06k, False: 31.5k]
  ------------------
  628|  1.06k|					write_filter_data(rar5, (uint32_t)i,
  629|  1.06k|					    addr + file_size);
  630|  1.06k|				}
  631|  42.3k|			} else {
  632|  42.3k|				if((addr - file_size) & 0x80000000) {
  ------------------
  |  Branch (632:8): [True: 40.4k, False: 1.85k]
  ------------------
  633|  40.4k|					uint32_t naddr = addr - offset;
  634|  40.4k|					write_filter_data(rar5, (uint32_t)i,
  635|  40.4k|					    naddr);
  636|  40.4k|				}
  637|  42.3k|			}
  638|       |
  639|  74.9k|			i += 4;
  640|  74.9k|		}
  641|   720k|	}
  642|       |
  643|    237|	return ARCHIVE_OK;
  ------------------
  |  |  233|    237|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  644|    237|}
archive_read_support_format_rar5.c:circular_memcpy:
  531|  86.4k|{
  532|  86.4k|	if((start & mask) > (end & mask)) {
  ------------------
  |  Branch (532:5): [True: 31, False: 86.3k]
  ------------------
  533|     31|		ssize_t len1 = mask + 1 - (start & mask);
  534|     31|		ssize_t len2 = end & mask;
  535|       |
  536|     31|		memcpy(dst, &window[start & mask], len1);
  537|     31|		memcpy(dst + len1, window, len2);
  538|  86.3k|	} else {
  539|  86.3k|		memcpy(dst, &window[start & mask], (size_t) (end - start));
  540|  86.3k|	}
  541|  86.4k|}
archive_read_support_format_rar5.c:read_filter_data:
  543|  84.1k|static uint32_t read_filter_data(struct rar5 *rar5, uint32_t offset) {
  544|  84.1k|	uint8_t linear_buf[4];
  545|  84.1k|	circular_memcpy(linear_buf, rar5->cstate.window_buf,
  546|  84.1k|	    rar5->cstate.window_mask, offset, offset + 4);
  547|  84.1k|	return archive_le32dec(linear_buf);
  548|  84.1k|}
archive_read_support_format_rar5.c:write_filter_data:
  552|  50.6k|{
  553|  50.6k|	archive_le32enc(&rar5->cstate.filtered_buf[offset], value);
  554|  50.6k|}
archive_read_support_format_rar5.c:run_arm_filter:
  646|  2.08k|static int run_arm_filter(struct rar5 *rar5, struct filter_info* flt) {
  647|  2.08k|	ssize_t i = 0;
  648|  2.08k|	uint32_t offset;
  649|       |
  650|  2.08k|	circular_memcpy(rar5->cstate.filtered_buf,
  651|  2.08k|	    rar5->cstate.window_buf, rar5->cstate.window_mask,
  652|  2.08k|	    rar5->cstate.solid_offset + flt->block_start,
  653|  2.08k|	    rar5->cstate.solid_offset + flt->block_start + flt->block_length);
  654|       |
  655|   140k|	for(i = 0; i < flt->block_length - 3; i += 4) {
  ------------------
  |  Branch (655:13): [True: 138k, False: 2.08k]
  ------------------
  656|   138k|		uint8_t* b = &rar5->cstate.window_buf[
  657|   138k|		    (rar5->cstate.solid_offset +
  658|   138k|		    flt->block_start + i + 3) & rar5->cstate.window_mask];
  659|       |
  660|   138k|		if(*b == 0xEB) {
  ------------------
  |  Branch (660:6): [True: 9.12k, False: 129k]
  ------------------
  661|       |			/* 0xEB = ARM's BL (branch + link) instruction. */
  662|  9.12k|			offset = read_filter_data(rar5,
  663|  9.12k|			    (rar5->cstate.solid_offset + flt->block_start + i) &
  664|  9.12k|			     (uint32_t)rar5->cstate.window_mask) & 0x00ffffff;
  665|       |
  666|  9.12k|			offset -= (uint32_t) ((i + flt->block_start) / 4);
  667|  9.12k|			offset = (offset & 0x00ffffff) | 0xeb000000;
  668|  9.12k|			write_filter_data(rar5, (uint32_t)i, offset);
  669|  9.12k|		}
  670|   138k|	}
  671|       |
  672|  2.08k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  2.08k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  673|  2.08k|}
archive_read_support_format_rar5.c:push_data_ready:
 3905|  23.0k|{
 3906|  23.0k|	int i;
 3907|       |
 3908|       |	/* Don't push if we're in skip mode. This is needed because solid
 3909|       |	 * streams need full processing even if we're skipping data. After
 3910|       |	 * fully processing the stream, we need to discard the generated bytes,
 3911|       |	 * because we're interested only in the side effect: building up the
 3912|       |	 * internal window circular buffer. This window buffer will be used
 3913|       |	 * later during unpacking of requested data. */
 3914|  23.0k|	if(rar5->skip_mode)
  ------------------
  |  Branch (3914:5): [True: 1.44k, False: 21.6k]
  ------------------
 3915|  1.44k|		return ARCHIVE_OK;
  ------------------
  |  |  233|  1.44k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3916|       |
 3917|       |	/* Sanity check. */
 3918|  21.6k|	if(offset != rar5->file.last_offset + rar5->file.last_size) {
  ------------------
  |  Branch (3918:5): [True: 1, False: 21.6k]
  ------------------
 3919|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      1|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3920|      1|		    "Sanity check error: output stream is not continuous");
 3921|      1|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3922|      1|	}
 3923|       |
 3924|  25.9k|	for(i = 0; i < rar5_countof(rar5->cstate.dready); i++) {
  ------------------
  |  |   62|  25.9k|#define rar5_countof(X) ((const ssize_t) (sizeof(X) / sizeof(*X)))
  ------------------
  |  Branch (3924:13): [True: 25.9k, False: 0]
  ------------------
 3925|  25.9k|		struct data_ready* d = &rar5->cstate.dready[i];
 3926|  25.9k|		if(!d->used) {
  ------------------
  |  Branch (3926:6): [True: 21.6k, False: 4.37k]
  ------------------
 3927|  21.6k|			d->used = 1;
 3928|  21.6k|			d->buf = buf;
 3929|  21.6k|			d->size = size;
 3930|  21.6k|			d->offset = offset;
 3931|       |
 3932|       |			/* These fields are used only in sanity checking. */
 3933|  21.6k|			rar5->file.last_offset = offset;
 3934|  21.6k|			rar5->file.last_size = size;
 3935|       |
 3936|       |			/* Calculate the checksum of this new block before
 3937|       |			 * submitting data to libarchive's engine. */
 3938|  21.6k|			update_crc(rar5, d->buf, d->size);
 3939|       |
 3940|  21.6k|			return ARCHIVE_OK;
  ------------------
  |  |  233|  21.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3941|  21.6k|		}
 3942|  25.9k|	}
 3943|       |
 3944|       |	/* Program counter will reach this code if the
 3945|       |	 * `rar5->cstate.data_ready` stack will be filled up so that no new
 3946|       |	 * entries will be allowed. The code shouldn't allow such situation to
 3947|       |	 * occur. So we treat this case as an internal error. */
 3948|       |
 3949|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      0|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 3950|      0|	    "Premature end of data_ready stack");
 3951|      0|	return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3952|  21.6k|}
archive_read_support_format_rar5.c:cdeque_front:
  436|  20.2k|static int cdeque_front(struct cdeque* d, void** value) {
  437|  20.2k|	if(d->size > 0) {
  ------------------
  |  Branch (437:5): [True: 7.29k, False: 12.9k]
  ------------------
  438|  7.29k|		cdeque_front_fast(d, value);
  439|  7.29k|		return CDE_OK;
  440|  7.29k|	} else
  441|  12.9k|		return CDE_OUT_OF_BOUNDS;
  442|  20.2k|}
archive_read_support_format_rar5.c:cdeque_front_fast:
  430|  7.29k|static void cdeque_front_fast(struct cdeque* d, void** value) {
  431|  7.29k|	*value = (void*) d->arr[d->beg_pos];
  432|  7.29k|}
archive_read_support_format_rar5.c:push_window_data:
  781|  16.0k|{
  782|  16.0k|	push_data(a, rar5, rar5->cstate.window_buf, idx_begin, idx_end);
  783|  16.0k|}
archive_read_support_format_rar5.c:push_data:
  737|  16.0k|{
  738|  16.0k|	const ssize_t wmask = rar5->cstate.window_mask;
  739|  16.0k|	const ssize_t solid_write_ptr = (rar5->cstate.solid_offset +
  740|  16.0k|	    rar5->cstate.last_write_ptr) & wmask;
  741|       |
  742|  16.0k|	idx_begin += rar5->cstate.solid_offset;
  743|  16.0k|	idx_end += rar5->cstate.solid_offset;
  744|       |
  745|       |	/* Check if our unpacked data is wrapped inside the window circular
  746|       |	 * buffer.  If it's not wrapped, it can be copied out by using
  747|       |	 * a single memcpy, but when it's wrapped, we need to copy the first
  748|       |	 * part with one memcpy, and the second part with another memcpy. */
  749|       |
  750|  16.0k|	if((idx_begin & wmask) > (idx_end & wmask)) {
  ------------------
  |  Branch (750:5): [True: 4.40k, False: 11.6k]
  ------------------
  751|       |		/* The data is wrapped (begin offset sis bigger than end
  752|       |		 * offset). */
  753|  4.40k|		const ssize_t frag1_size = rar5->cstate.window_size -
  754|  4.40k|		    (idx_begin & wmask);
  755|  4.40k|		const ssize_t frag2_size = idx_end & wmask;
  756|       |
  757|       |		/* Copy the first part of the buffer first. */
  758|  4.40k|		push_data_ready(a, rar5, buf + solid_write_ptr, frag1_size,
  759|  4.40k|		    rar5->cstate.last_write_ptr);
  760|       |
  761|       |		/* Copy the second part of the buffer. */
  762|  4.40k|		push_data_ready(a, rar5, buf, frag2_size,
  763|  4.40k|		    rar5->cstate.last_write_ptr + frag1_size);
  764|       |
  765|  4.40k|		rar5->cstate.last_write_ptr += frag1_size + frag2_size;
  766|  11.6k|	} else {
  767|       |		/* Data is not wrapped, so we can just use one call to copy the
  768|       |		 * data. */
  769|  11.6k|		push_data_ready(a, rar5,
  770|  11.6k|		    buf + solid_write_ptr, (idx_end - idx_begin) & wmask,
  771|  11.6k|		    rar5->cstate.last_write_ptr);
  772|       |
  773|  11.6k|		rar5->cstate.last_write_ptr += idx_end - idx_begin;
  774|  11.6k|	}
  775|  16.0k|}
archive_read_support_format_rar5.c:verify_global_checksums:
 4326|  1.20k|static int verify_global_checksums(struct archive_read* a) {
 4327|  1.20k|	return verify_checksums(a);
 4328|  1.20k|}
archive_read_support_format_rar5.c:verify_checksums:
 4228|  1.20k|static int verify_checksums(struct archive_read* a) {
 4229|  1.20k|	struct rar5 *rar5 = a->format->data;
 4230|  1.20k|	int verify_crc;
 4231|       |
 4232|       |	/* Check checksums only when actually unpacking the data. There's no
 4233|       |	 * need to calculate checksum when we're skipping data in solid archives
 4234|       |	 * (skipping in solid archives is the same thing as unpacking compressed
 4235|       |	 * data and discarding the result). */
 4236|       |
 4237|  1.20k|	if(!rar5->skip_mode) {
  ------------------
  |  Branch (4237:5): [True: 1.04k, False: 160]
  ------------------
 4238|       |		/* Always check checksums if we're not in skip mode */
 4239|  1.04k|		verify_crc = 1;
 4240|  1.04k|	} else {
 4241|       |		/* We can override the logic above with a compile-time option
 4242|       |		 * NO_CRC_ON_SOLID_SKIP. This option is used during debugging,
 4243|       |		 * and it will check checksums of unpacked data even when
 4244|       |		 * we're skipping it. */
 4245|       |
 4246|       |#if defined CHECK_CRC_ON_SOLID_SKIP
 4247|       |		/* Debug case */
 4248|       |		verify_crc = 1;
 4249|       |#else
 4250|       |		/* Normal case */
 4251|    160|		verify_crc = 0;
 4252|    160|#endif
 4253|    160|	}
 4254|       |
 4255|  1.20k|	if(verify_crc) {
  ------------------
  |  Branch (4255:5): [True: 1.04k, False: 160]
  ------------------
 4256|       |		/* During unpacking, on each unpacked block we're calling the
 4257|       |		 * update_crc() function. Since we are here, the unpacking
 4258|       |		 * process is already over and we can check if calculated
 4259|       |		 * checksum (CRC32 or BLAKE2sp) is the same as what is stored
 4260|       |		 * in the archive. */
 4261|  1.04k|		if(rar5->file.stored_crc32 > 0) {
  ------------------
  |  Branch (4261:6): [True: 824, False: 217]
  ------------------
 4262|       |			/* Check CRC32 only when the file contains a CRC32
 4263|       |			 * value for this file. */
 4264|       |
 4265|    824|			if(rar5->file.calculated_crc32 !=
  ------------------
  |  Branch (4265:7): [True: 823, False: 1]
  ------------------
 4266|    824|			    rar5->file.stored_crc32) {
 4267|       |				/* Checksums do not match; the unpacked file
 4268|       |				 * is corrupted. */
 4269|       |
 4270|    823|				DEBUG_CODE {
  ------------------
  |  |   68|    823|#define DEBUG_CODE if(0)
  |  |  ------------------
  |  |  |  Branch (68:23): [Folded, False: 823]
  |  |  ------------------
  ------------------
 4271|      0|					printf("Checksum error: CRC32 "
 4272|      0|					    "(was: %08" PRIx32 ", expected: %08" PRIx32 ")\n",
 4273|      0|					    rar5->file.calculated_crc32,
 4274|      0|					    rar5->file.stored_crc32);
 4275|      0|				}
 4276|       |
 4277|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 4278|       |				archive_set_error(&a->archive,
 4279|       |				    ARCHIVE_ERRNO_FILE_FORMAT,
 4280|       |				    "Checksum error: CRC32");
 4281|       |				return ARCHIVE_FAILED;
 4282|       |#endif
 4283|    823|			} else {
 4284|      1|				DEBUG_CODE {
  ------------------
  |  |   68|      1|#define DEBUG_CODE if(0)
  |  |  ------------------
  |  |  |  Branch (68:23): [Folded, False: 1]
  |  |  ------------------
  ------------------
 4285|      0|					printf("Checksum OK: CRC32 "
 4286|      0|					    "(%08" PRIx32 "/%08" PRIx32 ")\n",
 4287|      0|					    rar5->file.stored_crc32,
 4288|      0|					    rar5->file.calculated_crc32);
 4289|      0|				}
 4290|      1|			}
 4291|    824|		}
 4292|       |
 4293|  1.04k|		if(rar5->file.has_blake2 > 0) {
  ------------------
  |  Branch (4293:6): [True: 818, False: 223]
  ------------------
 4294|       |			/* BLAKE2sp is an optional checksum algorithm that is
 4295|       |			 * added to RARv5 archives when using the `-htb` switch
 4296|       |			 *  during creation of archive.
 4297|       |			 *
 4298|       |			 * We now finalize the hash calculation by calling the
 4299|       |			 * `final` function. This will generate the final hash
 4300|       |			 * value we can use to compare it with the BLAKE2sp
 4301|       |			 * checksum that is stored in the archive.
 4302|       |			 *
 4303|       |			 * The return value of this `final` function is not
 4304|       |			 * very helpful, as it guards only against improper use.
 4305|       | 			 * This is why we're explicitly ignoring it. */
 4306|       |
 4307|    818|			uint8_t b2_buf[32];
 4308|    818|			(void) blake2sp_final(&rar5->file.b2state, b2_buf, 32);
  ------------------
  |  |   29|    818|#define blake2sp_final __archive_blake2sp_final
  ------------------
 4309|       |
 4310|    818|			if(memcmp(&rar5->file.blake2sp, b2_buf, 32) != 0) {
  ------------------
  |  |   28|    818|#define blake2sp __archive_blake2sp
  ------------------
  |  Branch (4310:7): [True: 818, False: 0]
  ------------------
 4311|       |#ifndef DONT_FAIL_ON_CRC_ERROR
 4312|       |				archive_set_error(&a->archive,
 4313|       |				    ARCHIVE_ERRNO_FILE_FORMAT,
 4314|       |				    "Checksum error: BLAKE2");
 4315|       |
 4316|       |				return ARCHIVE_FAILED;
 4317|       |#endif
 4318|    818|			}
 4319|    818|		}
 4320|  1.04k|	}
 4321|       |
 4322|       |	/* Finalization for this file has been successfully completed. */
 4323|  1.20k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  1.20k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4324|  1.20k|}
archive_read_support_format_rar5.c:rar5_read_data_skip:
 4408|  5.10k|static int rar5_read_data_skip(struct archive_read *a) {
 4409|  5.10k|	struct rar5 *rar5 = a->format->data;
 4410|       |
 4411|  5.10k|	if(rar5->main.solid && (rar5->cstate.data_encrypted == 0)) {
  ------------------
  |  Branch (4411:5): [True: 2.52k, False: 2.58k]
  |  Branch (4411:25): [True: 1.96k, False: 561]
  ------------------
 4412|       |		/* In solid archives, instead of skipping the data, we need to
 4413|       |		 * extract it, and dispose the result. The side effect of this
 4414|       |		 * operation will be setting up the initial window buffer state
 4415|       |		 * needed to be able to extract the selected file. Note that
 4416|       |		 * this is only possible when data within this solid block is
 4417|       |		 * not encrypted, in which case we'll skip and fail if the user
 4418|       |		 * tries to read data. */
 4419|       |
 4420|  1.96k|		int ret;
 4421|       |
 4422|       |		/* Make sure to process all blocks in the compressed stream. */
 4423|  3.58k|		while(rar5->file.bytes_remaining > 0) {
  ------------------
  |  Branch (4423:9): [True: 2.28k, False: 1.30k]
  ------------------
 4424|       |			/* Setting the "skip mode" will allow us to skip
 4425|       |			 * checksum checks during data skipping. Checking the
 4426|       |			 * checksum of skipped data isn't really necessary and
 4427|       |			 * it's only slowing things down.
 4428|       |			 *
 4429|       |			 * This is incremented instead of setting to 1 because
 4430|       |			 * this data skipping function can be called
 4431|       |			 * recursively. */
 4432|  2.28k|			rar5->skip_mode++;
 4433|       |
 4434|       |			/* We're disposing 1 block of data, so we use triple
 4435|       |			 * NULLs in arguments. */
 4436|  2.28k|			ret = rar5_read_data(a, NULL, NULL, NULL);
 4437|       |
 4438|       |			/* Turn off "skip mode". */
 4439|  2.28k|			rar5->skip_mode--;
 4440|       |
 4441|  2.28k|			if(ret < 0 || ret == ARCHIVE_EOF) {
  ------------------
  |  |  232|  1.76k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  |  Branch (4441:7): [True: 518, False: 1.76k]
  |  Branch (4441:18): [True: 142, False: 1.62k]
  ------------------
 4442|       |				/* Propagate any potential error conditions
 4443|       |				 * to the caller. */
 4444|    660|				return ret;
 4445|    660|			}
 4446|  2.28k|		}
 4447|  3.14k|	} else {
 4448|       |		/* In standard archives, we can just jump over the compressed
 4449|       |		 * stream. Each file in non-solid archives starts from an empty
 4450|       |		 * window buffer. */
 4451|       |
 4452|  3.14k|		if(ARCHIVE_OK != consume(a, rar5->file.bytes_remaining)) {
  ------------------
  |  |  233|  3.14k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4452:6): [True: 335, False: 2.80k]
  ------------------
 4453|    335|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|    335|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4454|    335|		}
 4455|       |
 4456|  2.80k|		rar5->file.bytes_remaining = 0;
 4457|  2.80k|	}
 4458|       |
 4459|  4.11k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  4.11k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4460|  5.10k|}
archive_read_support_format_rar5.c:rar5_cleanup:
 4476|  16.7k|static int rar5_cleanup(struct archive_read *a) {
 4477|  16.7k|	struct rar5 *rar5 = a->format->data;
 4478|       |
 4479|  16.7k|	free(rar5->cstate.window_buf);
 4480|  16.7k|	free(rar5->cstate.filtered_buf);
 4481|  16.7k|	clear_data_ready_stack(rar5);
 4482|       |
 4483|  16.7k|	free(rar5->vol.push_buf);
 4484|       |
 4485|  16.7k|	free_filters(rar5);
 4486|  16.7k|	rar5_deinit(rar5);
 4487|       |
 4488|  16.7k|	free(rar5);
 4489|  16.7k|	a->format->data = NULL;
 4490|       |
 4491|  16.7k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4492|  16.7k|}
archive_read_support_format_rar5.c:rar5_capabilities:
 4494|  4.04k|static int rar5_capabilities(struct archive_read * a) {
 4495|  4.04k|	(void) a;
 4496|  4.04k|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA
  ------------------
  |  |  398|  4.04k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
 4497|  4.04k|			| ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  399|  4.04k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
 4498|  4.04k|}
archive_read_support_format_rar5.c:rar5_has_encrypted_entries:
 4500|  2.02k|static int rar5_has_encrypted_entries(struct archive_read *_a) {
 4501|  2.02k|	if (_a && _a->format) {
  ------------------
  |  Branch (4501:6): [True: 2.02k, False: 0]
  |  Branch (4501:12): [True: 2.02k, False: 0]
  ------------------
 4502|  2.02k|		struct rar5 *rar5 = _a->format->data;
 4503|  2.02k|		if (rar5) {
  ------------------
  |  Branch (4503:7): [True: 2.02k, False: 0]
  ------------------
 4504|  2.02k|			return rar5->has_encrypted_entries;
 4505|  2.02k|		}
 4506|  2.02k|	}
 4507|       |
 4508|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4509|  2.02k|}
archive_read_support_format_rar5.c:rar5_deinit:
 4528|  16.7k|static void rar5_deinit(struct rar5 *rar5) {
 4529|  16.7k|	cdeque_free(&rar5->cstate.filters);
 4530|  16.7k|}
archive_read_support_format_rar5.c:cdeque_free:
  493|  16.7k|static void cdeque_free(struct cdeque* d) {
  494|  16.7k|	if(!d)
  ------------------
  |  Branch (494:5): [True: 0, False: 16.7k]
  ------------------
  495|      0|		return;
  496|       |
  497|  16.7k|	if(!d->arr)
  ------------------
  |  Branch (497:5): [True: 0, False: 16.7k]
  ------------------
  498|      0|		return;
  499|       |
  500|  16.7k|	free(d->arr);
  501|       |
  502|       |	d->arr = NULL;
  503|  16.7k|	d->beg_pos = -1;
  504|  16.7k|	d->end_pos = -1;
  505|  16.7k|	d->cap_mask = 0;
  506|  16.7k|}

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

archive_read_support_format_gnutar:
  258|  16.7k|{
  259|  16.7k|	archive_check_magic(a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
  260|  16.7k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_gnutar");
  261|  16.7k|	return (archive_read_support_format_tar(a));
  262|  16.7k|}
archive_read_support_format_tar:
  267|  33.4k|{
  268|  33.4k|	struct archive_read *a = (struct archive_read *)_a;
  269|  33.4k|	struct tar *tar;
  270|  33.4k|	int r;
  271|       |
  272|  33.4k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  33.4k|	do { \
  |  |  180|  33.4k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  33.4k|			(allowed_states), (function_name)); \
  |  |  182|  33.4k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  33.4k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 33.4k]
  |  |  ------------------
  |  |  183|  33.4k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  33.4k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 33.4k]
  |  |  ------------------
  ------------------
  273|  33.4k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_tar");
  274|       |
  275|  33.4k|	tar = calloc(1, sizeof(*tar));
  276|  33.4k|	if (tar == NULL) {
  ------------------
  |  Branch (276:6): [True: 0, False: 33.4k]
  ------------------
  277|      0|		archive_set_error(_a, ENOMEM, "Can't allocate tar data");
  278|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  279|      0|	}
  280|       |#ifdef HAVE_COPYFILE_H
  281|       |	/* Set this by default on Mac OS. */
  282|       |	tar->process_mac_extensions = 1;
  283|       |#endif
  284|       |
  285|  33.4k|	r = __archive_read_register_format(a,
  286|  33.4k|	    tar,
  287|  33.4k|	    "tar",
  288|  33.4k|	    archive_read_format_tar_bid,
  289|  33.4k|	    archive_read_format_tar_options,
  290|  33.4k|	    archive_read_format_tar_read_header,
  291|  33.4k|	    archive_read_format_tar_read_data,
  292|  33.4k|	    archive_read_format_tar_skip,
  293|  33.4k|	    NULL,
  294|  33.4k|	    archive_read_format_tar_cleanup,
  295|  33.4k|	    NULL,
  296|  33.4k|	    NULL);
  297|       |
  298|  33.4k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  33.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (298:6): [True: 16.7k, False: 16.7k]
  ------------------
  299|  16.7k|		free(tar);
  300|  33.4k|	return (r);
  301|  33.4k|}
archive_read_support_format_tar.c:archive_read_format_tar_cleanup:
  305|  16.7k|{
  306|  16.7k|	struct tar *tar = a->format->data;
  307|       |
  308|  16.7k|	gnu_clear_sparse_list(tar);
  309|  16.7k|	archive_string_free(&tar->entry_pathname);
  310|  16.7k|	archive_string_free(&tar->entry_pathname_override);
  311|  16.7k|	archive_string_free(&tar->entry_uname);
  312|  16.7k|	archive_string_free(&tar->entry_gname);
  313|  16.7k|	archive_string_free(&tar->entry_linkpath);
  314|  16.7k|	archive_string_free(&tar->line);
  315|  16.7k|	archive_string_free(&tar->localname);
  316|  16.7k|	free(tar);
  317|  16.7k|	a->format->data = NULL;
  318|  16.7k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  319|  16.7k|}
archive_read_support_format_tar.c:gnu_clear_sparse_list:
 3267|   668k|{
 3268|   668k|	struct sparse_block *p;
 3269|       |
 3270|   683k|	while (tar->sparse_list != NULL) {
  ------------------
  |  Branch (3270:9): [True: 14.3k, False: 668k]
  ------------------
 3271|  14.3k|		p = tar->sparse_list;
 3272|  14.3k|		tar->sparse_list = p->next;
 3273|  14.3k|		free(p);
 3274|  14.3k|	}
 3275|       |	tar->sparse_last = NULL;
 3276|   668k|}
archive_read_support_format_tar.c:archive_read_format_tar_bid:
  375|  18.3k|{
  376|  18.3k|	int bid;
  377|  18.3k|	const char *h;
  378|  18.3k|	const struct archive_entry_header_ustar *header;
  379|       |
  380|  18.3k|	(void)best_bid; /* UNUSED */
  381|       |
  382|  18.3k|	bid = 0;
  383|       |
  384|       |	/* Now let's look at the actual header and see if it matches. */
  385|  18.3k|	h = __archive_read_ahead(a, 512, NULL);
  386|  18.3k|	if (h == NULL)
  ------------------
  |  Branch (386:6): [True: 9.15k, False: 9.24k]
  ------------------
  387|  9.15k|		return (-1);
  388|       |
  389|       |	/* If it's an end-of-archive mark, we can handle it. */
  390|  9.24k|	if (h[0] == 0 && archive_block_is_null(h)) {
  ------------------
  |  Branch (390:6): [True: 2.03k, False: 7.21k]
  |  Branch (390:19): [True: 148, False: 1.88k]
  ------------------
  391|       |		/*
  392|       |		 * Usually, I bid the number of bits verified, but
  393|       |		 * in this case, 4096 seems excessive so I picked 10 as
  394|       |		 * an arbitrary but reasonable-seeming value.
  395|       |		 */
  396|    148|		return (10);
  397|    148|	}
  398|       |
  399|       |	/* If it's not an end-of-archive mark, it must have a valid checksum.*/
  400|  9.09k|	if (!checksum(a, h))
  ------------------
  |  Branch (400:6): [True: 4.56k, False: 4.53k]
  ------------------
  401|  4.56k|		return (0);
  402|  4.53k|	bid += 48;  /* Checksum is usually 6 octal digits. */
  403|       |
  404|  4.53k|	header = (const struct archive_entry_header_ustar *)h;
  405|       |
  406|       |	/* Recognize POSIX formats. */
  407|  4.53k|	if ((memcmp(header->magic, "ustar\0", 6) == 0)
  ------------------
  |  Branch (407:6): [True: 235, False: 4.29k]
  ------------------
  408|    235|	    && (memcmp(header->version, "00", 2) == 0))
  ------------------
  |  Branch (408:9): [True: 28, False: 207]
  ------------------
  409|     28|		bid += 56;
  410|       |
  411|       |	/* Recognize GNU tar format. */
  412|  4.53k|	if ((memcmp(header->magic, "ustar ", 6) == 0)
  ------------------
  |  Branch (412:6): [True: 2.05k, False: 2.47k]
  ------------------
  413|  2.05k|	    && (memcmp(header->version, " \0", 2) == 0))
  ------------------
  |  Branch (413:9): [True: 237, False: 1.82k]
  ------------------
  414|    237|		bid += 56;
  415|       |
  416|       |	/* Type flag must be null, digit or A-Z, a-z. */
  417|  4.53k|	if (header->typeflag[0] != 0 &&
  ------------------
  |  Branch (417:6): [True: 3.85k, False: 677]
  ------------------
  418|  3.85k|	    !( header->typeflag[0] >= '0' && header->typeflag[0] <= '9') &&
  ------------------
  |  Branch (418:9): [True: 3.79k, False: 64]
  |  Branch (418:39): [True: 2.42k, False: 1.36k]
  ------------------
  419|  1.43k|	    !( header->typeflag[0] >= 'A' && header->typeflag[0] <= 'Z') &&
  ------------------
  |  Branch (419:9): [True: 1.36k, False: 68]
  |  Branch (419:39): [True: 628, False: 736]
  ------------------
  420|    804|	    !( header->typeflag[0] >= 'a' && header->typeflag[0] <= 'z') )
  ------------------
  |  Branch (420:9): [True: 735, False: 69]
  |  Branch (420:39): [True: 732, False: 3]
  ------------------
  421|     72|		return (0);
  422|  4.46k|	bid += 2;  /* 6 bits of variation in an 8-bit field leaves 2 bits. */
  423|       |
  424|       |	/*
  425|       |	 * Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields.
  426|       |	 */
  427|  4.46k|	if (validate_number_field(header->mode, sizeof(header->mode)) == 0
  ------------------
  |  Branch (427:6): [True: 201, False: 4.26k]
  ------------------
  428|  4.26k|	    || validate_number_field(header->uid, sizeof(header->uid)) == 0
  ------------------
  |  Branch (428:9): [True: 148, False: 4.11k]
  ------------------
  429|  4.11k|	    || validate_number_field(header->gid, sizeof(header->gid)) == 0
  ------------------
  |  Branch (429:9): [True: 191, False: 3.92k]
  ------------------
  430|  3.92k|	    || validate_number_field(header->mtime, sizeof(header->mtime)) == 0
  ------------------
  |  Branch (430:9): [True: 127, False: 3.79k]
  ------------------
  431|  3.79k|	    || validate_number_field(header->size, sizeof(header->size)) == 0
  ------------------
  |  Branch (431:9): [True: 249, False: 3.54k]
  ------------------
  432|  3.54k|	    || validate_number_field(header->rdevmajor, sizeof(header->rdevmajor)) == 0
  ------------------
  |  Branch (432:9): [True: 623, False: 2.92k]
  ------------------
  433|  2.92k|	    || validate_number_field(header->rdevminor, sizeof(header->rdevminor)) == 0) {
  ------------------
  |  Branch (433:9): [True: 62, False: 2.86k]
  ------------------
  434|  1.60k|		bid = 0;
  435|  1.60k|	}
  436|       |
  437|  4.46k|	return (bid);
  438|  4.53k|}
archive_read_support_format_tar.c:archive_block_is_null:
 1063|  32.7k|{
 1064|  32.7k|	unsigned i;
 1065|       |
 1066|  5.69M|	for (i = 0; i < 512; i++)
  ------------------
  |  Branch (1066:14): [True: 5.68M, False: 9.48k]
  ------------------
 1067|  5.68M|		if (*p++)
  ------------------
  |  Branch (1067:7): [True: 23.2k, False: 5.66M]
  ------------------
 1068|  23.2k|			return (0);
 1069|  9.48k|	return (1);
 1070|  32.7k|}
archive_read_support_format_tar.c:checksum:
 1003|   382k|{
 1004|   382k|	const unsigned char *bytes;
 1005|   382k|	const struct archive_entry_header_ustar	*header;
 1006|   382k|	int check, sum;
 1007|   382k|	size_t i;
 1008|       |
 1009|   382k|	(void)a; /* UNUSED */
 1010|   382k|	bytes = (const unsigned char *)h;
 1011|   382k|	header = (const struct archive_entry_header_ustar *)h;
 1012|       |
 1013|       |	/* Checksum field must hold an octal number */
 1014|  2.77M|	for (i = 0; i < sizeof(header->checksum); ++i) {
  ------------------
  |  Branch (1014:14): [True: 2.48M, False: 291k]
  ------------------
 1015|  2.48M|		char c = header->checksum[i];
 1016|  2.48M|		if (c != ' ' && c != '\0' && (c < '0' || c > '7'))
  ------------------
  |  Branch (1016:7): [True: 2.41M, False: 75.2k]
  |  Branch (1016:19): [True: 2.25M, False: 152k]
  |  Branch (1016:33): [True: 11.5k, False: 2.24M]
  |  Branch (1016:44): [True: 79.4k, False: 2.16M]
  ------------------
 1017|  91.0k|			return 0;
 1018|  2.48M|	}
 1019|       |
 1020|       |	/*
 1021|       |	 * Test the checksum.  Note that POSIX specifies _unsigned_
 1022|       |	 * bytes for this calculation.
 1023|       |	 */
 1024|   291k|	sum = (int)tar_atol(header->checksum, sizeof(header->checksum));
 1025|   291k|	check = 0;
 1026|  43.4M|	for (i = 0; i < 148; i++)
  ------------------
  |  Branch (1026:14): [True: 43.1M, False: 291k]
  ------------------
 1027|  43.1M|		check += (unsigned char)bytes[i];
 1028|  2.62M|	for (; i < 156; i++)
  ------------------
  |  Branch (1028:9): [True: 2.33M, False: 291k]
  ------------------
 1029|  2.33M|		check += 32;
 1030|   104M|	for (; i < 512; i++)
  ------------------
  |  Branch (1030:9): [True: 103M, False: 291k]
  ------------------
 1031|   103M|		check += (unsigned char)bytes[i];
 1032|   291k|	if (sum == check)
  ------------------
  |  Branch (1032:6): [True: 6, False: 291k]
  ------------------
 1033|      6|		return (1);
 1034|       |
 1035|       |	/*
 1036|       |	 * Repeat test with _signed_ bytes, just in case this archive
 1037|       |	 * was created by an old BSD, Solaris, or HP-UX tar with a
 1038|       |	 * broken checksum calculation.
 1039|       |	 */
 1040|   291k|	check = 0;
 1041|  43.4M|	for (i = 0; i < 148; i++)
  ------------------
  |  Branch (1041:14): [True: 43.1M, False: 291k]
  ------------------
 1042|  43.1M|		check += (signed char)bytes[i];
 1043|  2.62M|	for (; i < 156; i++)
  ------------------
  |  Branch (1043:9): [True: 2.33M, False: 291k]
  ------------------
 1044|  2.33M|		check += 32;
 1045|   103M|	for (; i < 512; i++)
  ------------------
  |  Branch (1045:9): [True: 103M, False: 291k]
  ------------------
 1046|   103M|		check += (signed char)bytes[i];
 1047|   291k|	if (sum == check)
  ------------------
  |  Branch (1047:6): [True: 12, False: 291k]
  ------------------
 1048|     12|		return (1);
 1049|       |
 1050|   291k|#if DONT_FAIL_ON_CRC_ERROR
 1051|       |	/* Speed up fuzzing by pretending the checksum is always right. */
 1052|   291k|	return (1);
 1053|       |#else
 1054|       |	return (0);
 1055|       |#endif
 1056|   291k|}
archive_read_support_format_tar.c:tar_atol:
 3583|  2.06M|{
 3584|       |	/*
 3585|       |	 * Technically, GNU tar considers a field to be in base-256
 3586|       |	 * only if the first byte is 0xff or 0x80.
 3587|       |	 */
 3588|  2.06M|	if (*p & 0x80)
  ------------------
  |  Branch (3588:6): [True: 3.69k, False: 2.06M]
  ------------------
 3589|  3.69k|		return (tar_atol256(p, char_cnt));
 3590|  2.06M|	return (tar_atol8(p, char_cnt));
 3591|  2.06M|}
archive_read_support_format_tar.c:tar_atol256:
 3659|  3.69k|{
 3660|  3.69k|	uint64_t l;
 3661|  3.69k|	const unsigned char *p = (const unsigned char *)_p;
 3662|  3.69k|	unsigned char c, neg;
 3663|       |
 3664|       |	/* Extend 7-bit 2s-comp to 8-bit 2s-comp, decide sign. */
 3665|  3.69k|	c = *p;
 3666|  3.69k|	if (c & 0x40) {
  ------------------
  |  Branch (3666:6): [True: 2.32k, False: 1.37k]
  ------------------
 3667|  2.32k|		neg = 0xff;
 3668|  2.32k|		c |= 0x80;
 3669|  2.32k|		l = ~ARCHIVE_LITERAL_ULL(0);
  ------------------
  |  |  208|  2.32k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  ------------------
 3670|  2.32k|	} else {
 3671|  1.37k|		neg = 0;
 3672|  1.37k|		c &= 0x7f;
 3673|  1.37k|		l = 0;
 3674|  1.37k|	}
 3675|       |
 3676|       |	/* If more than 8 bytes, check that we can ignore
 3677|       |	 * high-order bits without overflow. */
 3678|  6.53k|	while (char_cnt > sizeof(int64_t)) {
  ------------------
  |  Branch (3678:9): [True: 3.36k, False: 3.16k]
  ------------------
 3679|  3.36k|		--char_cnt;
 3680|  3.36k|		if (c != neg)
  ------------------
  |  Branch (3680:7): [True: 531, False: 2.83k]
  ------------------
 3681|    531|			return neg ? INT64_MIN : INT64_MAX;
  ------------------
  |  Branch (3681:11): [True: 397, False: 134]
  ------------------
 3682|  2.83k|		c = *++p;
 3683|  2.83k|	}
 3684|       |
 3685|       |	/* c is first byte that fits; if sign mismatch, return overflow */
 3686|  3.16k|	if ((c ^ neg) & 0x80) {
  ------------------
  |  Branch (3686:6): [True: 119, False: 3.04k]
  ------------------
 3687|    119|		return neg ? INT64_MIN : INT64_MAX;
  ------------------
  |  Branch (3687:10): [True: 106, False: 13]
  ------------------
 3688|    119|	}
 3689|       |
 3690|       |	/* Accumulate remaining bytes. */
 3691|  24.3k|	while (--char_cnt > 0) {
  ------------------
  |  Branch (3691:9): [True: 21.3k, False: 3.04k]
  ------------------
 3692|  21.3k|		l = (l << 8) | c;
 3693|  21.3k|		c = *++p;
 3694|  21.3k|	}
 3695|  3.04k|	l = (l << 8) | c;
 3696|       |	/* Return signed twos-complement value. */
 3697|  3.04k|	return (int64_t)(l);
 3698|  3.16k|}
archive_read_support_format_tar.c:tar_atol8:
 3637|  2.06M|{
 3638|  2.06M|	return tar_atol_base_n(p, char_cnt, 8);
 3639|  2.06M|}
archive_read_support_format_tar.c:tar_atol_base_n:
 3600|  2.06M|{
 3601|  2.06M|	int64_t	l;
 3602|  2.06M|	int digit, sign;
 3603|       |
 3604|       |	/* the pointer will not be dereferenced if char_cnt is zero
 3605|       |	 * due to the way the && operator is evaluated.
 3606|       |	 */
 3607|  2.44M|	while (char_cnt != 0 && (*p == ' ' || *p == '\t')) {
  ------------------
  |  Branch (3607:9): [True: 2.41M, False: 32.3k]
  |  Branch (3607:27): [True: 369k, False: 2.04M]
  |  Branch (3607:40): [True: 14.3k, False: 2.03M]
  ------------------
 3608|   384k|		p++;
 3609|   384k|		char_cnt--;
 3610|   384k|	}
 3611|       |
 3612|  2.06M|	sign = 1;
 3613|  2.06M|	if (char_cnt != 0 && *p == '-') {
  ------------------
  |  Branch (3613:6): [True: 2.03M, False: 32.3k]
  |  Branch (3613:23): [True: 696, False: 2.03M]
  ------------------
 3614|    696|		sign = -1;
 3615|    696|		p++;
 3616|    696|		char_cnt--;
 3617|    696|	}
 3618|       |
 3619|  2.06M|	l = 0;
 3620|  19.7M|	while (char_cnt != 0) {
  ------------------
  |  Branch (3620:9): [True: 17.9M, False: 1.82M]
  ------------------
 3621|  17.9M|		digit = *p - '0';
 3622|  17.9M|		if (digit < 0 || digit >= base)
  ------------------
  |  Branch (3622:7): [True: 155k, False: 17.7M]
  |  Branch (3622:20): [True: 87.0k, False: 17.7M]
  ------------------
 3623|   242k|			break;
 3624|  17.7M|		if (archive_ckd_mul_i64(&l, l, base) ||
  ------------------
  |  Branch (3624:7): [True: 45, False: 17.7M]
  ------------------
 3625|  17.7M|		    archive_ckd_add_i64(&l, l, sign * digit)) {
  ------------------
  |  Branch (3625:7): [True: 12, False: 17.7M]
  ------------------
 3626|       |			 /* Truncate on overflow. */
 3627|     57|			return sign < 0 ? INT64_MIN : INT64_MAX;
  ------------------
  |  Branch (3627:11): [True: 17, False: 40]
  ------------------
 3628|     57|		}
 3629|  17.7M|		p++;
 3630|  17.7M|		char_cnt--;
 3631|  17.7M|	}
 3632|  2.06M|	return l;
 3633|  2.06M|}
archive_read_support_format_tar.c:validate_number_field:
  346|  27.0k|{
  347|  27.0k|	unsigned char marker = (unsigned char)p_field[0];
  348|  27.0k|	if (marker == 128 || marker == 255 || marker == 0) {
  ------------------
  |  Branch (348:6): [True: 466, False: 26.5k]
  |  Branch (348:23): [True: 759, False: 25.7k]
  |  Branch (348:40): [True: 7.06k, False: 18.7k]
  ------------------
  349|       |		/* Base-256 marker, there's nothing we can check. */
  350|  8.28k|		return 1;
  351|  18.7k|	} else {
  352|       |		/* Must be octal */
  353|  18.7k|		size_t i = 0;
  354|       |		/* Skip any leading spaces */
  355|  68.4k|		while (i < i_size && p_field[i] == ' ') {
  ------------------
  |  Branch (355:10): [True: 63.9k, False: 4.54k]
  |  Branch (355:24): [True: 49.7k, False: 14.1k]
  ------------------
  356|  49.7k|			++i;
  357|  49.7k|		}
  358|       |		/* Skip octal digits. */
  359|   116k|		while (i < i_size && p_field[i] >= '0' && p_field[i] <= '7') {
  ------------------
  |  Branch (359:10): [True: 109k, False: 7.19k]
  |  Branch (359:24): [True: 99.0k, False: 10.6k]
  |  Branch (359:45): [True: 98.1k, False: 897]
  ------------------
  360|  98.1k|			++i;
  361|  98.1k|		}
  362|       |		/* Any remaining characters must be space or NUL padding. */
  363|  36.5k|		while (i < i_size) {
  ------------------
  |  Branch (363:10): [True: 19.4k, False: 17.1k]
  ------------------
  364|  19.4k|			if (p_field[i] != ' ' && p_field[i] != 0) {
  ------------------
  |  Branch (364:8): [True: 15.2k, False: 4.11k]
  |  Branch (364:29): [True: 1.60k, False: 13.6k]
  ------------------
  365|  1.60k|				return 0;
  366|  1.60k|			}
  367|  17.8k|			++i;
  368|  17.8k|		}
  369|  17.1k|		return 1;
  370|  18.7k|	}
  371|  27.0k|}
archive_read_support_format_tar.c:archive_read_format_tar_options:
  443|  33.4k|{
  444|  33.4k|	struct tar *tar = a->format->data;
  445|  33.4k|	int ret = ARCHIVE_FAILED;
  ------------------
  |  |  237|  33.4k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  446|       |
  447|  33.4k|	if (strcmp(key, "compat-2x")  == 0) {
  ------------------
  |  Branch (447:6): [True: 0, False: 33.4k]
  ------------------
  448|       |		/* Handle UTF-8 filenames as libarchive 2.x */
  449|      0|		tar->compat_2x = (val != NULL && val[0] != 0);
  ------------------
  |  Branch (449:21): [True: 0, False: 0]
  |  Branch (449:36): [True: 0, False: 0]
  ------------------
  450|      0|		tar->init_default_conversion = tar->compat_2x;
  451|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  452|  33.4k|	} else if (strcmp(key, "hdrcharset")  == 0) {
  ------------------
  |  Branch (452:13): [True: 0, False: 33.4k]
  ------------------
  453|      0|		if (val == NULL || val[0] == 0)
  ------------------
  |  Branch (453:7): [True: 0, False: 0]
  |  Branch (453:22): [True: 0, False: 0]
  ------------------
  454|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  455|      0|			    "tar: hdrcharset option needs a character-set name");
  456|      0|		else {
  457|      0|			tar->opt_sconv =
  458|      0|			    archive_string_conversion_from_charset(
  459|      0|				&a->archive, val, 0);
  460|      0|			if (tar->opt_sconv != NULL)
  ------------------
  |  Branch (460:8): [True: 0, False: 0]
  ------------------
  461|      0|				ret = ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  462|      0|			else
  463|      0|				ret = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  464|      0|		}
  465|      0|		return (ret);
  466|  33.4k|	} else if (strcmp(key, "mac-ext") == 0) {
  ------------------
  |  Branch (466:13): [True: 16.7k, False: 16.7k]
  ------------------
  467|  16.7k|		tar->process_mac_extensions = (val != NULL && val[0] != 0);
  ------------------
  |  Branch (467:34): [True: 16.7k, False: 0]
  |  Branch (467:49): [True: 16.7k, False: 0]
  ------------------
  468|  16.7k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  469|  16.7k|	} else if (strcmp(key, "read_concatenated_archives") == 0) {
  ------------------
  |  Branch (469:13): [True: 16.7k, False: 0]
  ------------------
  470|  16.7k|		tar->read_concatenated_archives = (val != NULL && val[0] != 0);
  ------------------
  |  Branch (470:38): [True: 16.7k, False: 0]
  |  Branch (470:53): [True: 16.7k, False: 0]
  ------------------
  471|  16.7k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  472|  16.7k|	}
  473|       |
  474|       |	/* Note: The "warn" return is just to inform the options
  475|       |	 * supervisor that we didn't handle it.  It will generate
  476|       |	 * a suitable error if no one used this option. */
  477|      0|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  478|  33.4k|}
archive_read_support_format_tar.c:archive_read_format_tar_read_header:
  514|   370k|{
  515|       |	/*
  516|       |	 * When converting tar archives to cpio archives, it is
  517|       |	 * essential that each distinct file have a distinct inode
  518|       |	 * number.  To simplify this, we keep a static count here to
  519|       |	 * assign fake dev/inode numbers to each tar entry.  Note that
  520|       |	 * pax format archives may overwrite this with something more
  521|       |	 * useful.
  522|       |	 *
  523|       |	 * Ideally, we would track every file read from the archive so
  524|       |	 * that we could assign the same dev/ino pair to hardlinks,
  525|       |	 * but the memory required to store a complete lookup table is
  526|       |	 * probably not worthwhile just to support the relatively
  527|       |	 * obscure tar->cpio conversion case.
  528|       |	 */
  529|   370k|	struct tar *tar = a->format->data;
  530|   370k|	const char *p;
  531|   370k|	const wchar_t *wp;
  532|   370k|	int r;
  533|   370k|	size_t l;
  534|   370k|	int64_t unconsumed = 0;
  535|       |
  536|       |	/* Assign default device/inode values. */
  537|   370k|	archive_entry_set_dev(entry, 1 + tar->default_dev); /* Don't use zero. */
  538|   370k|	archive_entry_set_ino(entry, ++tar->default_inode); /* Don't use zero. */
  539|       |	/* Limit generated st_ino number to 16 bits. */
  540|   370k|	if (tar->default_inode >= 0xffff) {
  ------------------
  |  Branch (540:6): [True: 0, False: 370k]
  ------------------
  541|      0|		++tar->default_dev;
  542|      0|		tar->default_inode = 0;
  543|      0|	}
  544|       |
  545|   370k|	tar->entry_offset = 0;
  546|   370k|	gnu_clear_sparse_list(tar);
  547|   370k|	tar->size_fields = 0; /* We don't have any size info yet */
  548|       |
  549|       |	/* Setup default string conversion. */
  550|   370k|	tar->sconv = tar->opt_sconv;
  551|   370k|	if (tar->sconv == NULL) {
  ------------------
  |  Branch (551:6): [True: 370k, False: 0]
  ------------------
  552|   370k|		if (!tar->init_default_conversion) {
  ------------------
  |  Branch (552:7): [True: 1.97k, False: 368k]
  ------------------
  553|  1.97k|			tar->sconv_default =
  554|  1.97k|			    archive_string_default_conversion_for_read(&(a->archive));
  555|  1.97k|			tar->init_default_conversion = 1;
  556|  1.97k|		}
  557|   370k|		tar->sconv = tar->sconv_default;
  558|   370k|	}
  559|       |
  560|   370k|	r = tar_read_header(a, tar, entry, &unconsumed);
  561|       |
  562|   370k|	tar_flush_unconsumed(a, &unconsumed);
  563|       |
  564|       |	/*
  565|       |	 * "non-sparse" files are really just sparse files with
  566|       |	 * a single block.
  567|       |	 */
  568|   370k|	if (tar->sparse_list == NULL) {
  ------------------
  |  Branch (568:6): [True: 370k, False: 181]
  ------------------
  569|   370k|		if (gnu_add_sparse_entry(a, tar, 0, tar->entry_bytes_remaining)
  ------------------
  |  Branch (569:7): [True: 0, False: 370k]
  ------------------
  570|   370k|		    != ARCHIVE_OK)
  ------------------
  |  |  233|   370k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  571|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  572|   370k|	} else {
  573|    181|		struct sparse_block *sb;
  574|    181|		size_t added = 0;
  575|    181|		int count;
  576|       |
  577|  12.5k|		for (sb = tar->sparse_list; sb != NULL; sb = sb->next) {
  ------------------
  |  Branch (577:31): [True: 12.3k, False: 181]
  ------------------
  578|  12.3k|			if (!sb->hole) {
  ------------------
  |  Branch (578:8): [True: 12.0k, False: 335]
  ------------------
  579|  12.0k|				archive_entry_sparse_add_entry(entry,
  580|  12.0k|				    sb->offset, sb->remaining);
  581|  12.0k|				added++;
  582|  12.0k|			}
  583|  12.3k|		}
  584|    181|		count = archive_entry_sparse_count(entry);
  585|    181|		if (count < 0 || (size_t)count != added)
  ------------------
  |  Branch (585:7): [True: 0, False: 181]
  |  Branch (585:20): [True: 140, False: 41]
  ------------------
  586|    140|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    140|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  587|    181|	}
  588|       |
  589|   370k|	if (r == ARCHIVE_OK && archive_entry_filetype(entry) == AE_IFREG) {
  ------------------
  |  |  233|   740k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	if (r == ARCHIVE_OK && archive_entry_filetype(entry) == AE_IFREG) {
  ------------------
  |  |  216|   281k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  |  Branch (589:6): [True: 281k, False: 88.8k]
  |  Branch (589:25): [True: 278k, False: 2.54k]
  ------------------
  590|       |		/*
  591|       |		 * "Regular" entry with trailing '/' is really
  592|       |		 * directory: This is needed for certain old tar
  593|       |		 * variants and even for some broken newer ones.
  594|       |		 */
  595|   278k|		if ((p = archive_entry_pathname(entry)) != NULL) {
  ------------------
  |  Branch (595:7): [True: 278k, False: 0]
  ------------------
  596|   278k|			l = strlen(p);
  597|   278k|			if (l > 0 && p[l - 1] == '/') {
  ------------------
  |  Branch (597:8): [True: 264k, False: 14.3k]
  |  Branch (597:17): [True: 2.83k, False: 261k]
  ------------------
  598|  2.83k|				archive_entry_set_filetype(entry, AE_IFDIR);
  ------------------
  |  |  221|  2.83k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  599|  2.83k|				tar->entry_bytes_remaining = 0;
  600|  2.83k|				tar->entry_padding = 0;
  601|  2.83k|			}
  602|   278k|		} else if ((wp = archive_entry_pathname_w(entry)) != NULL) {
  ------------------
  |  Branch (602:14): [True: 0, False: 0]
  ------------------
  603|      0|			l = wcslen(wp);
  604|      0|			if (l > 0 && wp[l - 1] == L'/') {
  ------------------
  |  Branch (604:8): [True: 0, False: 0]
  |  Branch (604:17): [True: 0, False: 0]
  ------------------
  605|      0|				archive_entry_set_filetype(entry, AE_IFDIR);
  ------------------
  |  |  221|      0|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  606|      0|				tar->entry_bytes_remaining = 0;
  607|      0|				tar->entry_padding = 0;
  608|      0|			}
  609|      0|		}
  610|   278k|	}
  611|   370k|	return (r);
  612|   370k|}
archive_read_support_format_tar.c:tar_read_header:
  722|   370k|{
  723|   370k|	ssize_t bytes;
  724|   370k|	int err = ARCHIVE_OK, err2;
  ------------------
  |  |  233|   370k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  725|   370k|	int eof_fatal = 0; /* EOF is okay at some points... */
  726|   370k|	const char *h;
  727|   370k|	const struct archive_entry_header_ustar *header;
  728|   370k|	const struct archive_entry_header_gnutar *gnuheader;
  729|       |
  730|       |	/* Bitmask of what header types we've seen. */
  731|   370k|	int32_t seen_headers = 0;
  732|   370k|	static const int32_t seen_A_header = 1;
  733|   370k|	static const int32_t seen_g_header = 2;
  734|   370k|	static const int32_t seen_K_header = 4;
  735|   370k|	static const int32_t seen_L_header = 8;
  736|   370k|	static const int32_t seen_V_header = 16;
  737|   370k|	static const int32_t seen_x_header = 32; /* Also X */
  738|   370k|	static const int32_t seen_mac_metadata = 512;
  739|       |
  740|   370k|	tar_reset_header_state(tar);
  741|       |
  742|       |	/* Ensure format is set. */
  743|   370k|	if (a->archive.archive_format_name == NULL) {
  ------------------
  |  Branch (743:6): [True: 1.97k, False: 368k]
  ------------------
  744|  1.97k|		a->archive.archive_format = ARCHIVE_FORMAT_TAR;
  ------------------
  |  |  367|  1.97k|#define	ARCHIVE_FORMAT_TAR			0x30000
  ------------------
  745|  1.97k|		a->archive.archive_format_name = "tar";
  746|  1.97k|	}
  747|       |
  748|       |	/*
  749|       |	 * TODO: Write global/default pax options into
  750|       |	 * 'entry' struct here before overwriting with
  751|       |	 * file-specific options.
  752|       |	 */
  753|       |
  754|       |	/* Loop over all the headers needed for the next entry */
  755|   374k|	for (;;) {
  756|       |
  757|       |		/* Find the next valid header record. */
  758|   384k|		while (1) {
  ------------------
  |  Branch (758:10): [True: 384k, Folded]
  ------------------
  759|   384k|			if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|   384k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (759:8): [True: 925, False: 383k]
  ------------------
  760|    925|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    925|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  761|    925|			}
  762|       |
  763|       |			/* Read 512-byte header record */
  764|   383k|			h = __archive_read_ahead(a, 512, &bytes);
  765|   383k|			if (bytes == 0) { /* EOF at a block boundary. */
  ------------------
  |  Branch (765:8): [True: 49, False: 383k]
  ------------------
  766|     49|				if (eof_fatal) {
  ------------------
  |  Branch (766:9): [True: 24, False: 25]
  ------------------
  767|       |					/* We've read a special header already;
  768|       |					 * if there's no regular header, then this is
  769|       |					 * a premature EOF. */
  770|     24|					archive_set_error(&a->archive, EINVAL,
  771|     24|							  "Damaged tar archive (end-of-archive within a sequence of headers)");
  772|     24|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     24|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  773|     25|				} else {
  774|     25|					return (ARCHIVE_EOF);
  ------------------
  |  |  232|     25|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  775|     25|				}
  776|     49|			}
  777|   383k|			if (h == NULL) {  /* Short block at EOF; this is bad. */
  ------------------
  |  Branch (777:8): [True: 482, False: 382k]
  ------------------
  778|    482|				archive_set_error(&a->archive,
  779|    482|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    482|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  780|    482|				    "Truncated tar archive"
  781|    482|				    " detected while reading next header");
  782|    482|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    482|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  783|    482|			}
  784|   382k|			*unconsumed += 512;
  785|       |
  786|   382k|			if (h[0] == 0 && archive_block_is_null(h)) {
  ------------------
  |  Branch (786:8): [True: 30.6k, False: 351k]
  |  Branch (786:21): [True: 9.33k, False: 21.3k]
  ------------------
  787|       |				/* We found a NULL block which indicates end-of-archive */
  788|       |
  789|  9.33k|				if (tar->read_concatenated_archives) {
  ------------------
  |  Branch (789:9): [True: 9.33k, False: 0]
  ------------------
  790|       |					/* We're ignoring NULL blocks, so keep going. */
  791|  9.33k|					continue;
  792|  9.33k|				}
  793|       |
  794|       |				/* Try to consume a second all-null record, as well. */
  795|       |				/* If we can't, that's okay. */
  796|      0|				tar_flush_unconsumed(a, unconsumed);
  797|      0|				h = __archive_read_ahead(a, 512, NULL);
  798|      0|				if (h != NULL && h[0] == 0 && archive_block_is_null(h))
  ------------------
  |  Branch (798:9): [True: 0, False: 0]
  |  Branch (798:22): [True: 0, False: 0]
  |  Branch (798:35): [True: 0, False: 0]
  ------------------
  799|      0|						__archive_read_consume(a, 512);
  800|       |
  801|      0|				archive_clear_error(&a->archive);
  802|      0|				return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  803|  9.33k|			}
  804|       |
  805|       |			/* This is NOT a null block, so it must be a valid header. */
  806|   373k|			if (!checksum(a, h)) {
  ------------------
  |  Branch (806:8): [True: 86.4k, False: 286k]
  ------------------
  807|  86.4k|				if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|  86.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (807:9): [True: 0, False: 86.4k]
  ------------------
  808|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  809|      0|				}
  810|  86.4k|				archive_set_error(&a->archive, EINVAL,
  811|  86.4k|						  "Damaged tar archive (bad header checksum)");
  812|       |				/* If we've read some critical information (pax headers, etc)
  813|       |				 * and _then_ see a bad header, we can't really recover. */
  814|  86.4k|				if (eof_fatal) {
  ------------------
  |  Branch (814:9): [True: 20, False: 86.4k]
  ------------------
  815|     20|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     20|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  816|  86.4k|				} else {
  817|  86.4k|					return (ARCHIVE_RETRY);
  ------------------
  |  |  234|  86.4k|#define	ARCHIVE_RETRY	(-10)	/* Retry might succeed. */
  ------------------
  818|  86.4k|				}
  819|  86.4k|			}
  820|   286k|			break;
  821|   373k|		}
  822|       |
  823|       |		/* Determine the format variant. */
  824|   286k|		header = (const struct archive_entry_header_ustar *)h;
  825|   286k|		switch(header->typeflag[0]) {
  826|    944|		case 'A': /* Solaris tar ACL */
  ------------------
  |  Branch (826:3): [True: 944, False: 285k]
  ------------------
  827|    944|			if (seen_headers & seen_A_header) {
  ------------------
  |  Branch (827:8): [True: 0, False: 944]
  ------------------
  828|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  829|      0|						  "Redundant 'A' header");
  830|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  831|      0|			}
  832|    944|			seen_headers |= seen_A_header;
  833|    944|			a->archive.archive_format = ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE;
  ------------------
  |  |  369|    944|#define	ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE	(ARCHIVE_FORMAT_TAR | 2)
  |  |  ------------------
  |  |  |  |  367|    944|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  834|    944|			a->archive.archive_format_name = "Solaris tar";
  835|    944|			err2 = header_Solaris_ACL(a, tar, entry, h, unconsumed);
  836|    944|			break;
  837|  1.28k|		case 'g': /* POSIX-standard 'g' header. */
  ------------------
  |  Branch (837:3): [True: 1.28k, False: 285k]
  ------------------
  838|  1.28k|			if (seen_headers & seen_g_header) {
  ------------------
  |  Branch (838:8): [True: 1, False: 1.28k]
  ------------------
  839|      1|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  840|      1|						  "Redundant 'g' header");
  841|      1|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  842|      1|			}
  843|  1.28k|			seen_headers |= seen_g_header;
  844|  1.28k|			a->archive.archive_format = ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE;
  ------------------
  |  |  369|  1.28k|#define	ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE	(ARCHIVE_FORMAT_TAR | 2)
  |  |  ------------------
  |  |  |  |  367|  1.28k|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  845|  1.28k|			a->archive.archive_format_name = "POSIX pax interchange format";
  846|  1.28k|			err2 = header_pax_global(a, tar, entry, h, unconsumed);
  847|  1.28k|			break;
  848|    880|		case 'K': /* Long link name (GNU tar, others) */
  ------------------
  |  Branch (848:3): [True: 880, False: 285k]
  ------------------
  849|    880|			if (seen_headers & seen_K_header) {
  ------------------
  |  Branch (849:8): [True: 612, False: 268]
  ------------------
  850|    612|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    612|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  851|    612|						  "Damaged archive: Redundant 'K' headers may cause linknames to be incorrect");
  852|    612|				err = err_combine(err, ARCHIVE_WARN);
  ------------------
  |  |  201|    612|#define	err_combine(a,b)	((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (201:27): [True: 0, False: 612]
  |  |  ------------------
  ------------------
  853|    612|			}
  854|    880|			seen_headers |= seen_K_header;
  855|    880|			a->archive.archive_format = ARCHIVE_FORMAT_TAR_GNUTAR;
  ------------------
  |  |  371|    880|#define	ARCHIVE_FORMAT_TAR_GNUTAR		(ARCHIVE_FORMAT_TAR | 4)
  |  |  ------------------
  |  |  |  |  367|    880|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  856|    880|			a->archive.archive_format_name = "GNU tar format";
  857|    880|			err2 = header_gnu_longlink(a, tar, entry, h, unconsumed);
  858|    880|			break;
  859|    515|		case 'L': /* Long filename (GNU tar, others) */
  ------------------
  |  Branch (859:3): [True: 515, False: 286k]
  ------------------
  860|    515|			if (seen_headers & seen_L_header) {
  ------------------
  |  Branch (860:8): [True: 360, False: 155]
  ------------------
  861|    360|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    360|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  862|    360|						  "Damaged archive: Redundant 'L' headers may cause filenames to be incorrect");
  863|    360|				err = err_combine(err, ARCHIVE_WARN);
  ------------------
  |  |  201|    360|#define	err_combine(a,b)	((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (201:27): [True: 0, False: 360]
  |  |  ------------------
  ------------------
  864|    360|			}
  865|    515|			seen_headers |= seen_L_header;
  866|    515|			a->archive.archive_format = ARCHIVE_FORMAT_TAR_GNUTAR;
  ------------------
  |  |  371|    515|#define	ARCHIVE_FORMAT_TAR_GNUTAR		(ARCHIVE_FORMAT_TAR | 4)
  |  |  ------------------
  |  |  |  |  367|    515|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  867|    515|			a->archive.archive_format_name = "GNU tar format";
  868|    515|			err2 = header_gnu_longname(a, tar, entry, h, unconsumed);
  869|    515|			break;
  870|    144|		case 'V': /* GNU volume header */
  ------------------
  |  Branch (870:3): [True: 144, False: 286k]
  ------------------
  871|    144|			if (seen_headers & seen_V_header) {
  ------------------
  |  Branch (871:8): [True: 44, False: 100]
  ------------------
  872|     44|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     44|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  873|     44|						  "Redundant 'V' header");
  874|     44|				err = err_combine(err, ARCHIVE_WARN);
  ------------------
  |  |  201|     44|#define	err_combine(a,b)	((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (201:27): [True: 0, False: 44]
  |  |  ------------------
  ------------------
  875|     44|			}
  876|    144|			seen_headers |= seen_V_header;
  877|    144|			a->archive.archive_format = ARCHIVE_FORMAT_TAR_GNUTAR;
  ------------------
  |  |  371|    144|#define	ARCHIVE_FORMAT_TAR_GNUTAR		(ARCHIVE_FORMAT_TAR | 4)
  |  |  ------------------
  |  |  |  |  367|    144|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  878|    144|			a->archive.archive_format_name = "GNU tar format";
  879|    144|			err2 = header_volume(a, tar, entry, h, unconsumed);
  880|    144|			break;
  881|     43|		case 'X': /* Used by SUN tar; same as 'x'. */
  ------------------
  |  Branch (881:3): [True: 43, False: 286k]
  ------------------
  882|     43|			if (seen_headers & seen_x_header) {
  ------------------
  |  Branch (882:8): [True: 1, False: 42]
  ------------------
  883|      1|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  884|      1|						  "Redundant 'X'/'x' header");
  885|      1|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  886|      1|			}
  887|     42|			seen_headers |= seen_x_header;
  888|     42|			a->archive.archive_format = ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE;
  ------------------
  |  |  369|     42|#define	ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE	(ARCHIVE_FORMAT_TAR | 2)
  |  |  ------------------
  |  |  |  |  367|     42|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  889|     42|			a->archive.archive_format_name =
  890|     42|				"POSIX pax interchange format (Sun variant)";
  891|     42|			err2 = header_pax_extension(a, tar, entry, h, unconsumed);
  892|     42|			break;
  893|    825|		case 'x': /* POSIX-standard 'x' header. */
  ------------------
  |  Branch (893:3): [True: 825, False: 285k]
  ------------------
  894|    825|			if (seen_headers & seen_x_header) {
  ------------------
  |  Branch (894:8): [True: 2, False: 823]
  ------------------
  895|      2|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  896|      2|						  "Redundant 'x' header");
  897|      2|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  898|      2|			}
  899|    823|			seen_headers |= seen_x_header;
  900|    823|			a->archive.archive_format = ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE;
  ------------------
  |  |  369|    823|#define	ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE	(ARCHIVE_FORMAT_TAR | 2)
  |  |  ------------------
  |  |  |  |  367|    823|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  901|    823|			a->archive.archive_format_name = "POSIX pax interchange format";
  902|    823|			err2 = header_pax_extension(a, tar, entry, h, unconsumed);
  903|    823|			break;
  904|   282k|		default: /* Regular header: Legacy tar, GNU tar, or ustar */
  ------------------
  |  Branch (904:3): [True: 282k, False: 4.64k]
  ------------------
  905|   282k|			gnuheader = (const struct archive_entry_header_gnutar *)h;
  906|   282k|			if (memcmp(gnuheader->magic, "ustar  \0", 8) == 0) {
  ------------------
  |  Branch (906:8): [True: 755, False: 281k]
  ------------------
  907|    755|				a->archive.archive_format = ARCHIVE_FORMAT_TAR_GNUTAR;
  ------------------
  |  |  371|    755|#define	ARCHIVE_FORMAT_TAR_GNUTAR		(ARCHIVE_FORMAT_TAR | 4)
  |  |  ------------------
  |  |  |  |  367|    755|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  908|    755|				a->archive.archive_format_name = "GNU tar format";
  909|    755|				err2 = header_gnutar(a, tar, entry, h, unconsumed);
  910|   281k|			} else if (memcmp(header->magic, "ustar", 5) == 0) {
  ------------------
  |  Branch (910:15): [True: 2.52k, False: 278k]
  ------------------
  911|  2.52k|				if (a->archive.archive_format != ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE) {
  ------------------
  |  |  369|  2.52k|#define	ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE	(ARCHIVE_FORMAT_TAR | 2)
  |  |  ------------------
  |  |  |  |  367|  2.52k|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  |  Branch (911:9): [True: 2.47k, False: 55]
  ------------------
  912|  2.47k|					a->archive.archive_format = ARCHIVE_FORMAT_TAR_USTAR;
  ------------------
  |  |  368|  2.47k|#define	ARCHIVE_FORMAT_TAR_USTAR		(ARCHIVE_FORMAT_TAR | 1)
  |  |  ------------------
  |  |  |  |  367|  2.47k|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  913|  2.47k|					a->archive.archive_format_name = "POSIX ustar format";
  914|  2.47k|				}
  915|  2.52k|				err2 = header_ustar(a, tar, entry, h);
  916|   278k|			} else {
  917|   278k|				a->archive.archive_format = ARCHIVE_FORMAT_TAR;
  ------------------
  |  |  367|   278k|#define	ARCHIVE_FORMAT_TAR			0x30000
  ------------------
  918|   278k|				a->archive.archive_format_name = "tar (non-POSIX)";
  919|   278k|				err2 = header_old_tar(a, tar, entry, h);
  920|   278k|			}
  921|   282k|			err = err_combine(err, err2);
  ------------------
  |  |  201|   282k|#define	err_combine(a,b)	((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (201:27): [True: 725, False: 281k]
  |  |  ------------------
  ------------------
  922|       |			/* We return warnings or success as-is.  Anything else is fatal. */
  923|   282k|			if (err < ARCHIVE_WARN) {
  ------------------
  |  |  235|   282k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (923:8): [True: 127, False: 282k]
  ------------------
  924|    127|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    127|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  925|    127|			}
  926|       |			/* Filename of the form `._filename` is an AppleDouble
  927|       |			 * extension entry.  The body is the macOS metadata blob;
  928|       |			 * this is followed by another entry with the actual
  929|       |			 * regular file data.
  930|       |			 * This design has two drawbacks:
  931|       |			 * = it's brittle; you might just have a file with such a name
  932|       |			 * = it duplicates any long pathname extensions
  933|       |			 *
  934|       |			 * TODO: This probably shouldn't be here at all.  Consider
  935|       |			 * just returning the contents as a regular entry here and
  936|       |			 * then dealing with it when we write data to disk.
  937|       |			 */
  938|   282k|			if (tar->process_mac_extensions
  ------------------
  |  Branch (938:8): [True: 282k, False: 0]
  ------------------
  939|   282k|			    && ((seen_headers & seen_mac_metadata) == 0)
  ------------------
  |  Branch (939:11): [True: 282k, False: 11]
  ------------------
  940|   282k|			    && is_mac_metadata_entry(entry)) {
  ------------------
  |  Branch (940:11): [True: 18, False: 281k]
  ------------------
  941|     18|				err2 = read_mac_metadata_blob(a, entry, unconsumed);
  942|     18|				if (err2 < ARCHIVE_WARN) {
  ------------------
  |  |  235|     18|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (942:9): [True: 4, False: 14]
  ------------------
  943|      4|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  944|      4|				}
  945|     14|				err = err_combine(err, err2);
  ------------------
  |  |  201|     14|#define	err_combine(a,b)	((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (201:27): [True: 0, False: 14]
  |  |  ------------------
  ------------------
  946|       |				/* Note: Other headers can appear again. */
  947|     14|				seen_headers = seen_mac_metadata;
  948|     14|				tar_reset_header_state(tar);
  949|     14|				break;
  950|     18|			}
  951|       |
  952|       |			/* Reconcile GNU sparse attributes */
  953|   281k|			if (tar->sparse_gnu_attributes_seen) {
  ------------------
  |  Branch (953:8): [True: 78, False: 281k]
  ------------------
  954|       |				/* Only 'S' (GNU sparse) and ustar '0' regular files can be sparse */
  955|     78|				if (tar->filetype != 'S' && tar->filetype != '0') {
  ------------------
  |  Branch (955:9): [True: 76, False: 2]
  |  Branch (955:33): [True: 17, False: 59]
  ------------------
  956|     17|					archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     17|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  957|     17|							  "Non-regular file cannot be sparse");
  958|     17|					return (ARCHIVE_WARN);
  ------------------
  |  |  235|     17|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  959|     61|				} else if (tar->sparse_gnu_major == 0 &&
  ------------------
  |  Branch (959:16): [True: 15, False: 46]
  ------------------
  960|     15|				    tar->sparse_gnu_minor == 0) {
  ------------------
  |  Branch (960:9): [True: 6, False: 9]
  ------------------
  961|       |					/* Sparse map already parsed from 'x' header */
  962|     55|				} else if (tar->sparse_gnu_major == 0 &&
  ------------------
  |  Branch (962:16): [True: 9, False: 46]
  ------------------
  963|      9|				    tar->sparse_gnu_minor == 1) {
  ------------------
  |  Branch (963:9): [True: 1, False: 8]
  ------------------
  964|       |					/* Sparse map already parsed from 'x' header */
  965|     54|				} else if (tar->sparse_gnu_major == 1 &&
  ------------------
  |  Branch (965:16): [True: 45, False: 9]
  ------------------
  966|     45|				    tar->sparse_gnu_minor == 0) {
  ------------------
  |  Branch (966:9): [True: 45, False: 0]
  ------------------
  967|       |					/* Sparse map is prepended to file contents */
  968|     45|					ssize_t bytes_read;
  969|     45|					bytes_read = gnu_sparse_10_read(a, tar, unconsumed);
  970|     45|					if (bytes_read < 0)
  ------------------
  |  Branch (970:10): [True: 44, False: 1]
  ------------------
  971|     44|						return ((int)bytes_read);
  972|      1|					tar->entry_bytes_remaining -= bytes_read;
  973|      9|				} else {
  974|      9|					archive_set_error(&a->archive,
  975|      9|							  ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      9|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  976|      9|							  "Unrecognized GNU sparse file format");
  977|      9|					return (ARCHIVE_WARN);
  ------------------
  |  |  235|      9|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  978|      9|				}
  979|     78|			}
  980|   281k|			return (err);
  981|   286k|		}
  982|       |
  983|       |		/* We're between headers ... */
  984|  4.65k|		err = err_combine(err, err2);
  ------------------
  |  |  201|  4.65k|#define	err_combine(a,b)	((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (201:27): [True: 1.01k, False: 3.63k]
  |  |  ------------------
  ------------------
  985|  4.65k|		if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|  4.65k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (985:7): [True: 147, False: 4.50k]
  ------------------
  986|    147|			return (err);
  987|       |
  988|       |		/* The GNU volume header and the pax `g` global header
  989|       |		 * are both allowed to be the only header in an
  990|       |		 * archive.  If we've seen any other header, a
  991|       |		 * following EOF is fatal. */
  992|  4.50k|		if ((seen_headers & ~seen_V_header & ~seen_g_header) != 0) {
  ------------------
  |  Branch (992:7): [True: 3.09k, False: 1.41k]
  ------------------
  993|  3.09k|			eof_fatal = 1;
  994|  3.09k|		}
  995|  4.50k|	}
  996|   370k|}
archive_read_support_format_tar.c:tar_reset_header_state:
  705|   370k|{
  706|   370k|	tar->pax_hdrcharset_utf8 = 1;
  707|   370k|	tar->sparse_gnu_attributes_seen = 0;
  708|   370k|	archive_string_empty(&(tar->entry_gname));
  ------------------
  |  |  181|   370k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  709|   370k|	archive_string_empty(&(tar->entry_pathname));
  ------------------
  |  |  181|   370k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  710|   370k|	archive_string_empty(&(tar->entry_pathname_override));
  ------------------
  |  |  181|   370k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  711|   370k|	archive_string_empty(&(tar->entry_uname));
  ------------------
  |  |  181|   370k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  712|   370k|	archive_string_empty(&tar->entry_linkpath);
  ------------------
  |  |  181|   370k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
  713|   370k|}
archive_read_support_format_tar.c:header_Solaris_ACL:
 1078|    944|{
 1079|    944|	struct archive_string	 acl_text;
 1080|    944|	size_t size;
 1081|    944|	int err, acl_type;
 1082|    944|	uint64_t type;
 1083|    944|	char *acl, *p;
 1084|       |
 1085|    944|	archive_string_init(&acl_text);
  ------------------
  |  |   71|    944|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 944]
  |  |  ------------------
  ------------------
 1086|    944|	err = read_body_to_string(a, tar, &acl_text, h, unconsumed);
 1087|    944|	if (err != ARCHIVE_OK) {
  ------------------
  |  |  233|    944|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1087:6): [True: 26, False: 918]
  ------------------
 1088|     26|		archive_string_free(&acl_text);
 1089|     26|		return (err);
 1090|     26|	}
 1091|    918|	size = archive_strlen(&acl_text);
  ------------------
  |  |  178|    918|#define	archive_strlen(a) ((a)->length)
  ------------------
 1092|       |
 1093|       |	/* TODO: Examine the first characters to see if this
 1094|       |	 * is an AIX ACL descriptor.  We'll likely never support
 1095|       |	 * them, but it would be polite to recognize and warn when
 1096|       |	 * we do see them. */
 1097|       |
 1098|       |	/* Leading octal number indicates ACL type and number of entries. */
 1099|    918|	p = acl = acl_text.s;
 1100|    918|	type = 0;
 1101|  6.03k|	while (*p != '\0' && p < acl + size) {
  ------------------
  |  Branch (1101:9): [True: 5.16k, False: 871]
  |  Branch (1101:23): [True: 5.16k, False: 0]
  ------------------
 1102|  5.16k|		if (*p < '0' || *p > '7') {
  ------------------
  |  Branch (1102:7): [True: 24, False: 5.14k]
  |  Branch (1102:19): [True: 13, False: 5.12k]
  ------------------
 1103|     37|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     37|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1104|     37|			    "Malformed Solaris ACL attribute (invalid digit)");
 1105|     37|			archive_string_free(&acl_text);
 1106|     37|			return(ARCHIVE_WARN);
  ------------------
  |  |  235|     37|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1107|     37|		}
 1108|  5.12k|		type <<= 3;
 1109|  5.12k|		type += *p - '0';
 1110|  5.12k|		if (type > 077777777) {
  ------------------
  |  Branch (1110:7): [True: 10, False: 5.11k]
  ------------------
 1111|     10|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     10|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1112|     10|			    "Malformed Solaris ACL attribute (count too large)");
 1113|     10|			archive_string_free(&acl_text);
 1114|     10|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|     10|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1115|     10|		}
 1116|  5.11k|		p++;
 1117|  5.11k|	}
 1118|    871|	switch (type & ~0777777) {
 1119|    291|	case 01000000:
  ------------------
  |  Branch (1119:2): [True: 291, False: 580]
  ------------------
 1120|       |		/* POSIX.1e ACL */
 1121|    291|		acl_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS;
  ------------------
  |  |  534|    291|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
 1122|    291|		break;
 1123|    298|	case 03000000:
  ------------------
  |  Branch (1123:2): [True: 298, False: 573]
  ------------------
 1124|       |		/* NFSv4 ACL */
 1125|    298|		acl_type = ARCHIVE_ENTRY_ACL_TYPE_NFS4;
  ------------------
  |  |  542|    298|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|    298|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|    298|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|    298|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|    298|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|    298|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|    298|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|    298|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
 1126|    298|		break;
 1127|    282|	default:
  ------------------
  |  Branch (1127:2): [True: 282, False: 589]
  ------------------
 1128|    282|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    282|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1129|    282|		    "Malformed Solaris ACL attribute (unsupported type %llu)",
 1130|    282|		    (unsigned long long)type);
 1131|    282|		archive_string_free(&acl_text);
 1132|    282|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|    282|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1133|    871|	}
 1134|    589|	p++;
 1135|       |
 1136|    589|	if (p >= acl + size) {
  ------------------
  |  Branch (1136:6): [True: 6, False: 583]
  ------------------
 1137|      6|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      6|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1138|      6|		    "Malformed Solaris ACL attribute (body overflow)");
 1139|      6|		archive_string_free(&acl_text);
 1140|      6|		return(ARCHIVE_WARN);
  ------------------
  |  |  235|      6|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1141|      6|	}
 1142|       |
 1143|       |	/* ACL text is null-terminated; find the end. */
 1144|    583|	size -= (p - acl);
 1145|    583|	acl = p;
 1146|       |
 1147|   365k|	while (*p != '\0' && p < acl + size)
  ------------------
  |  Branch (1147:9): [True: 365k, False: 583]
  |  Branch (1147:23): [True: 365k, False: 0]
  ------------------
 1148|   365k|		p++;
 1149|       |
 1150|    583|	if (tar->sconv_acl == NULL) {
  ------------------
  |  Branch (1150:6): [True: 456, False: 127]
  ------------------
 1151|    456|		tar->sconv_acl = archive_string_conversion_from_charset(
 1152|    456|		    &(a->archive), "UTF-8", 1);
 1153|    456|		if (tar->sconv_acl == NULL) {
  ------------------
  |  Branch (1153:7): [True: 0, False: 456]
  ------------------
 1154|      0|			archive_string_free(&acl_text);
 1155|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1156|      0|		}
 1157|    456|	}
 1158|    583|	archive_strncpy(&(tar->localname), acl, p - acl);
  ------------------
  |  |  173|    583|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1159|    583|	err = archive_acl_from_text_l(archive_entry_acl(entry),
 1160|    583|	    tar->localname.s, acl_type, tar->sconv_acl);
 1161|       |	/* Workaround: Force perm_is_set() to be correct */
 1162|       |	/* If this bit were stored in the ACL, this wouldn't be needed */
 1163|    583|	archive_entry_set_perm(entry, archive_entry_perm(entry));
 1164|    583|	if (err != ARCHIVE_OK) {
  ------------------
  |  |  233|    583|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1164:6): [True: 576, False: 7]
  ------------------
 1165|    576|		if (errno == ENOMEM) {
  ------------------
  |  Branch (1165:7): [True: 0, False: 576]
  ------------------
 1166|      0|			archive_set_error(&a->archive, ENOMEM,
 1167|      0|			    "Can't allocate memory for ACL");
 1168|      0|		} else
 1169|    576|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    576|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1170|    576|			    "Malformed Solaris ACL attribute (unparsable)");
 1171|    576|	}
 1172|    583|	archive_string_free(&acl_text);
 1173|    583|	return (err);
 1174|    583|}
archive_read_support_format_tar.c:read_body_to_string:
 1298|  2.33k|{
 1299|  2.33k|	int64_t size;
 1300|  2.33k|	const struct archive_entry_header_ustar *header;
 1301|  2.33k|	int r;
 1302|       |
 1303|  2.33k|	(void)tar; /* UNUSED */
 1304|  2.33k|	header = (const struct archive_entry_header_ustar *)h;
 1305|  2.33k|	size  = tar_atol(header->size, sizeof(header->size));
 1306|  2.33k|	if (size < 0 || size > entry_limit) {
  ------------------
  |  Branch (1306:6): [True: 3, False: 2.33k]
  |  Branch (1306:18): [True: 0, False: 2.33k]
  ------------------
 1307|      3|		archive_set_error(&a->archive, EINVAL,
 1308|      3|		    "Special header has invalid size: %lld",
 1309|      3|		    (long long)size);
 1310|      3|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1311|      3|	}
 1312|  2.33k|	if (size > (int64_t)pathname_limit) {
  ------------------
  |  Branch (1312:6): [True: 24, False: 2.31k]
  ------------------
 1313|     24|		archive_string_empty(as);
  ------------------
  |  |  181|     24|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1314|     24|		int64_t to_consume = ((size + 511) & ~511);
 1315|     24|		if (to_consume != __archive_read_consume(a, to_consume)) {
  ------------------
  |  Branch (1315:7): [True: 21, False: 3]
  ------------------
 1316|     21|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     21|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1317|     21|		}
 1318|      3|		archive_set_error(&a->archive, EINVAL,
 1319|      3|		    "Special header too large: %lld > 1MiB",
 1320|      3|		    (long long)size);
 1321|      3|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1322|     24|	}
 1323|  2.31k|	r = read_bytes_to_string(a, as, size, unconsumed);
 1324|  2.31k|	*unconsumed += 0x1ff & (-size);
 1325|  2.31k|	return(r);
 1326|  2.33k|}
archive_read_support_format_tar.c:read_bytes_to_string:
 1262|  3.80k|		     int64_t *unconsumed) {
 1263|  3.80k|	const void *src;
 1264|       |
 1265|       |	/* Fail if we can't make our buffer big enough. */
 1266|  3.80k|	if (archive_string_ensure(as, size + 1) == NULL) {
  ------------------
  |  Branch (1266:6): [True: 0, False: 3.80k]
  ------------------
 1267|      0|		archive_set_error(&a->archive, ENOMEM,
 1268|      0|		    "No memory");
 1269|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1270|      0|	}
 1271|       |
 1272|  3.80k|	if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|  3.80k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1272:6): [True: 0, False: 3.80k]
  ------------------
 1273|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1274|      0|	}
 1275|       |
 1276|       |	/* Read the body into the string. */
 1277|  3.80k|	src = __archive_read_ahead(a, size, NULL);
 1278|  3.80k|	if (src == NULL) {
  ------------------
  |  Branch (1278:6): [True: 5, False: 3.80k]
  ------------------
 1279|      5|		archive_set_error(&a->archive, EINVAL,
 1280|      5|		    "Truncated archive"
 1281|      5|		    " detected while reading metadata");
 1282|      5|		*unconsumed = 0;
 1283|      5|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1284|      5|	}
 1285|  3.80k|	memcpy(as->s, src, size);
 1286|  3.80k|	as->s[size] = '\0';
 1287|  3.80k|	as->length = size;
 1288|  3.80k|	*unconsumed += size;
 1289|  3.80k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.80k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1290|  3.80k|}
archive_read_support_format_tar.c:header_pax_global:
 1834|  1.28k|{
 1835|  1.28k|	return (header_pax_records(a, tar, entry, h, unconsumed, 1));
 1836|  1.28k|}
archive_read_support_format_tar.c:header_pax_records:
 1956|  2.15k|{
 1957|       |	/* Sanity checks: The largest `x` body I've ever heard of was
 1958|       |	 * a little over 4MB.  So I doubt there has ever been a
 1959|       |	 * well-formed archive with an `x` body over 1GiB.  Similarly,
 1960|       |	 * it seems plausible that no single attribute has ever been
 1961|       |	 * larger than 100MB.  So if we see a larger value here, it's
 1962|       |	 * almost certainly a sign of a corrupted/malicious archive. */
 1963|       |
 1964|       |	/* Maximum sane size for extension body: 1 GiB */
 1965|       |	/* This cannot be raised to larger than 8GiB without
 1966|       |	 * exceeding the maximum size for a standard ustar
 1967|       |	 * entry. */
 1968|  2.15k|	const int64_t ext_size_limit = 1024 * 1024 * (int64_t)1024;
 1969|       |	/* Maximum size for a single line/attr: 100 million characters */
 1970|       |	/* This cannot be raised to more than 2GiB without exceeding
 1971|       |	 * a `size_t` on 32-bit platforms. */
 1972|  2.15k|	const size_t max_parsed_line_length = 99999999ULL;
 1973|       |	/* Largest attribute prolog:  size + name. */
 1974|  2.15k|	const size_t max_size_name = 512;
 1975|       |
 1976|       |	/* Size and padding of the full extension body */
 1977|  2.15k|	int64_t ext_size, ext_padding;
 1978|  2.15k|	size_t line_length, value_length, name_length;
 1979|  2.15k|	ssize_t to_read, did_read;
 1980|  2.15k|	const struct archive_entry_header_ustar *header;
 1981|  2.15k|	const char *p, *attr_start, *name_start;
 1982|  2.15k|	struct archive_string_conv *sconv;
 1983|  2.15k|	struct archive_string *pas = NULL;
 1984|  2.15k|	struct archive_string attr_name;
 1985|  2.15k|	int err = ARCHIVE_OK, r;
  ------------------
  |  |  233|  2.15k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1986|       |
 1987|  2.15k|	header = (const struct archive_entry_header_ustar *)h;
 1988|  2.15k|	ext_size  = tar_atol(header->size, sizeof(header->size));
 1989|  2.15k|	if (ext_size > entry_limit) {
  ------------------
  |  Branch (1989:6): [True: 0, False: 2.15k]
  ------------------
 1990|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1991|      0|	}
 1992|  2.15k|	if (ext_size < 0) {
  ------------------
  |  Branch (1992:6): [True: 3, False: 2.15k]
  ------------------
 1993|      3|	  archive_set_error(&a->archive, EINVAL,
 1994|      3|			    "pax extension header has invalid size: %lld",
 1995|      3|			    (long long)ext_size);
 1996|      3|	  return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1997|      3|	}
 1998|  2.15k|	if (ext_size == 0) {
  ------------------
  |  Branch (1998:6): [True: 5, False: 2.14k]
  ------------------
 1999|      5|		archive_set_error(&a->archive, EINVAL,
 2000|      5|		    global ? "Invalid empty pax global extended header"
  ------------------
  |  Branch (2000:7): [True: 3, False: 2]
  ------------------
 2001|      5|			   : "Invalid empty pax extended header");
 2002|      5|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2003|      5|	}
 2004|       |
 2005|  2.14k|	ext_padding = 0x1ff & (-ext_size);
 2006|  2.14k|	if (ext_size > ext_size_limit) {
  ------------------
  |  Branch (2006:6): [True: 17, False: 2.12k]
  ------------------
 2007|       |		/* Consume the pax extension body and return an error */
 2008|     17|		if (ext_size + ext_padding != __archive_read_consume(a, ext_size + ext_padding)) {
  ------------------
  |  Branch (2008:7): [True: 17, False: 0]
  ------------------
 2009|     17|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     17|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2010|     17|		}
 2011|      0|		archive_set_error(&a->archive, EINVAL,
 2012|      0|		    "Ignoring oversized pax extensions: %lld > %lld",
 2013|      0|		    (long long)ext_size, (long long)ext_size_limit);
 2014|      0|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2015|     17|	}
 2016|  2.12k|	if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|  2.12k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2016:6): [True: 0, False: 2.12k]
  ------------------
 2017|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2018|      0|	}
 2019|       |
 2020|       |	/* Parse the size/name of each pax attribute in the body */
 2021|  2.12k|	archive_string_init(&attr_name);
  ------------------
  |  |   71|  2.12k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 2.12k]
  |  |  ------------------
  ------------------
 2022|  6.29k|	while (ext_size > 0) {
  ------------------
  |  Branch (2022:9): [True: 6.28k, False: 15]
  ------------------
 2023|       |		/* Read enough bytes to parse the size/name of the next attribute */
 2024|  6.28k|		to_read = max_size_name;
 2025|  6.28k|		if (to_read > ext_size) {
  ------------------
  |  Branch (2025:7): [True: 3.75k, False: 2.53k]
  ------------------
 2026|  3.75k|			to_read = ext_size;
 2027|  3.75k|		}
 2028|  6.28k|		p = __archive_read_ahead(a, to_read, &did_read);
 2029|  6.28k|		if (p == NULL) { /* EOF */
  ------------------
  |  Branch (2029:7): [True: 47, False: 6.23k]
  ------------------
 2030|     47|			archive_set_error(&a->archive, EINVAL,
 2031|     47|					  "Truncated tar archive"
 2032|     47|					  " detected while reading pax attribute name");
 2033|     47|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     47|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2034|     47|		}
 2035|  6.23k|		if (did_read > ext_size) {
  ------------------
  |  Branch (2035:7): [True: 3.64k, False: 2.59k]
  ------------------
 2036|  3.64k|			did_read = ext_size;
 2037|  3.64k|		}
 2038|       |
 2039|       |		/* Parse size of attribute */
 2040|  6.23k|		line_length = 0;
 2041|  6.23k|		attr_start = p;
 2042|  17.4k|		while (1) {
  ------------------
  |  Branch (2042:10): [True: 17.4k, Folded]
  ------------------
 2043|  17.4k|			if (p >= attr_start + did_read) {
  ------------------
  |  Branch (2043:8): [True: 224, False: 17.1k]
  ------------------
 2044|    224|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    224|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2045|    224|						  "Ignoring malformed pax attributes: overlarge attribute size field");
 2046|    224|				*unconsumed += ext_size + ext_padding;
 2047|    224|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|    224|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2048|    224|			}
 2049|  17.1k|			if (*p == ' ') {
  ------------------
  |  Branch (2049:8): [True: 5.73k, False: 11.4k]
  ------------------
 2050|  5.73k|				p++;
 2051|  5.73k|				break;
 2052|  5.73k|			}
 2053|  11.4k|			if (*p < '0' || *p > '9') {
  ------------------
  |  Branch (2053:8): [True: 238, False: 11.2k]
  |  Branch (2053:20): [True: 19, False: 11.1k]
  ------------------
 2054|    257|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    257|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2055|    257|						  "Ignoring malformed pax attributes: malformed attribute size field");
 2056|    257|				*unconsumed += ext_size + ext_padding;
 2057|    257|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|    257|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2058|    257|			}
 2059|  11.1k|			line_length *= 10;
 2060|  11.1k|			line_length += *p - '0';
 2061|  11.1k|			if (line_length > max_parsed_line_length) {
  ------------------
  |  Branch (2061:8): [True: 18, False: 11.1k]
  ------------------
 2062|     18|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     18|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2063|     18|						  "Ignoring malformed pax attribute: size > %lld",
 2064|     18|						  (long long)max_parsed_line_length);
 2065|     18|				*unconsumed += ext_size + ext_padding;
 2066|     18|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|     18|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2067|     18|			}
 2068|  11.1k|			p++;
 2069|  11.1k|		}
 2070|       |
 2071|  5.73k|		if ((int64_t)line_length > ext_size) {
  ------------------
  |  Branch (2071:7): [True: 297, False: 5.44k]
  ------------------
 2072|    297|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    297|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2073|    297|						  "Ignoring malformed pax attribute:  %lld > %lld",
 2074|    297|						  (long long)line_length, (long long)ext_size);
 2075|    297|				*unconsumed += ext_size + ext_padding;
 2076|    297|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|    297|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2077|    297|		}
 2078|       |
 2079|       |		/* Parse name of attribute */
 2080|  5.44k|		if (p >= attr_start + did_read
  ------------------
  |  Branch (2080:7): [True: 438, False: 5.00k]
  ------------------
 2081|  5.00k|		    || p >= attr_start + line_length
  ------------------
  |  Branch (2081:10): [True: 279, False: 4.72k]
  ------------------
 2082|  4.72k|		    || *p == '=') {
  ------------------
  |  Branch (2082:10): [True: 1, False: 4.72k]
  ------------------
 2083|    718|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    718|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2084|    718|					  "Ignoring malformed pax attributes: empty name found");
 2085|    718|			*unconsumed += ext_size + ext_padding;
 2086|    718|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|    718|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2087|    718|		}
 2088|  4.72k|		name_start = p;
 2089|  94.1k|		while (1) {
  ------------------
  |  Branch (2089:10): [True: 94.1k, Folded]
  ------------------
 2090|  94.1k|			if (p >= attr_start + did_read || p >= attr_start + line_length) {
  ------------------
  |  Branch (2090:8): [True: 11, False: 94.1k]
  |  Branch (2090:38): [True: 35, False: 94.1k]
  ------------------
 2091|     46|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     46|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2092|     46|						  "Ignoring malformed pax attributes: overlarge attribute name");
 2093|     46|				*unconsumed += ext_size + ext_padding;
 2094|     46|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|     46|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2095|     46|			}
 2096|  94.1k|			if (*p == '=') {
  ------------------
  |  Branch (2096:8): [True: 4.67k, False: 89.4k]
  ------------------
 2097|  4.67k|				break;
 2098|  4.67k|			}
 2099|  89.4k|			p++;
 2100|  89.4k|		}
 2101|  4.67k|		name_length = p - name_start;
 2102|  4.67k|		p++; // Skip '='
 2103|       |
 2104|       |		// Save the name before we consume it
 2105|  4.67k|		archive_strncpy(&attr_name, name_start, name_length);
  ------------------
  |  |  173|  4.67k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 2106|       |
 2107|  4.67k|		ext_size -= p - attr_start;
 2108|  4.67k|		value_length = line_length - (p - attr_start);
 2109|       |
 2110|       |		/* Consume size, name, and `=` */
 2111|  4.67k|		*unconsumed += p - attr_start;
 2112|  4.67k|		if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|  4.67k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2112:7): [True: 0, False: 4.67k]
  ------------------
 2113|      0|			archive_string_free(&attr_name);
 2114|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2115|      0|		}
 2116|       |
 2117|  4.67k|		if (value_length == 0) {
  ------------------
  |  Branch (2117:7): [True: 4, False: 4.67k]
  ------------------
 2118|      4|			archive_set_error(&a->archive, EINVAL,
 2119|      4|					  "Malformed pax attributes");
 2120|      4|			*unconsumed += ext_size + ext_padding;
 2121|      4|			archive_string_free(&attr_name);
 2122|      4|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      4|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2123|      4|		}
 2124|       |
 2125|  4.67k|		if (global) {
  ------------------
  |  Branch (2125:7): [True: 22, False: 4.65k]
  ------------------
 2126|     22|			if (pax_global_attribute_unsupported(attr_name.s,
  ------------------
  |  Branch (2126:8): [True: 7, False: 15]
  ------------------
 2127|     22|				archive_strlen(&attr_name))) {
  ------------------
  |  |  178|     22|#define	archive_strlen(a) ((a)->length)
  ------------------
 2128|      7|				archive_set_error(&a->archive,
 2129|      7|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      7|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2130|      7|				    "Unsupported pax global extended header attribute '%s'",
 2131|      7|				    attr_name.s);
 2132|      7|				archive_string_free(&attr_name);
 2133|      7|				*unconsumed += ext_size + ext_padding;
 2134|      7|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2135|      7|			}
 2136|       |			/* Not an attribute we would have acted on, so
 2137|       |			 * ignoring it here changes nothing. */
 2138|     15|			__archive_read_consume(a, value_length - 1);
 2139|     15|			r = ARCHIVE_OK;
  ------------------
  |  |  233|     15|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2140|  4.65k|		} else {
 2141|       |			/* pax_attribute will consume value_length - 1 */
 2142|  4.65k|			r = pax_attribute(a, tar, entry, attr_name.s, archive_strlen(&attr_name), value_length - 1, unconsumed);
  ------------------
  |  |  178|  4.65k|#define	archive_strlen(a) ((a)->length)
  ------------------
 2143|  4.65k|		}
 2144|  4.66k|		ext_size -= value_length - 1;
 2145|       |
 2146|       |		// Release the allocated attr_name (either here or before every return in this function)
 2147|  4.66k|		archive_string_free(&attr_name);
 2148|       |
 2149|  4.66k|		if (r < ARCHIVE_WARN) {
  ------------------
  |  |  235|  4.66k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  |  Branch (2149:7): [True: 23, False: 4.64k]
  ------------------
 2150|     23|			*unconsumed += ext_size + ext_padding;
 2151|     23|			return (r);
 2152|     23|		}
 2153|  4.64k|		err = err_combine(err, r);
  ------------------
  |  |  201|  4.64k|#define	err_combine(a,b)	((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (201:27): [True: 1.25k, False: 3.38k]
  |  |  ------------------
  ------------------
 2154|       |
 2155|       |		/* Consume the `\n` that follows the pax attribute value. */
 2156|  4.64k|		if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|  4.64k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2156:7): [True: 0, False: 4.64k]
  ------------------
 2157|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2158|      0|		}
 2159|  4.64k|		p = __archive_read_ahead(a, 1, &did_read);
 2160|  4.64k|		if (p == NULL) {
  ------------------
  |  Branch (2160:7): [True: 13, False: 4.62k]
  ------------------
 2161|     13|			archive_set_error(&a->archive, EINVAL,
 2162|     13|					  "Truncated tar archive"
 2163|     13|					  " detected while completing pax attribute");
 2164|     13|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     13|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2165|     13|		}
 2166|  4.62k|		if (p[0] != '\n') {
  ------------------
  |  Branch (2166:7): [True: 459, False: 4.17k]
  ------------------
 2167|    459|			archive_set_error(&a->archive, EINVAL,
 2168|    459|					  "Malformed pax attributes");
 2169|    459|			*unconsumed += ext_size + ext_padding;
 2170|    459|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|    459|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2171|    459|		}
 2172|  4.17k|		ext_size -= 1;
 2173|  4.17k|		*unconsumed += 1;
 2174|  4.17k|		if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|  4.17k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2174:7): [True: 0, False: 4.17k]
  ------------------
 2175|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2176|      0|		}
 2177|  4.17k|	}
 2178|     15|	*unconsumed += ext_size + ext_padding;
 2179|       |
 2180|       |	/*
 2181|       |	 * Some PAX values -- pathname, linkpath, uname, gname --
 2182|       |	 * can't be copied into the entry until we know the character
 2183|       |	 * set to use:
 2184|       |	 */
 2185|     15|	if (!tar->pax_hdrcharset_utf8)
  ------------------
  |  Branch (2185:6): [True: 0, False: 15]
  ------------------
 2186|       |		/* PAX specified "BINARY", so use the default charset */
 2187|      0|		sconv = tar->opt_sconv;
 2188|     15|	else {
 2189|       |		/* PAX default UTF-8 */
 2190|     15|		sconv = archive_string_conversion_from_charset(
 2191|     15|		    &(a->archive), "UTF-8", 1);
 2192|     15|		if (sconv == NULL)
  ------------------
  |  Branch (2192:7): [True: 0, False: 15]
  ------------------
 2193|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2194|     15|		if (tar->compat_2x)
  ------------------
  |  Branch (2194:7): [True: 0, False: 15]
  ------------------
 2195|      0|			archive_string_conversion_set_opt(sconv,
 2196|      0|			    SCONV_SET_OPT_UTF8_LIBARCHIVE2X);
  ------------------
  |  |  113|      0|#define SCONV_SET_OPT_UTF8_LIBARCHIVE2X	1
  ------------------
 2197|     15|	}
 2198|       |
 2199|       |	/* Pathname */
 2200|     15|	pas = NULL;
 2201|     15|	if (archive_strlen(&(tar->entry_pathname_override)) > 0) {
  ------------------
  |  |  178|     15|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (2201:6): [True: 1, False: 14]
  ------------------
 2202|       |		/* Prefer GNU.sparse.name attribute if present */
 2203|       |		/* GNU sparse files store a fake name under the standard
 2204|       |		 * "pathname" key. */
 2205|      1|		pas = &(tar->entry_pathname_override);
 2206|     14|	} else if (archive_strlen(&(tar->entry_pathname)) > 0) {
  ------------------
  |  |  178|     14|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (2206:13): [True: 3, False: 11]
  ------------------
 2207|       |		/* Use standard "pathname" PAX extension */
 2208|      3|		pas = &(tar->entry_pathname);
 2209|      3|	}
 2210|     15|	if (pas != NULL) {
  ------------------
  |  Branch (2210:6): [True: 4, False: 11]
  ------------------
 2211|      4|		if (archive_entry_copy_pathname_l(entry, pas->s,
  ------------------
  |  |   80|      4|#define archive_entry_copy_pathname_l	__archive_entry_copy_pathname_l
  ------------------
  |  Branch (2211:7): [True: 3, False: 1]
  ------------------
 2212|      4|		    archive_strlen(pas), sconv) != 0) {
  ------------------
  |  |  178|      4|#define	archive_strlen(a) ((a)->length)
  ------------------
 2213|      3|			err = set_conversion_failed_error(a, sconv, "Pathname");
 2214|      3|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2214:8): [True: 0, False: 3]
  ------------------
 2215|      0|				return (err);
 2216|       |			/* Use raw name without conversion */
 2217|      3|			archive_entry_copy_pathname(entry, pas->s);
 2218|      3|		}
 2219|      4|	}
 2220|       |	/* Uname */
 2221|     15|	if (archive_strlen(&(tar->entry_uname)) > 0) {
  ------------------
  |  |  178|     15|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (2221:6): [True: 2, False: 13]
  ------------------
 2222|      2|		if (archive_entry_copy_uname_l(entry, tar->entry_uname.s,
  ------------------
  |  |   86|      2|#define archive_entry_copy_uname_l	__archive_entry_copy_uname_l
  ------------------
  |  Branch (2222:7): [True: 1, False: 1]
  ------------------
 2223|      2|		    archive_strlen(&(tar->entry_uname)), sconv) != 0) {
  ------------------
  |  |  178|      2|#define	archive_strlen(a) ((a)->length)
  ------------------
 2224|      1|			err = set_conversion_failed_error(a, sconv, "Uname");
 2225|      1|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2225:8): [True: 0, False: 1]
  ------------------
 2226|      0|				return (err);
 2227|       |			/* Use raw name without conversion */
 2228|      1|			archive_entry_copy_uname(entry, tar->entry_uname.s);
 2229|      1|		}
 2230|      2|	}
 2231|       |	/* Gname */
 2232|     15|	if (archive_strlen(&(tar->entry_gname)) > 0) {
  ------------------
  |  |  178|     15|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (2232:6): [True: 3, False: 12]
  ------------------
 2233|      3|		if (archive_entry_copy_gname_l(entry, tar->entry_gname.s,
  ------------------
  |  |   71|      3|#define archive_entry_copy_gname_l	__archive_entry_copy_gname_l
  ------------------
  |  Branch (2233:7): [True: 2, False: 1]
  ------------------
 2234|      3|		    archive_strlen(&(tar->entry_gname)), sconv) != 0) {
  ------------------
  |  |  178|      3|#define	archive_strlen(a) ((a)->length)
  ------------------
 2235|      2|			err = set_conversion_failed_error(a, sconv, "Gname");
 2236|      2|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2236:8): [True: 0, False: 2]
  ------------------
 2237|      0|				return (err);
 2238|       |			/* Use raw name without conversion */
 2239|      2|			archive_entry_copy_gname(entry, tar->entry_gname.s);
 2240|      2|		}
 2241|      3|	}
 2242|       |	/* Linkpath */
 2243|     15|	if (archive_strlen(&(tar->entry_linkpath)) > 0) {
  ------------------
  |  |  178|     15|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (2243:6): [True: 5, False: 10]
  ------------------
 2244|      5|		if (archive_entry_copy_link_l(entry, tar->entry_linkpath.s,
  ------------------
  |  |   77|      5|#define archive_entry_copy_link_l	__archive_entry_copy_link_l
  ------------------
  |  Branch (2244:7): [True: 4, False: 1]
  ------------------
 2245|      5|		    archive_strlen(&(tar->entry_linkpath)), sconv) != 0) {
  ------------------
  |  |  178|      5|#define	archive_strlen(a) ((a)->length)
  ------------------
 2246|      4|			err = set_conversion_failed_error(a, sconv, "Linkpath");
 2247|      4|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2247:8): [True: 0, False: 4]
  ------------------
 2248|      0|				return (err);
 2249|       |			/* Use raw name without conversion */
 2250|      4|			archive_entry_copy_link(entry, tar->entry_linkpath.s);
 2251|      4|		}
 2252|      5|	}
 2253|       |
 2254|       |	/* Extension may have given us a corrected `entry_bytes_remaining` for
 2255|       |	 * the main entry; update the padding appropriately. */
 2256|     15|	tar->entry_padding = 0x1ff & (-tar->entry_bytes_remaining);
 2257|     15|	return (err);
 2258|     15|}
archive_read_support_format_tar.c:pax_global_attribute_unsupported:
 1809|     22|{
 1810|     22|	const struct pax_global_unsupported_attr *attr;
 1811|     22|	size_t i;
 1812|       |
 1813|    602|	for (i = 0; i < sizeof(pax_global_unsupported_attrs)
  ------------------
  |  Branch (1813:14): [True: 587, False: 15]
  ------------------
 1814|    602|	    / sizeof(pax_global_unsupported_attrs[0]); i++) {
 1815|    587|		attr = &pax_global_unsupported_attrs[i];
 1816|    587|		if (attr->is_prefix) {
  ------------------
  |  Branch (1816:7): [True: 60, False: 527]
  ------------------
 1817|     60|			if (key_length > attr->length
  ------------------
  |  Branch (1817:8): [True: 42, False: 18]
  ------------------
 1818|     42|			    && memcmp(key, attr->key, attr->length) == 0)
  ------------------
  |  Branch (1818:11): [True: 5, False: 37]
  ------------------
 1819|      5|				return (1);
 1820|    527|		} else if (key_length == attr->length
  ------------------
  |  Branch (1820:14): [True: 24, False: 503]
  ------------------
 1821|     24|		    && memcmp(key, attr->key, attr->length) == 0) {
  ------------------
  |  Branch (1821:10): [True: 2, False: 22]
  ------------------
 1822|      2|			return (1);
 1823|      2|		}
 1824|    587|	}
 1825|     15|	return (0);
 1826|     22|}
archive_read_support_format_tar.c:pax_attribute:
 2471|  4.65k|{
 2472|  4.65k|	int64_t t;
 2473|  4.65k|	long n;
 2474|  4.65k|	const char *p;
 2475|  4.65k|	int err = ARCHIVE_OK;
  ------------------
  |  |  233|  4.65k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2476|       |
 2477|  4.65k|	switch (key[0]) {
  ------------------
  |  Branch (2477:10): [True: 4.34k, False: 309]
  ------------------
 2478|    629|	case 'G':
  ------------------
  |  Branch (2478:2): [True: 629, False: 4.02k]
  ------------------
 2479|       |		/* GNU.* extensions */
 2480|    629|		if (key_length > 4 && memcmp(key, "GNU.", 4) == 0) {
  ------------------
  |  Branch (2480:7): [True: 617, False: 12]
  |  Branch (2480:25): [True: 554, False: 63]
  ------------------
 2481|    554|			key += 4;
 2482|    554|			key_length -= 4;
 2483|       |
 2484|       |			/* GNU.sparse marks the existence of GNU sparse information */
 2485|    554|			if (key_length == 6 && memcmp(key, "sparse", 6) == 0) {
  ------------------
  |  Branch (2485:8): [True: 24, False: 530]
  |  Branch (2485:27): [True: 11, False: 13]
  ------------------
 2486|     11|				tar->sparse_gnu_attributes_seen = 1;
 2487|     11|			}
 2488|       |
 2489|       |			/* GNU.sparse.* extensions */
 2490|    543|			else if (key_length > 7 && memcmp(key, "sparse.", 7) == 0) {
  ------------------
  |  Branch (2490:13): [True: 490, False: 53]
  |  Branch (2490:31): [True: 390, False: 100]
  ------------------
 2491|    390|				tar->sparse_gnu_attributes_seen = 1;
 2492|    390|				key += 7;
 2493|    390|				key_length -= 7;
 2494|       |
 2495|       |				/* GNU "0.0" sparse pax format. */
 2496|    390|				if (key_length == 9 && memcmp(key, "numblocks", 9) == 0) {
  ------------------
  |  Branch (2496:9): [True: 24, False: 366]
  |  Branch (2496:28): [True: 8, False: 16]
  ------------------
 2497|       |					/* GNU.sparse.numblocks */
 2498|      8|					tar->sparse_offset = -1;
 2499|      8|					tar->sparse_numbytes = -1;
 2500|      8|					tar->sparse_gnu_major = 0;
 2501|      8|					tar->sparse_gnu_minor = 0;
 2502|      8|				}
 2503|    382|				else if (key_length == 6 && memcmp(key, "offset", 6) == 0) {
  ------------------
  |  Branch (2503:14): [True: 73, False: 309]
  |  Branch (2503:33): [True: 60, False: 13]
  ------------------
 2504|       |					/* GNU.sparse.offset */
 2505|     60|					if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|     60|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2505:10): [True: 42, False: 18]
  ------------------
 2506|     42|						tar->sparse_offset = t;
 2507|     42|						if (tar->sparse_numbytes != -1) {
  ------------------
  |  Branch (2507:11): [True: 17, False: 25]
  ------------------
 2508|     17|							if (gnu_add_sparse_entry(a, tar,
  ------------------
  |  Branch (2508:12): [True: 0, False: 17]
  ------------------
 2509|     17|									 tar->sparse_offset, tar->sparse_numbytes)
 2510|     17|							    != ARCHIVE_OK)
  ------------------
  |  |  233|     17|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2511|      0|								return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2512|     17|							tar->sparse_offset = -1;
 2513|     17|							tar->sparse_numbytes = -1;
 2514|     17|						}
 2515|     42|					}
 2516|     60|					return (err);
 2517|     60|				}
 2518|    322|				else if (key_length == 8 && memcmp(key, "numbytes", 8) == 0) {
  ------------------
  |  Branch (2518:14): [True: 38, False: 284]
  |  Branch (2518:33): [True: 22, False: 16]
  ------------------
 2519|       |					/* GNU.sparse.numbytes */
 2520|     22|					if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|     22|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2520:10): [True: 21, False: 1]
  ------------------
 2521|     21|						tar->sparse_numbytes = t;
 2522|     21|						if (tar->sparse_offset != -1) {
  ------------------
  |  Branch (2522:11): [True: 10, False: 11]
  ------------------
 2523|     10|							if (gnu_add_sparse_entry(a, tar,
  ------------------
  |  Branch (2523:12): [True: 0, False: 10]
  ------------------
 2524|     10|									 tar->sparse_offset, tar->sparse_numbytes)
 2525|     10|							    != ARCHIVE_OK)
  ------------------
  |  |  233|     10|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2526|      0|								return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2527|     10|							tar->sparse_offset = -1;
 2528|     10|							tar->sparse_numbytes = -1;
 2529|     10|						}
 2530|     21|					}
 2531|     22|					return (err);
 2532|     22|				}
 2533|    300|				else if (key_length == 4 && memcmp(key, "size", 4) == 0) {
  ------------------
  |  Branch (2533:14): [True: 49, False: 251]
  |  Branch (2533:33): [True: 22, False: 27]
  ------------------
 2534|       |					/* GNU.sparse.size */
 2535|       |					/* This is either the size of stored entry OR the size of data on disk,
 2536|       |					 * depending on which GNU sparse format version is in use.
 2537|       |					 * Since pax attributes can be in any order, we may not actually
 2538|       |					 * know at this point how to interpret this. */
 2539|     22|					if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|     22|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2539:10): [True: 14, False: 8]
  ------------------
 2540|     14|						tar->GNU_sparse_size = t;
 2541|     14|						tar->size_fields |= TAR_SIZE_GNU_SPARSE_SIZE;
  ------------------
  |  |  164|     14|#define TAR_SIZE_GNU_SPARSE_SIZE 4
  ------------------
 2542|     14|					}
 2543|     22|					return (err);
 2544|     22|				}
 2545|       |
 2546|       |				/* GNU "0.1" sparse pax format. */
 2547|    278|				else if (key_length == 3 && memcmp(key, "map", 3) == 0) {
  ------------------
  |  Branch (2547:14): [True: 68, False: 210]
  |  Branch (2547:33): [True: 40, False: 28]
  ------------------
 2548|       |					/* GNU.sparse.map */
 2549|     40|					tar->sparse_gnu_major = 0;
 2550|     40|					tar->sparse_gnu_minor = 1;
 2551|     40|					if (value_length > sparse_map_limit) {
  ------------------
  |  Branch (2551:10): [True: 1, False: 39]
  ------------------
 2552|      1|						archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2553|      1|								  "Unreasonably large sparse map: %llu > %llu",
 2554|      1|								  (unsigned long long)value_length,
 2555|      1|								  (unsigned long long)sparse_map_limit);
 2556|      1|						err = ARCHIVE_FAILED;
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2557|     39|					} else {
 2558|     39|						p = __archive_read_ahead(a, value_length, NULL);
 2559|     39|						if (p == NULL) {
  ------------------
  |  Branch (2559:11): [True: 1, False: 38]
  ------------------
 2560|      1|							archive_set_error(&a->archive, EINVAL,
 2561|      1|									  "Truncated archive"
 2562|      1|									  " detected while reading GNU sparse data");
 2563|      1|							return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2564|      1|						}
 2565|     38|						if (gnu_sparse_01_parse(a, tar, p, value_length) != ARCHIVE_OK) {
  ------------------
  |  |  233|     38|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2565:11): [True: 24, False: 14]
  ------------------
 2566|     24|							err = ARCHIVE_WARN;
  ------------------
  |  |  235|     24|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2567|     24|						}
 2568|     38|					}
 2569|     39|					__archive_read_consume(a, value_length);
 2570|     39|					return (err);
 2571|     40|				}
 2572|       |
 2573|       |				/* GNU "1.0" sparse pax format */
 2574|    238|				else if (key_length == 5 && memcmp(key, "major", 5) == 0) {
  ------------------
  |  Branch (2574:14): [True: 137, False: 101]
  |  Branch (2574:33): [True: 88, False: 49]
  ------------------
 2575|       |					/* GNU.sparse.major */
 2576|     88|					if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK
  ------------------
  |  |  233|    176|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2576:10): [True: 78, False: 10]
  ------------------
 2577|     78|					    && t >= 0
  ------------------
  |  Branch (2577:13): [True: 78, False: 0]
  ------------------
 2578|     78|					    && t <= 10) {
  ------------------
  |  Branch (2578:13): [True: 62, False: 16]
  ------------------
 2579|     62|						tar->sparse_gnu_major = (int)t;
 2580|     62|					}
 2581|     88|					return (err);
 2582|     88|				}
 2583|    150|				else if (key_length == 5 && memcmp(key, "minor", 5) == 0) {
  ------------------
  |  Branch (2583:14): [True: 49, False: 101]
  |  Branch (2583:33): [True: 32, False: 17]
  ------------------
 2584|       |					/* GNU.sparse.minor */
 2585|     32|					if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK
  ------------------
  |  |  233|     64|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2585:10): [True: 31, False: 1]
  ------------------
 2586|     31|					    && t >= 0
  ------------------
  |  Branch (2586:13): [True: 31, False: 0]
  ------------------
 2587|     31|					    && t <= 10) {
  ------------------
  |  Branch (2587:13): [True: 16, False: 15]
  ------------------
 2588|     16|						tar->sparse_gnu_minor = (int)t;
 2589|     16|					}
 2590|     32|					return (err);
 2591|     32|				}
 2592|    118|				else if (key_length == 4 && memcmp(key, "name", 4) == 0) {
  ------------------
  |  Branch (2592:14): [True: 27, False: 91]
  |  Branch (2592:33): [True: 13, False: 14]
  ------------------
 2593|       |					/* GNU.sparse.name */
 2594|       |					/*
 2595|       |					 * The real filename; when storing sparse
 2596|       |					 * files, GNU tar puts a synthesized name into
 2597|       |					 * the regular 'path' attribute in an attempt
 2598|       |					 * to limit confusion. ;-)
 2599|       |					 */
 2600|     13|					if (value_length > pathname_limit) {
  ------------------
  |  Branch (2600:10): [True: 0, False: 13]
  ------------------
 2601|      0|						*unconsumed += value_length;
 2602|      0|						err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2603|     13|					} else {
 2604|     13|						err = read_bytes_to_string(a, &(tar->entry_pathname_override),
 2605|     13|									   value_length, unconsumed);
 2606|     13|					}
 2607|     13|					return (err);
 2608|     13|				}
 2609|    105|				else if (key_length == 8 && memcmp(key, "realsize", 8) == 0) {
  ------------------
  |  Branch (2609:14): [True: 16, False: 89]
  |  Branch (2609:33): [True: 4, False: 12]
  ------------------
 2610|       |					/* GNU.sparse.realsize = size of file on disk */
 2611|      4|					if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      4|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2611:10): [True: 3, False: 1]
  ------------------
 2612|      3|						tar->GNU_sparse_realsize = t;
 2613|      3|						tar->size_fields |= TAR_SIZE_GNU_SPARSE_REALSIZE;
  ------------------
  |  |  163|      3|#define TAR_SIZE_GNU_SPARSE_REALSIZE 2
  ------------------
 2614|      3|					}
 2615|      4|					return (err);
 2616|      4|				}
 2617|    390|			}
 2618|    554|		}
 2619|    348|		break;
 2620|    348|	case 'L':
  ------------------
  |  Branch (2620:2): [True: 147, False: 4.50k]
  ------------------
 2621|       |		/* LIBARCHIVE extensions */
 2622|    147|		if (key_length > 11 && memcmp(key, "LIBARCHIVE.", 11) == 0) {
  ------------------
  |  Branch (2622:7): [True: 136, False: 11]
  |  Branch (2622:26): [True: 123, False: 13]
  ------------------
 2623|    123|			key_length -= 11;
 2624|    123|			key += 11;
 2625|       |
 2626|       |			/* TODO: Handle arbitrary extended attributes... */
 2627|       |			/*
 2628|       |			  if (strcmp(key, "LIBARCHIVE.xxxxxxx") == 0)
 2629|       |				  archive_entry_set_xxxxxx(entry, value);
 2630|       |			*/
 2631|    123|			if (key_length == 12 && memcmp(key, "creationtime", 12) == 0) {
  ------------------
  |  Branch (2631:8): [True: 6, False: 117]
  |  Branch (2631:28): [True: 2, False: 4]
  ------------------
 2632|       |				/* LIBARCHIVE.creationtime */
 2633|      2|				__LA_TIME_T sec = 0;
  ------------------
  |  |  107|      2|#define __LA_TIME_T time_t
  ------------------
 2634|      2|				if ((err = pax_attribute_read_time(a, value_length, &sec, &n, unconsumed)) == ARCHIVE_OK) {
  ------------------
  |  |  233|      2|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2634:9): [True: 1, False: 1]
  ------------------
 2635|      1|					archive_entry_set_birthtime(entry, sec, n);
 2636|      1|				} else {
 2637|      1|					archive_set_error(&a->archive,
 2638|      1|							  ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2639|      1|							  "Ignoring malformed pax creationtime");
 2640|      1|				}
 2641|      2|				return (err);
 2642|      2|			}
 2643|    121|			else if (key_length == 11 && memcmp(key, "symlinktype", 11) == 0) {
  ------------------
  |  Branch (2643:13): [True: 38, False: 83]
  |  Branch (2643:33): [True: 8, False: 30]
  ------------------
 2644|       |				/* LIBARCHIVE.symlinktype */
 2645|      8|				if (value_length < 16) {
  ------------------
  |  Branch (2645:9): [True: 5, False: 3]
  ------------------
 2646|      5|					p = __archive_read_ahead(a, value_length, NULL);
 2647|      5|					if (p == NULL) {
  ------------------
  |  Branch (2647:10): [True: 1, False: 4]
  ------------------
 2648|      1|						archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2649|      1|								  "Truncated tar archive "
 2650|      1|								  "detected while reading `symlinktype` attribute");
 2651|      1|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2652|      1|					}
 2653|      4|					if (value_length == 4 && memcmp(p, "file", 4) == 0) {
  ------------------
  |  Branch (2653:10): [True: 1, False: 3]
  |  Branch (2653:31): [True: 0, False: 1]
  ------------------
 2654|      0|						archive_entry_set_symlink_type(entry,
 2655|      0|									       AE_SYMLINK_TYPE_FILE);
  ------------------
  |  |  228|      0|#define AE_SYMLINK_TYPE_FILE		1
  ------------------
 2656|      4|					} else if (value_length == 3 && memcmp(p, "dir", 3) == 0) {
  ------------------
  |  Branch (2656:17): [True: 2, False: 2]
  |  Branch (2656:38): [True: 1, False: 1]
  ------------------
 2657|      1|							archive_entry_set_symlink_type(entry,
 2658|      1|										       AE_SYMLINK_TYPE_DIRECTORY);
  ------------------
  |  |  229|      1|#define AE_SYMLINK_TYPE_DIRECTORY	2
  ------------------
 2659|      3|					} else {
 2660|      3|						archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2661|      3|								  "Unrecognized symlink type");
 2662|      3|						err = ARCHIVE_WARN;
  ------------------
  |  |  235|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2663|      3|					}
 2664|      4|				} else {
 2665|      3|					archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2666|      3|							  "symlink type is very long"
 2667|      3|							  "(longest recognized value is 4 bytes, this is %llu)",
 2668|      3|							  (unsigned long long)value_length);
 2669|      3|					err = ARCHIVE_WARN;
  ------------------
  |  |  235|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2670|      3|				}
 2671|      7|				__archive_read_consume(a, value_length);
 2672|      7|				return (err);
 2673|      8|			}
 2674|    113|			else if (key_length > 6 && memcmp(key, "xattr.", 6) == 0) {
  ------------------
  |  Branch (2674:13): [True: 106, False: 7]
  |  Branch (2674:31): [True: 94, False: 12]
  ------------------
 2675|     94|				key_length -= 6;
 2676|     94|				key += 6;
 2677|     94|				if (value_length > xattr_limit) {
  ------------------
  |  Branch (2677:9): [True: 1, False: 93]
  ------------------
 2678|      1|					err = ARCHIVE_WARN;
  ------------------
  |  |  235|      1|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2679|     93|				} else {
 2680|     93|					p = __archive_read_ahead(a, value_length, NULL);
 2681|     93|					if (p == NULL) {
  ------------------
  |  Branch (2681:10): [True: 7, False: 86]
  ------------------
 2682|      7|						archive_set_error(&a->archive, EINVAL,
 2683|      7|								  "Truncated archive"
 2684|      7|								  " detected while reading xattr information");
 2685|      7|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2686|      7|					}
 2687|     86|					if (pax_attribute_LIBARCHIVE_xattr(entry, key, key_length, p, value_length)) {
  ------------------
  |  Branch (2687:10): [True: 0, False: 86]
  ------------------
 2688|       |						/* TODO: Unable to parse xattr */
 2689|      0|						err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2690|      0|					}
 2691|     86|				}
 2692|     87|				__archive_read_consume(a, value_length);
 2693|     87|				return (err);
 2694|     94|			}
 2695|    123|		}
 2696|     43|		break;
 2697|     43|	case 'R':
  ------------------
  |  Branch (2697:2): [True: 17, False: 4.63k]
  ------------------
 2698|       |		/* GNU tar uses RHT.security header to store SELinux xattrs
 2699|       |		 * SCHILY.xattr.security.selinux == RHT.security.selinux */
 2700|     17|		if (key_length == 20 && memcmp(key, "RHT.security.selinux", 20) == 0) {
  ------------------
  |  Branch (2700:7): [True: 12, False: 5]
  |  Branch (2700:27): [True: 1, False: 11]
  ------------------
 2701|      1|			if (value_length > xattr_limit) {
  ------------------
  |  Branch (2701:8): [True: 0, False: 1]
  ------------------
 2702|      0|				archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2703|      0|						  "Ignoring unreasonably large security.selinux attribute:"
 2704|      0|						  " %llu > %llu",
 2705|      0|						  (unsigned long long)value_length,
 2706|      0|						  (unsigned long long)xattr_limit);
 2707|       |				/* TODO: Should this be FAILED instead? */
 2708|      0|				err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2709|      1|			} else {
 2710|      1|				p = __archive_read_ahead(a, value_length, NULL);
 2711|      1|				if (p == NULL) {
  ------------------
  |  Branch (2711:9): [True: 0, False: 1]
  ------------------
 2712|      0|					archive_set_error(&a->archive, EINVAL,
 2713|      0|							  "Truncated archive"
 2714|      0|							  " detected while reading selinux data");
 2715|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2716|      0|				}
 2717|      1|				if (pax_attribute_RHT_security_selinux(entry, p, value_length)) {
  ------------------
  |  Branch (2717:9): [True: 0, False: 1]
  ------------------
 2718|       |					/* TODO: Unable to parse xattr */
 2719|      0|					err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2720|      0|				}
 2721|      1|			}
 2722|      1|			__archive_read_consume(a, value_length);
 2723|      1|			return (err);
 2724|      1|		}
 2725|     16|		break;
 2726|  1.29k|	case 'S':
  ------------------
  |  Branch (2726:2): [True: 1.29k, False: 3.35k]
  ------------------
 2727|       |		/* SCHILY.* extensions used by "star" archiver */
 2728|  1.29k|		if (key_length > 7 && memcmp(key, "SCHILY.", 7) == 0) {
  ------------------
  |  Branch (2728:7): [True: 1.25k, False: 34]
  |  Branch (2728:25): [True: 590, False: 668]
  ------------------
 2729|    590|			key_length -= 7;
 2730|    590|			key += 7;
 2731|       |
 2732|    590|			if (key_length == 10 && memcmp(key, "acl.access", 10) == 0) {
  ------------------
  |  Branch (2732:8): [True: 19, False: 571]
  |  Branch (2732:28): [True: 6, False: 13]
  ------------------
 2733|      6|				err = pax_attribute_SCHILY_acl(a, tar, entry, value_length,
 2734|      6|						      ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
  ------------------
  |  |  534|      6|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
 2735|       |				// TODO: Mark mode as set
 2736|      6|				return (err);
 2737|      6|			}
 2738|    584|			else if (key_length == 11 && memcmp(key, "acl.default", 11) == 0) {
  ------------------
  |  Branch (2738:13): [True: 34, False: 550]
  |  Branch (2738:33): [True: 22, False: 12]
  ------------------
 2739|     22|				err = pax_attribute_SCHILY_acl(a, tar, entry, value_length,
 2740|     22|						      ARCHIVE_ENTRY_ACL_TYPE_DEFAULT);
  ------------------
  |  |  535|     22|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
 2741|     22|				return (err);
 2742|     22|			}
 2743|    562|			else if (key_length == 7 && memcmp(key, "acl.ace", 7) == 0) {
  ------------------
  |  Branch (2743:13): [True: 21, False: 541]
  |  Branch (2743:32): [True: 10, False: 11]
  ------------------
 2744|     10|				err = pax_attribute_SCHILY_acl(a, tar, entry, value_length,
 2745|     10|						      ARCHIVE_ENTRY_ACL_TYPE_NFS4);
  ------------------
  |  |  542|     10|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|     10|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|     10|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|     10|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|     10|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|     10|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|     10|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|     10|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
 2746|       |				// TODO: Mark mode as set
 2747|     10|				return (err);
 2748|     10|			}
 2749|    552|			else if (key_length == 8 && memcmp(key, "devmajor", 8) == 0) {
  ------------------
  |  Branch (2749:13): [True: 136, False: 416]
  |  Branch (2749:32): [True: 22, False: 114]
  ------------------
 2750|     22|				if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|     22|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2750:9): [True: 21, False: 1]
  ------------------
 2751|     21|					archive_entry_set_rdevmajor(entry, (dev_t)t);
 2752|     21|				}
 2753|     22|				return (err);
 2754|     22|			}
 2755|    530|			else if (key_length == 8 && memcmp(key, "devminor", 8) == 0) {
  ------------------
  |  Branch (2755:13): [True: 114, False: 416]
  |  Branch (2755:32): [True: 18, False: 96]
  ------------------
 2756|     18|				if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|     18|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2756:9): [True: 10, False: 8]
  ------------------
 2757|     10|					archive_entry_set_rdevminor(entry, (dev_t)t);
 2758|     10|				}
 2759|     18|				return (err);
 2760|     18|			}
 2761|    512|			else if (key_length == 6 && memcmp(key, "fflags", 6) == 0) {
  ------------------
  |  Branch (2761:13): [True: 31, False: 481]
  |  Branch (2761:32): [True: 19, False: 12]
  ------------------
 2762|     19|				if (value_length < fflags_limit) {
  ------------------
  |  Branch (2762:9): [True: 19, False: 0]
  ------------------
 2763|     19|					p = __archive_read_ahead(a, value_length, NULL);
 2764|     19|					if (p == NULL) {
  ------------------
  |  Branch (2764:10): [True: 0, False: 19]
  ------------------
 2765|       |						/* Truncated archive */
 2766|      0|						archive_set_error(&a->archive, EINVAL,
 2767|      0|								  "Truncated archive"
 2768|      0|								  " detected while reading SCHILY.fflags");
 2769|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2770|      0|					}
 2771|     19|					archive_entry_copy_fflags_text_len(entry, p, value_length);
 2772|     19|					err = ARCHIVE_OK;
  ------------------
  |  |  233|     19|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2773|     19|				} else {
 2774|       |					/* Overlong fflags field */
 2775|      0|					err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2776|      0|				}
 2777|     19|				__archive_read_consume(a, value_length);
 2778|     19|				return (err);
 2779|     19|			}
 2780|    493|			else if (key_length == 3 && memcmp(key, "dev", 3) == 0) {
  ------------------
  |  Branch (2780:13): [True: 294, False: 199]
  |  Branch (2780:32): [True: 210, False: 84]
  ------------------
 2781|    210|				if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|    210|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2781:9): [True: 203, False: 7]
  ------------------
 2782|    203|					archive_entry_set_dev(entry, (dev_t)t);
 2783|    203|				}
 2784|    210|				return (err);
 2785|    210|			}
 2786|    283|			else if (key_length == 3 && memcmp(key, "ino", 3) == 0) {
  ------------------
  |  Branch (2786:13): [True: 84, False: 199]
  |  Branch (2786:32): [True: 17, False: 67]
  ------------------
 2787|     17|				if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|     17|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2787:9): [True: 16, False: 1]
  ------------------
 2788|     16|					archive_entry_set_ino(entry, t);
 2789|     16|				}
 2790|     17|				return (err);
 2791|     17|			}
 2792|    266|			else if (key_length == 5 && memcmp(key, "nlink", 5) == 0) {
  ------------------
  |  Branch (2792:13): [True: 31, False: 235]
  |  Branch (2792:32): [True: 20, False: 11]
  ------------------
 2793|     20|				if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|     20|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2793:9): [True: 10, False: 10]
  ------------------
 2794|     10|					archive_entry_set_nlink(entry, (unsigned int)t);
 2795|     10|				}
 2796|     20|				return (err);
 2797|     20|			}
 2798|    246|			else if (key_length == 8 && memcmp(key, "realsize", 8) == 0) {
  ------------------
  |  Branch (2798:13): [True: 96, False: 150]
  |  Branch (2798:32): [True: 49, False: 47]
  ------------------
 2799|     49|				if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|     49|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2799:9): [True: 48, False: 1]
  ------------------
 2800|     48|					tar->SCHILY_sparse_realsize = t;
 2801|     48|					tar->size_fields |= TAR_SIZE_SCHILY_SPARSE_REALSIZE;
  ------------------
  |  |  165|     48|#define TAR_SIZE_SCHILY_SPARSE_REALSIZE 8
  ------------------
 2802|     48|				}
 2803|     49|				return (err);
 2804|     49|			}
 2805|       |			/* TODO: Is there a SCHILY.sparse.size similar to GNU.sparse.size ? */
 2806|    197|			else if (key_length > 6 && memcmp(key, "xattr.", 6) == 0) {
  ------------------
  |  Branch (2806:13): [True: 103, False: 94]
  |  Branch (2806:31): [True: 17, False: 86]
  ------------------
 2807|     17|				key_length -= 6;
 2808|     17|				key += 6;
 2809|     17|				if (value_length < xattr_limit) {
  ------------------
  |  Branch (2809:9): [True: 17, False: 0]
  ------------------
 2810|     17|					p = __archive_read_ahead(a, value_length, NULL);
 2811|     17|					if (p == NULL) {
  ------------------
  |  Branch (2811:10): [True: 0, False: 17]
  ------------------
 2812|      0|						archive_set_error(&a->archive, EINVAL,
 2813|      0|								  "Truncated archive"
 2814|      0|								  " detected while reading SCHILY.xattr");
 2815|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2816|      0|					}
 2817|     17|					if (pax_attribute_SCHILY_xattr(entry, key, key_length, p, value_length)) {
  ------------------
  |  Branch (2817:10): [True: 0, False: 17]
  ------------------
 2818|       |						/* TODO: Unable to parse xattr */
 2819|      0|						err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2820|      0|					}
 2821|     17|				} else {
 2822|      0|					archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2823|      0|							  "Unreasonably large xattr: %llu > %llu",
 2824|      0|							  (unsigned long long)value_length,
 2825|      0|							  (unsigned long long)xattr_limit);
 2826|      0|					err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2827|      0|				}
 2828|     17|				__archive_read_consume(a, value_length);
 2829|     17|				return (err);
 2830|     17|			}
 2831|    590|		}
 2832|       |		/* SUN.* extensions from Solaris tar */
 2833|    882|		if (key_length > 4 && memcmp(key, "SUN.", 4) == 0) {
  ------------------
  |  Branch (2833:7): [True: 782, False: 100]
  |  Branch (2833:25): [True: 453, False: 329]
  ------------------
 2834|    453|			key_length -= 4;
 2835|    453|			key += 4;
 2836|       |
 2837|    453|			if (key_length == 9 && memcmp(key, "holesdata", 9) == 0) {
  ------------------
  |  Branch (2837:8): [True: 440, False: 13]
  |  Branch (2837:27): [True: 387, False: 53]
  ------------------
 2838|       |				/* SUN.holesdata */
 2839|    387|				if (value_length < sparse_map_limit) {
  ------------------
  |  Branch (2839:9): [True: 387, False: 0]
  ------------------
 2840|    387|					p = __archive_read_ahead(a, value_length, NULL);
 2841|    387|					if (p == NULL) {
  ------------------
  |  Branch (2841:10): [True: 1, False: 386]
  ------------------
 2842|      1|						archive_set_error(&a->archive, EINVAL,
 2843|      1|								  "Truncated archive"
 2844|      1|								  " detected while reading SUN.holesdata");
 2845|      1|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2846|      1|					}
 2847|    386|					err = pax_attribute_SUN_holesdata(a, tar, entry, p, value_length);
 2848|    386|					if (err < ARCHIVE_OK) {
  ------------------
  |  |  233|    386|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2848:10): [True: 352, False: 34]
  ------------------
 2849|    352|						archive_set_error(&a->archive,
 2850|    352|								  ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    352|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2851|    352|								  "Parse error: SUN.holesdata");
 2852|    352|					}
 2853|    386|				} else {
 2854|      0|					archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2855|      0|							  "Unreasonably large sparse map: %llu > %llu",
 2856|      0|							  (unsigned long long)value_length,
 2857|      0|							  (unsigned long long)sparse_map_limit);
 2858|      0|					err = ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2859|      0|				}
 2860|    386|				__archive_read_consume(a, value_length);
 2861|    386|				return (err);
 2862|    387|			}
 2863|    453|		}
 2864|    495|		break;
 2865|    495|	case 'a':
  ------------------
  |  Branch (2865:2): [True: 421, False: 4.22k]
  ------------------
 2866|    421|		if (key_length == 5 && memcmp(key, "atime", 5) == 0) {
  ------------------
  |  Branch (2866:7): [True: 398, False: 23]
  |  Branch (2866:26): [True: 63, False: 335]
  ------------------
 2867|     63|			__LA_TIME_T sec = 0;
  ------------------
  |  |  107|     63|#define __LA_TIME_T time_t
  ------------------
 2868|     63|			if ((err = pax_attribute_read_time(a, value_length, &sec, &n, unconsumed)) == ARCHIVE_OK) {
  ------------------
  |  |  233|     63|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2868:8): [True: 10, False: 53]
  ------------------
 2869|     10|				archive_entry_set_atime(entry, sec, n);
 2870|     53|			} else {
 2871|     53|				archive_set_error(&a->archive,
 2872|     53|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     53|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2873|     53|				    "Ignoring malformed pax atime");
 2874|     53|			}
 2875|     63|			return (err);
 2876|     63|		}
 2877|    358|		break;
 2878|    358|	case 'c':
  ------------------
  |  Branch (2878:2): [True: 146, False: 4.50k]
  ------------------
 2879|    146|		if (key_length == 5 && memcmp(key, "ctime", 5) == 0) {
  ------------------
  |  Branch (2879:7): [True: 67, False: 79]
  |  Branch (2879:26): [True: 44, False: 23]
  ------------------
 2880|     44|			__LA_TIME_T sec = 0;
  ------------------
  |  |  107|     44|#define __LA_TIME_T time_t
  ------------------
 2881|     44|			if ((err = pax_attribute_read_time(a, value_length, &sec, &n, unconsumed)) == ARCHIVE_OK) {
  ------------------
  |  |  233|     44|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2881:8): [True: 1, False: 43]
  ------------------
 2882|      1|				archive_entry_set_ctime(entry, sec, n);
 2883|     43|			} else {
 2884|     43|				archive_set_error(&a->archive,
 2885|     43|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     43|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2886|     43|				    "Ignoring malformed pax ctime");
 2887|     43|			}
 2888|     44|			return (err);
 2889|    102|		} else if (key_length == 7 && memcmp(key, "charset", 7) == 0) {
  ------------------
  |  Branch (2889:14): [True: 0, False: 102]
  |  Branch (2889:33): [True: 0, False: 0]
  ------------------
 2890|       |			/* TODO: Publish charset information in entry. */
 2891|    102|		} else if (key_length == 7 && memcmp(key, "comment", 7) == 0) {
  ------------------
  |  Branch (2891:14): [True: 0, False: 102]
  |  Branch (2891:33): [True: 0, False: 0]
  ------------------
 2892|       |			/* TODO: Publish comment in entry. */
 2893|      0|		}
 2894|    102|		break;
 2895|    102|	case 'g':
  ------------------
  |  Branch (2895:2): [True: 73, False: 4.57k]
  ------------------
 2896|     73|		if (key_length == 3 && memcmp(key, "gid", 3) == 0) {
  ------------------
  |  Branch (2896:7): [True: 50, False: 23]
  |  Branch (2896:26): [True: 41, False: 9]
  ------------------
 2897|     41|			if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|     41|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2897:8): [True: 12, False: 29]
  ------------------
 2898|     12|				archive_entry_set_gid(entry, t);
 2899|     12|			}
 2900|     41|			return (err);
 2901|     41|		} else if (key_length == 5 && memcmp(key, "gname", 5) == 0) {
  ------------------
  |  Branch (2901:14): [True: 16, False: 16]
  |  Branch (2901:33): [True: 9, False: 7]
  ------------------
 2902|      9|			if (value_length > guname_limit) {
  ------------------
  |  Branch (2902:8): [True: 0, False: 9]
  ------------------
 2903|      0|				*unconsumed += value_length;
 2904|      0|				err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2905|      9|			} else {
 2906|      9|				err = read_bytes_to_string(a, &(tar->entry_gname), value_length, unconsumed);
 2907|      9|			}
 2908|      9|			return (err);
 2909|      9|		}
 2910|     23|		break;
 2911|     48|	case 'h':
  ------------------
  |  Branch (2911:2): [True: 48, False: 4.60k]
  ------------------
 2912|     48|		if (key_length == 10 && memcmp(key, "hdrcharset", 10) == 0) {
  ------------------
  |  Branch (2912:7): [True: 12, False: 36]
  |  Branch (2912:27): [True: 4, False: 8]
  ------------------
 2913|      4|			if (value_length < 64) {
  ------------------
  |  Branch (2913:8): [True: 3, False: 1]
  ------------------
 2914|      3|				p = __archive_read_ahead(a, value_length, NULL);
 2915|      3|				if (p == NULL) {
  ------------------
  |  Branch (2915:9): [True: 0, False: 3]
  ------------------
 2916|      0|					archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2917|      0|							  "Truncated tar archive "
 2918|      0|							  "detected while reading hdrcharset attribute");
 2919|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2920|      0|				}
 2921|      3|				if (value_length == 6
  ------------------
  |  Branch (2921:9): [True: 1, False: 2]
  ------------------
 2922|      1|				    && memcmp(p, "BINARY", 6) == 0) {
  ------------------
  |  Branch (2922:12): [True: 0, False: 1]
  ------------------
 2923|       |					/* Binary  mode. */
 2924|      0|					tar->pax_hdrcharset_utf8 = 0;
 2925|      0|					err = ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2926|      3|				} else if (value_length == 23
  ------------------
  |  Branch (2926:16): [True: 1, False: 2]
  ------------------
 2927|      1|					   && memcmp(p, "ISO-IR 10646 2000 UTF-8", 23) == 0) {
  ------------------
  |  Branch (2927:12): [True: 0, False: 1]
  ------------------
 2928|      0|					tar->pax_hdrcharset_utf8 = 1;
 2929|      0|					err = ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2930|      3|				} else {
 2931|       |					/* TODO: Unrecognized character set */
 2932|      3|					err  = ARCHIVE_WARN;
  ------------------
  |  |  235|      3|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2933|      3|				}
 2934|      3|			} else {
 2935|      1|				archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2936|      1|						  "hdrcharset attribute is unreasonably large (%llu bytes)",
 2937|      1|						  (unsigned long long)value_length);
 2938|      1|				err = ARCHIVE_WARN;
  ------------------
  |  |  235|      1|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2939|      1|			}
 2940|      4|			__archive_read_consume(a, value_length);
 2941|      4|			return (err);
 2942|      4|		}
 2943|     44|		break;
 2944|     74|	case 'l':
  ------------------
  |  Branch (2944:2): [True: 74, False: 4.57k]
  ------------------
 2945|       |		/* pax interchange doesn't distinguish hardlink vs. symlink. */
 2946|     74|		if (key_length == 8 && memcmp(key, "linkpath", 8) == 0) {
  ------------------
  |  Branch (2946:7): [True: 19, False: 55]
  |  Branch (2946:26): [True: 9, False: 10]
  ------------------
 2947|      9|			if (value_length > pathname_limit) {
  ------------------
  |  Branch (2947:8): [True: 0, False: 9]
  ------------------
 2948|      0|				*unconsumed += value_length;
 2949|      0|				err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2950|      9|			} else {
 2951|      9|				err = read_bytes_to_string(a, &tar->entry_linkpath, value_length, unconsumed);
 2952|      9|			}
 2953|      9|			return (err);
 2954|      9|		}
 2955|     65|		break;
 2956|  1.22k|	case 'm':
  ------------------
  |  Branch (2956:2): [True: 1.22k, False: 3.43k]
  ------------------
 2957|  1.22k|		if (key_length == 5 && memcmp(key, "mtime", 5) == 0) {
  ------------------
  |  Branch (2957:7): [True: 889, False: 331]
  |  Branch (2957:26): [True: 705, False: 184]
  ------------------
 2958|    705|			__LA_TIME_T sec;
  ------------------
  |  |  107|    705|#define __LA_TIME_T time_t
  ------------------
 2959|    705|			if ((err = pax_attribute_read_time(a, value_length, &sec, &n, unconsumed)) == ARCHIVE_OK) {
  ------------------
  |  |  233|    705|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2959:8): [True: 210, False: 495]
  ------------------
 2960|    210|				archive_entry_set_mtime(entry, sec, n);
 2961|    495|			} else {
 2962|    495|				archive_set_error(&a->archive,
 2963|    495|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    495|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2964|    495|				    "Ignoring malformed pax mtime");
 2965|    495|			}
 2966|    705|			return (err);
 2967|    705|		}
 2968|    515|		break;
 2969|    515|	case 'p':
  ------------------
  |  Branch (2969:2): [True: 58, False: 4.59k]
  ------------------
 2970|     58|		if (key_length == 4 && memcmp(key, "path", 4) == 0) {
  ------------------
  |  Branch (2970:7): [True: 12, False: 46]
  |  Branch (2970:26): [True: 7, False: 5]
  ------------------
 2971|      7|			if (value_length > pathname_limit) {
  ------------------
  |  Branch (2971:8): [True: 0, False: 7]
  ------------------
 2972|      0|				*unconsumed += value_length;
 2973|      0|				err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2974|      7|			} else {
 2975|      7|				err = read_bytes_to_string(a, &(tar->entry_pathname), value_length, unconsumed);
 2976|      7|			}
 2977|      7|			return (err);
 2978|      7|		}
 2979|     51|		break;
 2980|     51|	case 'r':
  ------------------
  |  Branch (2980:2): [True: 0, False: 4.65k]
  ------------------
 2981|       |		/* POSIX has reserved 'realtime.*' */
 2982|      0|		break;
 2983|    113|	case 's':
  ------------------
  |  Branch (2983:2): [True: 113, False: 4.53k]
  ------------------
 2984|       |		/* POSIX has reserved 'security.*' */
 2985|       |		/* Someday: if (strcmp(key, "security.acl") == 0) { ... } */
 2986|    113|		if (key_length == 4 && memcmp(key, "size", 4) == 0) {
  ------------------
  |  Branch (2986:7): [True: 72, False: 41]
  |  Branch (2986:26): [True: 22, False: 50]
  ------------------
 2987|       |			/* "size" is the size of the data in the entry. */
 2988|     22|			if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|     22|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2988:8): [True: 20, False: 2]
  ------------------
 2989|     20|				tar->pax_size = t;
 2990|     20|				tar->size_fields |= TAR_SIZE_PAX_SIZE;
  ------------------
  |  |  162|     20|#define TAR_SIZE_PAX_SIZE 1
  ------------------
 2991|     20|			}
 2992|      2|			else if (t == INT64_MAX) {
  ------------------
  |  Branch (2992:13): [True: 1, False: 1]
  ------------------
 2993|       |				/* Note: pax_attr_read_number returns INT64_MAX on overflow or < 0 */
 2994|      1|				tar->entry_bytes_remaining = 0;
 2995|      1|				archive_set_error(&a->archive,
 2996|      1|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2997|      1|				    "Tar size attribute overflow");
 2998|      1|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2999|      1|			}
 3000|     21|			return (err);
 3001|     22|		}
 3002|     91|		break;
 3003|    103|	case 'u':
  ------------------
  |  Branch (3003:2): [True: 103, False: 4.54k]
  ------------------
 3004|    103|		if (key_length == 3 && memcmp(key, "uid", 3) == 0) {
  ------------------
  |  Branch (3004:7): [True: 82, False: 21]
  |  Branch (3004:26): [True: 27, False: 55]
  ------------------
 3005|     27|			if ((err = pax_attribute_read_number(a, value_length, &t)) == ARCHIVE_OK) {
  ------------------
  |  |  233|     27|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3005:8): [True: 21, False: 6]
  ------------------
 3006|     21|				archive_entry_set_uid(entry, t);
 3007|     21|			}
 3008|     27|			return (err);
 3009|     76|		} else if (key_length == 5 && memcmp(key, "uname", 5) == 0) {
  ------------------
  |  Branch (3009:14): [True: 15, False: 61]
  |  Branch (3009:33): [True: 2, False: 13]
  ------------------
 3010|      2|			if (value_length > guname_limit) {
  ------------------
  |  Branch (3010:8): [True: 0, False: 2]
  ------------------
 3011|      0|				*unconsumed += value_length;
 3012|      0|				err = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 3013|      2|			} else {
 3014|      2|				err = read_bytes_to_string(a, &(tar->entry_uname), value_length, unconsumed);
 3015|      2|			}
 3016|      2|			return (err);
 3017|      2|		}
 3018|     74|		break;
 3019|  4.65k|	}
 3020|       |
 3021|       |	/* Unrecognized key, just skip the entire value. */
 3022|  2.53k|	__archive_read_consume(a, value_length);
 3023|  2.53k|	return (err);
 3024|  4.65k|}
archive_read_support_format_tar.c:pax_attribute_read_number:
 2424|    654|pax_attribute_read_number(struct archive_read *a, size_t value_length, int64_t *result) {
 2425|    654|	struct archive_string as;
 2426|    654|	int64_t unconsumed = 0;
 2427|    654|	int r;
 2428|       |
 2429|    654|	if (value_length > 64) {
  ------------------
  |  Branch (2429:6): [True: 9, False: 645]
  ------------------
 2430|      9|		__archive_read_consume(a, value_length);
 2431|      9|		*result = 0;
 2432|      9|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      9|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2433|      9|	}
 2434|       |
 2435|    645|	archive_string_init(&as);
  ------------------
  |  |   71|    645|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 645]
  |  |  ------------------
  ------------------
 2436|    645|	r = read_bytes_to_string(a, &as, value_length, &unconsumed);
 2437|    645|	if (tar_flush_unconsumed(a, &unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|    645|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2437:6): [True: 0, False: 645]
  ------------------
 2438|      0|		*result = 0;
 2439|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2440|      0|	}
 2441|    645|	if (r < ARCHIVE_OK) {
  ------------------
  |  |  233|    645|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2441:6): [True: 0, False: 645]
  ------------------
 2442|      0|		archive_string_free(&as);
 2443|      0|		*result = 0;
 2444|      0|		return (r);
 2445|      0|	}
 2446|       |
 2447|    645|	*result = tar_atol10(as.s, archive_strlen(&as));
  ------------------
  |  |  178|    645|#define	archive_strlen(a) ((a)->length)
  ------------------
 2448|    645|	archive_string_free(&as);
 2449|    645|	if (*result < 0 || *result == INT64_MAX) {
  ------------------
  |  Branch (2449:6): [True: 89, False: 556]
  |  Branch (2449:21): [True: 6, False: 550]
  ------------------
 2450|     95|		*result = INT64_MAX;
 2451|     95|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|     95|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2452|     95|	}
 2453|    550|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    550|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2454|    645|}
archive_read_support_format_tar.c:tar_atol10:
 3643|  1.90k|{
 3644|  1.90k|	return tar_atol_base_n(p, char_cnt, 10);
 3645|  1.90k|}
archive_read_support_format_tar.c:gnu_sparse_01_parse:
 3371|     38|{
 3372|     38|	const char *e;
 3373|     38|	int64_t offset = -1, size = -1;
 3374|       |
 3375|    437|	for (;;) {
 3376|    437|		e = p;
 3377|  1.89k|		while (length > 0 && *e != ',') {
  ------------------
  |  Branch (3377:10): [True: 1.87k, False: 15]
  |  Branch (3377:24): [True: 1.47k, False: 400]
  ------------------
 3378|  1.47k|			if (*e < '0' || *e > '9')
  ------------------
  |  Branch (3378:8): [True: 11, False: 1.46k]
  |  Branch (3378:20): [True: 11, False: 1.45k]
  ------------------
 3379|     22|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|     22|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 3380|  1.45k|			e++;
 3381|  1.45k|			length--;
 3382|  1.45k|		}
 3383|    415|		if (offset < 0) {
  ------------------
  |  Branch (3383:7): [True: 218, False: 197]
  ------------------
 3384|    218|			offset = tar_atol10(p, e - p);
 3385|    218|			if (offset < 0)
  ------------------
  |  Branch (3385:8): [True: 0, False: 218]
  ------------------
 3386|      0|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 3387|    218|		} else {
 3388|    197|			size = tar_atol10(p, e - p);
 3389|    197|			if (size < 0)
  ------------------
  |  Branch (3389:8): [True: 0, False: 197]
  ------------------
 3390|      0|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 3391|    197|			if (gnu_add_sparse_entry(a, tar, offset, size)
  ------------------
  |  Branch (3391:8): [True: 2, False: 195]
  ------------------
 3392|    197|			    != ARCHIVE_OK)
  ------------------
  |  |  233|    197|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3393|      2|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3394|    195|			offset = -1;
 3395|    195|		}
 3396|    413|		if (length == 0)
  ------------------
  |  Branch (3396:7): [True: 14, False: 399]
  ------------------
 3397|     14|			return (ARCHIVE_OK);
  ------------------
  |  |  233|     14|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3398|    399|		p = e + 1;
 3399|    399|		length--;
 3400|    399|	}
 3401|     38|}
archive_read_support_format_tar.c:pax_attribute_read_time:
 2389|    814|pax_attribute_read_time(struct archive_read *a, size_t value_length, __LA_TIME_T *ps, long *pn, int64_t *unconsumed) {
 2390|    814|	struct archive_string as;
 2391|    814|	int r;
 2392|       |
 2393|    814|	if (value_length > 128) {
  ------------------
  |  Branch (2393:6): [True: 2, False: 812]
  ------------------
 2394|      2|		__archive_read_consume(a, value_length);
 2395|      2|		*ps = 0;
 2396|      2|		*pn = 0;
 2397|      2|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2398|      2|	}
 2399|       |
 2400|    812|	archive_string_init(&as);
  ------------------
  |  |   71|    812|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 812]
  |  |  ------------------
  ------------------
 2401|    812|	r = read_bytes_to_string(a, &as, value_length, unconsumed);
 2402|    812|	if (r < ARCHIVE_OK) {
  ------------------
  |  |  233|    812|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2402:6): [True: 0, False: 812]
  ------------------
 2403|      0|		archive_string_free(&as);
 2404|      0|		*ps = 0;
 2405|      0|		*pn = 0;
 2406|      0|		return (r);
 2407|      0|	}
 2408|       |
 2409|    812|	int64_t sec = 0;
 2410|    812|	pax_time(as.s, archive_strlen(&as), &sec, pn);
  ------------------
  |  |  178|    812|#define	archive_strlen(a) ((a)->length)
  ------------------
 2411|    812|	archive_string_free(&as);
 2412|       |
 2413|    812|	if (sec == INT64_MIN) {
  ------------------
  |  Branch (2413:6): [True: 590, False: 222]
  ------------------
 2414|    590|		*ps = 0;
 2415|    590|		*pn = 0;
 2416|    590|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|    590|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2417|    590|	} else {
 2418|    222|		*ps = (__LA_TIME_T)sec;
 2419|    222|	}
 2420|    222|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    222|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2421|    812|}
archive_read_support_format_tar.c:pax_time:
 3036|    812|{
 3037|    812|	char digit;
 3038|    812|	int64_t	s;
 3039|    812|	unsigned long l;
 3040|    812|	int sign;
 3041|       |
 3042|    812|	if (length <= 0) {
  ------------------
  |  Branch (3042:6): [True: 3, False: 809]
  ------------------
 3043|      3|		*ps = 0;
 3044|      3|		*pn = 0;
 3045|      3|		return;
 3046|      3|	}
 3047|    809|	s = 0;
 3048|    809|	sign = 1;
 3049|    809|	if (*p == '-') {
  ------------------
  |  Branch (3049:6): [True: 667, False: 142]
  ------------------
 3050|    667|		sign = -1;
 3051|    667|		p++;
 3052|    667|		length--;
 3053|    667|	}
 3054|  7.11k|	while (length > 0 && *p >= '0' && *p <= '9') {
  ------------------
  |  Branch (3054:9): [True: 7.10k, False: 11]
  |  Branch (3054:23): [True: 6.39k, False: 708]
  |  Branch (3054:36): [True: 6.32k, False: 68]
  ------------------
 3055|  6.32k|		digit = *p - '0';
 3056|  6.32k|		if (archive_ckd_mul_i64(&s, s, 10) ||
  ------------------
  |  Branch (3056:7): [True: 21, False: 6.30k]
  ------------------
 3057|  6.30k|		    archive_ckd_add_i64(&s, s, digit)) {
  ------------------
  |  Branch (3057:7): [True: 1, False: 6.30k]
  ------------------
 3058|     22|			*ps = INT64_MIN;
 3059|     22|			*pn = 0;
 3060|     22|			return;
 3061|     22|		}
 3062|  6.30k|		++p;
 3063|  6.30k|		--length;
 3064|  6.30k|	}
 3065|       |
 3066|    787|	*ps = s * sign;
 3067|       |
 3068|    787|#if ARCHIVE_VERSION_NUMBER < 4000000
 3069|       |	/* Libarchive 4.0 will have __LA_TIME_T == int64_t, so
 3070|       |	   this will be unnecessary. */
 3071|       |	/* Test whether it overflows __LA_TIME_T */
 3072|    787|	__LA_TIME_T sec = (__LA_TIME_T)*ps;
  ------------------
  |  |  107|    787|#define __LA_TIME_T time_t
  ------------------
 3073|    787|	if ((int64_t)sec != *ps) {
  ------------------
  |  Branch (3073:6): [True: 0, False: 787]
  ------------------
 3074|      0|		*ps = INT64_MIN;
 3075|      0|		*pn = 0;
 3076|      0|		return;
 3077|      0|	}
 3078|    787|#endif
 3079|       |
 3080|       |	/* Calculate nanoseconds. */
 3081|    787|	*pn = 0;
 3082|       |
 3083|    787|	if (length <= 0) {
  ------------------
  |  Branch (3083:6): [True: 11, False: 776]
  ------------------
 3084|     11|		return;
 3085|     11|	}
 3086|       |
 3087|       |	/* Skip `.` */
 3088|    776|	if (*p != '.') {
  ------------------
  |  Branch (3088:6): [True: 351, False: 425]
  ------------------
 3089|    351|		*ps = INT64_MIN;
 3090|    351|		*pn = 0;
 3091|    351|		return;
 3092|    351|	}
 3093|    425|	++p;
 3094|    425|	--length;
 3095|       |
 3096|    425|	l = 100000000UL;
 3097|  2.35k|	do {
 3098|  2.35k|		if (length <= 0) {
  ------------------
  |  Branch (3098:7): [True: 188, False: 2.17k]
  ------------------
 3099|    188|			return;
 3100|    188|		}
 3101|  2.17k|		if (*p >= '0' && *p <= '9') {
  ------------------
  |  Branch (3101:7): [True: 2.01k, False: 151]
  |  Branch (3101:20): [True: 1.96k, False: 51]
  ------------------
 3102|  1.96k|			*pn += (*p - '0') * l;
 3103|  1.96k|		} else {
 3104|    202|			*ps = INT64_MIN;
 3105|    202|			*pn = 0;
 3106|    202|			return;
 3107|    202|		}
 3108|  1.96k|		++p;
 3109|  1.96k|		--length;
 3110|  1.96k|	} while (l /= 10);
  ------------------
  |  Branch (3110:11): [True: 1.93k, False: 35]
  ------------------
 3111|       |
 3112|       |	/* Ignore resolution beyond nanoseconds,
 3113|       |	   but verify it's all decimal digits. */
 3114|    177|	while (length > 0) {
  ------------------
  |  Branch (3114:9): [True: 157, False: 20]
  ------------------
 3115|    157|		if (*p < '0' || *p > '9') {
  ------------------
  |  Branch (3115:7): [True: 12, False: 145]
  |  Branch (3115:19): [True: 3, False: 142]
  ------------------
 3116|     15|			*ps = INT64_MIN;
 3117|     15|			*pn = 0;
 3118|     15|			return;
 3119|     15|		}
 3120|    142|		++p;
 3121|    142|		--length;
 3122|    142|	}
 3123|     35|}
archive_read_support_format_tar.c:pax_attribute_LIBARCHIVE_xattr:
 2263|     86|{
 2264|     86|	char *name_decoded;
 2265|     86|	void *value_decoded;
 2266|     86|	size_t value_len;
 2267|       |
 2268|     86|	if (name_length < 1)
  ------------------
  |  Branch (2268:6): [True: 0, False: 86]
  ------------------
 2269|      0|		return 3;
 2270|       |
 2271|       |	/* URL-decode name */
 2272|     86|	name_decoded = url_decode(name, name_length);
 2273|     86|	if (name_decoded == NULL)
  ------------------
  |  Branch (2273:6): [True: 0, False: 86]
  ------------------
 2274|      0|		return 2;
 2275|       |
 2276|       |	/* Base-64 decode value */
 2277|     86|	value_decoded = base64_decode(value, value_length, &value_len);
 2278|     86|	if (value_decoded == NULL) {
  ------------------
  |  Branch (2278:6): [True: 0, False: 86]
  ------------------
 2279|      0|		free(name_decoded);
 2280|      0|		return 1;
 2281|      0|	}
 2282|       |
 2283|     86|	archive_entry_xattr_add_entry(entry, name_decoded,
 2284|     86|		value_decoded, value_len);
 2285|       |
 2286|     86|	free(name_decoded);
 2287|     86|	free(value_decoded);
 2288|     86|	return 0;
 2289|     86|}
archive_read_support_format_tar.c:url_decode:
 3852|     86|{
 3853|     86|	char *out, *d;
 3854|     86|	const char *s;
 3855|       |
 3856|     86|	out = malloc(length + 1);
 3857|     86|	if (out == NULL)
  ------------------
  |  Branch (3857:6): [True: 0, False: 86]
  ------------------
 3858|      0|		return (NULL);
 3859|  8.59k|	for (s = in, d = out; length > 0 && *s != '\0'; ) {
  ------------------
  |  Branch (3859:24): [True: 8.50k, False: 86]
  |  Branch (3859:38): [True: 8.50k, False: 0]
  ------------------
 3860|  8.50k|		if (s[0] == '%' && length > 2) {
  ------------------
  |  Branch (3860:7): [True: 3.49k, False: 5.01k]
  |  Branch (3860:22): [True: 3.46k, False: 26]
  ------------------
 3861|       |			/* Try to convert % escape */
 3862|  3.46k|			int digit1 = tohex(s[1]);
 3863|  3.46k|			int digit2 = tohex(s[2]);
 3864|  3.46k|			if (digit1 >= 0 && digit2 >= 0) {
  ------------------
  |  Branch (3864:8): [True: 688, False: 2.78k]
  |  Branch (3864:23): [True: 218, False: 470]
  ------------------
 3865|       |				/* Looks good, consume three chars */
 3866|    218|				s += 3;
 3867|    218|				length -= 3;
 3868|       |				/* Convert output */
 3869|    218|				*d++ = ((digit1 << 4) | digit2);
 3870|    218|				continue;
 3871|    218|			}
 3872|       |			/* Else fall through and treat '%' as normal char */
 3873|  3.46k|		}
 3874|  8.29k|		*d++ = *s++;
 3875|  8.29k|		--length;
 3876|  8.29k|	}
 3877|     86|	*d = '\0';
 3878|     86|	return (out);
 3879|     86|}
archive_read_support_format_tar.c:tohex:
 3883|  6.93k|{
 3884|  6.93k|	if (c >= '0' && c <= '9')
  ------------------
  |  Branch (3884:6): [True: 1.83k, False: 5.10k]
  |  Branch (3884:18): [True: 575, False: 1.26k]
  ------------------
 3885|    575|		return (c - '0');
 3886|  6.36k|	else if (c >= 'A' && c <= 'F')
  ------------------
  |  Branch (3886:11): [True: 1.25k, False: 5.11k]
  |  Branch (3886:23): [True: 151, False: 1.09k]
  ------------------
 3887|    151|		return (c - 'A' + 10);
 3888|  6.21k|	else if (c >= 'a' && c <= 'f')
  ------------------
  |  Branch (3888:11): [True: 972, False: 5.23k]
  |  Branch (3888:23): [True: 715, False: 257]
  ------------------
 3889|    715|		return (c - 'a' + 10);
 3890|  5.49k|	else
 3891|  5.49k|		return (-1);
 3892|  6.93k|}
archive_read_support_format_tar.c:base64_decode:
 3784|     86|{
 3785|     86|	static const unsigned char decode_table[128] = {
 3786|     86|		255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
 3787|     86|		255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
 3788|     86|		255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
 3789|     86|		255, 255, 255, 255, 255, 255, 255, 62, 255, 255, 255, 63,
 3790|     86|		52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 255, 255, 255, 255,
 3791|     86|		255, 255, 255, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
 3792|     86|		14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 255, 255,
 3793|     86|		255, 255, 255, 255, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
 3794|     86|		36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
 3795|     86|		51, 255, 255, 255, 255, 255 };
 3796|     86|	char *out, *d;
 3797|     86|	const unsigned char *src = (const unsigned char *)s;
 3798|       |
 3799|       |	/* Allocate enough space to hold the entire output. */
 3800|       |	/* Note that we may not use all of this... */
 3801|     86|	out = malloc(len - len / 4 + 1);
 3802|     86|	if (out == NULL) {
  ------------------
  |  Branch (3802:6): [True: 0, False: 86]
  ------------------
 3803|      0|		*out_len = 0;
 3804|      0|		return (NULL);
 3805|      0|	}
 3806|     86|	d = out;
 3807|       |
 3808|  1.94k|	while (len > 0) {
  ------------------
  |  Branch (3808:9): [True: 1.85k, False: 86]
  ------------------
 3809|       |		/* Collect the next group of (up to) four characters. */
 3810|  1.85k|		int v = 0;
 3811|  1.85k|		int group_size = 0;
 3812|  22.9k|		while (group_size < 4 && len > 0) {
  ------------------
  |  Branch (3812:10): [True: 21.1k, False: 1.77k]
  |  Branch (3812:28): [True: 21.1k, False: 24]
  ------------------
 3813|       |			/* '=' or '_' padding indicates final group. */
 3814|  21.1k|			if (*src == '=' || *src == '_') {
  ------------------
  |  Branch (3814:8): [True: 37, False: 21.0k]
  |  Branch (3814:23): [True: 18, False: 21.0k]
  ------------------
 3815|     55|				len = 0;
 3816|     55|				break;
 3817|     55|			}
 3818|       |			/* Skip illegal characters (including line breaks) */
 3819|  21.0k|			if (*src > 127 || *src < 32
  ------------------
  |  Branch (3819:8): [True: 4.86k, False: 16.1k]
  |  Branch (3819:22): [True: 5.90k, False: 10.2k]
  ------------------
 3820|  13.8k|			    || decode_table[*src] == 0xff) {
  ------------------
  |  Branch (3820:11): [True: 3.04k, False: 7.23k]
  ------------------
 3821|  13.8k|				len--;
 3822|  13.8k|				src++;
 3823|  13.8k|				continue;
 3824|  13.8k|			}
 3825|  7.23k|			v <<= 6;
 3826|  7.23k|			v |= decode_table[*src++];
 3827|  7.23k|			len --;
 3828|  7.23k|			group_size++;
 3829|  7.23k|		}
 3830|       |		/* Align a short group properly. */
 3831|  1.85k|		v <<= 6 * (4 - group_size);
 3832|       |		/* Unpack the group we just collected. */
 3833|  1.85k|		switch (group_size) {
  ------------------
  |  Branch (3833:11): [True: 1.83k, False: 21]
  ------------------
 3834|  1.77k|		case 4: d[2] = v & 0xff;
  ------------------
  |  Branch (3834:3): [True: 1.77k, False: 79]
  ------------------
 3835|       |			/* FALLTHROUGH */
 3836|  1.79k|		case 3: d[1] = (v >> 8) & 0xff;
  ------------------
  |  Branch (3836:3): [True: 20, False: 1.83k]
  ------------------
 3837|       |			/* FALLTHROUGH */
 3838|  1.82k|		case 2: d[0] = (v >> 16) & 0xff;
  ------------------
  |  Branch (3838:3): [True: 23, False: 1.83k]
  ------------------
 3839|  1.82k|			break;
 3840|     15|		case 1: /* this is invalid! */
  ------------------
  |  Branch (3840:3): [True: 15, False: 1.84k]
  ------------------
 3841|     15|			break;
 3842|  1.85k|		}
 3843|  1.85k|		d += group_size * 3 / 4;
 3844|  1.85k|	}
 3845|       |
 3846|     86|	*out_len = d - out;
 3847|     86|	return (out);
 3848|     86|}
archive_read_support_format_tar.c:pax_attribute_RHT_security_selinux:
 2313|      1|{
 2314|      1|	archive_entry_xattr_add_entry(entry, "security.selinux",
 2315|      1|            value, value_length);
 2316|       |
 2317|      1|	return 0;
 2318|      1|}
archive_read_support_format_tar.c:pax_attribute_SCHILY_acl:
 2323|     38|{
 2324|     38|	int r;
 2325|     38|	const char *p;
 2326|     38|	const char* errstr;
 2327|       |
 2328|     38|	switch (type) {
 2329|      6|	case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
  ------------------
  |  |  534|      6|#define	ARCHIVE_ENTRY_ACL_TYPE_ACCESS	0x00000100  /* POSIX.1e only */
  ------------------
  |  Branch (2329:2): [True: 6, False: 32]
  ------------------
 2330|      6|		errstr = "SCHILY.acl.access";
 2331|      6|		break;
 2332|     22|	case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
  ------------------
  |  |  535|     22|#define	ARCHIVE_ENTRY_ACL_TYPE_DEFAULT	0x00000200  /* POSIX.1e only */
  ------------------
  |  Branch (2332:2): [True: 22, False: 16]
  ------------------
 2333|     22|		errstr = "SCHILY.acl.default";
 2334|     22|		break;
 2335|     10|	case ARCHIVE_ENTRY_ACL_TYPE_NFS4:
  ------------------
  |  |  542|     10|#define	ARCHIVE_ENTRY_ACL_TYPE_NFS4	(ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
  |  |  ------------------
  |  |  |  |  536|     10|#define	ARCHIVE_ENTRY_ACL_TYPE_ALLOW	0x00000400 /* NFS4 only */
  |  |  ------------------
  |  |  543|     10|	    | ARCHIVE_ENTRY_ACL_TYPE_DENY \
  |  |  ------------------
  |  |  |  |  537|     10|#define	ARCHIVE_ENTRY_ACL_TYPE_DENY	0x00000800 /* NFS4 only */
  |  |  ------------------
  |  |  544|     10|	    | ARCHIVE_ENTRY_ACL_TYPE_AUDIT \
  |  |  ------------------
  |  |  |  |  538|     10|#define	ARCHIVE_ENTRY_ACL_TYPE_AUDIT	0x00001000 /* NFS4 only */
  |  |  ------------------
  |  |  545|     10|	    | ARCHIVE_ENTRY_ACL_TYPE_ALARM)
  |  |  ------------------
  |  |  |  |  539|     10|#define	ARCHIVE_ENTRY_ACL_TYPE_ALARM	0x00002000 /* NFS4 only */
  |  |  ------------------
  ------------------
  |  Branch (2335:2): [True: 10, False: 28]
  ------------------
 2336|     10|		errstr = "SCHILY.acl.ace";
 2337|     10|		break;
 2338|      0|	default:
  ------------------
  |  Branch (2338:2): [True: 0, False: 38]
  ------------------
 2339|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2340|      0|		    "Unknown ACL type: %d", type);
 2341|      0|		return(ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2342|     38|	}
 2343|       |
 2344|     38|	if (tar->sconv_acl == NULL) {
  ------------------
  |  Branch (2344:6): [True: 15, False: 23]
  ------------------
 2345|     15|		tar->sconv_acl =
 2346|     15|		    archive_string_conversion_from_charset(
 2347|     15|			&(a->archive), "UTF-8", 1);
 2348|     15|		if (tar->sconv_acl == NULL)
  ------------------
  |  Branch (2348:7): [True: 0, False: 15]
  ------------------
 2349|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2350|     15|	}
 2351|       |
 2352|     38|	if (value_length > acl_limit) {
  ------------------
  |  Branch (2352:6): [True: 0, False: 38]
  ------------------
 2353|      0|		__archive_read_consume(a, value_length);
 2354|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2355|      0|				  "Unreasonably large ACL: %llu > %llu",
 2356|      0|				  (unsigned long long)value_length,
 2357|      0|				  (unsigned long long)acl_limit);
 2358|      0|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 2359|      0|	}
 2360|       |
 2361|     38|	p = __archive_read_ahead(a, value_length, NULL);
 2362|     38|	if (p == NULL) {
  ------------------
  |  Branch (2362:6): [True: 0, False: 38]
  ------------------
 2363|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2364|      0|				  "Truncated tar archive "
 2365|      0|				  "detected while reading ACL data");
 2366|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2367|      0|	}
 2368|       |
 2369|     38|	r = archive_acl_from_text_nl(archive_entry_acl(entry), p, value_length,
 2370|     38|	    type, tar->sconv_acl);
 2371|     38|	__archive_read_consume(a, value_length);
 2372|       |	/* Workaround: Force perm_is_set() to be correct */
 2373|       |	/* If this bit were stored in the ACL, this wouldn't be needed */
 2374|     38|	archive_entry_set_perm(entry, archive_entry_perm(entry));
 2375|     38|	if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|     38|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2375:6): [True: 17, False: 21]
  ------------------
 2376|     17|		if (r == ARCHIVE_FATAL) {
  ------------------
  |  |  239|     17|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (2376:7): [True: 0, False: 17]
  ------------------
 2377|      0|			archive_set_error(&a->archive, ENOMEM,
 2378|      0|			    "%s %s", "Can't allocate memory for",
 2379|      0|			    errstr);
 2380|      0|			return (r);
 2381|      0|		}
 2382|     17|		archive_set_error(&a->archive,
 2383|     17|		    ARCHIVE_ERRNO_MISC, "%s %s", "Parse error:", errstr);
  ------------------
  |  |  204|     17|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2384|     17|	}
 2385|     38|	return (r);
 2386|     38|}
archive_read_support_format_tar.c:pax_attribute_SCHILY_xattr:
 2294|     17|{
 2295|     17|	if (name_length < 1 || name_length > 128) {
  ------------------
  |  Branch (2295:6): [True: 0, False: 17]
  |  Branch (2295:25): [True: 0, False: 17]
  ------------------
 2296|      0|		return 1;
 2297|      0|	}
 2298|       |
 2299|     17|	char * null_terminated_name = malloc(name_length + 1);
 2300|     17|	if (null_terminated_name != NULL) {
  ------------------
  |  Branch (2300:6): [True: 17, False: 0]
  ------------------
 2301|     17|		memcpy(null_terminated_name, name, name_length);
 2302|     17|		null_terminated_name[name_length] = '\0';
 2303|     17|		archive_entry_xattr_add_entry(entry, null_terminated_name, value, value_length);
 2304|     17|		free(null_terminated_name);
 2305|     17|	}
 2306|       |
 2307|     17|	return 0;
 2308|     17|}
archive_read_support_format_tar.c:pax_attribute_SUN_holesdata:
 3520|    386|{
 3521|    386|	const char *e;
 3522|    386|	int64_t start, end;
 3523|    386|	int hole = 1;
 3524|       |
 3525|    386|	(void)entry; /* UNUSED */
 3526|       |
 3527|    386|	end = 0;
 3528|    386|	if (length <= 0)
  ------------------
  |  Branch (3528:6): [True: 1, False: 385]
  ------------------
 3529|      1|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|      1|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 3530|    385|	if (*p == ' ') {
  ------------------
  |  Branch (3530:6): [True: 344, False: 41]
  ------------------
 3531|    344|		p++;
 3532|    344|		length--;
 3533|    344|	} else {
 3534|     41|		return (ARCHIVE_WARN);
  ------------------
  |  |  235|     41|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 3535|     41|	}
 3536|  1.15k|	for (;;) {
 3537|  1.15k|		e = p;
 3538|  5.24k|		while (length > 0 && *e != ' ') {
  ------------------
  |  Branch (3538:10): [True: 5.20k, False: 34]
  |  Branch (3538:24): [True: 4.39k, False: 809]
  ------------------
 3539|  4.39k|			if (*e < '0' || *e > '9')
  ------------------
  |  Branch (3539:8): [True: 51, False: 4.34k]
  |  Branch (3539:20): [True: 259, False: 4.08k]
  ------------------
 3540|    310|				return (ARCHIVE_WARN);
  ------------------
  |  |  235|    310|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 3541|  4.08k|			e++;
 3542|  4.08k|			length--;
 3543|  4.08k|		}
 3544|    843|		start = end;
 3545|    843|		end = tar_atol10(p, e - p);
 3546|    843|		if (end < 0)
  ------------------
  |  Branch (3546:7): [True: 0, False: 843]
  ------------------
 3547|      0|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 3548|    843|		if (start < end) {
  ------------------
  |  Branch (3548:7): [True: 403, False: 440]
  ------------------
 3549|    403|			if (gnu_add_sparse_entry(a, tar, start,
  ------------------
  |  Branch (3549:8): [True: 0, False: 403]
  ------------------
 3550|    403|			    end - start) != ARCHIVE_OK)
  ------------------
  |  |  233|    403|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3551|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3552|    403|			tar->sparse_last->hole = hole;
 3553|    403|		}
 3554|    843|		if (length == 0)
  ------------------
  |  Branch (3554:7): [True: 34, False: 809]
  ------------------
 3555|     34|			return (ARCHIVE_OK);
  ------------------
  |  |  233|     34|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3556|    809|		if (*e == '\n')
  ------------------
  |  Branch (3556:7): [True: 0, False: 809]
  ------------------
 3557|      0|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 3558|    809|		p = e + 1;
 3559|    809|		length--;
 3560|    809|		hole = hole == 0;
 3561|    809|	}
 3562|    344|}
archive_read_support_format_tar.c:set_conversion_failed_error:
 1198|     10|{
 1199|     10|	if (errno == ENOMEM) {
  ------------------
  |  Branch (1199:6): [True: 0, False: 10]
  ------------------
 1200|      0|		archive_set_error(&a->archive, ENOMEM,
 1201|      0|		    "Can't allocate memory for %s", name);
 1202|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1203|      0|	}
 1204|     10|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     10|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1205|     10|	    "%s can't be converted from %s to current locale",
 1206|     10|	    name, archive_string_conversion_charset_name(sconv));
 1207|     10|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|     10|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1208|     10|}
archive_read_support_format_tar.c:header_gnu_longlink:
 1182|    880|{
 1183|    880|	int err;
 1184|       |
 1185|    880|	struct archive_string linkpath;
 1186|    880|	archive_string_init(&linkpath);
  ------------------
  |  |   71|    880|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 880]
  |  |  ------------------
  ------------------
 1187|    880|	err = read_body_to_string(a, tar, &linkpath, h, unconsumed);
 1188|    880|	if (err == ARCHIVE_OK) {
  ------------------
  |  |  233|    880|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1188:6): [True: 876, False: 4]
  ------------------
 1189|    876|		archive_entry_set_link(entry, linkpath.s);
 1190|    876|	}
 1191|    880|	archive_string_free(&linkpath);
 1192|    880|	return (err);
 1193|    880|}
archive_read_support_format_tar.c:header_gnu_longname:
 1216|    515|{
 1217|    515|	int err;
 1218|    515|	struct archive_string longname;
 1219|       |
 1220|    515|	archive_string_init(&longname);
  ------------------
  |  |   71|    515|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 515]
  |  |  ------------------
  ------------------
 1221|    515|	err = read_body_to_string(a, tar, &longname, h, unconsumed);
 1222|    515|	if (err == ARCHIVE_OK) {
  ------------------
  |  |  233|    515|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1222:6): [True: 513, False: 2]
  ------------------
 1223|    513|		if (archive_entry_copy_pathname_l(entry, longname.s,
  ------------------
  |  |   80|    513|#define archive_entry_copy_pathname_l	__archive_entry_copy_pathname_l
  ------------------
  |  Branch (1223:7): [True: 0, False: 513]
  ------------------
 1224|    513|		    archive_strlen(&longname), tar->sconv) != 0)
  ------------------
  |  |  178|    513|#define	archive_strlen(a) ((a)->length)
  ------------------
 1225|      0|			err = set_conversion_failed_error(a, tar->sconv, "Pathname");
 1226|    513|	}
 1227|    515|	archive_string_free(&longname);
 1228|    515|	return (err);
 1229|    515|}
archive_read_support_format_tar.c:header_volume:
 1237|    144|{
 1238|    144|	const struct archive_entry_header_ustar *header;
 1239|    144|	int64_t size, to_consume;
 1240|       |
 1241|    144|	(void)a; /* UNUSED */
 1242|    144|	(void)tar; /* UNUSED */
 1243|    144|	(void)entry; /* UNUSED */
 1244|       |
 1245|    144|	header = (const struct archive_entry_header_ustar *)h;
 1246|    144|	size = tar_atol(header->size, sizeof(header->size));
 1247|    144|	if (size < 0 || size > (int64_t)pathname_limit) {
  ------------------
  |  Branch (1247:6): [True: 3, False: 141]
  |  Branch (1247:18): [True: 1, False: 140]
  ------------------
 1248|      4|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1249|      4|	}
 1250|    140|	to_consume = ((size + 511) & ~511);
 1251|    140|	*unconsumed += to_consume;
 1252|    140|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    140|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1253|    144|}
archive_read_support_format_tar.c:header_pax_extension:
 1844|    865|{
 1845|    865|	return (header_pax_records(a, tar, entry, h, unconsumed, 0));
 1846|    865|}
archive_read_support_format_tar.c:header_gnutar:
 3131|    755|{
 3132|    755|	struct archive_entry_header_gnutar header_copy;
 3133|    755|	const struct archive_entry_header_gnutar *header;
 3134|    755|	int64_t t;
 3135|    755|	int err = ARCHIVE_OK;
  ------------------
  |  |  233|    755|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3136|       |
 3137|       |	/*
 3138|       |	 * GNU header is like POSIX ustar, except 'prefix' is
 3139|       |	 * replaced with some other fields. This also means the
 3140|       |	 * filename is stored as in old-style archives.
 3141|       |	 */
 3142|       |
 3143|       |	/*
 3144|       |	 * Sparse extension reads can reuse the callback buffer containing h,
 3145|       |	 * so preserve the main header until common fields are parsed.
 3146|       |	 */
 3147|    755|	memcpy(&header_copy, h, sizeof(header_copy));
 3148|    755|	header = &header_copy;
 3149|       |
 3150|       |	/* Copy filename over (to ensure null termination). */
 3151|    755|	const char *existing_pathname = archive_entry_pathname(entry);
 3152|    755|	const wchar_t *existing_wcs_pathname = archive_entry_pathname_w(entry);
 3153|    755|	if ((existing_pathname == NULL || existing_pathname[0] == '\0')
  ------------------
  |  Branch (3153:7): [True: 753, False: 2]
  |  Branch (3153:36): [True: 1, False: 1]
  ------------------
 3154|    754|	    && (existing_wcs_pathname == NULL || existing_wcs_pathname[0] == L'\0')) {
  ------------------
  |  Branch (3154:10): [True: 753, False: 1]
  |  Branch (3154:43): [True: 1, False: 0]
  ------------------
 3155|    754|		if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|    754|#define archive_entry_copy_pathname_l	__archive_entry_copy_pathname_l
  ------------------
  |  Branch (3155:7): [True: 0, False: 754]
  ------------------
 3156|    754|		    header->name, sizeof(header->name), tar->sconv) != 0) {
 3157|      0|			err = set_conversion_failed_error(a, tar->sconv, "Pathname");
 3158|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (3158:8): [True: 0, False: 0]
  ------------------
 3159|      0|				return (err);
 3160|      0|		}
 3161|    754|	}
 3162|       |
 3163|       |	/* Fields common to ustar and GNU */
 3164|       |	/* XXX Can the following be factored out since it's common
 3165|       |	 * to ustar and gnu tar?  Is it okay to move it down into
 3166|       |	 * header_common, perhaps?  */
 3167|    755|	const char *existing_uname = archive_entry_uname(entry);
 3168|    755|	if (existing_uname == NULL || existing_uname[0] == '\0') {
  ------------------
  |  Branch (3168:6): [True: 755, False: 0]
  |  Branch (3168:32): [True: 0, False: 0]
  ------------------
 3169|    755|		if (archive_entry_copy_uname_l(entry,
  ------------------
  |  |   86|    755|#define archive_entry_copy_uname_l	__archive_entry_copy_uname_l
  ------------------
  |  Branch (3169:7): [True: 0, False: 755]
  ------------------
 3170|    755|		    header->uname, sizeof(header->uname), tar->sconv) != 0) {
 3171|      0|			err = set_conversion_failed_error(a, tar->sconv, "Uname");
 3172|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (3172:8): [True: 0, False: 0]
  ------------------
 3173|      0|				return (err);
 3174|      0|		}
 3175|    755|	}
 3176|       |
 3177|    755|	const char *existing_gname = archive_entry_gname(entry);
 3178|    755|	if (existing_gname == NULL || existing_gname[0] == '\0') {
  ------------------
  |  Branch (3178:6): [True: 755, False: 0]
  |  Branch (3178:32): [True: 0, False: 0]
  ------------------
 3179|    755|		if (archive_entry_copy_gname_l(entry,
  ------------------
  |  |   71|    755|#define archive_entry_copy_gname_l	__archive_entry_copy_gname_l
  ------------------
  |  Branch (3179:7): [True: 0, False: 755]
  ------------------
 3180|    755|		    header->gname, sizeof(header->gname), tar->sconv) != 0) {
 3181|      0|			err = set_conversion_failed_error(a, tar->sconv, "Gname");
 3182|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (3182:8): [True: 0, False: 0]
  ------------------
 3183|      0|				return (err);
 3184|      0|		}
 3185|    755|	}
 3186|       |
 3187|       |	/* Parse out device numbers only for char and block specials */
 3188|    755|	if (header->typeflag[0] == '3' || header->typeflag[0] == '4') {
  ------------------
  |  Branch (3188:6): [True: 1, False: 754]
  |  Branch (3188:36): [True: 200, False: 554]
  ------------------
 3189|    201|		if (!archive_entry_rdev_is_set(entry)) {
  ------------------
  |  Branch (3189:7): [True: 201, False: 0]
  ------------------
 3190|    201|			archive_entry_set_rdevmajor(entry, (dev_t)
 3191|    201|			    tar_atol(header->rdevmajor, sizeof(header->rdevmajor)));
 3192|    201|			archive_entry_set_rdevminor(entry, (dev_t)
 3193|    201|			    tar_atol(header->rdevminor, sizeof(header->rdevminor)));
 3194|    201|		}
 3195|    554|	} else {
 3196|    554|		archive_entry_set_rdev(entry, 0);
 3197|    554|	}
 3198|       |
 3199|       |	/* Grab GNU-specific fields. */
 3200|    755|	if (!archive_entry_atime_is_set(entry)) {
  ------------------
  |  Branch (3200:6): [True: 755, False: 0]
  ------------------
 3201|    755|		t = tar_atol(header->atime, sizeof(header->atime));
 3202|    755|		if (t > 0)
  ------------------
  |  Branch (3202:7): [True: 272, False: 483]
  ------------------
 3203|    272|			archive_entry_set_atime(entry, t, 0);
 3204|    755|	}
 3205|    755|	if (!archive_entry_ctime_is_set(entry)) {
  ------------------
  |  Branch (3205:6): [True: 755, False: 0]
  ------------------
 3206|    755|		t = tar_atol(header->ctime, sizeof(header->ctime));
 3207|    755|		if (t > 0)
  ------------------
  |  Branch (3207:7): [True: 252, False: 503]
  ------------------
 3208|    252|			archive_entry_set_ctime(entry, t, 0);
 3209|    755|	}
 3210|       |
 3211|    755|	if (header->realsize[0] != 0) {
  ------------------
  |  Branch (3211:6): [True: 487, False: 268]
  ------------------
 3212|       |		/* Treat as a synonym for the pax GNU.sparse.realsize attr */
 3213|    487|		tar->GNU_sparse_realsize
 3214|    487|		    = tar_atol(header->realsize, sizeof(header->realsize));
 3215|    487|		tar->size_fields |= TAR_SIZE_GNU_SPARSE_REALSIZE;
  ------------------
  |  |  163|    487|#define TAR_SIZE_GNU_SPARSE_REALSIZE 2
  ------------------
 3216|    487|	}
 3217|       |
 3218|    755|	if (header->sparse[0].offset[0] != 0) {
  ------------------
  |  Branch (3218:6): [True: 139, False: 616]
  ------------------
 3219|    139|		if (gnu_sparse_old_read(a, tar, header, unconsumed)
  ------------------
  |  Branch (3219:7): [True: 69, False: 70]
  ------------------
 3220|    139|		    != ARCHIVE_OK)
  ------------------
  |  |  233|    139|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3221|     69|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     69|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3222|    616|	} else {
 3223|    616|		if (header->isextended[0] != 0) {
  ------------------
  |  Branch (3223:7): [True: 10, False: 606]
  ------------------
 3224|       |			/* XXX WTF? XXX */
 3225|     10|		}
 3226|    616|	}
 3227|       |
 3228|       |	/* Grab fields common to all tar variants. */
 3229|    686|	err = header_common(a, tar, entry, header);
 3230|    686|	if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|    686|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (3230:6): [True: 4, False: 682]
  ------------------
 3231|      4|		return (err);
 3232|       |
 3233|    682|	tar->entry_padding = 0x1ff & (-tar->entry_bytes_remaining);
 3234|       |
 3235|    682|	return (err);
 3236|    686|}
archive_read_support_format_tar.c:gnu_sparse_old_read:
 3293|    139|{
 3294|    139|	const void *data;
 3295|    139|	struct extended {
 3296|    139|		struct gnu_sparse sparse[21];
 3297|    139|		char	isextended[1];
 3298|    139|		char	padding[7];
 3299|    139|	};
 3300|    139|	const struct extended *ext;
 3301|       |
 3302|    139|	if (gnu_sparse_old_parse(a, tar, header->sparse, 4) != ARCHIVE_OK)
  ------------------
  |  |  233|    139|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3302:6): [True: 22, False: 117]
  ------------------
 3303|     22|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     22|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3304|    117|	if (header->isextended[0] == 0)
  ------------------
  |  Branch (3304:6): [True: 31, False: 86]
  ------------------
 3305|     31|		return (ARCHIVE_OK);
  ------------------
  |  |  233|     31|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3306|       |
 3307|  1.87k|	do {
 3308|  1.87k|		if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.87k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3308:7): [True: 0, False: 1.87k]
  ------------------
 3309|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3310|      0|		}
 3311|  1.87k|		data = __archive_read_ahead(a, 512, NULL);
 3312|  1.87k|		if (data == NULL) {
  ------------------
  |  Branch (3312:7): [True: 30, False: 1.84k]
  ------------------
 3313|     30|			archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     30|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3314|     30|			    "Truncated tar archive "
 3315|     30|			    "detected while reading sparse file data");
 3316|     30|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     30|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3317|     30|		}
 3318|  1.84k|		*unconsumed = 512;
 3319|  1.84k|		ext = (const struct extended *)data;
 3320|  1.84k|		if (gnu_sparse_old_parse(a, tar, ext->sparse, 21) != ARCHIVE_OK)
  ------------------
  |  |  233|  1.84k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3320:7): [True: 17, False: 1.82k]
  ------------------
 3321|     17|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     17|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3322|  1.84k|	} while (ext->isextended[0] != 0);
  ------------------
  |  Branch (3322:11): [True: 1.78k, False: 39]
  ------------------
 3323|     39|	if (tar->sparse_list != NULL)
  ------------------
  |  Branch (3323:6): [True: 34, False: 5]
  ------------------
 3324|     34|		tar->entry_offset = tar->sparse_list->offset;
 3325|     39|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     39|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3326|     86|}
archive_read_support_format_tar.c:gnu_sparse_old_parse:
 3331|  1.97k|{
 3332|  39.3k|	while (length > 0 && sparse->offset[0] != 0) {
  ------------------
  |  Branch (3332:9): [True: 37.5k, False: 1.79k]
  |  Branch (3332:23): [True: 37.4k, False: 144]
  ------------------
 3333|  37.4k|		if (gnu_add_sparse_entry(a, tar,
  ------------------
  |  Branch (3333:7): [True: 39, False: 37.3k]
  ------------------
 3334|  37.4k|		    tar_atol(sparse->offset, sizeof(sparse->offset)),
 3335|  37.4k|		    tar_atol(sparse->numbytes, sizeof(sparse->numbytes)))
 3336|  37.4k|		    != ARCHIVE_OK)
  ------------------
  |  |  233|  37.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3337|     39|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     39|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3338|  37.3k|		sparse++;
 3339|  37.3k|		length--;
 3340|  37.3k|	}
 3341|  1.94k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.94k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3342|  1.97k|}
archive_read_support_format_tar.c:header_common:
 1346|   282k|{
 1347|   282k|	const struct archive_entry_header_ustar	*header;
 1348|   282k|	const char *existing_linkpath;
 1349|   282k|	const wchar_t *existing_wcs_linkpath;
 1350|   282k|	mode_t header_mode;
 1351|   282k|	int     err = ARCHIVE_OK;
  ------------------
  |  |  233|   282k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1352|       |
 1353|   282k|	header = (const struct archive_entry_header_ustar *)h;
 1354|       |
 1355|       |	/* Parse out the numeric fields (all are octal) */
 1356|       |
 1357|       |	/* Split mode handling: Set filetype always, perm only if not already set */
 1358|   282k|	header_mode = (mode_t)tar_atol(header->mode, sizeof(header->mode));
 1359|   282k|	archive_entry_set_filetype(entry, header_mode);
 1360|   282k|	if (!archive_entry_perm_is_set(entry))
  ------------------
  |  Branch (1360:6): [True: 281k, False: 147]
  ------------------
 1361|   281k|		archive_entry_set_perm(entry, header_mode);
 1362|       |
 1363|       |	/* Set uid, gid, mtime if not already set */
 1364|   282k|	if (!archive_entry_uid_is_set(entry)) {
  ------------------
  |  Branch (1364:6): [True: 282k, False: 1]
  ------------------
 1365|   282k|		archive_entry_set_uid(entry, tar_atol(header->uid, sizeof(header->uid)));
 1366|   282k|	}
 1367|   282k|	if (!archive_entry_gid_is_set(entry)) {
  ------------------
  |  Branch (1367:6): [True: 282k, False: 1]
  ------------------
 1368|   282k|		archive_entry_set_gid(entry, tar_atol(header->gid, sizeof(header->gid)));
 1369|   282k|	}
 1370|   282k|	if (!archive_entry_mtime_is_set(entry)) {
  ------------------
  |  Branch (1370:6): [True: 282k, False: 15]
  ------------------
 1371|   282k|		int64_t t64 = tar_atol(header->mtime, sizeof(header->mtime));
 1372|   282k|		time_t t = (time_t)t64;
 1373|   282k|		if ((int64_t)t != t64) { /* time_t overflowed */
  ------------------
  |  Branch (1373:7): [True: 0, False: 282k]
  ------------------
 1374|      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 */)
  ------------------
 1375|      0|		}
 1376|   282k|		archive_entry_set_mtime(entry, t, 0);
 1377|   282k|	}
 1378|       |
 1379|       |	/* Reconcile the size info. */
 1380|       |	/* First, how big is the file on disk? */
 1381|   282k|	if ((tar->size_fields & TAR_SIZE_GNU_SPARSE_REALSIZE) != 0) {
  ------------------
  |  |  163|   282k|#define TAR_SIZE_GNU_SPARSE_REALSIZE 2
  ------------------
  |  Branch (1381:6): [True: 424, False: 281k]
  ------------------
 1382|       |		/* GNU sparse format 1.0 uses `GNU.sparse.realsize`
 1383|       |		 * to hold the size of the file on disk. */
 1384|    424|		tar->disk_size = tar->GNU_sparse_realsize;
 1385|   281k|	} else if ((tar->size_fields & TAR_SIZE_GNU_SPARSE_SIZE) != 0
  ------------------
  |  |  164|   281k|#define TAR_SIZE_GNU_SPARSE_SIZE 4
  ------------------
  |  Branch (1385:13): [True: 2, False: 281k]
  ------------------
 1386|      2|		   && (tar->sparse_gnu_major == 0)) {
  ------------------
  |  Branch (1386:9): [True: 2, False: 0]
  ------------------
 1387|       |		/* GNU sparse format 0.0 and 0.1 use `GNU.sparse.size`
 1388|       |		 * to hold the size of the file on disk. */
 1389|      2|		tar->disk_size = tar->GNU_sparse_size;
 1390|   281k|	} else if ((tar->size_fields & TAR_SIZE_SCHILY_SPARSE_REALSIZE) != 0) {
  ------------------
  |  |  165|   281k|#define TAR_SIZE_SCHILY_SPARSE_REALSIZE 8
  ------------------
  |  Branch (1390:13): [True: 20, False: 281k]
  ------------------
 1391|     20|		tar->disk_size = tar->SCHILY_sparse_realsize;
 1392|   281k|	} else if ((tar->size_fields & TAR_SIZE_PAX_SIZE) != 0) {
  ------------------
  |  |  162|   281k|#define TAR_SIZE_PAX_SIZE 1
  ------------------
  |  Branch (1392:13): [True: 2, False: 281k]
  ------------------
 1393|      2|		tar->disk_size = tar->pax_size;
 1394|   281k|	} else {
 1395|       |		/* There wasn't a suitable pax header, so use the ustar info */
 1396|   281k|		tar->disk_size = tar_atol(header->size, sizeof(header->size));
 1397|   281k|	}
 1398|       |
 1399|   282k|	if (tar->disk_size < 0) {
  ------------------
  |  Branch (1399:6): [True: 43, False: 282k]
  ------------------
 1400|     43|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     43|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1401|     43|				  "Tar entry has negative file size");
 1402|     43|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     43|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1403|   282k|	} else if (tar->disk_size > entry_limit) {
  ------------------
  |  Branch (1403:13): [True: 12, False: 282k]
  ------------------
 1404|     12|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     12|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1405|     12|				  "Tar entry size overflow");
 1406|     12|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1407|   282k|	} else {
 1408|   282k|		archive_entry_set_size(entry, tar->disk_size);
 1409|   282k|	}
 1410|       |
 1411|       |	/* Second, how big is the data in the archive? */
 1412|   282k|	if ((tar->size_fields & TAR_SIZE_GNU_SPARSE_SIZE) != 0
  ------------------
  |  |  164|   282k|#define TAR_SIZE_GNU_SPARSE_SIZE 4
  ------------------
  |  Branch (1412:6): [True: 2, False: 282k]
  ------------------
 1413|      2|	    && (tar->sparse_gnu_major == 1)) {
  ------------------
  |  Branch (1413:9): [True: 0, False: 2]
  ------------------
 1414|       |		/* GNU sparse format 1.0 uses `GNU.sparse.size`
 1415|       |		 * to hold the size of the data in the archive. */
 1416|      0|		tar->entry_bytes_remaining = tar->GNU_sparse_size;
 1417|   282k|	} else if ((tar->size_fields & TAR_SIZE_PAX_SIZE) != 0) {
  ------------------
  |  |  162|   282k|#define TAR_SIZE_PAX_SIZE 1
  ------------------
  |  Branch (1417:13): [True: 2, False: 282k]
  ------------------
 1418|      2|		tar->entry_bytes_remaining = tar->pax_size;
 1419|   282k|	} else {
 1420|   282k|		tar->entry_bytes_remaining
 1421|   282k|			= tar_atol(header->size, sizeof(header->size));
 1422|   282k|	}
 1423|   282k|	if (tar->entry_bytes_remaining < 0) {
  ------------------
  |  Branch (1423:6): [True: 2, False: 282k]
  ------------------
 1424|      2|		tar->entry_bytes_remaining = 0;
 1425|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1426|      2|				  "Tar entry has negative size");
 1427|      2|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1428|   282k|	} else if (tar->entry_bytes_remaining > entry_limit) {
  ------------------
  |  Branch (1428:13): [True: 1, False: 282k]
  ------------------
 1429|      1|		tar->entry_bytes_remaining = 0;
 1430|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1431|      1|				  "Tar entry size overflow");
 1432|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1433|      1|	}
 1434|       |
 1435|       |	/* Handle the tar type flag appropriately. */
 1436|   282k|	tar->filetype = header->typeflag[0];
 1437|       |
 1438|       |	/*
 1439|       |	 * TODO: If the linkpath came from Pax extension header, then
 1440|       |	 * we should obey the hdrcharset_utf8 flag when converting these.
 1441|       |	 */
 1442|   282k|	switch (tar->filetype) {
 1443|  2.84k|	case '1': /* Hard link */
  ------------------
  |  Branch (1443:2): [True: 2.84k, False: 279k]
  ------------------
 1444|  2.84k|		archive_entry_set_link_to_hardlink(entry);
 1445|  2.84k|		existing_wcs_linkpath = archive_entry_hardlink_w(entry);
 1446|  2.84k|		existing_linkpath = archive_entry_hardlink(entry);
 1447|  2.84k|		if ((existing_linkpath == NULL || existing_linkpath[0] == '\0')
  ------------------
  |  Branch (1447:8): [True: 2.80k, False: 36]
  |  Branch (1447:37): [True: 20, False: 16]
  ------------------
 1448|  2.82k|		    && (existing_wcs_linkpath == NULL || existing_wcs_linkpath[0] == '\0')) {
  ------------------
  |  Branch (1448:11): [True: 2.80k, False: 20]
  |  Branch (1448:44): [True: 20, False: 0]
  ------------------
 1449|  2.82k|			struct archive_string linkpath;
 1450|  2.82k|			archive_string_init(&linkpath);
  ------------------
  |  |   71|  2.82k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 2.82k]
  |  |  ------------------
  ------------------
 1451|  2.82k|			archive_strncpy(&linkpath,
  ------------------
  |  |  173|  2.82k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1452|  2.82k|					header->linkname, sizeof(header->linkname));
 1453|  2.82k|			if (archive_entry_copy_hardlink_l(entry, linkpath.s,
  ------------------
  |  |   74|  2.82k|#define archive_entry_copy_hardlink_l	__archive_entry_copy_hardlink_l
  ------------------
  |  Branch (1453:8): [True: 0, False: 2.82k]
  ------------------
 1454|  2.82k|							  archive_strlen(&linkpath), tar->sconv) != 0) {
  ------------------
  |  |  178|  2.82k|#define	archive_strlen(a) ((a)->length)
  ------------------
 1455|      0|				err = set_conversion_failed_error(a, tar->sconv,
 1456|      0|								  "Linkname");
 1457|      0|				if (err == ARCHIVE_FATAL) {
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1457:9): [True: 0, False: 0]
  ------------------
 1458|      0|					archive_string_free(&linkpath);
 1459|      0|					return (err);
 1460|      0|				}
 1461|      0|			}
 1462|  2.82k|			archive_string_free(&linkpath);
 1463|  2.82k|		}
 1464|       |		/*
 1465|       |		 * The following may seem odd, but: Technically, tar
 1466|       |		 * does not store the file type for a "hard link"
 1467|       |		 * entry, only the fact that it is a hard link.  So, I
 1468|       |		 * leave the type zero normally.  But, pax interchange
 1469|       |		 * format allows hard links to have data, which
 1470|       |		 * implies that the underlying entry is a regular
 1471|       |		 * file.
 1472|       |		 */
 1473|  2.84k|		if (archive_entry_size(entry) > 0)
  ------------------
  |  Branch (1473:7): [True: 2.52k, False: 314]
  ------------------
 1474|  2.52k|			archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  2.52k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1475|       |
 1476|       |		/*
 1477|       |		 * A tricky point: Traditionally, tar readers have
 1478|       |		 * ignored the size field when reading hardlink
 1479|       |		 * entries, and some writers put non-zero sizes even
 1480|       |		 * though the body is empty.  POSIX blessed this
 1481|       |		 * convention in the 1988 standard, but broke with
 1482|       |		 * this tradition in 2001 by permitting hardlink
 1483|       |		 * entries to store valid bodies in pax interchange
 1484|       |		 * format, but not in ustar format.  Since there is no
 1485|       |		 * hard and fast way to distinguish pax interchange
 1486|       |		 * from earlier archives (the 'x' and 'g' entries are
 1487|       |		 * optional, after all), we need a heuristic.
 1488|       |		 */
 1489|  2.84k|		if (archive_entry_size(entry) == 0) {
  ------------------
  |  Branch (1489:7): [True: 314, False: 2.52k]
  ------------------
 1490|       |			/* If the size is already zero, we're done. */
 1491|  2.52k|		}  else if (a->archive.archive_format
  ------------------
  |  Branch (1491:15): [True: 17, False: 2.51k]
  ------------------
 1492|  2.52k|		    == ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE) {
  ------------------
  |  |  369|  2.52k|#define	ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE	(ARCHIVE_FORMAT_TAR | 2)
  |  |  ------------------
  |  |  |  |  367|  2.52k|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
 1493|       |			/* Definitely pax extended; must obey hardlink size. */
 1494|  2.51k|		} else if (a->archive.archive_format == ARCHIVE_FORMAT_TAR
  ------------------
  |  |  367|  5.02k|#define	ARCHIVE_FORMAT_TAR			0x30000
  ------------------
  |  Branch (1494:14): [True: 496, False: 2.01k]
  ------------------
 1495|  2.01k|		    || a->archive.archive_format == ARCHIVE_FORMAT_TAR_GNUTAR)
  ------------------
  |  |  371|  2.01k|#define	ARCHIVE_FORMAT_TAR_GNUTAR		(ARCHIVE_FORMAT_TAR | 4)
  |  |  ------------------
  |  |  |  |  367|  2.01k|#define	ARCHIVE_FORMAT_TAR			0x30000
  |  |  ------------------
  ------------------
  |  Branch (1495:10): [True: 40, False: 1.97k]
  ------------------
 1496|    536|		{
 1497|       |			/* Old-style or GNU tar: we must ignore the size. */
 1498|    536|			archive_entry_set_size(entry, 0);
 1499|    536|			tar->entry_bytes_remaining = 0;
 1500|  1.97k|		} else if (archive_read_format_tar_bid(a, 50) > 50) {
  ------------------
  |  Branch (1500:14): [True: 6, False: 1.96k]
  ------------------
 1501|       |			/*
 1502|       |			 * We don't know if it's pax: If the bid
 1503|       |			 * function sees a valid ustar header
 1504|       |			 * immediately following, then let's ignore
 1505|       |			 * the hardlink size.
 1506|       |			 */
 1507|      6|			archive_entry_set_size(entry, 0);
 1508|      6|			tar->entry_bytes_remaining = 0;
 1509|      6|		}
 1510|       |		/*
 1511|       |		 * TODO: There are still two cases I'd like to handle:
 1512|       |		 *   = a ustar non-pax archive with a hardlink entry at
 1513|       |		 *     end-of-archive.  (Look for block of nulls following?)
 1514|       |		 *   = a pax archive that has not seen any pax headers
 1515|       |		 *     and has an entry which is a hardlink entry storing
 1516|       |		 *     a body containing an uncompressed tar archive.
 1517|       |		 * The first is worth addressing; I don't see any reliable
 1518|       |		 * way to deal with the second possibility.
 1519|       |		 */
 1520|  2.84k|		break;
 1521|    236|	case '2': /* Symlink */
  ------------------
  |  Branch (1521:2): [True: 236, False: 281k]
  ------------------
 1522|    236|		archive_entry_set_link_to_symlink(entry);
 1523|    236|		existing_wcs_linkpath = archive_entry_symlink_w(entry);
 1524|    236|		existing_linkpath = archive_entry_symlink(entry);
 1525|    236|		if ((existing_linkpath == NULL || existing_linkpath[0] == '\0')
  ------------------
  |  Branch (1525:8): [True: 194, False: 42]
  |  Branch (1525:37): [True: 21, False: 21]
  ------------------
 1526|    215|		    && (existing_wcs_linkpath == NULL || existing_wcs_linkpath[0] == '\0')) {
  ------------------
  |  Branch (1526:11): [True: 194, False: 21]
  |  Branch (1526:44): [True: 21, False: 0]
  ------------------
 1527|    215|			struct archive_string linkpath;
 1528|    215|			archive_string_init(&linkpath);
  ------------------
  |  |   71|    215|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 215]
  |  |  ------------------
  ------------------
 1529|    215|			archive_strncpy(&linkpath,
  ------------------
  |  |  173|    215|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1530|    215|					header->linkname, sizeof(header->linkname));
 1531|    215|			if (archive_entry_copy_symlink_l(entry, linkpath.s,
  ------------------
  |  |   83|    215|#define archive_entry_copy_symlink_l	__archive_entry_copy_symlink_l
  ------------------
  |  Branch (1531:8): [True: 0, False: 215]
  ------------------
 1532|    215|			    archive_strlen(&linkpath), tar->sconv) != 0) {
  ------------------
  |  |  178|    215|#define	archive_strlen(a) ((a)->length)
  ------------------
 1533|      0|				err = set_conversion_failed_error(a, tar->sconv,
 1534|      0|				    "Linkname");
 1535|      0|				if (err == ARCHIVE_FATAL) {
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1535:9): [True: 0, False: 0]
  ------------------
 1536|      0|					archive_string_free(&linkpath);
 1537|      0|					return (err);
 1538|      0|				}
 1539|      0|			}
 1540|    215|			archive_string_free(&linkpath);
 1541|    215|		}
 1542|    236|		archive_entry_set_filetype(entry, AE_IFLNK);
  ------------------
  |  |  217|    236|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
 1543|    236|		archive_entry_set_size(entry, 0);
 1544|    236|		tar->entry_bytes_remaining = 0;
 1545|    236|		break;
 1546|    381|	case '3': /* Character device */
  ------------------
  |  Branch (1546:2): [True: 381, False: 281k]
  ------------------
 1547|    381|		archive_entry_set_filetype(entry, AE_IFCHR);
  ------------------
  |  |  219|    381|#define AE_IFCHR	((__LA_MODE_T)0020000)
  ------------------
 1548|    381|		archive_entry_set_size(entry, 0);
 1549|    381|		tar->entry_bytes_remaining = 0;
 1550|    381|		break;
 1551|    743|	case '4': /* Block device */
  ------------------
  |  Branch (1551:2): [True: 743, False: 281k]
  ------------------
 1552|    743|		archive_entry_set_filetype(entry, AE_IFBLK);
  ------------------
  |  |  220|    743|#define AE_IFBLK	((__LA_MODE_T)0060000)
  ------------------
 1553|    743|		archive_entry_set_size(entry, 0);
 1554|    743|		tar->entry_bytes_remaining = 0;
 1555|    743|		break;
 1556|    107|	case '5': /* Dir */
  ------------------
  |  Branch (1556:2): [True: 107, False: 281k]
  ------------------
 1557|    107|		archive_entry_set_filetype(entry, AE_IFDIR);
  ------------------
  |  |  221|    107|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1558|    107|		archive_entry_set_size(entry, 0);
 1559|    107|		tar->entry_bytes_remaining = 0;
 1560|    107|		break;
 1561|    417|	case '6': /* FIFO device */
  ------------------
  |  Branch (1561:2): [True: 417, False: 281k]
  ------------------
 1562|    417|		archive_entry_set_filetype(entry, AE_IFIFO);
  ------------------
  |  |  222|    417|#define AE_IFIFO	((__LA_MODE_T)0010000)
  ------------------
 1563|    417|		archive_entry_set_size(entry, 0);
 1564|    417|		tar->entry_bytes_remaining = 0;
 1565|    417|		break;
 1566|    204|	case 'D': /* GNU incremental directory type */
  ------------------
  |  Branch (1566:2): [True: 204, False: 281k]
  ------------------
 1567|       |		/*
 1568|       |		 * No special handling is actually required here.
 1569|       |		 * It might be nice someday to preprocess the file list and
 1570|       |		 * provide it to the client, though.
 1571|       |		 */
 1572|    204|		archive_entry_set_filetype(entry, AE_IFDIR);
  ------------------
  |  |  221|    204|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1573|    204|		break;
 1574|    254|	case 'M': /* GNU "Multi-volume" (remainder of file from last archive)*/
  ------------------
  |  Branch (1574:2): [True: 254, False: 281k]
  ------------------
 1575|       |		/*
 1576|       |		 * As far as I can tell, this is just like a regular file
 1577|       |		 * entry, except that the contents should be _appended_ to
 1578|       |		 * the indicated file at the indicated offset.  This may
 1579|       |		 * require some API work to fully support.
 1580|       |		 */
 1581|    254|		break;
 1582|     91|	case 'N': /* Old GNU "long filename" entry. */
  ------------------
  |  Branch (1582:2): [True: 91, False: 281k]
  ------------------
 1583|       |		/* The body of this entry is a script for renaming
 1584|       |		 * previously-extracted entries.  Ugh.  It will never
 1585|       |		 * be supported by libarchive. */
 1586|     91|		archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|     91|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1587|     91|		break;
 1588|      2|	case 'S': /* GNU sparse files */
  ------------------
  |  Branch (1588:2): [True: 2, False: 282k]
  ------------------
 1589|       |		/*
 1590|       |		 * Sparse files are really just regular files with
 1591|       |		 * sparse information in the extended area.
 1592|       |		 */
 1593|       |		/* FALLTHROUGH */
 1594|   256k|	case '0': /* ustar "regular" file */
  ------------------
  |  Branch (1594:2): [True: 256k, False: 25.0k]
  ------------------
 1595|       |		/* FALLTHROUGH */
 1596|   276k|	default: /* Non-standard file types */
  ------------------
  |  Branch (1596:2): [True: 19.7k, False: 262k]
  ------------------
 1597|       |		/*
 1598|       |		 * Per POSIX: non-recognized types should always be
 1599|       |		 * treated as regular files.
 1600|       |		 */
 1601|   276k|		archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|   276k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1602|   276k|		break;
 1603|   282k|	}
 1604|   282k|	return (err);
 1605|   282k|}
archive_read_support_format_tar.c:header_ustar:
 1859|  2.52k|{
 1860|  2.52k|	const struct archive_entry_header_ustar	*header;
 1861|  2.52k|	int err = ARCHIVE_OK, r;
  ------------------
  |  |  233|  2.52k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1862|       |
 1863|  2.52k|	header = (const struct archive_entry_header_ustar *)h;
 1864|       |
 1865|       |	/*
 1866|       |	 * The name field is fixed-width and may not be NUL-terminated.
 1867|       |	 * Use a temporary string only when prefix/name joining is required.
 1868|       |	 */
 1869|  2.52k|	const char *existing_pathname = archive_entry_pathname(entry);
 1870|  2.52k|	const wchar_t *existing_wcs_pathname = archive_entry_pathname_w(entry);
 1871|  2.52k|	if ((existing_pathname == NULL || existing_pathname[0] == '\0')
  ------------------
  |  Branch (1871:7): [True: 2.50k, False: 24]
  |  Branch (1871:36): [True: 12, False: 12]
  ------------------
 1872|  2.51k|	    && (existing_wcs_pathname == NULL || existing_wcs_pathname[0] == '\0')) {
  ------------------
  |  Branch (1872:10): [True: 2.50k, False: 12]
  |  Branch (1872:43): [True: 12, False: 0]
  ------------------
 1873|  2.51k|		struct archive_string as;
 1874|  2.51k|		const char *pathname;
 1875|  2.51k|		size_t pathname_length;
 1876|       |
 1877|  2.51k|		archive_string_init(&as);
  ------------------
  |  |   71|  2.51k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 2.51k]
  |  |  ------------------
  ------------------
 1878|  2.51k|		if (header->prefix[0]) {
  ------------------
  |  Branch (1878:7): [True: 2.27k, False: 242]
  ------------------
 1879|  2.27k|			archive_strncpy(&as, header->prefix, sizeof(header->prefix));
  ------------------
  |  |  173|  2.27k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 1880|  2.27k|			if (as.s[archive_strlen(&as) - 1] != '/')
  ------------------
  |  |  178|  2.27k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1880:8): [True: 2.25k, False: 18]
  ------------------
 1881|  2.25k|				archive_strappend_char(&as, '/');
 1882|  2.27k|			archive_strncat(&as, header->name, sizeof(header->name));
 1883|  2.27k|			pathname = as.s;
 1884|  2.27k|			pathname_length = archive_strlen(&as);
  ------------------
  |  |  178|  2.27k|#define	archive_strlen(a) ((a)->length)
  ------------------
 1885|  2.27k|		} else {
 1886|    242|			pathname = header->name;
 1887|    242|			pathname_length = sizeof(header->name);
 1888|    242|		}
 1889|  2.51k|		r = archive_entry_copy_pathname_l(entry, pathname,
  ------------------
  |  |   80|  2.51k|#define archive_entry_copy_pathname_l	__archive_entry_copy_pathname_l
  ------------------
 1890|  2.51k|		    pathname_length, tar->sconv);
 1891|  2.51k|		archive_string_free(&as);
 1892|  2.51k|		if (r != 0) {
  ------------------
  |  Branch (1892:7): [True: 0, False: 2.51k]
  ------------------
 1893|      0|			err = set_conversion_failed_error(a, tar->sconv, "Pathname");
 1894|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1894:8): [True: 0, False: 0]
  ------------------
 1895|      0|				return (err);
 1896|      0|		}
 1897|  2.51k|	}
 1898|       |
 1899|       |	/* Handle rest of common fields. */
 1900|  2.52k|	r = header_common(a, tar, entry, h);
 1901|  2.52k|	if (r == ARCHIVE_FATAL)
  ------------------
  |  |  239|  2.52k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1901:6): [True: 1, False: 2.52k]
  ------------------
 1902|      1|		return (r);
 1903|  2.52k|	if (r < err)
  ------------------
  |  Branch (1903:6): [True: 0, False: 2.52k]
  ------------------
 1904|      0|		err = r;
 1905|       |
 1906|       |	/* Handle POSIX ustar fields. */
 1907|  2.52k|	const char *existing_uname = archive_entry_uname(entry);
 1908|  2.52k|	if (existing_uname == NULL || existing_uname[0] == '\0') {
  ------------------
  |  Branch (1908:6): [True: 2.52k, False: 0]
  |  Branch (1908:32): [True: 0, False: 0]
  ------------------
 1909|  2.52k|		if (archive_entry_copy_uname_l(entry,
  ------------------
  |  |   86|  2.52k|#define archive_entry_copy_uname_l	__archive_entry_copy_uname_l
  ------------------
  |  Branch (1909:7): [True: 0, False: 2.52k]
  ------------------
 1910|  2.52k|		    header->uname, sizeof(header->uname), tar->sconv) != 0) {
 1911|      0|			err = set_conversion_failed_error(a, tar->sconv, "Uname");
 1912|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1912:8): [True: 0, False: 0]
  ------------------
 1913|      0|				return (err);
 1914|      0|		}
 1915|  2.52k|	}
 1916|       |
 1917|  2.52k|	const char *existing_gname = archive_entry_gname(entry);
 1918|  2.52k|	if (existing_gname == NULL || existing_gname[0] == '\0') {
  ------------------
  |  Branch (1918:6): [True: 2.52k, False: 0]
  |  Branch (1918:32): [True: 0, False: 0]
  ------------------
 1919|  2.52k|		if (archive_entry_copy_gname_l(entry,
  ------------------
  |  |   71|  2.52k|#define archive_entry_copy_gname_l	__archive_entry_copy_gname_l
  ------------------
  |  Branch (1919:7): [True: 0, False: 2.52k]
  ------------------
 1920|  2.52k|		    header->gname, sizeof(header->gname), tar->sconv) != 0) {
 1921|      0|			err = set_conversion_failed_error(a, tar->sconv, "Gname");
 1922|      0|			if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1922:8): [True: 0, False: 0]
  ------------------
 1923|      0|				return (err);
 1924|      0|		}
 1925|  2.52k|	}
 1926|       |
 1927|       |	/* Parse out device numbers only for char and block specials. */
 1928|  2.52k|	if (header->typeflag[0] == '3' || header->typeflag[0] == '4') {
  ------------------
  |  Branch (1928:6): [True: 62, False: 2.46k]
  |  Branch (1928:36): [True: 254, False: 2.20k]
  ------------------
 1929|    316|		if (!archive_entry_rdev_is_set(entry)) {
  ------------------
  |  Branch (1929:7): [True: 316, False: 0]
  ------------------
 1930|    316|			archive_entry_set_rdevmajor(entry, (dev_t)
 1931|    316|			    tar_atol(header->rdevmajor, sizeof(header->rdevmajor)));
 1932|    316|			archive_entry_set_rdevminor(entry, (dev_t)
 1933|    316|			    tar_atol(header->rdevminor, sizeof(header->rdevminor)));
 1934|    316|		}
 1935|  2.20k|	} else {
 1936|  2.20k|		archive_entry_set_rdev(entry, 0);
 1937|  2.20k|	}
 1938|       |
 1939|  2.52k|	tar->entry_padding = 0x1ff & (-tar->entry_bytes_remaining);
 1940|       |
 1941|  2.52k|	return (err);
 1942|  2.52k|}
archive_read_support_format_tar.c:header_old_tar:
 1613|   278k|{
 1614|   278k|	const struct archive_entry_header_ustar	*header;
 1615|   278k|	int err = ARCHIVE_OK, err2;
  ------------------
  |  |  233|   278k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1616|       |
 1617|       |	/*
 1618|       |	 * Copy filename over (to ensure null termination).
 1619|       |	 * Skip if pathname was already set e.g. by header_gnu_longname()
 1620|       |	 */
 1621|   278k|	header = (const struct archive_entry_header_ustar *)h;
 1622|       |
 1623|   278k|	const char *existing_pathname = archive_entry_pathname(entry);
 1624|   278k|	const wchar_t *existing_wcs_pathname = archive_entry_pathname_w(entry);
 1625|   278k|	if ((existing_pathname == NULL || existing_pathname[0] == '\0')
  ------------------
  |  Branch (1625:7): [True: 278k, False: 118]
  |  Branch (1625:36): [True: 95, False: 23]
  ------------------
 1626|   278k|	    && (existing_wcs_pathname == NULL || existing_wcs_pathname[0] == '\0') &&
  ------------------
  |  Branch (1626:10): [True: 278k, False: 95]
  |  Branch (1626:43): [True: 95, False: 0]
  ------------------
 1627|   278k|	    archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|   278k|#define archive_entry_copy_pathname_l	__archive_entry_copy_pathname_l
  ------------------
  |  Branch (1627:6): [True: 0, False: 278k]
  ------------------
 1628|   278k|	    header->name, sizeof(header->name), tar->sconv) != 0) {
 1629|      0|		err = set_conversion_failed_error(a, tar->sconv, "Pathname");
 1630|      0|		if (err == ARCHIVE_FATAL)
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (1630:7): [True: 0, False: 0]
  ------------------
 1631|      0|			return (err);
 1632|      0|	}
 1633|       |
 1634|       |	/* Grab rest of common fields */
 1635|   278k|	err2 = header_common(a, tar, entry, h);
 1636|   278k|	if (err > err2)
  ------------------
  |  Branch (1636:6): [True: 53, False: 278k]
  ------------------
 1637|     53|		err = err2;
 1638|       |
 1639|   278k|	tar->entry_padding = 0x1ff & (-tar->entry_bytes_remaining);
 1640|   278k|	return (err);
 1641|   278k|}
archive_read_support_format_tar.c:is_mac_metadata_entry:
 1647|   282k|is_mac_metadata_entry(struct archive_entry *entry) {
 1648|   282k|	const char *p, *name;
 1649|   282k|	const wchar_t *wp, *wname;
 1650|       |
 1651|   282k|	name = p = archive_entry_pathname(entry);
 1652|   282k|	if (p != NULL) {
  ------------------
  |  Branch (1652:6): [True: 282k, False: 0]
  ------------------
 1653|       |		/* Find the last path element. */
 1654|  26.5M|		for (; *p != '\0'; ++p) {
  ------------------
  |  Branch (1654:10): [True: 26.2M, False: 282k]
  ------------------
 1655|  26.2M|			if (p[0] == '/' && p[1] != '\0')
  ------------------
  |  Branch (1655:8): [True: 102k, False: 26.1M]
  |  Branch (1655:23): [True: 99.6k, False: 3.00k]
  ------------------
 1656|  99.6k|				name = p + 1;
 1657|  26.2M|		}
 1658|       |		/*
 1659|       |		 * If last path element starts with "._", then
 1660|       |		 * this is a Mac extension.
 1661|       |		 */
 1662|   282k|		if (name[0] == '.' && name[1] == '_' && name[2] != '\0')
  ------------------
  |  Branch (1662:7): [True: 1.11k, False: 280k]
  |  Branch (1662:25): [True: 28, False: 1.08k]
  |  Branch (1662:43): [True: 18, False: 10]
  ------------------
 1663|     18|			return 1;
 1664|   282k|	} else {
 1665|       |		/* Find the last path element. */
 1666|      0|		wname = wp = archive_entry_pathname_w(entry);
 1667|      0|		if (wp == NULL)
  ------------------
  |  Branch (1667:7): [True: 0, False: 0]
  ------------------
 1668|      0|			return 0;
 1669|      0|		for (; *wp != L'\0'; ++wp) {
  ------------------
  |  Branch (1669:10): [True: 0, False: 0]
  ------------------
 1670|      0|			if (wp[0] == L'/' && wp[1] != L'\0')
  ------------------
  |  Branch (1670:8): [True: 0, False: 0]
  |  Branch (1670:25): [True: 0, False: 0]
  ------------------
 1671|      0|				wname = wp + 1;
 1672|      0|		}
 1673|       |		/*
 1674|       |		 * If last path element starts with "._", then
 1675|       |		 * this is a Mac extension.
 1676|       |		 */
 1677|      0|		if (wname[0] == L'.' && wname[1] == L'_' && wname[2] != L'\0')
  ------------------
  |  Branch (1677:7): [True: 0, False: 0]
  |  Branch (1677:27): [True: 0, False: 0]
  |  Branch (1677:47): [True: 0, False: 0]
  ------------------
 1678|      0|			return 1;
 1679|      0|	}
 1680|       |	/* Not a mac extension */
 1681|   281k|	return 0;
 1682|   282k|}
archive_read_support_format_tar.c:read_mac_metadata_blob:
 1696|     18|{
 1697|     18|	int64_t size;
 1698|     18|	size_t msize;
 1699|     18|	const void *data;
 1700|       |
 1701|       | 	/* Read the body as a Mac OS metadata blob. */
 1702|     18|	size = archive_entry_size(entry);
 1703|     18|	msize = (size_t)size;
 1704|     18|	if (size < 0 || (uintmax_t)msize != (uintmax_t)size) {
  ------------------
  |  Branch (1704:6): [True: 0, False: 18]
  |  Branch (1704:18): [True: 0, False: 18]
  ------------------
 1705|      0|		*unconsumed = 0;
 1706|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1707|      0|	}
 1708|       |
 1709|       |	/* TODO: Should this merely skip the overlarge entry and
 1710|       |	 * WARN?  Or is xattr_limit sufficiently large that we can
 1711|       |	 * safely assume anything larger is malicious? */
 1712|     18|	if (size > (int64_t)xattr_limit) {
  ------------------
  |  Branch (1712:6): [True: 1, False: 17]
  ------------------
 1713|      1|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1714|      1|		    "Oversized AppleDouble extension has size %llu > %llu",
 1715|      1|		    (unsigned long long)size,
 1716|      1|		    (unsigned long long)xattr_limit);
 1717|      1|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1718|      1|	}
 1719|       |
 1720|       |	/*
 1721|       |	 * TODO: Look beyond the body here to peek at the next header.
 1722|       |	 * If it's a regular header (not an extension header)
 1723|       |	 * that has the wrong name, just return the current
 1724|       |	 * entry as-is, without consuming the body here.
 1725|       |	 * That would reduce the risk of us mis-identifying
 1726|       |	 * an ordinary file that just happened to have
 1727|       |	 * a name starting with "._".
 1728|       |	 *
 1729|       |	 * Q: Is the above idea really possible?  Even
 1730|       |	 * when there are GNU or pax extension entries?
 1731|       |	 */
 1732|     17|	if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|     17|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1732:6): [True: 0, False: 17]
  ------------------
 1733|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1734|      0|	}
 1735|     17|	data = __archive_read_ahead(a, msize, NULL);
 1736|     17|	if (data == NULL) {
  ------------------
  |  Branch (1736:6): [True: 3, False: 14]
  ------------------
 1737|      3|		archive_set_error(&a->archive, EINVAL,
 1738|      3|		    "Truncated archive"
 1739|      3|		    " detected while reading macOS metadata");
 1740|      3|		*unconsumed = 0;
 1741|      3|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1742|      3|	}
 1743|     14|	archive_entry_clear(entry);
 1744|     14|	archive_entry_copy_mac_metadata(entry, data, msize);
 1745|     14|	*unconsumed = (msize + 511) & ~ 511;
 1746|     14|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     14|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1747|     17|}
archive_read_support_format_tar.c:gnu_sparse_10_read:
 3472|     45|{
 3473|     45|	int64_t bytes_read, entries, offset, size, to_skip, remaining;
 3474|       |
 3475|       |	/* Clear out the existing sparse list. */
 3476|     45|	gnu_clear_sparse_list(tar);
 3477|       |
 3478|     45|	remaining = tar->entry_bytes_remaining;
 3479|       |
 3480|       |	/* Parse entries. */
 3481|     45|	entries = gnu_sparse_10_atol(a, tar, &remaining, unconsumed);
 3482|     45|	if (entries < 0)
  ------------------
  |  Branch (3482:6): [True: 14, False: 31]
  ------------------
 3483|     14|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     14|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3484|       |	/* Parse the individual entries. */
 3485|    388|	while (entries-- > 0) {
  ------------------
  |  Branch (3485:9): [True: 380, False: 8]
  ------------------
 3486|       |		/* Parse offset/size */
 3487|    380|		offset = gnu_sparse_10_atol(a, tar, &remaining, unconsumed);
 3488|    380|		if (offset < 0)
  ------------------
  |  Branch (3488:7): [True: 14, False: 366]
  ------------------
 3489|     14|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     14|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3490|    366|		size = gnu_sparse_10_atol(a, tar, &remaining, unconsumed);
 3491|    366|		if (size < 0)
  ------------------
  |  Branch (3491:7): [True: 7, False: 359]
  ------------------
 3492|      7|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3493|       |		/* Add a new sparse entry. */
 3494|    359|		if (gnu_add_sparse_entry(a, tar, offset, size) != ARCHIVE_OK)
  ------------------
  |  |  233|    359|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3494:7): [True: 2, False: 357]
  ------------------
 3495|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3496|    359|	}
 3497|       |	/* Skip rest of block... */
 3498|      8|	if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|      8|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3498:6): [True: 0, False: 8]
  ------------------
 3499|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3500|      0|	}
 3501|      8|	bytes_read = tar->entry_bytes_remaining - remaining;
 3502|      8|	to_skip = 0x1ff & -bytes_read;
 3503|       |	/* Fail if tar->entry_bytes_remaing would get negative */
 3504|      8|	if (to_skip > remaining)
  ------------------
  |  Branch (3504:6): [True: 2, False: 6]
  ------------------
 3505|      2|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3506|      6|	if (to_skip != __archive_read_consume(a, to_skip))
  ------------------
  |  Branch (3506:6): [True: 5, False: 1]
  ------------------
 3507|      5|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3508|      1|	return (bytes_read + to_skip);
 3509|      6|}
archive_read_support_format_tar.c:gnu_sparse_10_atol:
 3428|    791|{
 3429|    791|	int64_t l;
 3430|    791|	const char *p;
 3431|    791|	ssize_t bytes_read;
 3432|    791|	int base, digit;
 3433|       |
 3434|    791|	base = 10;
 3435|       |
 3436|       |	/*
 3437|       |	 * Skip any lines starting with '#'; GNU tar specs
 3438|       |	 * don't require this, but they should.
 3439|       |	 */
 3440|    830|	do {
 3441|    830|		bytes_read = readline(a, tar, &p,
 3442|    830|			(ssize_t)tar_min(*remaining, 100), unconsumed);
  ------------------
  |  |   49|    830|#define tar_min(a,b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (49:23): [True: 36, False: 794]
  |  |  ------------------
  ------------------
 3443|    830|		if (bytes_read <= 0)
  ------------------
  |  Branch (3443:7): [True: 22, False: 808]
  ------------------
 3444|     22|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     22|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3445|    808|		*remaining -= bytes_read;
 3446|    808|	} while (p[0] == '#');
  ------------------
  |  Branch (3446:11): [True: 39, False: 769]
  ------------------
 3447|       |
 3448|    769|	l = 0;
 3449|  1.36k|	while (bytes_read > 0) {
  ------------------
  |  Branch (3449:9): [True: 1.36k, False: 0]
  ------------------
 3450|  1.36k|		if (*p == '\n')
  ------------------
  |  Branch (3450:7): [True: 756, False: 607]
  ------------------
 3451|    756|			return (l);
 3452|    607|		if (*p < '0' || *p >= '0' + base)
  ------------------
  |  Branch (3452:7): [True: 8, False: 599]
  |  Branch (3452:19): [True: 5, False: 594]
  ------------------
 3453|     13|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|     13|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 3454|    594|		digit = *p - '0';
 3455|    594|		if (archive_ckd_mul_i64(&l, l, base) ||
  ------------------
  |  Branch (3455:7): [True: 171, False: 423]
  ------------------
 3456|    423|		    archive_ckd_add_i64(&l, l, digit)) {
  ------------------
  |  Branch (3456:7): [True: 1, False: 422]
  ------------------
 3457|    172|			l = INT64_MAX; /* Truncate on overflow. */
 3458|    172|		}
 3459|    594|		p++;
 3460|    594|		bytes_read--;
 3461|    594|	}
 3462|       |	/* TODO: Error message. */
 3463|      0|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 3464|    769|}
archive_read_support_format_tar.c:readline:
 3709|    830|{
 3710|    830|	ssize_t bytes_read;
 3711|    830|	ssize_t total_size = 0;
 3712|    830|	const void *p, *t;
 3713|    830|	const char *s;
 3714|       |
 3715|    830|	if (tar_flush_unconsumed(a, unconsumed) != ARCHIVE_OK) {
  ------------------
  |  |  233|    830|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3715:6): [True: 0, False: 830]
  ------------------
 3716|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3717|      0|	}
 3718|       |
 3719|    830|	t = __archive_read_ahead(a, 1, &bytes_read);
 3720|    830|	if (bytes_read <= 0 || t == NULL)
  ------------------
  |  Branch (3720:6): [True: 2, False: 828]
  |  Branch (3720:25): [True: 0, False: 828]
  ------------------
 3721|      2|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3722|    828|	s = t;  /* Start of line? */
 3723|    828|	p = memchr(t, '\n', bytes_read);
 3724|       |	/* If we found '\n' in the read buffer, return pointer to that. */
 3725|    828|	if (p != NULL) {
  ------------------
  |  Branch (3725:6): [True: 812, False: 16]
  ------------------
 3726|    812|		bytes_read = 1 + ((const char *)p) - s;
 3727|    812|		if (bytes_read > limit) {
  ------------------
  |  Branch (3727:7): [True: 4, False: 808]
  ------------------
 3728|      4|			archive_set_error(&a->archive,
 3729|      4|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3730|      4|			    "Line too long");
 3731|      4|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3732|      4|		}
 3733|    808|		*unconsumed = bytes_read;
 3734|    808|		*start = s;
 3735|    808|		return (bytes_read);
 3736|    812|	}
 3737|     16|	*unconsumed = bytes_read;
 3738|       |	/* Otherwise, we need to accumulate in a line buffer. */
 3739|     16|	for (;;) {
 3740|     16|		if (total_size + bytes_read > limit) {
  ------------------
  |  Branch (3740:7): [True: 3, False: 13]
  ------------------
 3741|      3|			archive_set_error(&a->archive,
 3742|      3|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      3|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3743|      3|			    "Line too long");
 3744|      3|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3745|      3|		}
 3746|     13|		if (archive_string_ensure(&tar->line, total_size + bytes_read) == NULL) {
  ------------------
  |  Branch (3746:7): [True: 0, False: 13]
  ------------------
 3747|      0|			archive_set_error(&a->archive, ENOMEM,
 3748|      0|			    "Can't allocate working buffer");
 3749|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3750|      0|		}
 3751|     13|		memcpy(tar->line.s + total_size, t, bytes_read);
 3752|     13|		tar_flush_unconsumed(a, unconsumed);
 3753|     13|		total_size += bytes_read;
 3754|       |		/* If we found '\n', clean up and return. */
 3755|     13|		if (p != NULL) {
  ------------------
  |  Branch (3755:7): [True: 0, False: 13]
  ------------------
 3756|      0|			*start = tar->line.s;
 3757|      0|			return (total_size);
 3758|      0|		}
 3759|       |		/* Read some more. */
 3760|     13|		t = __archive_read_ahead(a, 1, &bytes_read);
 3761|     13|		if (bytes_read <= 0 || t == NULL)
  ------------------
  |  Branch (3761:7): [True: 13, False: 0]
  |  Branch (3761:26): [True: 0, False: 0]
  ------------------
 3762|     13|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     13|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3763|      0|		s = t;  /* Start of line? */
 3764|      0|		p = memchr(t, '\n', bytes_read);
 3765|       |		/* If we found '\n', trim the read. */
 3766|      0|		if (p != NULL) {
  ------------------
  |  Branch (3766:7): [True: 0, False: 0]
  ------------------
 3767|      0|			bytes_read = 1 + ((const char *)p) - s;
 3768|      0|		}
 3769|      0|		*unconsumed = bytes_read;
 3770|      0|	}
 3771|     16|}
archive_read_support_format_tar.c:tar_flush_unconsumed:
  486|   863k|{
  487|   863k|	if (*unconsumed) {
  ------------------
  |  Branch (487:6): [True: 399k, False: 463k]
  ------------------
  488|       |/*
  489|       |		void *data = (void *)__archive_read_ahead(a, *unconsumed, NULL);
  490|       |		 * this block of code is to poison claimed unconsumed space, ensuring
  491|       |		 * things break if it is in use still.
  492|       |		 * currently it WILL break things, so enable it only for debugging this issue
  493|       |		if (data) {
  494|       |			memset(data, 0xff, *unconsumed);
  495|       |		}
  496|       |*/
  497|   399k|		int64_t consumed = __archive_read_consume(a, *unconsumed);
  498|   399k|		if (consumed != *unconsumed) {
  ------------------
  |  Branch (498:7): [True: 1.91k, False: 397k]
  ------------------
  499|  1.91k|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|  1.91k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  500|  1.91k|		}
  501|   397k|		*unconsumed = 0;
  502|   397k|	}
  503|   861k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|   861k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  504|   863k|}
archive_read_support_format_tar.c:gnu_add_sparse_entry:
 3241|   408k|{
 3242|   408k|	struct sparse_block *p;
 3243|       |
 3244|   408k|	if (remaining == 0)
  ------------------
  |  Branch (3244:6): [True: 392k, False: 16.0k]
  ------------------
 3245|   392k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|   392k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3246|  16.0k|	p = calloc(1, sizeof(*p));
 3247|  16.0k|	if (p == NULL) {
  ------------------
  |  Branch (3247:6): [True: 0, False: 16.0k]
  ------------------
 3248|      0|		archive_set_error(&a->archive, ENOMEM, "Out of memory");
 3249|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3250|      0|	}
 3251|  16.0k|	if (tar->sparse_last != NULL)
  ------------------
  |  Branch (3251:6): [True: 12.1k, False: 3.83k]
  ------------------
 3252|  12.1k|		tar->sparse_last->next = p;
 3253|  3.83k|	else
 3254|  3.83k|		tar->sparse_list = p;
 3255|  16.0k|	tar->sparse_last = p;
 3256|  16.0k|	if (remaining < 0 || offset < 0 || offset > INT64_MAX - remaining) {
  ------------------
  |  Branch (3256:6): [True: 31, False: 15.9k]
  |  Branch (3256:23): [True: 5, False: 15.9k]
  |  Branch (3256:37): [True: 7, False: 15.9k]
  ------------------
 3257|     43|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Malformed sparse map data");
  ------------------
  |  |  204|     43|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3258|     43|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     43|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3259|     43|	}
 3260|  15.9k|	p->offset = offset;
 3261|  15.9k|	p->remaining = remaining;
 3262|  15.9k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  15.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3263|  16.0k|}
archive_read_support_format_tar.c:archive_read_format_tar_read_data:
  617|   292k|{
  618|   292k|	struct tar *tar = a->format->data;
  619|   292k|	ssize_t bytes_read;
  620|   292k|	struct sparse_block *p;
  621|       |
  622|   293k|	for (;;) {
  623|       |		/* Remove exhausted entries from sparse list. */
  624|   294k|		while (tar->sparse_list != NULL &&
  ------------------
  |  Branch (624:10): [True: 9.50k, False: 285k]
  ------------------
  625|  9.50k|		    tar->sparse_list->remaining == 0) {
  ------------------
  |  Branch (625:7): [True: 1.69k, False: 7.81k]
  ------------------
  626|  1.69k|			p = tar->sparse_list;
  627|  1.69k|			tar->sparse_list = p->next;
  628|  1.69k|			free(p);
  629|  1.69k|		}
  630|       |
  631|   293k|		if (tar->entry_bytes_unconsumed) {
  ------------------
  |  Branch (631:7): [True: 2.22k, False: 290k]
  ------------------
  632|  2.22k|			__archive_read_consume(a, tar->entry_bytes_unconsumed);
  633|  2.22k|			tar->entry_bytes_unconsumed = 0;
  634|  2.22k|		}
  635|       |
  636|       |		/* If we're at end of file, return EOF. */
  637|   293k|		if (tar->sparse_list == NULL ||
  ------------------
  |  Branch (637:7): [True: 285k, False: 7.81k]
  ------------------
  638|   290k|		    tar->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (638:7): [True: 5.46k, False: 2.34k]
  ------------------
  639|   290k|			int64_t request = tar->entry_bytes_remaining +
  640|   290k|			    tar->entry_padding;
  641|       |
  642|   290k|			if (__archive_read_consume(a, request) != request)
  ------------------
  |  Branch (642:8): [True: 19, False: 290k]
  ------------------
  643|     19|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     19|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  644|   290k|			tar->entry_padding = 0;
  645|   290k|			*buff = NULL;
  646|   290k|			*size = 0;
  647|   290k|			*offset = tar->disk_size;
  648|   290k|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|   290k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  649|   290k|		}
  650|       |
  651|  2.34k|		*buff = __archive_read_ahead(a, 1, &bytes_read);
  652|  2.34k|		if (*buff == NULL) {
  ------------------
  |  Branch (652:7): [True: 120, False: 2.22k]
  ------------------
  653|    120|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    120|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  654|    120|			    "Truncated tar archive"
  655|    120|			    " detected while reading data");
  656|    120|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    120|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  657|    120|		}
  658|  2.22k|		if (bytes_read > tar->entry_bytes_remaining)
  ------------------
  |  Branch (658:7): [True: 1.67k, False: 551]
  ------------------
  659|  1.67k|			bytes_read = (ssize_t)tar->entry_bytes_remaining;
  660|       |		/* Don't read more than is available in the
  661|       |		 * current sparse block. */
  662|  2.22k|		if (tar->sparse_list->remaining < bytes_read)
  ------------------
  |  Branch (662:7): [True: 14, False: 2.21k]
  ------------------
  663|     14|			bytes_read = (ssize_t)tar->sparse_list->remaining;
  664|  2.22k|		*size = bytes_read;
  665|  2.22k|		*offset = tar->sparse_list->offset;
  666|  2.22k|		tar->sparse_list->remaining -= bytes_read;
  667|  2.22k|		tar->sparse_list->offset += bytes_read;
  668|  2.22k|		tar->entry_bytes_remaining -= bytes_read;
  669|  2.22k|		tar->entry_bytes_unconsumed = bytes_read;
  670|       |
  671|  2.22k|		if (!tar->sparse_list->hole)
  ------------------
  |  Branch (671:7): [True: 2.21k, False: 12]
  ------------------
  672|  2.21k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.21k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  673|       |		/* Current is hole data and skip this. */
  674|  2.22k|	}
  675|   292k|}
archive_read_support_format_tar.c:archive_read_format_tar_skip:
  679|   281k|{
  680|   281k|	struct tar *tar = a->format->data;
  681|   281k|	int64_t request;
  682|       |
  683|   281k|	request = tar->entry_bytes_remaining + tar->entry_padding +
  684|   281k|	    tar->entry_bytes_unconsumed;
  685|       |
  686|   281k|	if (__archive_read_consume(a, request) != request)
  ------------------
  |  Branch (686:6): [True: 0, False: 281k]
  ------------------
  687|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  688|       |
  689|   281k|	tar->entry_bytes_remaining = 0;
  690|   281k|	tar->entry_bytes_unconsumed = 0;
  691|   281k|	tar->entry_padding = 0;
  692|       |
  693|       |	/* Free the sparse list. */
  694|   281k|	gnu_clear_sparse_list(tar);
  695|       |
  696|   281k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|   281k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  697|   281k|}

archive_read_support_format_warc:
  144|  16.7k|{
  145|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
  146|  16.7k|	struct warc *warc;
  147|  16.7k|	int r;
  148|       |
  149|  16.7k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
  150|  16.7k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_warc");
  151|       |
  152|  16.7k|	if ((warc = calloc(1, sizeof(*warc))) == NULL) {
  ------------------
  |  Branch (152:6): [True: 0, False: 16.7k]
  ------------------
  153|      0|		archive_set_error(_a, ENOMEM, "Can't allocate warc data");
  154|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  155|      0|	}
  156|       |
  157|  16.7k|	r = __archive_read_register_format(a,
  158|  16.7k|	    warc,
  159|  16.7k|	    "warc",
  160|  16.7k|	    archive_read_format_warc_bid,
  161|  16.7k|	    NULL,
  162|  16.7k|	    archive_read_format_warc_read_header,
  163|  16.7k|	    archive_read_format_warc_read_data,
  164|  16.7k|	    archive_read_format_warc_skip,
  165|  16.7k|	    NULL,
  166|  16.7k|	    archive_read_format_warc_cleanup,
  167|  16.7k|	    NULL,
  168|  16.7k|	    NULL);
  169|       |
  170|  16.7k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (170:6): [True: 0, False: 16.7k]
  ------------------
  171|      0|		free(warc);
  172|  16.7k|	return (r);
  173|  16.7k|}
archive_read_support_format_warc.c:archive_read_format_warc_cleanup:
  177|  16.7k|{
  178|  16.7k|	struct warc *warc = a->format->data;
  179|       |
  180|  16.7k|	if (warc->pool.len > 0U) {
  ------------------
  |  Branch (180:6): [True: 266, False: 16.4k]
  ------------------
  181|    266|		free(warc->pool.str);
  182|    266|	}
  183|  16.7k|	archive_string_free(&warc->sver);
  184|  16.7k|	free(warc);
  185|  16.7k|	a->format->data = NULL;
  186|  16.7k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  187|  16.7k|}
archive_read_support_format_warc.c:archive_read_format_warc_bid:
  191|  16.4k|{
  192|  16.4k|	const void *h;
  193|  16.4k|	ssize_t nrd;
  194|  16.4k|	unsigned int ver;
  195|       |
  196|  16.4k|	(void)best_bid; /* UNUSED */
  197|       |
  198|       |	/* Check the first line, which should already be a record header. */
  199|  16.4k|	if ((h = __archive_read_ahead(a, 12, &nrd)) == NULL) {
  ------------------
  |  Branch (199:6): [True: 166, False: 16.2k]
  ------------------
  200|       |		/* Not enough data to identify this format. */
  201|    166|		return -1;
  202|    166|	}
  203|       |
  204|       |	/* Parse the record version number. */
  205|  16.2k|	ver = warc_read_version(h, nrd);
  206|  16.2k|	if (ver < 1200U || ver > 10000U) {
  ------------------
  |  Branch (206:6): [True: 15.6k, False: 633]
  |  Branch (206:21): [True: 0, False: 633]
  ------------------
  207|       |		/* Only WARC 0.12 through WARC 1.0 are supported. */
  208|  15.6k|		return -1;
  209|  15.6k|	}
  210|       |
  211|       |	/* WARC magic and version checks passed. */
  212|    633|	return (64);
  213|  16.2k|}
archive_read_support_format_warc.c:warc_read_version:
  633|  30.1k|{
  634|  30.1k|	static const char magic[] = "WARC/";
  635|  30.1k|	const char *c;
  636|  30.1k|	unsigned int ver = 0U;
  637|  30.1k|	unsigned int end = 0U;
  638|       |
  639|  30.1k|	if (bsz < 12 || memcmp(buf, magic, sizeof(magic) - 1U) != 0) {
  ------------------
  |  Branch (639:6): [True: 2, False: 30.1k]
  |  Branch (639:18): [True: 15.6k, False: 14.4k]
  ------------------
  640|       |		/* Buffer too small or invalid magic. */
  641|  15.6k|		return ver;
  642|  15.6k|	}
  643|       |	/* Parse the version number. */
  644|  14.4k|	buf += sizeof(magic) - 1U;
  645|       |
  646|  14.4k|	if (warc_isdigit(buf[0]) && buf[1] == '.' && warc_isdigit(buf[2])) {
  ------------------
  |  Branch (646:6): [True: 14.4k, False: 6]
  |  Branch (646:30): [True: 14.4k, False: 5]
  |  Branch (646:47): [True: 14.4k, False: 0]
  ------------------
  647|       |		/* Support at most two digits in the minor version. */
  648|  14.4k|		if (warc_isdigit(buf[3]))
  ------------------
  |  Branch (648:7): [True: 147, False: 14.3k]
  ------------------
  649|    147|			end = 1U;
  650|       |		/* Set up the major version. */
  651|  14.4k|		ver = (buf[0U] - '0') * 10000U;
  652|       |		/* Set up the minor version. */
  653|  14.4k|		if (end == 1U) {
  ------------------
  |  Branch (653:7): [True: 147, False: 14.3k]
  ------------------
  654|    147|			ver += (buf[2U] - '0') * 1000U;
  655|    147|			ver += (buf[3U] - '0') * 100U;
  656|    147|		} else
  657|  14.3k|			ver += (buf[2U] - '0') * 100U;
  658|       |		/*
  659|       |		 * WARC versions before 0.12 use a space-separated header.
  660|       |		 * WARC 0.12 and later terminate the version with CRLF.
  661|       |		 */
  662|  14.4k|		c = buf + 3U + end;
  663|  14.4k|		if (ver >= 1200U) {
  ------------------
  |  Branch (663:7): [True: 14.4k, False: 0]
  ------------------
  664|  14.4k|			if (memcmp(c, "\r\n", 2U) != 0)
  ------------------
  |  Branch (664:8): [True: 5, False: 14.4k]
  ------------------
  665|      5|				ver = 0U;
  666|  14.4k|		} else {
  667|       |			/* Version is below WARC 0.12. */
  668|      0|			if (*c != ' ' && *c != '\t')
  ------------------
  |  Branch (668:8): [True: 0, False: 0]
  |  Branch (668:21): [True: 0, False: 0]
  ------------------
  669|      0|				ver = 0U;
  670|      0|		}
  671|  14.4k|	}
  672|  14.4k|	return ver;
  673|  30.1k|}
archive_read_support_format_warc.c:warc_isdigit:
  627|  43.4k|{
  628|  43.4k|	return c >= '0' && c <= '9';
  ------------------
  |  Branch (628:9): [True: 29.1k, False: 14.3k]
  |  Branch (628:21): [True: 29.1k, False: 3]
  ------------------
  629|  43.4k|}
archive_read_support_format_warc.c:archive_read_format_warc_read_header:
  218|  7.54k|{
  219|  7.54k|#define HDR_PROBE_LEN		(12U)
  220|  7.54k|	struct warc *warc = a->format->data;
  221|  7.54k|	unsigned int ver;
  222|  7.54k|	const char *buf;
  223|  7.54k|	ssize_t nrd;
  224|  7.54k|	const char *eoh;
  225|  7.54k|	char *tmp;
  226|       |	/* Reuse the header buffer while parsing the file name. */
  227|  7.54k|	warc_string_t fnam;
  228|       |	/* WARC record type */
  229|  7.54k|	warc_type_t ftyp;
  230|       |	/* Content length, or a negative error indicator */
  231|  7.54k|	int64_t cntlen;
  232|       |	/* WARC-Date is exposed as the entry ctime. */
  233|  7.54k|	time_t rtime;
  234|       |	/* A Last-Modified record header is exposed as the entry mtime. */
  235|  7.54k|	time_t mtime;
  236|       |
  237|  14.1k|start_over:
  238|       |	/* Use read_ahead(); it already tracks unconsumed bytes, so this
  239|       |	 * reader does not need a separate shift buffer. */
  240|  14.1k|	buf = __archive_read_ahead(a, HDR_PROBE_LEN, &nrd);
  ------------------
  |  |  219|  14.1k|#define HDR_PROBE_LEN		(12U)
  ------------------
  241|       |
  242|  14.1k|	if (nrd < 0) {
  ------------------
  |  Branch (242:6): [True: 0, False: 14.1k]
  ------------------
  243|       |		/* I/O or stream error. */
  244|      0|		archive_set_error(
  245|      0|			&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  246|      0|			"Bad record header");
  247|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  248|  14.1k|	} else if (buf == NULL) {
  ------------------
  |  Branch (248:13): [True: 42, False: 14.1k]
  ------------------
  249|       |		/* there should be room for at least WARC/bla\r\n
  250|       |		 * must be EOF therefore */
  251|     42|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|     42|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  252|     42|	}
  253|       |	/* Locate the end of the record header. */
  254|  14.1k|	eoh = warc_find_eoh(buf, nrd);
  255|  14.1k|	if (eoh == NULL) {
  ------------------
  |  Branch (255:6): [True: 265, False: 13.8k]
  ------------------
  256|       |		/* The header terminator was not found in the probed data. */
  257|    265|		archive_set_error(
  258|    265|			&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    265|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  259|    265|			"Bad record header");
  260|    265|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    265|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  261|    265|	}
  262|  13.8k|	ver = warc_read_version(buf, eoh - buf);
  263|       |	/* Only WARC 0.12 through WARC 1.0 are supported. */
  264|  13.8k|	if (ver == 0U) {
  ------------------
  |  Branch (264:6): [True: 26, False: 13.8k]
  ------------------
  265|     26|		archive_set_error(
  266|     26|			&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     26|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  267|     26|			"Invalid record version");
  268|     26|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     26|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  269|  13.8k|	} else if (ver < 1200U || ver > 10000U) {
  ------------------
  |  Branch (269:13): [True: 0, False: 13.8k]
  |  Branch (269:28): [True: 3, False: 13.8k]
  ------------------
  270|      3|		archive_set_error(
  271|      3|			&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  272|      3|			"Unsupported record version: %u.%u",
  273|      3|			ver / 10000, (ver % 10000) / 100);
  274|      3|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  275|      3|	}
  276|  13.8k|	cntlen = warc_read_length(buf, eoh - buf);
  277|  13.8k|	if (cntlen < 0) {
  ------------------
  |  Branch (277:6): [True: 63, False: 13.7k]
  ------------------
  278|       |		/* This reader requires Content-Length before processing a record. */
  279|     63|		archive_set_error(
  280|     63|			&a->archive, EINVAL,
  281|     63|			"Bad content length");
  282|     63|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     63|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  283|     63|	}
  284|  13.7k|	rtime = warc_read_date(buf, eoh - buf);
  285|  13.7k|	if (rtime == (time_t)-1) {
  ------------------
  |  Branch (285:6): [True: 133, False: 13.6k]
  ------------------
  286|       |		/* This reader requires WARC-Date before processing a record. */
  287|    133|		archive_set_error(
  288|    133|			&a->archive, EINVAL,
  289|    133|			"Bad record time");
  290|    133|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    133|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  291|    133|	}
  292|       |
  293|       |	/* Report this archive as WARC. */
  294|  13.6k|	a->archive.archive_format = ARCHIVE_FORMAT_WARC;
  ------------------
  |  |  386|  13.6k|#define	ARCHIVE_FORMAT_WARC			0xF0000
  ------------------
  295|  13.6k|	if (ver != warc->pver) {
  ------------------
  |  Branch (295:6): [True: 793, False: 12.8k]
  ------------------
  296|       |		/* Format this entry's WARC version. */
  297|    793|		archive_string_sprintf(&warc->sver,
  298|    793|			"WARC/%u.%u", ver / 10000, (ver % 10000) / 100);
  299|       |		/* Remember the version for later entries. */
  300|    793|		warc->pver = ver;
  301|    793|	}
  302|       |	/* Parse the record type. */
  303|  13.6k|	ftyp = warc_read_type(buf, eoh - buf);
  304|       |	/* Save content state for subsequent read calls. */
  305|  13.6k|	warc->cntlen = cntlen;
  306|  13.6k|	warc->cntoff = 0;
  307|  13.6k|	mtime = 0;/* Avoid compiler warnings on some platforms. */
  308|       |
  309|  13.6k|	switch (ftyp) {
  310|    553|	case WT_RSRC:
  ------------------
  |  Branch (310:2): [True: 553, False: 13.0k]
  ------------------
  311|  9.41k|	case WT_RSP:
  ------------------
  |  Branch (311:2): [True: 8.86k, False: 4.77k]
  ------------------
  312|       |		/* Read the filename only for record types that are expected to
  313|       |		 * have a target URI. */
  314|  9.41k|		fnam = warc_read_uri(buf, eoh - buf);
  315|       |		/* Avoid creating directory endpoints as files. */
  316|  9.41k|		if (fnam.len == 0 || fnam.str[fnam.len - 1] == '/') {
  ------------------
  |  Branch (316:7): [True: 2.25k, False: 7.16k]
  |  Branch (316:24): [True: 207, False: 6.95k]
  ------------------
  317|       |			/* Skip this record. */
  318|  2.46k|			fnam.len = 0U;
  319|  2.46k|			fnam.str = NULL;
  320|  2.46k|			break;
  321|  2.46k|		}
  322|       |		/* Copy the name into the reusable string pool to avoid a malloc/free
  323|       |		 * roundtrip for each entry. */
  324|  6.95k|		if (fnam.len + 1U > warc->pool.len) {
  ------------------
  |  Branch (324:7): [True: 281, False: 6.67k]
  ------------------
  325|    281|			warc->pool.len = ((fnam.len + 64U) / 64U) * 64U;
  326|    281|			tmp = realloc(warc->pool.str, warc->pool.len);
  327|    281|			if (tmp == NULL) {
  ------------------
  |  Branch (327:8): [True: 0, False: 281]
  ------------------
  328|      0|				archive_set_error(
  329|      0|					&a->archive, ENOMEM,
  330|      0|					"Out of memory");
  331|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  332|      0|			}
  333|    281|			warc->pool.str = tmp;
  334|    281|		}
  335|  6.95k|		memcpy(warc->pool.str, fnam.str, fnam.len);
  336|  6.95k|		warc->pool.str[fnam.len] = '\0';
  337|       |		/* Hide the pool implementation behind the parsed string. */
  338|  6.95k|		fnam.str = warc->pool.str;
  339|       |
  340|       |		/* Use a Last-Modified record header when present; otherwise fall back
  341|       |		 * to WARC-Date. */
  342|  6.95k|		if ((mtime = warc_read_last_modified(buf, eoh - buf)) == (time_t)-1) {
  ------------------
  |  Branch (342:7): [True: 6.87k, False: 86]
  ------------------
  343|  6.87k|			mtime = rtime;
  344|  6.87k|		}
  345|  6.95k|		break;
  346|  4.22k|	case WT_NONE:
  ------------------
  |  Branch (346:2): [True: 4.22k, False: 9.41k]
  ------------------
  347|  4.22k|	case WT_INFO:
  ------------------
  |  Branch (347:2): [True: 0, False: 13.6k]
  ------------------
  348|  4.22k|	case WT_META:
  ------------------
  |  Branch (348:2): [True: 0, False: 13.6k]
  ------------------
  349|  4.22k|	case WT_REQ:
  ------------------
  |  Branch (349:2): [True: 0, False: 13.6k]
  ------------------
  350|  4.22k|	case WT_RVIS:
  ------------------
  |  Branch (350:2): [True: 0, False: 13.6k]
  ------------------
  351|  4.22k|	case WT_CONV:
  ------------------
  |  Branch (351:2): [True: 0, False: 13.6k]
  ------------------
  352|  4.22k|	case WT_CONT:
  ------------------
  |  Branch (352:2): [True: 0, False: 13.6k]
  ------------------
  353|  4.22k|	case LAST_WT:
  ------------------
  |  Branch (353:2): [True: 0, False: 13.6k]
  ------------------
  354|  4.22k|	default:
  ------------------
  |  Branch (354:2): [True: 0, False: 13.6k]
  ------------------
  355|  4.22k|		fnam.len = 0U;
  356|  4.22k|		fnam.str = NULL;
  357|  4.22k|		break;
  358|  13.6k|	}
  359|       |
  360|       |	/* Consume the record header. */
  361|  13.6k|	__archive_read_consume(a, eoh - buf);
  362|       |
  363|  13.6k|	switch (ftyp) {
  364|    553|	case WT_RSRC:
  ------------------
  |  Branch (364:2): [True: 553, False: 13.0k]
  ------------------
  365|  9.41k|	case WT_RSP:
  ------------------
  |  Branch (365:2): [True: 8.86k, False: 4.77k]
  ------------------
  366|  9.41k|		if (fnam.len > 0U) {
  ------------------
  |  Branch (366:7): [True: 6.95k, False: 2.46k]
  ------------------
  367|       |			/* Populate the entry object. */
  368|  6.95k|			archive_entry_set_filetype(entry, AE_IFREG);
  ------------------
  |  |  216|  6.95k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  369|  6.95k|			archive_entry_copy_pathname(entry, fnam.str);
  370|  6.95k|			archive_entry_set_size(entry, cntlen);
  371|  6.95k|			archive_entry_set_perm(entry, 0644);
  372|       |			/* WARC-Date becomes ctime; mtime comes from Last-Modified or WARC-Date. */
  373|  6.95k|			archive_entry_set_ctime(entry, rtime, 0L);
  374|  6.95k|			archive_entry_set_mtime(entry, mtime, 0L);
  375|  6.95k|			break;
  376|  6.95k|		}
  377|       |		/* FALLTHROUGH */
  378|  6.68k|	case WT_NONE:
  ------------------
  |  Branch (378:2): [True: 4.22k, False: 9.41k]
  ------------------
  379|  6.68k|	case WT_INFO:
  ------------------
  |  Branch (379:2): [True: 0, False: 13.6k]
  ------------------
  380|  6.68k|	case WT_META:
  ------------------
  |  Branch (380:2): [True: 0, False: 13.6k]
  ------------------
  381|  6.68k|	case WT_REQ:
  ------------------
  |  Branch (381:2): [True: 0, False: 13.6k]
  ------------------
  382|  6.68k|	case WT_RVIS:
  ------------------
  |  Branch (382:2): [True: 0, False: 13.6k]
  ------------------
  383|  6.68k|	case WT_CONV:
  ------------------
  |  Branch (383:2): [True: 0, False: 13.6k]
  ------------------
  384|  6.68k|	case WT_CONT:
  ------------------
  |  Branch (384:2): [True: 0, False: 13.6k]
  ------------------
  385|  6.68k|	case LAST_WT:
  ------------------
  |  Branch (385:2): [True: 0, False: 13.6k]
  ------------------
  386|  6.68k|	default:
  ------------------
  |  Branch (386:2): [True: 0, False: 13.6k]
  ------------------
  387|       |		/* Skip this record body and look for the next one. */
  388|  6.68k|		if (archive_read_format_warc_skip(a) < 0)
  ------------------
  |  Branch (388:7): [True: 58, False: 6.62k]
  ------------------
  389|     58|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     58|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  390|  6.62k|		goto start_over;
  391|  13.6k|	}
  392|  6.95k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  6.95k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  393|  13.6k|}
archive_read_support_format_warc.c:warc_find_eoh:
  856|  14.1k|{
  857|  14.1k|	static const char _marker[] = "\r\n\r\n";
  858|  14.1k|	const char *hit = xmemmem(buf, bsz, _marker, sizeof(_marker) - 1U);
  859|       |
  860|  14.1k|	if (hit != NULL) {
  ------------------
  |  Branch (860:6): [True: 13.8k, False: 265]
  ------------------
  861|  13.8k|		hit += sizeof(_marker) - 1U;
  862|  13.8k|	}
  863|  14.1k|	return hit;
  864|  14.1k|}
archive_read_support_format_warc.c:xmemmem:
  461|   133k|{
  462|   133k|	const char *const eoh = hay + haysize;
  463|   133k|	const char *const eon = needle + needlesize;
  464|   133k|	const char *hp;
  465|   133k|	const char *np;
  466|   133k|	const char *cand;
  467|   133k|	unsigned int hsum;
  468|   133k|	unsigned int nsum;
  469|   133k|	unsigned int eqp;
  470|       |
  471|       |	/* Handle trivial cases first.  A zero-sized needle is defined to be
  472|       |	 * found anywhere in the haystack; otherwise find the first candidate
  473|       |	 * that begins with *NEEDLE. */
  474|   133k|	if (needlesize == 0UL) {
  ------------------
  |  Branch (474:6): [True: 0, False: 133k]
  ------------------
  475|      0|		return hay;
  476|   133k|	} else if ((hay = memchr(hay, *needle, haysize)) == NULL) {
  ------------------
  |  Branch (476:13): [True: 386, False: 133k]
  ------------------
  477|       |		/* No candidate match remains. */
  478|    386|		return NULL;
  479|    386|	}
  480|       |
  481|       |	/* The first characters of haystack and needle already match, and both
  482|       |	 * strings are at least one character long.  Compute the rolling XOR
  483|       |	 * values for the needle and the first NEEDLESIZE characters of haystack. */
  484|   133k|	for (hp = hay + 1U, np = needle + 1U, hsum = *hay, nsum = *hay, eqp = 1U;
  485|  1.03M|	     hp < eoh && np < eon;
  ------------------
  |  Branch (485:7): [True: 1.03M, False: 89]
  |  Branch (485:19): [True: 900k, False: 133k]
  ------------------
  486|   900k|	     hsum ^= *hp, nsum ^= *np, eqp &= *hp == *np, hp++, np++);
  487|       |
  488|       |	/* HP now references the (NEEDLESIZE + 1)-th character. */
  489|   133k|	if (np < eon) {
  ------------------
  |  Branch (489:6): [True: 76, False: 133k]
  ------------------
  490|       |		/* The haystack is smaller than the needle. */
  491|     76|		return NULL;
  492|   133k|	} else if (eqp) {
  ------------------
  |  Branch (492:13): [True: 67.5k, False: 65.8k]
  ------------------
  493|       |		/* Found a match. */
  494|  67.5k|		return hay;
  495|  67.5k|	}
  496|       |
  497|       |	/* Loop through the rest of the haystack and update the rolling XOR
  498|       |	 * iteratively. */
  499|  18.9M|	for (cand = hay; hp < eoh; hp++) {
  ------------------
  |  Branch (499:19): [True: 18.9M, False: 5.16k]
  ------------------
  500|  18.9M|		hsum ^= *cand++;
  501|  18.9M|		hsum ^= *hp;
  502|       |
  503|       |		/* When the rolling XOR values match, it is enough to check
  504|       |		 * NEEDLESIZE - 1 characters for equality.  CAND is always before
  505|       |		 * HP by design, so no range check is needed. */
  506|  18.9M|		if (hsum == nsum && memcmp(cand, needle, needlesize - 1U) == 0) {
  ------------------
  |  Branch (506:7): [True: 1.36M, False: 17.6M]
  |  Branch (506:23): [True: 60.6k, False: 1.30M]
  ------------------
  507|  60.6k|			return cand;
  508|  60.6k|		}
  509|  18.9M|	}
  510|  5.16k|	return NULL;
  511|  65.8k|}
archive_read_support_format_warc.c:warc_read_length:
  763|  13.8k|{
  764|  13.8k|	static const char _key[] = "\r\nContent-Length:";
  765|  13.8k|	const char *val, *eol, *p;
  766|  13.8k|	int64_t len;
  767|       |
  768|  13.8k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (768:6): [True: 30, False: 13.8k]
  ------------------
  769|       |		/* Header field is absent. */
  770|     30|		return -1;
  771|     30|	}
  772|  13.8k|	val += sizeof(_key) - 1U;
  773|       |
  774|  13.8k|	if ((eol = warc_find_eol(val, buf + bsz - val)) == NULL) {
  ------------------
  |  Branch (774:6): [True: 0, False: 13.8k]
  ------------------
  775|       |		/* Malformed field with no end of line. */
  776|      0|		return -1;
  777|      0|	}
  778|       |
  779|       |	/* Skip leading whitespace. */
  780|  15.4k|	while (val < eol && (*val == ' ' || *val == '\t'))
  ------------------
  |  Branch (780:9): [True: 15.4k, False: 0]
  |  Branch (780:23): [True: 1.19k, False: 14.2k]
  |  Branch (780:38): [True: 433, False: 13.8k]
  ------------------
  781|  1.62k|		val++;
  782|       |
  783|       |	/* Require at least one digit. */
  784|  13.8k|	if (val >= eol || *val < '0' || *val > '9')
  ------------------
  |  Branch (784:6): [True: 0, False: 13.8k]
  |  Branch (784:20): [True: 11, False: 13.7k]
  |  Branch (784:34): [True: 4, False: 13.7k]
  ------------------
  785|     15|		return -1;
  786|       |
  787|  13.7k|	len = 0;
  788|  40.9k|	for (p = val; p < eol; p++) {
  ------------------
  |  Branch (788:16): [True: 27.1k, False: 13.7k]
  ------------------
  789|  27.1k|		int64_t digit;
  790|       |
  791|  27.1k|		if (*p < '0' || *p > '9')
  ------------------
  |  Branch (791:7): [True: 11, False: 27.1k]
  |  Branch (791:19): [True: 4, False: 27.1k]
  ------------------
  792|     15|			return -1;
  793|  27.1k|		digit = *p - '0';
  794|  27.1k|		if (archive_ckd_mul_i64(&len, len, 10) ||
  ------------------
  |  Branch (794:7): [True: 2, False: 27.1k]
  ------------------
  795|  27.1k|		    archive_ckd_add_i64(&len, len, digit))
  ------------------
  |  Branch (795:7): [True: 1, False: 27.1k]
  ------------------
  796|      3|			return -1;
  797|  27.1k|	}
  798|       |
  799|  13.7k|	return len;
  800|  13.7k|}
archive_read_support_format_warc.c:warc_find_eol:
  868|  53.0k|{
  869|  53.0k|	static const char _marker[] = "\r\n";
  870|  53.0k|	const char *hit = xmemmem(buf, bsz, _marker, sizeof(_marker) - 1U);
  871|       |
  872|  53.0k|	return hit;
  873|  53.0k|}
archive_read_support_format_warc.c:warc_read_date:
  804|  13.7k|{
  805|  13.7k|	static const char _key[] = "\r\nWARC-Date:";
  806|  13.7k|	const char *val, *eol, *on = NULL;
  807|  13.7k|	time_t res;
  808|       |
  809|  13.7k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (809:6): [True: 36, False: 13.7k]
  ------------------
  810|       |		/* Header field is absent. */
  811|     36|		return (time_t)-1;
  812|     36|	}
  813|  13.7k|	val += sizeof(_key) - 1U;
  814|  13.7k|	if ((eol = warc_find_eol(val, buf + bsz - val)) == NULL ) {
  ------------------
  |  Branch (814:6): [True: 0, False: 13.7k]
  ------------------
  815|       |		/* Header field has no end of line. */
  816|      0|		return -1;
  817|      0|	}
  818|       |
  819|       |	/* xstrpisotime() skips leading whitespace. */
  820|  13.7k|	res = xstrpisotime(val, &on);
  821|  13.7k|	if (on != eol) {
  ------------------
  |  Branch (821:6): [True: 94, False: 13.6k]
  ------------------
  822|       |		/* The field must end here. */
  823|     94|		return -1;
  824|     94|	}
  825|  13.6k|	return res;
  826|  13.7k|}
archive_read_support_format_warc.c:xstrpisotime:
  573|  18.8k|{
  574|       |/* Like strptime(), but only for ISO 8601 Zulu strings. */
  575|  18.8k|	struct tm tm;
  576|  18.8k|	time_t res = (time_t)-1;
  577|       |
  578|       |	/* Clear the tm structure. */
  579|  18.8k|	memset(&tm, 0, sizeof(tm));
  580|       |
  581|       |	/* This is a non-standard routine, so skip leading whitespace for
  582|       |	 * caller convenience. */
  583|  38.4k|	while (*s == ' ' || *s == '\t')
  ------------------
  |  Branch (583:9): [True: 465, False: 37.9k]
  |  Branch (583:22): [True: 19.0k, False: 18.8k]
  ------------------
  584|  19.5k|		++s;
  585|       |
  586|       |	/* Read the year. */
  587|  18.8k|	if ((tm.tm_year = strtoi_lim(s, &s, 1583, 4095)) < 0 || *s++ != '-') {
  ------------------
  |  Branch (587:6): [True: 556, False: 18.2k]
  |  Branch (587:58): [True: 82, False: 18.2k]
  ------------------
  588|    638|		goto out;
  589|    638|	}
  590|       |	/* Read the month. */
  591|  18.2k|	if ((tm.tm_mon = strtoi_lim(s, &s, 1, 12)) < 0 || *s++ != '-') {
  ------------------
  |  Branch (591:6): [True: 871, False: 17.3k]
  |  Branch (591:52): [True: 80, False: 17.2k]
  ------------------
  592|    951|		goto out;
  593|    951|	}
  594|       |	/* Read the day of the month. */
  595|  17.2k|	if ((tm.tm_mday = strtoi_lim(s, &s, 1, 31)) < 0 || *s++ != 'T') {
  ------------------
  |  Branch (595:6): [True: 753, False: 16.5k]
  |  Branch (595:53): [True: 750, False: 15.7k]
  ------------------
  596|  1.50k|		goto out;
  597|  1.50k|	}
  598|       |	/* Read the hour. */
  599|  15.7k|	if ((tm.tm_hour = strtoi_lim(s, &s, 0, 23)) < 0 || *s++ != ':') {
  ------------------
  |  Branch (599:6): [True: 549, False: 15.2k]
  |  Branch (599:53): [True: 214, False: 14.9k]
  ------------------
  600|    763|		goto out;
  601|    763|	}
  602|       |	/* Read the minute. */
  603|  14.9k|	if ((tm.tm_min = strtoi_lim(s, &s, 0, 59)) < 0 || *s++ != ':') {
  ------------------
  |  Branch (603:6): [True: 638, False: 14.3k]
  |  Branch (603:52): [True: 221, False: 14.1k]
  ------------------
  604|    859|		goto out;
  605|    859|	}
  606|       |	/* Read the second. */
  607|  14.1k|	if ((tm.tm_sec = strtoi_lim(s, &s, 0, 60)) < 0 || *s++ != 'Z') {
  ------------------
  |  Branch (607:6): [True: 161, False: 13.9k]
  |  Branch (607:52): [True: 244, False: 13.7k]
  ------------------
  608|    405|		goto out;
  609|    405|	}
  610|       |
  611|       |	/* Adjust tm fields to satisfy POSIX constraints. */
  612|  13.7k|	tm.tm_year -= 1900;
  613|  13.7k|	tm.tm_mon--;
  614|       |
  615|       |	/* Convert the tm structure to a Unix timestamp in UTC. */
  616|  13.7k|	res = time_from_tm(&tm);
  617|       |
  618|  18.8k|out:
  619|  18.8k|	if (endptr != NULL) {
  ------------------
  |  Branch (619:6): [True: 18.8k, False: 0]
  ------------------
  620|  18.8k|		*endptr = s;
  621|  18.8k|	}
  622|  18.8k|	return res;
  623|  13.7k|}
archive_read_support_format_warc.c:strtoi_lim:
  515|  99.2k|{
  516|  99.2k|	int res = 0;
  517|  99.2k|	const char *sp;
  518|       |	/* Track the number of digits with rulim. */
  519|  99.2k|	int rulim;
  520|       |
  521|  99.2k|	for (sp = str, rulim = ulim > 10 ? ulim : 10;
  ------------------
  |  Branch (521:25): [True: 99.2k, False: 0]
  ------------------
  522|   264k|	     res * 10 <= ulim && rulim && *sp >= '0' && *sp <= '9';
  ------------------
  |  Branch (522:7): [True: 202k, False: 62.7k]
  |  Branch (522:27): [True: 200k, False: 1.11k]
  |  Branch (522:36): [True: 197k, False: 3.37k]
  |  Branch (522:50): [True: 165k, False: 31.9k]
  ------------------
  523|   165k|	     sp++, rulim /= 10) {
  524|   165k|		res *= 10;
  525|   165k|		res += *sp - '0';
  526|   165k|	}
  527|  99.2k|	if (sp == str) {
  ------------------
  |  Branch (527:6): [True: 2.55k, False: 96.6k]
  ------------------
  528|  2.55k|		res = -1;
  529|  96.6k|	} else if (res < llim || res > ulim) {
  ------------------
  |  Branch (529:13): [True: 566, False: 96.0k]
  |  Branch (529:27): [True: 404, False: 95.6k]
  ------------------
  530|    970|		res = -2;
  531|    970|	}
  532|  99.2k|	*ep = (const char*)sp;
  533|  99.2k|	return res;
  534|  99.2k|}
archive_read_support_format_warc.c:time_from_tm:
  538|  13.7k|{
  539|       |#if HAVE__MKGMTIME
  540|       |        return _mkgmtime(t);
  541|       |#elif HAVE_TIMEGM
  542|       |        /* Use platform timegm() if available. */
  543|  13.7k|        return (timegm(t));
  544|       |#else
  545|       |        int64_t days, result;
  546|       |
  547|       |        /* Otherwise, calculate directly using POSIX assumptions. */
  548|       |        /* First, fix up tm_yday based on the year, month, and day. */
  549|       |        if (mktime(t) == (time_t)-1)
  550|       |                return ((time_t)-1);
  551|       |        /* Then compute timegm() from first principles. */
  552|       |        days = (int64_t)t->tm_yday
  553|       |            + ((int64_t)t->tm_year - 70) * 365
  554|       |            + ((int64_t)t->tm_year - 69) / 4
  555|       |            - ((int64_t)t->tm_year - 1) / 100
  556|       |            + ((int64_t)t->tm_year + 299) / 400;
  557|       |        if (archive_ckd_mul_i64(&result, days, 86400) ||
  558|       |            archive_ckd_add_i64(&result, result,
  559|       |                (int64_t)t->tm_hour * 3600 + t->tm_min * 60
  560|       |                + t->tm_sec))
  561|       |                return ((time_t)-1);
  562|       |        if (result < 0) {
  563|       |                if (TIME_MIN == 0 || result < (int64_t)TIME_MIN)
  564|       |                        return ((time_t)-1);
  565|       |        } else if ((uint64_t)result > (uint64_t)TIME_MAX)
  566|       |                return ((time_t)-1);
  567|       |        return ((time_t)result);
  568|       |#endif
  569|  13.7k|}
archive_read_support_format_warc.c:warc_read_type:
  677|  13.6k|{
  678|  13.6k|	static const char _key[] = "\r\nWARC-Type:";
  679|  13.6k|	const char *val, *eol;
  680|       |
  681|  13.6k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (681:6): [True: 2.35k, False: 11.2k]
  ------------------
  682|       |		/* Header field is absent. */
  683|  2.35k|		return WT_NONE;
  684|  2.35k|	}
  685|  11.2k|	val += sizeof(_key) - 1U;
  686|  11.2k|	if ((eol = warc_find_eol(val, buf + bsz - val)) == NULL) {
  ------------------
  |  Branch (686:6): [True: 0, False: 11.2k]
  ------------------
  687|       |		/* Header field has no end of line. */
  688|      0|		return WT_NONE;
  689|      0|	}
  690|       |
  691|       |	/* Skip leading whitespace. */
  692|  31.6k|	while (val < eol && (*val == ' ' || *val == '\t'))
  ------------------
  |  Branch (692:9): [True: 31.4k, False: 243]
  |  Branch (692:23): [True: 11.2k, False: 20.2k]
  |  Branch (692:38): [True: 9.15k, False: 11.0k]
  ------------------
  693|  20.4k|		++val;
  694|       |
  695|  11.2k|	if (val + 8U == eol) {
  ------------------
  |  Branch (695:6): [True: 9.85k, False: 1.43k]
  ------------------
  696|  9.85k|		if (memcmp(val, "resource", 8U) == 0)
  ------------------
  |  Branch (696:7): [True: 553, False: 9.30k]
  ------------------
  697|    553|			return WT_RSRC;
  698|  9.30k|		else if (memcmp(val, "response", 8U) == 0)
  ------------------
  |  Branch (698:12): [True: 8.86k, False: 437]
  ------------------
  699|  8.86k|			return WT_RSP;
  700|  9.85k|	}
  701|  1.87k|	return WT_NONE;
  702|  11.2k|}
archive_read_support_format_warc.c:warc_read_uri:
  706|  9.41k|{
  707|  9.41k|	static const char _key[] = "\r\nWARC-Target-URI:";
  708|  9.41k|	const char *val, *uri, *eol, *p;
  709|  9.41k|	warc_string_t res = {0U, NULL};
  710|       |
  711|  9.41k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (711:6): [True: 320, False: 9.09k]
  ------------------
  712|       |		/* Header field is absent. */
  713|    320|		return res;
  714|    320|	}
  715|       |	/* Skip leading whitespace. */
  716|  9.09k|	val += sizeof(_key) - 1U;
  717|  9.09k|	if ((eol = warc_find_eol(val, buf + bsz - val)) == NULL) {
  ------------------
  |  Branch (717:6): [True: 0, False: 9.09k]
  ------------------
  718|       |		/* Header field has no end of line. */
  719|      0|		return res;
  720|      0|	}
  721|       |
  722|  10.8k|	while (val < eol && (*val == ' ' || *val == '\t'))
  ------------------
  |  Branch (722:9): [True: 10.4k, False: 335]
  |  Branch (722:23): [True: 477, False: 10.0k]
  |  Branch (722:38): [True: 1.23k, False: 8.76k]
  ------------------
  723|  1.71k|		++val;
  724|       |
  725|       |	/* Locate the :// separator. */
  726|  9.09k|	if ((uri = xmemmem(val, eol - val, "://", 3U)) == NULL) {
  ------------------
  |  Branch (726:6): [True: 777, False: 8.32k]
  ------------------
  727|       |		/* Ignore values without a :// separator. */
  728|    777|		return res;
  729|    777|	}
  730|       |
  731|       |	/* Spaces inside a URI are not allowed; CRLF should follow. */
  732|   265k|	for (p = val; p < eol; p++) {
  ------------------
  |  Branch (732:16): [True: 257k, False: 8.00k]
  ------------------
  733|   257k|		if (isspace((unsigned char)*p))
  ------------------
  |  Branch (733:7): [True: 321, False: 256k]
  ------------------
  734|    321|			return res;
  735|   257k|	}
  736|       |
  737|       |	/* Require enough room for the shortest supported scheme. */
  738|  8.00k|	if (uri < (val + 3U))
  ------------------
  |  Branch (738:6): [True: 403, False: 7.59k]
  ------------------
  739|    403|		return res;
  740|       |
  741|       |	/* Move uri past the :// separator. */
  742|  7.59k|	uri += 3U;
  743|       |
  744|       |	/* Inspect the scheme prefix. */
  745|  7.59k|	if (memcmp(val, "file", 4U) == 0) {
  ------------------
  |  Branch (745:6): [True: 5.35k, False: 2.24k]
  ------------------
  746|       |		/* Keep file:// paths as-is. */
  747|       |
  748|  5.35k|	} else if (memcmp(val, "http", 4U) == 0 ||
  ------------------
  |  Branch (748:13): [True: 1.45k, False: 789]
  ------------------
  749|  2.09k|		   memcmp(val, "ftp", 3U) == 0) {
  ------------------
  |  Branch (749:6): [True: 638, False: 151]
  ------------------
  750|       |		/* Skip the domain and the first slash. */
  751|  11.8k|		while (uri < eol && *uri++ != '/');
  ------------------
  |  Branch (751:10): [True: 11.6k, False: 283]
  |  Branch (751:23): [True: 9.80k, False: 1.81k]
  ------------------
  752|  2.09k|	} else {
  753|       |		/* Unsupported URI scheme. */
  754|    151|		return res;
  755|    151|	}
  756|  7.44k|	res.str = uri;
  757|  7.44k|	res.len = eol - uri;
  758|  7.44k|	return res;
  759|  7.59k|}
archive_read_support_format_warc.c:warc_read_last_modified:
  830|  6.95k|{
  831|  6.95k|	static const char _key[] = "\r\nLast-Modified:";
  832|  6.95k|	const char *val, *eol, *on = NULL;
  833|  6.95k|	time_t res;
  834|       |
  835|  6.95k|	if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
  ------------------
  |  Branch (835:6): [True: 1.84k, False: 5.11k]
  ------------------
  836|       |		/* Header field is absent. */
  837|  1.84k|		return (time_t)-1;
  838|  1.84k|	}
  839|  5.11k|	val += sizeof(_key) - 1U;
  840|  5.11k|	if ((eol = warc_find_eol(val, buf + bsz - val)) == NULL ) {
  ------------------
  |  Branch (840:6): [True: 0, False: 5.11k]
  ------------------
  841|       |		/* Header field has no end of line. */
  842|      0|		return -1;
  843|      0|	}
  844|       |
  845|       |	/* xstrpisotime() skips leading whitespace. */
  846|  5.11k|	res = xstrpisotime(val, &on);
  847|  5.11k|	if (on != eol) {
  ------------------
  |  Branch (847:6): [True: 4.94k, False: 163]
  ------------------
  848|       |		/* The field must end here. */
  849|  4.94k|		return -1;
  850|  4.94k|	}
  851|    163|	return res;
  852|  5.11k|}
archive_read_support_format_warc.c:archive_read_format_warc_read_data:
  398|  20.8k|{
  399|  20.8k|	struct warc *warc = a->format->data;
  400|  20.8k|	const char *rab;
  401|  20.8k|	ssize_t nrd;
  402|       |
  403|  20.8k|	if (warc->unconsumed) {
  ------------------
  |  Branch (403:6): [True: 6.94k, False: 13.8k]
  ------------------
  404|  6.94k|		__archive_read_consume(a, warc->unconsumed);
  405|  6.94k|		warc->unconsumed = 0;
  406|  6.94k|	}
  407|       |
  408|  20.8k|	if (warc->cntoff >= warc->cntlen) {
  ------------------
  |  Branch (408:6): [True: 13.8k, False: 6.98k]
  ------------------
  409|       |		/* No data is available to return for this entry. */
  410|  13.8k|		*buf = NULL;
  411|  13.8k|		*bsz = 0U;
  412|  13.8k|		*off = warc->cntoff;
  413|  13.8k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  13.8k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  414|  13.8k|	}
  415|       |
  416|  6.98k|	rab = __archive_read_ahead(a, 1U, &nrd);
  417|  6.98k|	if (nrd < 0) {
  ------------------
  |  Branch (417:6): [True: 0, False: 6.98k]
  ------------------
  418|      0|		*bsz = 0U;
  419|       |		/* Propagate the read error. */
  420|      0|		return (int)nrd;
  421|  6.98k|	} else if (nrd == 0) {
  ------------------
  |  Branch (421:13): [True: 41, False: 6.94k]
  ------------------
  422|     41|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     41|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  423|     41|		    "Truncated WARC file data");
  424|     41|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     41|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  425|  6.94k|	} else if ((int64_t)nrd > warc->cntlen - warc->cntoff) {
  ------------------
  |  Branch (425:13): [True: 6.91k, False: 32]
  ------------------
  426|       |		/* Clamp reads to Content-Length. */
  427|  6.91k|		nrd = warc->cntlen - warc->cntoff;
  428|  6.91k|	}
  429|  6.94k|	*off = warc->cntoff;
  430|  6.94k|	*bsz = nrd;
  431|  6.94k|	*buf = rab;
  432|       |
  433|  6.94k|	warc->cntoff += nrd;
  434|  6.94k|	warc->unconsumed = nrd;
  435|  6.94k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  6.94k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  436|  6.98k|}
archive_read_support_format_warc.c:archive_read_format_warc_skip:
  440|  13.6k|{
  441|  13.6k|	struct warc *warc = a->format->data;
  442|       |
  443|  13.6k|	if (warc->cntoff > warc->cntlen)
  ------------------
  |  Branch (443:6): [True: 0, False: 13.6k]
  ------------------
  444|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  445|  13.6k|	if (warc->unconsumed) {
  ------------------
  |  Branch (445:6): [True: 0, False: 13.6k]
  ------------------
  446|      0|		__archive_read_consume(a, warc->unconsumed);
  447|      0|		warc->unconsumed = 0;
  448|      0|	}
  449|  13.6k|	if (__archive_read_consume(a, warc->cntlen - warc->cntoff) < 0 ||
  ------------------
  |  Branch (449:6): [True: 38, False: 13.5k]
  ------------------
  450|  13.5k|	    __archive_read_consume(a, 4U/*\r\n\r\n separator*/) < 0)
  ------------------
  |  Branch (450:6): [True: 22, False: 13.5k]
  ------------------
  451|     60|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     60|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  452|  13.5k|	warc->cntlen = 0;
  453|  13.5k|	warc->cntoff = 0;
  454|  13.5k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  13.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  455|  13.6k|}

archive_read_support_format_xar:
  465|  16.7k|{
  466|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
  467|  16.7k|	struct xar *xar;
  468|  16.7k|	int r;
  469|       |
  470|  16.7k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
  471|  16.7k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_xar");
  472|       |
  473|  16.7k|	xar = calloc(1, sizeof(*xar));
  474|  16.7k|	if (xar == NULL) {
  ------------------
  |  Branch (474:6): [True: 0, False: 16.7k]
  ------------------
  475|      0|		archive_set_error(_a, ENOMEM, "Can't allocate xar data");
  476|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  477|      0|	}
  478|       |
  479|       |	/* initialize xar->file_queue */
  480|  16.7k|	xar->file_queue.allocated = 0;
  481|  16.7k|	xar->file_queue.used = 0;
  482|  16.7k|	xar->file_queue.files = NULL;
  483|       |
  484|  16.7k|	r = __archive_read_register_format(a,
  485|  16.7k|	    xar,
  486|  16.7k|	    "xar",
  487|  16.7k|	    xar_bid,
  488|  16.7k|	    NULL,
  489|  16.7k|	    xar_read_header,
  490|  16.7k|	    xar_read_data,
  491|  16.7k|	    xar_read_data_skip,
  492|  16.7k|	    NULL,
  493|  16.7k|	    xar_cleanup,
  494|  16.7k|	    NULL,
  495|  16.7k|	    NULL);
  496|       |
  497|  16.7k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (497:6): [True: 0, False: 16.7k]
  ------------------
  498|      0|		free(xar);
  499|  16.7k|	return (r);
  500|  16.7k|}
archive_read_support_format_xar.c:xar_bid:
  504|  16.4k|{
  505|  16.4k|	const char *h;
  506|  16.4k|	int bid;
  507|       |
  508|  16.4k|	(void)best_bid; /* UNUSED */
  509|       |
  510|  16.4k|	h = __archive_read_ahead(a, HEADER_SIZE, NULL);
  ------------------
  |  |  109|  16.4k|#define HEADER_SIZE	28
  ------------------
  511|  16.4k|	if (h == NULL)
  ------------------
  |  Branch (511:6): [True: 178, False: 16.2k]
  ------------------
  512|    178|		return (-1);
  513|       |
  514|  16.2k|	bid = 0;
  515|       |	/*
  516|       |	 * Verify magic code
  517|       |	 */
  518|  16.2k|	if (archive_be32dec(h) != HEADER_MAGIC)
  ------------------
  |  |  108|  16.2k|#define HEADER_MAGIC	0x78617221
  ------------------
  |  Branch (518:6): [True: 15.1k, False: 1.07k]
  ------------------
  519|  15.1k|		return (0);
  520|  1.07k|	bid += 32;
  521|       |	/*
  522|       |	 * Verify header size
  523|       |	 */
  524|  1.07k|	if (archive_be16dec(h+4) != HEADER_SIZE)
  ------------------
  |  |  109|  1.07k|#define HEADER_SIZE	28
  ------------------
  |  Branch (524:6): [True: 0, False: 1.07k]
  ------------------
  525|      0|		return (0);
  526|  1.07k|	bid += 16;
  527|       |	/*
  528|       |	 * Verify header version
  529|       |	 */
  530|  1.07k|	if (archive_be16dec(h+6) != HEADER_VERSION)
  ------------------
  |  |  110|  1.07k|#define HEADER_VERSION	1
  ------------------
  |  Branch (530:6): [True: 0, False: 1.07k]
  ------------------
  531|      0|		return (0);
  532|  1.07k|	bid += 16;
  533|       |	/*
  534|       |	 * Verify type of checksum
  535|       |	 */
  536|  1.07k|	switch (archive_be32dec(h+24)) {
  537|     91|	case CKSUM_NONE:
  ------------------
  |  |  111|     91|#define CKSUM_NONE	0
  ------------------
  |  Branch (537:2): [True: 91, False: 985]
  ------------------
  538|  1.04k|	case CKSUM_SHA1:
  ------------------
  |  |  112|  1.04k|#define CKSUM_SHA1	1
  ------------------
  |  Branch (538:2): [True: 957, False: 119]
  ------------------
  539|  1.06k|	case CKSUM_MD5:
  ------------------
  |  |  113|  1.06k|#define CKSUM_MD5	2
  ------------------
  |  Branch (539:2): [True: 19, False: 1.05k]
  ------------------
  540|  1.07k|	case CKSUM_SHA256:
  ------------------
  |  |  114|  1.07k|#define CKSUM_SHA256	3
  ------------------
  |  Branch (540:2): [True: 3, False: 1.07k]
  ------------------
  541|  1.07k|	case CKSUM_SHA512:
  ------------------
  |  |  115|  1.07k|#define CKSUM_SHA512	4
  ------------------
  |  Branch (541:2): [True: 6, False: 1.07k]
  ------------------
  542|  1.07k|		bid += 32;
  543|  1.07k|		break;
  544|      0|	default:
  ------------------
  |  Branch (544:2): [True: 0, False: 1.07k]
  ------------------
  545|      0|		return (0);
  546|  1.07k|	}
  547|       |
  548|  1.07k|	return (bid);
  549|  1.07k|}
archive_read_support_format_xar.c:xar_read_header:
  689|  1.07k|{
  690|  1.07k|	struct xar *xar = a->format->data;
  691|  1.07k|	struct xar_file *file;
  692|  1.07k|	struct xattr *xattr;
  693|  1.07k|	int r;
  694|       |
  695|  1.07k|	r = ARCHIVE_OK;
  ------------------
  |  |  233|  1.07k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  696|       |
  697|  1.07k|	if (xar->offset == 0) {
  ------------------
  |  Branch (697:6): [True: 1.07k, False: 0]
  ------------------
  698|       |		/* Create a character conversion object. */
  699|  1.07k|		if (xar->sconv == NULL) {
  ------------------
  |  Branch (699:7): [True: 1.07k, False: 0]
  ------------------
  700|  1.07k|			xar->sconv = archive_string_conversion_from_charset(
  701|  1.07k|			    &(a->archive), "UTF-8", 1);
  702|  1.07k|			if (xar->sconv == NULL)
  ------------------
  |  Branch (702:8): [True: 0, False: 1.07k]
  ------------------
  703|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  704|  1.07k|		}
  705|       |
  706|       |		/* Read TOC. */
  707|  1.07k|		r = read_toc(a);
  708|  1.07k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  1.07k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (708:7): [True: 1.07k, False: 0]
  ------------------
  709|  1.07k|			return (r);
  710|  1.07k|	}
  711|       |
  712|      0|	for (;;) {
  713|      0|		file = xar->file = heap_get_entry(&(xar->file_queue));
  714|      0|		if (file == NULL) {
  ------------------
  |  Branch (714:7): [True: 0, False: 0]
  ------------------
  715|      0|			xar->end_of_file = 1;
  716|      0|			return (ARCHIVE_EOF);
  ------------------
  |  |  232|      0|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
  717|      0|		}
  718|      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 (718:7): [True: 0, False: 0]
  ------------------
  719|      0|			break;
  720|      0|		if (file->has != (HAS_PATHNAME | HAS_TYPE))
  ------------------
  |  |  174|      0|#define HAS_PATHNAME		0x00002
  ------------------
              		if (file->has != (HAS_PATHNAME | HAS_TYPE))
  ------------------
  |  |  180|      0|#define HAS_TYPE		0x00080
  ------------------
  |  Branch (720:7): [True: 0, False: 0]
  ------------------
  721|      0|			break;
  722|       |		/*
  723|       |		 * If a file type is a directory and it does not have
  724|       |		 * any metadata, do not export.
  725|       |		 */
  726|      0|		file_free(file);
  727|      0|	}
  728|      0|        if (file->has & HAS_ATIME) {
  ------------------
  |  |  190|      0|#define HAS_ATIME		0x20000
  ------------------
  |  Branch (728:13): [True: 0, False: 0]
  ------------------
  729|      0|          archive_entry_set_atime(entry, file->atime, 0);
  730|      0|        }
  731|      0|        if (file->has & HAS_CTIME) {
  ------------------
  |  |  188|      0|#define HAS_CTIME		0x08000
  ------------------
  |  Branch (731:13): [True: 0, False: 0]
  ------------------
  732|      0|          archive_entry_set_ctime(entry, file->ctime, 0);
  733|      0|        }
  734|      0|        if (file->has & HAS_MTIME) {
  ------------------
  |  |  189|      0|#define HAS_MTIME		0x10000
  ------------------
  |  Branch (734:13): [True: 0, False: 0]
  ------------------
  735|      0|          archive_entry_set_mtime(entry, file->mtime, 0);
  736|      0|        }
  737|      0|	archive_entry_set_gid(entry, file->gid);
  738|      0|	if (file->gname.length > 0 &&
  ------------------
  |  Branch (738:6): [True: 0, False: 0]
  ------------------
  739|      0|	    archive_entry_copy_gname_l(entry, file->gname.s,
  ------------------
  |  |   71|      0|#define archive_entry_copy_gname_l	__archive_entry_copy_gname_l
  ------------------
  |  Branch (739:6): [True: 0, False: 0]
  ------------------
  740|      0|		archive_strlen(&(file->gname)), xar->sconv) != 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  741|      0|		if (errno == ENOMEM) {
  ------------------
  |  Branch (741:7): [True: 0, False: 0]
  ------------------
  742|      0|			archive_set_error(&a->archive, ENOMEM,
  743|      0|			    "Can't allocate memory for Gname");
  744|      0|			file_free(file);
  745|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  746|      0|		}
  747|      0|		archive_set_error(&a->archive,
  748|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  749|      0|		    "Gname cannot be converted from %s to current locale",
  750|      0|		    archive_string_conversion_charset_name(xar->sconv));
  751|      0|		r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  752|      0|	}
  753|      0|	archive_entry_set_uid(entry, file->uid);
  754|      0|	if (file->uname.length > 0 &&
  ------------------
  |  Branch (754:6): [True: 0, False: 0]
  ------------------
  755|      0|	    archive_entry_copy_uname_l(entry, file->uname.s,
  ------------------
  |  |   86|      0|#define archive_entry_copy_uname_l	__archive_entry_copy_uname_l
  ------------------
  |  Branch (755:6): [True: 0, False: 0]
  ------------------
  756|      0|		archive_strlen(&(file->uname)), xar->sconv) != 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  757|      0|		if (errno == ENOMEM) {
  ------------------
  |  Branch (757:7): [True: 0, False: 0]
  ------------------
  758|      0|			archive_set_error(&a->archive, ENOMEM,
  759|      0|			    "Can't allocate memory for Uname");
  760|      0|			file_free(file);
  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|		    "Uname 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|      0|	archive_entry_set_mode(entry, file->mode);
  770|      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 (770:6): [True: 0, False: 0]
  ------------------
  771|      0|	    archive_strlen(&(file->pathname)), xar->sconv) != 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  772|      0|		if (errno == ENOMEM) {
  ------------------
  |  Branch (772:7): [True: 0, False: 0]
  ------------------
  773|      0|			archive_set_error(&a->archive, ENOMEM,
  774|      0|			    "Can't allocate memory for Pathname");
  775|      0|			file_free(file);
  776|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  777|      0|		}
  778|      0|		archive_set_error(&a->archive,
  779|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  780|      0|		    "Pathname cannot be converted from %s to current locale",
  781|      0|		    archive_string_conversion_charset_name(xar->sconv));
  782|      0|		r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  783|      0|	}
  784|       |
  785|       |
  786|      0|	if (file->symlink.length > 0 &&
  ------------------
  |  Branch (786:6): [True: 0, False: 0]
  ------------------
  787|      0|	    archive_entry_copy_symlink_l(entry, file->symlink.s,
  ------------------
  |  |   83|      0|#define archive_entry_copy_symlink_l	__archive_entry_copy_symlink_l
  ------------------
  |  Branch (787:6): [True: 0, False: 0]
  ------------------
  788|      0|		archive_strlen(&(file->symlink)), xar->sconv) != 0) {
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  789|      0|		if (errno == ENOMEM) {
  ------------------
  |  Branch (789:7): [True: 0, False: 0]
  ------------------
  790|      0|			archive_set_error(&a->archive, ENOMEM,
  791|      0|			    "Can't allocate memory for Linkname");
  792|      0|			file_free(file);
  793|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  794|      0|		}
  795|      0|		archive_set_error(&a->archive,
  796|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  797|      0|		    "Linkname cannot be converted from %s to current locale",
  798|      0|		    archive_string_conversion_charset_name(xar->sconv));
  799|      0|		r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  800|      0|	}
  801|       |	/* Set proper nlink. */
  802|      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 (802:6): [True: 0, False: 0]
  ------------------
  803|      0|		archive_entry_set_nlink(entry, file->subdirs + 2);
  804|      0|	else
  805|      0|		archive_entry_set_nlink(entry, file->nlink);
  806|      0|	archive_entry_set_size(entry, file->size);
  807|      0|	if (archive_strlen(&(file->hardlink)) > 0)
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (807:6): [True: 0, False: 0]
  ------------------
  808|      0|		archive_entry_set_hardlink(entry, file->hardlink.s);
  809|      0|	archive_entry_set_ino64(entry, file->ino64);
  810|      0|	if (file->has & HAS_DEV)
  ------------------
  |  |  181|      0|#define HAS_DEV			0x00100
  ------------------
  |  Branch (810:6): [True: 0, False: 0]
  ------------------
  811|      0|		archive_entry_set_dev(entry, file->dev);
  812|      0|	if (file->has & HAS_DEVMAJOR)
  ------------------
  |  |  182|      0|#define HAS_DEVMAJOR		0x00200
  ------------------
  |  Branch (812:6): [True: 0, False: 0]
  ------------------
  813|      0|		archive_entry_set_devmajor(entry, file->devmajor);
  814|      0|	if (file->has & HAS_DEVMINOR)
  ------------------
  |  |  183|      0|#define HAS_DEVMINOR		0x00400
  ------------------
  |  Branch (814:6): [True: 0, False: 0]
  ------------------
  815|      0|		archive_entry_set_devminor(entry, file->devminor);
  816|      0|	if (archive_strlen(&(file->fflags_text)) > 0)
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (816:6): [True: 0, False: 0]
  ------------------
  817|      0|		archive_entry_copy_fflags_text(entry, file->fflags_text.s);
  818|       |
  819|      0|	xar->entry_init = 1;
  820|      0|	xar->entry_total = 0;
  821|      0|	xar->entry_remaining = file->length;
  822|      0|	xar->entry_size = file->size;
  823|      0|	xar->entry_encoding = file->encoding;
  824|      0|	xar->entry_a_sum = file->a_sum;
  825|      0|	xar->entry_e_sum = file->e_sum;
  826|       |	/*
  827|       |	 * Read extended attributes.
  828|       |	 */
  829|      0|	xattr = file->xattr_list;
  830|      0|	while (xattr != NULL) {
  ------------------
  |  Branch (830:9): [True: 0, False: 0]
  ------------------
  831|      0|		const void *d;
  832|      0|		size_t outbytes = 0;
  833|      0|		size_t used = 0;
  834|       |
  835|      0|		r = move_reading_point(a, xattr->offset);
  836|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (836:7): [True: 0, False: 0]
  ------------------
  837|      0|			break;
  838|      0|		r = rd_contents_init(a, xattr->encoding,
  839|      0|		    xattr->a_sum.alg, xattr->e_sum.alg);
  840|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (840:7): [True: 0, False: 0]
  ------------------
  841|      0|			break;
  842|      0|		d = NULL;
  843|      0|		r = rd_contents(a, &d, &outbytes, &used, xattr->length);
  844|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (844:7): [True: 0, False: 0]
  ------------------
  845|      0|			break;
  846|      0|		if (outbytes != xattr->size) {
  ------------------
  |  Branch (846:7): [True: 0, False: 0]
  ------------------
  847|      0|			archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  848|      0|			    "Decompressed size error");
  849|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  850|      0|			break;
  851|      0|		}
  852|      0|		r = checksum_final(a,
  853|      0|		    xattr->a_sum.val, xattr->a_sum.len,
  854|      0|		    xattr->e_sum.val, xattr->e_sum.len);
  855|      0|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (855:7): [True: 0, False: 0]
  ------------------
  856|       |#ifndef DONT_FAIL_ON_CRC_ERROR
  857|       |			archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  858|       |			    "Xattr checksum error");
  859|       |			r = ARCHIVE_WARN;
  860|       |			break;
  861|       |#endif
  862|      0|		}
  863|      0|		if (xattr->name.s == NULL) {
  ------------------
  |  Branch (863:7): [True: 0, False: 0]
  ------------------
  864|      0|			archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  865|      0|			    "Xattr name error");
  866|      0|			r = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
  867|      0|			break;
  868|      0|		}
  869|      0|		archive_entry_xattr_add_entry(entry,
  870|      0|		    xattr->name.s, d, outbytes);
  871|      0|		xattr = xattr->next;
  872|      0|	}
  873|      0|	if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (873:6): [True: 0, False: 0]
  ------------------
  874|      0|		file_free(file);
  875|      0|		return (r);
  876|      0|	}
  877|       |
  878|      0|	if (xar->entry_remaining > 0)
  ------------------
  |  Branch (878:6): [True: 0, False: 0]
  ------------------
  879|       |		/* Move reading point to the beginning of current
  880|       |		 * file contents. */
  881|      0|		r = move_reading_point(a, file->offset);
  882|      0|	else
  883|      0|		r = ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  884|       |
  885|      0|	file_free(file);
  886|      0|	return (r);
  887|      0|}
archive_read_support_format_xar.c:read_toc:
  553|  1.07k|{
  554|  1.07k|	struct xar *xar = a->format->data;
  555|  1.07k|	struct xar_file *file;
  556|  1.07k|	const unsigned char *b;
  557|  1.07k|	uint64_t toc_compressed_size;
  558|  1.07k|	uint64_t toc_uncompressed_size;
  559|  1.07k|	uint32_t toc_chksum_alg;
  560|  1.07k|	ssize_t bytes;
  561|  1.07k|	int r;
  562|       |
  563|       |	/*
  564|       |	 * Read xar header.
  565|       |	 */
  566|  1.07k|	b = __archive_read_ahead(a, HEADER_SIZE, &bytes);
  ------------------
  |  |  109|  1.07k|#define HEADER_SIZE	28
  ------------------
  567|  1.07k|	if (bytes < 0)
  ------------------
  |  Branch (567:6): [True: 0, False: 1.07k]
  ------------------
  568|      0|		return ((int)bytes);
  569|  1.07k|	if (bytes < HEADER_SIZE) {
  ------------------
  |  |  109|  1.07k|#define HEADER_SIZE	28
  ------------------
  |  Branch (569:6): [True: 0, False: 1.07k]
  ------------------
  570|      0|		archive_set_error(&a->archive,
  571|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  572|      0|		    "Truncated archive header");
  573|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  574|      0|	}
  575|       |
  576|  1.07k|	if (archive_be32dec(b) != HEADER_MAGIC) {
  ------------------
  |  |  108|  1.07k|#define HEADER_MAGIC	0x78617221
  ------------------
  |  Branch (576:6): [True: 0, False: 1.07k]
  ------------------
  577|      0|		archive_set_error(&a->archive,
  578|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  579|      0|		    "Invalid header magic");
  580|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  581|      0|	}
  582|  1.07k|	if (archive_be16dec(b+6) != HEADER_VERSION) {
  ------------------
  |  |  110|  1.07k|#define HEADER_VERSION	1
  ------------------
  |  Branch (582:6): [True: 0, False: 1.07k]
  ------------------
  583|      0|		archive_set_error(&a->archive,
  584|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  585|      0|		    "Unsupported header version(%d)",
  586|      0|		    archive_be16dec(b+6));
  587|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  588|      0|	}
  589|  1.07k|	toc_compressed_size = archive_be64dec(b+8);
  590|  1.07k|	xar->toc_remaining = toc_compressed_size;
  591|  1.07k|	toc_uncompressed_size = archive_be64dec(b+16);
  592|  1.07k|	toc_chksum_alg = archive_be32dec(b+24);
  593|  1.07k|	__archive_read_consume(a, HEADER_SIZE);
  ------------------
  |  |  109|  1.07k|#define HEADER_SIZE	28
  ------------------
  594|  1.07k|	xar->offset += HEADER_SIZE;
  ------------------
  |  |  109|  1.07k|#define HEADER_SIZE	28
  ------------------
  595|  1.07k|	xar->toc_total = 0;
  596|       |
  597|       |	/*
  598|       |	 * Read TOC(Table of Contents).
  599|       |	 */
  600|       |	/* Initialize reading contents. */
  601|  1.07k|	r = move_reading_point(a, HEADER_SIZE);
  ------------------
  |  |  109|  1.07k|#define HEADER_SIZE	28
  ------------------
  602|  1.07k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  1.07k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (602:6): [True: 0, False: 1.07k]
  ------------------
  603|      0|		return (r);
  604|  1.07k|	r = rd_contents_init(a, GZIP, toc_chksum_alg, CKSUM_NONE);
  ------------------
  |  |  111|  1.07k|#define CKSUM_NONE	0
  ------------------
  605|  1.07k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  1.07k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (605:6): [True: 0, False: 1.07k]
  ------------------
  606|      0|		return (r);
  607|       |
  608|  1.07k|#ifdef HAVE_LIBXML_XMLREADER_H
  609|  1.07k|	r = xml2_read_toc(a);
  610|       |#elif defined(HAVE_BSDXML_H) || defined(HAVE_EXPAT_H)
  611|       |	r = expat_read_toc(a);
  612|       |#elif defined(HAVE_XMLLITE_H)
  613|       |	r = xmllite_read_toc(a);
  614|       |#endif
  615|  1.07k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  1.07k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (615:6): [True: 1.07k, False: 0]
  ------------------
  616|  1.07k|		return (r);
  617|       |
  618|       |	/* Set 'The HEAP' base. */
  619|      0|	xar->h_base = xar->offset;
  620|      0|	if (xar->toc_total != toc_uncompressed_size) {
  ------------------
  |  Branch (620:6): [True: 0, False: 0]
  ------------------
  621|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
  622|      0|		    "TOC uncompressed size error");
  623|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  624|      0|	}
  625|       |
  626|       |	/*
  627|       |	 * Checksum TOC
  628|       |	 */
  629|      0|	if (toc_chksum_alg != CKSUM_NONE) {
  ------------------
  |  |  111|      0|#define CKSUM_NONE	0
  ------------------
  |  Branch (629:6): [True: 0, False: 0]
  ------------------
  630|      0|		r = move_reading_point(a, xar->toc_chksum_offset);
  631|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (631:7): [True: 0, False: 0]
  ------------------
  632|      0|			return (r);
  633|      0|		b = __archive_read_ahead(a,
  634|      0|			(size_t)xar->toc_chksum_size, &bytes);
  635|      0|		if (bytes < 0)
  ------------------
  |  Branch (635:7): [True: 0, False: 0]
  ------------------
  636|      0|			return ((int)bytes);
  637|      0|		if ((uint64_t)bytes < xar->toc_chksum_size) {
  ------------------
  |  Branch (637:7): [True: 0, False: 0]
  ------------------
  638|      0|			archive_set_error(&a->archive,
  639|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  640|      0|			    "Truncated archive file");
  641|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  642|      0|		}
  643|      0|		r = checksum_final(a, b,
  644|      0|			(size_t)xar->toc_chksum_size, NULL, 0);
  645|      0|		__archive_read_consume(a, xar->toc_chksum_size);
  646|      0|		xar->offset += xar->toc_chksum_size;
  647|       |#ifndef DONT_FAIL_ON_CRC_ERROR
  648|       |		if (r != ARCHIVE_OK)
  649|       |			return (ARCHIVE_FATAL);
  650|       |#endif
  651|      0|	}
  652|       |
  653|       |	/*
  654|       |	 * Connect hardlinked files.
  655|       |	 */
  656|      0|	for (file = xar->hdlink_orgs; file != NULL; file = file->hdnext) {
  ------------------
  |  Branch (656:32): [True: 0, False: 0]
  ------------------
  657|      0|		struct hdlink **hdlink;
  658|       |
  659|      0|		for (hdlink = &(xar->hdlink_list); *hdlink != NULL;
  ------------------
  |  Branch (659:38): [True: 0, False: 0]
  ------------------
  660|      0|		    hdlink = &((*hdlink)->next)) {
  661|      0|			if ((*hdlink)->id == file->id) {
  ------------------
  |  Branch (661:8): [True: 0, False: 0]
  ------------------
  662|      0|				struct hdlink *hltmp;
  663|      0|				struct xar_file *f2;
  664|      0|				int nlink = (*hdlink)->cnt + 1;
  665|       |
  666|      0|				file->nlink = nlink;
  667|      0|				for (f2 = (*hdlink)->files; f2 != NULL;
  ------------------
  |  Branch (667:33): [True: 0, False: 0]
  ------------------
  668|      0|				    f2 = f2->hdnext) {
  669|      0|					f2->nlink = nlink;
  670|      0|					archive_string_copy(
  ------------------
  |  |  133|      0|	((dest)->length = 0, archive_string_concat((dest), (src)))
  ------------------
  671|      0|					    &(f2->hardlink), &(file->pathname));
  672|      0|				}
  673|       |				/* Remove resolved files from hdlist_list. */
  674|      0|				hltmp = *hdlink;
  675|      0|				*hdlink = hltmp->next;
  676|      0|				free(hltmp);
  677|      0|				break;
  678|      0|			}
  679|      0|		}
  680|      0|	}
  681|      0|	a->archive.archive_format = ARCHIVE_FORMAT_XAR;
  ------------------
  |  |  381|      0|#define	ARCHIVE_FORMAT_XAR			0xA0000
  ------------------
  682|      0|	a->archive.archive_format_name = "xar";
  683|       |
  684|      0|	return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  685|      0|}
archive_read_support_format_xar.c:xml2_read_toc:
 3278|  1.07k|{
 3279|  1.07k|	xmlTextReaderPtr reader;
 3280|  1.07k|	struct xmlattr_list list;
 3281|  1.07k|	int r;
 3282|       |
 3283|  1.07k|	reader = xmlReaderForIO(xml2_read_cb, xml2_close_cb, a, NULL, NULL, 0);
 3284|  1.07k|	if (reader == NULL) {
  ------------------
  |  Branch (3284:6): [True: 0, False: 1.07k]
  ------------------
 3285|      0|		archive_set_error(&a->archive, ENOMEM,
 3286|      0|		    "Couldn't allocate memory for xml parser");
 3287|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3288|      0|	}
 3289|  1.07k|	xmlTextReaderSetErrorHandler(reader, xml2_error_hdr, a);
 3290|       |
 3291|   343k|	while ((r = xmlTextReaderRead(reader)) == 1) {
  ------------------
  |  Branch (3291:9): [True: 342k, False: 1.06k]
  ------------------
 3292|   342k|		const char *name, *value;
 3293|   342k|		int type, empty;
 3294|       |
 3295|   342k|		type = xmlTextReaderNodeType(reader);
 3296|   342k|		name = (const char *)xmlTextReaderConstLocalName(reader);
 3297|   342k|		switch (type) {
 3298|   123k|		case XML_READER_TYPE_ELEMENT:
  ------------------
  |  Branch (3298:3): [True: 123k, False: 219k]
  ------------------
 3299|   123k|			empty = xmlTextReaderIsEmptyElement(reader);
 3300|   123k|			r = xml2_xmlattr_setup(a, &list, reader);
 3301|   123k|			if (r == ARCHIVE_OK)
  ------------------
  |  |  233|   123k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3301:8): [True: 123k, False: 0]
  ------------------
 3302|   123k|				r = xml_start(a, name, &list);
 3303|   123k|			xmlattr_cleanup(&list);
 3304|   123k|			if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|   123k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3304:8): [True: 1, False: 123k]
  ------------------
 3305|      1|				xmlFreeTextReader(reader);
 3306|      1|				xmlCleanupParser();
 3307|      1|				return (r);
 3308|      1|			}
 3309|   123k|			if (empty)
  ------------------
  |  Branch (3309:8): [True: 64.2k, False: 59.1k]
  ------------------
 3310|  64.2k|				xml_end(a, name);
 3311|   123k|			break;
 3312|  48.3k|		case XML_READER_TYPE_END_ELEMENT:
  ------------------
  |  Branch (3312:3): [True: 48.3k, False: 294k]
  ------------------
 3313|  48.3k|			xml_end(a, name);
 3314|  48.3k|			break;
 3315|   155k|		case XML_READER_TYPE_TEXT:
  ------------------
  |  Branch (3315:3): [True: 155k, False: 187k]
  ------------------
 3316|   155k|			value = (const char *)xmlTextReaderConstValue(reader);
 3317|   155k|			r = xml_data(a, value, strlen(value));
 3318|   155k|			if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|   155k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3318:8): [True: 12, False: 155k]
  ------------------
 3319|     12|				xmlFreeTextReader(reader);
 3320|     12|				xmlCleanupParser();
 3321|     12|				return (r);
 3322|     12|			}
 3323|   155k|			break;
 3324|   155k|		case XML_READER_TYPE_SIGNIFICANT_WHITESPACE:
  ------------------
  |  Branch (3324:3): [True: 15.4k, False: 327k]
  ------------------
 3325|  15.8k|		default:
  ------------------
  |  Branch (3325:3): [True: 451, False: 342k]
  ------------------
 3326|  15.8k|			break;
 3327|   342k|		}
 3328|   342k|		if (r < 0)
  ------------------
  |  Branch (3328:7): [True: 0, False: 342k]
  ------------------
 3329|      0|			break;
 3330|   342k|	}
 3331|  1.06k|	xmlFreeTextReader(reader);
 3332|  1.06k|	xmlCleanupParser();
 3333|       |
 3334|  1.06k|	return ((r == 0)?ARCHIVE_OK:ARCHIVE_FATAL);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
              	return ((r == 0)?ARCHIVE_OK:ARCHIVE_FATAL);
  ------------------
  |  |  239|  1.06k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  |  Branch (3334:10): [True: 0, False: 1.06k]
  ------------------
 3335|  1.07k|}
archive_read_support_format_xar.c:xml2_read_cb:
 3223|  4.77k|{
 3224|  4.77k|	struct archive_read *a = (struct archive_read *)context;
 3225|  4.77k|	struct xar *xar = a->format->data;
 3226|  4.77k|	const void *d;
 3227|  4.77k|	size_t outbytes;
 3228|  4.77k|	size_t used = 0;
 3229|  4.77k|	int r;
 3230|       |
 3231|  4.77k|	if (xar->toc_remaining <= 0)
  ------------------
  |  Branch (3231:6): [True: 2, False: 4.76k]
  ------------------
 3232|      2|		return (0);
 3233|  4.76k|	d = buffer;
 3234|  4.76k|	outbytes = len;
 3235|  4.76k|	r = rd_contents(a, &d, &outbytes, &used, xar->toc_remaining);
 3236|  4.76k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  4.76k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3236:6): [True: 847, False: 3.92k]
  ------------------
 3237|    847|		return (r);
 3238|  3.92k|	__archive_read_consume(a, used);
 3239|  3.92k|	xar->toc_remaining -= used;
 3240|  3.92k|	xar->offset += used;
 3241|  3.92k|	xar->toc_total += outbytes;
 3242|  3.92k|	PRINT_TOC(buffer, len);
 3243|       |
 3244|  3.92k|	return ((int)outbytes);
 3245|  4.76k|}
archive_read_support_format_xar.c:xml2_close_cb:
 3249|  1.07k|{
 3250|       |
 3251|  1.07k|	(void)context; /* UNUSED */
 3252|  1.07k|	return (0);
 3253|  1.07k|}
archive_read_support_format_xar.c:xml2_error_hdr:
 3258|  1.57k|{
 3259|  1.57k|	struct archive_read *a = (struct archive_read *)arg;
 3260|       |
 3261|  1.57k|	(void)locator; /* UNUSED */
 3262|  1.57k|	switch (severity) {
  ------------------
  |  Branch (3262:10): [True: 1.57k, False: 0]
  ------------------
 3263|      0|	case XML_PARSER_SEVERITY_VALIDITY_WARNING:
  ------------------
  |  Branch (3263:2): [True: 0, False: 1.57k]
  ------------------
 3264|    134|	case XML_PARSER_SEVERITY_WARNING:
  ------------------
  |  Branch (3264:2): [True: 134, False: 1.43k]
  ------------------
 3265|    134|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    134|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3266|    134|		    "XML Parsing error: %s", msg);
 3267|    134|		break;
 3268|      0|	case XML_PARSER_SEVERITY_VALIDITY_ERROR:
  ------------------
  |  Branch (3268:2): [True: 0, False: 1.57k]
  ------------------
 3269|  1.43k|	case XML_PARSER_SEVERITY_ERROR:
  ------------------
  |  Branch (3269:2): [True: 1.43k, False: 134]
  ------------------
 3270|  1.43k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  1.43k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3271|  1.43k|		    "XML Parsing error: %s", msg);
 3272|  1.43k|		break;
 3273|  1.57k|	}
 3274|  1.57k|}
archive_read_support_format_xar.c:xml2_xmlattr_setup:
 3185|   123k|{
 3186|   123k|	struct xmlattr *attr;
 3187|   123k|	int r;
 3188|       |
 3189|   123k|	list->first = NULL;
 3190|   123k|	list->last = &(list->first);
 3191|   123k|	r = xmlTextReaderMoveToFirstAttribute(reader);
 3192|   156k|	while (r == 1) {
  ------------------
  |  Branch (3192:9): [True: 32.7k, False: 123k]
  ------------------
 3193|  32.7k|		attr = malloc(sizeof*(attr));
 3194|  32.7k|		if (attr == NULL) {
  ------------------
  |  Branch (3194:7): [True: 0, False: 32.7k]
  ------------------
 3195|      0|			archive_set_error(&a->archive, ENOMEM, "Out of memory");
 3196|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3197|      0|		}
 3198|  32.7k|		attr->name = strdup(
 3199|  32.7k|		    (const char *)xmlTextReaderConstLocalName(reader));
 3200|  32.7k|		if (attr->name == NULL) {
  ------------------
  |  Branch (3200:7): [True: 0, False: 32.7k]
  ------------------
 3201|      0|			free(attr);
 3202|      0|			archive_set_error(&a->archive, ENOMEM, "Out of memory");
 3203|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3204|      0|		}
 3205|  32.7k|		attr->value = strdup(
 3206|  32.7k|		    (const char *)xmlTextReaderConstValue(reader));
 3207|  32.7k|		if (attr->value == NULL) {
  ------------------
  |  Branch (3207:7): [True: 0, False: 32.7k]
  ------------------
 3208|      0|			free(attr->name);
 3209|      0|			free(attr);
 3210|      0|			archive_set_error(&a->archive, ENOMEM, "Out of memory");
 3211|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3212|      0|		}
 3213|  32.7k|		attr->next = NULL;
 3214|  32.7k|		*list->last = attr;
 3215|  32.7k|		list->last = &(attr->next);
 3216|  32.7k|		r = xmlTextReaderMoveToNextAttribute(reader);
 3217|  32.7k|	}
 3218|   123k|	return (r);
 3219|   123k|}
archive_read_support_format_xar.c:xml_start:
 2022|   123k|{
 2023|   123k|	struct xar *xar = a->format->data;
 2024|   123k|	struct xmlattr *attr;
 2025|       |
 2026|       |#if DEBUG
 2027|       |	fprintf(stderr, "xml_sta:[%s]\n", name);
 2028|       |	for (attr = list->first; attr != NULL; attr = attr->next)
 2029|       |		fprintf(stderr, "    attr:\"%s\"=\"%s\"\n",
 2030|       |		    attr->name, attr->value);
 2031|       |#endif
 2032|   123k|	xar->base64text = 0;
 2033|   123k|	switch (xar->xmlsts) {
  ------------------
  |  Branch (2033:10): [True: 123k, False: 0]
  ------------------
 2034|  1.05k|	case INIT:
  ------------------
  |  Branch (2034:2): [True: 1.05k, False: 122k]
  ------------------
 2035|  1.05k|		if (strcmp(name, "xar") == 0)
  ------------------
  |  Branch (2035:7): [True: 1.05k, False: 5]
  ------------------
 2036|  1.05k|			xar->xmlsts = XAR;
 2037|      5|		else
 2038|      5|			if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|      5|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2038:8): [True: 0, False: 5]
  ------------------
 2039|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2040|  1.05k|		break;
 2041|  1.72k|	case XAR:
  ------------------
  |  Branch (2041:2): [True: 1.72k, False: 121k]
  ------------------
 2042|  1.72k|		if (strcmp(name, "toc") == 0)
  ------------------
  |  Branch (2042:7): [True: 1.41k, False: 310]
  ------------------
 2043|  1.41k|			xar->xmlsts = TOC;
 2044|    310|		else
 2045|    310|			if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|    310|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2045:8): [True: 0, False: 310]
  ------------------
 2046|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2047|  1.72k|		break;
 2048|  19.3k|	case TOC:
  ------------------
  |  Branch (2048:2): [True: 19.3k, False: 104k]
  ------------------
 2049|  19.3k|		if (strcmp(name, "creation-time") == 0)
  ------------------
  |  Branch (2049:7): [True: 275, False: 19.0k]
  ------------------
 2050|    275|			xar->xmlsts = TOC_CREATION_TIME;
 2051|  19.0k|		else if (strcmp(name, "checksum") == 0)
  ------------------
  |  Branch (2051:12): [True: 807, False: 18.2k]
  ------------------
 2052|    807|			xar->xmlsts = TOC_CHECKSUM;
 2053|  18.2k|		else if (strcmp(name, "file") == 0) {
  ------------------
  |  Branch (2053:12): [True: 15.9k, False: 2.26k]
  ------------------
 2054|  15.9k|			if (file_new(a, xar, list) != ARCHIVE_OK)
  ------------------
  |  |  233|  15.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2054:8): [True: 0, False: 15.9k]
  ------------------
 2055|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2056|  15.9k|			xar->xmlsts = TOC_FILE;
 2057|  15.9k|		}
 2058|  2.26k|		else
 2059|  2.26k|			if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|  2.26k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2059:8): [True: 0, False: 2.26k]
  ------------------
 2060|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2061|  19.3k|		break;
 2062|  19.3k|	case TOC_CHECKSUM:
  ------------------
  |  Branch (2062:2): [True: 2.78k, False: 120k]
  ------------------
 2063|  2.78k|		if (strcmp(name, "offset") == 0)
  ------------------
  |  Branch (2063:7): [True: 413, False: 2.37k]
  ------------------
 2064|    413|			xar->xmlsts = TOC_CHECKSUM_OFFSET;
 2065|  2.37k|		else if (strcmp(name, "size") == 0)
  ------------------
  |  Branch (2065:12): [True: 916, False: 1.45k]
  ------------------
 2066|    916|			xar->xmlsts = TOC_CHECKSUM_SIZE;
 2067|  1.45k|		else
 2068|  1.45k|			if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|  1.45k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2068:8): [True: 0, False: 1.45k]
  ------------------
 2069|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2070|  2.78k|		break;
 2071|  20.5k|	case TOC_FILE:
  ------------------
  |  Branch (2071:2): [True: 20.5k, False: 102k]
  ------------------
 2072|  20.5k|		if (strcmp(name, "file") == 0) {
  ------------------
  |  Branch (2072:7): [True: 5.08k, False: 15.4k]
  ------------------
 2073|  5.08k|			if (file_new(a, xar, list) != ARCHIVE_OK)
  ------------------
  |  |  233|  5.08k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2073:8): [True: 1, False: 5.08k]
  ------------------
 2074|      1|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2075|  5.08k|		}
 2076|  15.4k|		else if (strcmp(name, "data") == 0)
  ------------------
  |  Branch (2076:12): [True: 1.74k, False: 13.6k]
  ------------------
 2077|  1.74k|			xar->xmlsts = FILE_DATA;
 2078|  13.6k|		else if (strcmp(name, "ea") == 0) {
  ------------------
  |  Branch (2078:12): [True: 1.65k, False: 12.0k]
  ------------------
 2079|  1.65k|			if (xattr_new(a, xar, list) != ARCHIVE_OK)
  ------------------
  |  |  233|  1.65k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2079:8): [True: 0, False: 1.65k]
  ------------------
 2080|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2081|  1.65k|			xar->xmlsts = FILE_EA;
 2082|  1.65k|		}
 2083|  12.0k|		else if (strcmp(name, "ctime") == 0)
  ------------------
  |  Branch (2083:12): [True: 446, False: 11.5k]
  ------------------
 2084|    446|			xar->xmlsts = FILE_CTIME;
 2085|  11.5k|		else if (strcmp(name, "mtime") == 0)
  ------------------
  |  Branch (2085:12): [True: 438, False: 11.1k]
  ------------------
 2086|    438|			xar->xmlsts = FILE_MTIME;
 2087|  11.1k|		else if (strcmp(name, "atime") == 0)
  ------------------
  |  Branch (2087:12): [True: 420, False: 10.7k]
  ------------------
 2088|    420|			xar->xmlsts = FILE_ATIME;
 2089|  10.7k|		else if (strcmp(name, "group") == 0)
  ------------------
  |  Branch (2089:12): [True: 559, False: 10.1k]
  ------------------
 2090|    559|			xar->xmlsts = FILE_GROUP;
 2091|  10.1k|		else if (strcmp(name, "gid") == 0)
  ------------------
  |  Branch (2091:12): [True: 1.21k, False: 8.94k]
  ------------------
 2092|  1.21k|			xar->xmlsts = FILE_GID;
 2093|  8.94k|		else if (strcmp(name, "user") == 0)
  ------------------
  |  Branch (2093:12): [True: 1.22k, False: 7.71k]
  ------------------
 2094|  1.22k|			xar->xmlsts = FILE_USER;
 2095|  7.71k|		else if (strcmp(name, "uid") == 0)
  ------------------
  |  Branch (2095:12): [True: 1.12k, False: 6.59k]
  ------------------
 2096|  1.12k|			xar->xmlsts = FILE_UID;
 2097|  6.59k|		else if (strcmp(name, "mode") == 0)
  ------------------
  |  Branch (2097:12): [True: 494, False: 6.09k]
  ------------------
 2098|    494|			xar->xmlsts = FILE_MODE;
 2099|  6.09k|		else if (strcmp(name, "device") == 0)
  ------------------
  |  Branch (2099:12): [True: 0, False: 6.09k]
  ------------------
 2100|      0|			xar->xmlsts = FILE_DEVICE;
 2101|  6.09k|		else if (strcmp(name, "deviceno") == 0)
  ------------------
  |  Branch (2101:12): [True: 0, False: 6.09k]
  ------------------
 2102|      0|			xar->xmlsts = FILE_DEVICENO;
 2103|  6.09k|		else if (strcmp(name, "inode") == 0)
  ------------------
  |  Branch (2103:12): [True: 0, False: 6.09k]
  ------------------
 2104|      0|			xar->xmlsts = FILE_INODE;
 2105|  6.09k|		else if (strcmp(name, "link") == 0)
  ------------------
  |  Branch (2105:12): [True: 0, False: 6.09k]
  ------------------
 2106|      0|			xar->xmlsts = FILE_LINK;
 2107|  6.09k|		else if (strcmp(name, "type") == 0) {
  ------------------
  |  Branch (2107:12): [True: 0, False: 6.09k]
  ------------------
 2108|      0|			xar->xmlsts = FILE_TYPE;
 2109|      0|			for (attr = list->first; attr != NULL;
  ------------------
  |  Branch (2109:29): [True: 0, False: 0]
  ------------------
 2110|      0|			    attr = attr->next) {
 2111|      0|				if (strcmp(attr->name, "link") != 0)
  ------------------
  |  Branch (2111:9): [True: 0, False: 0]
  ------------------
 2112|      0|					continue;
 2113|      0|				if (xar->file->hdnext != NULL || xar->file->link != 0 ||
  ------------------
  |  Branch (2113:9): [True: 0, False: 0]
  |  Branch (2113:38): [True: 0, False: 0]
  ------------------
 2114|      0|				    xar->file == xar->hdlink_orgs) {
  ------------------
  |  Branch (2114:9): [True: 0, False: 0]
  ------------------
 2115|      0|					archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2116|      0|					    "File with multiple link attributes");
 2117|      0|					return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2118|      0|				}
 2119|      0|				if (strcmp(attr->value, "original") == 0) {
  ------------------
  |  Branch (2119:9): [True: 0, False: 0]
  ------------------
 2120|      0|					xar->file->hdnext = xar->hdlink_orgs;
 2121|      0|					xar->hdlink_orgs = xar->file;
 2122|      0|				} else {
 2123|      0|					uint64_t val;
 2124|      0|					int r;
 2125|      0|					r = atou64(attr->value,
 2126|      0|					    strlen(attr->value), 10, &val);
 2127|      0|					if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2127:10): [True: 0, False: 0]
  ------------------
 2128|      0|						return (r);
 2129|      0|					}
 2130|      0|					if (val > UINT_MAX) {
  ------------------
  |  Branch (2130:10): [True: 0, False: 0]
  ------------------
 2131|      0|						return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2132|      0|					}
 2133|      0|					xar->file->link = (unsigned)val;
 2134|      0|					if (xar->file->link > 0)
  ------------------
  |  Branch (2134:10): [True: 0, False: 0]
  ------------------
 2135|      0|						if (add_link(a, xar, xar->file) != ARCHIVE_OK) {
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2135:11): [True: 0, False: 0]
  ------------------
 2136|      0|							return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2137|      0|						}
 2138|      0|				}
 2139|      0|			}
 2140|      0|		}
 2141|  6.09k|		else if (strcmp(name, "name") == 0) {
  ------------------
  |  Branch (2141:12): [True: 0, False: 6.09k]
  ------------------
 2142|      0|			xar->xmlsts = FILE_NAME;
 2143|      0|			for (attr = list->first; attr != NULL;
  ------------------
  |  Branch (2143:29): [True: 0, False: 0]
  ------------------
 2144|      0|			    attr = attr->next) {
 2145|      0|				if (strcmp(attr->name, "enctype") == 0 &&
  ------------------
  |  Branch (2145:9): [True: 0, False: 0]
  ------------------
 2146|      0|				    strcmp(attr->value, "base64") == 0)
  ------------------
  |  Branch (2146:9): [True: 0, False: 0]
  ------------------
 2147|      0|					xar->base64text = 1;
 2148|      0|			}
 2149|      0|		}
 2150|  6.09k|		else if (strcmp(name, "acl") == 0)
  ------------------
  |  Branch (2150:12): [True: 0, False: 6.09k]
  ------------------
 2151|      0|			xar->xmlsts = FILE_ACL;
 2152|  6.09k|		else if (strcmp(name, "flags") == 0)
  ------------------
  |  Branch (2152:12): [True: 0, False: 6.09k]
  ------------------
 2153|      0|			xar->xmlsts = FILE_FLAGS;
 2154|  6.09k|		else if (strcmp(name, "ext2") == 0)
  ------------------
  |  Branch (2154:12): [True: 830, False: 5.26k]
  ------------------
 2155|    830|			xar->xmlsts = FILE_EXT2;
 2156|  5.26k|		else
 2157|  5.26k|			if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|  5.26k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2157:8): [True: 0, False: 5.26k]
  ------------------
 2158|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2159|  20.5k|		break;
 2160|  28.4k|	case FILE_DATA:
  ------------------
  |  Branch (2160:2): [True: 28.4k, False: 94.9k]
  ------------------
 2161|  28.4k|		if (strcmp(name, "length") == 0)
  ------------------
  |  Branch (2161:7): [True: 311, False: 28.1k]
  ------------------
 2162|    311|			xar->xmlsts = FILE_DATA_LENGTH;
 2163|  28.1k|		else if (strcmp(name, "offset") == 0)
  ------------------
  |  Branch (2163:12): [True: 711, False: 27.4k]
  ------------------
 2164|    711|			xar->xmlsts = FILE_DATA_OFFSET;
 2165|  27.4k|		else if (strcmp(name, "size") == 0)
  ------------------
  |  Branch (2165:12): [True: 1.41k, False: 26.0k]
  ------------------
 2166|  1.41k|			xar->xmlsts = FILE_DATA_SIZE;
 2167|  26.0k|		else if (strcmp(name, "encoding") == 0) {
  ------------------
  |  Branch (2167:12): [True: 3.13k, False: 22.8k]
  ------------------
 2168|  3.13k|			xar->xmlsts = FILE_DATA_ENCODING;
 2169|  3.13k|			xar->file->encoding = getencoding(list);
 2170|  3.13k|		}
 2171|  22.8k|		else if (strcmp(name, "archived-checksum") == 0) {
  ------------------
  |  Branch (2171:12): [True: 6.85k, False: 16.0k]
  ------------------
 2172|  6.85k|			xar->xmlsts = FILE_DATA_A_CHECKSUM;
 2173|  6.85k|			xar->file->a_sum.alg = getsumalgorithm(list);
 2174|  6.85k|		}
 2175|  16.0k|		else if (strcmp(name, "extracted-checksum") == 0) {
  ------------------
  |  Branch (2175:12): [True: 6.27k, False: 9.74k]
  ------------------
 2176|  6.27k|			xar->xmlsts = FILE_DATA_E_CHECKSUM;
 2177|  6.27k|			xar->file->e_sum.alg = getsumalgorithm(list);
 2178|  6.27k|		}
 2179|  9.74k|		else if (strcmp(name, "content") == 0)
  ------------------
  |  Branch (2179:12): [True: 0, False: 9.74k]
  ------------------
 2180|      0|			xar->xmlsts = FILE_DATA_CONTENT;
 2181|  9.74k|		else
 2182|  9.74k|			if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|  9.74k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2182:8): [True: 0, False: 9.74k]
  ------------------
 2183|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2184|  28.4k|		break;
 2185|  28.4k|	case FILE_DEVICE:
  ------------------
  |  Branch (2185:2): [True: 0, False: 123k]
  ------------------
 2186|      0|		if (strcmp(name, "major") == 0)
  ------------------
  |  Branch (2186:7): [True: 0, False: 0]
  ------------------
 2187|      0|			xar->xmlsts = FILE_DEVICE_MAJOR;
 2188|      0|		else if (strcmp(name, "minor") == 0)
  ------------------
  |  Branch (2188:12): [True: 0, False: 0]
  ------------------
 2189|      0|			xar->xmlsts = FILE_DEVICE_MINOR;
 2190|      0|		else
 2191|      0|			if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2191:8): [True: 0, False: 0]
  ------------------
 2192|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2193|      0|		break;
 2194|      0|	case FILE_DATA_CONTENT:
  ------------------
  |  Branch (2194:2): [True: 0, False: 123k]
  ------------------
 2195|      0|		if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2195:7): [True: 0, False: 0]
  ------------------
 2196|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2197|      0|		break;
 2198|  3.77k|	case FILE_EA:
  ------------------
  |  Branch (2198:2): [True: 3.77k, False: 119k]
  ------------------
 2199|  3.77k|		if (strcmp(name, "length") == 0)
  ------------------
  |  Branch (2199:7): [True: 539, False: 3.23k]
  ------------------
 2200|    539|			xar->xmlsts = FILE_EA_LENGTH;
 2201|  3.23k|		else if (strcmp(name, "offset") == 0)
  ------------------
  |  Branch (2201:12): [True: 655, False: 2.58k]
  ------------------
 2202|    655|			xar->xmlsts = FILE_EA_OFFSET;
 2203|  2.58k|		else if (strcmp(name, "size") == 0)
  ------------------
  |  Branch (2203:12): [True: 342, False: 2.23k]
  ------------------
 2204|    342|			xar->xmlsts = FILE_EA_SIZE;
 2205|  2.23k|		else if (strcmp(name, "encoding") == 0) {
  ------------------
  |  Branch (2205:12): [True: 207, False: 2.03k]
  ------------------
 2206|    207|			xar->xmlsts = FILE_EA_ENCODING;
 2207|    207|			xar->xattr->encoding = getencoding(list);
 2208|  2.03k|		} else if (strcmp(name, "archived-checksum") == 0)
  ------------------
  |  Branch (2208:14): [True: 937, False: 1.09k]
  ------------------
 2209|    937|			xar->xmlsts = FILE_EA_A_CHECKSUM;
 2210|  1.09k|		else if (strcmp(name, "extracted-checksum") == 0)
  ------------------
  |  Branch (2210:12): [True: 47, False: 1.04k]
  ------------------
 2211|     47|			xar->xmlsts = FILE_EA_E_CHECKSUM;
 2212|  1.04k|		else if (strcmp(name, "name") == 0)
  ------------------
  |  Branch (2212:12): [True: 0, False: 1.04k]
  ------------------
 2213|      0|			xar->xmlsts = FILE_EA_NAME;
 2214|  1.04k|		else if (strcmp(name, "fstype") == 0)
  ------------------
  |  Branch (2214:12): [True: 0, False: 1.04k]
  ------------------
 2215|      0|			xar->xmlsts = FILE_EA_FSTYPE;
 2216|  1.04k|		else
 2217|  1.04k|			if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|  1.04k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2217:8): [True: 0, False: 1.04k]
  ------------------
 2218|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2219|  3.77k|		break;
 2220|  3.77k|	case FILE_ACL:
  ------------------
  |  Branch (2220:2): [True: 0, False: 123k]
  ------------------
 2221|      0|		if (strcmp(name, "appleextended") == 0)
  ------------------
  |  Branch (2221:7): [True: 0, False: 0]
  ------------------
 2222|      0|			xar->xmlsts = FILE_ACL_APPLEEXTENDED;
 2223|      0|		else if (strcmp(name, "default") == 0)
  ------------------
  |  Branch (2223:12): [True: 0, False: 0]
  ------------------
 2224|      0|			xar->xmlsts = FILE_ACL_DEFAULT;
 2225|      0|		else if (strcmp(name, "access") == 0)
  ------------------
  |  Branch (2225:12): [True: 0, False: 0]
  ------------------
 2226|      0|			xar->xmlsts = FILE_ACL_ACCESS;
 2227|      0|		else
 2228|      0|			if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2228:8): [True: 0, False: 0]
  ------------------
 2229|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2230|      0|		break;
 2231|      0|	case FILE_FLAGS:
  ------------------
  |  Branch (2231:2): [True: 0, False: 123k]
  ------------------
 2232|      0|		if (!xml_parse_file_flags(xar, name))
  ------------------
  |  Branch (2232:7): [True: 0, False: 0]
  ------------------
 2233|      0|			if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2233:8): [True: 0, False: 0]
  ------------------
 2234|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2235|      0|		break;
 2236|    340|	case FILE_EXT2:
  ------------------
  |  Branch (2236:2): [True: 340, False: 123k]
  ------------------
 2237|    340|		if (!xml_parse_file_ext2(xar, name))
  ------------------
  |  Branch (2237:7): [True: 340, False: 0]
  ------------------
 2238|    340|			if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|    340|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2238:8): [True: 0, False: 340]
  ------------------
 2239|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2240|    340|		break;
 2241|    340|	case TOC_CREATION_TIME:
  ------------------
  |  Branch (2241:2): [True: 281, False: 123k]
  ------------------
 2242|  2.28k|	case TOC_CHECKSUM_OFFSET:
  ------------------
  |  Branch (2242:2): [True: 2.00k, False: 121k]
  ------------------
 2243|  2.52k|	case TOC_CHECKSUM_SIZE:
  ------------------
  |  Branch (2243:2): [True: 236, False: 123k]
  ------------------
 2244|  3.34k|	case FILE_DATA_LENGTH:
  ------------------
  |  Branch (2244:2): [True: 825, False: 122k]
  ------------------
 2245|  3.87k|	case FILE_DATA_OFFSET:
  ------------------
  |  Branch (2245:2): [True: 528, False: 122k]
  ------------------
 2246|  4.47k|	case FILE_DATA_SIZE:
  ------------------
  |  Branch (2246:2): [True: 603, False: 122k]
  ------------------
 2247|  4.68k|	case FILE_DATA_ENCODING:
  ------------------
  |  Branch (2247:2): [True: 211, False: 123k]
  ------------------
 2248|  7.30k|	case FILE_DATA_A_CHECKSUM:
  ------------------
  |  Branch (2248:2): [True: 2.61k, False: 120k]
  ------------------
 2249|  10.0k|	case FILE_DATA_E_CHECKSUM:
  ------------------
  |  Branch (2249:2): [True: 2.71k, False: 120k]
  ------------------
 2250|  10.8k|	case FILE_EA_LENGTH:
  ------------------
  |  Branch (2250:2): [True: 800, False: 122k]
  ------------------
 2251|  11.2k|	case FILE_EA_OFFSET:
  ------------------
  |  Branch (2251:2): [True: 414, False: 123k]
  ------------------
 2252|  11.5k|	case FILE_EA_SIZE:
  ------------------
  |  Branch (2252:2): [True: 306, False: 123k]
  ------------------
 2253|  11.6k|	case FILE_EA_ENCODING:
  ------------------
  |  Branch (2253:2): [True: 83, False: 123k]
  ------------------
 2254|  15.3k|	case FILE_EA_A_CHECKSUM:
  ------------------
  |  Branch (2254:2): [True: 3.73k, False: 119k]
  ------------------
 2255|  17.0k|	case FILE_EA_E_CHECKSUM:
  ------------------
  |  Branch (2255:2): [True: 1.73k, False: 121k]
  ------------------
 2256|  17.0k|	case FILE_EA_NAME:
  ------------------
  |  Branch (2256:2): [True: 0, False: 123k]
  ------------------
 2257|  17.0k|	case FILE_EA_FSTYPE:
  ------------------
  |  Branch (2257:2): [True: 0, False: 123k]
  ------------------
 2258|  17.4k|	case FILE_CTIME:
  ------------------
  |  Branch (2258:2): [True: 396, False: 123k]
  ------------------
 2259|  17.7k|	case FILE_MTIME:
  ------------------
  |  Branch (2259:2): [True: 282, False: 123k]
  ------------------
 2260|  33.3k|	case FILE_ATIME:
  ------------------
  |  Branch (2260:2): [True: 15.5k, False: 107k]
  ------------------
 2261|  33.5k|	case FILE_GROUP:
  ------------------
  |  Branch (2261:2): [True: 226, False: 123k]
  ------------------
 2262|  33.8k|	case FILE_GID:
  ------------------
  |  Branch (2262:2): [True: 264, False: 123k]
  ------------------
 2263|  34.0k|	case FILE_USER:
  ------------------
  |  Branch (2263:2): [True: 207, False: 123k]
  ------------------
 2264|  34.3k|	case FILE_UID:
  ------------------
  |  Branch (2264:2): [True: 280, False: 123k]
  ------------------
 2265|  34.3k|	case FILE_INODE:
  ------------------
  |  Branch (2265:2): [True: 0, False: 123k]
  ------------------
 2266|  34.3k|	case FILE_DEVICE_MAJOR:
  ------------------
  |  Branch (2266:2): [True: 0, False: 123k]
  ------------------
 2267|  34.3k|	case FILE_DEVICE_MINOR:
  ------------------
  |  Branch (2267:2): [True: 0, False: 123k]
  ------------------
 2268|  34.3k|	case FILE_DEVICENO:
  ------------------
  |  Branch (2268:2): [True: 0, False: 123k]
  ------------------
 2269|  34.5k|	case FILE_MODE:
  ------------------
  |  Branch (2269:2): [True: 246, False: 123k]
  ------------------
 2270|  34.5k|	case FILE_TYPE:
  ------------------
  |  Branch (2270:2): [True: 0, False: 123k]
  ------------------
 2271|  34.5k|	case FILE_LINK:
  ------------------
  |  Branch (2271:2): [True: 0, False: 123k]
  ------------------
 2272|  34.5k|	case FILE_NAME:
  ------------------
  |  Branch (2272:2): [True: 0, False: 123k]
  ------------------
 2273|  34.5k|	case FILE_ACL_DEFAULT:
  ------------------
  |  Branch (2273:2): [True: 0, False: 123k]
  ------------------
 2274|  34.5k|	case FILE_ACL_ACCESS:
  ------------------
  |  Branch (2274:2): [True: 0, False: 123k]
  ------------------
 2275|  34.5k|	case FILE_ACL_APPLEEXTENDED:
  ------------------
  |  Branch (2275:2): [True: 0, False: 123k]
  ------------------
 2276|  34.5k|	case FILE_FLAGS_USER_NODUMP:
  ------------------
  |  Branch (2276:2): [True: 0, False: 123k]
  ------------------
 2277|  34.5k|	case FILE_FLAGS_USER_IMMUTABLE:
  ------------------
  |  Branch (2277:2): [True: 0, False: 123k]
  ------------------
 2278|  34.5k|	case FILE_FLAGS_USER_APPEND:
  ------------------
  |  Branch (2278:2): [True: 0, False: 123k]
  ------------------
 2279|  34.5k|	case FILE_FLAGS_USER_OPAQUE:
  ------------------
  |  Branch (2279:2): [True: 0, False: 123k]
  ------------------
 2280|  34.5k|	case FILE_FLAGS_USER_NOUNLINK:
  ------------------
  |  Branch (2280:2): [True: 0, False: 123k]
  ------------------
 2281|  34.5k|	case FILE_FLAGS_SYS_ARCHIVED:
  ------------------
  |  Branch (2281:2): [True: 0, False: 123k]
  ------------------
 2282|  34.5k|	case FILE_FLAGS_SYS_IMMUTABLE:
  ------------------
  |  Branch (2282:2): [True: 0, False: 123k]
  ------------------
 2283|  34.5k|	case FILE_FLAGS_SYS_APPEND:
  ------------------
  |  Branch (2283:2): [True: 0, False: 123k]
  ------------------
 2284|  34.5k|	case FILE_FLAGS_SYS_NOUNLINK:
  ------------------
  |  Branch (2284:2): [True: 0, False: 123k]
  ------------------
 2285|  34.5k|	case FILE_FLAGS_SYS_SNAPSHOT:
  ------------------
  |  Branch (2285:2): [True: 0, False: 123k]
  ------------------
 2286|  34.5k|	case FILE_EXT2_SecureDeletion:
  ------------------
  |  Branch (2286:2): [True: 0, False: 123k]
  ------------------
 2287|  34.5k|	case FILE_EXT2_Undelete:
  ------------------
  |  Branch (2287:2): [True: 0, False: 123k]
  ------------------
 2288|  34.5k|	case FILE_EXT2_Compress:
  ------------------
  |  Branch (2288:2): [True: 0, False: 123k]
  ------------------
 2289|  34.5k|	case FILE_EXT2_Synchronous:
  ------------------
  |  Branch (2289:2): [True: 0, False: 123k]
  ------------------
 2290|  34.5k|	case FILE_EXT2_Immutable:
  ------------------
  |  Branch (2290:2): [True: 0, False: 123k]
  ------------------
 2291|  34.5k|	case FILE_EXT2_AppendOnly:
  ------------------
  |  Branch (2291:2): [True: 0, False: 123k]
  ------------------
 2292|  34.5k|	case FILE_EXT2_NoDump:
  ------------------
  |  Branch (2292:2): [True: 0, False: 123k]
  ------------------
 2293|  34.5k|	case FILE_EXT2_NoAtime:
  ------------------
  |  Branch (2293:2): [True: 0, False: 123k]
  ------------------
 2294|  34.5k|	case FILE_EXT2_CompDirty:
  ------------------
  |  Branch (2294:2): [True: 0, False: 123k]
  ------------------
 2295|  34.5k|	case FILE_EXT2_CompBlock:
  ------------------
  |  Branch (2295:2): [True: 0, False: 123k]
  ------------------
 2296|  34.5k|	case FILE_EXT2_NoCompBlock:
  ------------------
  |  Branch (2296:2): [True: 0, False: 123k]
  ------------------
 2297|  34.5k|	case FILE_EXT2_CompError:
  ------------------
  |  Branch (2297:2): [True: 0, False: 123k]
  ------------------
 2298|  34.5k|	case FILE_EXT2_BTree:
  ------------------
  |  Branch (2298:2): [True: 0, False: 123k]
  ------------------
 2299|  34.5k|	case FILE_EXT2_HashIndexed:
  ------------------
  |  Branch (2299:2): [True: 0, False: 123k]
  ------------------
 2300|  34.5k|	case FILE_EXT2_iMagic:
  ------------------
  |  Branch (2300:2): [True: 0, False: 123k]
  ------------------
 2301|  34.5k|	case FILE_EXT2_Journaled:
  ------------------
  |  Branch (2301:2): [True: 0, False: 123k]
  ------------------
 2302|  34.5k|	case FILE_EXT2_NoTail:
  ------------------
  |  Branch (2302:2): [True: 0, False: 123k]
  ------------------
 2303|  34.5k|	case FILE_EXT2_DirSync:
  ------------------
  |  Branch (2303:2): [True: 0, False: 123k]
  ------------------
 2304|  34.5k|	case FILE_EXT2_TopDir:
  ------------------
  |  Branch (2304:2): [True: 0, False: 123k]
  ------------------
 2305|  34.5k|	case FILE_EXT2_Reserved:
  ------------------
  |  Branch (2305:2): [True: 0, False: 123k]
  ------------------
 2306|  45.4k|	case UNKNOWN:
  ------------------
  |  Branch (2306:2): [True: 10.9k, False: 112k]
  ------------------
 2307|  45.4k|		if (unknowntag_start(a, xar, name) != ARCHIVE_OK)
  ------------------
  |  |  233|  45.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2307:7): [True: 0, False: 45.4k]
  ------------------
 2308|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2309|  45.4k|		break;
 2310|   123k|	}
 2311|   123k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|   123k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2312|   123k|}
archive_read_support_format_xar.c:unknowntag_start:
 1977|  65.9k|{
 1978|  65.9k|	struct unknown_tag *tag;
 1979|       |
 1980|  65.9k|	tag = malloc(sizeof(*tag));
 1981|  65.9k|	if (tag == NULL) {
  ------------------
  |  Branch (1981:6): [True: 0, False: 65.9k]
  ------------------
 1982|      0|		archive_set_error(&a->archive, ENOMEM, "Out of memory");
 1983|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1984|      0|	}
 1985|  65.9k|	tag->next = xar->unknowntags;
 1986|  65.9k|	archive_string_init(&(tag->name));
  ------------------
  |  |   71|  65.9k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 65.9k]
  |  |  ------------------
  ------------------
 1987|  65.9k|	archive_strcpy(&(tag->name), name);
  ------------------
  |  |  165|  65.9k|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|   131k|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 65.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1988|  65.9k|	if (xar->unknowntags == NULL) {
  ------------------
  |  Branch (1988:6): [True: 55.0k, False: 10.9k]
  ------------------
 1989|       |#if DEBUG
 1990|       |		fprintf(stderr, "UNKNOWNTAG_START:%s\n", name);
 1991|       |#endif
 1992|  55.0k|		xar->xmlsts_unknown = xar->xmlsts;
 1993|  55.0k|		xar->xmlsts = UNKNOWN;
 1994|  55.0k|	}
 1995|  65.9k|	xar->unknowntags = tag;
 1996|  65.9k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  65.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1997|  65.9k|}
archive_read_support_format_xar.c:file_new:
 1819|  21.0k|{
 1820|  21.0k|	struct xar_file *file;
 1821|  21.0k|	struct xmlattr *attr;
 1822|       |
 1823|  21.0k|	file = calloc(1, sizeof(*file));
 1824|  21.0k|	if (file == NULL) {
  ------------------
  |  Branch (1824:6): [True: 0, False: 21.0k]
  ------------------
 1825|      0|		archive_set_error(&a->archive, ENOMEM, "Out of memory");
 1826|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1827|      0|	}
 1828|  21.0k|	file->parent = xar->file;
 1829|  21.0k|	file->mode = 0777 | AE_IFREG;
  ------------------
  |  |  216|  21.0k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1830|  21.0k|	file->atime =  0;
 1831|  21.0k|	file->mtime = 0;
 1832|  21.0k|	xar->xattr = NULL;
 1833|  28.3k|	for (attr = list->first; attr != NULL; attr = attr->next) {
  ------------------
  |  Branch (1833:27): [True: 7.25k, False: 21.0k]
  ------------------
 1834|  7.25k|		if (strcmp(attr->name, "id") == 0) {
  ------------------
  |  Branch (1834:7): [True: 5.66k, False: 1.59k]
  ------------------
 1835|  5.66k|			int r;
 1836|       |
 1837|  5.66k|			r = atou64(attr->value, strlen(attr->value),
 1838|  5.66k|			    10, &file->id);
 1839|  5.66k|			if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|  5.66k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1839:8): [True: 1, False: 5.66k]
  ------------------
 1840|      1|				free(file);
 1841|      1|				return (r);
 1842|      1|			}
 1843|  5.66k|		}
 1844|  7.25k|	}
 1845|  21.0k|	xar->file = file;
 1846|  21.0k|	file->nlink = 1;
 1847|  21.0k|	if (heap_add_entry(a, &(xar->file_queue), file) != ARCHIVE_OK) {
  ------------------
  |  |  233|  21.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1847:6): [True: 0, False: 21.0k]
  ------------------
 1848|      0|		xar->file = file->parent;
 1849|      0|		file_free(file);
 1850|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1851|      0|	}
 1852|  21.0k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  21.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1853|  21.0k|}
archive_read_support_format_xar.c:heap_add_entry:
 1218|  21.0k|{
 1219|  21.0k|	uint64_t file_id, parent_id;
 1220|  21.0k|	size_t hole, parent;
 1221|       |
 1222|       |	/* Expand our pending files list as necessary. */
 1223|  21.0k|	if (heap->used >= heap->allocated) {
  ------------------
  |  Branch (1223:6): [True: 956, False: 20.1k]
  ------------------
 1224|    956|		struct xar_file **new_pending_files;
 1225|    956|		size_t new_size;
 1226|       |
 1227|    956|		if (heap->allocated < 1024)
  ------------------
  |  Branch (1227:7): [True: 948, False: 8]
  ------------------
 1228|    948|			new_size = 1024;
 1229|      8|		else if (archive_ckd_mul_size(&new_size, heap->allocated, 2)) {
  ------------------
  |  Branch (1229:12): [True: 0, False: 8]
  ------------------
 1230|       |			/* Overflow keeps us from growing the list. */
 1231|      0|			archive_set_error(&a->archive,
 1232|      0|			    ENOMEM, "Out of memory");
 1233|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1234|      0|		}
 1235|    956|		new_pending_files = (struct xar_file **)
 1236|    956|		    calloc(new_size, sizeof(new_pending_files[0]));
 1237|    956|		if (new_pending_files == NULL) {
  ------------------
  |  Branch (1237:7): [True: 0, False: 956]
  ------------------
 1238|      0|			archive_set_error(&a->archive,
 1239|      0|			    ENOMEM, "Out of memory");
 1240|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1241|      0|		}
 1242|    956|		if (heap->allocated) {
  ------------------
  |  Branch (1242:7): [True: 8, False: 948]
  ------------------
 1243|      8|			memcpy(new_pending_files, heap->files,
 1244|      8|			    heap->allocated * sizeof(new_pending_files[0]));
 1245|      8|			free(heap->files);
 1246|      8|		}
 1247|    956|		heap->files = new_pending_files;
 1248|    956|		heap->allocated = new_size;
 1249|    956|	}
 1250|       |
 1251|  21.0k|	file_id = file->id;
 1252|       |
 1253|       |	/*
 1254|       |	 * Start with hole at end, walk it up tree to find insertion point.
 1255|       |	 */
 1256|  21.0k|	hole = heap->used++;
 1257|  22.2k|	while (hole > 0) {
  ------------------
  |  Branch (1257:9): [True: 21.2k, False: 1.01k]
  ------------------
 1258|  21.2k|		parent = (hole - 1) / 2;
 1259|  21.2k|		parent_id = heap->files[parent]->id;
 1260|  21.2k|		if (file_id >= parent_id) {
  ------------------
  |  Branch (1260:7): [True: 20.0k, False: 1.20k]
  ------------------
 1261|  20.0k|			heap->files[hole] = file;
 1262|  20.0k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  20.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1263|  20.0k|		}
 1264|       |		/* Move parent into hole <==> move hole up tree. */
 1265|  1.20k|		heap->files[hole] = heap->files[parent];
 1266|  1.20k|		hole = parent;
 1267|  1.20k|	}
 1268|  1.01k|	heap->files[0] = file;
 1269|       |
 1270|  1.01k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.01k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1271|  21.0k|}
archive_read_support_format_xar.c:xattr_new:
 1880|  1.65k|{
 1881|  1.65k|	struct xattr *xattr, **nx;
 1882|  1.65k|	struct xmlattr *attr;
 1883|       |
 1884|  1.65k|	xattr = calloc(1, sizeof(*xattr));
 1885|  1.65k|	if (xattr == NULL) {
  ------------------
  |  Branch (1885:6): [True: 0, False: 1.65k]
  ------------------
 1886|      0|		archive_set_error(&a->archive, ENOMEM, "Out of memory");
 1887|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1888|      0|	}
 1889|  3.03k|	for (attr = list->first; attr != NULL; attr = attr->next) {
  ------------------
  |  Branch (1889:27): [True: 1.38k, False: 1.65k]
  ------------------
 1890|  1.38k|		if (strcmp(attr->name, "id") == 0) {
  ------------------
  |  Branch (1890:7): [True: 582, False: 798]
  ------------------
 1891|    582|			int r;
 1892|       |
 1893|    582|			r = atou64(attr->value, strlen(attr->value),
 1894|    582|			    10, &xattr->id);
 1895|    582|			if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|    582|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1895:8): [True: 0, False: 582]
  ------------------
 1896|      0|				free(xattr);
 1897|      0|				return (r);
 1898|      0|			}
 1899|    582|		}
 1900|  1.38k|	}
 1901|  1.65k|	xar->xattr = xattr;
 1902|       |	/* Chain to xattr list. */
 1903|  1.65k|	for (nx = &(xar->file->xattr_list);
 1904|  36.3k|	    *nx != NULL; nx = &((*nx)->next)) {
  ------------------
  |  Branch (1904:6): [True: 34.9k, False: 1.40k]
  ------------------
 1905|  34.9k|		if (xattr->id < (*nx)->id)
  ------------------
  |  Branch (1905:7): [True: 255, False: 34.6k]
  ------------------
 1906|    255|			break;
 1907|  34.9k|	}
 1908|  1.65k|	xattr->next = *nx;
 1909|  1.65k|	*nx = xattr;
 1910|       |
 1911|  1.65k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.65k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1912|  1.65k|}
archive_read_support_format_xar.c:atou64:
 1086|  66.3k|{
 1087|  66.3k|	uint64_t l;
 1088|       |
 1089|  66.3k|	l = 0;
 1090|   183k|	while (char_cnt-- > 0) {
  ------------------
  |  Branch (1090:9): [True: 156k, False: 27.0k]
  ------------------
 1091|   156k|		int digit = *p++ - '0';
 1092|       |
 1093|   156k|		if (digit < 0 || digit >= base)
  ------------------
  |  Branch (1093:7): [True: 6.70k, False: 150k]
  |  Branch (1093:20): [True: 32.5k, False: 117k]
  ------------------
 1094|  39.2k|			break;
 1095|   117k|		if (archive_ckd_mul_u64(&l, l, base) ||
  ------------------
  |  Branch (1095:7): [True: 12, False: 117k]
  ------------------
 1096|   117k|		    archive_ckd_add_u64(&l, l, digit))
  ------------------
  |  Branch (1096:7): [True: 0, False: 117k]
  ------------------
 1097|     12|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     12|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1098|   117k|	}
 1099|       |
 1100|  66.3k|	*val = l;
 1101|  66.3k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  66.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1102|  66.3k|}
archive_read_support_format_xar.c:getencoding:
 1924|  3.34k|{
 1925|  3.34k|	struct xmlattr *attr;
 1926|  3.34k|	enum enctype encoding = NONE;
 1927|       |
 1928|  6.54k|	for (attr = list->first; attr != NULL; attr = attr->next) {
  ------------------
  |  Branch (1928:27): [True: 3.20k, False: 3.34k]
  ------------------
 1929|  3.20k|		if (strcmp(attr->name, "style") == 0) {
  ------------------
  |  Branch (1929:7): [True: 1.45k, False: 1.74k]
  ------------------
 1930|  1.45k|			if (strcmp(attr->value, "application/octet-stream") == 0)
  ------------------
  |  Branch (1930:8): [True: 0, False: 1.45k]
  ------------------
 1931|      0|				encoding = NONE;
 1932|  1.45k|			else if (strcmp(attr->value, "application/x-gzip") == 0)
  ------------------
  |  Branch (1932:13): [True: 0, False: 1.45k]
  ------------------
 1933|      0|				encoding = GZIP;
 1934|  1.45k|			else if (strcmp(attr->value, "application/x-bzip2") == 0)
  ------------------
  |  Branch (1934:13): [True: 0, False: 1.45k]
  ------------------
 1935|      0|				encoding = BZIP2;
 1936|  1.45k|			else if (strcmp(attr->value, "application/x-lzma") == 0)
  ------------------
  |  Branch (1936:13): [True: 0, False: 1.45k]
  ------------------
 1937|      0|				encoding = LZMA;
 1938|  1.45k|			else if (strcmp(attr->value, "application/x-xz") == 0)
  ------------------
  |  Branch (1938:13): [True: 0, False: 1.45k]
  ------------------
 1939|      0|				encoding = XZ;
 1940|  1.45k|		}
 1941|  3.20k|	}
 1942|  3.34k|	return (encoding);
 1943|  3.34k|}
archive_read_support_format_xar.c:getsumalgorithm:
 1947|  13.1k|{
 1948|  13.1k|	struct xmlattr *attr;
 1949|  13.1k|	int alg = CKSUM_NONE;
  ------------------
  |  |  111|  13.1k|#define CKSUM_NONE	0
  ------------------
 1950|       |
 1951|  26.7k|	for (attr = list->first; attr != NULL; attr = attr->next) {
  ------------------
  |  Branch (1951:27): [True: 13.5k, False: 13.1k]
  ------------------
 1952|  13.5k|		if (strcmp(attr->name, "style") == 0) {
  ------------------
  |  Branch (1952:7): [True: 12.5k, False: 1.05k]
  ------------------
 1953|  12.5k|			const char *v = attr->value;
 1954|  12.5k|			if ((v[0] == 'S' || v[0] == 's') &&
  ------------------
  |  Branch (1954:9): [True: 0, False: 12.5k]
  |  Branch (1954:24): [True: 4.54k, False: 7.99k]
  ------------------
 1955|  4.54k|			    (v[1] == 'H' || v[1] == 'h') &&
  ------------------
  |  Branch (1955:9): [True: 0, False: 4.54k]
  |  Branch (1955:24): [True: 4.26k, False: 276]
  ------------------
 1956|  4.26k|			    (v[2] == 'A' || v[2] == 'a')) {
  ------------------
  |  Branch (1956:9): [True: 0, False: 4.26k]
  |  Branch (1956:24): [True: 3.23k, False: 1.02k]
  ------------------
 1957|  3.23k|				if (v[3] == '1' && v[4] == '\0')
  ------------------
  |  Branch (1957:9): [True: 910, False: 2.32k]
  |  Branch (1957:24): [True: 394, False: 516]
  ------------------
 1958|    394|					alg = CKSUM_SHA1;
  ------------------
  |  |  112|    394|#define CKSUM_SHA1	1
  ------------------
 1959|  2.84k|				else if (v[3] == '2' && v[4] == '5' &&
  ------------------
  |  Branch (1959:14): [True: 406, False: 2.43k]
  |  Branch (1959:29): [True: 70, False: 336]
  ------------------
 1960|     70|				    v[5] == '6' && v[6] == '\0')
  ------------------
  |  Branch (1960:9): [True: 3, False: 67]
  |  Branch (1960:24): [True: 0, False: 3]
  ------------------
 1961|      0|					alg = CKSUM_SHA256;
  ------------------
  |  |  114|      0|#define CKSUM_SHA256	3
  ------------------
 1962|  2.84k|				else if (v[3] == '5' && v[4] == '1' &&
  ------------------
  |  Branch (1962:14): [True: 1.65k, False: 1.19k]
  |  Branch (1962:29): [True: 736, False: 916]
  ------------------
 1963|    736|				    v[5] == '2' && v[6] == '\0')
  ------------------
  |  Branch (1963:9): [True: 272, False: 464]
  |  Branch (1963:24): [True: 0, False: 272]
  ------------------
 1964|      0|					alg = CKSUM_SHA512;
  ------------------
  |  |  115|      0|#define CKSUM_SHA512	4
  ------------------
 1965|  3.23k|			}
 1966|  12.5k|			if ((v[0] == 'M' || v[0] == 'm') &&
  ------------------
  |  Branch (1966:9): [True: 0, False: 12.5k]
  |  Branch (1966:24): [True: 7.95k, False: 4.59k]
  ------------------
 1967|  7.95k|			    (v[1] == 'D' || v[1] == 'd') &&
  ------------------
  |  Branch (1967:9): [True: 0, False: 7.95k]
  |  Branch (1967:24): [True: 2.94k, False: 5.00k]
  ------------------
 1968|  2.94k|			    v[2] == '5' && v[3] == '\0')
  ------------------
  |  Branch (1968:8): [True: 591, False: 2.35k]
  |  Branch (1968:23): [True: 372, False: 219]
  ------------------
 1969|    372|				alg = CKSUM_MD5;
  ------------------
  |  |  113|    372|#define CKSUM_MD5	2
  ------------------
 1970|  12.5k|		}
 1971|  13.5k|	}
 1972|  13.1k|	return (alg);
 1973|  13.1k|}
archive_read_support_format_xar.c:xml_parse_file_ext2:
 3088|    340|{
 3089|    340|	const char *flag = NULL;
 3090|       |
 3091|    340|	if (strcmp(name, "SecureDeletion") == 0) {
  ------------------
  |  Branch (3091:6): [True: 0, False: 340]
  ------------------
 3092|      0|		xar->xmlsts = FILE_EXT2_SecureDeletion;
 3093|      0|		flag = "securedeletion";
 3094|      0|	}
 3095|    340|	else if (strcmp(name, "Undelete") == 0) {
  ------------------
  |  Branch (3095:11): [True: 0, False: 340]
  ------------------
 3096|      0|		xar->xmlsts = FILE_EXT2_Undelete;
 3097|      0|		flag = "nouunlink";
 3098|      0|	}
 3099|    340|	else if (strcmp(name, "Compress") == 0) {
  ------------------
  |  Branch (3099:11): [True: 0, False: 340]
  ------------------
 3100|      0|		xar->xmlsts = FILE_EXT2_Compress;
 3101|      0|		flag = "compress";
 3102|      0|	}
 3103|    340|	else if (strcmp(name, "Synchronous") == 0) {
  ------------------
  |  Branch (3103:11): [True: 0, False: 340]
  ------------------
 3104|      0|		xar->xmlsts = FILE_EXT2_Synchronous;
 3105|      0|		flag = "sync";
 3106|      0|	}
 3107|    340|	else if (strcmp(name, "Immutable") == 0) {
  ------------------
  |  Branch (3107:11): [True: 0, False: 340]
  ------------------
 3108|      0|		xar->xmlsts = FILE_EXT2_Immutable;
 3109|      0|		flag = "simmutable";
 3110|      0|	}
 3111|    340|	else if (strcmp(name, "AppendOnly") == 0) {
  ------------------
  |  Branch (3111:11): [True: 0, False: 340]
  ------------------
 3112|      0|		xar->xmlsts = FILE_EXT2_AppendOnly;
 3113|      0|		flag = "sappend";
 3114|      0|	}
 3115|    340|	else if (strcmp(name, "NoDump") == 0) {
  ------------------
  |  Branch (3115:11): [True: 0, False: 340]
  ------------------
 3116|      0|		xar->xmlsts = FILE_EXT2_NoDump;
 3117|      0|		flag = "nodump";
 3118|      0|	}
 3119|    340|	else if (strcmp(name, "NoAtime") == 0) {
  ------------------
  |  Branch (3119:11): [True: 0, False: 340]
  ------------------
 3120|      0|		xar->xmlsts = FILE_EXT2_NoAtime;
 3121|      0|		flag = "noatime";
 3122|      0|	}
 3123|    340|	else if (strcmp(name, "CompDirty") == 0) {
  ------------------
  |  Branch (3123:11): [True: 0, False: 340]
  ------------------
 3124|      0|		xar->xmlsts = FILE_EXT2_CompDirty;
 3125|      0|		flag = "compdirty";
 3126|      0|	}
 3127|    340|	else if (strcmp(name, "CompBlock") == 0) {
  ------------------
  |  Branch (3127:11): [True: 0, False: 340]
  ------------------
 3128|      0|		xar->xmlsts = FILE_EXT2_CompBlock;
 3129|      0|		flag = "comprblk";
 3130|      0|	}
 3131|    340|	else if (strcmp(name, "NoCompBlock") == 0) {
  ------------------
  |  Branch (3131:11): [True: 0, False: 340]
  ------------------
 3132|      0|		xar->xmlsts = FILE_EXT2_NoCompBlock;
 3133|      0|		flag = "nocomprblk";
 3134|      0|	}
 3135|    340|	else if (strcmp(name, "CompError") == 0) {
  ------------------
  |  Branch (3135:11): [True: 0, False: 340]
  ------------------
 3136|      0|		xar->xmlsts = FILE_EXT2_CompError;
 3137|      0|		flag = "comperr";
 3138|      0|	}
 3139|    340|	else if (strcmp(name, "BTree") == 0) {
  ------------------
  |  Branch (3139:11): [True: 0, False: 340]
  ------------------
 3140|      0|		xar->xmlsts = FILE_EXT2_BTree;
 3141|      0|		flag = "btree";
 3142|      0|	}
 3143|    340|	else if (strcmp(name, "HashIndexed") == 0) {
  ------------------
  |  Branch (3143:11): [True: 0, False: 340]
  ------------------
 3144|      0|		xar->xmlsts = FILE_EXT2_HashIndexed;
 3145|      0|		flag = "hashidx";
 3146|      0|	}
 3147|    340|	else if (strcmp(name, "iMagic") == 0) {
  ------------------
  |  Branch (3147:11): [True: 0, False: 340]
  ------------------
 3148|      0|		xar->xmlsts = FILE_EXT2_iMagic;
 3149|      0|		flag = "imagic";
 3150|      0|	}
 3151|    340|	else if (strcmp(name, "Journaled") == 0) {
  ------------------
  |  Branch (3151:11): [True: 0, False: 340]
  ------------------
 3152|      0|		xar->xmlsts = FILE_EXT2_Journaled;
 3153|      0|		flag = "journal";
 3154|      0|	}
 3155|    340|	else if (strcmp(name, "NoTail") == 0) {
  ------------------
  |  Branch (3155:11): [True: 0, False: 340]
  ------------------
 3156|      0|		xar->xmlsts = FILE_EXT2_NoTail;
 3157|      0|		flag = "notail";
 3158|      0|	}
 3159|    340|	else if (strcmp(name, "DirSync") == 0) {
  ------------------
  |  Branch (3159:11): [True: 0, False: 340]
  ------------------
 3160|      0|		xar->xmlsts = FILE_EXT2_DirSync;
 3161|      0|		flag = "dirsync";
 3162|      0|	}
 3163|    340|	else if (strcmp(name, "TopDir") == 0) {
  ------------------
  |  Branch (3163:11): [True: 0, False: 340]
  ------------------
 3164|      0|		xar->xmlsts = FILE_EXT2_TopDir;
 3165|      0|		flag = "topdir";
 3166|      0|	}
 3167|    340|	else if (strcmp(name, "Reserved") == 0) {
  ------------------
  |  Branch (3167:11): [True: 0, False: 340]
  ------------------
 3168|      0|		xar->xmlsts = FILE_EXT2_Reserved;
 3169|      0|		flag = "reserved";
 3170|      0|	}
 3171|       |
 3172|    340|	if (flag == NULL)
  ------------------
  |  Branch (3172:6): [True: 340, False: 0]
  ------------------
 3173|    340|		return (0);
 3174|      0|	if (archive_strlen(&(xar->file->fflags_text)) > 0)
  ------------------
  |  |  178|      0|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (3174:6): [True: 0, False: 0]
  ------------------
 3175|      0|		archive_strappend_char(&(xar->file->fflags_text), ',');
 3176|      0|	archive_strcat(&(xar->file->fflags_text), flag);
 3177|      0|	return (1);
 3178|    340|}
archive_read_support_format_xar.c:xmlattr_cleanup:
 1802|   123k|{
 1803|   123k|	struct xmlattr *attr, *next;
 1804|       |
 1805|   123k|	attr = list->first;
 1806|   156k|	while (attr != NULL) {
  ------------------
  |  Branch (1806:9): [True: 32.7k, False: 123k]
  ------------------
 1807|  32.7k|		next = attr->next;
 1808|  32.7k|		free(attr->name);
 1809|  32.7k|		free(attr->value);
 1810|  32.7k|		free(attr);
 1811|  32.7k|		attr = next;
 1812|  32.7k|	}
 1813|       |	list->first = NULL;
 1814|   123k|	list->last = &(list->first);
 1815|   123k|}
archive_read_support_format_xar.c:xml_end:
 2316|   112k|{
 2317|   112k|	struct archive_read *a = (struct archive_read *)userData;
 2318|   112k|	struct xar *xar = a->format->data;
 2319|       |
 2320|       |#if DEBUG
 2321|       |	fprintf(stderr, "xml_end:[%s]\n", name);
 2322|       |#endif
 2323|   112k|	switch (xar->xmlsts) {
  ------------------
  |  Branch (2323:10): [True: 112k, False: 0]
  ------------------
 2324|      0|	case INIT:
  ------------------
  |  Branch (2324:2): [True: 0, False: 112k]
  ------------------
 2325|      0|		break;
 2326|      0|	case XAR:
  ------------------
  |  Branch (2326:2): [True: 0, False: 112k]
  ------------------
 2327|      0|		if (strcmp(name, "xar") == 0)
  ------------------
  |  Branch (2327:7): [True: 0, False: 0]
  ------------------
 2328|      0|			xar->xmlsts = INIT;
 2329|      0|		break;
 2330|    380|	case TOC:
  ------------------
  |  Branch (2330:2): [True: 380, False: 112k]
  ------------------
 2331|    380|		if (strcmp(name, "toc") == 0)
  ------------------
  |  Branch (2331:7): [True: 380, False: 0]
  ------------------
 2332|    380|			xar->xmlsts = XAR;
 2333|    380|		break;
 2334|    265|	case TOC_CREATION_TIME:
  ------------------
  |  Branch (2334:2): [True: 265, False: 112k]
  ------------------
 2335|    265|		if (strcmp(name, "creation-time") == 0)
  ------------------
  |  Branch (2335:7): [True: 265, False: 0]
  ------------------
 2336|    265|			xar->xmlsts = TOC;
 2337|    265|		break;
 2338|    750|	case TOC_CHECKSUM:
  ------------------
  |  Branch (2338:2): [True: 750, False: 111k]
  ------------------
 2339|    750|		if (strcmp(name, "checksum") == 0)
  ------------------
  |  Branch (2339:7): [True: 750, False: 0]
  ------------------
 2340|    750|			xar->xmlsts = TOC;
 2341|    750|		break;
 2342|    388|	case TOC_CHECKSUM_OFFSET:
  ------------------
  |  Branch (2342:2): [True: 388, False: 112k]
  ------------------
 2343|    388|		if (strcmp(name, "offset") == 0)
  ------------------
  |  Branch (2343:7): [True: 388, False: 0]
  ------------------
 2344|    388|			xar->xmlsts = TOC_CHECKSUM;
 2345|    388|		break;
 2346|    899|	case TOC_CHECKSUM_SIZE:
  ------------------
  |  Branch (2346:2): [True: 899, False: 111k]
  ------------------
 2347|    899|		if (strcmp(name, "size") == 0)
  ------------------
  |  Branch (2347:7): [True: 899, False: 0]
  ------------------
 2348|    899|			xar->xmlsts = TOC_CHECKSUM;
 2349|    899|		break;
 2350|  16.3k|	case TOC_FILE:
  ------------------
  |  Branch (2350:2): [True: 16.3k, False: 96.1k]
  ------------------
 2351|  16.3k|		if (strcmp(name, "file") == 0) {
  ------------------
  |  Branch (2351:7): [True: 16.3k, False: 0]
  ------------------
 2352|  16.3k|			if (xar->file->parent != NULL &&
  ------------------
  |  Branch (2352:8): [True: 1.35k, False: 15.0k]
  ------------------
 2353|  1.35k|			    ((xar->file->mode & AE_IFMT) == AE_IFDIR))
  ------------------
  |  |  215|  1.35k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              			    ((xar->file->mode & AE_IFMT) == AE_IFDIR))
  ------------------
  |  |  221|  1.35k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (2353:8): [True: 0, False: 1.35k]
  ------------------
 2354|      0|				xar->file->parent->subdirs++;
 2355|  16.3k|			xar->file = xar->file->parent;
 2356|  16.3k|			if (xar->file == NULL)
  ------------------
  |  Branch (2356:8): [True: 15.0k, False: 1.35k]
  ------------------
 2357|  15.0k|				xar->xmlsts = TOC;
 2358|  16.3k|		}
 2359|  16.3k|		break;
 2360|  1.40k|	case FILE_DATA:
  ------------------
  |  Branch (2360:2): [True: 1.40k, False: 111k]
  ------------------
 2361|  1.40k|		if (strcmp(name, "data") == 0)
  ------------------
  |  Branch (2361:7): [True: 1.40k, False: 0]
  ------------------
 2362|  1.40k|			xar->xmlsts = TOC_FILE;
 2363|  1.40k|		break;
 2364|    294|	case FILE_DATA_LENGTH:
  ------------------
  |  Branch (2364:2): [True: 294, False: 112k]
  ------------------
 2365|    294|		if (strcmp(name, "length") == 0)
  ------------------
  |  Branch (2365:7): [True: 294, False: 0]
  ------------------
 2366|    294|			xar->xmlsts = FILE_DATA;
 2367|    294|		break;
 2368|    694|	case FILE_DATA_OFFSET:
  ------------------
  |  Branch (2368:2): [True: 694, False: 111k]
  ------------------
 2369|    694|		if (strcmp(name, "offset") == 0)
  ------------------
  |  Branch (2369:7): [True: 694, False: 0]
  ------------------
 2370|    694|			xar->xmlsts = FILE_DATA;
 2371|    694|		break;
 2372|  1.39k|	case FILE_DATA_SIZE:
  ------------------
  |  Branch (2372:2): [True: 1.39k, False: 111k]
  ------------------
 2373|  1.39k|		if (strcmp(name, "size") == 0)
  ------------------
  |  Branch (2373:7): [True: 1.39k, False: 0]
  ------------------
 2374|  1.39k|			xar->xmlsts = FILE_DATA;
 2375|  1.39k|		break;
 2376|  3.12k|	case FILE_DATA_ENCODING:
  ------------------
  |  Branch (2376:2): [True: 3.12k, False: 109k]
  ------------------
 2377|  3.12k|		if (strcmp(name, "encoding") == 0)
  ------------------
  |  Branch (2377:7): [True: 3.12k, False: 0]
  ------------------
 2378|  3.12k|			xar->xmlsts = FILE_DATA;
 2379|  3.12k|		break;
 2380|  6.78k|	case FILE_DATA_A_CHECKSUM:
  ------------------
  |  Branch (2380:2): [True: 6.78k, False: 105k]
  ------------------
 2381|  6.78k|		if (strcmp(name, "archived-checksum") == 0)
  ------------------
  |  Branch (2381:7): [True: 6.78k, False: 0]
  ------------------
 2382|  6.78k|			xar->xmlsts = FILE_DATA;
 2383|  6.78k|		break;
 2384|  6.20k|	case FILE_DATA_E_CHECKSUM:
  ------------------
  |  Branch (2384:2): [True: 6.20k, False: 106k]
  ------------------
 2385|  6.20k|		if (strcmp(name, "extracted-checksum") == 0)
  ------------------
  |  Branch (2385:7): [True: 6.20k, False: 0]
  ------------------
 2386|  6.20k|			xar->xmlsts = FILE_DATA;
 2387|  6.20k|		break;
 2388|      0|	case FILE_DATA_CONTENT:
  ------------------
  |  Branch (2388:2): [True: 0, False: 112k]
  ------------------
 2389|      0|		if (strcmp(name, "content") == 0)
  ------------------
  |  Branch (2389:7): [True: 0, False: 0]
  ------------------
 2390|      0|			xar->xmlsts = FILE_DATA;
 2391|      0|		break;
 2392|  1.43k|	case FILE_EA:
  ------------------
  |  Branch (2392:2): [True: 1.43k, False: 111k]
  ------------------
 2393|  1.43k|		if (strcmp(name, "ea") == 0) {
  ------------------
  |  Branch (2393:7): [True: 1.43k, False: 0]
  ------------------
 2394|  1.43k|			xar->xmlsts = TOC_FILE;
 2395|  1.43k|			xar->xattr = NULL;
 2396|  1.43k|		}
 2397|  1.43k|		break;
 2398|    517|	case FILE_EA_LENGTH:
  ------------------
  |  Branch (2398:2): [True: 517, False: 112k]
  ------------------
 2399|    517|		if (strcmp(name, "length") == 0)
  ------------------
  |  Branch (2399:7): [True: 517, False: 0]
  ------------------
 2400|    517|			xar->xmlsts = FILE_EA;
 2401|    517|		break;
 2402|    642|	case FILE_EA_OFFSET:
  ------------------
  |  Branch (2402:2): [True: 642, False: 111k]
  ------------------
 2403|    642|		if (strcmp(name, "offset") == 0)
  ------------------
  |  Branch (2403:7): [True: 642, False: 0]
  ------------------
 2404|    642|			xar->xmlsts = FILE_EA;
 2405|    642|		break;
 2406|    327|	case FILE_EA_SIZE:
  ------------------
  |  Branch (2406:2): [True: 327, False: 112k]
  ------------------
 2407|    327|		if (strcmp(name, "size") == 0)
  ------------------
  |  Branch (2407:7): [True: 327, False: 0]
  ------------------
 2408|    327|			xar->xmlsts = FILE_EA;
 2409|    327|		break;
 2410|    200|	case FILE_EA_ENCODING:
  ------------------
  |  Branch (2410:2): [True: 200, False: 112k]
  ------------------
 2411|    200|		if (strcmp(name, "encoding") == 0)
  ------------------
  |  Branch (2411:7): [True: 200, False: 0]
  ------------------
 2412|    200|			xar->xmlsts = FILE_EA;
 2413|    200|		break;
 2414|    895|	case FILE_EA_A_CHECKSUM:
  ------------------
  |  Branch (2414:2): [True: 895, False: 111k]
  ------------------
 2415|    895|		if (strcmp(name, "archived-checksum") == 0)
  ------------------
  |  Branch (2415:7): [True: 895, False: 0]
  ------------------
 2416|    895|			xar->xmlsts = FILE_EA;
 2417|    895|		break;
 2418|      4|	case FILE_EA_E_CHECKSUM:
  ------------------
  |  Branch (2418:2): [True: 4, False: 112k]
  ------------------
 2419|      4|		if (strcmp(name, "extracted-checksum") == 0)
  ------------------
  |  Branch (2419:7): [True: 4, False: 0]
  ------------------
 2420|      4|			xar->xmlsts = FILE_EA;
 2421|      4|		break;
 2422|      0|	case FILE_EA_NAME:
  ------------------
  |  Branch (2422:2): [True: 0, False: 112k]
  ------------------
 2423|      0|		if (strcmp(name, "name") == 0)
  ------------------
  |  Branch (2423:7): [True: 0, False: 0]
  ------------------
 2424|      0|			xar->xmlsts = FILE_EA;
 2425|      0|		break;
 2426|      0|	case FILE_EA_FSTYPE:
  ------------------
  |  Branch (2426:2): [True: 0, False: 112k]
  ------------------
 2427|      0|		if (strcmp(name, "fstype") == 0)
  ------------------
  |  Branch (2427:7): [True: 0, False: 0]
  ------------------
 2428|      0|			xar->xmlsts = FILE_EA;
 2429|      0|		break;
 2430|    436|	case FILE_CTIME:
  ------------------
  |  Branch (2430:2): [True: 436, False: 112k]
  ------------------
 2431|    436|		if (strcmp(name, "ctime") == 0)
  ------------------
  |  Branch (2431:7): [True: 436, False: 0]
  ------------------
 2432|    436|			xar->xmlsts = TOC_FILE;
 2433|    436|		break;
 2434|    430|	case FILE_MTIME:
  ------------------
  |  Branch (2434:2): [True: 430, False: 112k]
  ------------------
 2435|    430|		if (strcmp(name, "mtime") == 0)
  ------------------
  |  Branch (2435:7): [True: 430, False: 0]
  ------------------
 2436|    430|			xar->xmlsts = TOC_FILE;
 2437|    430|		break;
 2438|    280|	case FILE_ATIME:
  ------------------
  |  Branch (2438:2): [True: 280, False: 112k]
  ------------------
 2439|    280|		if (strcmp(name, "atime") == 0)
  ------------------
  |  Branch (2439:7): [True: 280, False: 0]
  ------------------
 2440|    280|			xar->xmlsts = TOC_FILE;
 2441|    280|		break;
 2442|    551|	case FILE_GROUP:
  ------------------
  |  Branch (2442:2): [True: 551, False: 112k]
  ------------------
 2443|    551|		if (strcmp(name, "group") == 0)
  ------------------
  |  Branch (2443:7): [True: 551, False: 0]
  ------------------
 2444|    551|			xar->xmlsts = TOC_FILE;
 2445|    551|		break;
 2446|  1.20k|	case FILE_GID:
  ------------------
  |  Branch (2446:2): [True: 1.20k, False: 111k]
  ------------------
 2447|  1.20k|		if (strcmp(name, "gid") == 0)
  ------------------
  |  Branch (2447:7): [True: 1.20k, False: 0]
  ------------------
 2448|  1.20k|			xar->xmlsts = TOC_FILE;
 2449|  1.20k|		break;
 2450|  1.20k|	case FILE_USER:
  ------------------
  |  Branch (2450:2): [True: 1.20k, False: 111k]
  ------------------
 2451|  1.20k|		if (strcmp(name, "user") == 0)
  ------------------
  |  Branch (2451:7): [True: 1.20k, False: 0]
  ------------------
 2452|  1.20k|			xar->xmlsts = TOC_FILE;
 2453|  1.20k|		break;
 2454|  1.10k|	case FILE_UID:
  ------------------
  |  Branch (2454:2): [True: 1.10k, False: 111k]
  ------------------
 2455|  1.10k|		if (strcmp(name, "uid") == 0)
  ------------------
  |  Branch (2455:7): [True: 1.10k, False: 0]
  ------------------
 2456|  1.10k|			xar->xmlsts = TOC_FILE;
 2457|  1.10k|		break;
 2458|    474|	case FILE_MODE:
  ------------------
  |  Branch (2458:2): [True: 474, False: 112k]
  ------------------
 2459|    474|		if (strcmp(name, "mode") == 0)
  ------------------
  |  Branch (2459:7): [True: 474, False: 0]
  ------------------
 2460|    474|			xar->xmlsts = TOC_FILE;
 2461|    474|		break;
 2462|      0|	case FILE_DEVICE:
  ------------------
  |  Branch (2462:2): [True: 0, False: 112k]
  ------------------
 2463|      0|		if (strcmp(name, "device") == 0)
  ------------------
  |  Branch (2463:7): [True: 0, False: 0]
  ------------------
 2464|      0|			xar->xmlsts = TOC_FILE;
 2465|      0|		break;
 2466|      0|	case FILE_DEVICE_MAJOR:
  ------------------
  |  Branch (2466:2): [True: 0, False: 112k]
  ------------------
 2467|      0|		if (strcmp(name, "major") == 0)
  ------------------
  |  Branch (2467:7): [True: 0, False: 0]
  ------------------
 2468|      0|			xar->xmlsts = FILE_DEVICE;
 2469|      0|		break;
 2470|      0|	case FILE_DEVICE_MINOR:
  ------------------
  |  Branch (2470:2): [True: 0, False: 112k]
  ------------------
 2471|      0|		if (strcmp(name, "minor") == 0)
  ------------------
  |  Branch (2471:7): [True: 0, False: 0]
  ------------------
 2472|      0|			xar->xmlsts = FILE_DEVICE;
 2473|      0|		break;
 2474|      0|	case FILE_DEVICENO:
  ------------------
  |  Branch (2474:2): [True: 0, False: 112k]
  ------------------
 2475|      0|		if (strcmp(name, "deviceno") == 0)
  ------------------
  |  Branch (2475:7): [True: 0, False: 0]
  ------------------
 2476|      0|			xar->xmlsts = TOC_FILE;
 2477|      0|		break;
 2478|      0|	case FILE_INODE:
  ------------------
  |  Branch (2478:2): [True: 0, False: 112k]
  ------------------
 2479|      0|		if (strcmp(name, "inode") == 0)
  ------------------
  |  Branch (2479:7): [True: 0, False: 0]
  ------------------
 2480|      0|			xar->xmlsts = TOC_FILE;
 2481|      0|		break;
 2482|      0|	case FILE_LINK:
  ------------------
  |  Branch (2482:2): [True: 0, False: 112k]
  ------------------
 2483|      0|		if (strcmp(name, "link") == 0)
  ------------------
  |  Branch (2483:7): [True: 0, False: 0]
  ------------------
 2484|      0|			xar->xmlsts = TOC_FILE;
 2485|      0|		break;
 2486|      0|	case FILE_TYPE:
  ------------------
  |  Branch (2486:2): [True: 0, False: 112k]
  ------------------
 2487|      0|		if (strcmp(name, "type") == 0)
  ------------------
  |  Branch (2487:7): [True: 0, False: 0]
  ------------------
 2488|      0|			xar->xmlsts = TOC_FILE;
 2489|      0|		break;
 2490|      0|	case FILE_NAME:
  ------------------
  |  Branch (2490:2): [True: 0, False: 112k]
  ------------------
 2491|      0|		if (strcmp(name, "name") == 0)
  ------------------
  |  Branch (2491:7): [True: 0, False: 0]
  ------------------
 2492|      0|			xar->xmlsts = TOC_FILE;
 2493|      0|		break;
 2494|      0|	case FILE_ACL:
  ------------------
  |  Branch (2494:2): [True: 0, False: 112k]
  ------------------
 2495|      0|		if (strcmp(name, "acl") == 0)
  ------------------
  |  Branch (2495:7): [True: 0, False: 0]
  ------------------
 2496|      0|			xar->xmlsts = TOC_FILE;
 2497|      0|		break;
 2498|      0|	case FILE_ACL_DEFAULT:
  ------------------
  |  Branch (2498:2): [True: 0, False: 112k]
  ------------------
 2499|      0|		if (strcmp(name, "default") == 0)
  ------------------
  |  Branch (2499:7): [True: 0, False: 0]
  ------------------
 2500|      0|			xar->xmlsts = FILE_ACL;
 2501|      0|		break;
 2502|      0|	case FILE_ACL_ACCESS:
  ------------------
  |  Branch (2502:2): [True: 0, False: 112k]
  ------------------
 2503|      0|		if (strcmp(name, "access") == 0)
  ------------------
  |  Branch (2503:7): [True: 0, False: 0]
  ------------------
 2504|      0|			xar->xmlsts = FILE_ACL;
 2505|      0|		break;
 2506|      0|	case FILE_ACL_APPLEEXTENDED:
  ------------------
  |  Branch (2506:2): [True: 0, False: 112k]
  ------------------
 2507|      0|		if (strcmp(name, "appleextended") == 0)
  ------------------
  |  Branch (2507:7): [True: 0, False: 0]
  ------------------
 2508|      0|			xar->xmlsts = FILE_ACL;
 2509|      0|		break;
 2510|      0|	case FILE_FLAGS:
  ------------------
  |  Branch (2510:2): [True: 0, False: 112k]
  ------------------
 2511|      0|		if (strcmp(name, "flags") == 0)
  ------------------
  |  Branch (2511:7): [True: 0, False: 0]
  ------------------
 2512|      0|			xar->xmlsts = TOC_FILE;
 2513|      0|		break;
 2514|      0|	case FILE_FLAGS_USER_NODUMP:
  ------------------
  |  Branch (2514:2): [True: 0, False: 112k]
  ------------------
 2515|      0|		if (strcmp(name, "UserNoDump") == 0)
  ------------------
  |  Branch (2515:7): [True: 0, False: 0]
  ------------------
 2516|      0|			xar->xmlsts = FILE_FLAGS;
 2517|      0|		break;
 2518|      0|	case FILE_FLAGS_USER_IMMUTABLE:
  ------------------
  |  Branch (2518:2): [True: 0, False: 112k]
  ------------------
 2519|      0|		if (strcmp(name, "UserImmutable") == 0)
  ------------------
  |  Branch (2519:7): [True: 0, False: 0]
  ------------------
 2520|      0|			xar->xmlsts = FILE_FLAGS;
 2521|      0|		break;
 2522|      0|	case FILE_FLAGS_USER_APPEND:
  ------------------
  |  Branch (2522:2): [True: 0, False: 112k]
  ------------------
 2523|      0|		if (strcmp(name, "UserAppend") == 0)
  ------------------
  |  Branch (2523:7): [True: 0, False: 0]
  ------------------
 2524|      0|			xar->xmlsts = FILE_FLAGS;
 2525|      0|		break;
 2526|      0|	case FILE_FLAGS_USER_OPAQUE:
  ------------------
  |  Branch (2526:2): [True: 0, False: 112k]
  ------------------
 2527|      0|		if (strcmp(name, "UserOpaque") == 0)
  ------------------
  |  Branch (2527:7): [True: 0, False: 0]
  ------------------
 2528|      0|			xar->xmlsts = FILE_FLAGS;
 2529|      0|		break;
 2530|      0|	case FILE_FLAGS_USER_NOUNLINK:
  ------------------
  |  Branch (2530:2): [True: 0, False: 112k]
  ------------------
 2531|      0|		if (strcmp(name, "UserNoUnlink") == 0)
  ------------------
  |  Branch (2531:7): [True: 0, False: 0]
  ------------------
 2532|      0|			xar->xmlsts = FILE_FLAGS;
 2533|      0|		break;
 2534|      0|	case FILE_FLAGS_SYS_ARCHIVED:
  ------------------
  |  Branch (2534:2): [True: 0, False: 112k]
  ------------------
 2535|      0|		if (strcmp(name, "SystemArchived") == 0)
  ------------------
  |  Branch (2535:7): [True: 0, False: 0]
  ------------------
 2536|      0|			xar->xmlsts = FILE_FLAGS;
 2537|      0|		break;
 2538|      0|	case FILE_FLAGS_SYS_IMMUTABLE:
  ------------------
  |  Branch (2538:2): [True: 0, False: 112k]
  ------------------
 2539|      0|		if (strcmp(name, "SystemImmutable") == 0)
  ------------------
  |  Branch (2539:7): [True: 0, False: 0]
  ------------------
 2540|      0|			xar->xmlsts = FILE_FLAGS;
 2541|      0|		break;
 2542|      0|	case FILE_FLAGS_SYS_APPEND:
  ------------------
  |  Branch (2542:2): [True: 0, False: 112k]
  ------------------
 2543|      0|		if (strcmp(name, "SystemAppend") == 0)
  ------------------
  |  Branch (2543:7): [True: 0, False: 0]
  ------------------
 2544|      0|			xar->xmlsts = FILE_FLAGS;
 2545|      0|		break;
 2546|      0|	case FILE_FLAGS_SYS_NOUNLINK:
  ------------------
  |  Branch (2546:2): [True: 0, False: 112k]
  ------------------
 2547|      0|		if (strcmp(name, "SystemNoUnlink") == 0)
  ------------------
  |  Branch (2547:7): [True: 0, False: 0]
  ------------------
 2548|      0|			xar->xmlsts = FILE_FLAGS;
 2549|      0|		break;
 2550|      0|	case FILE_FLAGS_SYS_SNAPSHOT:
  ------------------
  |  Branch (2550:2): [True: 0, False: 112k]
  ------------------
 2551|      0|		if (strcmp(name, "SystemSnapshot") == 0)
  ------------------
  |  Branch (2551:7): [True: 0, False: 0]
  ------------------
 2552|      0|			xar->xmlsts = FILE_FLAGS;
 2553|      0|		break;
 2554|    820|	case FILE_EXT2:
  ------------------
  |  Branch (2554:2): [True: 820, False: 111k]
  ------------------
 2555|    820|		if (strcmp(name, "ext2") == 0)
  ------------------
  |  Branch (2555:7): [True: 820, False: 0]
  ------------------
 2556|    820|			xar->xmlsts = TOC_FILE;
 2557|    820|		break;
 2558|      0|	case FILE_EXT2_SecureDeletion:
  ------------------
  |  Branch (2558:2): [True: 0, False: 112k]
  ------------------
 2559|      0|		if (strcmp(name, "SecureDeletion") == 0)
  ------------------
  |  Branch (2559:7): [True: 0, False: 0]
  ------------------
 2560|      0|			xar->xmlsts = FILE_EXT2;
 2561|      0|		break;
 2562|      0|	case FILE_EXT2_Undelete:
  ------------------
  |  Branch (2562:2): [True: 0, False: 112k]
  ------------------
 2563|      0|		if (strcmp(name, "Undelete") == 0)
  ------------------
  |  Branch (2563:7): [True: 0, False: 0]
  ------------------
 2564|      0|			xar->xmlsts = FILE_EXT2;
 2565|      0|		break;
 2566|      0|	case FILE_EXT2_Compress:
  ------------------
  |  Branch (2566:2): [True: 0, False: 112k]
  ------------------
 2567|      0|		if (strcmp(name, "Compress") == 0)
  ------------------
  |  Branch (2567:7): [True: 0, False: 0]
  ------------------
 2568|      0|			xar->xmlsts = FILE_EXT2;
 2569|      0|		break;
 2570|      0|	case FILE_EXT2_Synchronous:
  ------------------
  |  Branch (2570:2): [True: 0, False: 112k]
  ------------------
 2571|      0|		if (strcmp(name, "Synchronous") == 0)
  ------------------
  |  Branch (2571:7): [True: 0, False: 0]
  ------------------
 2572|      0|			xar->xmlsts = FILE_EXT2;
 2573|      0|		break;
 2574|      0|	case FILE_EXT2_Immutable:
  ------------------
  |  Branch (2574:2): [True: 0, False: 112k]
  ------------------
 2575|      0|		if (strcmp(name, "Immutable") == 0)
  ------------------
  |  Branch (2575:7): [True: 0, False: 0]
  ------------------
 2576|      0|			xar->xmlsts = FILE_EXT2;
 2577|      0|		break;
 2578|      0|	case FILE_EXT2_AppendOnly:
  ------------------
  |  Branch (2578:2): [True: 0, False: 112k]
  ------------------
 2579|      0|		if (strcmp(name, "AppendOnly") == 0)
  ------------------
  |  Branch (2579:7): [True: 0, False: 0]
  ------------------
 2580|      0|			xar->xmlsts = FILE_EXT2;
 2581|      0|		break;
 2582|      0|	case FILE_EXT2_NoDump:
  ------------------
  |  Branch (2582:2): [True: 0, False: 112k]
  ------------------
 2583|      0|		if (strcmp(name, "NoDump") == 0)
  ------------------
  |  Branch (2583:7): [True: 0, False: 0]
  ------------------
 2584|      0|			xar->xmlsts = FILE_EXT2;
 2585|      0|		break;
 2586|      0|	case FILE_EXT2_NoAtime:
  ------------------
  |  Branch (2586:2): [True: 0, False: 112k]
  ------------------
 2587|      0|		if (strcmp(name, "NoAtime") == 0)
  ------------------
  |  Branch (2587:7): [True: 0, False: 0]
  ------------------
 2588|      0|			xar->xmlsts = FILE_EXT2;
 2589|      0|		break;
 2590|      0|	case FILE_EXT2_CompDirty:
  ------------------
  |  Branch (2590:2): [True: 0, False: 112k]
  ------------------
 2591|      0|		if (strcmp(name, "CompDirty") == 0)
  ------------------
  |  Branch (2591:7): [True: 0, False: 0]
  ------------------
 2592|      0|			xar->xmlsts = FILE_EXT2;
 2593|      0|		break;
 2594|      0|	case FILE_EXT2_CompBlock:
  ------------------
  |  Branch (2594:2): [True: 0, False: 112k]
  ------------------
 2595|      0|		if (strcmp(name, "CompBlock") == 0)
  ------------------
  |  Branch (2595:7): [True: 0, False: 0]
  ------------------
 2596|      0|			xar->xmlsts = FILE_EXT2;
 2597|      0|		break;
 2598|      0|	case FILE_EXT2_NoCompBlock:
  ------------------
  |  Branch (2598:2): [True: 0, False: 112k]
  ------------------
 2599|      0|		if (strcmp(name, "NoCompBlock") == 0)
  ------------------
  |  Branch (2599:7): [True: 0, False: 0]
  ------------------
 2600|      0|			xar->xmlsts = FILE_EXT2;
 2601|      0|		break;
 2602|      0|	case FILE_EXT2_CompError:
  ------------------
  |  Branch (2602:2): [True: 0, False: 112k]
  ------------------
 2603|      0|		if (strcmp(name, "CompError") == 0)
  ------------------
  |  Branch (2603:7): [True: 0, False: 0]
  ------------------
 2604|      0|			xar->xmlsts = FILE_EXT2;
 2605|      0|		break;
 2606|      0|	case FILE_EXT2_BTree:
  ------------------
  |  Branch (2606:2): [True: 0, False: 112k]
  ------------------
 2607|      0|		if (strcmp(name, "BTree") == 0)
  ------------------
  |  Branch (2607:7): [True: 0, False: 0]
  ------------------
 2608|      0|			xar->xmlsts = FILE_EXT2;
 2609|      0|		break;
 2610|      0|	case FILE_EXT2_HashIndexed:
  ------------------
  |  Branch (2610:2): [True: 0, False: 112k]
  ------------------
 2611|      0|		if (strcmp(name, "HashIndexed") == 0)
  ------------------
  |  Branch (2611:7): [True: 0, False: 0]
  ------------------
 2612|      0|			xar->xmlsts = FILE_EXT2;
 2613|      0|		break;
 2614|      0|	case FILE_EXT2_iMagic:
  ------------------
  |  Branch (2614:2): [True: 0, False: 112k]
  ------------------
 2615|      0|		if (strcmp(name, "iMagic") == 0)
  ------------------
  |  Branch (2615:7): [True: 0, False: 0]
  ------------------
 2616|      0|			xar->xmlsts = FILE_EXT2;
 2617|      0|		break;
 2618|      0|	case FILE_EXT2_Journaled:
  ------------------
  |  Branch (2618:2): [True: 0, False: 112k]
  ------------------
 2619|      0|		if (strcmp(name, "Journaled") == 0)
  ------------------
  |  Branch (2619:7): [True: 0, False: 0]
  ------------------
 2620|      0|			xar->xmlsts = FILE_EXT2;
 2621|      0|		break;
 2622|      0|	case FILE_EXT2_NoTail:
  ------------------
  |  Branch (2622:2): [True: 0, False: 112k]
  ------------------
 2623|      0|		if (strcmp(name, "NoTail") == 0)
  ------------------
  |  Branch (2623:7): [True: 0, False: 0]
  ------------------
 2624|      0|			xar->xmlsts = FILE_EXT2;
 2625|      0|		break;
 2626|      0|	case FILE_EXT2_DirSync:
  ------------------
  |  Branch (2626:2): [True: 0, False: 112k]
  ------------------
 2627|      0|		if (strcmp(name, "DirSync") == 0)
  ------------------
  |  Branch (2627:7): [True: 0, False: 0]
  ------------------
 2628|      0|			xar->xmlsts = FILE_EXT2;
 2629|      0|		break;
 2630|      0|	case FILE_EXT2_TopDir:
  ------------------
  |  Branch (2630:2): [True: 0, False: 112k]
  ------------------
 2631|      0|		if (strcmp(name, "TopDir") == 0)
  ------------------
  |  Branch (2631:7): [True: 0, False: 0]
  ------------------
 2632|      0|			xar->xmlsts = FILE_EXT2;
 2633|      0|		break;
 2634|      0|	case FILE_EXT2_Reserved:
  ------------------
  |  Branch (2634:2): [True: 0, False: 112k]
  ------------------
 2635|      0|		if (strcmp(name, "Reserved") == 0)
  ------------------
  |  Branch (2635:7): [True: 0, False: 0]
  ------------------
 2636|      0|			xar->xmlsts = FILE_EXT2;
 2637|      0|		break;
 2638|  63.0k|	case UNKNOWN:
  ------------------
  |  Branch (2638:2): [True: 63.0k, False: 49.5k]
  ------------------
 2639|  63.0k|		unknowntag_end(xar, name);
 2640|  63.0k|		break;
 2641|   112k|	}
 2642|   112k|}
archive_read_support_format_xar.c:unknowntag_end:
 2001|  63.0k|{
 2002|  63.0k|	struct unknown_tag *tag;
 2003|       |
 2004|  63.0k|	tag = xar->unknowntags;
 2005|  63.0k|	if (tag == NULL || name == NULL)
  ------------------
  |  Branch (2005:6): [True: 0, False: 63.0k]
  |  Branch (2005:21): [True: 0, False: 63.0k]
  ------------------
 2006|      0|		return;
 2007|  63.0k|	if (strcmp(tag->name.s, name) == 0) {
  ------------------
  |  Branch (2007:6): [True: 63.0k, False: 0]
  ------------------
 2008|  63.0k|		xar->unknowntags = tag->next;
 2009|  63.0k|		archive_string_free(&(tag->name));
 2010|  63.0k|		free(tag);
 2011|  63.0k|		if (xar->unknowntags == NULL) {
  ------------------
  |  Branch (2011:7): [True: 54.6k, False: 8.45k]
  ------------------
 2012|       |#if DEBUG
 2013|       |			fprintf(stderr, "UNKNOWNTAG_END:%s\n", name);
 2014|       |#endif
 2015|  54.6k|			xar->xmlsts = xar->xmlsts_unknown;
 2016|  54.6k|		}
 2017|  63.0k|	}
 2018|  63.0k|}
archive_read_support_format_xar.c:xml_data:
 2739|   155k|{
 2740|   155k|	struct archive_read *a = (struct archive_read *)userData;
 2741|   155k|	struct xar *xar = a->format->data;
 2742|   155k|	uint64_t val;
 2743|   155k|	int r;
 2744|       |
 2745|       |#if DEBUG
 2746|       |	{
 2747|       |		char buff[1024];
 2748|       |		size_t dlen = len;
 2749|       |		if (dlen > sizeof(buff) - 1)
 2750|       |			dlen = sizeof(buff) - 1;
 2751|       |		strncpy(buff, s, dlen);
 2752|       |		buff[dlen] = 0;
 2753|       |		fprintf(stderr, "\tlen=%zu:\"%s\"\n", dlen, buff);
 2754|       |	}
 2755|       |#endif
 2756|   155k|	switch (xar->xmlsts) {
 2757|  2.39k|	case TOC_CHECKSUM_OFFSET:
  ------------------
  |  Branch (2757:2): [True: 2.39k, False: 152k]
  ------------------
 2758|  2.39k|		r = atou64(s, len, 10, &xar->toc_chksum_offset);
 2759|  2.39k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.39k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2759:7): [True: 1, False: 2.39k]
  ------------------
 2760|      1|			return (r);
 2761|  2.39k|		break;
 2762|  2.39k|	case TOC_CHECKSUM_SIZE:
  ------------------
  |  Branch (2762:2): [True: 1.13k, False: 154k]
  ------------------
 2763|  1.13k|		r = atou64(s, len, 10, &xar->toc_chksum_size);
 2764|  1.13k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  1.13k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2764:7): [True: 1, False: 1.13k]
  ------------------
 2765|      1|			return (r);
 2766|  1.13k|		break;
 2767|   151k|	default:
  ------------------
  |  Branch (2767:2): [True: 151k, False: 3.52k]
  ------------------
 2768|   151k|		break;
 2769|   155k|	}
 2770|   155k|	if (xar->file == NULL)
  ------------------
  |  Branch (2770:6): [True: 33.2k, False: 121k]
  ------------------
 2771|  33.2k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  33.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2772|       |
 2773|   121k|	switch (xar->xmlsts) {
  ------------------
  |  Branch (2773:10): [True: 121k, False: 0]
  ------------------
 2774|      0|	case FILE_NAME:
  ------------------
  |  Branch (2774:2): [True: 0, False: 121k]
  ------------------
 2775|      0|		if (xar->file->has & HAS_PATHNAME)
  ------------------
  |  |  174|      0|#define HAS_PATHNAME		0x00002
  ------------------
  |  Branch (2775:7): [True: 0, False: 0]
  ------------------
 2776|      0|			break;
 2777|       |
 2778|      0|		if (xar->file->parent != NULL) {
  ------------------
  |  Branch (2778:7): [True: 0, False: 0]
  ------------------
 2779|      0|			archive_string_concat(&(xar->file->pathname),
 2780|      0|			    &(xar->file->parent->pathname));
 2781|      0|			archive_strappend_char(&(xar->file->pathname), '/');
 2782|      0|		}
 2783|      0|		xar->file->has |= HAS_PATHNAME;
  ------------------
  |  |  174|      0|#define HAS_PATHNAME		0x00002
  ------------------
 2784|      0|		if (xar->base64text) {
  ------------------
  |  Branch (2784:7): [True: 0, False: 0]
  ------------------
 2785|      0|			strappend_base64(xar,
 2786|      0|			    &(xar->file->pathname), s, len);
 2787|      0|		} else
 2788|      0|			archive_strncat(&(xar->file->pathname), s, len);
 2789|      0|		break;
 2790|      0|	case FILE_LINK:
  ------------------
  |  Branch (2790:2): [True: 0, False: 121k]
  ------------------
 2791|      0|		xar->file->has |= HAS_SYMLINK;
  ------------------
  |  |  175|      0|#define HAS_SYMLINK		0x00004
  ------------------
 2792|      0|		archive_strncpy(&(xar->file->symlink), s, len);
  ------------------
  |  |  173|      0|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 2793|      0|		break;
 2794|      0|	case FILE_TYPE:
  ------------------
  |  Branch (2794:2): [True: 0, False: 121k]
  ------------------
 2795|      0|		if (is_string("file", s, len) == 0 ||
  ------------------
  |  Branch (2795:7): [True: 0, False: 0]
  ------------------
 2796|      0|		    is_string("hardlink", s, len) == 0)
  ------------------
  |  Branch (2796:7): [True: 0, False: 0]
  ------------------
 2797|      0|			xar->file->mode =
 2798|      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)
  ------------------
 2799|      0|		if (is_string("directory", s, len) == 0)
  ------------------
  |  Branch (2799:7): [True: 0, False: 0]
  ------------------
 2800|      0|			xar->file->mode =
 2801|      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)
  ------------------
 2802|      0|		if (is_string("symlink", s, len) == 0)
  ------------------
  |  Branch (2802:7): [True: 0, False: 0]
  ------------------
 2803|      0|			xar->file->mode =
 2804|      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)
  ------------------
 2805|      0|		if (is_string("character special", s, len) == 0)
  ------------------
  |  Branch (2805:7): [True: 0, False: 0]
  ------------------
 2806|      0|			xar->file->mode =
 2807|      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)
  ------------------
 2808|      0|		if (is_string("block special", s, len) == 0)
  ------------------
  |  Branch (2808:7): [True: 0, False: 0]
  ------------------
 2809|      0|			xar->file->mode =
 2810|      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)
  ------------------
 2811|      0|		if (is_string("socket", s, len) == 0)
  ------------------
  |  Branch (2811:7): [True: 0, False: 0]
  ------------------
 2812|      0|			xar->file->mode =
 2813|      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)
  ------------------
 2814|      0|		if (is_string("fifo", s, len) == 0)
  ------------------
  |  Branch (2814:7): [True: 0, False: 0]
  ------------------
 2815|      0|			xar->file->mode =
 2816|      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)
  ------------------
 2817|      0|		xar->file->has |= HAS_TYPE;
  ------------------
  |  |  180|      0|#define HAS_TYPE		0x00080
  ------------------
 2818|      0|		break;
 2819|      0|	case FILE_INODE:
  ------------------
  |  Branch (2819:2): [True: 0, False: 121k]
  ------------------
 2820|      0|		r = atou64(s, len, 10, &val);
 2821|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2821:7): [True: 0, False: 0]
  ------------------
 2822|      0|			return (r);
 2823|      0|		if (val > (uint64_t)INT64_MAX)
  ------------------
  |  Branch (2823:7): [True: 0, False: 0]
  ------------------
 2824|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2825|      0|		xar->file->has |= HAS_INO;
  ------------------
  |  |  184|      0|#define HAS_INO			0x00800
  ------------------
 2826|      0|		xar->file->ino64 = (int64_t)val;
 2827|      0|		break;
 2828|      0|	case FILE_DEVICE_MAJOR:
  ------------------
  |  Branch (2828:2): [True: 0, False: 121k]
  ------------------
 2829|      0|		r = atou64(s, len, 10, &val);
 2830|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2830:7): [True: 0, False: 0]
  ------------------
 2831|      0|			return (r);
 2832|      0|		if (val != (dev_t)val)
  ------------------
  |  Branch (2832:7): [True: 0, False: 0]
  ------------------
 2833|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2834|      0|		xar->file->has |= HAS_DEVMAJOR;
  ------------------
  |  |  182|      0|#define HAS_DEVMAJOR		0x00200
  ------------------
 2835|      0|		xar->file->devmajor = (dev_t)val;
 2836|      0|		break;
 2837|      0|	case FILE_DEVICE_MINOR:
  ------------------
  |  Branch (2837:2): [True: 0, False: 121k]
  ------------------
 2838|      0|		r = atou64(s, len, 10, &val);
 2839|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2839:7): [True: 0, False: 0]
  ------------------
 2840|      0|			return (r);
 2841|      0|		if (val != (dev_t)val)
  ------------------
  |  Branch (2841:7): [True: 0, False: 0]
  ------------------
 2842|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2843|      0|		xar->file->has |= HAS_DEVMINOR;
  ------------------
  |  |  183|      0|#define HAS_DEVMINOR		0x00400
  ------------------
 2844|      0|		xar->file->devminor = (dev_t)val;
 2845|      0|		break;
 2846|      0|	case FILE_DEVICENO:
  ------------------
  |  Branch (2846:2): [True: 0, False: 121k]
  ------------------
 2847|      0|		r = atou64(s, len, 10, &val);
 2848|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2848:7): [True: 0, False: 0]
  ------------------
 2849|      0|			return (r);
 2850|      0|		if (val != (dev_t)val)
  ------------------
  |  Branch (2850:7): [True: 0, False: 0]
  ------------------
 2851|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2852|      0|		xar->file->has |= HAS_DEV;
  ------------------
  |  |  181|      0|#define HAS_DEV			0x00100
  ------------------
 2853|      0|		xar->file->dev = (dev_t)val;
 2854|      0|		break;
 2855|    723|	case FILE_MODE:
  ------------------
  |  Branch (2855:2): [True: 723, False: 121k]
  ------------------
 2856|    723|		r = atou64(s, len, 8, &val);
 2857|    723|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    723|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2857:7): [True: 3, False: 720]
  ------------------
 2858|      3|			return (r);
 2859|    720|		if (val != (mode_t)val)
  ------------------
  |  Branch (2859:7): [True: 1, False: 719]
  ------------------
 2860|      1|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2861|    719|		xar->file->has |= HAS_MODE;
  ------------------
  |  |  179|    719|#define HAS_MODE		0x00040
  ------------------
 2862|    719|		xar->file->mode =
 2863|    719|		    (xar->file->mode & AE_IFMT) | ((mode_t)val & ~AE_IFMT);
  ------------------
  |  |  215|    719|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              		    (xar->file->mode & AE_IFMT) | ((mode_t)val & ~AE_IFMT);
  ------------------
  |  |  215|    719|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 2864|    719|		break;
 2865|    777|	case FILE_GROUP:
  ------------------
  |  Branch (2865:2): [True: 777, False: 121k]
  ------------------
 2866|    777|		xar->file->has |= HAS_GID;
  ------------------
  |  |  178|    777|#define HAS_GID			0x00020
  ------------------
 2867|    777|		archive_strncpy(&(xar->file->gname), s, len);
  ------------------
  |  |  173|    777|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 2868|    777|		break;
 2869|  1.46k|	case FILE_GID:
  ------------------
  |  Branch (2869:2): [True: 1.46k, False: 120k]
  ------------------
 2870|  1.46k|		r = atou64(s, len, 10, &val);
 2871|  1.46k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  1.46k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2871:7): [True: 1, False: 1.45k]
  ------------------
 2872|      1|			return (r);
 2873|  1.45k|		if (val > (uint64_t)INT64_MAX)
  ------------------
  |  Branch (2873:7): [True: 0, False: 1.45k]
  ------------------
 2874|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2875|  1.45k|		xar->file->has |= HAS_GID;
  ------------------
  |  |  178|  1.45k|#define HAS_GID			0x00020
  ------------------
 2876|  1.45k|		xar->file->gid = (int64_t)val;
 2877|  1.45k|		break;
 2878|  1.41k|	case FILE_USER:
  ------------------
  |  Branch (2878:2): [True: 1.41k, False: 120k]
  ------------------
 2879|  1.41k|		xar->file->has |= HAS_UID;
  ------------------
  |  |  177|  1.41k|#define HAS_UID			0x00010
  ------------------
 2880|  1.41k|		archive_strncpy(&(xar->file->uname), s, len);
  ------------------
  |  |  173|  1.41k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 2881|  1.41k|		break;
 2882|  1.37k|	case FILE_UID:
  ------------------
  |  Branch (2882:2): [True: 1.37k, False: 120k]
  ------------------
 2883|  1.37k|		r = atou64(s, len, 10, &val);
 2884|  1.37k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  1.37k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2884:7): [True: 1, False: 1.37k]
  ------------------
 2885|      1|			return (r);
 2886|  1.37k|		if (val > (uint64_t)INT64_MAX)
  ------------------
  |  Branch (2886:7): [True: 0, False: 1.37k]
  ------------------
 2887|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2888|  1.37k|		xar->file->has |= HAS_UID;
  ------------------
  |  |  177|  1.37k|#define HAS_UID			0x00010
  ------------------
 2889|  1.37k|		xar->file->uid = (int64_t)val;
 2890|  1.37k|		break;
 2891|    819|	case FILE_CTIME:
  ------------------
  |  Branch (2891:2): [True: 819, False: 121k]
  ------------------
 2892|    819|		xar->file->has |= HAS_TIME | HAS_CTIME;
  ------------------
  |  |  176|    819|#define HAS_TIME		0x00008
  ------------------
              		xar->file->has |= HAS_TIME | HAS_CTIME;
  ------------------
  |  |  188|    819|#define HAS_CTIME		0x08000
  ------------------
 2893|    819|		xar->file->ctime = parse_time(s, len);
 2894|    819|		break;
 2895|    689|	case FILE_MTIME:
  ------------------
  |  Branch (2895:2): [True: 689, False: 121k]
  ------------------
 2896|    689|		xar->file->has |= HAS_TIME | HAS_MTIME;
  ------------------
  |  |  176|    689|#define HAS_TIME		0x00008
  ------------------
              		xar->file->has |= HAS_TIME | HAS_MTIME;
  ------------------
  |  |  189|    689|#define HAS_MTIME		0x10000
  ------------------
 2897|    689|		xar->file->mtime = parse_time(s, len);
 2898|    689|		break;
 2899|  15.7k|	case FILE_ATIME:
  ------------------
  |  Branch (2899:2): [True: 15.7k, False: 106k]
  ------------------
 2900|  15.7k|		xar->file->has |= HAS_TIME | HAS_ATIME;
  ------------------
  |  |  176|  15.7k|#define HAS_TIME		0x00008
  ------------------
              		xar->file->has |= HAS_TIME | HAS_ATIME;
  ------------------
  |  |  190|  15.7k|#define HAS_ATIME		0x20000
  ------------------
 2901|  15.7k|		xar->file->atime = parse_time(s, len);
 2902|  15.7k|		break;
 2903|  1.12k|	case FILE_DATA_LENGTH:
  ------------------
  |  Branch (2903:2): [True: 1.12k, False: 120k]
  ------------------
 2904|  1.12k|		r = atou64(s, len, 10, &xar->file->length);
 2905|  1.12k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  1.12k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2905:7): [True: 1, False: 1.11k]
  ------------------
 2906|      1|			return (r);
 2907|  1.11k|		xar->file->has |= HAS_DATA;
  ------------------
  |  |  173|  1.11k|#define HAS_DATA		0x00001
  ------------------
 2908|  1.11k|		break;
 2909|  1.22k|	case FILE_DATA_OFFSET:
  ------------------
  |  Branch (2909:2): [True: 1.22k, False: 120k]
  ------------------
 2910|  1.22k|		r = atou64(s, len, 10, &xar->file->offset);
 2911|  1.22k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  1.22k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2911:7): [True: 0, False: 1.22k]
  ------------------
 2912|      0|			return (r);
 2913|  1.22k|		xar->file->has |= HAS_DATA;
  ------------------
  |  |  173|  1.22k|#define HAS_DATA		0x00001
  ------------------
 2914|  1.22k|		break;
 2915|  1.98k|	case FILE_DATA_SIZE:
  ------------------
  |  Branch (2915:2): [True: 1.98k, False: 119k]
  ------------------
 2916|  1.98k|		r = atou64(s, len, 10, &xar->file->size);
 2917|  1.98k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  1.98k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2917:7): [True: 1, False: 1.98k]
  ------------------
 2918|      1|			return (r);
 2919|  1.98k|		xar->file->has |= HAS_DATA;
  ------------------
  |  |  173|  1.98k|#define HAS_DATA		0x00001
  ------------------
 2920|  1.98k|		break;
 2921|  9.39k|	case FILE_DATA_A_CHECKSUM:
  ------------------
  |  Branch (2921:2): [True: 9.39k, False: 112k]
  ------------------
 2922|  9.39k|		xar->file->a_sum.len = atohex(xar->file->a_sum.val,
 2923|  9.39k|		    sizeof(xar->file->a_sum.val), s, len);
 2924|  9.39k|		break;
 2925|  2.76k|	case FILE_DATA_E_CHECKSUM:
  ------------------
  |  Branch (2925:2): [True: 2.76k, False: 119k]
  ------------------
 2926|  2.76k|		xar->file->e_sum.len = atohex(xar->file->e_sum.val,
 2927|  2.76k|		    sizeof(xar->file->e_sum.val), s, len);
 2928|  2.76k|		break;
 2929|    801|	case FILE_EA_LENGTH:
  ------------------
  |  Branch (2929:2): [True: 801, False: 121k]
  ------------------
 2930|    801|		r = atou64(s, len, 10, &xar->xattr->length);
 2931|    801|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    801|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2931:7): [True: 1, False: 800]
  ------------------
 2932|      1|			return (r);
 2933|    800|		xar->file->has |= HAS_XATTR;
  ------------------
  |  |  186|    800|#define HAS_XATTR		0x02000
  ------------------
 2934|    800|		break;
 2935|  1.05k|	case FILE_EA_OFFSET:
  ------------------
  |  Branch (2935:2): [True: 1.05k, False: 120k]
  ------------------
 2936|  1.05k|		r = atou64(s, len, 10, &xar->xattr->offset);
 2937|  1.05k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  1.05k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2937:7): [True: 0, False: 1.05k]
  ------------------
 2938|      0|			return (r);
 2939|  1.05k|		xar->file->has |= HAS_XATTR;
  ------------------
  |  |  186|  1.05k|#define HAS_XATTR		0x02000
  ------------------
 2940|  1.05k|		break;
 2941|    630|	case FILE_EA_SIZE:
  ------------------
  |  Branch (2941:2): [True: 630, False: 121k]
  ------------------
 2942|    630|		r = atou64(s, len, 10, &xar->xattr->size);
 2943|    630|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    630|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2943:7): [True: 1, False: 629]
  ------------------
 2944|      1|			return (r);
 2945|    629|		xar->file->has |= HAS_XATTR;
  ------------------
  |  |  186|    629|#define HAS_XATTR		0x02000
  ------------------
 2946|    629|		break;
 2947|  3.64k|	case FILE_EA_A_CHECKSUM:
  ------------------
  |  Branch (2947:2): [True: 3.64k, False: 118k]
  ------------------
 2948|  3.64k|		xar->file->has |= HAS_XATTR;
  ------------------
  |  |  186|  3.64k|#define HAS_XATTR		0x02000
  ------------------
 2949|  3.64k|		xar->xattr->a_sum.len = atohex(xar->xattr->a_sum.val,
 2950|  3.64k|		    sizeof(xar->xattr->a_sum.val), s, len);
 2951|  3.64k|		break;
 2952|  1.73k|	case FILE_EA_E_CHECKSUM:
  ------------------
  |  Branch (2952:2): [True: 1.73k, False: 120k]
  ------------------
 2953|  1.73k|		xar->file->has |= HAS_XATTR;
  ------------------
  |  |  186|  1.73k|#define HAS_XATTR		0x02000
  ------------------
 2954|  1.73k|		xar->xattr->e_sum.len = atohex(xar->xattr->e_sum.val,
 2955|  1.73k|		    sizeof(xar->xattr->e_sum.val), s, len);
 2956|  1.73k|		break;
 2957|      0|	case FILE_EA_NAME:
  ------------------
  |  Branch (2957:2): [True: 0, False: 121k]
  ------------------
 2958|      0|		xar->file->has |= HAS_XATTR;
  ------------------
  |  |  186|      0|#define HAS_XATTR		0x02000
  ------------------
 2959|      0|		archive_strncpy(&(xar->xattr->name), s, len);
  ------------------
  |  |  173|      0|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 2960|      0|		break;
 2961|      0|	case FILE_EA_FSTYPE:
  ------------------
  |  Branch (2961:2): [True: 0, False: 121k]
  ------------------
 2962|      0|		xar->file->has |= HAS_XATTR;
  ------------------
  |  |  186|      0|#define HAS_XATTR		0x02000
  ------------------
 2963|      0|		archive_strncpy(&(xar->xattr->fstype), s, len);
  ------------------
  |  |  173|      0|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 2964|      0|		break;
 2965|      0|	case FILE_ACL_DEFAULT:
  ------------------
  |  Branch (2965:2): [True: 0, False: 121k]
  ------------------
 2966|      0|	case FILE_ACL_ACCESS:
  ------------------
  |  Branch (2966:2): [True: 0, False: 121k]
  ------------------
 2967|      0|	case FILE_ACL_APPLEEXTENDED:
  ------------------
  |  Branch (2967:2): [True: 0, False: 121k]
  ------------------
 2968|      0|		xar->file->has |= HAS_ACL;
  ------------------
  |  |  187|      0|#define HAS_ACL			0x04000
  ------------------
 2969|       |		/* TODO */
 2970|      0|		break;
 2971|      0|	case INIT:
  ------------------
  |  Branch (2971:2): [True: 0, False: 121k]
  ------------------
 2972|      0|	case XAR:
  ------------------
  |  Branch (2972:2): [True: 0, False: 121k]
  ------------------
 2973|      0|	case TOC:
  ------------------
  |  Branch (2973:2): [True: 0, False: 121k]
  ------------------
 2974|      0|	case TOC_CREATION_TIME:
  ------------------
  |  Branch (2974:2): [True: 0, False: 121k]
  ------------------
 2975|      0|	case TOC_CHECKSUM:
  ------------------
  |  Branch (2975:2): [True: 0, False: 121k]
  ------------------
 2976|      0|	case TOC_CHECKSUM_OFFSET:
  ------------------
  |  Branch (2976:2): [True: 0, False: 121k]
  ------------------
 2977|      0|	case TOC_CHECKSUM_SIZE:
  ------------------
  |  Branch (2977:2): [True: 0, False: 121k]
  ------------------
 2978|  12.9k|	case TOC_FILE:
  ------------------
  |  Branch (2978:2): [True: 12.9k, False: 108k]
  ------------------
 2979|  42.7k|	case FILE_DATA:
  ------------------
  |  Branch (2979:2): [True: 29.8k, False: 92.0k]
  ------------------
 2980|  42.9k|	case FILE_DATA_ENCODING:
  ------------------
  |  Branch (2980:2): [True: 211, False: 121k]
  ------------------
 2981|  42.9k|	case FILE_DATA_CONTENT:
  ------------------
  |  Branch (2981:2): [True: 0, False: 121k]
  ------------------
 2982|  42.9k|	case FILE_DEVICE:
  ------------------
  |  Branch (2982:2): [True: 0, False: 121k]
  ------------------
 2983|  47.3k|	case FILE_EA:
  ------------------
  |  Branch (2983:2): [True: 4.37k, False: 117k]
  ------------------
 2984|  47.4k|	case FILE_EA_ENCODING:
  ------------------
  |  Branch (2984:2): [True: 83, False: 121k]
  ------------------
 2985|  47.4k|	case FILE_ACL:
  ------------------
  |  Branch (2985:2): [True: 0, False: 121k]
  ------------------
 2986|  47.4k|	case FILE_FLAGS:
  ------------------
  |  Branch (2986:2): [True: 0, False: 121k]
  ------------------
 2987|  47.4k|	case FILE_FLAGS_USER_NODUMP:
  ------------------
  |  Branch (2987:2): [True: 0, False: 121k]
  ------------------
 2988|  47.4k|	case FILE_FLAGS_USER_IMMUTABLE:
  ------------------
  |  Branch (2988:2): [True: 0, False: 121k]
  ------------------
 2989|  47.4k|	case FILE_FLAGS_USER_APPEND:
  ------------------
  |  Branch (2989:2): [True: 0, False: 121k]
  ------------------
 2990|  47.4k|	case FILE_FLAGS_USER_OPAQUE:
  ------------------
  |  Branch (2990:2): [True: 0, False: 121k]
  ------------------
 2991|  47.4k|	case FILE_FLAGS_USER_NOUNLINK:
  ------------------
  |  Branch (2991:2): [True: 0, False: 121k]
  ------------------
 2992|  47.4k|	case FILE_FLAGS_SYS_ARCHIVED:
  ------------------
  |  Branch (2992:2): [True: 0, False: 121k]
  ------------------
 2993|  47.4k|	case FILE_FLAGS_SYS_IMMUTABLE:
  ------------------
  |  Branch (2993:2): [True: 0, False: 121k]
  ------------------
 2994|  47.4k|	case FILE_FLAGS_SYS_APPEND:
  ------------------
  |  Branch (2994:2): [True: 0, False: 121k]
  ------------------
 2995|  47.4k|	case FILE_FLAGS_SYS_NOUNLINK:
  ------------------
  |  Branch (2995:2): [True: 0, False: 121k]
  ------------------
 2996|  47.4k|	case FILE_FLAGS_SYS_SNAPSHOT:
  ------------------
  |  Branch (2996:2): [True: 0, False: 121k]
  ------------------
 2997|  47.7k|	case FILE_EXT2:
  ------------------
  |  Branch (2997:2): [True: 340, False: 121k]
  ------------------
 2998|  47.7k|	case FILE_EXT2_SecureDeletion:
  ------------------
  |  Branch (2998:2): [True: 0, False: 121k]
  ------------------
 2999|  47.7k|	case FILE_EXT2_Undelete:
  ------------------
  |  Branch (2999:2): [True: 0, False: 121k]
  ------------------
 3000|  47.7k|	case FILE_EXT2_Compress:
  ------------------
  |  Branch (3000:2): [True: 0, False: 121k]
  ------------------
 3001|  47.7k|	case FILE_EXT2_Synchronous:
  ------------------
  |  Branch (3001:2): [True: 0, False: 121k]
  ------------------
 3002|  47.7k|	case FILE_EXT2_Immutable:
  ------------------
  |  Branch (3002:2): [True: 0, False: 121k]
  ------------------
 3003|  47.7k|	case FILE_EXT2_AppendOnly:
  ------------------
  |  Branch (3003:2): [True: 0, False: 121k]
  ------------------
 3004|  47.7k|	case FILE_EXT2_NoDump:
  ------------------
  |  Branch (3004:2): [True: 0, False: 121k]
  ------------------
 3005|  47.7k|	case FILE_EXT2_NoAtime:
  ------------------
  |  Branch (3005:2): [True: 0, False: 121k]
  ------------------
 3006|  47.7k|	case FILE_EXT2_CompDirty:
  ------------------
  |  Branch (3006:2): [True: 0, False: 121k]
  ------------------
 3007|  47.7k|	case FILE_EXT2_CompBlock:
  ------------------
  |  Branch (3007:2): [True: 0, False: 121k]
  ------------------
 3008|  47.7k|	case FILE_EXT2_NoCompBlock:
  ------------------
  |  Branch (3008:2): [True: 0, False: 121k]
  ------------------
 3009|  47.7k|	case FILE_EXT2_CompError:
  ------------------
  |  Branch (3009:2): [True: 0, False: 121k]
  ------------------
 3010|  47.7k|	case FILE_EXT2_BTree:
  ------------------
  |  Branch (3010:2): [True: 0, False: 121k]
  ------------------
 3011|  47.7k|	case FILE_EXT2_HashIndexed:
  ------------------
  |  Branch (3011:2): [True: 0, False: 121k]
  ------------------
 3012|  47.7k|	case FILE_EXT2_iMagic:
  ------------------
  |  Branch (3012:2): [True: 0, False: 121k]
  ------------------
 3013|  47.7k|	case FILE_EXT2_Journaled:
  ------------------
  |  Branch (3013:2): [True: 0, False: 121k]
  ------------------
 3014|  47.7k|	case FILE_EXT2_NoTail:
  ------------------
  |  Branch (3014:2): [True: 0, False: 121k]
  ------------------
 3015|  47.7k|	case FILE_EXT2_DirSync:
  ------------------
  |  Branch (3015:2): [True: 0, False: 121k]
  ------------------
 3016|  47.7k|	case FILE_EXT2_TopDir:
  ------------------
  |  Branch (3016:2): [True: 0, False: 121k]
  ------------------
 3017|  47.7k|	case FILE_EXT2_Reserved:
  ------------------
  |  Branch (3017:2): [True: 0, False: 121k]
  ------------------
 3018|  74.6k|	case UNKNOWN:
  ------------------
  |  Branch (3018:2): [True: 26.8k, False: 95.1k]
  ------------------
 3019|  74.6k|		break;
 3020|   121k|	}
 3021|       |
 3022|   121k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|   121k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3023|   121k|}
archive_read_support_format_xar.c:parse_time:
 1163|  17.2k|{
 1164|  17.2k|	struct tm tm;
 1165|  17.2k|	time_t t = 0;
 1166|  17.2k|	uint64_t data;
 1167|       |
 1168|  17.2k|	memset(&tm, 0, sizeof(tm));
 1169|  17.2k|	if (n != 20)
  ------------------
  |  Branch (1169:6): [True: 1.12k, False: 16.1k]
  ------------------
 1170|  1.12k|		return (t);
 1171|  16.1k|	if (atou64(p, 4, 10, &data) != ARCHIVE_OK || data < 1900)
  ------------------
  |  |  233|  32.2k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1171:6): [True: 0, False: 16.1k]
  |  Branch (1171:47): [True: 3.36k, False: 12.7k]
  ------------------
 1172|  3.36k|		return (t);
 1173|  12.7k|	tm.tm_year = (int)data - 1900;
 1174|  12.7k|	p += 4;
 1175|  12.7k|	if (*p++ != '-')
  ------------------
  |  Branch (1175:6): [True: 371, False: 12.3k]
  ------------------
 1176|    371|		return (t);
 1177|  12.3k|	if (atou64(p, 2, 10, &data) != ARCHIVE_OK || data < 1 || data > 12)
  ------------------
  |  |  233|  24.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1177:6): [True: 0, False: 12.3k]
  |  Branch (1177:47): [True: 589, False: 11.7k]
  |  Branch (1177:59): [True: 1.13k, False: 10.6k]
  ------------------
 1178|  1.72k|		return (t);
 1179|  10.6k|	tm.tm_mon = (int)data -1;
 1180|  10.6k|	p += 2;
 1181|  10.6k|	if (*p++ != '-')
  ------------------
  |  Branch (1181:6): [True: 714, False: 9.92k]
  ------------------
 1182|    714|		return (t);
 1183|  9.92k|	if (atou64(p, 2, 10, &data) != ARCHIVE_OK || data < 1 || data > 31)
  ------------------
  |  |  233|  19.8k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1183:6): [True: 0, False: 9.92k]
  |  Branch (1183:47): [True: 360, False: 9.56k]
  |  Branch (1183:59): [True: 2.78k, False: 6.78k]
  ------------------
 1184|  3.14k|		return (t);
 1185|  6.78k|	tm.tm_mday = (int)data;
 1186|  6.78k|	p += 2;
 1187|  6.78k|	if (*p++ != 'T')
  ------------------
  |  Branch (1187:6): [True: 2.89k, False: 3.89k]
  ------------------
 1188|  2.89k|		return (t);
 1189|  3.89k|	if (atou64(p, 2, 10, &data) != ARCHIVE_OK || data > 23)
  ------------------
  |  |  233|  7.78k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1189:6): [True: 0, False: 3.89k]
  |  Branch (1189:47): [True: 271, False: 3.62k]
  ------------------
 1190|    271|		return (t);
 1191|  3.62k|	tm.tm_hour = (int)data;
 1192|  3.62k|	p += 2;
 1193|  3.62k|	if (*p++ != ':')
  ------------------
  |  Branch (1193:6): [True: 1.14k, False: 2.48k]
  ------------------
 1194|  1.14k|		return (t);
 1195|  2.48k|	if (atou64(p, 2, 10, &data) != ARCHIVE_OK || data > 59)
  ------------------
  |  |  233|  4.96k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1195:6): [True: 0, False: 2.48k]
  |  Branch (1195:47): [True: 84, False: 2.39k]
  ------------------
 1196|     84|		return (t);
 1197|  2.39k|	tm.tm_min = (int)data;
 1198|  2.39k|	p += 2;
 1199|  2.39k|	if (*p++ != ':')
  ------------------
  |  Branch (1199:6): [True: 990, False: 1.40k]
  ------------------
 1200|    990|		return (t);
 1201|  1.40k|	if (atou64(p, 2, 10, &data) != ARCHIVE_OK || data > 60)
  ------------------
  |  |  233|  2.81k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1201:6): [True: 0, False: 1.40k]
  |  Branch (1201:47): [True: 451, False: 957]
  ------------------
 1202|    451|		return (t);
 1203|    957|	tm.tm_sec = (int)data;
 1204|       |#if 0
 1205|       |	p += 2;
 1206|       |	if (*p != 'Z')
 1207|       |		return (t);
 1208|       |#endif
 1209|       |
 1210|    957|	t = time_from_tm(&tm);
 1211|       |
 1212|    957|	return (t);
 1213|  1.40k|}
archive_read_support_format_xar.c:time_from_tm:
 1139|    957|{
 1140|       |#if HAVE__MKGMTIME
 1141|       |        return _mkgmtime(t);
 1142|       |#elif HAVE_TIMEGM
 1143|       |        /* Use platform timegm() if available. */
 1144|    957|        return (timegm(t));
 1145|       |#else
 1146|       |        /* Else use direct calculation using POSIX assumptions. */
 1147|       |        /* First, fix up tm_yday based on the year/month/day. */
 1148|       |        mktime(t);
 1149|       |        /* Then we can compute timegm() from first principles. */
 1150|       |        return (t->tm_sec
 1151|       |            + t->tm_min * 60
 1152|       |            + t->tm_hour * 3600
 1153|       |            + t->tm_yday * 86400
 1154|       |            + (t->tm_year - 70) * 31536000
 1155|       |            + ((t->tm_year - 69) / 4) * 86400
 1156|       |            - ((t->tm_year - 1) / 100) * 86400
 1157|       |            + ((t->tm_year + 299) / 400) * 86400);
 1158|       |#endif
 1159|    957|}
archive_read_support_format_xar.c:atohex:
 1106|  17.5k|{
 1107|  17.5k|	size_t fbsize = bsize;
 1108|       |
 1109|  64.7k|	while (bsize && psize > 1) {
  ------------------
  |  Branch (1109:9): [True: 64.6k, False: 115]
  |  Branch (1109:18): [True: 62.7k, False: 1.89k]
  ------------------
 1110|  62.7k|		unsigned char x;
 1111|       |
 1112|  62.7k|		if (p[0] >= 'a' && p[0] <= 'f')
  ------------------
  |  Branch (1112:7): [True: 42.6k, False: 20.1k]
  |  Branch (1112:22): [True: 40.2k, False: 2.31k]
  ------------------
 1113|  40.2k|			x = (p[0] - 'a' + 0x0a) << 4;
 1114|  22.4k|		else if (p[0] >= 'A' && p[0] <= 'F')
  ------------------
  |  Branch (1114:12): [True: 3.78k, False: 18.6k]
  |  Branch (1114:27): [True: 1.40k, False: 2.37k]
  ------------------
 1115|  1.40k|			x = (p[0] - 'A' + 0x0a) << 4;
 1116|  21.0k|		else if (p[0] >= '0' && p[0] <= '9')
  ------------------
  |  Branch (1116:12): [True: 18.3k, False: 2.69k]
  |  Branch (1116:27): [True: 15.2k, False: 3.08k]
  ------------------
 1117|  15.2k|			x = (p[0] - '0') << 4;
 1118|  5.78k|		else
 1119|  5.78k|			return (-1);
 1120|  56.9k|		if (p[1] >= 'a' && p[1] <= 'f')
  ------------------
  |  Branch (1120:7): [True: 39.2k, False: 17.7k]
  |  Branch (1120:22): [True: 36.3k, False: 2.86k]
  ------------------
 1121|  36.3k|			x |= p[1] - 'a' + 0x0a;
 1122|  20.5k|		else if (p[1] >= 'A' && p[1] <= 'F')
  ------------------
  |  Branch (1122:12): [True: 4.02k, False: 16.5k]
  |  Branch (1122:27): [True: 1.11k, False: 2.90k]
  ------------------
 1123|  1.11k|			x |= p[1] - 'A' + 0x0a;
 1124|  19.4k|		else if (p[1] >= '0' && p[1] <= '9')
  ------------------
  |  Branch (1124:12): [True: 12.7k, False: 6.73k]
  |  Branch (1124:27): [True: 9.72k, False: 3.01k]
  ------------------
 1125|  9.72k|			x |= p[1] - '0';
 1126|  9.74k|		else
 1127|  9.74k|			return (-1);
 1128|       |
 1129|  47.2k|		*b++ = x;
 1130|  47.2k|		bsize--;
 1131|  47.2k|		p += 2;
 1132|  47.2k|		psize -= 2;
 1133|  47.2k|	}
 1134|  2.00k|	return (fbsize - bsize);
 1135|  17.5k|}
archive_read_support_format_xar.c:file_free:
 1857|  21.0k|{
 1858|  21.0k|	struct xattr *xattr;
 1859|       |
 1860|  21.0k|	archive_string_free(&(file->pathname));
 1861|  21.0k|	archive_string_free(&(file->symlink));
 1862|  21.0k|	archive_string_free(&(file->uname));
 1863|  21.0k|	archive_string_free(&(file->gname));
 1864|  21.0k|	archive_string_free(&(file->hardlink));
 1865|  21.0k|	archive_string_free(&(file->fflags_text));
 1866|  21.0k|	xattr = file->xattr_list;
 1867|  22.7k|	while (xattr != NULL) {
  ------------------
  |  Branch (1867:9): [True: 1.65k, False: 21.0k]
  ------------------
 1868|  1.65k|		struct xattr *next;
 1869|       |
 1870|  1.65k|		next = xattr->next;
 1871|  1.65k|		xattr_free(xattr);
 1872|  1.65k|		xattr = next;
 1873|  1.65k|	}
 1874|       |
 1875|  21.0k|	free(file);
 1876|  21.0k|}
archive_read_support_format_xar.c:xattr_free:
 1916|  1.65k|{
 1917|  1.65k|	archive_string_free(&(xattr->name));
 1918|  1.65k|	archive_string_free(&(xattr->fstype));
 1919|  1.65k|	free(xattr);
 1920|  1.65k|}
archive_read_support_format_xar.c:move_reading_point:
 1004|  1.07k|{
 1005|  1.07k|	struct xar *xar = a->format->data;
 1006|       |
 1007|  1.07k|	if (xar->offset - xar->h_base != offset) {
  ------------------
  |  Branch (1007:6): [True: 0, False: 1.07k]
  ------------------
 1008|       |		/* Seek forward to the start of file contents. */
 1009|      0|		int64_t step;
 1010|       |
 1011|      0|		step = offset - (xar->offset - xar->h_base);
 1012|      0|		if (step > 0) {
  ------------------
  |  Branch (1012:7): [True: 0, False: 0]
  ------------------
 1013|      0|			step = __archive_read_consume(a, step);
 1014|      0|			if (step < 0)
  ------------------
  |  Branch (1014:8): [True: 0, False: 0]
  ------------------
 1015|      0|				return ((int)step);
 1016|      0|			xar->offset += step;
 1017|      0|		} else {
 1018|      0|			int64_t pos = __archive_read_seek(a, xar->h_base + offset, SEEK_SET);
 1019|      0|			if (pos == ARCHIVE_FAILED) {
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  |  Branch (1019:8): [True: 0, False: 0]
  ------------------
 1020|      0|				archive_set_error(&(a->archive),
 1021|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1022|      0|				    "Cannot seek");
 1023|      0|				return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1024|      0|			}
 1025|      0|			xar->offset = pos;
 1026|      0|		}
 1027|      0|	}
 1028|  1.07k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.07k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1029|  1.07k|}
archive_read_support_format_xar.c:rd_contents_init:
 1034|  1.07k|{
 1035|  1.07k|	int r;
 1036|       |
 1037|       |	/* Init decompress library. */
 1038|  1.07k|	if ((r = decompression_init(a, encoding)) != ARCHIVE_OK)
  ------------------
  |  |  233|  1.07k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1038:6): [True: 0, False: 1.07k]
  ------------------
 1039|      0|		return (r);
 1040|       |	/* Init checksum library. */
 1041|  1.07k|	return (checksum_init(a, a_sum_alg, e_sum_alg));
 1042|  1.07k|}
archive_read_support_format_xar.c:decompression_init:
 1486|  1.07k|{
 1487|  1.07k|	struct xar *xar = a->format->data;
 1488|  1.07k|	const char *detail;
 1489|  1.07k|	int r;
 1490|       |
 1491|  1.07k|	xar->rd_encoding = encoding;
 1492|  1.07k|	switch (encoding) {
 1493|      0|	case NONE:
  ------------------
  |  Branch (1493:2): [True: 0, False: 1.07k]
  ------------------
 1494|      0|		break;
 1495|  1.07k|	case GZIP:
  ------------------
  |  Branch (1495:2): [True: 1.07k, False: 0]
  ------------------
 1496|  1.07k|		if (xar->stream_valid)
  ------------------
  |  Branch (1496:7): [True: 0, False: 1.07k]
  ------------------
 1497|      0|			r = inflateReset(&(xar->stream));
 1498|  1.07k|		else
 1499|  1.07k|			r = inflateInit(&(xar->stream));
 1500|  1.07k|		if (r != Z_OK) {
  ------------------
  |  Branch (1500:7): [True: 0, False: 1.07k]
  ------------------
 1501|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1502|      0|			    "Couldn't initialize zlib stream");
 1503|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1504|      0|		}
 1505|  1.07k|		xar->stream_valid = 1;
 1506|  1.07k|		xar->stream.total_in = 0;
 1507|  1.07k|		xar->stream.total_out = 0;
 1508|  1.07k|		break;
 1509|      0|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 1510|      0|	case BZIP2:
  ------------------
  |  Branch (1510:2): [True: 0, False: 1.07k]
  ------------------
 1511|      0|		if (xar->bzstream_valid) {
  ------------------
  |  Branch (1511:7): [True: 0, False: 0]
  ------------------
 1512|      0|			BZ2_bzDecompressEnd(&(xar->bzstream));
 1513|      0|			xar->bzstream_valid = 0;
 1514|      0|		}
 1515|      0|		r = BZ2_bzDecompressInit(&(xar->bzstream), 0, 0);
 1516|      0|		if (r == BZ_MEM_ERROR)
  ------------------
  |  Branch (1516:7): [True: 0, False: 0]
  ------------------
 1517|      0|			r = BZ2_bzDecompressInit(&(xar->bzstream), 0, 1);
 1518|      0|		if (r != BZ_OK) {
  ------------------
  |  Branch (1518:7): [True: 0, False: 0]
  ------------------
 1519|      0|			int err = ARCHIVE_ERRNO_MISC;
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1520|      0|			detail = NULL;
 1521|      0|			switch (r) {
  ------------------
  |  Branch (1521:12): [True: 0, False: 0]
  ------------------
 1522|      0|			case BZ_PARAM_ERROR:
  ------------------
  |  Branch (1522:4): [True: 0, False: 0]
  ------------------
 1523|      0|				detail = "invalid setup parameter";
 1524|      0|				break;
 1525|      0|			case BZ_MEM_ERROR:
  ------------------
  |  Branch (1525:4): [True: 0, False: 0]
  ------------------
 1526|      0|				err = ENOMEM;
 1527|      0|				detail = "out of memory";
 1528|      0|				break;
 1529|      0|			case BZ_CONFIG_ERROR:
  ------------------
  |  Branch (1529:4): [True: 0, False: 0]
  ------------------
 1530|      0|				detail = "mis-compiled library";
 1531|      0|				break;
 1532|      0|			}
 1533|      0|			archive_set_error(&a->archive, err,
 1534|      0|			    "Internal error initializing decompressor: %s",
 1535|      0|			    detail == NULL ? "??" : detail);
  ------------------
  |  Branch (1535:8): [True: 0, False: 0]
  ------------------
 1536|      0|			xar->bzstream_valid = 0;
 1537|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1538|      0|		}
 1539|      0|		xar->bzstream_valid = 1;
 1540|      0|		xar->bzstream.total_in_lo32 = 0;
 1541|      0|		xar->bzstream.total_in_hi32 = 0;
 1542|      0|		xar->bzstream.total_out_lo32 = 0;
 1543|      0|		xar->bzstream.total_out_hi32 = 0;
 1544|      0|		break;
 1545|      0|#endif
 1546|      0|#if defined(HAVE_LZMA_H) && defined(HAVE_LIBLZMA)
 1547|      0|#if LZMA_VERSION_MAJOR >= 5
 1548|       |/* Effectively disable the limiter. */
 1549|      0|#define LZMA_MEMLIMIT   UINT64_MAX
 1550|       |#else
 1551|       |/* NOTE: This needs to check memory size which running system has. */
 1552|       |#define LZMA_MEMLIMIT   (1U << 30)
 1553|       |#endif
 1554|      0|	case XZ:
  ------------------
  |  Branch (1554:2): [True: 0, False: 1.07k]
  ------------------
 1555|      0|	case LZMA:
  ------------------
  |  Branch (1555:2): [True: 0, False: 1.07k]
  ------------------
 1556|      0|		if (xar->lzstream_valid) {
  ------------------
  |  Branch (1556:7): [True: 0, False: 0]
  ------------------
 1557|      0|			lzma_end(&(xar->lzstream));
 1558|      0|			xar->lzstream_valid = 0;
 1559|      0|		}
 1560|      0|		if (xar->entry_encoding == XZ)
  ------------------
  |  Branch (1560:7): [True: 0, False: 0]
  ------------------
 1561|      0|			r = lzma_stream_decoder(&(xar->lzstream),
 1562|      0|			    LZMA_MEMLIMIT,/* memlimit */
  ------------------
  |  | 1549|      0|#define LZMA_MEMLIMIT   UINT64_MAX
  ------------------
 1563|      0|			    LZMA_CONCATENATED);
 1564|      0|		else
 1565|      0|			r = lzma_alone_decoder(&(xar->lzstream),
 1566|      0|			    LZMA_MEMLIMIT);/* memlimit */
  ------------------
  |  | 1549|      0|#define LZMA_MEMLIMIT   UINT64_MAX
  ------------------
 1567|      0|		if (r != LZMA_OK) {
  ------------------
  |  Branch (1567:7): [True: 0, False: 0]
  ------------------
 1568|      0|			switch (r) {
 1569|      0|			case LZMA_MEM_ERROR:
  ------------------
  |  Branch (1569:4): [True: 0, False: 0]
  ------------------
 1570|      0|				archive_set_error(&a->archive,
 1571|      0|				    ENOMEM,
 1572|      0|				    "Internal error initializing "
 1573|      0|				    "compression library: "
 1574|      0|				    "Cannot allocate memory");
 1575|      0|				break;
 1576|      0|			case LZMA_OPTIONS_ERROR:
  ------------------
  |  Branch (1576:4): [True: 0, False: 0]
  ------------------
 1577|      0|				archive_set_error(&a->archive,
 1578|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1579|      0|				    "Internal error initializing "
 1580|      0|				    "compression library: "
 1581|      0|				    "Invalid or unsupported options");
 1582|      0|				break;
 1583|      0|			default:
  ------------------
  |  Branch (1583:4): [True: 0, False: 0]
  ------------------
 1584|      0|				archive_set_error(&a->archive,
 1585|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1586|      0|				    "Internal error initializing "
 1587|      0|				    "lzma library");
 1588|      0|				break;
 1589|      0|			}
 1590|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1591|      0|		}
 1592|      0|		xar->lzstream_valid = 1;
 1593|      0|		xar->lzstream.total_in = 0;
 1594|      0|		xar->lzstream.total_out = 0;
 1595|      0|		break;
 1596|      0|#endif
 1597|       |	/*
 1598|       |	 * Unsupported compression.
 1599|       |	 */
 1600|      0|	default:
  ------------------
  |  Branch (1600:2): [True: 0, False: 1.07k]
  ------------------
 1601|       |#if !defined(HAVE_BZLIB_H) || !defined(BZ_CONFIG_ERROR)
 1602|       |	case BZIP2:
 1603|       |#endif
 1604|       |#if !defined(HAVE_LZMA_H) || !defined(HAVE_LIBLZMA)
 1605|       |	case LZMA:
 1606|       |	case XZ:
 1607|       |#endif
 1608|      0|		switch (xar->entry_encoding) {
 1609|      0|		case BZIP2: detail = "bzip2"; break;
  ------------------
  |  Branch (1609:3): [True: 0, False: 0]
  ------------------
 1610|      0|		case LZMA: detail = "lzma"; break;
  ------------------
  |  Branch (1610:3): [True: 0, False: 0]
  ------------------
 1611|      0|		case XZ: detail = "xz"; break;
  ------------------
  |  Branch (1611:3): [True: 0, False: 0]
  ------------------
 1612|      0|		default: detail = "??"; break;
  ------------------
  |  Branch (1612:3): [True: 0, False: 0]
  ------------------
 1613|      0|		}
 1614|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1615|      0|		    "%s compression not supported on this platform",
 1616|      0|		    detail);
 1617|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1618|  1.07k|	}
 1619|  1.07k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.07k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1620|  1.07k|}
archive_read_support_format_xar.c:checksum_init:
 1447|  1.07k|{
 1448|  1.07k|	struct xar *xar = a->format->data;
 1449|       |
 1450|  1.07k|	if (_checksum_init(&(xar->a_sumwrk), a_sum_alg) != ARCHIVE_OK ||
  ------------------
  |  |  233|  2.15k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1450:6): [True: 0, False: 1.07k]
  ------------------
 1451|  1.07k|	    _checksum_init(&(xar->e_sumwrk), e_sum_alg) != ARCHIVE_OK) {
  ------------------
  |  |  233|  1.07k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1451:6): [True: 0, False: 1.07k]
  ------------------
 1452|      0|		archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1453|      0|		    "Unsupported checksum");
 1454|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1455|      0|	}
 1456|  1.07k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.07k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1457|  1.07k|}
archive_read_support_format_xar.c:_checksum_init:
 1349|  2.15k|{
 1350|  2.15k|	sumwrk->alg = sum_alg;
 1351|  2.15k|	switch (sum_alg) {
 1352|  1.16k|	case CKSUM_NONE:
  ------------------
  |  |  111|  1.16k|#define CKSUM_NONE	0
  ------------------
  |  Branch (1352:2): [True: 1.16k, False: 985]
  ------------------
 1353|  1.16k|		break;
 1354|    957|	case CKSUM_SHA1:
  ------------------
  |  |  112|    957|#define CKSUM_SHA1	1
  ------------------
  |  Branch (1354:2): [True: 957, False: 1.19k]
  ------------------
 1355|    957|		archive_sha1_init(&(sumwrk->sha1ctx));
  ------------------
  |  |  346|    957|  __archive_digest.sha1init(ctx)
  ------------------
 1356|    957|		break;
 1357|     19|	case CKSUM_MD5:
  ------------------
  |  |  113|     19|#define CKSUM_MD5	2
  ------------------
  |  Branch (1357:2): [True: 19, False: 2.13k]
  ------------------
 1358|     19|		archive_md5_init(&(sumwrk->md5ctx));
  ------------------
  |  |  317|     19|  __archive_digest.md5init(ctx)
  ------------------
 1359|     19|		break;
 1360|      0|#ifdef ARCHIVE_HAS_SHA256
 1361|      3|	case CKSUM_SHA256:
  ------------------
  |  |  114|      3|#define CKSUM_SHA256	3
  ------------------
  |  Branch (1361:2): [True: 3, False: 2.14k]
  ------------------
 1362|      3|		archive_sha256_init(&(sumwrk->sha256ctx));
  ------------------
  |  |  364|      3|  __archive_digest.sha256init(ctx)
  ------------------
 1363|      3|		break;
 1364|      0|#endif
 1365|      0|#ifdef ARCHIVE_HAS_SHA512
 1366|      6|	case CKSUM_SHA512:
  ------------------
  |  |  115|      6|#define CKSUM_SHA512	4
  ------------------
  |  Branch (1366:2): [True: 6, False: 2.14k]
  ------------------
 1367|      6|		archive_sha512_init(&(sumwrk->sha512ctx));
  ------------------
  |  |  399|      6|  __archive_digest.sha512init(ctx)
  ------------------
 1368|      6|		break;
 1369|      0|#endif
 1370|      0|	default:
  ------------------
  |  Branch (1370:2): [True: 0, False: 2.15k]
  ------------------
 1371|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1372|  2.15k|	}
 1373|  2.15k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.15k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1374|  2.15k|}
archive_read_support_format_xar.c:rd_contents:
 1047|  4.76k|{
 1048|  4.76k|	const unsigned char *b;
 1049|  4.76k|	ssize_t bytes;
 1050|       |
 1051|       |	/* Get whatever bytes are immediately available. */
 1052|  4.76k|	b = __archive_read_ahead(a, 1, &bytes);
 1053|  4.76k|	if (bytes < 0)
  ------------------
  |  Branch (1053:6): [True: 0, False: 4.76k]
  ------------------
 1054|      0|		return ((int)bytes);
 1055|  4.76k|	if (bytes == 0) {
  ------------------
  |  Branch (1055:6): [True: 828, False: 3.94k]
  ------------------
 1056|    828|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    828|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1057|    828|		    "Truncated archive file");
 1058|    828|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    828|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1059|    828|	}
 1060|  3.94k|	if ((uint64_t)bytes > remaining)
  ------------------
  |  Branch (1060:6): [True: 40, False: 3.90k]
  ------------------
 1061|     40|		bytes = (ssize_t)remaining;
 1062|       |
 1063|       |	/*
 1064|       |	 * Decompress contents of file.
 1065|       |	 */
 1066|  3.94k|	*used = bytes;
 1067|  3.94k|	if (decompress(a, buff, size, b, used) != ARCHIVE_OK)
  ------------------
  |  |  233|  3.94k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1067:6): [True: 19, False: 3.92k]
  ------------------
 1068|     19|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     19|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1069|       |
 1070|       |	/*
 1071|       |	 * Update checksum of a compressed data and a extracted data.
 1072|       |	 */
 1073|  3.92k|	checksum_update(a, b, *used, *buff, *size);
 1074|       |
 1075|  3.92k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.92k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1076|  3.94k|}
archive_read_support_format_xar.c:decompress:
 1625|  3.94k|{
 1626|  3.94k|	struct xar *xar = a->format->data;
 1627|  3.94k|	void *outbuff;
 1628|  3.94k|	size_t avail_in, avail_out;
 1629|  3.94k|	int r;
 1630|       |
 1631|  3.94k|	avail_in = *used;
 1632|  3.94k|	outbuff = (void *)(uintptr_t)*buff;
 1633|  3.94k|	if (outbuff == NULL) {
  ------------------
  |  Branch (1633:6): [True: 0, False: 3.94k]
  ------------------
 1634|      0|		if (xar->outbuff == NULL) {
  ------------------
  |  Branch (1634:7): [True: 0, False: 0]
  ------------------
 1635|      0|			xar->outbuff = malloc(OUTBUFF_SIZE);
  ------------------
  |  |  327|      0|#define OUTBUFF_SIZE	(1024 * 64)
  ------------------
 1636|      0|			if (xar->outbuff == NULL) {
  ------------------
  |  Branch (1636:8): [True: 0, False: 0]
  ------------------
 1637|      0|				archive_set_error(&a->archive, ENOMEM,
 1638|      0|				    "Couldn't allocate memory for out buffer");
 1639|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1640|      0|			}
 1641|      0|		}
 1642|      0|		outbuff = xar->outbuff;
 1643|      0|		*buff = outbuff;
 1644|      0|		avail_out = OUTBUFF_SIZE;
  ------------------
  |  |  327|      0|#define OUTBUFF_SIZE	(1024 * 64)
  ------------------
 1645|      0|	} else
 1646|  3.94k|		avail_out = *outbytes;
 1647|  3.94k|	switch (xar->rd_encoding) {
 1648|  3.94k|	case GZIP:
  ------------------
  |  Branch (1648:2): [True: 3.94k, False: 0]
  ------------------
 1649|       |		/* avail_in and avail_out are 32 bits wide in zlib. */
 1650|  3.94k|		if (avail_in > UINT_MAX)
  ------------------
  |  Branch (1650:7): [True: 0, False: 3.94k]
  ------------------
 1651|      0|			avail_in = UINT_MAX;
 1652|  3.94k|		if (avail_out > UINT_MAX)
  ------------------
  |  Branch (1652:7): [True: 0, False: 3.94k]
  ------------------
 1653|      0|			avail_out = UINT_MAX;
 1654|  3.94k|		xar->stream.next_in = (Bytef *)(uintptr_t)b;
 1655|  3.94k|		xar->stream.avail_in = (uInt)avail_in;
 1656|  3.94k|		xar->stream.next_out = (unsigned char *)outbuff;
 1657|  3.94k|		xar->stream.avail_out = (uInt)avail_out;
 1658|  3.94k|		r = inflate(&(xar->stream), 0);
 1659|  3.94k|		switch (r) {
 1660|  3.92k|		case Z_OK: /* Decompressor made some progress.*/
  ------------------
  |  Branch (1660:3): [True: 3.92k, False: 19]
  ------------------
 1661|  3.92k|		case Z_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1661:3): [True: 0, False: 3.94k]
  ------------------
 1662|  3.92k|			break;
 1663|     19|		default:
  ------------------
  |  Branch (1663:3): [True: 19, False: 3.92k]
  ------------------
 1664|     19|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     19|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1665|     19|			    "File decompression failed (%d)", r);
 1666|     19|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     19|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1667|  3.94k|		}
 1668|  3.92k|		*used = avail_in - xar->stream.avail_in;
 1669|  3.92k|		*outbytes = avail_out - xar->stream.avail_out;
 1670|  3.92k|		break;
 1671|      0|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 1672|      0|	case BZIP2:
  ------------------
  |  Branch (1672:2): [True: 0, False: 3.94k]
  ------------------
 1673|       |		/* avail_in and avail_out are 32 bits wide in bzlib. */
 1674|      0|		if (avail_in > UINT_MAX)
  ------------------
  |  Branch (1674:7): [True: 0, False: 0]
  ------------------
 1675|      0|			avail_in = UINT_MAX;
 1676|      0|		if (avail_out > UINT_MAX)
  ------------------
  |  Branch (1676:7): [True: 0, False: 0]
  ------------------
 1677|      0|			avail_out = UINT_MAX;
 1678|      0|		xar->bzstream.next_in = (char *)(uintptr_t)b;
 1679|      0|		xar->bzstream.avail_in = (unsigned int)avail_in;
 1680|      0|		xar->bzstream.next_out = (char *)outbuff;
 1681|      0|		xar->bzstream.avail_out = (unsigned int)avail_out;
 1682|      0|		r = BZ2_bzDecompress(&(xar->bzstream));
 1683|      0|		switch (r) {
 1684|      0|		case BZ_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1684:3): [True: 0, False: 0]
  ------------------
 1685|      0|			switch (BZ2_bzDecompressEnd(&(xar->bzstream))) {
 1686|      0|			case BZ_OK:
  ------------------
  |  Branch (1686:4): [True: 0, False: 0]
  ------------------
 1687|      0|				break;
 1688|      0|			default:
  ------------------
  |  Branch (1688:4): [True: 0, False: 0]
  ------------------
 1689|      0|				archive_set_error(&(a->archive),
 1690|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1691|      0|				    "Failed to clean up decompressor");
 1692|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1693|      0|			}
 1694|      0|			xar->bzstream_valid = 0;
 1695|       |			/* FALLTHROUGH */
 1696|      0|		case BZ_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (1696:3): [True: 0, False: 0]
  ------------------
 1697|      0|			break;
 1698|      0|		default:
  ------------------
  |  Branch (1698:3): [True: 0, False: 0]
  ------------------
 1699|      0|			archive_set_error(&(a->archive),
 1700|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1701|      0|			    "bzip decompression failed");
 1702|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1703|      0|		}
 1704|      0|		*used = avail_in - xar->bzstream.avail_in;
 1705|      0|		*outbytes = avail_out - xar->bzstream.avail_out;
 1706|      0|		break;
 1707|      0|#endif
 1708|      0|#if defined(HAVE_LZMA_H) && defined(HAVE_LIBLZMA)
 1709|      0|	case LZMA:
  ------------------
  |  Branch (1709:2): [True: 0, False: 3.94k]
  ------------------
 1710|      0|	case XZ:
  ------------------
  |  Branch (1710:2): [True: 0, False: 3.94k]
  ------------------
 1711|      0|		xar->lzstream.next_in = b;
 1712|      0|		xar->lzstream.avail_in = avail_in;
 1713|      0|		xar->lzstream.next_out = (unsigned char *)outbuff;
 1714|      0|		xar->lzstream.avail_out = avail_out;
 1715|      0|		r = lzma_code(&(xar->lzstream), LZMA_RUN);
 1716|      0|		switch (r) {
 1717|      0|		case LZMA_STREAM_END: /* Found end of stream. */
  ------------------
  |  Branch (1717:3): [True: 0, False: 0]
  ------------------
 1718|      0|			lzma_end(&(xar->lzstream));
 1719|      0|			xar->lzstream_valid = 0;
 1720|       |			/* FALLTHROUGH */
 1721|      0|		case LZMA_OK: /* Decompressor made some progress. */
  ------------------
  |  Branch (1721:3): [True: 0, False: 0]
  ------------------
 1722|      0|			break;
 1723|      0|		default:
  ------------------
  |  Branch (1723:3): [True: 0, False: 0]
  ------------------
 1724|      0|			archive_set_error(&(a->archive),
 1725|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1726|      0|			    "%s decompression failed (%d)",
 1727|      0|			    (xar->entry_encoding == XZ)?"xz":"lzma",
  ------------------
  |  Branch (1727:8): [True: 0, False: 0]
  ------------------
 1728|      0|			    r);
 1729|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1730|      0|		}
 1731|      0|		*used = avail_in - xar->lzstream.avail_in;
 1732|      0|		*outbytes = avail_out - xar->lzstream.avail_out;
 1733|      0|		break;
 1734|      0|#endif
 1735|       |#if !defined(HAVE_BZLIB_H) || !defined(BZ_CONFIG_ERROR)
 1736|       |	case BZIP2:
 1737|       |#endif
 1738|       |#if !defined(HAVE_LZMA_H) || !defined(HAVE_LIBLZMA)
 1739|       |	case LZMA:
 1740|       |	case XZ:
 1741|       |#endif
 1742|      0|	case NONE:
  ------------------
  |  Branch (1742:2): [True: 0, False: 3.94k]
  ------------------
 1743|      0|	default:
  ------------------
  |  Branch (1743:2): [True: 0, False: 3.94k]
  ------------------
 1744|      0|		if (outbuff == xar->outbuff) {
  ------------------
  |  Branch (1744:7): [True: 0, False: 0]
  ------------------
 1745|      0|			*buff = b;
 1746|      0|			*used = avail_in;
 1747|      0|			*outbytes = avail_in;
 1748|      0|		} else {
 1749|      0|			if (avail_out > avail_in)
  ------------------
  |  Branch (1749:8): [True: 0, False: 0]
  ------------------
 1750|      0|				avail_out = avail_in;
 1751|      0|			memcpy(outbuff, b, avail_out);
 1752|      0|			*used = avail_out;
 1753|      0|			*outbytes = avail_out;
 1754|      0|		}
 1755|      0|		break;
 1756|  3.94k|	}
 1757|  3.92k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.92k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1758|  3.94k|}
archive_read_support_format_xar.c:checksum_update:
 1462|  3.92k|{
 1463|  3.92k|	struct xar *xar = a->format->data;
 1464|       |
 1465|  3.92k|	_checksum_update(&(xar->a_sumwrk), abuff, asize);
 1466|  3.92k|	_checksum_update(&(xar->e_sumwrk), ebuff, esize);
 1467|  3.92k|}
archive_read_support_format_xar.c:_checksum_update:
 1378|  7.84k|{
 1379|       |
 1380|  7.84k|	switch (sumwrk->alg) {
  ------------------
  |  Branch (1380:10): [True: 7.84k, False: 0]
  ------------------
 1381|  4.34k|	case CKSUM_NONE:
  ------------------
  |  |  111|  4.34k|#define CKSUM_NONE	0
  ------------------
  |  Branch (1381:2): [True: 4.34k, False: 3.50k]
  ------------------
 1382|  4.34k|		break;
 1383|  3.19k|	case CKSUM_SHA1:
  ------------------
  |  |  112|  3.19k|#define CKSUM_SHA1	1
  ------------------
  |  Branch (1383:2): [True: 3.19k, False: 4.65k]
  ------------------
 1384|  3.19k|		archive_sha1_update(&(sumwrk->sha1ctx), buff, size);
  ------------------
  |  |  350|  3.19k|  __archive_digest.sha1update(ctx, buf, n)
  ------------------
 1385|  3.19k|		break;
 1386|    259|	case CKSUM_MD5:
  ------------------
  |  |  113|    259|#define CKSUM_MD5	2
  ------------------
  |  Branch (1386:2): [True: 259, False: 7.58k]
  ------------------
 1387|    259|		archive_md5_update(&(sumwrk->md5ctx), buff, size);
  ------------------
  |  |  321|    259|  __archive_digest.md5update(ctx, buf, n)
  ------------------
 1388|    259|		break;
 1389|      0|#ifdef ARCHIVE_HAS_SHA256
 1390|      6|	case CKSUM_SHA256:
  ------------------
  |  |  114|      6|#define CKSUM_SHA256	3
  ------------------
  |  Branch (1390:2): [True: 6, False: 7.83k]
  ------------------
 1391|      6|		archive_sha256_update(&(sumwrk->sha256ctx), buff, size);
  ------------------
  |  |  368|      6|  __archive_digest.sha256update(ctx, buf, n)
  ------------------
 1392|      6|		break;
 1393|      0|#endif
 1394|      0|#ifdef ARCHIVE_HAS_SHA512
 1395|     45|	case CKSUM_SHA512:
  ------------------
  |  |  115|     45|#define CKSUM_SHA512	4
  ------------------
  |  Branch (1395:2): [True: 45, False: 7.79k]
  ------------------
 1396|     45|		archive_sha512_update(&(sumwrk->sha512ctx), buff, size);
  ------------------
  |  |  403|     45|  __archive_digest.sha512update(ctx, buf, n)
  ------------------
 1397|     45|		break;
 1398|  7.84k|#endif
 1399|  7.84k|	}
 1400|  7.84k|}
archive_read_support_format_xar.c:_checksum_final:
 1404|  33.4k|{
 1405|  33.4k|	unsigned char sum[MAX_SUM_SIZE];
 1406|  33.4k|	int r = ARCHIVE_OK;
  ------------------
  |  |  233|  33.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1407|       |
 1408|  33.4k|	switch (sumwrk->alg) {
 1409|  32.4k|	case CKSUM_NONE:
  ------------------
  |  |  111|  32.4k|#define CKSUM_NONE	0
  ------------------
  |  Branch (1409:2): [True: 32.4k, False: 985]
  ------------------
 1410|  32.4k|		break;
 1411|    957|	case CKSUM_SHA1:
  ------------------
  |  |  112|    957|#define CKSUM_SHA1	1
  ------------------
  |  Branch (1411:2): [True: 957, False: 32.4k]
  ------------------
 1412|    957|		archive_sha1_final(&(sumwrk->sha1ctx), sum);
  ------------------
  |  |  348|    957|  __archive_digest.sha1final(ctx, md)
  ------------------
 1413|    957|		if (len != SHA1_SIZE ||
  ------------------
  |  |  118|  1.91k|#define SHA1_SIZE	20
  ------------------
  |  Branch (1413:7): [True: 957, False: 0]
  ------------------
 1414|      0|		    memcmp(val, sum, SHA1_SIZE) != 0)
  ------------------
  |  |  118|      0|#define SHA1_SIZE	20
  ------------------
  |  Branch (1414:7): [True: 0, False: 0]
  ------------------
 1415|    957|			r = ARCHIVE_FAILED;
  ------------------
  |  |  237|    957|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1416|    957|		break;
 1417|     19|	case CKSUM_MD5:
  ------------------
  |  |  113|     19|#define CKSUM_MD5	2
  ------------------
  |  Branch (1417:2): [True: 19, False: 33.4k]
  ------------------
 1418|     19|		archive_md5_final(&(sumwrk->md5ctx), sum);
  ------------------
  |  |  319|     19|  __archive_digest.md5final(ctx, md)
  ------------------
 1419|     19|		if (len != MD5_SIZE ||
  ------------------
  |  |  117|     38|#define MD5_SIZE	16
  ------------------
  |  Branch (1419:7): [True: 19, False: 0]
  ------------------
 1420|      0|		    memcmp(val, sum, MD5_SIZE) != 0)
  ------------------
  |  |  117|      0|#define MD5_SIZE	16
  ------------------
  |  Branch (1420:7): [True: 0, False: 0]
  ------------------
 1421|     19|			r = ARCHIVE_FAILED;
  ------------------
  |  |  237|     19|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1422|     19|		break;
 1423|      0|#ifdef ARCHIVE_HAS_SHA256
 1424|      3|	case CKSUM_SHA256:
  ------------------
  |  |  114|      3|#define CKSUM_SHA256	3
  ------------------
  |  Branch (1424:2): [True: 3, False: 33.4k]
  ------------------
 1425|      3|		archive_sha256_final(&(sumwrk->sha256ctx), sum);
  ------------------
  |  |  366|      3|  __archive_digest.sha256final(ctx, md)
  ------------------
 1426|      3|		if (len != SHA256_SIZE ||
  ------------------
  |  |  119|      6|#define SHA256_SIZE	32
  ------------------
  |  Branch (1426:7): [True: 3, False: 0]
  ------------------
 1427|      0|		    memcmp(val, sum, SHA256_SIZE) != 0)
  ------------------
  |  |  119|      0|#define SHA256_SIZE	32
  ------------------
  |  Branch (1427:7): [True: 0, False: 0]
  ------------------
 1428|      3|			r = ARCHIVE_FAILED;
  ------------------
  |  |  237|      3|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1429|      3|		break;
 1430|      0|#endif
 1431|      0|#ifdef ARCHIVE_HAS_SHA512
 1432|      6|	case CKSUM_SHA512:
  ------------------
  |  |  115|      6|#define CKSUM_SHA512	4
  ------------------
  |  Branch (1432:2): [True: 6, False: 33.4k]
  ------------------
 1433|      6|		archive_sha512_final(&(sumwrk->sha512ctx), sum);
  ------------------
  |  |  401|      6|  __archive_digest.sha512final(ctx, md)
  ------------------
 1434|      6|		if (len != SHA512_SIZE ||
  ------------------
  |  |  120|     12|#define SHA512_SIZE	64
  ------------------
  |  Branch (1434:7): [True: 6, False: 0]
  ------------------
 1435|      0|		    memcmp(val, sum, SHA512_SIZE) != 0)
  ------------------
  |  |  120|      0|#define SHA512_SIZE	64
  ------------------
  |  Branch (1435:7): [True: 0, False: 0]
  ------------------
 1436|      6|			r = ARCHIVE_FAILED;
  ------------------
  |  |  237|      6|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1437|      6|		break;
 1438|      0|#endif
 1439|      0|	default:
  ------------------
  |  Branch (1439:2): [True: 0, False: 33.4k]
  ------------------
 1440|      0|		r = ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1441|  33.4k|	}
 1442|  33.4k|	return (r);
 1443|  33.4k|}
archive_read_support_format_xar.c:xar_cleanup:
  970|  16.7k|{
  971|  16.7k|	struct xar *xar = a->format->data;
  972|  16.7k|	struct hdlink *hdlink;
  973|  16.7k|	size_t i;
  974|  16.7k|	int r;
  975|       |
  976|  16.7k|	checksum_cleanup(a);
  977|  16.7k|	r = decompression_cleanup(a);
  978|  16.7k|	hdlink = xar->hdlink_list;
  979|  16.7k|	while (hdlink != NULL) {
  ------------------
  |  Branch (979:9): [True: 0, False: 16.7k]
  ------------------
  980|      0|		struct hdlink *next = hdlink->next;
  981|       |
  982|      0|		free(hdlink);
  983|      0|		hdlink = next;
  984|      0|	}
  985|  37.7k|	for (i = 0; i < xar->file_queue.used; i++)
  ------------------
  |  Branch (985:14): [True: 21.0k, False: 16.7k]
  ------------------
  986|  21.0k|		file_free(xar->file_queue.files[i]);
  987|  16.7k|	free(xar->file_queue.files);
  988|  19.5k|	while (xar->unknowntags != NULL) {
  ------------------
  |  Branch (988:9): [True: 2.83k, False: 16.7k]
  ------------------
  989|  2.83k|		struct unknown_tag *tag;
  990|       |
  991|  2.83k|		tag = xar->unknowntags;
  992|  2.83k|		xar->unknowntags = tag->next;
  993|  2.83k|		archive_string_free(&(tag->name));
  994|  2.83k|		free(tag);
  995|  2.83k|	}
  996|  16.7k|	free(xar->outbuff);
  997|  16.7k|	free(xar);
  998|       |	a->format->data = NULL;
  999|  16.7k|	return (r);
 1000|  16.7k|}
archive_read_support_format_xar.c:checksum_cleanup:
 1793|  16.7k|checksum_cleanup(struct archive_read *a) {
 1794|  16.7k|	struct xar *xar = a->format->data;
 1795|       |
 1796|  16.7k|	_checksum_final(&(xar->a_sumwrk), NULL, 0);
 1797|       |	_checksum_final(&(xar->e_sumwrk), NULL, 0);
 1798|  16.7k|}
archive_read_support_format_xar.c:decompression_cleanup:
 1762|  16.7k|{
 1763|  16.7k|	struct xar *xar = a->format->data;
 1764|  16.7k|	int r;
 1765|       |
 1766|  16.7k|	r = ARCHIVE_OK;
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1767|  16.7k|	if (xar->stream_valid) {
  ------------------
  |  Branch (1767:6): [True: 1.07k, False: 15.6k]
  ------------------
 1768|  1.07k|		if (inflateEnd(&(xar->stream)) != Z_OK) {
  ------------------
  |  Branch (1768:7): [True: 0, False: 1.07k]
  ------------------
 1769|      0|			archive_set_error(&a->archive,
 1770|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1771|      0|			    "Failed to clean up zlib decompressor");
 1772|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1773|      0|		}
 1774|  1.07k|	}
 1775|  16.7k|#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
 1776|  16.7k|	if (xar->bzstream_valid) {
  ------------------
  |  Branch (1776:6): [True: 0, False: 16.7k]
  ------------------
 1777|      0|		if (BZ2_bzDecompressEnd(&(xar->bzstream)) != BZ_OK) {
  ------------------
  |  Branch (1777:7): [True: 0, False: 0]
  ------------------
 1778|      0|			archive_set_error(&a->archive,
 1779|      0|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1780|      0|			    "Failed to clean up bzip2 decompressor");
 1781|      0|			r = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1782|      0|		}
 1783|      0|	}
 1784|  16.7k|#endif
 1785|  16.7k|#if defined(HAVE_LZMA_H) && defined(HAVE_LIBLZMA)
 1786|  16.7k|	if (xar->lzstream_valid)
  ------------------
  |  Branch (1786:6): [True: 0, False: 16.7k]
  ------------------
 1787|      0|		lzma_end(&(xar->lzstream));
 1788|  16.7k|#endif
 1789|  16.7k|	return (r);
 1790|  16.7k|}

archive_read_support_format_zip:
 3648|  16.7k|{
 3649|  16.7k|	int r;
 3650|  16.7k|	r = archive_read_support_format_zip_streamable(a);
 3651|  16.7k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3651:6): [True: 0, False: 16.7k]
  ------------------
 3652|      0|		return r;
 3653|  16.7k|	return (archive_read_support_format_zip_seekable(a));
 3654|  16.7k|}
archive_read_support_format_zip_streamable:
 3892|  16.7k|{
 3893|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
 3894|  16.7k|	struct zip *zip;
 3895|  16.7k|	int r;
 3896|       |
 3897|  16.7k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
 3898|  16.7k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_zip");
 3899|       |
 3900|  16.7k|	zip = calloc(1, sizeof(*zip));
 3901|  16.7k|	if (zip == NULL) {
  ------------------
  |  Branch (3901:6): [True: 0, False: 16.7k]
  ------------------
 3902|      0|		archive_set_error(_a, ENOMEM, "Can't allocate zip data");
 3903|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3904|      0|	}
 3905|       |
 3906|       |	/* Streamable reader doesn't support mac extensions. */
 3907|  16.7k|	zip->process_mac_extensions = 0;
 3908|       |
 3909|       |	/*
 3910|       |	 * Until enough data has been read, we cannot tell about
 3911|       |	 * any encrypted entries yet.
 3912|       |	 */
 3913|  16.7k|	zip->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|  16.7k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 3914|  16.7k|	zip->crc32func = real_crc32;
 3915|       |
 3916|  16.7k|	r = __archive_read_register_format(a,
 3917|  16.7k|	    zip,
 3918|  16.7k|	    "zip",
 3919|  16.7k|	    archive_read_format_zip_streamable_bid,
 3920|  16.7k|	    archive_read_format_zip_options,
 3921|  16.7k|	    archive_read_format_zip_streamable_read_header,
 3922|  16.7k|	    archive_read_format_zip_read_data,
 3923|  16.7k|	    archive_read_format_zip_read_data_skip_streamable,
 3924|  16.7k|	    NULL,
 3925|  16.7k|	    archive_read_format_zip_cleanup,
 3926|  16.7k|	    archive_read_support_format_zip_capabilities_streamable,
 3927|  16.7k|	    archive_read_format_zip_has_encrypted_entries);
 3928|       |
 3929|  16.7k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3929:6): [True: 0, False: 16.7k]
  ------------------
 3930|      0|		free(zip);
 3931|  16.7k|	return (r);
 3932|  16.7k|}
archive_read_support_format_zip_seekable:
 4682|  16.7k|{
 4683|  16.7k|	struct archive_read *a = (struct archive_read *)_a;
 4684|  16.7k|	struct zip *zip;
 4685|  16.7k|	int r;
 4686|       |
 4687|  16.7k|	archive_check_magic(_a, ARCHIVE_READ_MAGIC,
  ------------------
  |  |  179|  16.7k|	do { \
  |  |  180|  16.7k|		int magic_test = __archive_check_magic((a), (expected_magic), \
  |  |  181|  16.7k|			(allowed_states), (function_name)); \
  |  |  182|  16.7k|		if (magic_test == ARCHIVE_FATAL) \
  |  |  ------------------
  |  |  |  |  239|  16.7k|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  |  Branch (182:7): [True: 0, False: 16.7k]
  |  |  ------------------
  |  |  183|  16.7k|			return ARCHIVE_FATAL; \
  |  |  ------------------
  |  |  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  |  |  ------------------
  |  |  184|  16.7k|	} while (0)
  |  |  ------------------
  |  |  |  Branch (184:11): [Folded, False: 16.7k]
  |  |  ------------------
  ------------------
 4688|  16.7k|	    ARCHIVE_STATE_NEW, "archive_read_support_format_zip_seekable");
 4689|       |
 4690|  16.7k|	zip = calloc(1, sizeof(*zip));
 4691|  16.7k|	if (zip == NULL) {
  ------------------
  |  Branch (4691:6): [True: 0, False: 16.7k]
  ------------------
 4692|      0|		archive_set_error(&a->archive, ENOMEM,
 4693|      0|		    "Can't allocate zip data");
 4694|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4695|      0|	}
 4696|       |
 4697|       |#ifdef HAVE_COPYFILE_H
 4698|       |	/* Set this by default on Mac OS. */
 4699|       |	zip->process_mac_extensions = 1;
 4700|       |#endif
 4701|       |
 4702|       |	/*
 4703|       |	 * Until enough data has been read, we cannot tell about
 4704|       |	 * any encrypted entries yet.
 4705|       |	 */
 4706|  16.7k|	zip->has_encrypted_entries = ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|  16.7k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4707|  16.7k|	zip->crc32func = real_crc32;
 4708|       |
 4709|  16.7k|	r = __archive_read_register_format(a,
 4710|  16.7k|	    zip,
 4711|  16.7k|	    "zip",
 4712|  16.7k|	    archive_read_format_zip_seekable_bid,
 4713|  16.7k|	    archive_read_format_zip_options,
 4714|  16.7k|	    archive_read_format_zip_seekable_read_header,
 4715|  16.7k|	    archive_read_format_zip_read_data,
 4716|  16.7k|	    archive_read_format_zip_read_data_skip_seekable,
 4717|  16.7k|	    NULL,
 4718|  16.7k|	    archive_read_format_zip_cleanup,
 4719|  16.7k|	    archive_read_support_format_zip_capabilities_seekable,
 4720|  16.7k|	    archive_read_format_zip_has_encrypted_entries);
 4721|       |
 4722|  16.7k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  16.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4722:6): [True: 0, False: 16.7k]
  ------------------
 4723|      0|		free(zip);
 4724|  16.7k|	return (r);
 4725|  16.7k|}
archive_read_support_format_zip.c:archive_read_format_zip_streamable_bid:
 3673|  16.4k|{
 3674|  16.4k|	const char *h;
 3675|       |
 3676|  16.4k|	(void)best_bid; /* UNUSED */
 3677|       |
 3678|  16.4k|	if ((h = __archive_read_ahead(a, 4, NULL)) == NULL)
  ------------------
  |  Branch (3678:6): [True: 200, False: 16.2k]
  ------------------
 3679|    200|		return (-1);
 3680|       |
 3681|       |	/*
 3682|       |	 * Bid of 29 here comes from:
 3683|       |	 *  + 16 bits for "PK",
 3684|       |	 *  + next 16-bit field has 6 options so contributes
 3685|       |	 *    about 16 - log_2(6) ~= 16 - 2.6 ~= 13 bits
 3686|       |	 *
 3687|       |	 * So we've effectively verified ~29 total bits of check data.
 3688|       |	 */
 3689|  16.2k|	if (h[0] == 'P' && h[1] == 'K') {
  ------------------
  |  Branch (3689:6): [True: 2.73k, False: 13.4k]
  |  Branch (3689:21): [True: 2.64k, False: 95]
  ------------------
 3690|  2.64k|		if ((h[2] == '\001' && h[3] == '\002')
  ------------------
  |  Branch (3690:8): [True: 17, False: 2.62k]
  |  Branch (3690:26): [True: 17, False: 0]
  ------------------
 3691|  2.62k|		    || (h[2] == '\003' && h[3] == '\004')
  ------------------
  |  Branch (3691:11): [True: 2.48k, False: 138]
  |  Branch (3691:29): [True: 2.47k, False: 9]
  ------------------
 3692|    147|		    || (h[2] == '\005' && h[3] == '\006')
  ------------------
  |  Branch (3692:11): [True: 0, False: 147]
  |  Branch (3692:29): [True: 0, False: 0]
  ------------------
 3693|    147|		    || (h[2] == '\006' && h[3] == '\006')
  ------------------
  |  Branch (3693:11): [True: 0, False: 147]
  |  Branch (3693:29): [True: 0, False: 0]
  ------------------
 3694|    147|		    || (h[2] == '\007' && h[3] == '\010')
  ------------------
  |  Branch (3694:11): [True: 117, False: 30]
  |  Branch (3694:29): [True: 117, False: 0]
  ------------------
 3695|     30|		    || (h[2] == '0' && h[3] == '0'))
  ------------------
  |  Branch (3695:11): [True: 11, False: 19]
  |  Branch (3695:26): [True: 11, False: 0]
  ------------------
 3696|  2.62k|			return (29);
 3697|  2.64k|	}
 3698|       |
 3699|       |	/* TODO: It's worth looking ahead a little bit for a valid
 3700|       |	 * PK signature.  In particular, that would make it possible
 3701|       |	 * to read some UUEncoded SFX files or SFX files coming from
 3702|       |	 * a network socket. */
 3703|       |
 3704|  13.5k|	return (0);
 3705|  16.2k|}
archive_read_support_format_zip.c:archive_read_format_zip_options:
 3601|  33.4k|{
 3602|  33.4k|	struct zip *zip = a->format->data;
 3603|  33.4k|	int ret = ARCHIVE_FAILED;
  ------------------
  |  |  237|  33.4k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3604|       |
 3605|  33.4k|	if (strcmp(key, "compat-2x")  == 0) {
  ------------------
  |  Branch (3605:6): [True: 0, False: 33.4k]
  ------------------
 3606|       |		/* Handle filenames as libarchive 2.x */
 3607|      0|		zip->init_default_conversion = (val != NULL) ? 1 : 0;
  ------------------
  |  Branch (3607:34): [True: 0, False: 0]
  ------------------
 3608|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3609|  33.4k|	} else if (strcmp(key, "hdrcharset")  == 0) {
  ------------------
  |  Branch (3609:13): [True: 0, False: 33.4k]
  ------------------
 3610|      0|		if (val == NULL || val[0] == 0)
  ------------------
  |  Branch (3610:7): [True: 0, False: 0]
  |  Branch (3610:22): [True: 0, False: 0]
  ------------------
 3611|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3612|      0|			    "zip: hdrcharset option needs a character-set name"
 3613|      0|			);
 3614|      0|		else {
 3615|      0|			zip->sconv = archive_string_conversion_from_charset(
 3616|      0|			    &a->archive, val, 0);
 3617|      0|			if (zip->sconv != NULL) {
  ------------------
  |  Branch (3617:8): [True: 0, False: 0]
  ------------------
 3618|      0|				if (strcmp(val, "UTF-8") == 0)
  ------------------
  |  Branch (3618:9): [True: 0, False: 0]
  ------------------
 3619|      0|					zip->sconv_utf8 = zip->sconv;
 3620|      0|				ret = ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3621|      0|			} else
 3622|      0|				ret = ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3623|      0|		}
 3624|      0|		return (ret);
 3625|  33.4k|	} else if (strcmp(key, "ignorecrc32") == 0) {
  ------------------
  |  Branch (3625:13): [True: 33.4k, False: 0]
  ------------------
 3626|       |		/* Mostly useful for testing. */
 3627|  33.4k|		if (val == NULL || val[0] == 0) {
  ------------------
  |  Branch (3627:7): [True: 0, False: 33.4k]
  |  Branch (3627:22): [True: 0, False: 33.4k]
  ------------------
 3628|      0|			zip->crc32func = real_crc32;
 3629|      0|			zip->ignore_crc32 = 0;
 3630|  33.4k|		} else {
 3631|  33.4k|			zip->crc32func = fake_crc32;
 3632|  33.4k|			zip->ignore_crc32 = 1;
 3633|  33.4k|		}
 3634|  33.4k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  33.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3635|  33.4k|	} else if (strcmp(key, "mac-ext") == 0) {
  ------------------
  |  Branch (3635:13): [True: 0, False: 0]
  ------------------
 3636|      0|		zip->process_mac_extensions = (val != NULL && val[0] != 0);
  ------------------
  |  Branch (3636:34): [True: 0, False: 0]
  |  Branch (3636:49): [True: 0, False: 0]
  ------------------
 3637|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3638|      0|	}
 3639|       |
 3640|       |	/* Note: The "warn" return is just to inform the options
 3641|       |	 * supervisor that we didn't handle it.  It will generate
 3642|       |	 * a suitable error if no one used this option. */
 3643|      0|	return (ARCHIVE_WARN);
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 3644|  33.4k|}
archive_read_support_format_zip.c:fake_crc32:
  596|  54.4k|{
  597|  54.4k|	(void)crc; /* UNUSED */
  598|  54.4k|	(void)buff; /* UNUSED */
  599|  54.4k|	(void)len; /* UNUSED */
  600|  54.4k|	return 0;
  601|  54.4k|}
archive_read_support_format_zip.c:archive_read_format_zip_streamable_read_header:
 3710|  39.1k|{
 3711|  39.1k|	struct zip *zip = a->format->data;
 3712|       |
 3713|  39.1k|	a->archive.archive_format = ARCHIVE_FORMAT_ZIP;
  ------------------
  |  |  374|  39.1k|#define	ARCHIVE_FORMAT_ZIP			0x50000
  ------------------
 3714|  39.1k|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (3714:6): [True: 2.51k, False: 36.6k]
  ------------------
 3715|  2.51k|		a->archive.archive_format_name = "ZIP";
 3716|       |
 3717|       |	/*
 3718|       |	 * It should be sufficient to call archive_read_next_header() for
 3719|       |	 * a reader to determine if an entry is encrypted or not. If the
 3720|       |	 * encryption of an entry is only detectable when calling
 3721|       |	 * archive_read_data(), so be it. We'll do the same check there
 3722|       |	 * as well.
 3723|       |	 */
 3724|  39.1k|	if (zip->has_encrypted_entries ==
  ------------------
  |  Branch (3724:6): [True: 2.51k, False: 36.6k]
  ------------------
 3725|  39.1k|			ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW)
  ------------------
  |  |  411|  39.1k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 3726|  2.51k|		zip->has_encrypted_entries = 0;
 3727|       |
 3728|       |	/* Make sure we have a zip_entry structure to use. */
 3729|  39.1k|	if (zip->zip_entries == NULL) {
  ------------------
  |  Branch (3729:6): [True: 2.51k, False: 36.6k]
  ------------------
 3730|  2.51k|		zip->zip_entries = malloc(sizeof(struct zip_entry));
 3731|  2.51k|		if (zip->zip_entries == NULL) {
  ------------------
  |  Branch (3731:7): [True: 0, False: 2.51k]
  ------------------
 3732|      0|			archive_set_error(&a->archive, ENOMEM,
 3733|      0|			    "Out  of memory");
 3734|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3735|      0|		}
 3736|  2.51k|	}
 3737|  39.1k|	zip->entry = zip->zip_entries;
 3738|  39.1k|	memset(zip->entry, 0, sizeof(struct zip_entry));
 3739|       |
 3740|  39.1k|	if (zip->cctx_valid)
  ------------------
  |  Branch (3740:6): [True: 4.76k, False: 34.4k]
  ------------------
 3741|  4.76k|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  156|  4.76k|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 3742|  39.1k|	if (zip->hctx_valid)
  ------------------
  |  Branch (3742:6): [True: 4.76k, False: 34.4k]
  ------------------
 3743|  4.76k|		archive_hmac_sha1_cleanup(&zip->hctx);
  ------------------
  |  |   95|  4.76k|	__archive_hmac.__hmac_sha1_cleanup(ctx)
  ------------------
 3744|  39.1k|	zip->tctx_valid = zip->cctx_valid = zip->hctx_valid = 0;
 3745|  39.1k|	__archive_read_reset_passphrase(a);
 3746|       |
 3747|       |	/* Search ahead for the next local file header. */
 3748|  39.1k|	__archive_read_consume(a, zip->unconsumed);
 3749|  39.1k|	zip->unconsumed = 0;
 3750|  40.2k|	for (;;) {
 3751|  40.2k|		int64_t skipped = 0;
 3752|  40.2k|		const char *p, *end;
 3753|  40.2k|		ssize_t bytes;
 3754|       |
 3755|  40.2k|		p = __archive_read_ahead(a, 4, &bytes);
 3756|  40.2k|		if (p == NULL)
  ------------------
  |  Branch (3756:7): [True: 902, False: 39.3k]
  ------------------
 3757|    902|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    902|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3758|  39.3k|		end = p + bytes;
 3759|       |
 3760|  15.1M|		while (p + 4 <= end) {
  ------------------
  |  Branch (3760:10): [True: 15.1M, False: 1.07k]
  ------------------
 3761|  15.1M|			if (p[0] == 'P' && p[1] == 'K') {
  ------------------
  |  Branch (3761:8): [True: 83.3k, False: 15.0M]
  |  Branch (3761:23): [True: 56.7k, False: 26.5k]
  ------------------
 3762|  56.7k|				if (p[2] == '\003' && p[3] == '\004') {
  ------------------
  |  Branch (3762:9): [True: 40.8k, False: 15.8k]
  |  Branch (3762:27): [True: 38.2k, False: 2.58k]
  ------------------
 3763|       |					/* Regular file entry. */
 3764|  38.2k|					__archive_read_consume(a, skipped);
 3765|  38.2k|					return zip_read_local_file_header(a,
 3766|  38.2k|					    entry, zip);
 3767|  38.2k|				}
 3768|       |
 3769|       |                              /*
 3770|       |                               * TODO: We cannot restore permissions
 3771|       |                               * based only on the local file headers.
 3772|       |                               * Consider scanning the central
 3773|       |                               * directory and returning additional
 3774|       |                               * entries for at least directories.
 3775|       |                               * This would allow us to properly set
 3776|       |                               * directory permissions.
 3777|       |			       *
 3778|       |			       * This won't help us fix symlinks
 3779|       |			       * and may not help with regular file
 3780|       |			       * permissions, either.  <sigh>
 3781|       |                               */
 3782|  18.4k|                              if (p[2] == '\001' && p[3] == '\002') {
  ------------------
  |  Branch (3782:35): [True: 1.27k, False: 17.2k]
  |  Branch (3782:53): [True: 6, False: 1.26k]
  ------------------
 3783|      6|                                      return (ARCHIVE_EOF);
  ------------------
  |  |  232|      6|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3784|      6|                              }
 3785|       |
 3786|       |                              /* End of central directory?  Must be an
 3787|       |                               * empty archive. */
 3788|  18.4k|                              if ((p[2] == '\005' && p[3] == '\006')
  ------------------
  |  Branch (3788:36): [True: 528, False: 17.9k]
  |  Branch (3788:54): [True: 11, False: 517]
  ------------------
 3789|  18.4k|                                  || (p[2] == '\006' && p[3] == '\006'))
  ------------------
  |  Branch (3789:39): [True: 961, False: 17.5k]
  |  Branch (3789:57): [True: 0, False: 961]
  ------------------
 3790|     11|                                      return (ARCHIVE_EOF);
  ------------------
  |  |  232|     11|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3791|  18.4k|			}
 3792|  15.0M|			++p;
 3793|  15.0M|			++skipped;
 3794|  15.0M|		}
 3795|  1.07k|		__archive_read_consume(a, skipped);
 3796|  1.07k|	}
 3797|  39.1k|}
archive_read_support_format_zip.c:zip_read_local_file_header:
 1106|  38.4k|{
 1107|  38.4k|	const char *p;
 1108|  38.4k|	const void *h;
 1109|  38.4k|	const wchar_t *wp;
 1110|  38.4k|	const char *cp;
 1111|  38.4k|	size_t len, filename_length, extra_length;
 1112|  38.4k|	struct archive_string_conv *sconv;
 1113|  38.4k|	struct zip_entry *zip_entry = zip->entry;
 1114|  38.4k|	struct zip_entry zip_entry_central_dir;
 1115|  38.4k|	int ret = ARCHIVE_OK;
  ------------------
  |  |  233|  38.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1116|  38.4k|	char version;
 1117|       |
 1118|       |	/* Save a copy of the original for consistency checks. */
 1119|  38.4k|	zip_entry_central_dir = *zip_entry;
 1120|       |
 1121|  38.4k|	zip->decompress_init = 0;
 1122|  38.4k|	zip->end_of_entry = 0;
 1123|  38.4k|	zip->entry_uncompressed_bytes_read = 0;
 1124|  38.4k|	zip->entry_compressed_bytes_read = 0;
 1125|  38.4k|	zip->computed_crc32 = zip->crc32func(0, NULL, 0);
 1126|       |
 1127|       |	/* Setup default conversion. */
 1128|  38.4k|	if (zip->sconv == NULL && !zip->init_default_conversion) {
  ------------------
  |  Branch (1128:6): [True: 38.4k, False: 0]
  |  Branch (1128:28): [True: 2.55k, False: 35.9k]
  ------------------
 1129|  2.55k|		zip->sconv_default =
 1130|  2.55k|		    archive_string_default_conversion_for_read(&(a->archive));
 1131|  2.55k|		zip->init_default_conversion = 1;
 1132|  2.55k|	}
 1133|       |
 1134|  38.4k|	if ((p = __archive_read_ahead(a, ZIP_LOCHDR_LEN, NULL)) == NULL) {
  ------------------
  |  |   83|  38.4k|#define ZIP_LOCHDR_LEN		30U
  ------------------
  |  Branch (1134:6): [True: 122, False: 38.3k]
  ------------------
 1135|    122|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    122|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1136|    122|		    "Truncated ZIP file header");
 1137|    122|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    122|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1138|    122|	}
 1139|       |
 1140|  38.3k|	if (memcmp(p, "PK\003\004", 4) != 0) {
  ------------------
  |  Branch (1140:6): [True: 10, False: 38.3k]
  ------------------
 1141|     10|		archive_set_error(&a->archive, -1, "Damaged Zip archive");
 1142|     10|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|     10|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1143|     10|	}
 1144|  38.3k|	version = p[4];
 1145|  38.3k|	zip_entry->system = p[5];
 1146|  38.3k|	zip_entry->zip_flags = archive_le16dec(p + 6);
 1147|  38.3k|	if (zip_entry->zip_flags & (ZIP_ENCRYPTED | ZIP_STRONG_ENCRYPTED)) {
  ------------------
  |  |  128|  38.3k|#define ZIP_ENCRYPTED	(1 << 0)
  ------------------
              	if (zip_entry->zip_flags & (ZIP_ENCRYPTED | ZIP_STRONG_ENCRYPTED)) {
  ------------------
  |  |  130|  38.3k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
  |  Branch (1147:6): [True: 13.3k, False: 25.0k]
  ------------------
 1148|  13.3k|		zip->has_encrypted_entries = 1;
 1149|  13.3k|		archive_entry_set_is_data_encrypted(entry, 1);
 1150|  13.3k|		if (zip_entry->zip_flags & ZIP_CENTRAL_DIRECTORY_ENCRYPTED &&
  ------------------
  |  |  134|  26.6k|#define ZIP_CENTRAL_DIRECTORY_ENCRYPTED	(1 << 13)
  ------------------
  |  Branch (1150:7): [True: 4.44k, False: 8.86k]
  ------------------
 1151|  4.44k|			zip_entry->zip_flags & ZIP_ENCRYPTED &&
  ------------------
  |  |  128|  17.7k|#define ZIP_ENCRYPTED	(1 << 0)
  ------------------
  |  Branch (1151:4): [True: 878, False: 3.56k]
  ------------------
 1152|    878|			zip_entry->zip_flags & ZIP_STRONG_ENCRYPTED) {
  ------------------
  |  |  130|    878|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
  |  Branch (1152:4): [True: 6, False: 872]
  ------------------
 1153|      6|			archive_entry_set_is_metadata_encrypted(entry, 1);
 1154|      6|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      6|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1155|      6|		}
 1156|  13.3k|	}
 1157|  38.3k|	zip->init_decryption = (zip_entry->zip_flags & ZIP_ENCRYPTED);
  ------------------
  |  |  128|  38.3k|#define ZIP_ENCRYPTED	(1 << 0)
  ------------------
 1158|  38.3k|	zip_entry->compression = (char)archive_le16dec(p + 8);
 1159|  38.3k|	zip_entry->mtime = __archive_dos_to_unix(archive_le32dec(p + 10));
 1160|  38.3k|	zip_entry->crc32 = archive_le32dec(p + 14);
 1161|  38.3k|	if (zip_entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  129|  38.3k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (1161:6): [True: 22.5k, False: 15.7k]
  ------------------
 1162|  22.5k|		zip_entry->decdat = p[11];
 1163|  15.7k|	else
 1164|  15.7k|		zip_entry->decdat = p[17];
 1165|  38.3k|	zip_entry->compressed_size = archive_le32dec(p + 18);
 1166|  38.3k|	zip_entry->uncompressed_size = archive_le32dec(p + 22);
 1167|  38.3k|	filename_length = archive_le16dec(p + 26);
 1168|  38.3k|	extra_length = archive_le16dec(p + 28);
 1169|       |
 1170|  38.3k|	__archive_read_consume(a, ZIP_LOCHDR_LEN);
  ------------------
  |  |   83|  38.3k|#define ZIP_LOCHDR_LEN		30U
  ------------------
 1171|       |
 1172|       |	/* Read the filename. */
 1173|  38.3k|	if ((h = __archive_read_ahead(a, filename_length, NULL)) == NULL) {
  ------------------
  |  Branch (1173:6): [True: 149, False: 38.2k]
  ------------------
 1174|    149|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    149|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1175|    149|		    "Truncated ZIP file header");
 1176|    149|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    149|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1177|    149|	}
 1178|  38.2k|	if (zip_entry->zip_flags & ZIP_UTF8_NAME) {
  ------------------
  |  |  131|  38.2k|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (1178:6): [True: 10.4k, False: 27.7k]
  ------------------
 1179|       |		/* The filename is stored to be UTF-8. */
 1180|  10.4k|		if (zip->sconv_utf8 == NULL) {
  ------------------
  |  Branch (1180:7): [True: 954, False: 9.53k]
  ------------------
 1181|    954|			zip->sconv_utf8 =
 1182|    954|			    archive_string_conversion_from_charset(
 1183|    954|				&a->archive, "UTF-8", 1);
 1184|    954|			if (zip->sconv_utf8 == NULL)
  ------------------
  |  Branch (1184:8): [True: 0, False: 954]
  ------------------
 1185|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1186|    954|		}
 1187|  10.4k|		sconv = zip->sconv_utf8;
 1188|  27.7k|	} else if (zip->sconv != NULL)
  ------------------
  |  Branch (1188:13): [True: 0, False: 27.7k]
  ------------------
 1189|      0|		sconv = zip->sconv;
 1190|  27.7k|	else
 1191|  27.7k|		sconv = zip->sconv_default;
 1192|       |
 1193|  38.2k|	if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|  38.2k|#define archive_entry_copy_pathname_l	__archive_entry_copy_pathname_l
  ------------------
  |  Branch (1193:6): [True: 1.08k, False: 37.1k]
  ------------------
 1194|  38.2k|	    h, filename_length, sconv) != 0) {
 1195|  1.08k|		if (errno == ENOMEM) {
  ------------------
  |  Branch (1195:7): [True: 0, False: 1.08k]
  ------------------
 1196|      0|			archive_set_error(&a->archive, ENOMEM,
 1197|      0|			    "Can't allocate memory for Pathname");
 1198|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1199|      0|		}
 1200|  1.08k|		archive_set_error(&a->archive,
 1201|  1.08k|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.08k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1202|  1.08k|		    "Pathname cannot be converted "
 1203|  1.08k|		    "from %s to current locale",
 1204|  1.08k|		    archive_string_conversion_charset_name(sconv));
 1205|  1.08k|		ret = ARCHIVE_WARN;
  ------------------
  |  |  235|  1.08k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1206|  1.08k|	}
 1207|  38.2k|	__archive_read_consume(a, filename_length);
 1208|       |
 1209|       |	/* Read the extra data. */
 1210|  38.2k|	if ((h = __archive_read_ahead(a, extra_length, NULL)) == NULL) {
  ------------------
  |  Branch (1210:6): [True: 70, False: 38.1k]
  ------------------
 1211|     70|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     70|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1212|     70|		    "Truncated ZIP file header");
 1213|     70|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     70|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1214|     70|	}
 1215|       |
 1216|  38.1k|	if (ARCHIVE_OK != process_extra(a, entry, h, extra_length,
  ------------------
  |  |  233|  38.1k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1216:6): [True: 124, False: 38.0k]
  ------------------
 1217|  38.1k|	    zip_entry)) {
 1218|    124|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|    124|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1219|    124|	}
 1220|  38.0k|	__archive_read_consume(a, extra_length);
 1221|       |
 1222|       |	/* Work around a bug in Info-Zip: When reading from a pipe, it
 1223|       |	 * stats the pipe instead of synthesizing a file entry. */
 1224|  38.0k|	if ((zip_entry->mode & AE_IFMT) == AE_IFIFO) {
  ------------------
  |  |  215|  38.0k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip_entry->mode & AE_IFMT) == AE_IFIFO) {
  ------------------
  |  |  222|  38.0k|#define AE_IFIFO	((__LA_MODE_T)0010000)
  ------------------
  |  Branch (1224:6): [True: 531, False: 37.4k]
  ------------------
 1225|    531|		zip_entry->mode &= ~ AE_IFMT;
  ------------------
  |  |  215|    531|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1226|    531|		zip_entry->mode |= AE_IFREG;
  ------------------
  |  |  216|    531|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1227|    531|	}
 1228|       |
 1229|       |	/* If the mode is totally empty, set some sane default. */
 1230|  38.0k|	if (zip_entry->mode == 0) {
  ------------------
  |  Branch (1230:6): [True: 34.9k, False: 3.10k]
  ------------------
 1231|  34.9k|		zip_entry->mode |= 0664;
 1232|  34.9k|	}
 1233|       |
 1234|       |	/* Windows archivers sometimes use backslash as the directory
 1235|       |	 * separator. Normalize to slash. */
 1236|  38.0k|	if (zip_entry->system == 0 &&
  ------------------
  |  Branch (1236:6): [True: 19.6k, False: 18.3k]
  ------------------
 1237|  19.6k|	    (wp = archive_entry_pathname_w(entry)) != NULL) {
  ------------------
  |  Branch (1237:6): [True: 13.9k, False: 5.75k]
  ------------------
 1238|  13.9k|		if (wcschr(wp, L'/') == NULL && wcschr(wp, L'\\') != NULL) {
  ------------------
  |  Branch (1238:7): [True: 13.4k, False: 514]
  |  Branch (1238:35): [True: 1.02k, False: 12.4k]
  ------------------
 1239|  1.02k|			size_t i;
 1240|  1.02k|			struct archive_wstring s;
 1241|  1.02k|			archive_string_init(&s);
  ------------------
  |  |   71|  1.02k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 1.02k]
  |  |  ------------------
  ------------------
 1242|  1.02k|			archive_wstrcpy(&s, wp);
  ------------------
  |  |  167|  1.02k|	archive_wstrncpy((as), (p), ((p) == NULL ? 0 : wcslen(p)))
  |  |  ------------------
  |  |  |  |  175|  2.05k|	((as)->length = 0, archive_wstrncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (175:50): [True: 0, False: 1.02k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1243|  33.2k|			for (i = 0; i < archive_strlen(&s); i++) {
  ------------------
  |  |  178|  33.2k|#define	archive_strlen(a) ((a)->length)
  ------------------
  |  Branch (1243:16): [True: 32.2k, False: 1.02k]
  ------------------
 1244|  32.2k|				if (s.s[i] == '\\')
  ------------------
  |  Branch (1244:9): [True: 8.86k, False: 23.3k]
  ------------------
 1245|  8.86k|					s.s[i] = '/';
 1246|  32.2k|			}
 1247|  1.02k|			archive_entry_copy_pathname_w(entry, s.s);
 1248|  1.02k|			archive_wstring_free(&s);
 1249|  1.02k|		}
 1250|  13.9k|	}
 1251|       |
 1252|       |	/* Make sure that entries with a trailing '/' are marked as directories
 1253|       |	 * even if the External File Attributes contains bogus values.  If this
 1254|       |	 * is not a directory and there is no type, assume a regular file. */
 1255|  38.0k|	if ((zip_entry->mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  215|  38.0k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip_entry->mode & AE_IFMT) != AE_IFDIR) {
  ------------------
  |  |  221|  38.0k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1255:6): [True: 37.4k, False: 591]
  ------------------
 1256|  37.4k|		int has_slash;
 1257|       |
 1258|  37.4k|		wp = archive_entry_pathname_w(entry);
 1259|  37.4k|		if (wp != NULL) {
  ------------------
  |  Branch (1259:7): [True: 26.9k, False: 10.4k]
  ------------------
 1260|  26.9k|			len = wcslen(wp);
 1261|  26.9k|			has_slash = len > 0 && wp[len - 1] == L'/';
  ------------------
  |  Branch (1261:16): [True: 5.80k, False: 21.1k]
  |  Branch (1261:27): [True: 328, False: 5.47k]
  ------------------
 1262|  26.9k|		} else {
 1263|  10.4k|			cp = archive_entry_pathname(entry);
 1264|  10.4k|			len = (cp != NULL)?strlen(cp):0;
  ------------------
  |  Branch (1264:10): [True: 9.68k, False: 808]
  ------------------
 1265|  10.4k|			has_slash = len > 0 && cp[len - 1] == '/';
  ------------------
  |  Branch (1265:16): [True: 9.68k, False: 808]
  |  Branch (1265:27): [True: 309, False: 9.37k]
  ------------------
 1266|  10.4k|		}
 1267|       |		/* Correct file type as needed. */
 1268|  37.4k|		if (has_slash) {
  ------------------
  |  Branch (1268:7): [True: 637, False: 36.7k]
  ------------------
 1269|    637|			zip_entry->mode &= ~AE_IFMT;
  ------------------
  |  |  215|    637|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
 1270|    637|			zip_entry->mode |= AE_IFDIR;
  ------------------
  |  |  221|    637|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 1271|    637|			zip_entry->mode |= 0111;
 1272|  36.7k|		} else if ((zip_entry->mode & AE_IFMT) == 0) {
  ------------------
  |  |  215|  36.7k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  |  Branch (1272:14): [True: 34.7k, False: 2.02k]
  ------------------
 1273|  34.7k|			zip_entry->mode |= AE_IFREG;
  ------------------
  |  |  216|  34.7k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 1274|  34.7k|		}
 1275|  37.4k|	}
 1276|       |
 1277|       |	/* Make sure directories end in '/' */
 1278|  38.0k|	if ((zip_entry->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  215|  38.0k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip_entry->mode & AE_IFMT) == AE_IFDIR) {
  ------------------
  |  |  221|  38.0k|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  |  Branch (1278:6): [True: 1.22k, False: 36.7k]
  ------------------
 1279|  1.22k|		wp = archive_entry_pathname_w(entry);
 1280|  1.22k|		if (wp != NULL) {
  ------------------
  |  Branch (1280:7): [True: 620, False: 608]
  ------------------
 1281|    620|			len = wcslen(wp);
 1282|    620|			if (len > 0 && wp[len - 1] != L'/') {
  ------------------
  |  Branch (1282:8): [True: 454, False: 166]
  |  Branch (1282:19): [True: 48, False: 406]
  ------------------
 1283|     48|				struct archive_wstring s;
 1284|     48|				archive_string_init(&s);
  ------------------
  |  |   71|     48|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 48]
  |  |  ------------------
  ------------------
 1285|     48|				archive_wstrcat(&s, wp);
 1286|     48|				archive_wstrappend_wchar(&s, L'/');
 1287|     48|				archive_entry_copy_pathname_w(entry, s.s);
 1288|     48|				archive_wstring_free(&s);
 1289|     48|			}
 1290|    620|		} else {
 1291|    608|			cp = archive_entry_pathname(entry);
 1292|    608|			len = (cp != NULL)?strlen(cp):0;
  ------------------
  |  Branch (1292:10): [True: 347, False: 261]
  ------------------
 1293|    608|			if (len > 0 && cp[len - 1] != '/') {
  ------------------
  |  Branch (1293:8): [True: 347, False: 261]
  |  Branch (1293:19): [True: 38, False: 309]
  ------------------
 1294|     38|				struct archive_string s;
 1295|     38|				archive_string_init(&s);
  ------------------
  |  |   71|     38|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 38]
  |  |  ------------------
  ------------------
 1296|     38|				archive_strcat(&s, cp);
 1297|     38|				archive_strappend_char(&s, '/');
 1298|     38|				archive_entry_set_pathname(entry, s.s);
 1299|     38|				archive_string_free(&s);
 1300|     38|			}
 1301|    608|		}
 1302|  1.22k|	}
 1303|       |
 1304|  38.0k|	if (zip_entry->flags & LA_FROM_CENTRAL_DIRECTORY) {
  ------------------
  |  |  138|  38.0k|#define LA_FROM_CENTRAL_DIRECTORY (1 << 1)
  ------------------
  |  Branch (1304:6): [True: 202, False: 37.8k]
  ------------------
 1305|       |		/* If this came from the central dir, its size info
 1306|       |		 * is definitive, so ignore the length-at-end flag. */
 1307|    202|		zip_entry->zip_flags &= ~ZIP_LENGTH_AT_END;
  ------------------
  |  |  129|    202|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
 1308|       |		/* If local header is missing a value, use the one from
 1309|       |		   the central directory.  If both have it, warn about
 1310|       |		   mismatches. */
 1311|    202|		if (zip_entry->crc32 == 0) {
  ------------------
  |  Branch (1311:7): [True: 59, False: 143]
  ------------------
 1312|     59|			zip_entry->crc32 = zip_entry_central_dir.crc32;
 1313|    143|		} else if (!zip->ignore_crc32
  ------------------
  |  Branch (1313:14): [True: 0, False: 143]
  ------------------
 1314|      0|		    && zip_entry->crc32 != zip_entry_central_dir.crc32) {
  ------------------
  |  Branch (1314:10): [True: 0, False: 0]
  ------------------
 1315|      0|			archive_set_error(&a->archive,
 1316|      0|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1317|      0|			    "Inconsistent CRC32 values");
 1318|      0|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1319|      0|		}
 1320|    202|		if (zip_entry->compressed_size == 0
  ------------------
  |  Branch (1320:7): [True: 53, False: 149]
  ------------------
 1321|    149|		    || zip_entry->compressed_size == 0xffffffff) {
  ------------------
  |  Branch (1321:10): [True: 7, False: 142]
  ------------------
 1322|     60|			zip_entry->compressed_size
 1323|     60|			    = zip_entry_central_dir.compressed_size;
 1324|    142|		} else if (zip_entry->compressed_size
  ------------------
  |  Branch (1324:14): [True: 38, False: 104]
  ------------------
 1325|    142|		    != zip_entry_central_dir.compressed_size) {
 1326|     38|			archive_set_error(&a->archive,
 1327|     38|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     38|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1328|     38|			    "Inconsistent compressed size: "
 1329|     38|			    "%jd in central directory, %jd in local header",
 1330|     38|			    (intmax_t)zip_entry_central_dir.compressed_size,
 1331|     38|			    (intmax_t)zip_entry->compressed_size);
 1332|     38|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     38|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1333|     38|		}
 1334|    202|		if (zip_entry->uncompressed_size == 0 ||
  ------------------
  |  Branch (1334:7): [True: 51, False: 151]
  ------------------
 1335|    151|			zip_entry->uncompressed_size == 0xffffffff) {
  ------------------
  |  Branch (1335:4): [True: 3, False: 148]
  ------------------
 1336|     54|			zip_entry->uncompressed_size
 1337|     54|			    = zip_entry_central_dir.uncompressed_size;
 1338|    148|		} else if (zip_entry->uncompressed_size
  ------------------
  |  Branch (1338:14): [True: 29, False: 119]
  ------------------
 1339|    148|		    != zip_entry_central_dir.uncompressed_size) {
 1340|     29|			archive_set_error(&a->archive,
 1341|     29|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     29|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1342|     29|			    "Inconsistent uncompressed size: "
 1343|     29|			    "%jd in central directory, %jd in local header",
 1344|     29|			    (intmax_t)zip_entry_central_dir.uncompressed_size,
 1345|     29|			    (intmax_t)zip_entry->uncompressed_size);
 1346|     29|			ret = ARCHIVE_WARN;
  ------------------
  |  |  235|     29|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1347|     29|		}
 1348|    202|	}
 1349|       |
 1350|       |	/* Populate some additional entry fields: */
 1351|  38.0k|	archive_entry_set_mode(entry, zip_entry->mode);
 1352|  38.0k|	archive_entry_set_uid(entry, zip_entry->uid);
 1353|  38.0k|	archive_entry_set_gid(entry, zip_entry->gid);
 1354|  38.0k|	archive_entry_set_mtime(entry, zip_entry->mtime, 0);
 1355|  38.0k|	archive_entry_set_ctime(entry, zip_entry->ctime, 0);
 1356|  38.0k|	archive_entry_set_atime(entry, zip_entry->atime, 0);
 1357|       |
 1358|  38.0k|	if ((zip->entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  215|  38.0k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
              	if ((zip->entry->mode & AE_IFMT) == AE_IFLNK) {
  ------------------
  |  |  217|  38.0k|#define AE_IFLNK	((__LA_MODE_T)0120000)
  ------------------
  |  Branch (1358:6): [True: 1.03k, False: 36.9k]
  ------------------
 1359|  1.03k|		size_t linkname_length;
 1360|       |
 1361|  1.03k|		if (zip_entry->compressed_size > 64 * 1024) {
  ------------------
  |  Branch (1361:7): [True: 3, False: 1.02k]
  ------------------
 1362|      3|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      3|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1363|      3|			    "Zip file with oversized link entry");
 1364|      3|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      3|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1365|      3|		}
 1366|       |
 1367|  1.02k|		linkname_length = (size_t)zip_entry->compressed_size;
 1368|       |
 1369|  1.02k|		archive_entry_set_size(entry, 0);
 1370|       |
 1371|       |		// take into account link compression if any
 1372|  1.02k|		size_t linkname_full_length = linkname_length;
 1373|  1.02k|		if (zip->entry->compression != 0)
  ------------------
  |  Branch (1373:7): [True: 123, False: 904]
  ------------------
 1374|    123|		{
 1375|       |			// symlink target string appeared to be compressed
 1376|    123|			int status = ARCHIVE_FATAL;
  ------------------
  |  |  239|    123|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1377|    123|			const void *uncompressed_buffer = NULL;
 1378|       |
 1379|    123|			switch (zip->entry->compression)
 1380|    123|			{
 1381|      0|#if HAVE_ZLIB_H
 1382|    119|				case 8: /* Deflate compression. */
  ------------------
  |  Branch (1382:5): [True: 119, False: 4]
  ------------------
 1383|    119|					zip->entry_bytes_remaining = zip_entry->compressed_size;
 1384|    119|					status = zip_read_data_deflate(a, &uncompressed_buffer,
 1385|    119|						&linkname_full_length, NULL);
 1386|    119|					break;
 1387|      0|#endif
 1388|      0|#if HAVE_LZMA_H && HAVE_LIBLZMA
 1389|      1|				case 14: /* ZIPx LZMA compression. */
  ------------------
  |  Branch (1389:5): [True: 1, False: 122]
  ------------------
 1390|       |					/*(see zip file format specification, section 4.4.5)*/
 1391|      1|					zip->entry_bytes_remaining = zip_entry->compressed_size;
 1392|      1|					status = zip_read_data_zipx_lzma_alone(a, &uncompressed_buffer,
 1393|      1|						&linkname_full_length, NULL);
 1394|      1|					break;
 1395|      0|#endif
 1396|      3|				default: /* Unsupported compression. */
  ------------------
  |  Branch (1396:5): [True: 3, False: 120]
  ------------------
 1397|      3|					break;
 1398|    123|			}
 1399|    123|			if (status == ARCHIVE_OK)
  ------------------
  |  |  233|    123|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1399:8): [True: 118, False: 5]
  ------------------
 1400|    118|			{
 1401|    118|				p = uncompressed_buffer;
 1402|    118|			}
 1403|      5|			else
 1404|      5|			{
 1405|      5|				archive_set_error(&a->archive,
 1406|      5|					ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      5|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1407|      5|					"Unsupported ZIP compression method "
 1408|      5|					"during decompression of link entry (%d: %s)",
 1409|      5|					zip->entry->compression,
 1410|      5|					compression_name(zip->entry->compression));
 1411|      5|				return ARCHIVE_FAILED;
  ------------------
  |  |  237|      5|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1412|      5|			}
 1413|    123|		}
 1414|    904|		else
 1415|    904|		{
 1416|    904|			p = __archive_read_ahead(a, linkname_length, NULL);
 1417|    904|		}
 1418|       |
 1419|  1.02k|		if (p == NULL) {
  ------------------
  |  Branch (1419:7): [True: 1, False: 1.02k]
  ------------------
 1420|      1|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      1|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1421|      1|			    "Truncated Zip file");
 1422|      1|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1423|      1|		}
 1424|       |
 1425|  1.02k|		sconv = zip->sconv;
 1426|  1.02k|		if (sconv == NULL && (zip->entry->zip_flags & ZIP_UTF8_NAME))
  ------------------
  |  |  131|  1.02k|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (1426:7): [True: 1.02k, False: 0]
  |  Branch (1426:24): [True: 495, False: 526]
  ------------------
 1427|    495|			sconv = zip->sconv_utf8;
 1428|  1.02k|		if (sconv == NULL)
  ------------------
  |  Branch (1428:7): [True: 526, False: 495]
  ------------------
 1429|    526|			sconv = zip->sconv_default;
 1430|  1.02k|		if (archive_entry_copy_symlink_l(entry, p, linkname_full_length,
  ------------------
  |  |   83|  1.02k|#define archive_entry_copy_symlink_l	__archive_entry_copy_symlink_l
  ------------------
  |  Branch (1430:7): [True: 468, False: 553]
  ------------------
 1431|  1.02k|		    sconv) != 0) {
 1432|    468|			if (errno != ENOMEM && sconv == zip->sconv_utf8 &&
  ------------------
  |  Branch (1432:8): [True: 468, False: 0]
  |  Branch (1432:27): [True: 468, False: 0]
  ------------------
 1433|    468|			    (zip->entry->zip_flags & ZIP_UTF8_NAME))
  ------------------
  |  |  131|    468|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (1433:8): [True: 468, False: 0]
  ------------------
 1434|    468|			    archive_entry_copy_symlink_l(entry, p,
  ------------------
  |  |   83|    468|#define archive_entry_copy_symlink_l	__archive_entry_copy_symlink_l
  ------------------
 1435|    468|				linkname_full_length, NULL);
 1436|    468|			if (errno == ENOMEM) {
  ------------------
  |  Branch (1436:8): [True: 0, False: 468]
  ------------------
 1437|      0|				archive_set_error(&a->archive, ENOMEM,
 1438|      0|				    "Can't allocate memory for Symlink");
 1439|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1440|      0|			}
 1441|       |			/*
 1442|       |			 * Since there is no character-set regulation for
 1443|       |			 * symlink name, do not report the conversion error
 1444|       |			 * in an automatic conversion.
 1445|       |			 */
 1446|    468|			if (sconv != zip->sconv_utf8 ||
  ------------------
  |  Branch (1446:8): [True: 0, False: 468]
  ------------------
 1447|    468|			    (zip->entry->zip_flags & ZIP_UTF8_NAME) == 0) {
  ------------------
  |  |  131|    468|#define ZIP_UTF8_NAME	(1 << 11)
  ------------------
  |  Branch (1447:8): [True: 0, False: 468]
  ------------------
 1448|      0|				archive_set_error(&a->archive,
 1449|      0|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1450|      0|				    "Symlink cannot be converted "
 1451|      0|				    "from %s to current locale",
 1452|      0|				    archive_string_conversion_charset_name(
 1453|      0|					sconv));
 1454|      0|				ret = ARCHIVE_WARN;
  ------------------
  |  |  235|      0|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1455|      0|			}
 1456|    468|		}
 1457|  1.02k|		zip_entry->uncompressed_size = zip_entry->compressed_size = 0;
 1458|       |
 1459|  1.02k|		if (__archive_read_consume(a, linkname_length) < 0) {
  ------------------
  |  Branch (1459:7): [True: 2, False: 1.01k]
  ------------------
 1460|      2|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1461|      2|			    "Read error skipping symlink target name");
 1462|      2|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1463|      2|		}
 1464|  36.9k|	} else if (zip_entry_size_is_set(zip_entry)) {
  ------------------
  |  Branch (1464:13): [True: 29.8k, False: 7.10k]
  ------------------
 1465|  29.8k|		archive_entry_set_size(entry, zip_entry->uncompressed_size);
 1466|  29.8k|	}
 1467|  37.9k|	zip->entry_bytes_remaining = zip_entry->compressed_size;
 1468|       |
 1469|       |	/* If there's no body, force read_data() to return EOF immediately. */
 1470|  37.9k|	if (0 == (zip_entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  129|  37.9k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (1470:6): [True: 15.6k, False: 22.3k]
  ------------------
 1471|  15.6k|	    && zip->entry_bytes_remaining < 1)
  ------------------
  |  Branch (1471:9): [True: 2.83k, False: 12.7k]
  ------------------
 1472|  2.83k|		zip->end_of_entry = 1;
 1473|       |
 1474|       |	/* Set up a more descriptive format name. */
 1475|  37.9k|        archive_string_empty(&zip->format_name);
  ------------------
  |  |  181|  37.9k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 1476|  37.9k|	archive_string_sprintf(&zip->format_name, "ZIP %d.%d (%s)",
 1477|  37.9k|	    version / 10, version % 10,
 1478|  37.9k|	    compression_name(zip->entry->compression));
 1479|  37.9k|	a->archive.archive_format_name = zip->format_name.s;
 1480|       |
 1481|  37.9k|	return (ret);
 1482|  38.0k|}
archive_read_support_format_zip.c:process_extra:
  659|  39.2k|{
  660|  39.2k|	struct zip *zip = a->format->data;
  661|  39.2k|	unsigned offset = 0;
  662|       |
  663|  39.2k|	if (extra_length == 0) {
  ------------------
  |  Branch (663:6): [True: 22.7k, False: 16.5k]
  ------------------
  664|  22.7k|		return ARCHIVE_OK;
  ------------------
  |  |  233|  22.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  665|  22.7k|	}
  666|       |
  667|  16.5k|	if (extra_length < 4) {
  ------------------
  |  Branch (667:6): [True: 348, False: 16.1k]
  ------------------
  668|    348|		size_t i = 0;
  669|       |		/* Some ZIP files may have trailing 0 bytes. Let's check they
  670|       |		 * are all 0 and ignore them instead of returning an error.
  671|       |		 *
  672|       |		 * This is not technically correct, but some ZIP files look
  673|       |		 * like this and other tools support those files - so let's
  674|       |		 * also  support them.
  675|       |		 */
  676|  1.03k|		for (; i < extra_length; i++) {
  ------------------
  |  Branch (676:10): [True: 685, False: 346]
  ------------------
  677|    685|			if (p[i] != 0) {
  ------------------
  |  Branch (677:8): [True: 2, False: 683]
  ------------------
  678|      2|				archive_set_error(&a->archive,
  679|      2|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  680|      2|				    "Too-small extra data: "
  681|      2|				    "Need at least 4 bytes, "
  682|      2|				    "but only found %d bytes",
  683|      2|				    (int)extra_length);
  684|      2|				return ARCHIVE_FAILED;
  ------------------
  |  |  237|      2|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  685|      2|			}
  686|    685|		}
  687|       |
  688|    346|		return ARCHIVE_OK;
  ------------------
  |  |  233|    346|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  689|    348|	}
  690|       |
  691|  41.5k|	while (offset <= extra_length - 4) {
  ------------------
  |  Branch (691:9): [True: 25.5k, False: 16.0k]
  ------------------
  692|  25.5k|		unsigned short headerid = archive_le16dec(p + offset);
  693|  25.5k|		unsigned short datasize = archive_le16dec(p + offset + 2);
  694|       |
  695|  25.5k|		offset += 4;
  696|  25.5k|		if (offset + datasize > extra_length) {
  ------------------
  |  Branch (696:7): [True: 116, False: 25.3k]
  ------------------
  697|    116|			archive_set_error(&a->archive,
  698|    116|			    ARCHIVE_ERRNO_FILE_FORMAT, "Extra data overflow: "
  ------------------
  |  |  192|    116|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  699|    116|			    "Need %d bytes but only found %d bytes",
  700|    116|			    (int)datasize, (int)(extra_length - offset));
  701|    116|			return ARCHIVE_FAILED;
  ------------------
  |  |  237|    116|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  702|    116|		}
  703|       |#ifdef DEBUG
  704|       |		fprintf(stderr, "Header id 0x%04x, length %d\n",
  705|       |		    headerid, datasize);
  706|       |#endif
  707|  25.3k|		switch (headerid) {
  708|    681|		case 0x0001:
  ------------------
  |  Branch (708:3): [True: 681, False: 24.7k]
  ------------------
  709|       |			/* Zip64 extended information extra field. */
  710|    681|			zip_entry->flags |= LA_USED_ZIP64;
  ------------------
  |  |  137|    681|#define LA_USED_ZIP64	(1 << 0)
  ------------------
  711|    681|			if (zip_entry->uncompressed_size == 0xffffffff) {
  ------------------
  |  Branch (711:8): [True: 412, False: 269]
  ------------------
  712|    412|				uint64_t t = 0;
  713|    412|				if (datasize < 8
  ------------------
  |  Branch (713:9): [True: 2, False: 410]
  ------------------
  714|    410|				    || (t = archive_le64dec(p + offset)) >
  ------------------
  |  Branch (714:12): [True: 8, False: 402]
  ------------------
  715|    410|				    INT64_MAX) {
  716|     10|					archive_set_error(&a->archive,
  717|     10|					    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     10|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  718|     10|					    "Malformed 64-bit "
  719|     10|					    "uncompressed size");
  720|     10|					return ARCHIVE_FAILED;
  ------------------
  |  |  237|     10|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  721|     10|				}
  722|    402|				zip_entry->uncompressed_size = t;
  723|    402|				offset += 8;
  724|    402|				datasize -= 8;
  725|    402|			}
  726|    671|			if (zip_entry->compressed_size == 0xffffffff) {
  ------------------
  |  Branch (726:8): [True: 170, False: 501]
  ------------------
  727|    170|				uint64_t t = 0;
  728|    170|				if (datasize < 8
  ------------------
  |  Branch (728:9): [True: 0, False: 170]
  ------------------
  729|    170|				    || (t = archive_le64dec(p + offset)) >
  ------------------
  |  Branch (729:12): [True: 11, False: 159]
  ------------------
  730|    170|				    INT64_MAX) {
  731|     11|					archive_set_error(&a->archive,
  732|     11|					    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     11|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  733|     11|					    "Malformed 64-bit "
  734|     11|					    "compressed size");
  735|     11|					return ARCHIVE_FAILED;
  ------------------
  |  |  237|     11|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  736|     11|				}
  737|    159|				zip_entry->compressed_size = t;
  738|    159|				offset += 8;
  739|    159|				datasize -= 8;
  740|    159|			}
  741|    660|			if (zip_entry->local_header_offset == 0xffffffff) {
  ------------------
  |  Branch (741:8): [True: 4, False: 656]
  ------------------
  742|      4|				uint64_t t = 0;
  743|      4|				if (datasize < 8
  ------------------
  |  Branch (743:9): [True: 1, False: 3]
  ------------------
  744|      3|				    || (t = archive_le64dec(p + offset)) >
  ------------------
  |  Branch (744:12): [True: 1, False: 2]
  ------------------
  745|      3|				    INT64_MAX) {
  746|      2|					archive_set_error(&a->archive,
  747|      2|					    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  748|      2|					    "Malformed 64-bit "
  749|      2|					    "local header offset");
  750|      2|					return ARCHIVE_FAILED;
  ------------------
  |  |  237|      2|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  751|      2|				}
  752|      2|				zip_entry->local_header_offset = t;
  753|      2|				offset += 8;
  754|      2|				datasize -= 8;
  755|      2|			}
  756|       |			/* archive_le32dec(p + offset) gives disk
  757|       |			 * on which file starts, but we don't handle
  758|       |			 * multi-volume Zip files. */
  759|    658|			break;
  760|    658|		case 0x000d:
  ------------------
  |  Branch (760:3): [True: 176, False: 25.2k]
  ------------------
  761|       |			/* PKWARE Unix Extra Field fixed metadata. */
  762|    176|			if (datasize >= 12) {
  ------------------
  |  Branch (762:8): [True: 59, False: 117]
  ------------------
  763|     59|				zip_entry->atime = archive_le32dec(p + offset);
  764|     59|				zip_entry->mtime =
  765|     59|				    archive_le32dec(p + offset + 4);
  766|     59|				zip_entry->uid =
  767|     59|				    archive_le16dec(p + offset + 8);
  768|     59|				zip_entry->gid =
  769|     59|				    archive_le16dec(p + offset + 10);
  770|       |				/*
  771|       |				 * APPNOTE.TXT also defines additional data after
  772|       |				 * this fixed metadata, depending on file type.
  773|       |				 */
  774|     59|			}
  775|    176|			break;
  776|       |#ifdef DEBUG
  777|       |		case 0x0017:
  778|       |		{
  779|       |			/* Strong encryption field. */
  780|       |			if (archive_le16dec(p + offset) == 2) {
  781|       |				unsigned algId =
  782|       |					archive_le16dec(p + offset + 2);
  783|       |				unsigned bitLen =
  784|       |					archive_le16dec(p + offset + 4);
  785|       |				int	 flags =
  786|       |					archive_le16dec(p + offset + 6);
  787|       |				fprintf(stderr, "algId=0x%04x, bitLen=%u, "
  788|       |				    "flgas=%d\n", algId, bitLen,flags);
  789|       |			}
  790|       |			break;
  791|       |		}
  792|       |#endif
  793|  3.23k|		case 0x5455:
  ------------------
  |  Branch (793:3): [True: 3.23k, False: 22.1k]
  ------------------
  794|  3.23k|		{
  795|       |			/* Extended time field "UT". */
  796|  3.23k|			int flags;
  797|  3.23k|			if (datasize == 0) {
  ------------------
  |  Branch (797:8): [True: 1, False: 3.23k]
  ------------------
  798|      1|				archive_set_error(&a->archive,
  799|      1|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  800|      1|				    "Incomplete extended time field");
  801|      1|				return ARCHIVE_FAILED;
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  802|      1|			}
  803|  3.23k|			flags = p[offset];
  804|  3.23k|			offset++;
  805|  3.23k|			datasize--;
  806|       |			/* Flag bits indicate which dates are present. */
  807|  3.23k|			if (flags & 0x01)
  ------------------
  |  Branch (807:8): [True: 2.51k, False: 722]
  ------------------
  808|  2.51k|			{
  809|       |#ifdef DEBUG
  810|       |				fprintf(stderr, "mtime: %lld -> %d\n",
  811|       |				    (long long)zip_entry->mtime,
  812|       |				    archive_le32dec(p + offset));
  813|       |#endif
  814|  2.51k|				if (datasize < 4)
  ------------------
  |  Branch (814:9): [True: 55, False: 2.45k]
  ------------------
  815|     55|					break;
  816|  2.45k|				zip_entry->mtime = archive_le32dec(p + offset);
  817|  2.45k|				offset += 4;
  818|  2.45k|				datasize -= 4;
  819|  2.45k|			}
  820|  3.18k|			if (flags & 0x02)
  ------------------
  |  Branch (820:8): [True: 2.23k, False: 950]
  ------------------
  821|  2.23k|			{
  822|  2.23k|				if (datasize < 4)
  ------------------
  |  Branch (822:9): [True: 388, False: 1.84k]
  ------------------
  823|    388|					break;
  824|  1.84k|				zip_entry->atime = archive_le32dec(p + offset);
  825|  1.84k|				offset += 4;
  826|  1.84k|				datasize -= 4;
  827|  1.84k|			}
  828|  2.79k|			if (flags & 0x04)
  ------------------
  |  Branch (828:8): [True: 2.37k, False: 422]
  ------------------
  829|  2.37k|			{
  830|  2.37k|				if (datasize < 4)
  ------------------
  |  Branch (830:9): [True: 1.24k, False: 1.12k]
  ------------------
  831|  1.24k|					break;
  832|  1.12k|				zip_entry->ctime = archive_le32dec(p + offset);
  833|  1.12k|				offset += 4;
  834|  1.12k|				datasize -= 4;
  835|  1.12k|			}
  836|  1.54k|			break;
  837|  2.79k|		}
  838|  1.54k|		case 0x5855:
  ------------------
  |  Branch (838:3): [True: 289, False: 25.1k]
  ------------------
  839|    289|		{
  840|       |			/* Info-ZIP Unix Extra Field (old version) "UX". */
  841|    289|			if (datasize >= 8) {
  ------------------
  |  Branch (841:8): [True: 225, False: 64]
  ------------------
  842|    225|				zip_entry->atime = archive_le32dec(p + offset);
  843|    225|				zip_entry->mtime =
  844|    225|				    archive_le32dec(p + offset + 4);
  845|    225|			}
  846|    289|			if (datasize >= 12) {
  ------------------
  |  Branch (846:8): [True: 220, False: 69]
  ------------------
  847|    220|				zip_entry->uid =
  848|    220|				    archive_le16dec(p + offset + 8);
  849|    220|				zip_entry->gid =
  850|    220|				    archive_le16dec(p + offset + 10);
  851|    220|			}
  852|    289|			break;
  853|  2.79k|		}
  854|  5.08k|		case 0x6c78:
  ------------------
  |  Branch (854:3): [True: 5.08k, False: 20.3k]
  ------------------
  855|  5.08k|		{
  856|       |			/* Experimental 'xl' field */
  857|       |			/*
  858|       |			 * Introduced Dec 2013 to provide a way to
  859|       |			 * include external file attributes (and other
  860|       |			 * fields that ordinarily appear only in
  861|       |			 * central directory) in local file header.
  862|       |			 * This provides file type and permission
  863|       |			 * information necessary to support full
  864|       |			 * streaming extraction.  Currently being
  865|       |			 * discussed with other Zip developers
  866|       |			 * ... subject to change.
  867|       |			 *
  868|       |			 * Format:
  869|       |			 *  The field starts with a bitmap that specifies
  870|       |			 *  which additional fields are included.  The
  871|       |			 *  bitmap is variable length and can be extended in
  872|       |			 *  the future.
  873|       |			 *
  874|       |			 *  n bytes - feature bitmap: first byte has low-order
  875|       |			 *    7 bits.  If high-order bit is set, a subsequent
  876|       |			 *    byte holds the next 7 bits, etc.
  877|       |			 *
  878|       |			 *  if bitmap & 1, 2 byte "version made by"
  879|       |			 *  if bitmap & 2, 2 byte "internal file attributes"
  880|       |			 *  if bitmap & 4, 4 byte "external file attributes"
  881|       |			 *  if bitmap & 8, 2 byte comment length + n byte
  882|       |			 *  comment
  883|       |			 */
  884|  5.08k|			int bitmap, bitmap_last;
  885|       |
  886|  5.08k|			if (datasize < 1)
  ------------------
  |  Branch (886:8): [True: 297, False: 4.78k]
  ------------------
  887|    297|				break;
  888|  4.78k|			bitmap_last = bitmap = 0xff & p[offset];
  889|  4.78k|			offset += 1;
  890|  4.78k|			datasize -= 1;
  891|       |
  892|       |			/* We only support first 7 bits of bitmap; skip rest. */
  893|  19.8k|			while ((bitmap_last & 0x80) != 0
  ------------------
  |  Branch (893:11): [True: 15.5k, False: 4.31k]
  ------------------
  894|  15.5k|			    && datasize >= 1) {
  ------------------
  |  Branch (894:11): [True: 15.0k, False: 475]
  ------------------
  895|  15.0k|				bitmap_last = p[offset];
  896|  15.0k|				offset += 1;
  897|  15.0k|				datasize -= 1;
  898|  15.0k|			}
  899|       |
  900|  4.78k|			if (bitmap & 1) {
  ------------------
  |  Branch (900:8): [True: 3.88k, False: 901]
  ------------------
  901|       |				/* 2 byte "version made by" */
  902|  3.88k|				if (datasize < 2)
  ------------------
  |  Branch (902:9): [True: 457, False: 3.42k]
  ------------------
  903|    457|					break;
  904|  3.42k|				zip_entry->system
  905|  3.42k|				    = archive_le16dec(p + offset) >> 8;
  906|  3.42k|				offset += 2;
  907|  3.42k|				datasize -= 2;
  908|  3.42k|			}
  909|  4.32k|			if (bitmap & 2) {
  ------------------
  |  Branch (909:8): [True: 3.64k, False: 680]
  ------------------
  910|       |				/* 2 byte "internal file attributes" */
  911|  3.64k|				uint32_t internal_attributes;
  912|  3.64k|				if (datasize < 2)
  ------------------
  |  Branch (912:9): [True: 238, False: 3.41k]
  ------------------
  913|    238|					break;
  914|  3.41k|				internal_attributes
  915|  3.41k|				    = archive_le16dec(p + offset);
  916|       |				/* Not used by libarchive at present. */
  917|  3.41k|				(void)internal_attributes; /* UNUSED */
  918|  3.41k|				offset += 2;
  919|  3.41k|				datasize -= 2;
  920|  3.41k|			}
  921|  4.09k|			if (bitmap & 4) {
  ------------------
  |  Branch (921:8): [True: 3.73k, False: 356]
  ------------------
  922|       |				/* 4 byte "external file attributes" */
  923|  3.73k|				uint32_t external_attributes;
  924|  3.73k|				if (datasize < 4)
  ------------------
  |  Branch (924:9): [True: 278, False: 3.45k]
  ------------------
  925|    278|					break;
  926|  3.45k|				external_attributes
  927|  3.45k|				    = archive_le32dec(p + offset);
  928|  3.45k|				if (zip_entry->system == 3) {
  ------------------
  |  Branch (928:9): [True: 1.76k, False: 1.69k]
  ------------------
  929|  1.76k|					zip_entry->mode
  930|  1.76k|					    = external_attributes >> 16;
  931|  1.76k|				} else if (zip_entry->system == 0) {
  ------------------
  |  Branch (931:16): [True: 1.15k, False: 536]
  ------------------
  932|       |					// Interpret MSDOS directory bit
  933|  1.15k|					if (0x10 == (external_attributes &
  ------------------
  |  Branch (933:10): [True: 539, False: 619]
  ------------------
  934|  1.15k|					    0x10)) {
  935|    539|						zip_entry->mode =
  936|    539|						    AE_IFDIR | 0775;
  ------------------
  |  |  221|    539|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
  937|    619|					} else {
  938|    619|						zip_entry->mode =
  939|    619|						    AE_IFREG | 0664;
  ------------------
  |  |  216|    619|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
  940|    619|					}
  941|  1.15k|					if (0x01 == (external_attributes &
  ------------------
  |  Branch (941:10): [True: 460, False: 698]
  ------------------
  942|  1.15k|					    0x01)) {
  943|       |						/* Read-only bit;
  944|       |						 * strip write permissions */
  945|    460|						zip_entry->mode &= 0555;
  946|    460|					}
  947|  1.15k|				} else {
  948|    536|					zip_entry->mode = 0;
  949|    536|				}
  950|  3.45k|				offset += 4;
  951|  3.45k|				datasize -= 4;
  952|  3.45k|			}
  953|  3.81k|			if (bitmap & 8) {
  ------------------
  |  Branch (953:8): [True: 3.58k, False: 225]
  ------------------
  954|       |				/* 2 byte comment length + comment */
  955|  3.58k|				uint32_t comment_length;
  956|  3.58k|				if (datasize < 2)
  ------------------
  |  Branch (956:9): [True: 2.46k, False: 1.12k]
  ------------------
  957|  2.46k|					break;
  958|  1.12k|				comment_length
  959|  1.12k|				    = archive_le16dec(p + offset);
  960|  1.12k|				offset += 2;
  961|  1.12k|				datasize -= 2;
  962|       |
  963|  1.12k|				if (datasize < comment_length)
  ------------------
  |  Branch (963:9): [True: 885, False: 237]
  ------------------
  964|    885|					break;
  965|       |				/* Comment is not supported by libarchive */
  966|    237|				offset += comment_length;
  967|    237|				datasize -= comment_length;
  968|    237|			}
  969|    462|			break;
  970|  3.81k|		}
  971|    462|		case 0x7075:
  ------------------
  |  Branch (971:3): [True: 410, False: 24.9k]
  ------------------
  972|    410|		{
  973|       |			/* Info-ZIP Unicode Path Extra Field. */
  974|    410|			if (datasize < 5 || entry == NULL)
  ------------------
  |  Branch (974:8): [True: 234, False: 176]
  |  Branch (974:24): [True: 0, False: 176]
  ------------------
  975|    234|				break;
  976|    176|			offset += 5;
  977|    176|			datasize -= 5;
  978|       |
  979|       |			/* The path name in this field is always encoded
  980|       |			 * in UTF-8. */
  981|    176|			if (zip->sconv_utf8 == NULL) {
  ------------------
  |  Branch (981:8): [True: 14, False: 162]
  ------------------
  982|     14|				zip->sconv_utf8 =
  983|     14|					archive_string_conversion_from_charset(
  984|     14|					&a->archive, "UTF-8", 1);
  985|       |				/* If the converter from UTF-8 is not
  986|       |				 * available, then the path name from the main
  987|       |				 * field will more likely be correct. */
  988|     14|				if (zip->sconv_utf8 == NULL)
  ------------------
  |  Branch (988:9): [True: 0, False: 14]
  ------------------
  989|      0|					break;
  990|     14|			}
  991|       |
  992|       |			/* Make sure the CRC32 of the filename matches. */
  993|    176|			if (!zip->ignore_crc32) {
  ------------------
  |  Branch (993:8): [True: 0, False: 176]
  ------------------
  994|      0|				const char *cp = archive_entry_pathname(entry);
  995|      0|				if (cp) {
  ------------------
  |  Branch (995:9): [True: 0, False: 0]
  ------------------
  996|      0|					unsigned long file_crc =
  997|      0|					    zip->crc32func(0, cp, strlen(cp));
  998|      0|					unsigned long utf_crc =
  999|      0|					    archive_le32dec(p + offset - 4);
 1000|      0|					if (file_crc != utf_crc) {
  ------------------
  |  Branch (1000:10): [True: 0, False: 0]
  ------------------
 1001|       |#ifdef DEBUG
 1002|       |						fprintf(stderr,
 1003|       |						    "CRC filename mismatch; "
 1004|       |						    "CDE is %lx, but UTF8 "
 1005|       |						    "is outdated with %lx\n",
 1006|       |						    file_crc, utf_crc);
 1007|       |#endif
 1008|      0|						break;
 1009|      0|					}
 1010|      0|				}
 1011|      0|			}
 1012|       |
 1013|    176|			if (archive_entry_copy_pathname_l(entry,
  ------------------
  |  |   80|    176|#define archive_entry_copy_pathname_l	__archive_entry_copy_pathname_l
  ------------------
  |  Branch (1013:8): [True: 124, False: 52]
  ------------------
 1014|    176|			    p + offset, datasize, zip->sconv_utf8) != 0) {
 1015|       |				/* Ignore the error, and fallback to the path
 1016|       |				 * name from the main field. */
 1017|       |#ifdef DEBUG
 1018|       |				fprintf(stderr, "Failed to read the ZIP "
 1019|       |				    "0x7075 extra field path.\n");
 1020|       |#endif
 1021|    124|			}
 1022|    176|			break;
 1023|    176|		}
 1024|    683|		case 0x7855:
  ------------------
  |  Branch (1024:3): [True: 683, False: 24.7k]
  ------------------
 1025|       |			/* Info-ZIP Unix Extra Field (type 2) "Ux". */
 1026|       |#ifdef DEBUG
 1027|       |			fprintf(stderr, "uid %d gid %d\n",
 1028|       |			    archive_le16dec(p + offset),
 1029|       |			    archive_le16dec(p + offset + 2));
 1030|       |#endif
 1031|    683|			if (datasize >= 2)
  ------------------
  |  Branch (1031:8): [True: 311, False: 372]
  ------------------
 1032|    311|				zip_entry->uid = archive_le16dec(p + offset);
 1033|    683|			if (datasize >= 4)
  ------------------
  |  Branch (1033:8): [True: 253, False: 430]
  ------------------
 1034|    253|				zip_entry->gid =
 1035|    253|				    archive_le16dec(p + offset + 2);
 1036|    683|			break;
 1037|  3.27k|		case 0x7875:
  ------------------
  |  Branch (1037:3): [True: 3.27k, False: 22.1k]
  ------------------
 1038|  3.27k|		{
 1039|       |			/* Info-Zip Unix Extra Field (type 3) "ux". */
 1040|  3.27k|			int uidsize = 0, gidsize = 0;
 1041|       |
 1042|       |			/* TODO: support arbitrary uidsize/gidsize. */
 1043|  3.27k|			if (datasize >= 1 && p[offset] == 1) {/* version=1 */
  ------------------
  |  Branch (1043:8): [True: 3.21k, False: 54]
  |  Branch (1043:25): [True: 2.90k, False: 317]
  ------------------
 1044|  2.90k|				if (datasize >= 4) {
  ------------------
  |  Branch (1044:9): [True: 2.59k, False: 304]
  ------------------
 1045|       |					/* get a uid size. */
 1046|  2.59k|					uidsize = 0xff & (int)p[offset+1];
 1047|  2.59k|					if (uidsize == 2)
  ------------------
  |  Branch (1047:10): [True: 8, False: 2.59k]
  ------------------
 1048|      8|						zip_entry->uid =
 1049|      8|						    archive_le16dec(
 1050|      8|						        p + offset + 2);
 1051|  2.59k|					else if (uidsize == 4 && datasize >= 6)
  ------------------
  |  Branch (1051:15): [True: 1.11k, False: 1.47k]
  |  Branch (1051:31): [True: 1.09k, False: 13]
  ------------------
 1052|  1.09k|						zip_entry->uid =
 1053|  1.09k|						    archive_le32dec(
 1054|  1.09k|						        p + offset + 2);
 1055|  2.59k|				}
 1056|  2.90k|				if (datasize >= (2 + uidsize + 3)) {
  ------------------
  |  Branch (1056:9): [True: 2.32k, False: 573]
  ------------------
 1057|       |					/* get a gid size. */
 1058|  2.32k|					gidsize = 0xff &
 1059|  2.32k|					    (int)p[offset+2+uidsize];
 1060|  2.32k|					if (gidsize == 2)
  ------------------
  |  Branch (1060:10): [True: 1.04k, False: 1.28k]
  ------------------
 1061|  1.04k|						zip_entry->gid =
 1062|  1.04k|						    archive_le16dec(
 1063|  1.04k|						        p+offset+2+uidsize+1);
 1064|  1.28k|					else if (gidsize == 4 &&
  ------------------
  |  Branch (1064:15): [True: 892, False: 392]
  ------------------
 1065|    892|					    datasize >= (2 + uidsize + 5))
  ------------------
  |  Branch (1065:10): [True: 501, False: 391]
  ------------------
 1066|    501|						zip_entry->gid =
 1067|    501|						    archive_le32dec(
 1068|    501|						        p+offset+2+uidsize+1);
 1069|  2.32k|				}
 1070|  2.90k|			}
 1071|  3.27k|			break;
 1072|    176|		}
 1073|  5.59k|		case 0x9901:
  ------------------
  |  Branch (1073:3): [True: 5.59k, False: 19.7k]
  ------------------
 1074|       |			/* WinZip AES extra data field. */
 1075|  5.59k|			if (datasize < 6) {
  ------------------
  |  Branch (1075:8): [True: 1, False: 5.59k]
  ------------------
 1076|      1|				archive_set_error(&a->archive,
 1077|      1|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      1|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1078|      1|				    "Incomplete AES field");
 1079|      1|				return ARCHIVE_FAILED;
  ------------------
  |  |  237|      1|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1080|      1|			}
 1081|  5.59k|			if (p[offset + 2] == 'A' && p[offset + 3] == 'E') {
  ------------------
  |  Branch (1081:8): [True: 5.51k, False: 80]
  |  Branch (1081:32): [True: 5.44k, False: 69]
  ------------------
 1082|       |				/* Vendor version. */
 1083|  5.44k|				zip_entry->aes_extra.vendor =
 1084|  5.44k|				    archive_le16dec(p + offset);
 1085|       |				/* AES encryption strength. */
 1086|  5.44k|				zip_entry->aes_extra.strength = p[offset + 4];
 1087|       |				/* Actual compression method. */
 1088|  5.44k|				zip_entry->aes_extra.compression =
 1089|  5.44k|				    p[offset + 5];
 1090|  5.44k|			}
 1091|  5.59k|			break;
 1092|  5.96k|		default:
  ------------------
  |  Branch (1092:3): [True: 5.96k, False: 19.4k]
  ------------------
 1093|  5.96k|			break;
 1094|  25.3k|		}
 1095|  25.3k|		offset += datasize;
 1096|  25.3k|	}
 1097|  16.0k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  16.0k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1098|  16.1k|}
archive_read_support_format_zip.c:zip_read_data_deflate:
 2897|  5.06k|{
 2898|  5.06k|	struct zip *zip = a->format->data;
 2899|  5.06k|	ssize_t bytes_avail, max_in, to_consume = 0;
 2900|  5.06k|	const void *compressed_buff;
 2901|  5.06k|	const void *sp;
 2902|  5.06k|	int r;
 2903|       |
 2904|  5.06k|	(void)offset; /* UNUSED */
 2905|       |
 2906|       |	/* If the buffer hasn't been allocated, allocate it now. */
 2907|  5.06k|	if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (2907:6): [True: 274, False: 4.78k]
  ------------------
 2908|    274|		zip->uncompressed_buffer_size = 256 * 1024;
 2909|    274|		zip->uncompressed_buffer
 2910|    274|		    = malloc(zip->uncompressed_buffer_size);
 2911|    274|		if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (2911:7): [True: 0, False: 274]
  ------------------
 2912|      0|			archive_set_error(&a->archive, ENOMEM,
 2913|      0|			    "No memory for ZIP decompression");
 2914|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2915|      0|		}
 2916|    274|	}
 2917|       |
 2918|  5.06k|	r = zip_deflate_init(a, zip);
 2919|  5.06k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  5.06k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2919:6): [True: 0, False: 5.06k]
  ------------------
 2920|      0|		return (r);
 2921|       |
 2922|       |	/*
 2923|       |	 * Note: '1' here is a performance optimization.
 2924|       |	 * Recall that the decompression layer returns a count of
 2925|       |	 * available bytes; asking for more than that forces the
 2926|       |	 * decompressor to combine reads by copying data.
 2927|       |	 */
 2928|  5.06k|	compressed_buff = sp = __archive_read_ahead(a, 1, &bytes_avail);
 2929|  5.06k|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  129|  5.06k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (2929:6): [True: 1.03k, False: 4.02k]
  ------------------
 2930|  1.03k|	    && bytes_avail > zip->entry_bytes_remaining) {
  ------------------
  |  Branch (2930:9): [True: 338, False: 695]
  ------------------
 2931|    338|		bytes_avail = (ssize_t)zip->entry_bytes_remaining;
 2932|    338|	}
 2933|  5.06k|	if (bytes_avail < 0) {
  ------------------
  |  Branch (2933:6): [True: 0, False: 5.06k]
  ------------------
 2934|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2935|      0|		    "Truncated ZIP file body");
 2936|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2937|      0|	}
 2938|       |
 2939|  5.06k|	zip_read_decrypt(zip, compressed_buff, bytes_avail,
 2940|  5.06k|					 &compressed_buff, &bytes_avail, &sp);
 2941|       |
 2942|       |	/* stream.avail_in is a uInt, which is 32 bits wide even where
 2943|       |	 * ssize_t is 64 bits.  Clamp the available byte count so that a
 2944|       |	 * read-ahead window larger than 4 GiB is not truncated. */
 2945|  5.06k|	if (UINT_MAX >= SSIZE_MAX)
  ------------------
  |  Branch (2945:6): [Folded, False: 5.06k]
  ------------------
 2946|      0|		max_in = SSIZE_MAX;
 2947|  5.06k|	else
 2948|  5.06k|		max_in = UINT_MAX;
 2949|  5.06k|	if (bytes_avail > max_in)
  ------------------
  |  Branch (2949:6): [True: 0, False: 5.06k]
  ------------------
 2950|      0|		bytes_avail = max_in;
 2951|       |
 2952|       |	/*
 2953|       |	 * A bug in zlib.h: stream.next_in should be marked 'const'
 2954|       |	 * but isn't (the library never alters data through the
 2955|       |	 * next_in pointer, only reads it).  The result: this ugly
 2956|       |	 * cast to remove 'const'.
 2957|       |	 */
 2958|  5.06k|	zip->stream.next_in = (Bytef *)(uintptr_t)(const void *)compressed_buff;
 2959|  5.06k|	zip->stream.avail_in = (uInt)bytes_avail;
 2960|  5.06k|	zip->stream.total_in = 0;
 2961|  5.06k|	zip->stream.next_out = zip->uncompressed_buffer;
 2962|  5.06k|	zip->stream.avail_out = (uInt)zip->uncompressed_buffer_size;
 2963|  5.06k|	zip->stream.total_out = 0;
 2964|       |
 2965|  5.06k|	r = inflate(&zip->stream, 0);
 2966|  5.06k|	switch (r) {
 2967|    218|	case Z_OK:
  ------------------
  |  Branch (2967:2): [True: 218, False: 4.84k]
  ------------------
 2968|    218|		break;
 2969|  4.78k|	case Z_STREAM_END:
  ------------------
  |  Branch (2969:2): [True: 4.78k, False: 271]
  ------------------
 2970|  4.78k|		zip->end_of_entry = 1;
 2971|  4.78k|		break;
 2972|      0|	case Z_MEM_ERROR:
  ------------------
  |  Branch (2972:2): [True: 0, False: 5.06k]
  ------------------
 2973|      0|		archive_set_error(&a->archive, ENOMEM,
 2974|      0|		    "Out of memory for ZIP decompression");
 2975|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2976|     53|	default:
  ------------------
  |  Branch (2976:2): [True: 53, False: 5.00k]
  ------------------
 2977|     53|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     53|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2978|     53|		    "ZIP decompression failed (%d)", r);
 2979|     53|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     53|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2980|  5.06k|	}
 2981|       |
 2982|       |	/* Consume as much as the compressor actually used. */
 2983|  5.00k|	to_consume = zip->stream.total_in;
 2984|  5.00k|	__archive_read_consume(a, to_consume);
 2985|  5.00k|	zip->entry_bytes_remaining -= to_consume;
 2986|  5.00k|	zip->entry_compressed_bytes_read += to_consume;
 2987|  5.00k|	zip->entry_uncompressed_bytes_read += zip->stream.total_out;
 2988|       |
 2989|  5.00k|	zip_read_decrypt_update(zip, to_consume, sp);
 2990|       |
 2991|  5.00k|	if (zip->end_of_entry && zip->hctx_valid) {
  ------------------
  |  Branch (2991:6): [True: 4.78k, False: 218]
  |  Branch (2991:27): [True: 3.06k, False: 1.72k]
  ------------------
 2992|  3.06k|		r = check_authentication_code(a, NULL);
 2993|  3.06k|		if (r != ARCHIVE_OK) {
  ------------------
  |  |  233|  3.06k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2993:7): [True: 1.12k, False: 1.94k]
  ------------------
 2994|  1.12k|			return r;
 2995|  1.12k|		}
 2996|  3.06k|	}
 2997|       |
 2998|  3.88k|	*size = zip->stream.total_out;
 2999|  3.88k|	*buff = zip->uncompressed_buffer;
 3000|       |
 3001|  3.88k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.88k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3002|  5.00k|}
archive_read_support_format_zip.c:zip_deflate_init:
 2871|  5.06k|{
 2872|  5.06k|	int r;
 2873|       |
 2874|       |	/* If we haven't yet read any data, initialize the decompressor. */
 2875|  5.06k|	if (!zip->decompress_init) {
  ------------------
  |  Branch (2875:6): [True: 4.95k, False: 105]
  ------------------
 2876|  4.95k|		if (zip->stream_valid)
  ------------------
  |  Branch (2876:7): [True: 4.63k, False: 323]
  ------------------
 2877|  4.63k|			r = inflateReset(&zip->stream);
 2878|    323|		else
 2879|    323|			r = inflateInit2(&zip->stream,
 2880|  4.95k|			    -15 /* Don't check for zlib header */);
 2881|  4.95k|		if (r != Z_OK) {
  ------------------
  |  Branch (2881:7): [True: 0, False: 4.95k]
  ------------------
 2882|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2883|      0|			    "Can't initialize ZIP decompression");
 2884|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2885|      0|		}
 2886|       |		/* Stream structure has been set up. */
 2887|  4.95k|		zip->stream_valid = 1;
 2888|       |		/* We've initialized decompression for this stream. */
 2889|  4.95k|		zip->decompress_init = 1;
 2890|  4.95k|	}
 2891|  5.06k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  5.06k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2892|  5.06k|}
archive_read_support_format_zip.c:zip_read_decrypt:
  490|  8.03k|{
  491|  8.03k|	*sp = compressed_buff;
  492|       |
  493|       |	/* Safety check to prevent potential OOB reads if something went wrong
  494|       |	 * previously. We should not have a negative bytes_avail count here.
  495|       |	 * If we do, set them to zero so that reading the ZIP will fail later,
  496|       |	 * safely as corrupted instead of crashing. */
  497|  8.03k|	if (bytes_avail < 0)
  ------------------
  |  Branch (497:6): [True: 0, False: 8.03k]
  ------------------
  498|      0|		bytes_avail = 0;
  499|       |
  500|  8.03k|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (500:6): [True: 184, False: 7.84k]
  |  Branch (500:25): [True: 3.08k, False: 4.76k]
  ------------------
  501|  3.26k|		if (zip->decrypted_bytes_remaining < (size_t)bytes_avail) {
  ------------------
  |  Branch (501:7): [True: 3.25k, False: 14]
  ------------------
  502|  3.25k|			size_t buff_remaining =
  503|  3.25k|			    (zip->decrypted_buffer +
  504|  3.25k|			    zip->decrypted_buffer_size)
  505|  3.25k|			    - (zip->decrypted_ptr +
  506|  3.25k|			    zip->decrypted_bytes_remaining);
  507|       |			/* The new bytes to decrypt start after decrypted_bytes_remaining
  508|       |			 * in the raw stream: those leading bytes were already
  509|       |			 * decrypted on a previous call but have not yet been consumed. */
  510|  3.25k|			size_t new_bytes =
  511|  3.25k|			    (size_t)bytes_avail
  512|  3.25k|			    - zip->decrypted_bytes_remaining;
  513|       |
  514|  3.25k|			if (buff_remaining > new_bytes)
  ------------------
  |  Branch (514:8): [True: 2.80k, False: 442]
  ------------------
  515|  2.80k|				buff_remaining = new_bytes;
  516|       |
  517|  3.25k|			if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END) &&
  ------------------
  |  |  129|  3.25k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (517:8): [True: 279, False: 2.97k]
  ------------------
  518|    279|			      zip->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (518:10): [True: 279, False: 0]
  ------------------
  519|    279|				if ((int64_t)(zip->decrypted_bytes_remaining
  ------------------
  |  Branch (519:9): [True: 0, False: 279]
  ------------------
  520|    279|				    + buff_remaining)
  521|    279|				      > zip->entry_bytes_remaining) {
  522|      0|					if (zip->entry_bytes_remaining <
  ------------------
  |  Branch (522:10): [True: 0, False: 0]
  ------------------
  523|      0|					    (int64_t)zip->decrypted_bytes_remaining)
  524|      0|						buff_remaining = 0;
  525|      0|					else
  526|      0|						buff_remaining =
  527|      0|						    (size_t)zip->entry_bytes_remaining
  528|      0|						    - zip->decrypted_bytes_remaining;
  529|      0|				}
  530|    279|			}
  531|  3.25k|			if (buff_remaining > 0) {
  ------------------
  |  Branch (531:8): [True: 3.25k, False: 0]
  ------------------
  532|  3.25k|				if (zip->tctx_valid) {
  ------------------
  |  Branch (532:9): [True: 177, False: 3.07k]
  ------------------
  533|    177|					trad_enc_decrypt_update(&zip->tctx,
  534|    177|					    (const uint8_t *)compressed_buff
  535|    177|					      + zip->decrypted_bytes_remaining,
  536|    177|					    buff_remaining,
  537|    177|					    zip->decrypted_ptr
  538|    177|					      + zip->decrypted_bytes_remaining,
  539|    177|					    buff_remaining);
  540|  3.07k|				} else {
  541|  3.07k|					size_t dsize = buff_remaining;
  542|  3.07k|					archive_decrypto_aes_ctr_update(
  ------------------
  |  |  154|  3.07k|  __archive_cryptor.decrypto_aes_ctr_update(ctx, in, in_len, out, out_len)
  ------------------
  543|  3.07k|					    &zip->cctx,
  544|  3.07k|					    (const uint8_t *)compressed_buff
  545|  3.07k|					      + zip->decrypted_bytes_remaining,
  546|  3.07k|					    buff_remaining,
  547|  3.07k|					    zip->decrypted_ptr
  548|  3.07k|					      + zip->decrypted_bytes_remaining,
  549|  3.07k|					    &dsize);
  550|  3.07k|				}
  551|  3.25k|				zip->decrypted_bytes_remaining +=
  552|  3.25k|				    buff_remaining;
  553|  3.25k|			}
  554|  3.25k|		}
  555|  3.26k|		*result_avail = zip->decrypted_bytes_remaining;
  556|  3.26k|		*result_buff = (const char *)zip->decrypted_ptr;
  557|  4.76k|	} else {
  558|  4.76k|		*result_buff = compressed_buff;
  559|  4.76k|		*result_avail = bytes_avail;
  560|  4.76k|	}
  561|  8.03k|}
archive_read_support_format_zip.c:trad_enc_decrypt_update:
  360|  20.6k|{
  361|  20.6k|	unsigned i, max;
  362|       |
  363|  20.6k|	max = (unsigned)((in_len < out_len)? in_len: out_len);
  ------------------
  |  Branch (363:19): [True: 0, False: 20.6k]
  ------------------
  364|       |
  365|  2.39M|	for (i = 0; i < max; i++) {
  ------------------
  |  Branch (365:14): [True: 2.37M, False: 20.6k]
  ------------------
  366|  2.37M|		uint8_t t = in[i] ^ trad_enc_decrypt_byte(ctx);
  367|  2.37M|		out[i] = t;
  368|  2.37M|		trad_enc_update_keys(ctx, t);
  369|  2.37M|	}
  370|  20.6k|}
archive_read_support_format_zip.c:trad_enc_decrypt_byte:
  352|  2.37M|{
  353|  2.37M|	unsigned temp = ctx->keys[2] | 2;
  354|  2.37M|	return (uint8_t)((temp * (temp ^ 1)) >> 8) & 0xff;
  355|  2.37M|}
archive_read_support_format_zip.c:trad_enc_update_keys:
  339|  2.38M|{
  340|  2.38M|	uint8_t t;
  341|  2.38M|#define CRC32(c, b) (__archive_crc32(c ^ 0xffffffffUL, &b, 1) ^ 0xffffffffUL)
  342|       |
  343|  2.38M|	ctx->keys[0] = CRC32(ctx->keys[0], c);
  ------------------
  |  |  341|  2.38M|#define CRC32(c, b) (__archive_crc32(c ^ 0xffffffffUL, &b, 1) ^ 0xffffffffUL)
  ------------------
  344|  2.38M|	ctx->keys[1] = (ctx->keys[1] + (ctx->keys[0] & 0xff)) * 134775813L + 1;
  345|  2.38M|	t = (ctx->keys[1] >> 24) & 0xff;
  346|  2.38M|	ctx->keys[2] = CRC32(ctx->keys[2], t);
  ------------------
  |  |  341|  2.38M|#define CRC32(c, b) (__archive_crc32(c ^ 0xffffffffUL, &b, 1) ^ 0xffffffffUL)
  ------------------
  347|  2.38M|#undef CRC32
  348|  2.38M|}
archive_read_support_format_zip.c:zip_read_decrypt_update:
  568|  7.88k|{
  569|  7.88k|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (569:6): [True: 177, False: 7.70k]
  |  Branch (569:25): [True: 3.07k, False: 4.63k]
  ------------------
  570|  3.24k|		zip->decrypted_bytes_remaining -= to_consume;
  571|  3.24k|		if (zip->decrypted_bytes_remaining == 0)
  ------------------
  |  Branch (571:7): [True: 76, False: 3.17k]
  ------------------
  572|     76|			zip->decrypted_ptr = zip->decrypted_buffer;
  573|  3.17k|		else
  574|  3.17k|			zip->decrypted_ptr += to_consume;
  575|  3.24k|	}
  576|  7.88k|	if (zip->hctx_valid)
  ------------------
  |  Branch (576:6): [True: 3.07k, False: 4.81k]
  ------------------
  577|  3.07k|		archive_hmac_sha1_update(&zip->hctx, sp, to_consume);
  ------------------
  |  |   91|  3.07k|	__archive_hmac.__hmac_sha1_update(ctx, data, data_len)
  ------------------
  578|  7.88k|}
archive_read_support_format_zip.c:check_authentication_code:
 1486|  3.57k|{
 1487|  3.57k|	struct zip *zip = a->format->data;
 1488|       |
 1489|       |	/* Check authentication code. */
 1490|  3.57k|	if (zip->hctx_valid) {
  ------------------
  |  Branch (1490:6): [True: 3.57k, False: 0]
  ------------------
 1491|  3.57k|		const void *p;
 1492|  3.57k|		uint8_t hmac[20];
 1493|  3.57k|		size_t hmac_len = 20;
 1494|  3.57k|		int cmp;
 1495|       |
 1496|  3.57k|		archive_hmac_sha1_final(&zip->hctx, hmac, &hmac_len);
  ------------------
  |  |   93|  3.57k|  	__archive_hmac.__hmac_sha1_final(ctx, out, out_len)
  ------------------
 1497|  3.57k|		if (_p == NULL) {
  ------------------
  |  Branch (1497:7): [True: 3.48k, False: 89]
  ------------------
 1498|       |			/* Read authentication code. */
 1499|  3.48k|			p = __archive_read_ahead(a, AUTH_CODE_SIZE, NULL);
  ------------------
  |  |  147|  3.48k|#define AUTH_CODE_SIZE	10
  ------------------
 1500|  3.48k|			if (p == NULL) {
  ------------------
  |  Branch (1500:8): [True: 4, False: 3.47k]
  ------------------
 1501|      4|				archive_set_error(&a->archive,
 1502|      4|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1503|      4|				    "Truncated ZIP file data");
 1504|      4|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1505|      4|			}
 1506|  3.48k|		} else {
 1507|     89|			p = _p;
 1508|     89|		}
 1509|  3.56k|		cmp = memcmp(hmac, p, AUTH_CODE_SIZE);
  ------------------
  |  |  147|  3.56k|#define AUTH_CODE_SIZE	10
  ------------------
 1510|  3.56k|		__archive_read_consume(a, AUTH_CODE_SIZE);
  ------------------
  |  |  147|  3.56k|#define AUTH_CODE_SIZE	10
  ------------------
 1511|  3.56k|		if (cmp != 0) {
  ------------------
  |  Branch (1511:7): [True: 1.38k, False: 2.18k]
  ------------------
 1512|  1.38k|			archive_set_error(&a->archive,
 1513|  1.38k|			    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  1.38k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1514|  1.38k|			    "ZIP bad Authentication code");
 1515|  1.38k|			return (ARCHIVE_WARN);
  ------------------
  |  |  235|  1.38k|#define	ARCHIVE_WARN	(-20)	/* Partial success. */
  ------------------
 1516|  1.38k|		}
 1517|  3.56k|	}
 1518|  2.18k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.18k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1519|  3.57k|}
archive_read_support_format_zip.c:zip_read_data_zipx_lzma_alone:
 2228|  2.62k|{
 2229|  2.62k|	struct zip *zip = a->format->data;
 2230|  2.62k|	int ret;
 2231|  2.62k|	lzma_ret lz_ret;
 2232|  2.62k|	const void* compressed_buf;
 2233|  2.62k|	const void* sp;
 2234|  2.62k|	ssize_t bytes_avail, to_consume;
 2235|       |
 2236|  2.62k|	(void) offset; /* UNUSED */
 2237|       |
 2238|       |	/* Initialize decompressor if not yet initialized. */
 2239|  2.62k|	if (!zip->decompress_init) {
  ------------------
  |  Branch (2239:6): [True: 1.32k, False: 1.29k]
  ------------------
 2240|  1.32k|		ret = zipx_lzma_alone_init(a, zip);
 2241|  1.32k|		if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|  1.32k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2241:7): [True: 28, False: 1.29k]
  ------------------
 2242|     28|			return (ret);
 2243|  1.32k|	}
 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|  2.59k|	compressed_buf = __archive_read_ahead(a, 1, &bytes_avail);
 2254|  2.59k|	if (zip->entry_bytes_remaining > 0
  ------------------
  |  Branch (2254:6): [True: 2.46k, False: 137]
  ------------------
 2255|  2.46k|		&& bytes_avail > zip->entry_bytes_remaining) {
  ------------------
  |  Branch (2255:6): [True: 1.34k, False: 1.11k]
  ------------------
 2256|  1.34k|		bytes_avail = (ssize_t)zip->entry_bytes_remaining;
 2257|  1.34k|	}
 2258|  2.59k|	if (bytes_avail < 0) {
  ------------------
  |  Branch (2258:6): [True: 0, False: 2.59k]
  ------------------
 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|  2.59k|	zip_read_decrypt(zip, compressed_buf, bytes_avail,
 2265|  2.59k|	    &compressed_buf, &bytes_avail, &sp);
 2266|       |
 2267|  2.59k|	zip->zipx_lzma_stream.next_in = compressed_buf;
 2268|  2.59k|	zip->zipx_lzma_stream.avail_in = bytes_avail;
 2269|  2.59k|	zip->zipx_lzma_stream.total_in = 0;
 2270|  2.59k|	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|  2.59k|	if (zip->entry_bytes_remaining <= 0) {
  ------------------
  |  Branch (2278:6): [True: 137, False: 2.46k]
  ------------------
 2279|    137|		zip->zipx_lzma_stream.avail_out = zip->uncompressed_buffer_size;
 2280|  2.46k|	} else {
 2281|  2.46k|		zip->zipx_lzma_stream.avail_out =
 2282|  2.46k|			(size_t)zipmin((int64_t) zip->uncompressed_buffer_size,
  ------------------
  |  |  261|  2.46k|#define	zipmin(a,b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (261:22): [True: 226, False: 2.23k]
  |  |  ------------------
  ------------------
 2283|  2.46k|			    zip->entry->uncompressed_size -
 2284|  2.46k|			    zip->entry_uncompressed_bytes_read);
 2285|  2.46k|	}
 2286|  2.59k|	zip->zipx_lzma_stream.total_out = 0;
 2287|       |
 2288|       |	/* Perform the decompression. */
 2289|  2.59k|	lz_ret = lzma_code(&zip->zipx_lzma_stream, LZMA_RUN);
 2290|  2.59k|	switch(lz_ret) {
 2291|     13|		case LZMA_DATA_ERROR:
  ------------------
  |  Branch (2291:3): [True: 13, False: 2.58k]
  ------------------
 2292|     13|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     13|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2293|     13|			    "lzma data error (%d)", (int) lz_ret);
 2294|     13|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     13|#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|    443|		case LZMA_STREAM_END:
  ------------------
  |  Branch (2298:3): [True: 443, False: 2.15k]
  ------------------
 2299|       |			/* This assertion is only possible if the size of the
 2300|       |			 * compressed data stream is known. */
 2301|    443|			if((int64_t) zip->zipx_lzma_stream.total_in !=
  ------------------
  |  Branch (2301:7): [True: 24, False: 419]
  ------------------
 2302|    443|			    zip->entry_bytes_remaining
 2303|     24|			    && zip->entry_bytes_remaining > 0)
  ------------------
  |  Branch (2303:11): [True: 4, False: 20]
  ------------------
 2304|      4|			{
 2305|      4|				archive_set_error(&a->archive,
 2306|      4|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      4|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2307|      4|				    "lzma alone premature end of stream");
 2308|      4|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2309|      4|			}
 2310|       |
 2311|    439|			zip->end_of_entry = 1;
 2312|    439|			break;
 2313|       |
 2314|  1.51k|		case LZMA_OK:
  ------------------
  |  Branch (2314:3): [True: 1.51k, False: 1.08k]
  ------------------
 2315|  1.51k|			break;
 2316|       |
 2317|    631|		case LZMA_BUF_ERROR:
  ------------------
  |  Branch (2317:3): [True: 631, False: 1.96k]
  ------------------
 2318|    631|			if (zip->zipx_lzma_stream.avail_out == 0) {
  ------------------
  |  Branch (2318:8): [True: 606, False: 25]
  ------------------
 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|    606|				if (zip->entry_bytes_remaining > 0)
  ------------------
  |  Branch (2324:9): [True: 606, False: 0]
  ------------------
 2325|    606|					zip->end_of_entry = 1;
 2326|    606|				break;
 2327|    606|			}
 2328|       |			/* FALL THROUGH */
 2329|     25|		default:
  ------------------
  |  Branch (2329:3): [True: 0, False: 2.59k]
  ------------------
 2330|     25|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     25|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2331|     25|			    "lzma unknown error (%d)", (int) lz_ret);
 2332|     25|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     25|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2333|  2.59k|	}
 2334|       |
 2335|  2.55k|	to_consume = (ssize_t)zip->zipx_lzma_stream.total_in;
 2336|       |
 2337|       |	/* Update pointers. */
 2338|  2.55k|	__archive_read_consume(a, to_consume);
 2339|  2.55k|	zip->entry_compressed_bytes_read += to_consume;
 2340|  2.55k|	zip->entry_uncompressed_bytes_read += zip->zipx_lzma_stream.total_out;
 2341|       |
 2342|  2.55k|	zip_read_decrypt_update(zip, to_consume, sp);
 2343|       |
 2344|  2.55k|	if(zip->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (2344:5): [True: 2.42k, False: 130]
  ------------------
 2345|  2.42k|		zip->entry_bytes_remaining -= to_consume;
 2346|  2.42k|		if(zip->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (2346:6): [True: 558, False: 1.86k]
  ------------------
 2347|    558|			zip->end_of_entry = 1;
 2348|    558|		}
 2349|  2.42k|	}
 2350|       |
 2351|  2.55k|	if(zip->end_of_entry && zip->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (2351:5): [True: 1.18k, False: 1.37k]
  |  Branch (2351:26): [True: 606, False: 578]
  ------------------
 2352|    606|		ssize_t remaining = (ssize_t)zip->entry_bytes_remaining;
 2353|    606|		const void *p = __archive_read_ahead(a, remaining, NULL);
 2354|    606|		if (p != NULL) {
  ------------------
  |  Branch (2354:7): [True: 262, False: 344]
  ------------------
 2355|    262|			if (zip->hctx_valid)
  ------------------
  |  Branch (2355:8): [True: 0, False: 262]
  ------------------
 2356|      0|				archive_hmac_sha1_update(&zip->hctx,
  ------------------
  |  |   91|      0|	__archive_hmac.__hmac_sha1_update(ctx, data, data_len)
  ------------------
 2357|    262|				    p, remaining);
 2358|    262|			__archive_read_consume(a, remaining);
 2359|    262|			zip->entry_compressed_bytes_read += remaining;
 2360|    262|			zip->entry_bytes_remaining = 0;
 2361|    262|		}
 2362|    606|	}
 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|  2.55k|	if(zip->end_of_entry) {
  ------------------
  |  Branch (2367:5): [True: 1.18k, False: 1.37k]
  ------------------
 2368|  1.18k|		lzma_end(&zip->zipx_lzma_stream);
 2369|  1.18k|		zip->zipx_lzma_valid = 0;
 2370|       |
 2371|  1.18k|		if (zip->hctx_valid) {
  ------------------
  |  Branch (2371:7): [True: 0, False: 1.18k]
  ------------------
 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|  1.18k|	}
 2377|       |
 2378|       |	/* Return values. */
 2379|  2.55k|	*size = (size_t)zip->zipx_lzma_stream.total_out;
 2380|  2.55k|	*buff = zip->uncompressed_buffer;
 2381|       |
 2382|       |	/* If we're here, then we're good! */
 2383|  2.55k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  2.55k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2384|  2.55k|}
archive_read_support_format_zip.c:zipx_lzma_alone_init:
 1961|  1.32k|{
 1962|  1.32k|	lzma_ret r;
 1963|  1.32k|	const uint8_t* p;
 1964|       |
 1965|  1.32k|#pragma pack(push)
 1966|  1.32k|#pragma pack(1)
 1967|  1.32k|	struct _alone_header {
 1968|  1.32k|	    uint8_t bytes[5];
 1969|  1.32k|	    uint64_t uncompressed_size;
 1970|  1.32k|	} alone_header;
 1971|  1.32k|#pragma pack(pop)
 1972|       |
 1973|  1.32k|	if(zip->zipx_lzma_valid) {
  ------------------
  |  Branch (1973:5): [True: 68, False: 1.25k]
  ------------------
 1974|     68|		lzma_end(&zip->zipx_lzma_stream);
 1975|     68|		zip->zipx_lzma_valid = 0;
 1976|     68|	}
 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|  1.32k|	memset(&zip->zipx_lzma_stream, 0, sizeof(zip->zipx_lzma_stream));
 1986|  1.32k|	r = lzma_alone_decoder(&zip->zipx_lzma_stream, 576 * ((uint64_t)1 << 20));
 1987|  1.32k|	if (r != LZMA_OK) {
  ------------------
  |  Branch (1987:6): [True: 0, False: 1.32k]
  ------------------
 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|  1.32k|	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|  1.32k|	if(zip->entry_bytes_remaining > 0
  ------------------
  |  Branch (2041:5): [True: 1.32k, False: 5]
  ------------------
 2042|  1.32k|		&& zip->entry_bytes_remaining < 9) {
  ------------------
  |  Branch (2042:6): [True: 2, False: 1.32k]
  ------------------
 2043|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2044|      2|		    "Truncated lzma data");
 2045|      2|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2046|      2|	}
 2047|       |
 2048|  1.32k|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (2048:6): [True: 2, False: 1.32k]
  |  Branch (2048:25): [True: 1, False: 1.32k]
  ------------------
 2049|      3|		const void *decrypted;
 2050|      3|		size_t out_len;
 2051|      3|		size_t consumed;
 2052|      3|		int ret;
 2053|       |
 2054|      3|		ret = zipx_read_header_and_decrypt(a, &decrypted, 9, &out_len, &consumed);
 2055|      3|		if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2055:7): [True: 1, False: 2]
  ------------------
 2056|      1|			return ret;
 2057|      2|		p = decrypted;
 2058|  1.32k|	} else {
 2059|  1.32k|		p = __archive_read_ahead(a, 9, NULL);
 2060|  1.32k|		if (p == NULL) {
  ------------------
  |  Branch (2060:7): [True: 2, False: 1.32k]
  ------------------
 2061|      2|			archive_set_error(&a->archive,
 2062|      2|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2063|      2|			    "Truncated lzma data");
 2064|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2065|      2|		}
 2066|  1.32k|	}
 2067|       |
 2068|  1.32k|	if(p[2] != 0x05 || p[3] != 0x00) {
  ------------------
  |  Branch (2068:5): [True: 18, False: 1.30k]
  |  Branch (2068:21): [True: 0, False: 1.30k]
  ------------------
 2069|     18|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     18|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2070|     18|		    "Invalid lzma data");
 2071|     18|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     18|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2072|     18|	}
 2073|       |
 2074|       |	/* Prepare an lzma alone header: copy the lzma_params blob into
 2075|       |	 * a proper place into the lzma alone header. */
 2076|  1.30k|	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|  1.30k|	alone_header.uncompressed_size = UINT64_MAX;
 2081|       |
 2082|  1.30k|	if(!zip->uncompressed_buffer) {
  ------------------
  |  Branch (2082:5): [True: 117, False: 1.18k]
  ------------------
 2083|    117|		zip->uncompressed_buffer_size = 256 * 1024;
 2084|    117|		zip->uncompressed_buffer = malloc(zip->uncompressed_buffer_size);
 2085|       |
 2086|    117|		if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (2086:7): [True: 0, False: 117]
  ------------------
 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|    117|	}
 2092|       |
 2093|  1.30k|	zip->zipx_lzma_stream.next_in = (void*) &alone_header;
 2094|  1.30k|	zip->zipx_lzma_stream.avail_in = sizeof(alone_header);
 2095|  1.30k|	zip->zipx_lzma_stream.total_in = 0;
 2096|  1.30k|	zip->zipx_lzma_stream.next_out = zip->uncompressed_buffer;
 2097|  1.30k|	zip->zipx_lzma_stream.avail_out = zip->uncompressed_buffer_size;
 2098|  1.30k|	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|  1.30k|	r = lzma_code(&zip->zipx_lzma_stream, LZMA_RUN);
 2104|  1.30k|	if (r != LZMA_OK) {
  ------------------
  |  Branch (2104:6): [True: 5, False: 1.29k]
  ------------------
 2105|      5|		if (r == LZMA_MEMLIMIT_ERROR)
  ------------------
  |  Branch (2105:7): [True: 1, False: 4]
  ------------------
 2106|      1|			archive_set_error(&a->archive, ENOMEM,
 2107|      1|			    "lzma stream requires too much memory");
 2108|      4|		else
 2109|      4|			archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER,
  ------------------
  |  |  200|      4|#define	ARCHIVE_ERRNO_PROGRAMMER EINVAL
  ------------------
 2110|      4|			    "lzma stream initialization error");
 2111|      5|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      5|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2112|      5|	}
 2113|       |
 2114|       |	/* We've already consumed some bytes, so take this into account. */
 2115|  1.29k|	__archive_read_consume(a, 9);
 2116|  1.29k|	zip->entry_compressed_bytes_read += 9;
 2117|  1.29k|	if (zip->entry_bytes_remaining > 0) {
  ------------------
  |  Branch (2117:6): [True: 1.29k, False: 4]
  ------------------
 2118|  1.29k|		zip->entry_bytes_remaining -= 9;
 2119|  1.29k|	}
 2120|       |
 2121|  1.29k|	zip->decompress_init = 1;
 2122|  1.29k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.29k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2123|  1.30k|}
archive_read_support_format_zip.c:zipx_read_header_and_decrypt:
  440|    268|{
  441|    268|	struct zip *zip = a->format->data;
  442|    268|	const void *raw;
  443|    268|	ssize_t bytes_avail;
  444|    268|	size_t to_decrypt;
  445|       |
  446|    268|	raw = __archive_read_ahead(a, in_len, &bytes_avail);
  447|    268|	if (raw == NULL || bytes_avail < (ssize_t)in_len) {
  ------------------
  |  Branch (447:6): [True: 2, False: 266]
  |  Branch (447:21): [True: 0, False: 266]
  ------------------
  448|      2|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
  449|      2|		    "Truncated ZIP file data");
  450|      2|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
  451|      2|	}
  452|       |
  453|    266|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (453:6): [True: 42, False: 224]
  |  Branch (453:25): [True: 224, False: 0]
  ------------------
  454|    266|		to_decrypt = in_len;
  455|    266|		if (to_decrypt > zip->decrypted_buffer_size)
  ------------------
  |  Branch (455:7): [True: 0, False: 266]
  ------------------
  456|      0|			to_decrypt = zip->decrypted_buffer_size;
  457|       |
  458|    266|		if (zip->tctx_valid) {
  ------------------
  |  Branch (458:7): [True: 42, False: 224]
  ------------------
  459|     42|			trad_enc_decrypt_update(&zip->tctx,
  460|     42|			    raw, to_decrypt,
  461|     42|			    zip->decrypted_buffer, to_decrypt);
  462|    224|		} else {
  463|    224|			size_t dsize = to_decrypt;
  464|    224|			archive_decrypto_aes_ctr_update(&zip->cctx,
  ------------------
  |  |  154|    224|  __archive_cryptor.decrypto_aes_ctr_update(ctx, in, in_len, out, out_len)
  ------------------
  465|    224|			    raw, to_decrypt,
  466|    224|			    zip->decrypted_buffer, &dsize);
  467|    224|		}
  468|    266|		if (zip->hctx_valid)
  ------------------
  |  Branch (468:7): [True: 224, False: 42]
  ------------------
  469|    224|			archive_hmac_sha1_update(&zip->hctx,
  ------------------
  |  |   91|    224|	__archive_hmac.__hmac_sha1_update(ctx, data, data_len)
  ------------------
  470|    266|			    raw, to_decrypt);
  471|       |
  472|    266|		*buf = zip->decrypted_buffer;
  473|    266|		*out_len = to_decrypt;
  474|    266|		*consumed = to_decrypt;
  475|    266|	} else {
  476|      0|		*buf = raw;
  477|      0|		*out_len = in_len;
  478|      0|		*consumed = in_len;
  479|      0|	}
  480|    266|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    266|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  481|    268|}
archive_read_support_format_zip.c:compression_name:
  638|  43.5k|{
  639|  43.5k|	static const int num_compression_methods =
  640|  43.5k|		sizeof(compression_methods)/sizeof(compression_methods[0]);
  641|  43.5k|	int i=0;
  642|       |
  643|   754k|	while(compression >= 0 && i < num_compression_methods) {
  ------------------
  |  Branch (643:8): [True: 754k, False: 0]
  |  Branch (643:28): [True: 750k, False: 3.27k]
  ------------------
  644|   750k|		if (compression_methods[i].id == compression)
  ------------------
  |  Branch (644:7): [True: 40.3k, False: 710k]
  ------------------
  645|  40.3k|			return compression_methods[i].name;
  646|   710k|		i++;
  647|   710k|	}
  648|  3.27k|	return "??";
  649|  43.5k|}
archive_read_support_format_zip.c:zip_entry_size_is_set:
  266|  54.4k|{
  267|  54.4k|	return (0 == (zip_entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  129|  54.4k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (267:10): [True: 22.1k, False: 32.3k]
  ------------------
  268|  32.3k|	    || (zip_entry->uncompressed_size > 0
  ------------------
  |  Branch (268:10): [True: 20.7k, False: 11.6k]
  ------------------
  269|  20.7k|		&& zip_entry->uncompressed_size != 0xffffffff));
  ------------------
  |  Branch (269:6): [True: 20.6k, False: 152]
  ------------------
  270|  54.4k|}
archive_read_support_format_zip.c:archive_read_format_zip_read_data:
 3386|  54.3k|{
 3387|  54.3k|	struct zip *zip = a->format->data;
 3388|  54.3k|	int r;
 3389|       |
 3390|  54.3k|	if (zip->has_encrypted_entries ==
  ------------------
  |  Branch (3390:6): [True: 0, False: 54.3k]
  ------------------
 3391|  54.3k|			ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW) {
  ------------------
  |  |  411|  54.3k|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 3392|      0|		zip->has_encrypted_entries = 0;
 3393|      0|	}
 3394|       |
 3395|  54.3k|	*offset = zip->entry_uncompressed_bytes_read;
 3396|  54.3k|	*size = 0;
 3397|  54.3k|	*buff = NULL;
 3398|       |
 3399|       |	/* If we hit end-of-entry last time, return ARCHIVE_EOF. */
 3400|  54.3k|	if (zip->end_of_entry)
  ------------------
  |  Branch (3400:6): [True: 13.9k, False: 40.4k]
  ------------------
 3401|  13.9k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  13.9k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3402|       |
 3403|       |	/* Return EOF immediately if this is a non-regular file. */
 3404|  40.4k|	if (AE_IFREG != (zip->entry->mode & AE_IFMT))
  ------------------
  |  |  216|  40.4k|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
              	if (AE_IFREG != (zip->entry->mode & AE_IFMT))
  ------------------
  |  |  215|  40.4k|#define AE_IFMT		((__LA_MODE_T)0170000)
  ------------------
  |  Branch (3404:6): [True: 1.38k, False: 39.0k]
  ------------------
 3405|  1.38k|		return (ARCHIVE_EOF);
  ------------------
  |  |  232|  1.38k|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 3406|       |
 3407|  39.0k|	__archive_read_consume(a, zip->unconsumed);
 3408|  39.0k|	zip->unconsumed = 0;
 3409|       |
 3410|  39.0k|	if (zip->init_decryption) {
  ------------------
  |  Branch (3410:6): [True: 9.08k, False: 29.9k]
  ------------------
 3411|  9.08k|		zip->has_encrypted_entries = 1;
 3412|  9.08k|		if (zip->entry->zip_flags & ZIP_STRONG_ENCRYPTED)
  ------------------
  |  |  130|  9.08k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
  |  Branch (3412:7): [True: 1.38k, False: 7.70k]
  ------------------
 3413|  1.38k|			r = read_decryption_header(a);
 3414|  7.70k|		else if (zip->entry->compression == WINZIP_AES_ENCRYPTION)
  ------------------
  |  |  145|  7.70k|#define WINZIP_AES_ENCRYPTION	99
  ------------------
  |  Branch (3414:12): [True: 5.45k, False: 2.24k]
  ------------------
 3415|  5.45k|			r = init_WinZip_AES_decryption(a);
 3416|  2.24k|		else
 3417|  2.24k|			r = init_traditional_PKWARE_decryption(a);
 3418|  9.08k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  9.08k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3418:7): [True: 3.95k, False: 5.13k]
  ------------------
 3419|  3.95k|			return (r);
 3420|  5.13k|		zip->init_decryption = 0;
 3421|  5.13k|	}
 3422|       |
 3423|  35.0k|	switch(zip->entry->compression) {
 3424|  9.59k|	case 0:  /* No compression. */
  ------------------
  |  Branch (3424:2): [True: 9.59k, False: 25.4k]
  ------------------
 3425|  9.59k|		r =  zip_read_data_none(a, buff, size, offset);
 3426|  9.59k|		break;
 3427|      0|#ifdef HAVE_BZLIB_H
 3428|    329|	case 12: /* ZIPx bzip2 compression. */
  ------------------
  |  Branch (3428:2): [True: 329, False: 34.7k]
  ------------------
 3429|    329|		r = zip_read_data_zipx_bzip2(a, buff, size, offset);
 3430|    329|		break;
 3431|      0|#endif
 3432|      0|#if HAVE_LZMA_H && HAVE_LIBLZMA
 3433|  2.62k|	case 14: /* ZIPx LZMA compression. */
  ------------------
  |  Branch (3433:2): [True: 2.62k, False: 32.4k]
  ------------------
 3434|  2.62k|		r = zip_read_data_zipx_lzma_alone(a, buff, size, offset);
 3435|  2.62k|		break;
 3436|     51|	case 95: /* ZIPx XZ compression. */
  ------------------
  |  Branch (3436:2): [True: 51, False: 35.0k]
  ------------------
 3437|     51|		r = zip_read_data_zipx_xz(a, buff, size, offset);
 3438|     51|		break;
 3439|      0|#endif
 3440|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 3441|       |	case 93: /* ZIPx Zstd compression. */
 3442|       |		r = zip_read_data_zipx_zstd(a, buff, size, offset);
 3443|       |		break;
 3444|       |#endif
 3445|       |	/* PPMd support is built-in, so we don't need any #if guards. */
 3446|  12.0k|	case 98: /* ZIPx PPMd compression. */
  ------------------
  |  Branch (3446:2): [True: 12.0k, False: 23.0k]
  ------------------
 3447|  12.0k|		r = zip_read_data_zipx_ppmd(a, buff, size, offset);
 3448|  12.0k|		break;
 3449|       |
 3450|      0|#ifdef HAVE_ZLIB_H
 3451|  4.85k|	case 8: /* Deflate compression. */
  ------------------
  |  Branch (3451:2): [True: 4.85k, False: 30.2k]
  ------------------
 3452|  4.85k|		r =  zip_read_data_deflate(a, buff, size, offset);
 3453|  4.85k|		break;
 3454|      0|#endif
 3455|  5.57k|	default: /* Unsupported compression. */
  ------------------
  |  Branch (3455:2): [True: 5.57k, False: 29.5k]
  ------------------
 3456|       |		/* Return a warning. */
 3457|  5.57k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  5.57k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3458|  5.57k|		    "Unsupported ZIP compression method (%d: %s)",
 3459|  5.57k|		    zip->entry->compression, compression_name(zip->entry->compression));
 3460|       |		/* We can't decompress this entry, but we will
 3461|       |		 * be able to skip() it and try the next entry. */
 3462|  5.57k|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  5.57k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3463|  35.0k|	}
 3464|  29.5k|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  29.5k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3464:6): [True: 3.29k, False: 26.2k]
  ------------------
 3465|  3.29k|		return (r);
 3466|       |
 3467|       |	/*
 3468|       |	 * FAIL if there are more uncompressed bytes than were
 3469|       |	 * initially advertised.  The end-of-entry check below also
 3470|       |	 * compares these values, but only once decoding reaches its
 3471|       |	 * own natural end. Fail the entry so a caller relying on
 3472|       |	 * archive_entry_size() as a hard boundary is never misled;
 3473|       |	 * later entries in the archive can still be read normally.
 3474|       |	 */
 3475|  26.2k|	if (*size > 0 && zip_entry_size_is_set(zip->entry) &&
  ------------------
  |  Branch (3475:6): [True: 17.5k, False: 8.70k]
  |  Branch (3475:19): [True: 12.8k, False: 4.66k]
  ------------------
 3476|  12.8k|	    zip->entry_uncompressed_bytes_read > zip->entry->uncompressed_size) {
  ------------------
  |  Branch (3476:6): [True: 1.59k, False: 11.2k]
  ------------------
 3477|  1.59k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  1.59k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3478|  1.59k|		    "ZIP uncompressed data is larger than the declared "
 3479|  1.59k|		    "entry size (read at least %jd, expected %jd)",
 3480|  1.59k|		    (intmax_t)zip->entry_uncompressed_bytes_read,
 3481|  1.59k|		    (intmax_t)zip->entry->uncompressed_size);
 3482|  1.59k|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  1.59k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3483|  1.59k|	}
 3484|       |
 3485|  24.6k|	if (*size > 0) {
  ------------------
  |  Branch (3485:6): [True: 15.9k, False: 8.70k]
  ------------------
 3486|  15.9k|		zip->computed_crc32 = zip->crc32func(zip->computed_crc32, *buff,
 3487|  15.9k|						     (unsigned)*size);
 3488|  15.9k|	}
 3489|       |	/* If we hit the end, swallow any end-of-data marker and
 3490|       |	 * verify the final check values. */
 3491|  24.6k|	if (zip->end_of_entry) {
  ------------------
  |  Branch (3491:6): [True: 19.3k, False: 5.25k]
  ------------------
 3492|  19.3k|		consume_end_of_file_marker(a, zip);
 3493|       |
 3494|       |		/* Check computed CRC against header */
 3495|  19.3k|		if ((!zip->hctx_valid ||
  ------------------
  |  Branch (3495:8): [True: 17.2k, False: 2.09k]
  ------------------
 3496|  2.09k|		      zip->entry->aes_extra.vendor != AES_VENDOR_AE_2) &&
  ------------------
  |  |  114|  2.09k|#define AES_VENDOR_AE_2	0x0002
  ------------------
  |  Branch (3496:9): [True: 1.94k, False: 151]
  ------------------
 3497|  19.2k|		   zip->entry->crc32 != zip->computed_crc32
  ------------------
  |  Branch (3497:6): [True: 17.8k, False: 1.36k]
  ------------------
 3498|  17.8k|		    && !zip->ignore_crc32) {
  ------------------
  |  Branch (3498:10): [True: 0, False: 17.8k]
  ------------------
 3499|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3500|      0|			    "ZIP bad CRC: 0x%lx should be 0x%lx",
 3501|      0|			    (unsigned long)zip->computed_crc32,
 3502|      0|			    (unsigned long)zip->entry->crc32);
 3503|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3504|      0|		}
 3505|       |		/* Check file size against header. */
 3506|  19.3k|		if (zip->entry->compressed_size !=
  ------------------
  |  Branch (3506:7): [True: 10.8k, False: 8.54k]
  ------------------
 3507|  19.3k|		    zip->entry_compressed_bytes_read) {
 3508|  10.8k|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  10.8k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3509|  10.8k|			    "ZIP compressed data is wrong size "
 3510|  10.8k|			    "(read %jd, expected %jd)",
 3511|  10.8k|			    (intmax_t)zip->entry_compressed_bytes_read,
 3512|  10.8k|			    (intmax_t)zip->entry->compressed_size);
 3513|  10.8k|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  10.8k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3514|  10.8k|		}
 3515|  8.54k|		if (zip->entry->uncompressed_size !=
  ------------------
  |  Branch (3515:7): [True: 2.20k, False: 6.34k]
  ------------------
 3516|  8.54k|		    zip->entry_uncompressed_bytes_read) {
 3517|  2.20k|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  2.20k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3518|  2.20k|			    "ZIP uncompressed data is wrong size "
 3519|  2.20k|			    "(read %jd, expected %jd)",
 3520|  2.20k|			    (intmax_t)zip->entry_uncompressed_bytes_read,
 3521|  2.20k|			    (intmax_t)zip->entry->uncompressed_size);
 3522|  2.20k|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  2.20k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3523|  2.20k|		}
 3524|  8.54k|	}
 3525|       |
 3526|  11.6k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  11.6k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3527|  24.6k|}
archive_read_support_format_zip.c:read_decryption_header:
 3007|  1.50k|{
 3008|  1.50k|	struct zip *zip = a->format->data;
 3009|  1.50k|	const char *p;
 3010|  1.50k|	unsigned int remaining_size;
 3011|  1.50k|	unsigned int ts;
 3012|       |
 3013|       |	/*
 3014|       |	 * Read an initialization vector data field.
 3015|       |	 */
 3016|  1.50k|	p = __archive_read_ahead(a, 2, NULL);
 3017|  1.50k|	if (p == NULL)
  ------------------
  |  Branch (3017:6): [True: 4, False: 1.50k]
  ------------------
 3018|      4|		goto truncated;
 3019|  1.50k|	ts = zip->iv_size;
 3020|  1.50k|	zip->iv_size = archive_le16dec(p);
 3021|  1.50k|	__archive_read_consume(a, 2);
 3022|  1.50k|	if (ts < zip->iv_size) {
  ------------------
  |  Branch (3022:6): [True: 231, False: 1.27k]
  ------------------
 3023|    231|		free(zip->iv);
 3024|    231|		zip->iv = NULL;
 3025|    231|	}
 3026|  1.50k|	p = __archive_read_ahead(a, zip->iv_size, NULL);
 3027|  1.50k|	if (p == NULL)
  ------------------
  |  Branch (3027:6): [True: 8, False: 1.49k]
  ------------------
 3028|      8|		goto truncated;
 3029|  1.49k|	if (zip->iv == NULL) {
  ------------------
  |  Branch (3029:6): [True: 244, False: 1.25k]
  ------------------
 3030|    244|		zip->iv = malloc(zip->iv_size);
 3031|    244|		if (zip->iv == NULL)
  ------------------
  |  Branch (3031:7): [True: 0, False: 244]
  ------------------
 3032|      0|			goto nomem;
 3033|    244|	}
 3034|  1.49k|	memcpy(zip->iv, p, zip->iv_size);
 3035|  1.49k|	__archive_read_consume(a, zip->iv_size);
 3036|       |
 3037|       |	/*
 3038|       |	 * Read a size of remaining decryption header field.
 3039|       |	 */
 3040|  1.49k|	p = __archive_read_ahead(a, 14, NULL);
 3041|  1.49k|	if (p == NULL)
  ------------------
  |  Branch (3041:6): [True: 1, False: 1.49k]
  ------------------
 3042|      1|		goto truncated;
 3043|  1.49k|	remaining_size = archive_le32dec(p);
 3044|  1.49k|	if (remaining_size < 16 || remaining_size > (1 << 18))
  ------------------
  |  Branch (3044:6): [True: 4, False: 1.49k]
  |  Branch (3044:29): [True: 18, False: 1.47k]
  ------------------
 3045|     22|		goto corrupted;
 3046|       |
 3047|       |	/* Check if format version is supported. */
 3048|  1.47k|	if (archive_le16dec(p+4) != 3) {
  ------------------
  |  Branch (3048:6): [True: 244, False: 1.22k]
  ------------------
 3049|    244|		archive_set_error(&a->archive,
 3050|    244|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    244|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3051|    244|		    "Unsupported encryption format version: %u",
 3052|    244|		    archive_le16dec(p+4));
 3053|    244|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|    244|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3054|    244|	}
 3055|       |
 3056|       |	/*
 3057|       |	 * Read an encryption algorithm field.
 3058|       |	 */
 3059|  1.22k|	zip->alg_id = archive_le16dec(p+6);
 3060|  1.22k|	switch (zip->alg_id) {
 3061|     84|	case 0x6601:/* DES */
  ------------------
  |  Branch (3061:2): [True: 84, False: 1.14k]
  ------------------
 3062|    285|	case 0x6602:/* RC2 */
  ------------------
  |  Branch (3062:2): [True: 201, False: 1.02k]
  ------------------
 3063|    329|	case 0x6603:/* 3DES 168 */
  ------------------
  |  Branch (3063:2): [True: 44, False: 1.18k]
  ------------------
 3064|    363|	case 0x6609:/* 3DES 112 */
  ------------------
  |  Branch (3064:2): [True: 34, False: 1.19k]
  ------------------
 3065|    442|	case 0x660E:/* AES 128 */
  ------------------
  |  Branch (3065:2): [True: 79, False: 1.15k]
  ------------------
 3066|    516|	case 0x660F:/* AES 192 */
  ------------------
  |  Branch (3066:2): [True: 74, False: 1.15k]
  ------------------
 3067|    582|	case 0x6610:/* AES 256 */
  ------------------
  |  Branch (3067:2): [True: 66, False: 1.16k]
  ------------------
 3068|    639|	case 0x6702:/* RC2 (version >= 5.2) */
  ------------------
  |  Branch (3068:2): [True: 57, False: 1.17k]
  ------------------
 3069|    872|	case 0x6720:/* Blowfish */
  ------------------
  |  Branch (3069:2): [True: 233, False: 996]
  ------------------
 3070|    939|	case 0x6721:/* Twofish */
  ------------------
  |  Branch (3070:2): [True: 67, False: 1.16k]
  ------------------
 3071|  1.13k|	case 0x6801:/* RC4 */
  ------------------
  |  Branch (3071:2): [True: 195, False: 1.03k]
  ------------------
 3072|       |		/* Supported encryption algorithm. */
 3073|  1.13k|		break;
 3074|     95|	default:
  ------------------
  |  Branch (3074:2): [True: 95, False: 1.13k]
  ------------------
 3075|     95|		archive_set_error(&a->archive,
 3076|     95|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     95|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3077|     95|		    "Unknown encryption algorithm: %u", zip->alg_id);
 3078|     95|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|     95|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3079|  1.22k|	}
 3080|       |
 3081|       |	/*
 3082|       |	 * Read a bit length field.
 3083|       |	 */
 3084|  1.13k|	zip->bit_len = archive_le16dec(p+8);
 3085|       |
 3086|       |	/*
 3087|       |	 * Read a flags field.
 3088|       |	 */
 3089|  1.13k|	zip->flags = archive_le16dec(p+10);
 3090|  1.13k|	switch (zip->flags & 0xf000) {
 3091|      0|	case 0x0001: /* Password is required to decrypt. */
  ------------------
  |  Branch (3091:2): [True: 0, False: 1.13k]
  ------------------
 3092|      0|	case 0x0002: /* Certificates only. */
  ------------------
  |  Branch (3092:2): [True: 0, False: 1.13k]
  ------------------
 3093|      0|	case 0x0003: /* Password or certificate required to decrypt. */
  ------------------
  |  Branch (3093:2): [True: 0, False: 1.13k]
  ------------------
 3094|      0|		break;
 3095|  1.13k|	default:
  ------------------
  |  Branch (3095:2): [True: 1.13k, False: 0]
  ------------------
 3096|  1.13k|		archive_set_error(&a->archive,
 3097|  1.13k|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.13k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3098|  1.13k|		    "Unknown encryption flag: %u", zip->flags);
 3099|  1.13k|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  1.13k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3100|  1.13k|	}
 3101|      0|	if ((zip->flags & 0xf000) == 0 ||
  ------------------
  |  Branch (3101:6): [True: 0, False: 0]
  ------------------
 3102|      0|	    (zip->flags & 0xf000) == 0x4000) {
  ------------------
  |  Branch (3102:6): [True: 0, False: 0]
  ------------------
 3103|      0|		archive_set_error(&a->archive,
 3104|      0|		    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3105|      0|		    "Unknown encryption flag: %u", zip->flags);
 3106|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3107|      0|	}
 3108|       |
 3109|       |	/*
 3110|       |	 * Read an encrypted random data field.
 3111|       |	 */
 3112|      0|	ts = zip->erd_size;
 3113|      0|	zip->erd_size = archive_le16dec(p+12);
 3114|      0|	__archive_read_consume(a, 14);
 3115|      0|	if ((zip->erd_size & 0xf) != 0 ||
  ------------------
  |  Branch (3115:6): [True: 0, False: 0]
  ------------------
 3116|      0|	    (zip->erd_size + 16) > remaining_size ||
  ------------------
  |  Branch (3116:6): [True: 0, False: 0]
  ------------------
 3117|      0|	    (zip->erd_size + 16) < zip->erd_size)
  ------------------
  |  Branch (3117:6): [True: 0, False: 0]
  ------------------
 3118|      0|		goto corrupted;
 3119|       |
 3120|      0|	if (ts < zip->erd_size) {
  ------------------
  |  Branch (3120:6): [True: 0, False: 0]
  ------------------
 3121|      0|		free(zip->erd);
 3122|      0|		zip->erd = NULL;
 3123|      0|	}
 3124|      0|	p = __archive_read_ahead(a, zip->erd_size, NULL);
 3125|      0|	if (p == NULL)
  ------------------
  |  Branch (3125:6): [True: 0, False: 0]
  ------------------
 3126|      0|		goto truncated;
 3127|      0|	if (zip->erd == NULL) {
  ------------------
  |  Branch (3127:6): [True: 0, False: 0]
  ------------------
 3128|      0|		zip->erd = malloc(zip->erd_size);
 3129|      0|		if (zip->erd == NULL)
  ------------------
  |  Branch (3129:7): [True: 0, False: 0]
  ------------------
 3130|      0|			goto nomem;
 3131|      0|	}
 3132|      0|	memcpy(zip->erd, p, zip->erd_size);
 3133|      0|	__archive_read_consume(a, zip->erd_size);
 3134|       |
 3135|       |	/*
 3136|       |	 * Read a reserved data field.
 3137|       |	 */
 3138|      0|	p = __archive_read_ahead(a, 4, NULL);
 3139|      0|	if (p == NULL)
  ------------------
  |  Branch (3139:6): [True: 0, False: 0]
  ------------------
 3140|      0|		goto truncated;
 3141|       |	/* Reserved data size should be zero. */
 3142|      0|	if (archive_le32dec(p) != 0)
  ------------------
  |  Branch (3142:6): [True: 0, False: 0]
  ------------------
 3143|      0|		goto corrupted;
 3144|      0|	__archive_read_consume(a, 4);
 3145|       |
 3146|       |	/*
 3147|       |	 * Read a password validation data field.
 3148|       |	 */
 3149|      0|	p = __archive_read_ahead(a, 2, NULL);
 3150|      0|	if (p == NULL)
  ------------------
  |  Branch (3150:6): [True: 0, False: 0]
  ------------------
 3151|      0|		goto truncated;
 3152|      0|	ts = zip->v_size;
 3153|      0|	zip->v_size = archive_le16dec(p);
 3154|      0|	__archive_read_consume(a, 2);
 3155|      0|	if ((zip->v_size & 0x0f) != 0 ||
  ------------------
  |  Branch (3155:6): [True: 0, False: 0]
  ------------------
 3156|      0|	    (zip->erd_size + zip->v_size + 16) > remaining_size ||
  ------------------
  |  Branch (3156:6): [True: 0, False: 0]
  ------------------
 3157|      0|	    (zip->erd_size + zip->v_size + 16) < (zip->erd_size + zip->v_size))
  ------------------
  |  Branch (3157:6): [True: 0, False: 0]
  ------------------
 3158|      0|		goto corrupted;
 3159|      0|	if (ts < zip->v_size) {
  ------------------
  |  Branch (3159:6): [True: 0, False: 0]
  ------------------
 3160|      0|		free(zip->v_data);
 3161|      0|		zip->v_data = NULL;
 3162|      0|	}
 3163|      0|	p = __archive_read_ahead(a, zip->v_size, NULL);
 3164|      0|	if (p == NULL)
  ------------------
  |  Branch (3164:6): [True: 0, False: 0]
  ------------------
 3165|      0|		goto truncated;
 3166|      0|	if (zip->v_data == NULL) {
  ------------------
  |  Branch (3166:6): [True: 0, False: 0]
  ------------------
 3167|      0|		zip->v_data = malloc(zip->v_size);
 3168|      0|		if (zip->v_data == NULL)
  ------------------
  |  Branch (3168:7): [True: 0, False: 0]
  ------------------
 3169|      0|			goto nomem;
 3170|      0|	}
 3171|      0|	memcpy(zip->v_data, p, zip->v_size);
 3172|      0|	__archive_read_consume(a, zip->v_size);
 3173|       |
 3174|      0|	p = __archive_read_ahead(a, 4, NULL);
 3175|      0|	if (p == NULL)
  ------------------
  |  Branch (3175:6): [True: 0, False: 0]
  ------------------
 3176|      0|		goto truncated;
 3177|      0|	zip->v_crc32 = archive_le32dec(p);
 3178|      0|	__archive_read_consume(a, 4);
 3179|       |
 3180|       |	/*return (ARCHIVE_OK);
 3181|       |	 * This is not fully implemented yet.*/
 3182|      0|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3183|      0|	    "Encrypted file is unsupported");
 3184|      0|	return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3185|     13|truncated:
 3186|     13|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     13|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3187|     13|	    "Truncated ZIP file data");
 3188|     13|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     13|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3189|     22|corrupted:
 3190|     22|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     22|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3191|     22|	    "Corrupted ZIP file data");
 3192|     22|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     22|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3193|      0|nomem:
 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|}
archive_read_support_format_zip.c:init_WinZip_AES_decryption:
 3292|  5.52k|{
 3293|  5.52k|	struct zip *zip = a->format->data;
 3294|  5.52k|	const void *p;
 3295|  5.52k|	const uint8_t *pv;
 3296|  5.52k|	size_t key_len, salt_len;
 3297|  5.52k|	uint8_t derived_key[MAX_DERIVED_KEY_BUF_SIZE];
 3298|  5.52k|	int retry;
 3299|  5.52k|	int r;
 3300|       |
 3301|  5.52k|	if (zip->cctx_valid || zip->hctx_valid)
  ------------------
  |  Branch (3301:6): [True: 0, False: 5.52k]
  |  Branch (3301:25): [True: 0, False: 5.52k]
  ------------------
 3302|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3303|       |
 3304|  5.52k|	switch (zip->entry->aes_extra.strength) {
 3305|    353|	case 1: salt_len = 8;  key_len = 16; break;
  ------------------
  |  Branch (3305:2): [True: 353, False: 5.17k]
  ------------------
 3306|  4.80k|	case 2: salt_len = 12; key_len = 24; break;
  ------------------
  |  Branch (3306:2): [True: 4.80k, False: 724]
  ------------------
 3307|    356|	case 3: salt_len = 16; key_len = 32; break;
  ------------------
  |  Branch (3307:2): [True: 356, False: 5.17k]
  ------------------
 3308|     15|	default: goto corrupted;
  ------------------
  |  Branch (3308:2): [True: 15, False: 5.51k]
  ------------------
 3309|  5.52k|	}
 3310|  5.51k|	p = __archive_read_ahead(a, salt_len + 2, NULL);
 3311|  5.51k|	if (p == NULL)
  ------------------
  |  Branch (3311:6): [True: 9, False: 5.50k]
  ------------------
 3312|      9|		goto truncated;
 3313|       |
 3314|  6.13k|	for (retry = 0;; retry++) {
 3315|  6.13k|		const char *passphrase;
 3316|       |
 3317|  6.13k|		passphrase = __archive_read_next_passphrase(a);
 3318|  6.13k|		if (passphrase == NULL) {
  ------------------
  |  Branch (3318:7): [True: 704, False: 5.43k]
  ------------------
 3319|    704|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|    704|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3320|    704|			    (retry > 0)?
  ------------------
  |  Branch (3320:8): [True: 632, False: 72]
  ------------------
 3321|    632|				"Incorrect passphrase":
 3322|    704|				"Passphrase required for this entry");
 3323|    704|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|    704|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3324|    704|		}
 3325|  5.43k|		memset(derived_key, 0, sizeof(derived_key));
 3326|  5.43k|		r = archive_pbkdf2_sha1(passphrase, strlen(passphrase),
  ------------------
  |  |  149|  5.43k|  __archive_cryptor.pbkdf2sha1(pw, pw_len, salt, salt_len, rounds, dk, dk_len)
  ------------------
 3327|  5.43k|		    p, salt_len, 1000, derived_key, key_len * 2 + 2);
 3328|  5.43k|		if (r != 0) {
  ------------------
  |  Branch (3328:7): [True: 0, False: 5.43k]
  ------------------
 3329|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3330|      0|			    r == CRYPTOR_STUB_FUNCTION ? "Decryption is unsupported due "
  ------------------
  |  |  166|      0|#define CRYPTOR_STUB_FUNCTION	-2
  ------------------
  |  Branch (3330:8): [True: 0, False: 0]
  ------------------
 3331|      0|				"to lack of crypto library" : "Failed to process passphrase");
 3332|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3333|      0|		}
 3334|       |
 3335|       |		/* Check password verification value. */
 3336|  5.43k|		pv = ((const uint8_t *)p) + salt_len;
 3337|  5.43k|		if (derived_key[key_len * 2] == pv[0] &&
  ------------------
  |  Branch (3337:7): [True: 5.11k, False: 317]
  ------------------
 3338|  5.11k|		    derived_key[key_len * 2 + 1] == pv[1])
  ------------------
  |  Branch (3338:7): [True: 4.79k, False: 315]
  ------------------
 3339|  4.79k|			break;/* The passphrase is OK. */
 3340|    632|		if (retry > 10000) {
  ------------------
  |  Branch (3340:7): [True: 0, False: 632]
  ------------------
 3341|       |			/* Avoid infinity loop. */
 3342|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3343|      0|			    "Too many incorrect passphrases");
 3344|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3345|      0|		}
 3346|    632|	}
 3347|       |
 3348|  4.79k|	r = archive_decrypto_aes_ctr_init(&zip->cctx, derived_key, key_len);
  ------------------
  |  |  152|  4.79k|  __archive_cryptor.decrypto_aes_ctr_init(ctx, key, key_len)
  ------------------
 3349|  4.79k|	if (r != 0) {
  ------------------
  |  Branch (3349:6): [True: 0, False: 4.79k]
  ------------------
 3350|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3351|      0|		    "Decryption is unsupported due to lack of crypto library");
 3352|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3353|      0|	}
 3354|  4.79k|	r = archive_hmac_sha1_init(&zip->hctx, derived_key + key_len, key_len);
  ------------------
  |  |   89|  4.79k|	__archive_hmac.__hmac_sha1_init(ctx, key, key_len)
  ------------------
 3355|  4.79k|	if (r != 0) {
  ------------------
  |  Branch (3355:6): [True: 0, False: 4.79k]
  ------------------
 3356|      0|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  156|      0|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 3357|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3358|      0|		    "Failed to initialize HMAC-SHA1");
 3359|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3360|      0|	}
 3361|  4.79k|	zip->cctx_valid = zip->hctx_valid = 1;
 3362|  4.79k|	__archive_read_consume(a, salt_len + 2);
 3363|  4.79k|	zip->entry_bytes_remaining -= salt_len + 2 + AUTH_CODE_SIZE;
  ------------------
  |  |  147|  4.79k|#define AUTH_CODE_SIZE	10
  ------------------
 3364|  4.79k|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  129|  4.79k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (3364:6): [True: 1.29k, False: 3.50k]
  ------------------
 3365|  1.29k|	    && zip->entry_bytes_remaining < 0)
  ------------------
  |  Branch (3365:9): [True: 1, False: 1.29k]
  ------------------
 3366|      1|		goto corrupted;
 3367|  4.79k|	zip->entry_compressed_bytes_read += salt_len + 2 + AUTH_CODE_SIZE;
  ------------------
  |  |  147|  4.79k|#define AUTH_CODE_SIZE	10
  ------------------
 3368|  4.79k|	zip->decrypted_bytes_remaining = 0;
 3369|       |
 3370|  4.79k|	zip->entry->compression = zip->entry->aes_extra.compression;
 3371|  4.79k|	return (zip_alloc_decryption_buffer(a));
 3372|       |
 3373|      9|truncated:
 3374|      9|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      9|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3375|      9|	    "Truncated ZIP file data");
 3376|      9|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      9|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3377|     16|corrupted:
 3378|     16|	archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     16|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3379|     16|	    "Corrupted ZIP file data");
 3380|     16|	return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     16|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3381|  4.79k|}
archive_read_support_format_zip.c:zip_alloc_decryption_buffer:
 3201|  5.52k|{
 3202|  5.52k|	struct zip *zip = a->format->data;
 3203|  5.52k|	size_t bs = 256 * 1024;
 3204|       |
 3205|  5.52k|	if (zip->decrypted_buffer == NULL) {
  ------------------
  |  Branch (3205:6): [True: 255, False: 5.26k]
  ------------------
 3206|    255|		zip->decrypted_buffer_size = bs;
 3207|    255|		zip->decrypted_buffer = malloc(bs);
 3208|    255|		if (zip->decrypted_buffer == NULL) {
  ------------------
  |  Branch (3208:7): [True: 0, False: 255]
  ------------------
 3209|      0|			archive_set_error(&a->archive, ENOMEM,
 3210|      0|			    "No memory for ZIP decryption");
 3211|      0|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3212|      0|		}
 3213|    255|	}
 3214|  5.52k|	zip->decrypted_ptr = zip->decrypted_buffer;
 3215|  5.52k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  5.52k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3216|  5.52k|}
archive_read_support_format_zip.c:init_traditional_PKWARE_decryption:
 3220|  4.25k|{
 3221|  4.25k|	struct zip *zip = a->format->data;
 3222|  4.25k|	const void *p;
 3223|  4.25k|	int retry;
 3224|  4.25k|	int r;
 3225|       |
 3226|  4.25k|	if (zip->tctx_valid)
  ------------------
  |  Branch (3226:6): [True: 0, False: 4.25k]
  ------------------
 3227|      0|		return (ARCHIVE_OK);
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3228|       |
 3229|       |	/*
 3230|       |	   Read the 12 bytes encryption header stored at
 3231|       |	   the start of the data area.
 3232|       |	 */
 3233|  4.25k|#define ENC_HEADER_SIZE	12
 3234|  4.25k|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  129|  4.25k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (3234:6): [True: 419, False: 3.83k]
  ------------------
 3235|    419|	    && zip->entry_bytes_remaining < ENC_HEADER_SIZE) {
  ------------------
  |  | 3233|    419|#define ENC_HEADER_SIZE	12
  ------------------
  |  Branch (3235:9): [True: 4, False: 415]
  ------------------
 3236|      4|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      4|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3237|      4|		    "Truncated Zip encrypted body: only %jd bytes available",
 3238|      4|		    (intmax_t)zip->entry_bytes_remaining);
 3239|      4|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      4|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3240|      4|	}
 3241|       |
 3242|  4.24k|	p = __archive_read_ahead(a, ENC_HEADER_SIZE, NULL);
  ------------------
  |  | 3233|  4.24k|#define ENC_HEADER_SIZE	12
  ------------------
 3243|  4.24k|	if (p == NULL) {
  ------------------
  |  Branch (3243:6): [True: 13, False: 4.23k]
  ------------------
 3244|     13|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     13|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3245|     13|		    "Truncated ZIP file data");
 3246|     13|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     13|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3247|     13|	}
 3248|       |
 3249|  6.15k|	for (retry = 0;; retry++) {
 3250|  6.15k|		const char *passphrase;
 3251|  6.15k|		uint8_t crcchk;
 3252|       |
 3253|  6.15k|		passphrase = __archive_read_next_passphrase(a);
 3254|  6.15k|		if (passphrase == NULL) {
  ------------------
  |  Branch (3254:7): [True: 3.50k, False: 2.64k]
  ------------------
 3255|  3.50k|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|  3.50k|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3256|  3.50k|			    (retry > 0)?
  ------------------
  |  Branch (3256:8): [True: 1.92k, False: 1.58k]
  ------------------
 3257|  1.92k|				"Incorrect passphrase":
 3258|  3.50k|				"Passphrase required for this entry");
 3259|  3.50k|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  3.50k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3260|  3.50k|		}
 3261|       |
 3262|       |		/*
 3263|       |		 * Initialize ctx for Traditional PKWARE Decryption.
 3264|       |		 */
 3265|  2.64k|		r = trad_enc_init(&zip->tctx, passphrase, strlen(passphrase),
 3266|  2.64k|			p, ENC_HEADER_SIZE, &crcchk);
  ------------------
  |  | 3233|  2.64k|#define ENC_HEADER_SIZE	12
  ------------------
 3267|  2.64k|		if (r == 0 && crcchk == zip->entry->decdat)
  ------------------
  |  Branch (3267:7): [True: 2.64k, False: 0]
  |  Branch (3267:17): [True: 726, False: 1.92k]
  ------------------
 3268|    726|			break;/* The passphrase is OK. */
 3269|  1.92k|		if (retry > 10000) {
  ------------------
  |  Branch (3269:7): [True: 0, False: 1.92k]
  ------------------
 3270|       |			/* Avoid infinity loop. */
 3271|      0|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 3272|      0|			    "Too many incorrect passphrases");
 3273|      0|			return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 3274|      0|		}
 3275|  1.92k|	}
 3276|       |
 3277|    726|	__archive_read_consume(a, ENC_HEADER_SIZE);
  ------------------
  |  | 3233|    726|#define ENC_HEADER_SIZE	12
  ------------------
 3278|    726|	zip->tctx_valid = 1;
 3279|    726|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)) {
  ------------------
  |  |  129|    726|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (3279:6): [True: 176, False: 550]
  ------------------
 3280|    176|	    zip->entry_bytes_remaining -= ENC_HEADER_SIZE;
  ------------------
  |  | 3233|    176|#define ENC_HEADER_SIZE	12
  ------------------
 3281|    176|	}
 3282|       |	/*zip->entry_uncompressed_bytes_read += ENC_HEADER_SIZE;*/
 3283|    726|	zip->entry_compressed_bytes_read += ENC_HEADER_SIZE;
  ------------------
  |  | 3233|    726|#define ENC_HEADER_SIZE	12
  ------------------
 3284|    726|	zip->decrypted_bytes_remaining = 0;
 3285|       |
 3286|    726|	return (zip_alloc_decryption_buffer(a));
 3287|  4.23k|#undef ENC_HEADER_SIZE
 3288|  4.23k|}
archive_read_support_format_zip.c:trad_enc_init:
  375|  2.64k|{
  376|  2.64k|	uint8_t header[12];
  377|       |
  378|  2.64k|	if (key_len < 12) {
  ------------------
  |  Branch (378:6): [True: 0, False: 2.64k]
  ------------------
  379|      0|		*crcchk = 0xff;
  380|      0|		return -1;
  381|      0|	}
  382|       |
  383|  2.64k|	ctx->keys[0] = 305419896L;
  384|  2.64k|	ctx->keys[1] = 591751049L;
  385|  2.64k|	ctx->keys[2] = 878082192L;
  386|       |
  387|  18.5k|	for (;pw_len; --pw_len)
  ------------------
  |  Branch (387:8): [True: 15.8k, False: 2.64k]
  ------------------
  388|  15.8k|		trad_enc_update_keys(ctx, *pw++);
  389|       |
  390|  2.64k|	trad_enc_decrypt_update(ctx, key, 12, header, 12);
  391|       |	/* Return the last byte for CRC check. */
  392|  2.64k|	*crcchk = header[11];
  393|  2.64k|	return 0;
  394|  2.64k|}
archive_read_support_format_zip.c:zip_read_data_none:
 1810|  9.59k|{
 1811|  9.59k|	struct zip *zip = a->format->data;
 1812|  9.59k|	const char *buff;
 1813|  9.59k|	ssize_t bytes_avail;
 1814|  9.59k|	ssize_t trailing_extra;
 1815|  9.59k|	int r;
 1816|       |
 1817|  9.59k|	(void)offset; /* UNUSED */
 1818|       |
 1819|  9.59k|	trailing_extra = zip->hctx_valid ? AUTH_CODE_SIZE : 0;
  ------------------
  |  |  147|  1.57k|#define AUTH_CODE_SIZE	10
  ------------------
  |  Branch (1819:19): [True: 1.57k, False: 8.01k]
  ------------------
 1820|       |
 1821|  9.59k|	if (zip->entry->zip_flags & ZIP_LENGTH_AT_END) {
  ------------------
  |  |  129|  9.59k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (1821:6): [True: 5.17k, False: 4.42k]
  ------------------
 1822|  5.17k|		const char *p;
 1823|  5.17k|		ssize_t grabbing_bytes = 24 + trailing_extra;
 1824|       |
 1825|       |		/* Grab at least 24 bytes. */
 1826|  5.17k|		buff = __archive_read_ahead(a, grabbing_bytes, &bytes_avail);
 1827|  5.17k|		if (bytes_avail < grabbing_bytes) {
  ------------------
  |  Branch (1827:7): [True: 88, False: 5.09k]
  ------------------
 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|     88|			archive_set_error(&a->archive,
 1833|     88|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     88|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1834|     88|			    "Truncated ZIP file data");
 1835|     88|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     88|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1836|     88|		}
 1837|       |		/* Check for a complete PK\007\010 signature, followed
 1838|       |		 * by the correct 4-byte CRC. */
 1839|  5.09k|		p = buff + trailing_extra;
 1840|  5.09k|		if (p[0] == 'P' && p[1] == 'K'
  ------------------
  |  Branch (1840:7): [True: 3.77k, False: 1.31k]
  |  Branch (1840:22): [True: 3.68k, False: 95]
  ------------------
 1841|  3.68k|		    && p[2] == '\007' && p[3] == '\010'
  ------------------
  |  Branch (1841:10): [True: 3.45k, False: 225]
  |  Branch (1841:28): [True: 3.24k, False: 212]
  ------------------
 1842|  3.24k|		    && (archive_le32dec(p + 4) == zip->computed_crc32
  ------------------
  |  Branch (1842:11): [True: 907, False: 2.33k]
  ------------------
 1843|  2.33k|			|| zip->ignore_crc32
  ------------------
  |  Branch (1843:7): [True: 2.33k, False: 0]
  ------------------
 1844|      0|			|| (zip->hctx_valid
  ------------------
  |  Branch (1844:8): [True: 0, False: 0]
  ------------------
 1845|  3.24k|			 && zip->entry->aes_extra.vendor == AES_VENDOR_AE_2))) {
  ------------------
  |  |  114|      0|#define AES_VENDOR_AE_2	0x0002
  ------------------
  |  Branch (1845:8): [True: 0, False: 0]
  ------------------
 1846|  3.24k|			zip->end_of_entry = 1;
 1847|  3.24k|			if (zip->hctx_valid) {
  ------------------
  |  Branch (1847:8): [True: 89, False: 3.15k]
  ------------------
 1848|     89|				r = check_authentication_code(a, buff);
 1849|     89|				if (r != ARCHIVE_OK)
  ------------------
  |  |  233|     89|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1849:9): [True: 53, False: 36]
  ------------------
 1850|     53|					return (r);
 1851|     89|			}
 1852|  3.19k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  3.19k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1853|  3.24k|		}
 1854|       |		/* If not at EOF, ensure we consume at least one byte. */
 1855|  1.84k|		++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|   691k|		while (p < buff + bytes_avail - 4) {
  ------------------
  |  Branch (1861:10): [True: 691k, False: 111]
  ------------------
 1862|   691k|			if (p[3] == 'P') { p += 3; }
  ------------------
  |  Branch (1862:8): [True: 2.53k, False: 689k]
  ------------------
 1863|   689k|			else if (p[3] == 'K') { p += 2; }
  ------------------
  |  Branch (1863:13): [True: 1.91k, False: 687k]
  ------------------
 1864|   687k|			else if (p[3] == '\007') { p += 1; }
  ------------------
  |  Branch (1864:13): [True: 6.16k, False: 681k]
  ------------------
 1865|   681k|			else if (p[3] == '\010' && p[2] == '\007'
  ------------------
  |  Branch (1865:13): [True: 8.99k, False: 672k]
  |  Branch (1865:31): [True: 2.65k, False: 6.34k]
  ------------------
 1866|  2.65k|			    && p[1] == 'K' && p[0] == 'P') {
  ------------------
  |  Branch (1866:11): [True: 2.04k, False: 608]
  |  Branch (1866:26): [True: 1.73k, False: 315]
  ------------------
 1867|  1.73k|				break;
 1868|   679k|			} else { p += 4; }
 1869|   691k|		}
 1870|  1.84k|		p -= trailing_extra;
 1871|  1.84k|		bytes_avail = p - buff;
 1872|  4.42k|	} else {
 1873|  4.42k|		if (zip->entry_bytes_remaining == 0) {
  ------------------
  |  Branch (1873:7): [True: 1.55k, False: 2.86k]
  ------------------
 1874|  1.55k|			zip->end_of_entry = 1;
 1875|  1.55k|			if (zip->hctx_valid) {
  ------------------
  |  Branch (1875:8): [True: 209, False: 1.34k]
  ------------------
 1876|    209|				r = check_authentication_code(a, NULL);
 1877|    209|				if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    209|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (1877:9): [True: 96, False: 113]
  ------------------
 1878|     96|					return (r);
 1879|    209|			}
 1880|  1.45k|			return (ARCHIVE_OK);
  ------------------
  |  |  233|  1.45k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1881|  1.55k|		}
 1882|       |		/* Grab a bunch of bytes. */
 1883|  2.86k|		buff = __archive_read_ahead(a, 1, &bytes_avail);
 1884|  2.86k|		if (bytes_avail <= 0) {
  ------------------
  |  Branch (1884:7): [True: 50, False: 2.81k]
  ------------------
 1885|     50|			archive_set_error(&a->archive,
 1886|     50|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     50|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 1887|     50|			    "Truncated ZIP file data");
 1888|     50|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     50|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1889|     50|		}
 1890|  2.81k|		if (bytes_avail > zip->entry_bytes_remaining)
  ------------------
  |  Branch (1890:7): [True: 2.70k, False: 111]
  ------------------
 1891|  2.70k|			bytes_avail = (ssize_t)zip->entry_bytes_remaining;
 1892|  2.81k|	}
 1893|  4.66k|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (1893:6): [True: 122, False: 4.54k]
  |  Branch (1893:25): [True: 1.28k, False: 3.25k]
  ------------------
 1894|  1.40k|		size_t dec_size = bytes_avail;
 1895|       |
 1896|  1.40k|		if (dec_size > zip->decrypted_buffer_size)
  ------------------
  |  Branch (1896:7): [True: 3, False: 1.40k]
  ------------------
 1897|      3|			dec_size = zip->decrypted_buffer_size;
 1898|  1.40k|		if (zip->tctx_valid) {
  ------------------
  |  Branch (1898:7): [True: 122, False: 1.28k]
  ------------------
 1899|    122|			trad_enc_decrypt_update(&zip->tctx,
 1900|    122|			    (const uint8_t *)buff, dec_size,
 1901|    122|			    zip->decrypted_buffer, dec_size);
 1902|  1.28k|		} else {
 1903|  1.28k|			size_t dsize = dec_size;
 1904|  1.28k|			archive_hmac_sha1_update(&zip->hctx,
  ------------------
  |  |   91|  1.28k|	__archive_hmac.__hmac_sha1_update(ctx, data, data_len)
  ------------------
 1905|  1.28k|			    (const uint8_t *)buff, dec_size);
 1906|  1.28k|			archive_decrypto_aes_ctr_update(&zip->cctx,
  ------------------
  |  |  154|  1.28k|  __archive_cryptor.decrypto_aes_ctr_update(ctx, in, in_len, out, out_len)
  ------------------
 1907|  1.28k|			    (const uint8_t *)buff, dec_size,
 1908|  1.28k|			    zip->decrypted_buffer, &dsize);
 1909|  1.28k|		}
 1910|  1.40k|		bytes_avail = dec_size;
 1911|  1.40k|		buff = (const char *)zip->decrypted_buffer;
 1912|  1.40k|	}
 1913|  4.66k|	zip->entry_bytes_remaining -= bytes_avail;
 1914|  4.66k|	zip->entry_uncompressed_bytes_read += bytes_avail;
 1915|  4.66k|	zip->entry_compressed_bytes_read += bytes_avail;
 1916|  4.66k|	zip->unconsumed += bytes_avail;
 1917|  4.66k|	*size = bytes_avail;
 1918|  4.66k|	*_buff = buff;
 1919|  4.66k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  4.66k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1920|  9.59k|}
archive_read_support_format_zip.c:zip_read_data_zipx_bzip2:
 2617|    329|{
 2618|    329|	struct zip *zip = a->format->data;
 2619|    329|	ssize_t bytes_avail = 0, max_in, to_consume;
 2620|    329|	const void *compressed_buff;
 2621|    329|	const void *sp;
 2622|    329|	int r;
 2623|    329|	uint64_t total_out;
 2624|       |
 2625|    329|	(void) offset; /* UNUSED */
 2626|       |
 2627|       |	/* Initialize decompression context if we're here for the first time. */
 2628|    329|	if(!zip->decompress_init) {
  ------------------
  |  Branch (2628:5): [True: 125, False: 204]
  ------------------
 2629|    125|		r = zipx_bzip2_init(a, zip);
 2630|    125|		if(r != ARCHIVE_OK)
  ------------------
  |  |  233|    125|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2630:6): [True: 0, False: 125]
  ------------------
 2631|      0|			return r;
 2632|    125|	}
 2633|       |
 2634|       |	/* Fetch more compressed bytes. */
 2635|    329|	compressed_buff = __archive_read_ahead(a, 1, &bytes_avail);
 2636|    329|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  129|    329|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (2636:6): [True: 295, False: 34]
  ------------------
 2637|    295|		&& bytes_avail > zip->entry_bytes_remaining) {
  ------------------
  |  Branch (2637:6): [True: 163, False: 132]
  ------------------
 2638|    163|		bytes_avail = (ssize_t)zip->entry_bytes_remaining;
 2639|    163|	}
 2640|    329|	if(bytes_avail < 1) {
  ------------------
  |  Branch (2640:5): [True: 7, False: 322]
  ------------------
 2641|       |		/* libbz2 doesn't complain when caller feeds avail_in == 0.
 2642|       |		 * It will actually return success in this case, which is
 2643|       |		 * undesirable. This is why we need to make this check
 2644|       |		 * manually. */
 2645|      7|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      7|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2646|      7|		    "Truncated bzip2 file body");
 2647|      7|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2648|      7|	}
 2649|       |
 2650|    322|	zip_read_decrypt(zip, compressed_buff, bytes_avail,
 2651|    322|	    &compressed_buff, &bytes_avail, &sp);
 2652|       |
 2653|       |	/* Setup buffer boundaries.  bzstream.avail_in is 32 bits wide,
 2654|       |	 * so clamp the available byte count before the assignment. */
 2655|    322|	if (UINT_MAX >= SSIZE_MAX)
  ------------------
  |  Branch (2655:6): [Folded, False: 322]
  ------------------
 2656|      0|		max_in = SSIZE_MAX;
 2657|    322|	else
 2658|    322|		max_in = UINT_MAX;
 2659|    322|	if (bytes_avail > max_in)
  ------------------
  |  Branch (2659:6): [True: 0, False: 322]
  ------------------
 2660|      0|		bytes_avail = max_in;
 2661|    322|	zip->bzstream.next_in = (char*)(uintptr_t) compressed_buff;
 2662|    322|	zip->bzstream.avail_in = (uint32_t)bytes_avail;
 2663|    322|	zip->bzstream.total_in_hi32 = 0;
 2664|    322|	zip->bzstream.total_in_lo32 = 0;
 2665|    322|	zip->bzstream.next_out = (char*) zip->uncompressed_buffer;
 2666|    322|	zip->bzstream.avail_out = (uint32_t)zip->uncompressed_buffer_size;
 2667|    322|	zip->bzstream.total_out_hi32 = 0;
 2668|    322|	zip->bzstream.total_out_lo32 = 0;
 2669|       |
 2670|       |	/* Perform the decompression. */
 2671|    322|	r = BZ2_bzDecompress(&zip->bzstream);
 2672|    322|	switch(r) {
 2673|     96|		case BZ_STREAM_END:
  ------------------
  |  Branch (2673:3): [True: 96, False: 226]
  ------------------
 2674|       |			/* If we're at the end of the stream, deinitialize the
 2675|       |			 * decompression context now. */
 2676|     96|			switch(BZ2_bzDecompressEnd(&zip->bzstream)) {
 2677|     96|				case BZ_OK:
  ------------------
  |  Branch (2677:5): [True: 96, False: 0]
  ------------------
 2678|     96|					break;
 2679|      0|				default:
  ------------------
  |  Branch (2679:5): [True: 0, False: 96]
  ------------------
 2680|      0|					archive_set_error(&a->archive,
 2681|      0|					    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2682|      0|					    "Failed to clean up bzip2 "
 2683|      0|					    "decompressor");
 2684|      0|					return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2685|     96|			}
 2686|       |
 2687|     96|			zip->end_of_entry = 1;
 2688|     96|			break;
 2689|    208|		case BZ_OK:
  ------------------
  |  Branch (2689:3): [True: 208, False: 114]
  ------------------
 2690|       |			/* The decompressor has successfully decoded this
 2691|       |			 * chunk of data, but more data is still in queue. */
 2692|    208|			break;
 2693|     18|		default:
  ------------------
  |  Branch (2693:3): [True: 18, False: 304]
  ------------------
 2694|     18|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     18|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2695|     18|			    "bzip2 decompression failed");
 2696|     18|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|     18|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2697|    322|	}
 2698|       |
 2699|       |	/* Update the pointers so decompressor can continue decoding. */
 2700|    304|	to_consume = zip->bzstream.total_in_lo32;
 2701|    304|	__archive_read_consume(a, to_consume);
 2702|       |
 2703|    304|	total_out = ((uint64_t) zip->bzstream.total_out_hi32 << 32) |
 2704|    304|	    zip->bzstream.total_out_lo32;
 2705|       |
 2706|    304|	zip->entry_bytes_remaining -= to_consume;
 2707|    304|	zip->entry_compressed_bytes_read += to_consume;
 2708|    304|	zip->entry_uncompressed_bytes_read += total_out;
 2709|       |
 2710|    304|	zip_read_decrypt_update(zip, to_consume, sp);
 2711|       |
 2712|    304|	if (zip->end_of_entry && zip->hctx_valid) {
  ------------------
  |  Branch (2712:6): [True: 96, False: 208]
  |  Branch (2712:27): [True: 0, False: 96]
  ------------------
 2713|      0|		r = check_authentication_code(a, NULL);
 2714|      0|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2714:7): [True: 0, False: 0]
  ------------------
 2715|      0|			return r;
 2716|      0|	}
 2717|       |
 2718|       |	/* Give libarchive its due. */
 2719|    304|	*size = (size_t)total_out;
 2720|    304|	*buff = zip->uncompressed_buffer;
 2721|       |
 2722|    304|	return ARCHIVE_OK;
  ------------------
  |  |  233|    304|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2723|    304|}
archive_read_support_format_zip.c:zipx_bzip2_init:
 2574|    125|{
 2575|    125|	int r;
 2576|       |
 2577|       |	/* Deallocate already existing BZ2 decompression context if it
 2578|       |	 * exists. */
 2579|    125|	if(zip->bzstream_valid) {
  ------------------
  |  Branch (2579:5): [True: 95, False: 30]
  ------------------
 2580|     95|		BZ2_bzDecompressEnd(&zip->bzstream);
 2581|     95|		zip->bzstream_valid = 0;
 2582|     95|	}
 2583|       |
 2584|       |	/* Allocate a new BZ2 decompression context. */
 2585|    125|	memset(&zip->bzstream, 0, sizeof(bz_stream));
 2586|    125|	r = BZ2_bzDecompressInit(&zip->bzstream, 0, 1);
 2587|    125|	if(r != BZ_OK) {
  ------------------
  |  Branch (2587:5): [True: 0, False: 125]
  ------------------
 2588|      0|		archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2589|      0|		    "bzip2 initialization failed (%d)",
 2590|      0|		    r);
 2591|       |
 2592|      0|		return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2593|      0|	}
 2594|       |
 2595|       |	/* Mark the bzstream field to be released in cleanup phase. */
 2596|    125|	zip->bzstream_valid = 1;
 2597|       |
 2598|       |	/* (Re)allocate the buffer that will contain decompressed bytes. */
 2599|    125|	free(zip->uncompressed_buffer);
 2600|       |
 2601|    125|	zip->uncompressed_buffer_size = 256 * 1024;
 2602|    125|	zip->uncompressed_buffer = malloc(zip->uncompressed_buffer_size);
 2603|    125|	if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (2603:6): [True: 0, False: 125]
  ------------------
 2604|      0|		archive_set_error(&a->archive, ENOMEM,
 2605|      0|		    "No memory for bzip2 decompression");
 2606|      0|		    return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2607|      0|	}
 2608|       |
 2609|       |	/* Initialization done. */
 2610|    125|	zip->decompress_init = 1;
 2611|    125|	return ARCHIVE_OK;
  ------------------
  |  |  233|    125|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2612|    125|}
archive_read_support_format_zip.c:zip_read_data_zipx_xz:
 2128|     51|{
 2129|     51|	struct zip *zip = a->format->data;
 2130|     51|	int ret;
 2131|     51|	lzma_ret lz_ret;
 2132|     51|	const void* compressed_buf;
 2133|     51|	const void* sp;
 2134|     51|	ssize_t bytes_avail, to_consume = 0;
 2135|       |
 2136|     51|	(void) offset; /* UNUSED */
 2137|       |
 2138|       |	/* Initialize decompressor if not yet initialized. */
 2139|     51|	if (!zip->decompress_init) {
  ------------------
  |  Branch (2139:6): [True: 35, False: 16]
  ------------------
 2140|     35|		ret = zipx_xz_init(a, zip);
 2141|     35|		if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|     35|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2141:7): [True: 0, False: 35]
  ------------------
 2142|      0|			return (ret);
 2143|     35|	}
 2144|       |
 2145|     51|	compressed_buf = sp = __archive_read_ahead(a, 1, &bytes_avail);
 2146|     51|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  129|     51|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (2146:6): [True: 38, False: 13]
  ------------------
 2147|     38|		&& bytes_avail > zip->entry_bytes_remaining) {
  ------------------
  |  Branch (2147:6): [True: 10, False: 28]
  ------------------
 2148|     10|		bytes_avail = (ssize_t)zip->entry_bytes_remaining;
 2149|     10|	}
 2150|     51|	if (bytes_avail < 0) {
  ------------------
  |  Branch (2150:6): [True: 0, False: 51]
  ------------------
 2151|      0|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      0|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2152|      0|		    "Truncated xz file body");
 2153|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2154|      0|	}
 2155|       |
 2156|     51|	zip_read_decrypt(zip, compressed_buf, bytes_avail,
 2157|     51|		&compressed_buf, &bytes_avail, &sp);
 2158|       |
 2159|     51|	zip->zipx_lzma_stream.next_in = compressed_buf;
 2160|     51|	zip->zipx_lzma_stream.avail_in = bytes_avail;
 2161|     51|	zip->zipx_lzma_stream.total_in = 0;
 2162|     51|	zip->zipx_lzma_stream.next_out = zip->uncompressed_buffer;
 2163|     51|	zip->zipx_lzma_stream.avail_out = zip->uncompressed_buffer_size;
 2164|     51|	zip->zipx_lzma_stream.total_out = 0;
 2165|       |
 2166|       |	/* Perform the decompression. */
 2167|     51|	lz_ret = lzma_code(&zip->zipx_lzma_stream, LZMA_RUN);
 2168|     51|	switch(lz_ret) {
 2169|      2|		case LZMA_DATA_ERROR:
  ------------------
  |  Branch (2169:3): [True: 2, False: 49]
  ------------------
 2170|      2|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      2|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2171|      2|			    "xz data error (%d)", (int) lz_ret);
 2172|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2173|       |
 2174|      0|		case LZMA_NO_CHECK:
  ------------------
  |  Branch (2174:3): [True: 0, False: 51]
  ------------------
 2175|     16|		case LZMA_OK:
  ------------------
  |  Branch (2175:3): [True: 16, False: 35]
  ------------------
 2176|     16|			break;
 2177|       |
 2178|     33|		default:
  ------------------
  |  Branch (2178:3): [True: 33, False: 18]
  ------------------
 2179|     33|			archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|     33|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2180|     33|			    "xz unknown error (%d)", (int) lz_ret);
 2181|     33|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     33|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2182|       |
 2183|      0|		case LZMA_STREAM_END:
  ------------------
  |  Branch (2183:3): [True: 0, False: 51]
  ------------------
 2184|      0|			lzma_end(&zip->zipx_lzma_stream);
 2185|      0|			zip->zipx_lzma_valid = 0;
 2186|       |
 2187|       |			/* This assertion is only possible if the size of the compressed data
 2188|       |			 * stream is known -> !ZIP_LENGTH_AT_END */
 2189|      0|			if((int64_t) zip->zipx_lzma_stream.total_in != zip->entry_bytes_remaining
  ------------------
  |  Branch (2189:7): [True: 0, False: 0]
  ------------------
 2190|      0|				&& !(zip->entry->zip_flags & ZIP_LENGTH_AT_END))
  ------------------
  |  |  129|      0|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (2190:8): [True: 0, False: 0]
  ------------------
 2191|      0|			{
 2192|      0|				archive_set_error(&a->archive,
 2193|      0|				    ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 2194|      0|				    "xz premature end of stream");
 2195|      0|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2196|      0|			}
 2197|       |
 2198|      0|			zip->end_of_entry = 1;
 2199|      0|			break;
 2200|     51|	}
 2201|       |
 2202|     16|	to_consume = (ssize_t)zip->zipx_lzma_stream.total_in;
 2203|       |
 2204|     16|	__archive_read_consume(a, to_consume);
 2205|     16|	zip->entry_bytes_remaining -= to_consume;
 2206|     16|	zip->entry_compressed_bytes_read += to_consume;
 2207|     16|	zip->entry_uncompressed_bytes_read += zip->zipx_lzma_stream.total_out;
 2208|       |
 2209|     16|	zip_read_decrypt_update(zip, to_consume, sp);
 2210|       |
 2211|     16|	if (zip->end_of_entry) {
  ------------------
  |  Branch (2211:6): [True: 0, False: 16]
  ------------------
 2212|      0|		if (zip->hctx_valid) {
  ------------------
  |  Branch (2212:7): [True: 0, False: 0]
  ------------------
 2213|      0|			ret = check_authentication_code(a, NULL);
 2214|      0|			if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2214:8): [True: 0, False: 0]
  ------------------
 2215|      0|				return ret;
 2216|      0|		}
 2217|      0|	}
 2218|       |
 2219|     16|	*size = (size_t)zip->zipx_lzma_stream.total_out;
 2220|     16|	*buff = zip->uncompressed_buffer;
 2221|       |
 2222|     16|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     16|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2223|     16|}
archive_read_support_format_zip.c:zipx_xz_init:
 1925|     35|{
 1926|     35|	lzma_ret r;
 1927|       |
 1928|     35|	if(zip->zipx_lzma_valid) {
  ------------------
  |  Branch (1928:5): [True: 0, False: 35]
  ------------------
 1929|      0|		lzma_end(&zip->zipx_lzma_stream);
 1930|      0|		zip->zipx_lzma_valid = 0;
 1931|      0|	}
 1932|       |
 1933|     35|	memset(&zip->zipx_lzma_stream, 0, sizeof(zip->zipx_lzma_stream));
 1934|     35|	r = lzma_stream_decoder(&zip->zipx_lzma_stream, UINT64_MAX, 0);
 1935|     35|	if (r != LZMA_OK) {
  ------------------
  |  Branch (1935:6): [True: 0, False: 35]
  ------------------
 1936|      0|		archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1937|      0|		    "xz initialization failed (%d)",
 1938|      0|		    r);
 1939|       |
 1940|      0|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 1941|      0|	}
 1942|       |
 1943|     35|	zip->zipx_lzma_valid = 1;
 1944|       |
 1945|     35|	free(zip->uncompressed_buffer);
 1946|       |
 1947|     35|	zip->uncompressed_buffer_size = 256 * 1024;
 1948|     35|	zip->uncompressed_buffer = malloc(zip->uncompressed_buffer_size);
 1949|     35|	if (zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (1949:6): [True: 0, False: 35]
  ------------------
 1950|      0|		archive_set_error(&a->archive, ENOMEM,
 1951|      0|		    "No memory for xz decompression");
 1952|      0|		    return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 1953|      0|	}
 1954|       |
 1955|     35|	zip->decompress_init = 1;
 1956|     35|	return (ARCHIVE_OK);
  ------------------
  |  |  233|     35|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 1957|     35|}
archive_read_support_format_zip.c:zip_read_data_zipx_ppmd:
 2498|  12.0k|{
 2499|  12.0k|	struct zip *zip = a->format->data;
 2500|  12.0k|	int ret;
 2501|  12.0k|	size_t consumed_bytes = 0;
 2502|       |
 2503|  12.0k|	(void) offset; /* UNUSED */
 2504|       |
 2505|       |	/* If we're here for the first time, initialize Ppmd8 decompression
 2506|       |	 * context first. */
 2507|  12.0k|	if(!zip->decompress_init) {
  ------------------
  |  Branch (2507:5): [True: 11.9k, False: 151]
  ------------------
 2508|  11.9k|		ret = zipx_ppmd8_init(a, zip);
 2509|  11.9k|		if(ret != ARCHIVE_OK)
  ------------------
  |  |  233|  11.9k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2509:6): [True: 1.12k, False: 10.7k]
  ------------------
 2510|  1.12k|			return ret;
 2511|  11.9k|	}
 2512|       |
 2513|       |	/* Fetch for more data. We're reading 1 byte here, but libarchive
 2514|       |	 * should prefetch more bytes. */
 2515|  10.9k|	if(__archive_read_ahead(a, 1, NULL) == NULL) {
  ------------------
  |  Branch (2515:5): [True: 16, False: 10.9k]
  ------------------
 2516|     16|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     16|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2517|     16|		    "Truncated PPMd8 file body");
 2518|     16|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     16|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2519|     16|	}
 2520|       |
 2521|       |	/* This counter will be updated inside ppmd_read(), which at one
 2522|       |	 * point will be called by Ppmd8_DecodeSymbol. */
 2523|  10.9k|	zip->zipx_ppmd_read_compressed = 0;
 2524|       |
 2525|       |	/* Decompression loop. */
 2526|   115M|	do {
 2527|   115M|		int sym = __archive_ppmd8_functions.Ppmd8_DecodeSymbol(
 2528|   115M|		    &zip->ppmd8);
 2529|   115M|		if(sym < 0) {
  ------------------
  |  Branch (2529:6): [True: 10.2k, False: 115M]
  ------------------
 2530|  10.2k|			zip->end_of_entry = 1;
 2531|  10.2k|			break;
 2532|  10.2k|		}
 2533|       |
 2534|       |		/* This field is set by ppmd_read() when there was no more data
 2535|       |		 * to be read. */
 2536|   115M|		if(zip->ppmd8_stream_failed) {
  ------------------
  |  Branch (2536:6): [True: 450, False: 115M]
  ------------------
 2537|    450|			archive_set_error(&a->archive,
 2538|    450|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|    450|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2539|    450|			    "Truncated PPMd8 file body");
 2540|    450|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    450|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2541|    450|		}
 2542|       |
 2543|   115M|		zip->uncompressed_buffer[consumed_bytes] = (uint8_t) sym;
 2544|   115M|		++consumed_bytes;
 2545|   115M|	} while(consumed_bytes < zip->uncompressed_buffer_size);
  ------------------
  |  Branch (2545:10): [True: 115M, False: 187]
  ------------------
 2546|       |
 2547|       |	/* Update pointers so we can continue decompression in another call. */
 2548|  10.4k|	zip->entry_bytes_remaining -= zip->zipx_ppmd_read_compressed;
 2549|  10.4k|	zip->entry_compressed_bytes_read += zip->zipx_ppmd_read_compressed;
 2550|  10.4k|	zip->entry_uncompressed_bytes_read += consumed_bytes;
 2551|       |
 2552|       |	/* If we're at the end of stream, deinitialize Ppmd8 context. */
 2553|  10.4k|	if(zip->end_of_entry) {
  ------------------
  |  Branch (2553:5): [True: 10.2k, False: 187]
  ------------------
 2554|  10.2k|		__archive_ppmd8_functions.Ppmd8_Free(&zip->ppmd8);
 2555|  10.2k|		zip->ppmd8_valid = 0;
 2556|       |
 2557|  10.2k|		if (zip->hctx_valid) {
  ------------------
  |  Branch (2557:7): [True: 208, False: 10.0k]
  ------------------
 2558|    208|			int r = check_authentication_code(a, NULL);
 2559|    208|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    208|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2559:8): [True: 122, False: 86]
  ------------------
 2560|    122|				return (r);
 2561|    208|		}
 2562|  10.2k|	}
 2563|       |
 2564|       |	/* Update pointers for libarchive. */
 2565|  10.3k|	*buff = zip->uncompressed_buffer;
 2566|  10.3k|	*size = consumed_bytes;
 2567|       |
 2568|  10.3k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  10.3k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2569|  10.4k|}
archive_read_support_format_zip.c:zipx_ppmd8_init:
 2389|  11.9k|{
 2390|  11.9k|	const void* p;
 2391|  11.9k|	uint32_t val;
 2392|  11.9k|	uint32_t order;
 2393|  11.9k|	uint32_t mem;
 2394|  11.9k|	uint32_t restore_method;
 2395|       |
 2396|       |	/* Remove previous decompression context if it exists. */
 2397|  11.9k|	if(zip->ppmd8_valid) {
  ------------------
  |  Branch (2397:5): [True: 33, False: 11.8k]
  ------------------
 2398|     33|		__archive_ppmd8_functions.Ppmd8_Free(&zip->ppmd8);
 2399|     33|		zip->ppmd8_valid = 0;
 2400|     33|	}
 2401|       |
 2402|       |	/* Create a new decompression context. */
 2403|  11.9k|	__archive_ppmd8_functions.Ppmd8_Construct(&zip->ppmd8);
 2404|  11.9k|	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|  11.9k|	zip->ppmd8.Stream.In = &zip->zipx_ppmd_stream;
 2410|  11.9k|	zip->zipx_ppmd_stream.a = a;
 2411|  11.9k|	zip->zipx_ppmd_stream.Read = &ppmd_read;
 2412|       |
 2413|       |	/* Reset number of read bytes to 0. */
 2414|  11.9k|	zip->zipx_ppmd_read_compressed = 0;
 2415|       |
 2416|       |	/* Read Ppmd8 header (2 bytes). */
 2417|  11.9k|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (2417:6): [True: 41, False: 11.8k]
  |  Branch (2417:25): [True: 224, False: 11.6k]
  ------------------
 2418|    265|		size_t out_len;
 2419|    265|		size_t consumed;
 2420|    265|		int ret;
 2421|       |
 2422|    265|		ret = zipx_read_header_and_decrypt(a, &p, 2, &out_len, &consumed);
 2423|    265|		if (ret != ARCHIVE_OK)
  ------------------
  |  |  233|    265|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (2423:7): [True: 1, False: 264]
  ------------------
 2424|      1|			return ret;
 2425|  11.6k|	} else {
 2426|  11.6k|		p = __archive_read_ahead(a, 2, NULL);
 2427|  11.6k|		if(!p) {
  ------------------
  |  Branch (2427:6): [True: 2, False: 11.6k]
  ------------------
 2428|      2|			archive_set_error(&a->archive,
 2429|      2|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      2|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2430|      2|			    "Truncated file data in PPMd8 stream");
 2431|      2|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 2432|      2|		}
 2433|  11.6k|	}
 2434|  11.9k|	__archive_read_consume(a, 2);
 2435|       |
 2436|       |	/* Decode the stream's compression parameters. */
 2437|  11.9k|	val = archive_le16dec(p);
 2438|  11.9k|	order = (val & 15) + 1;
 2439|  11.9k|	mem = ((val >> 4) & 0xff) + 1;
 2440|  11.9k|	restore_method = (val >> 12);
 2441|       |
 2442|  11.9k|	if(order < 2 || restore_method > 2) {
  ------------------
  |  Branch (2442:5): [True: 564, False: 11.3k]
  |  Branch (2442:18): [True: 556, False: 10.7k]
  ------------------
 2443|  1.12k|		archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|  1.12k|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 2444|  1.12k|		    "Invalid parameter set in PPMd8 stream (order=%" PRIu32 ", "
 2445|  1.12k|		    "restore=%" PRIu32 ")", order, restore_method);
 2446|  1.12k|		return (ARCHIVE_FAILED);
  ------------------
  |  |  237|  1.12k|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
 2447|  1.12k|	}
 2448|       |
 2449|       |	/* Allocate the memory needed to properly decompress the file. */
 2450|  10.7k|	if(!__archive_ppmd8_functions.Ppmd8_Alloc(&zip->ppmd8, mem << 20)) {
  ------------------
  |  Branch (2450:5): [True: 0, False: 10.7k]
  ------------------
 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|  10.7k|	zip->ppmd8_valid = 1;
 2460|       |
 2461|       |	/* Perform further Ppmd8 initialization. */
 2462|  10.7k|	if(!__archive_ppmd8_functions.Ppmd8_RangeDec_Init(&zip->ppmd8)) {
  ------------------
  |  Branch (2462:5): [True: 0, False: 10.7k]
  ------------------
 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|  10.7k|	__archive_ppmd8_functions.Ppmd8_Init(&zip->ppmd8, order,
 2469|  10.7k|	    restore_method);
 2470|       |
 2471|       |	/* Allocate the buffer that will hold uncompressed data. */
 2472|  10.7k|	free(zip->uncompressed_buffer);
 2473|       |
 2474|  10.7k|	zip->uncompressed_buffer_size = 256 * 1024;
 2475|  10.7k|	zip->uncompressed_buffer = malloc(zip->uncompressed_buffer_size);
 2476|       |
 2477|  10.7k|	if(zip->uncompressed_buffer == NULL) {
  ------------------
  |  Branch (2477:5): [True: 0, False: 10.7k]
  ------------------
 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|  10.7k|	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|  10.7k|	zip->entry_compressed_bytes_read += 2 + zip->zipx_ppmd_read_compressed;
 2491|       |
 2492|  10.7k|	return ARCHIVE_OK;
  ------------------
  |  |  233|  10.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 2493|  10.7k|}
archive_read_support_format_zip.c:ppmd_read:
  292|  11.0M|ppmd_read(void* p) {
  293|       |	/* Get the handle to current decompression context. */
  294|  11.0M|	struct archive_read *a = ((IByteIn*)p)->a;
  295|  11.0M|	struct zip *zip = a->format->data;
  296|       |
  297|       |	/* Fetch next byte. */
  298|  11.0M|	const uint8_t* data = __archive_read_ahead(a, 1, NULL);
  299|  11.0M|	if(data == NULL) {
  ------------------
  |  Branch (299:5): [True: 574, False: 11.0M]
  ------------------
  300|    574|		zip->ppmd8_stream_failed = 1;
  301|    574|		return 0;
  302|    574|	}
  303|       |
  304|  11.0M|	if (zip->tctx_valid || zip->cctx_valid) {
  ------------------
  |  Branch (304:6): [True: 17.6k, False: 10.9M]
  |  Branch (304:25): [True: 103k, False: 10.8M]
  ------------------
  305|   120k|		uint8_t val;
  306|   120k|		if (zip->tctx_valid) {
  ------------------
  |  Branch (306:7): [True: 17.6k, False: 103k]
  ------------------
  307|  17.6k|			trad_enc_decrypt_update(&zip->tctx,
  308|  17.6k|			    data, 1, &val, 1);
  309|   103k|		} else {
  310|   103k|			size_t dsize = 1;
  311|   103k|			archive_decrypto_aes_ctr_update(&zip->cctx,
  ------------------
  |  |  154|   103k|  __archive_cryptor.decrypto_aes_ctr_update(ctx, in, in_len, out, out_len)
  ------------------
  312|   103k|			    data, 1, &val, &dsize);
  313|   103k|		}
  314|   120k|		if (zip->hctx_valid)
  ------------------
  |  Branch (314:7): [True: 103k, False: 17.6k]
  ------------------
  315|   103k|			archive_hmac_sha1_update(&zip->hctx, data, 1);
  ------------------
  |  |   91|   103k|	__archive_hmac.__hmac_sha1_update(ctx, data, data_len)
  ------------------
  316|       |
  317|   120k|		__archive_read_consume(a, 1);
  318|   120k|		++zip->zipx_ppmd_read_compressed;
  319|   120k|		return val;
  320|   120k|	}
  321|       |
  322|  10.8M|	__archive_read_consume(a, 1);
  323|       |
  324|       |	/* Increment the counter. */
  325|  10.8M|	++zip->zipx_ppmd_read_compressed;
  326|       |
  327|       |	/* Return the next compressed byte. */
  328|  10.8M|	return data[0];
  329|  11.0M|}
archive_read_support_format_zip.c:consume_end_of_file_marker:
 1591|  19.3k|{
 1592|  19.3k|	const char *marker;
 1593|  19.3k|	const char *p;
 1594|  19.3k|	uint64_t compressed32, uncompressed32;
 1595|  19.3k|	uint64_t compressed64, uncompressed64;
 1596|  19.3k|	uint64_t compressed_actual, uncompressed_actual;
 1597|  19.3k|	uint32_t crc32_actual;
 1598|  19.3k|	const uint32_t PK78 = 0x08074B50ULL;
 1599|  19.3k|	uint8_t crc32_ignored, crc32_may_be_zero;
 1600|       |
 1601|       |	/* If there shouldn't be a marker, don't consume it. */
 1602|  19.3k|	if ((zip->entry->zip_flags & ZIP_LENGTH_AT_END) == 0) {
  ------------------
  |  |  129|  19.3k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (1602:6): [True: 5.38k, False: 13.9k]
  ------------------
 1603|  5.38k|		return;
 1604|  5.38k|	}
 1605|       |
 1606|       |	/* The longest Zip end-of-file record is 24 bytes.  Since an
 1607|       |	 * end-of-file record can never appear at the end of the
 1608|       |	 * archive, we know 24 bytes will be available unless
 1609|       |	 * the archive is severely truncated. */
 1610|  13.9k|	if (NULL == (marker = __archive_read_ahead(a, 24, NULL))) {
  ------------------
  |  Branch (1610:6): [True: 123, False: 13.8k]
  ------------------
 1611|    123|		return;
 1612|    123|	}
 1613|  13.8k|	p = marker;
 1614|       |
 1615|       |	/* The end-of-file record comprises:
 1616|       |	 * = Optional PK\007\010 marker
 1617|       |	 * = 4-byte CRC32
 1618|       |	 * = Compressed size
 1619|       |	 * = Uncompressed size
 1620|       |	 *
 1621|       |	 * The last two fields are either both 32 bits or both 64
 1622|       |	 * bits.  We check all possible layouts and accept any one
 1623|       |	 * that gives us a complete match, else we make a best-effort
 1624|       |	 * attempt to parse out the pieces.
 1625|       |	 */
 1626|       |
 1627|       |	/* CRC32 checking can be tricky:
 1628|       |	 * * Test suites sometimes ignore the CRC32
 1629|       |	 * * AES AE-2 always writes zero for the CRC32
 1630|       |	 * * AES AE-1 sometimes writes zero for the CRC32
 1631|       |	 */
 1632|  13.8k|	crc32_ignored = zip->ignore_crc32;
 1633|  13.8k|	crc32_may_be_zero = 0;
 1634|  13.8k|	crc32_actual = zip->computed_crc32;
 1635|  13.8k|	if (zip->hctx_valid) {
  ------------------
  |  Branch (1635:6): [True: 1.97k, False: 11.8k]
  ------------------
 1636|  1.97k|	  switch (zip->entry->aes_extra.vendor) {
 1637|     36|	  case AES_VENDOR_AE_2:
  ------------------
  |  |  114|     36|#define AES_VENDOR_AE_2	0x0002
  ------------------
  |  Branch (1637:4): [True: 36, False: 1.93k]
  ------------------
 1638|     36|	    crc32_actual = 0;
 1639|     36|	    break;
 1640|      0|	  case AES_VENDOR_AE_1:
  ------------------
  |  |  113|      0|#define AES_VENDOR_AE_1	0x0001
  ------------------
  |  Branch (1640:4): [True: 0, False: 1.97k]
  ------------------
 1641|  1.93k|	  default:
  ------------------
  |  Branch (1641:4): [True: 1.93k, False: 36]
  ------------------
 1642|  1.93k|	    crc32_may_be_zero = 1;
 1643|  1.93k|	    break;
 1644|  1.97k|	  }
 1645|  1.97k|	}
 1646|       |
 1647|       |	/* Values computed from the actual data in the archive. */
 1648|  13.8k|	compressed_actual = (uint64_t)zip->entry_compressed_bytes_read;
 1649|  13.8k|	uncompressed_actual = (uint64_t)zip->entry_uncompressed_bytes_read;
 1650|       |
 1651|       |
 1652|       |	/* Longest: PK78 marker, all 64-bit fields (24 bytes total) */
 1653|  13.8k|	if (archive_le32dec(p) == PK78
  ------------------
  |  Branch (1653:6): [True: 4.12k, False: 9.73k]
  ------------------
 1654|  4.12k|	    && ((archive_le32dec(p + 4) == crc32_actual)
  ------------------
  |  Branch (1654:10): [True: 908, False: 3.21k]
  ------------------
 1655|  3.21k|		|| (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1655:7): [True: 704, False: 2.51k]
  |  Branch (1655:28): [True: 0, False: 704]
  ------------------
 1656|  3.21k|		|| crc32_ignored)
  ------------------
  |  Branch (1656:6): [True: 3.21k, False: 0]
  ------------------
 1657|  4.12k|	    && (archive_le64dec(p + 8) == compressed_actual)
  ------------------
  |  Branch (1657:9): [True: 1.05k, False: 3.06k]
  ------------------
 1658|  1.05k|	    && (archive_le64dec(p + 16) == uncompressed_actual)) {
  ------------------
  |  Branch (1658:9): [True: 219, False: 838]
  ------------------
 1659|    219|		if (!crc32_ignored) {
  ------------------
  |  Branch (1659:7): [True: 0, False: 219]
  ------------------
 1660|      0|			zip->entry->crc32 = crc32_actual;
 1661|      0|		}
 1662|    219|		zip->entry->compressed_size = compressed_actual;
 1663|    219|		zip->entry->uncompressed_size = uncompressed_actual;
 1664|    219|		zip->unconsumed += 24;
 1665|    219|		return;
 1666|    219|	}
 1667|       |
 1668|       |	/* No PK78 marker, 64-bit fields (20 bytes total) */
 1669|  13.6k|	if (((archive_le32dec(p) == crc32_actual)
  ------------------
  |  Branch (1669:7): [True: 1.03k, False: 12.6k]
  ------------------
 1670|  12.6k|	     || (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1670:11): [True: 1.93k, False: 10.6k]
  |  Branch (1670:32): [True: 1.16k, False: 772]
  ------------------
 1671|  11.4k|	     || crc32_ignored)
  ------------------
  |  Branch (1671:10): [True: 11.4k, False: 0]
  ------------------
 1672|  13.6k|	    && (archive_le64dec(p + 4) == compressed_actual)
  ------------------
  |  Branch (1672:9): [True: 1.47k, False: 12.1k]
  ------------------
 1673|  1.47k|	    && (archive_le64dec(p + 12) == uncompressed_actual)) {
  ------------------
  |  Branch (1673:9): [True: 158, False: 1.31k]
  ------------------
 1674|    158|	        if (!crc32_ignored) {
  ------------------
  |  Branch (1674:14): [True: 0, False: 158]
  ------------------
 1675|      0|			zip->entry->crc32 = crc32_actual;
 1676|      0|		}
 1677|    158|		zip->entry->compressed_size = compressed_actual;
 1678|    158|		zip->entry->uncompressed_size = uncompressed_actual;
 1679|    158|		zip->unconsumed += 20;
 1680|    158|		return;
 1681|    158|	}
 1682|       |
 1683|       |	/* PK78 marker and 32-bit fields (16 bytes total) */
 1684|  13.4k|	if (archive_le32dec(p) == PK78
  ------------------
  |  Branch (1684:6): [True: 3.90k, False: 9.57k]
  ------------------
 1685|  3.90k|	    && ((archive_le32dec(p + 4) == crc32_actual)
  ------------------
  |  Branch (1685:10): [True: 906, False: 2.99k]
  ------------------
 1686|  2.99k|		|| (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1686:7): [True: 704, False: 2.29k]
  |  Branch (1686:28): [True: 0, False: 704]
  ------------------
 1687|  2.99k|		|| crc32_ignored)
  ------------------
  |  Branch (1687:6): [True: 2.99k, False: 0]
  ------------------
 1688|  3.90k|	    && (archive_le32dec(p + 8) == compressed_actual)
  ------------------
  |  Branch (1688:9): [True: 1.44k, False: 2.45k]
  ------------------
 1689|  1.44k|	    && (archive_le32dec(p + 12) == uncompressed_actual)) {
  ------------------
  |  Branch (1689:9): [True: 609, False: 839]
  ------------------
 1690|    609|		if (!crc32_ignored) {
  ------------------
  |  Branch (1690:7): [True: 0, False: 609]
  ------------------
 1691|      0|			zip->entry->crc32 = crc32_actual;
 1692|      0|		}
 1693|    609|		zip->entry->compressed_size = compressed_actual;
 1694|    609|		zip->entry->uncompressed_size = uncompressed_actual;
 1695|    609|		zip->unconsumed += 16;
 1696|    609|		return;
 1697|    609|	}
 1698|       |
 1699|       |	/* Shortest: No PK78 marker, all 32-bit fields (12 bytes total) */
 1700|  12.8k|	if (((archive_le32dec(p) == crc32_actual)
  ------------------
  |  Branch (1700:7): [True: 1.03k, False: 11.8k]
  ------------------
 1701|  11.8k|	     || (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
  ------------------
  |  Branch (1701:11): [True: 1.93k, False: 9.90k]
  |  Branch (1701:32): [True: 1.16k, False: 772]
  ------------------
 1702|  10.6k|	     || crc32_ignored)
  ------------------
  |  Branch (1702:10): [True: 10.6k, False: 0]
  ------------------
 1703|  12.8k|	    && (archive_le32dec(p + 4) == compressed_actual)
  ------------------
  |  Branch (1703:9): [True: 1.17k, False: 11.6k]
  ------------------
 1704|  1.17k|	    && (archive_le32dec(p + 8) == uncompressed_actual)) {
  ------------------
  |  Branch (1704:9): [True: 568, False: 606]
  ------------------
 1705|    568|		if (!crc32_ignored) {
  ------------------
  |  Branch (1705:7): [True: 0, False: 568]
  ------------------
 1706|      0|			zip->entry->crc32 = crc32_actual;
 1707|      0|		}
 1708|    568|		zip->entry->compressed_size = compressed_actual;
 1709|    568|		zip->entry->uncompressed_size = uncompressed_actual;
 1710|    568|		zip->unconsumed += 12;
 1711|    568|		return;
 1712|    568|	}
 1713|       |
 1714|       |	/* None of the exact patterns matched. If entry size was unknown
 1715|       |	 * (ZIP_LENGTH_AT_END flag), before treating this as
 1716|       |	 * corruption, check whether the next ZIP record follows the data
 1717|       |	 * immediately: a length-at-end entry whose compression format has
 1718|       |	 * its own end-of-stream marker (e.g. PPMd) may be written with no
 1719|       |	 * data descriptor at all.  In that case the byte counts we measured
 1720|       |	 * during decompression are authoritative, so trust them and leave
 1721|       |	 * the stream untouched. */
 1722|  12.3k|	if (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  129|  12.3k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (1722:6): [True: 12.3k, False: 0]
  ------------------
 1723|  12.3k|	{
 1724|  12.3k|		const uint32_t sig = archive_le32dec(p);
 1725|  12.3k|		if (sig == 0x04034b50U     /* Local file header */
  ------------------
  |  Branch (1725:7): [True: 3.82k, False: 8.48k]
  ------------------
 1726|  8.48k|		    || sig == 0x02014b50U  /* Central directory record */
  ------------------
  |  Branch (1726:10): [True: 2, False: 8.48k]
  ------------------
 1727|  8.48k|		    || sig == 0x06054b50U) /* End of central directory */ {
  ------------------
  |  Branch (1727:10): [True: 1, False: 8.48k]
  ------------------
 1728|  3.82k|			zip->entry->compressed_size = compressed_actual;
 1729|  3.82k|			zip->entry->uncompressed_size = uncompressed_actual;
 1730|  3.82k|			return;
 1731|  3.82k|		}
 1732|  12.3k|	}
 1733|       |
 1734|       |	/* If none of the above patterns gives us a full exact match,
 1735|       |	 * then there's something definitely amiss.  The fallback code
 1736|       |	 * below will parse out some plausible values for error
 1737|       |	 * reporting purposes.  Note that this won't actually
 1738|       |	 * consume anything:
 1739|       |	 *
 1740|       |	 * = If there really is a marker here, the logic to resync to
 1741|       |	 *   the next entry will suffice to skip it.
 1742|       |	 *
 1743|       |	 * = There might not really be a marker: Corruption or bugs
 1744|       |	 *   may have set the length-at-end bit without a marker ever
 1745|       |	 *   having actually been written. In this case, we
 1746|       |	 *   explicitly should not consume any bytes, since that would
 1747|       |	 *   prevent us from correctly reading the next entry.
 1748|       |	 */
 1749|  8.48k|	if (archive_le32dec(p) == PK78) {
  ------------------
  |  Branch (1749:6): [True: 2.81k, False: 5.66k]
  ------------------
 1750|  2.81k|		p += 4; /* Ignore PK78 if it appears to be present */
 1751|  2.81k|	}
 1752|  8.48k|	zip->entry->crc32 = archive_le32dec(p);  /* Parse CRC32 */
 1753|  8.48k|	p += 4;
 1754|       |
 1755|       |	/* Consider both 32- and 64-bit interpretations */
 1756|  8.48k|	compressed32 = archive_le32dec(p);
 1757|  8.48k|	uncompressed32 = archive_le32dec(p + 4);
 1758|  8.48k|	compressed64 = archive_le64dec(p);
 1759|  8.48k|	uncompressed64 = archive_le64dec(p + 8);
 1760|       |
 1761|       |	/* The earlier patterns may have failed because of CRC32
 1762|       |	 * mismatch, so it's still possible that both sizes match.
 1763|       |	 * Try to match as many as we can...
 1764|       |	 */
 1765|  8.48k|	if (compressed32 == compressed_actual
  ------------------
  |  Branch (1765:6): [True: 891, False: 7.58k]
  ------------------
 1766|    891|	    && uncompressed32 == uncompressed_actual) {
  ------------------
  |  Branch (1766:9): [True: 0, False: 891]
  ------------------
 1767|       |		/* Both 32-bit fields match */
 1768|      0|		zip->entry->compressed_size = compressed32;
 1769|      0|		zip->entry->uncompressed_size = uncompressed32;
 1770|  8.48k|	} else if (compressed64 == compressed_actual
  ------------------
  |  Branch (1770:13): [True: 658, False: 7.82k]
  ------------------
 1771|  7.82k|		   || uncompressed64 == uncompressed_actual) {
  ------------------
  |  Branch (1771:9): [True: 572, False: 7.25k]
  ------------------
 1772|       |		/* One or both 64-bit fields match */
 1773|  1.23k|		zip->entry->compressed_size = compressed64;
 1774|  1.23k|		zip->entry->uncompressed_size = uncompressed64;
 1775|  7.25k|	} else {
 1776|       |		/* Zero or one 32-bit fields match */
 1777|  7.25k|		zip->entry->compressed_size = compressed32;
 1778|  7.25k|		zip->entry->uncompressed_size = uncompressed32;
 1779|  7.25k|	}
 1780|  8.48k|}
archive_read_support_format_zip.c:archive_read_format_zip_read_data_skip_streamable:
 3801|  36.9k|{
 3802|  36.9k|	struct zip *zip = a->format->data;
 3803|  36.9k|	int64_t bytes_skipped;
 3804|       |
 3805|  36.9k|	bytes_skipped = __archive_read_consume(a, zip->unconsumed);
 3806|  36.9k|	zip->unconsumed = 0;
 3807|  36.9k|	if (bytes_skipped < 0)
  ------------------
  |  Branch (3807:6): [True: 0, False: 36.9k]
  ------------------
 3808|      0|		return (ARCHIVE_FATAL);
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3809|       |
 3810|       |	/* If we've already read to end of data, we're done. */
 3811|  36.9k|	if (zip->end_of_entry)
  ------------------
  |  Branch (3811:6): [True: 23.7k, False: 13.2k]
  ------------------
 3812|  23.7k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  23.7k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3813|       |
 3814|       |	/* So we know we're streaming... */
 3815|  13.2k|	if (0 == (zip->entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  129|  13.2k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (3815:6): [True: 6.75k, False: 6.46k]
  ------------------
 3816|  9.60k|	    || zip->entry->compressed_size > 0) {
  ------------------
  |  Branch (3816:9): [True: 2.84k, False: 3.62k]
  ------------------
 3817|       |		/* We know the compressed length, so we can just skip. */
 3818|  9.60k|		bytes_skipped = __archive_read_consume(a,
 3819|  9.60k|					zip->entry_bytes_remaining);
 3820|  9.60k|		if (bytes_skipped < 0)
  ------------------
  |  Branch (3820:7): [True: 187, False: 9.41k]
  ------------------
 3821|    187|			return (ARCHIVE_FATAL);
  ------------------
  |  |  239|    187|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3822|  9.41k|		return (ARCHIVE_OK);
  ------------------
  |  |  233|  9.41k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3823|  9.60k|	}
 3824|       |
 3825|  3.62k|	if (zip->init_decryption) {
  ------------------
  |  Branch (3825:6): [True: 2.19k, False: 1.42k]
  ------------------
 3826|  2.19k|		int r;
 3827|       |
 3828|  2.19k|		zip->has_encrypted_entries = 1;
 3829|  2.19k|		if (zip->entry->zip_flags & ZIP_STRONG_ENCRYPTED)
  ------------------
  |  |  130|  2.19k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
  |  Branch (3829:7): [True: 122, False: 2.07k]
  ------------------
 3830|    122|			r = read_decryption_header(a);
 3831|  2.07k|		else if (zip->entry->compression == WINZIP_AES_ENCRYPTION)
  ------------------
  |  |  145|  2.07k|#define WINZIP_AES_ENCRYPTION	99
  ------------------
  |  Branch (3831:12): [True: 72, False: 2.00k]
  ------------------
 3832|     72|			r = init_WinZip_AES_decryption(a);
 3833|  2.00k|		else
 3834|  2.00k|			r = init_traditional_PKWARE_decryption(a);
 3835|  2.19k|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|  2.19k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3835:7): [True: 1.81k, False: 387]
  ------------------
 3836|  1.81k|			return (r);
 3837|    387|		zip->init_decryption = 0;
 3838|    387|	}
 3839|       |
 3840|       |	/* We're streaming and we don't know the length. */
 3841|       |	/* If the body is compressed and we know the format, we can
 3842|       |	 * find an exact end-of-entry by decompressing it. */
 3843|  1.81k|	switch (zip->entry->compression) {
 3844|      0|#ifdef HAVE_ZLIB_H
 3845|     89|	case 8: /* Deflate compression. */
  ------------------
  |  Branch (3845:2): [True: 89, False: 1.72k]
  ------------------
 3846|    178|		while (!zip->end_of_entry) {
  ------------------
  |  Branch (3846:10): [True: 91, False: 87]
  ------------------
 3847|     91|			int64_t offset = 0;
 3848|     91|			const void *buff = NULL;
 3849|     91|			size_t size = 0;
 3850|     91|			int r;
 3851|     91|			r =  zip_read_data_deflate(a, &buff, &size, &offset);
 3852|     91|			if (r != ARCHIVE_OK)
  ------------------
  |  |  233|     91|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (3852:8): [True: 2, False: 89]
  ------------------
 3853|      2|				return (r);
 3854|     91|		}
 3855|     87|		return ARCHIVE_OK;
  ------------------
  |  |  233|     87|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3856|      0|#endif
 3857|  1.72k|	default: /* Uncompressed or unknown. */
  ------------------
  |  Branch (3857:2): [True: 1.72k, False: 89]
  ------------------
 3858|       |		/* Scan for a PK\007\010 signature. */
 3859|  1.89k|		for (;;) {
 3860|  1.89k|			const char *p, *buff;
 3861|  1.89k|			ssize_t bytes_avail;
 3862|  1.89k|			buff = __archive_read_ahead(a, 16, &bytes_avail);
 3863|  1.89k|			if (bytes_avail < 16) {
  ------------------
  |  Branch (3863:8): [True: 77, False: 1.82k]
  ------------------
 3864|     77|				archive_set_error(&a->archive,
 3865|     77|				    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|     77|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 3866|     77|				    "Truncated ZIP file data");
 3867|     77|				return (ARCHIVE_FATAL);
  ------------------
  |  |  239|     77|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 3868|     77|			}
 3869|  1.82k|			p = buff;
 3870|   461k|			while (p <= buff + bytes_avail - 16) {
  ------------------
  |  Branch (3870:11): [True: 461k, False: 172]
  ------------------
 3871|   461k|				if (p[3] == 'P') { p += 3; }
  ------------------
  |  Branch (3871:9): [True: 3.38k, False: 457k]
  ------------------
 3872|   457k|				else if (p[3] == 'K') { p += 2; }
  ------------------
  |  Branch (3872:14): [True: 2.04k, False: 455k]
  ------------------
 3873|   455k|				else if (p[3] == '\007') { p += 1; }
  ------------------
  |  Branch (3873:14): [True: 3.09k, False: 452k]
  ------------------
 3874|   452k|				else if (p[3] == '\010' && p[2] == '\007'
  ------------------
  |  Branch (3874:14): [True: 6.00k, False: 446k]
  |  Branch (3874:32): [True: 2.26k, False: 3.74k]
  ------------------
 3875|  2.26k|				    && p[1] == 'K' && p[0] == 'P') {
  ------------------
  |  Branch (3875:12): [True: 1.88k, False: 385]
  |  Branch (3875:27): [True: 1.64k, False: 232]
  ------------------
 3876|  1.64k|					if (zip->entry->flags & LA_USED_ZIP64)
  ------------------
  |  |  137|  1.64k|#define LA_USED_ZIP64	(1 << 0)
  ------------------
  |  Branch (3876:10): [True: 69, False: 1.58k]
  ------------------
 3877|     69|						__archive_read_consume(a,
 3878|     69|						    p - buff + 24);
 3879|  1.58k|					else
 3880|  1.58k|						__archive_read_consume(a,
 3881|  1.58k|						    p - buff + 16);
 3882|  1.64k|					return ARCHIVE_OK;
  ------------------
  |  |  233|  1.64k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3883|   451k|				} else { p += 4; }
 3884|   461k|			}
 3885|    172|			__archive_read_consume(a, p - buff);
 3886|    172|		}
 3887|  1.81k|	}
 3888|  1.81k|}
archive_read_support_format_zip.c:archive_read_format_zip_cleanup:
 3531|  33.4k|{
 3532|  33.4k|	struct zip *zip = a->format->data;
 3533|  33.4k|	struct zip_entry *zip_entry, *next_zip_entry;
 3534|       |
 3535|  33.4k|#ifdef HAVE_ZLIB_H
 3536|  33.4k|	if (zip->stream_valid)
  ------------------
  |  Branch (3536:6): [True: 323, False: 33.1k]
  ------------------
 3537|    323|		inflateEnd(&zip->stream);
 3538|  33.4k|#endif
 3539|       |
 3540|  33.4k|#if HAVE_LZMA_H && HAVE_LIBLZMA
 3541|  33.4k|    if (zip->zipx_lzma_valid) {
  ------------------
  |  Branch (3541:9): [True: 110, False: 33.3k]
  ------------------
 3542|    110|		lzma_end(&zip->zipx_lzma_stream);
 3543|    110|	}
 3544|  33.4k|#endif
 3545|       |
 3546|  33.4k|#ifdef HAVE_BZLIB_H
 3547|  33.4k|	if (zip->bzstream_valid) {
  ------------------
  |  Branch (3547:6): [True: 30, False: 33.4k]
  ------------------
 3548|     30|		BZ2_bzDecompressEnd(&zip->bzstream);
 3549|     30|	}
 3550|  33.4k|#endif
 3551|       |
 3552|       |#if HAVE_ZSTD_H && HAVE_LIBZSTD
 3553|       |	if (zip->zstdstream_valid) {
 3554|       |		ZSTD_freeDStream(zip->zstdstream);
 3555|       |	}
 3556|       |#endif
 3557|       |
 3558|  33.4k|	free(zip->uncompressed_buffer);
 3559|       |
 3560|  33.4k|	if (zip->ppmd8_valid)
  ------------------
  |  Branch (3560:6): [True: 469, False: 32.9k]
  ------------------
 3561|    469|		__archive_ppmd8_functions.Ppmd8_Free(&zip->ppmd8);
 3562|       |
 3563|  33.4k|	if (zip->zip_entries) {
  ------------------
  |  Branch (3563:6): [True: 2.62k, False: 30.8k]
  ------------------
 3564|  2.62k|		zip_entry = zip->zip_entries;
 3565|  6.29k|		while (zip_entry != NULL) {
  ------------------
  |  Branch (3565:10): [True: 3.66k, False: 2.62k]
  ------------------
 3566|  3.66k|			next_zip_entry = zip_entry->next;
 3567|  3.66k|			archive_string_free(&zip_entry->rsrcname);
 3568|  3.66k|			free(zip_entry);
 3569|  3.66k|			zip_entry = next_zip_entry;
 3570|  3.66k|		}
 3571|  2.62k|	}
 3572|  33.4k|	free(zip->decrypted_buffer);
 3573|  33.4k|	if (zip->cctx_valid)
  ------------------
  |  Branch (3573:6): [True: 35, False: 33.4k]
  ------------------
 3574|     35|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  156|     35|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 3575|  33.4k|	if (zip->hctx_valid)
  ------------------
  |  Branch (3575:6): [True: 35, False: 33.4k]
  ------------------
 3576|     35|		archive_hmac_sha1_cleanup(&zip->hctx);
  ------------------
  |  |   95|     35|	__archive_hmac.__hmac_sha1_cleanup(ctx)
  ------------------
 3577|  33.4k|	free(zip->iv);
 3578|  33.4k|	free(zip->erd);
 3579|  33.4k|	free(zip->v_data);
 3580|  33.4k|	archive_string_free(&zip->format_name);
 3581|  33.4k|	free(zip);
 3582|  33.4k|	a->format->data = NULL;
 3583|  33.4k|	return (ARCHIVE_OK);
  ------------------
  |  |  233|  33.4k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 3584|  33.4k|}
archive_read_support_format_zip.c:archive_read_support_format_zip_capabilities_streamable:
 3665|  5.03k|{
 3666|  5.03k|	(void)a; /* UNUSED */
 3667|  5.03k|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA |
  ------------------
  |  |  398|  5.03k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
 3668|  5.03k|		ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  399|  5.03k|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
 3669|  5.03k|}
archive_read_support_format_zip.c:archive_read_format_zip_has_encrypted_entries:
 3588|  2.67k|{
 3589|  2.67k|	if (_a && _a->format) {
  ------------------
  |  Branch (3589:6): [True: 2.67k, False: 0]
  |  Branch (3589:12): [True: 2.67k, False: 0]
  ------------------
 3590|  2.67k|		struct zip *zip = _a->format->data;
 3591|  2.67k|		if (zip) {
  ------------------
  |  Branch (3591:7): [True: 2.67k, False: 0]
  ------------------
 3592|  2.67k|			return zip->has_encrypted_entries;
 3593|  2.67k|		}
 3594|  2.67k|	}
 3595|      0|	return ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW;
  ------------------
  |  |  411|      0|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 3596|  2.67k|}
archive_read_support_format_zip.c:archive_read_format_zip_seekable_bid:
 4044|  16.4k|{
 4045|  16.4k|	struct zip *zip = a->format->data;
 4046|  16.4k|	int64_t file_size, current_offset;
 4047|  16.4k|	const char *h;
 4048|  16.4k|	int i, tail;
 4049|       |
 4050|       |	/* If someone has already bid more than 32, then avoid
 4051|       |	   trashing the look-ahead buffers with a seek. */
 4052|  16.4k|	if (best_bid > 32)
  ------------------
  |  Branch (4052:6): [True: 8.74k, False: 7.67k]
  ------------------
 4053|  8.74k|		return (-1);
 4054|       |
 4055|  7.67k|	file_size = __archive_read_seek(a, 0, SEEK_END);
 4056|  7.67k|	if (file_size <= 0)
  ------------------
  |  Branch (4056:6): [True: 635, False: 7.04k]
  ------------------
 4057|    635|		return 0;
 4058|       |
 4059|       |	/* Search last 16k of file for end-of-central-directory
 4060|       |	 * record (which starts with PK\005\006) */
 4061|  7.04k|	tail = (int)zipmin(1024 * 16, file_size);
  ------------------
  |  |  261|  7.04k|#define	zipmin(a,b) ((a) < (b) ? (a) : (b))
  |  |  ------------------
  |  |  |  Branch (261:22): [True: 363, False: 6.68k]
  |  |  ------------------
  ------------------
 4062|  7.04k|	current_offset = __archive_read_seek(a, -tail, SEEK_END);
 4063|  7.04k|	if (current_offset < 0)
  ------------------
  |  Branch (4063:6): [True: 0, False: 7.04k]
  ------------------
 4064|      0|		return 0;
 4065|  7.04k|	if ((h = __archive_read_ahead(a, (size_t)tail, NULL)) == NULL)
  ------------------
  |  Branch (4065:6): [True: 0, False: 7.04k]
  ------------------
 4066|      0|		return 0;
 4067|       |	/* Boyer-Moore search backwards from the end, since we want
 4068|       |	 * to match the last EOCD in the file (there can be more than
 4069|       |	 * one if there is an uncompressed Zip archive as a member
 4070|       |	 * within this Zip archive). */
 4071|  2.97M|	for (i = tail - 22; i > 0;) {
  ------------------
  |  Branch (4071:22): [True: 2.96M, False: 6.72k]
  ------------------
 4072|  2.96M|		switch (h[i]) {
 4073|  35.4k|		case 'P':
  ------------------
  |  Branch (4073:3): [True: 35.4k, False: 2.93M]
  ------------------
 4074|  35.4k|			if (memcmp(h + i, "PK\005\006", 4) == 0) {
  ------------------
  |  Branch (4074:8): [True: 323, False: 35.1k]
  ------------------
 4075|    323|				int ret = read_eocd(zip, h + i,
 4076|    323|				    current_offset + i);
 4077|       |				/* Zip64 EOCD locator precedes
 4078|       |				 * regular EOCD if present. */
 4079|    323|				if (i >= 20 && memcmp(h + i - 20, "PK\006\007", 4) == 0) {
  ------------------
  |  Branch (4079:9): [True: 318, False: 5]
  |  Branch (4079:20): [True: 161, False: 157]
  ------------------
 4080|    161|					int ret_zip64 = read_zip64_eocd(a, zip, h + i - 20);
 4081|    161|					if (ret_zip64 > ret)
  ------------------
  |  Branch (4081:10): [True: 27, False: 134]
  ------------------
 4082|     27|						ret = ret_zip64;
 4083|    161|				}
 4084|    323|				return (ret);
 4085|    323|			}
 4086|  35.1k|			i -= 4;
 4087|  35.1k|			break;
 4088|  14.9k|		case 'K': i -= 1; break;
  ------------------
  |  Branch (4088:3): [True: 14.9k, False: 2.95M]
  ------------------
 4089|  29.6k|		case 005: i -= 2; break;
  ------------------
  |  Branch (4089:3): [True: 29.6k, False: 2.94M]
  ------------------
 4090|  7.75k|		case 006: i -= 3; break;
  ------------------
  |  Branch (4090:3): [True: 7.75k, False: 2.96M]
  ------------------
 4091|  2.88M|		default: i -= 4; break;
  ------------------
  |  Branch (4091:3): [True: 2.88M, False: 87.7k]
  ------------------
 4092|  2.96M|		}
 4093|  2.96M|	}
 4094|  6.72k|	return 0;
 4095|  7.04k|}
archive_read_support_format_zip.c:read_eocd:
 3959|    323|{
 3960|    323|	uint16_t disk_num;
 3961|    323|	uint32_t cd_size, cd_offset;
 3962|       |
 3963|    323|	disk_num = archive_le16dec(p + 4);
 3964|    323|	cd_size = archive_le32dec(p + 12);
 3965|    323|	cd_offset = archive_le32dec(p + 16);
 3966|       |
 3967|       |	/* Sanity-check the EOCD we've found. */
 3968|       |
 3969|       |	/* This must be the first volume. */
 3970|    323|	if (disk_num != 0)
  ------------------
  |  Branch (3970:6): [True: 129, False: 194]
  ------------------
 3971|    129|		return 0;
 3972|       |	/* Central directory must be on this volume. */
 3973|    194|	if (disk_num != archive_le16dec(p + 6))
  ------------------
  |  Branch (3973:6): [True: 10, False: 184]
  ------------------
 3974|     10|		return 0;
 3975|       |	/* All central directory entries must be on this volume. */
 3976|    184|	if (archive_le16dec(p + 10) != archive_le16dec(p + 8))
  ------------------
  |  Branch (3976:6): [True: 15, False: 169]
  ------------------
 3977|     15|		return 0;
 3978|       |	/* Central directory can't extend beyond start of EOCD record. */
 3979|    169|	if ((int64_t)cd_offset + cd_size > current_offset)
  ------------------
  |  Branch (3979:6): [True: 41, False: 128]
  ------------------
 3980|     41|		return 0;
 3981|       |
 3982|       |	/* Save the central directory location for later use. */
 3983|    128|	zip->central_directory_offset = cd_offset;
 3984|    128|	zip->central_directory_offset_adjusted = current_offset - cd_size;
 3985|       |
 3986|       |	/* This is just a tiny bit higher than the maximum
 3987|       |	   returned by the streaming Zip bidder.  This ensures
 3988|       |	   that the more accurate seeking Zip parser wins
 3989|       |	   whenever seek is available. */
 3990|    128|	return 32;
 3991|    169|}
archive_read_support_format_zip.c:read_zip64_eocd:
 3999|    161|{
 4000|    161|	int64_t eocd64_offset;
 4001|    161|	int64_t eocd64_size;
 4002|       |
 4003|       |	/* Sanity-check the locator record. */
 4004|       |
 4005|       |	/* Central dir must be on first volume. */
 4006|    161|	if (archive_le32dec(p + 4) != 0)
  ------------------
  |  Branch (4006:6): [True: 9, False: 152]
  ------------------
 4007|      9|		return 0;
 4008|       |	/* Must be only a single volume. */
 4009|    152|	if (archive_le32dec(p + 16) != 1)
  ------------------
  |  Branch (4009:6): [True: 4, False: 148]
  ------------------
 4010|      4|		return 0;
 4011|       |
 4012|       |	/* Find the Zip64 EOCD record. */
 4013|    148|	eocd64_offset = archive_le64dec(p + 8);
 4014|    148|	if (__archive_read_seek(a, eocd64_offset, SEEK_SET) < 0)
  ------------------
  |  Branch (4014:6): [True: 20, False: 128]
  ------------------
 4015|     20|		return 0;
 4016|    128|	if ((p = __archive_read_ahead(a, 56, NULL)) == NULL)
  ------------------
  |  Branch (4016:6): [True: 4, False: 124]
  ------------------
 4017|      4|		return 0;
 4018|       |	/* Make sure we can read all of it. */
 4019|    124|	eocd64_size = archive_le64dec(p + 4) + 12;
 4020|    124|	if (eocd64_size < 56 || eocd64_size > 16384)
  ------------------
  |  Branch (4020:6): [True: 36, False: 88]
  |  Branch (4020:26): [True: 24, False: 64]
  ------------------
 4021|     60|		return 0;
 4022|     64|	if ((p = __archive_read_ahead(a, (size_t)eocd64_size, NULL)) == NULL)
  ------------------
  |  Branch (4022:6): [True: 2, False: 62]
  ------------------
 4023|      2|		return 0;
 4024|       |
 4025|       |	/* Sanity-check the EOCD64 */
 4026|     62|	if (archive_le32dec(p + 16) != 0) /* Must be disk #0 */
  ------------------
  |  Branch (4026:6): [True: 9, False: 53]
  ------------------
 4027|      9|		return 0;
 4028|     53|	if (archive_le32dec(p + 20) != 0) /* CD must be on disk #0 */
  ------------------
  |  Branch (4028:6): [True: 6, False: 47]
  ------------------
 4029|      6|		return 0;
 4030|       |	/* CD can't be split. */
 4031|     47|	if (archive_le64dec(p + 24) != archive_le64dec(p + 32))
  ------------------
  |  Branch (4031:6): [True: 19, False: 28]
  ------------------
 4032|     19|		return 0;
 4033|       |
 4034|       |	/* Save the central directory offset for later use. */
 4035|     28|	zip->central_directory_offset = archive_le64dec(p + 48);
 4036|       |	/* TODO: Needs scanning backwards to find the eocd64 instead of assuming */
 4037|     28|	zip->central_directory_offset_adjusted = zip->central_directory_offset;
 4038|       |
 4039|     28|	return 32;
 4040|     47|}
archive_read_support_format_zip.c:archive_read_format_zip_seekable_read_header:
 4593|    349|{
 4594|    349|	struct zip *zip = a->format->data;
 4595|    349|	struct zip_entry *rsrc;
 4596|    349|	int64_t offset;
 4597|    349|	int r, ret = ARCHIVE_OK;
  ------------------
  |  |  233|    349|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4598|       |
 4599|       |	/*
 4600|       |	 * It should be sufficient to call archive_read_next_header() for
 4601|       |	 * a reader to determine if an entry is encrypted or not. If the
 4602|       |	 * encryption of an entry is only detectable when calling
 4603|       |	 * archive_read_data(), so be it. We'll do the same check there
 4604|       |	 * as well.
 4605|       |	 */
 4606|    349|	if (zip->has_encrypted_entries ==
  ------------------
  |  Branch (4606:6): [True: 155, False: 194]
  ------------------
 4607|    349|			ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW)
  ------------------
  |  |  411|    349|#define ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW -1
  ------------------
 4608|    155|		zip->has_encrypted_entries = 0;
 4609|       |
 4610|    349|	a->archive.archive_format = ARCHIVE_FORMAT_ZIP;
  ------------------
  |  |  374|    349|#define	ARCHIVE_FORMAT_ZIP			0x50000
  ------------------
 4611|    349|	if (a->archive.archive_format_name == NULL)
  ------------------
  |  Branch (4611:6): [True: 155, False: 194]
  ------------------
 4612|    155|		a->archive.archive_format_name = "ZIP";
 4613|       |
 4614|    349|	if (zip->zip_entries == NULL) {
  ------------------
  |  Branch (4614:6): [True: 155, False: 194]
  ------------------
 4615|    155|		r = slurp_central_directory(a, entry, zip);
 4616|    155|		if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    155|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4616:7): [True: 60, False: 95]
  ------------------
 4617|     60|			return r;
 4618|       |		/* Get first entry whose local header offset is lower than
 4619|       |		 * other entries in the archive file. */
 4620|     95|		zip->entry =
 4621|     95|		    (struct zip_entry *)ARCHIVE_RB_TREE_MIN(&zip->tree);
  ------------------
  |  |   49|     95|    __archive_rb_tree_iterate((T), NULL, ARCHIVE_RB_DIR_LEFT)
  |  |  ------------------
  |  |  |  |   45|     95|#define	ARCHIVE_RB_DIR_LEFT		0
  |  |  ------------------
  ------------------
 4622|    194|	} else if (zip->entry != NULL) {
  ------------------
  |  Branch (4622:13): [True: 194, False: 0]
  ------------------
 4623|       |		/* Get next entry in local header offset order. */
 4624|    194|		zip->entry = (struct zip_entry *)__archive_rb_tree_iterate(
 4625|    194|		    &zip->tree, &zip->entry->node, ARCHIVE_RB_DIR_RIGHT);
  ------------------
  |  |   46|    194|#define	ARCHIVE_RB_DIR_RIGHT		1
  ------------------
 4626|    194|	}
 4627|       |
 4628|    289|	if (zip->entry == NULL)
  ------------------
  |  Branch (4628:6): [True: 70, False: 219]
  ------------------
 4629|     70|		return ARCHIVE_EOF;
  ------------------
  |  |  232|     70|#define	ARCHIVE_EOF	  1	/* Found end of archive. */
  ------------------
 4630|       |
 4631|    219|	if (zip->entry->rsrcname.s)
  ------------------
  |  Branch (4631:6): [True: 0, False: 219]
  ------------------
 4632|      0|		rsrc = (struct zip_entry *)__archive_rb_tree_find_node(
 4633|      0|		    &zip->tree_rsrc, zip->entry->rsrcname.s);
 4634|    219|	else
 4635|    219|		rsrc = NULL;
 4636|       |
 4637|    219|	if (zip->cctx_valid)
  ------------------
  |  Branch (4637:6): [True: 0, False: 219]
  ------------------
 4638|      0|		archive_decrypto_aes_ctr_release(&zip->cctx);
  ------------------
  |  |  156|      0|  __archive_cryptor.decrypto_aes_ctr_release(ctx)
  ------------------
 4639|    219|	if (zip->hctx_valid)
  ------------------
  |  Branch (4639:6): [True: 0, False: 219]
  ------------------
 4640|      0|		archive_hmac_sha1_cleanup(&zip->hctx);
  ------------------
  |  |   95|      0|	__archive_hmac.__hmac_sha1_cleanup(ctx)
  ------------------
 4641|    219|	zip->tctx_valid = zip->cctx_valid = zip->hctx_valid = 0;
 4642|    219|	__archive_read_reset_passphrase(a);
 4643|       |
 4644|       |	/* File entries are sorted by the header offset, we should mostly
 4645|       |	 * use __archive_read_consume to advance a read point to avoid
 4646|       |	 * redundant data reading.  */
 4647|    219|	offset = archive_filter_bytes(&a->archive, 0);
 4648|    219|	if (offset < zip->entry->local_header_offset)
  ------------------
  |  Branch (4648:6): [True: 27, False: 192]
  ------------------
 4649|     27|		__archive_read_consume(a,
 4650|     27|		    zip->entry->local_header_offset - offset);
 4651|    192|	else if (offset != zip->entry->local_header_offset) {
  ------------------
  |  Branch (4651:11): [True: 57, False: 135]
  ------------------
 4652|     57|		__archive_read_seek(a, zip->entry->local_header_offset,
 4653|     57|		    SEEK_SET);
 4654|     57|	}
 4655|    219|	zip->unconsumed = 0;
 4656|    219|	r = zip_read_local_file_header(a, entry, zip);
 4657|    219|	if (r != ARCHIVE_OK)
  ------------------
  |  |  233|    219|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4657:6): [True: 74, False: 145]
  ------------------
 4658|     74|		return r;
 4659|    145|	if (rsrc) {
  ------------------
  |  Branch (4659:6): [True: 0, False: 145]
  ------------------
 4660|      0|		int ret2 = zip_read_mac_metadata(a, entry, rsrc);
 4661|      0|		if (ret2 < ret)
  ------------------
  |  Branch (4661:7): [True: 0, False: 0]
  ------------------
 4662|      0|			ret = ret2;
 4663|      0|	}
 4664|    145|	return (ret);
 4665|    219|}
archive_read_support_format_zip.c:slurp_central_directory:
 4192|    155|{
 4193|    155|	ssize_t i;
 4194|    155|	unsigned found;
 4195|    155|	int64_t correction;
 4196|    155|	ssize_t bytes_avail;
 4197|    155|	const char *p;
 4198|       |
 4199|       |	/*
 4200|       |	 * Find the start of the central directory.  The end-of-CD
 4201|       |	 * record has our starting point, but there are lots of
 4202|       |	 * Zip archives which have had other data prepended to the
 4203|       |	 * file, which makes the recorded offsets all too small.
 4204|       |	 * So we search forward from the specified offset until we
 4205|       |	 * find the real start of the central directory.  Then we
 4206|       |	 * know the correction we need to apply to account for leading
 4207|       |	 * padding.
 4208|       |	 */
 4209|    155|	if (__archive_read_seek(a, zip->central_directory_offset_adjusted, SEEK_SET)
  ------------------
  |  Branch (4209:6): [True: 7, False: 148]
  ------------------
 4210|    155|		< 0)
 4211|      7|		return ARCHIVE_FATAL;
  ------------------
  |  |  239|      7|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4212|       |
 4213|    148|	found = 0;
 4214|    295|	while (!found) {
  ------------------
  |  Branch (4214:9): [True: 149, False: 146]
  ------------------
 4215|    149|		if ((p = __archive_read_ahead(a, 20, &bytes_avail)) == NULL)
  ------------------
  |  Branch (4215:7): [True: 2, False: 147]
  ------------------
 4216|      2|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4217|  52.4k|		for (found = 0, i = 0; !found && i < bytes_avail - 4;) {
  ------------------
  |  Branch (4217:26): [True: 52.2k, False: 146]
  |  Branch (4217:36): [True: 52.2k, False: 1]
  ------------------
 4218|  52.2k|			switch (p[i + 3]) {
 4219|    874|			case 'P': i += 3; break;
  ------------------
  |  Branch (4219:4): [True: 874, False: 51.3k]
  ------------------
 4220|    243|			case 'K': i += 2; break;
  ------------------
  |  Branch (4220:4): [True: 243, False: 52.0k]
  ------------------
 4221|    807|			case 001: i += 1; break;
  ------------------
  |  Branch (4221:4): [True: 807, False: 51.4k]
  ------------------
 4222|    697|			case 002:
  ------------------
  |  Branch (4222:4): [True: 697, False: 51.5k]
  ------------------
 4223|    697|				if (memcmp(p + i, "PK\001\002", 4) == 0) {
  ------------------
  |  Branch (4223:9): [True: 108, False: 589]
  ------------------
 4224|    108|					p += i;
 4225|    108|					found = 1;
 4226|    108|				} else
 4227|    589|					i += 4;
 4228|    697|				break;
 4229|    585|			case 005: i += 1; break;
  ------------------
  |  Branch (4229:4): [True: 585, False: 51.6k]
  ------------------
 4230|  1.78k|			case 006:
  ------------------
  |  Branch (4230:4): [True: 1.78k, False: 50.4k]
  ------------------
 4231|  1.78k|				if (memcmp(p + i, "PK\005\006", 4) == 0) {
  ------------------
  |  Branch (4231:9): [True: 36, False: 1.74k]
  ------------------
 4232|     36|					p += i;
 4233|     36|					found = 1;
 4234|  1.74k|				} else if (memcmp(p + i, "PK\006\006", 4) == 0) {
  ------------------
  |  Branch (4234:16): [True: 2, False: 1.74k]
  ------------------
 4235|      2|					p += i;
 4236|      2|					found = 1;
 4237|      2|				} else
 4238|  1.74k|					i += 1;
 4239|  1.78k|				break;
 4240|  47.2k|			default: i += 4; break;
  ------------------
  |  Branch (4240:4): [True: 47.2k, False: 4.98k]
  ------------------
 4241|  52.2k|			}
 4242|  52.2k|		}
 4243|    147|		__archive_read_consume(a, i);
 4244|    147|	}
 4245|    146|	correction = archive_filter_bytes(&a->archive, 0)
 4246|    146|			- zip->central_directory_offset;
 4247|       |
 4248|    146|	__archive_rb_tree_init(&zip->tree, &rb_ops);
 4249|    146|	__archive_rb_tree_init(&zip->tree_rsrc, &rb_rsrc_ops);
 4250|       |
 4251|  1.26k|	while (1) {
  ------------------
  |  Branch (4251:9): [True: 1.26k, Folded]
  ------------------
 4252|  1.26k|		struct zip_entry *zip_entry;
 4253|  1.26k|		size_t filename_length, extra_length, comment_length;
 4254|  1.26k|		uint32_t external_attributes;
 4255|  1.26k|		const char *name, *r;
 4256|       |
 4257|  1.26k|		if ((p = __archive_read_ahead(a, 4, NULL)) == NULL)
  ------------------
  |  Branch (4257:7): [True: 2, False: 1.26k]
  ------------------
 4258|      2|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      2|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4259|  1.26k|		if (memcmp(p, "PK\006\006", 4) == 0
  ------------------
  |  Branch (4259:7): [True: 12, False: 1.25k]
  ------------------
 4260|  1.25k|		    || memcmp(p, "PK\005\006", 4) == 0) {
  ------------------
  |  Branch (4260:10): [True: 83, False: 1.16k]
  ------------------
 4261|     95|			break;
 4262|  1.16k|		} else if (memcmp(p, "PK\001\002", 4) != 0) {
  ------------------
  |  Branch (4262:14): [True: 20, False: 1.14k]
  ------------------
 4263|     20|			archive_set_error(&a->archive,
 4264|     20|			    -1, "Invalid central directory signature");
 4265|     20|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|     20|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4266|     20|		}
 4267|  1.14k|		if ((p = __archive_read_ahead(a, 46, NULL)) == NULL)
  ------------------
  |  Branch (4267:7): [True: 1, False: 1.14k]
  ------------------
 4268|      1|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      1|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4269|       |
 4270|  1.14k|		zip_entry = calloc(1, sizeof(struct zip_entry));
 4271|  1.14k|		if (zip_entry == NULL) {
  ------------------
  |  Branch (4271:7): [True: 0, False: 1.14k]
  ------------------
 4272|      0|			archive_set_error(&a->archive, ENOMEM,
 4273|      0|				"Can't allocate zip entry");
 4274|      0|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      0|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4275|      0|		}
 4276|  1.14k|		zip_entry->next = zip->zip_entries;
 4277|  1.14k|		zip_entry->flags |= LA_FROM_CENTRAL_DIRECTORY;
  ------------------
  |  |  138|  1.14k|#define LA_FROM_CENTRAL_DIRECTORY (1 << 1)
  ------------------
 4278|  1.14k|		zip->zip_entries = zip_entry;
 4279|       |
 4280|       |		/* version = p[4]; */
 4281|  1.14k|		zip_entry->system = p[5];
 4282|       |		/* version_required = archive_le16dec(p + 6); */
 4283|  1.14k|		zip_entry->zip_flags = archive_le16dec(p + 8);
 4284|  1.14k|		if (zip_entry->zip_flags
  ------------------
  |  Branch (4284:7): [True: 162, False: 985]
  ------------------
 4285|  1.14k|		      & (ZIP_ENCRYPTED | ZIP_STRONG_ENCRYPTED)){
  ------------------
  |  |  128|  1.14k|#define ZIP_ENCRYPTED	(1 << 0)
  ------------------
              		      & (ZIP_ENCRYPTED | ZIP_STRONG_ENCRYPTED)){
  ------------------
  |  |  130|  1.14k|#define ZIP_STRONG_ENCRYPTED	(1 << 6)
  ------------------
 4286|    162|			zip->has_encrypted_entries = 1;
 4287|    162|		}
 4288|  1.14k|		zip_entry->compression = (char)archive_le16dec(p + 10);
 4289|  1.14k|		zip_entry->mtime = __archive_dos_to_unix(archive_le32dec(p + 12));
 4290|  1.14k|		zip_entry->crc32 = archive_le32dec(p + 16);
 4291|  1.14k|		if (zip_entry->zip_flags & ZIP_LENGTH_AT_END)
  ------------------
  |  |  129|  1.14k|#define ZIP_LENGTH_AT_END	(1 << 3) /* Also called "Streaming bit" */
  ------------------
  |  Branch (4291:7): [True: 176, False: 971]
  ------------------
 4292|    176|			zip_entry->decdat = p[13];
 4293|    971|		else
 4294|    971|			zip_entry->decdat = p[19];
 4295|  1.14k|		zip_entry->compressed_size = archive_le32dec(p + 20);
 4296|  1.14k|		zip_entry->uncompressed_size = archive_le32dec(p + 24);
 4297|  1.14k|		filename_length = archive_le16dec(p + 28);
 4298|  1.14k|		extra_length = archive_le16dec(p + 30);
 4299|  1.14k|		comment_length = archive_le16dec(p + 32);
 4300|       |		/* disk_start = archive_le16dec(p + 34);
 4301|       |		 *   Better be zero.
 4302|       |		 * internal_attributes = archive_le16dec(p + 36);
 4303|       |		 *   text bit */
 4304|  1.14k|		external_attributes = archive_le32dec(p + 38);
 4305|  1.14k|		zip_entry->local_header_offset =
 4306|  1.14k|		    archive_le32dec(p + 42) + correction;
 4307|       |
 4308|       |		/* If we can't guess the mode, leave it zero here;
 4309|       |		   when we read the local file header we might get
 4310|       |		   more information. */
 4311|  1.14k|		if (zip_entry->system == 3) {
  ------------------
  |  Branch (4311:7): [True: 406, False: 741]
  ------------------
 4312|    406|			zip_entry->mode = external_attributes >> 16;
 4313|    741|		} else if (zip_entry->system == 0) {
  ------------------
  |  Branch (4313:14): [True: 663, False: 78]
  ------------------
 4314|       |			// Interpret MSDOS directory bit
 4315|    663|			if (0x10 == (external_attributes & 0x10)) {
  ------------------
  |  Branch (4315:8): [True: 169, False: 494]
  ------------------
 4316|    169|				zip_entry->mode = AE_IFDIR | 0775;
  ------------------
  |  |  221|    169|#define AE_IFDIR	((__LA_MODE_T)0040000)
  ------------------
 4317|    494|			} else {
 4318|    494|				zip_entry->mode = AE_IFREG | 0664;
  ------------------
  |  |  216|    494|#define AE_IFREG	((__LA_MODE_T)0100000)
  ------------------
 4319|    494|			}
 4320|    663|			if (0x01 == (external_attributes & 0x01)) {
  ------------------
  |  Branch (4320:8): [True: 25, False: 638]
  ------------------
 4321|       |				// Read-only bit; strip write permissions
 4322|     25|				zip_entry->mode &= 0555;
 4323|     25|			}
 4324|    663|		} else {
 4325|     78|			zip_entry->mode = 0;
 4326|     78|		}
 4327|       |
 4328|       |		/* We're done with the regular data; get the filename and
 4329|       |		 * extra data. */
 4330|  1.14k|		__archive_read_consume(a, 46);
 4331|  1.14k|		p = __archive_read_ahead(a, filename_length + extra_length,
 4332|  1.14k|			NULL);
 4333|  1.14k|		if (p == NULL) {
  ------------------
  |  Branch (4333:7): [True: 9, False: 1.13k]
  ------------------
 4334|      9|			archive_set_error(&a->archive,
 4335|      9|			    ARCHIVE_ERRNO_FILE_FORMAT,
  ------------------
  |  |  192|      9|#define	ARCHIVE_ERRNO_FILE_FORMAT EILSEQ
  ------------------
 4336|      9|			    "Truncated ZIP file header");
 4337|      9|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|      9|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4338|      9|		}
 4339|  1.13k|		if (ARCHIVE_OK != process_extra(a, entry, p + filename_length,
  ------------------
  |  |  233|  1.13k|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (4339:7): [True: 19, False: 1.11k]
  ------------------
 4340|  1.13k|		    extra_length, zip_entry)) {
 4341|     19|			return ARCHIVE_FATAL;
  ------------------
  |  |  239|     19|#define	ARCHIVE_FATAL	(-30)	/* No more operations are possible. */
  ------------------
 4342|     19|		}
 4343|       |
 4344|       |		/*
 4345|       |		 * Mac resource fork files are stored under the
 4346|       |		 * "__MACOSX/" directory, so we should check if
 4347|       |		 * it is.
 4348|       |		 */
 4349|  1.11k|		if (!zip->process_mac_extensions) {
  ------------------
  |  Branch (4349:7): [True: 1.11k, False: 0]
  ------------------
 4350|       |			/* Treat every entry as a regular entry. */
 4351|  1.11k|			__archive_rb_tree_insert_node(&zip->tree,
 4352|  1.11k|			    &zip_entry->node);
 4353|  1.11k|		} else {
 4354|      0|			name = p;
 4355|      0|			r = rsrc_basename(name, filename_length);
 4356|      0|			if (filename_length >= 9 &&
  ------------------
  |  Branch (4356:8): [True: 0, False: 0]
  ------------------
 4357|      0|			    strncmp("__MACOSX/", name, 9) == 0) {
  ------------------
  |  Branch (4357:8): [True: 0, False: 0]
  ------------------
 4358|      0|				const char *name_end;
 4359|       |
 4360|      0|				name_end = name + filename_length;
 4361|       |				/* If this file is not a resource fork nor
 4362|       |				 * a directory. We should treat it as a non
 4363|       |				 * resource fork file to expose it. */
 4364|      0|				if (name[filename_length-1] != '/' &&
  ------------------
  |  Branch (4364:9): [True: 0, False: 0]
  ------------------
 4365|      0|				    (name_end - r < 2 || r[0] != '.' || r[1] != '_')) {
  ------------------
  |  Branch (4365:10): [True: 0, False: 0]
  |  Branch (4365:30): [True: 0, False: 0]
  |  Branch (4365:45): [True: 0, False: 0]
  ------------------
 4366|      0|					__archive_rb_tree_insert_node(
 4367|      0|					    &zip->tree, &zip_entry->node);
 4368|       |					/* Expose its parent directories. */
 4369|      0|					expose_parent_dirs(zip, name,
 4370|      0|					    filename_length);
 4371|      0|				} else {
 4372|       |					/* This file is a resource fork file or
 4373|       |					 * a directory. */
 4374|      0|					archive_strncpy(&(zip_entry->rsrcname),
  ------------------
  |  |  173|      0|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 4375|      0|					     name, filename_length);
 4376|      0|					__archive_rb_tree_insert_node(
 4377|      0|					    &zip->tree_rsrc, &zip_entry->node);
 4378|      0|				}
 4379|      0|			} else {
 4380|       |				/* Generate resource fork name to find its
 4381|       |				 * resource file at zip->tree_rsrc. */
 4382|       |
 4383|       |				/* If this is an entry ending with slash,
 4384|       |				 * make the resource for name slash-less
 4385|       |				 * as the actual resource fork doesn't end with '/'.
 4386|       |				 */
 4387|      0|				size_t tmp_length = filename_length;
 4388|      0|				if (tmp_length > 0 && name[tmp_length - 1] == '/') {
  ------------------
  |  Branch (4388:9): [True: 0, False: 0]
  |  Branch (4388:27): [True: 0, False: 0]
  ------------------
 4389|      0|					tmp_length--;
 4390|      0|					r = rsrc_basename(name, tmp_length);
 4391|      0|				}
 4392|       |
 4393|      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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4394|      0|				    "__MACOSX/");
 4395|      0|				archive_strncat(&(zip_entry->rsrcname),
 4396|      0|				    name, r - name);
 4397|      0|				archive_strcat(&(zip_entry->rsrcname), "._");
 4398|      0|				archive_strncat(&(zip_entry->rsrcname),
 4399|      0|				    name + (r - name),
 4400|      0|				    tmp_length - (r - name));
 4401|       |				/* Register an entry to RB tree to sort it by
 4402|       |				 * file offset. */
 4403|      0|				__archive_rb_tree_insert_node(&zip->tree,
 4404|      0|				    &zip_entry->node);
 4405|      0|			}
 4406|      0|		}
 4407|       |
 4408|       |		/* Skip the comment too ... */
 4409|  1.11k|		__archive_read_consume(a,
 4410|  1.11k|		    filename_length + extra_length + comment_length);
 4411|  1.11k|	}
 4412|       |
 4413|     95|	return ARCHIVE_OK;
  ------------------
  |  |  233|     95|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4414|    146|}
archive_read_support_format_zip.c:cmp_node:
 4102|  5.67k|{
 4103|  5.67k|	const struct zip_entry *e1 = (const struct zip_entry *)n1;
 4104|  5.67k|	const struct zip_entry *e2 = (const struct zip_entry *)n2;
 4105|       |
 4106|  5.67k|	if (e1->local_header_offset > e2->local_header_offset)
  ------------------
  |  Branch (4106:6): [True: 629, False: 5.04k]
  ------------------
 4107|    629|		return -1;
 4108|  5.04k|	if (e1->local_header_offset < e2->local_header_offset)
  ------------------
  |  Branch (4108:6): [True: 4.93k, False: 106]
  ------------------
 4109|  4.93k|		return 1;
 4110|    106|	return 0;
 4111|  5.04k|}
archive_read_support_format_zip.c:archive_read_format_zip_read_data_skip_seekable:
 4673|    194|{
 4674|    194|	struct zip *zip = a->format->data;
 4675|       |
 4676|    194|	zip->unconsumed = 0;
 4677|    194|	return (ARCHIVE_OK);
  ------------------
  |  |  233|    194|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
 4678|    194|}
archive_read_support_format_zip.c:archive_read_support_format_zip_capabilities_seekable:
 3942|    310|{
 3943|    310|	(void)a; /* UNUSED */
 3944|    310|	return (ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA |
  ------------------
  |  |  398|    310|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_DATA (1<<0)  /* reader can detect encrypted data */
  ------------------
 3945|    310|		ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA);
  ------------------
  |  |  399|    310|#define ARCHIVE_READ_FORMAT_CAPS_ENCRYPT_METADATA (1<<1)  /* reader can detect encryptable metadata (pathname, mtime, etc.) */
  ------------------
 3946|    310|}

archive_array_append:
  250|    685|{
  251|    685|	return archive_string_append(as, p, s);
  252|    685|}
archive_string_concat:
  256|    612|{
  257|    612|	if (archive_string_append(dest, src->s, src->length) == NULL)
  ------------------
  |  Branch (257:6): [True: 0, False: 612]
  ------------------
  258|      0|		__archive_errx(1, "Out of memory");
  259|    612|}
archive_wstring_concat:
  264|  11.7k|{
  265|  11.7k|	if (archive_wstring_append(dest, src->s, src->length) == NULL)
  ------------------
  |  Branch (265:6): [True: 0, False: 11.7k]
  ------------------
  266|      0|		__archive_errx(1, "Out of memory");
  267|  11.7k|}
archive_string_free:
  271|  11.0M|{
  272|  11.0M|	as->length = 0;
  273|  11.0M|	as->buffer_length = 0;
  274|  11.0M|	free(as->s);
  275|       |	as->s = NULL;
  276|  11.0M|}
archive_wstring_free:
  280|  3.33M|{
  281|  3.33M|	as->length = 0;
  282|  3.33M|	as->buffer_length = 0;
  283|  3.33M|	free(as->s);
  284|       |	as->s = NULL;
  285|  3.33M|}
archive_wstring_ensure:
  289|   448k|{
  290|   448k|	return (struct archive_wstring *)
  291|   448k|		archive_string_ensure((struct archive_string *)as,
  292|   448k|					s * sizeof(wchar_t));
  293|   448k|}
archive_string_ensure:
  298|  16.0M|{
  299|  16.0M|	char *p;
  300|  16.0M|	size_t new_length;
  301|       |
  302|       |	/* If buffer is already big enough, don't reallocate. */
  303|  16.0M|	if (as->s && (s <= as->buffer_length))
  ------------------
  |  Branch (303:6): [True: 14.5M, False: 1.46M]
  |  Branch (303:15): [True: 14.4M, False: 68.5k]
  ------------------
  304|  14.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|  1.52M|	if (as->buffer_length < 32)
  ------------------
  |  Branch (313:6): [True: 1.46M, False: 68.5k]
  ------------------
  314|       |		/* Start with a minimum 32-character buffer. */
  315|  1.46M|		new_length = 32;
  316|  68.5k|	else if (as->buffer_length < 8192)
  ------------------
  |  Branch (316:11): [True: 68.2k, False: 357]
  ------------------
  317|       |		/* Buffers under 8k are doubled for speed. */
  318|  68.2k|		new_length = as->buffer_length + as->buffer_length;
  319|    357|	else {
  320|       |		/* Buffers 8k and over grow by at least 25% each time. */
  321|    357|		new_length = as->buffer_length + as->buffer_length / 4;
  322|       |		/* Be safe: If size wraps, fail. */
  323|    357|		if (new_length < as->buffer_length) {
  ------------------
  |  Branch (323:7): [True: 0, False: 357]
  ------------------
  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|    357|	}
  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|  1.52M|	if (new_length < s)
  ------------------
  |  Branch (335:6): [True: 953k, False: 576k]
  ------------------
  336|   953k|		new_length = s;
  337|       |	/* Now we can reallocate the buffer. */
  338|  1.52M|	p = realloc(as->s, new_length);
  339|  1.52M|	if (p == NULL) {
  ------------------
  |  Branch (339:6): [True: 0, False: 1.52M]
  ------------------
  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|  1.52M|	as->s = p;
  347|  1.52M|	as->buffer_length = new_length;
  348|  1.52M|	return (as);
  349|  1.52M|}
archive_strncat:
  360|   416k|{
  361|   416k|	size_t s;
  362|   416k|	const char *p, *pp;
  363|       |
  364|   416k|	p = (const char *)_p;
  365|       |
  366|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
  367|   416k|	s = 0;
  368|   416k|	pp = p;
  369|   173M|	while (s < n && *pp) {
  ------------------
  |  Branch (369:9): [True: 173M, False: 188k]
  |  Branch (369:18): [True: 173M, False: 228k]
  ------------------
  370|   173M|		pp++;
  371|   173M|		s++;
  372|   173M|	}
  373|   416k|	if ((as = archive_string_append(as, p, s)) == NULL)
  ------------------
  |  Branch (373:6): [True: 0, False: 416k]
  ------------------
  374|      0|		__archive_errx(1, "Out of memory");
  375|   416k|	return (as);
  376|   416k|}
archive_wstrncat:
  380|  8.65k|{
  381|  8.65k|	size_t s;
  382|  8.65k|	const wchar_t *pp;
  383|       |
  384|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
  385|  8.65k|	s = 0;
  386|  8.65k|	pp = p;
  387|  96.0k|	while (s < n && *pp) {
  ------------------
  |  Branch (387:9): [True: 87.4k, False: 8.61k]
  |  Branch (387:18): [True: 87.4k, False: 48]
  ------------------
  388|  87.4k|		pp++;
  389|  87.4k|		s++;
  390|  87.4k|	}
  391|  8.65k|	if ((as = archive_wstring_append(as, p, s)) == NULL)
  ------------------
  |  Branch (391:6): [True: 0, False: 8.65k]
  ------------------
  392|      0|		__archive_errx(1, "Out of memory");
  393|  8.65k|	return (as);
  394|  8.65k|}
archive_strcat:
  398|   219k|{
  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|   219k|	return archive_strncat(as, p, 0x1000000);
  406|   219k|}
archive_wstrcat:
  410|     48|{
  411|       |	/* Ditto. */
  412|     48|	return archive_wstrncat(as, p, 0x1000000);
  413|     48|}
archive_strappend_char:
  417|  13.2M|{
  418|  13.2M|	if ((as = archive_string_append(as, &c, 1)) == NULL)
  ------------------
  |  Branch (418:6): [True: 0, False: 13.2M]
  ------------------
  419|      0|		__archive_errx(1, "Out of memory");
  420|  13.2M|	return (as);
  421|  13.2M|}
archive_wstrappend_wchar:
  425|     48|{
  426|     48|	if ((as = archive_wstring_append(as, &c, 1)) == NULL)
  ------------------
  |  Branch (426:6): [True: 0, False: 48]
  ------------------
  427|      0|		__archive_errx(1, "Out of memory");
  428|     48|	return (as);
  429|     48|}
archive_wstring_append_from_mbs:
  623|   410k|{
  624|   410k|	size_t r;
  625|   410k|	int ret_val = 0;
  626|       |	/*
  627|       |	 * No single byte will be more than one wide character,
  628|       |	 * so this length estimate will always be big enough.
  629|       |	 */
  630|       |	// size_t wcs_length = len;
  631|   410k|	size_t mbs_length = len;
  632|   410k|	const char *mbs = p;
  633|   410k|	wchar_t *wcs;
  634|   410k|#if HAVE_MBRTOWC
  635|   410k|	mbstate_t shift_state;
  636|       |
  637|   410k|	memset(&shift_state, 0, sizeof(shift_state));
  638|   410k|#endif
  639|       |	/*
  640|       |	 * As we decided to have wcs_length == mbs_length == len
  641|       |	 * we can use len here instead of wcs_length
  642|       |	 */
  643|   410k|	if (NULL == archive_wstring_ensure(dest, dest->length + len + 1))
  ------------------
  |  Branch (643:6): [True: 0, False: 410k]
  ------------------
  644|      0|		return (-1);
  645|   410k|	wcs = dest->s + dest->length;
  646|       |	/*
  647|       |	 * We cannot use mbsrtowcs/mbstowcs here because those may convert
  648|       |	 * extra MBS when strlen(p) > len and one wide character consists of
  649|       |	 * multi bytes.
  650|       |	 */
  651|  36.0M|	while (*mbs && mbs_length > 0) {
  ------------------
  |  Branch (651:9): [True: 35.6M, False: 372k]
  |  Branch (651:17): [True: 35.6M, False: 0]
  ------------------
  652|       |		/*
  653|       |		 * The buffer we allocated is always big enough.
  654|       |		 * Keep this code path in a comment if we decide to choose
  655|       |		 * smaller wcs_length in the future
  656|       |		 */
  657|       |/*
  658|       |		if (wcs_length == 0) {
  659|       |			dest->length = wcs - dest->s;
  660|       |			dest->s[dest->length] = L'\0';
  661|       |			wcs_length = mbs_length;
  662|       |			if (NULL == archive_wstring_ensure(dest,
  663|       |			    dest->length + wcs_length + 1))
  664|       |				return (-1);
  665|       |			wcs = dest->s + dest->length;
  666|       |		}
  667|       |*/
  668|  35.6M|#if HAVE_MBRTOWC
  669|  35.6M|		r = mbrtowc(wcs, mbs, mbs_length, &shift_state);
  670|       |#else
  671|       |		r = mbtowc(wcs, mbs, mbs_length);
  672|       |#endif
  673|  35.6M|		if (r == (size_t)-1 || r == (size_t)-2) {
  ------------------
  |  Branch (673:7): [True: 38.3k, False: 35.6M]
  |  Branch (673:26): [True: 0, False: 35.6M]
  ------------------
  674|  38.3k|			ret_val = -1;
  675|  38.3k|			break;
  676|  38.3k|		}
  677|  35.6M|		if (r == 0 || r > mbs_length)
  ------------------
  |  Branch (677:7): [True: 0, False: 35.6M]
  |  Branch (677:17): [True: 0, False: 35.6M]
  ------------------
  678|      0|			break;
  679|  35.6M|		wcs++;
  680|       |		// wcs_length--;
  681|  35.6M|		mbs += r;
  682|  35.6M|		mbs_length -= r;
  683|  35.6M|	}
  684|   410k|	dest->length = wcs - dest->s;
  685|   410k|	dest->s[dest->length] = L'\0';
  686|   410k|	return (ret_val);
  687|   410k|}
archive_string_append_from_wcs:
  821|  6.93k|{
  822|       |	/* We cannot use the standard wcstombs() here because it
  823|       |	 * cannot tell us how big the output buffer should be.  So
  824|       |	 * I've built a loop around wcrtomb() or wctomb() that
  825|       |	 * converts a character at a time and resizes the string as
  826|       |	 * needed.  We prefer wcrtomb() when it's available because
  827|       |	 * it's thread-safe. */
  828|  6.93k|	int n, ret_val = 0;
  829|  6.93k|	char *p;
  830|  6.93k|	char *end;
  831|  6.93k|#if HAVE_WCRTOMB
  832|  6.93k|	mbstate_t shift_state;
  833|       |
  834|  6.93k|	memset(&shift_state, 0, sizeof(shift_state));
  835|       |#else
  836|       |	/* Clear the shift state before starting. */
  837|       |	wctomb(NULL, L'\0');
  838|       |#endif
  839|       |	/*
  840|       |	 * Allocate buffer for MBS.
  841|       |	 * We need this allocation here since it is possible that
  842|       |	 * as->s is still NULL.
  843|       |	 */
  844|  6.93k|	if (archive_string_ensure(as, as->length + len + 1) == NULL)
  ------------------
  |  Branch (844:6): [True: 0, False: 6.93k]
  ------------------
  845|      0|		return (-1);
  846|       |
  847|  6.93k|	p = as->s + as->length;
  848|  6.93k|	end = as->s + as->buffer_length - MB_CUR_MAX -1;
  849|  60.6k|	while (*w != L'\0' && len > 0) {
  ------------------
  |  Branch (849:9): [True: 53.7k, False: 6.93k]
  |  Branch (849:24): [True: 53.7k, False: 0]
  ------------------
  850|  53.7k|		if (p >= end) {
  ------------------
  |  Branch (850:7): [True: 792, False: 52.9k]
  ------------------
  851|    792|			as->length = p - as->s;
  852|    792|			as->s[as->length] = '\0';
  853|       |			/* Re-allocate buffer for MBS. */
  854|    792|			if (archive_string_ensure(as,
  ------------------
  |  Branch (854:8): [True: 0, False: 792]
  ------------------
  855|    792|			    as->length + max(len * 2,
  ------------------
  |  |   78|    792|#define max(a, b)       ((a)>(b)?(a):(b))
  |  |  ------------------
  |  |  |  Branch (78:26): [True: 792, False: 0]
  |  |  ------------------
  ------------------
  856|    792|			    (size_t)MB_CUR_MAX) + 1) == NULL)
  857|      0|				return (-1);
  858|    792|			p = as->s + as->length;
  859|    792|			end = as->s + as->buffer_length - MB_CUR_MAX -1;
  860|    792|		}
  861|  53.7k|#if HAVE_WCRTOMB
  862|  53.7k|		n = wcrtomb(p, *w++, &shift_state);
  863|       |#else
  864|       |		n = wctomb(p, *w++);
  865|       |#endif
  866|  53.7k|		if (n == -1) {
  ------------------
  |  Branch (866:7): [True: 0, False: 53.7k]
  ------------------
  867|      0|			if (errno == EILSEQ) {
  ------------------
  |  Branch (867:8): [True: 0, False: 0]
  ------------------
  868|       |				/* Skip an illegal wide char. */
  869|      0|				*p++ = '?';
  870|      0|				ret_val = -1;
  871|      0|			} else {
  872|      0|				ret_val = -1;
  873|      0|				break;
  874|      0|			}
  875|      0|		} else
  876|  53.7k|			p += n;
  877|  53.7k|		len--;
  878|  53.7k|	}
  879|  6.93k|	as->length = p - as->s;
  880|  6.93k|	as->s[as->length] = '\0';
  881|  6.93k|	return (ret_val);
  882|  6.93k|}
archive_string_conversion_to_charset:
 1782|   388k|{
 1783|   388k|	int flag = SCONV_TO_CHARSET;
  ------------------
  |  |   89|   388k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
 1784|       |
 1785|   388k|	if (best_effort)
  ------------------
  |  Branch (1785:6): [True: 388k, False: 0]
  ------------------
 1786|   388k|		flag |= SCONV_BEST_EFFORT;
  ------------------
  |  |   93|   388k|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
 1787|   388k|	return (get_sconv_object(a, get_current_charset(a), charset, flag));
 1788|   388k|}
archive_string_conversion_from_charset:
 1793|  48.1k|{
 1794|  48.1k|	int flag = SCONV_FROM_CHARSET;
  ------------------
  |  |   91|  48.1k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
 1795|       |
 1796|  48.1k|	if (best_effort)
  ------------------
  |  Branch (1796:6): [True: 48.1k, False: 0]
  ------------------
 1797|  48.1k|		flag |= SCONV_BEST_EFFORT;
  ------------------
  |  |   93|  48.1k|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
 1798|  48.1k|	return (get_sconv_object(a, charset, get_current_charset(a), flag));
 1799|  48.1k|}
archive_string_default_conversion_for_read:
 1855|  7.68k|{
 1856|  7.68k|	(void)a; /* UNUSED */
 1857|       |	return (NULL);
 1858|  7.68k|}
archive_string_conversion_free:
 1873|  16.7k|{
 1874|  16.7k|	struct archive_string_conv *sc; 
 1875|  16.7k|	struct archive_string_conv *sc_next; 
 1876|       |
 1877|  20.5k|	for (sc = a->sconv; sc != NULL; sc = sc_next) {
  ------------------
  |  Branch (1877:22): [True: 3.80k, False: 16.7k]
  ------------------
 1878|  3.80k|		sc_next = sc->next;
 1879|  3.80k|		free_sconv_object(sc);
 1880|  3.80k|	}
 1881|  16.7k|	a->sconv = NULL;
 1882|  16.7k|	free(a->current_code);
 1883|       |	a->current_code = NULL;
 1884|  16.7k|}
archive_string_conversion_charset_name:
 1891|  3.80k|{
 1892|  3.80k|	if (sc == NULL) {
  ------------------
  |  Branch (1892:6): [True: 0, False: 3.80k]
  ------------------
 1893|      0|		return "current locale";
 1894|      0|	}
 1895|  3.80k|	if (sc->flag & SCONV_TO_CHARSET)
  ------------------
  |  |   89|  3.80k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
  |  Branch (1895:6): [True: 0, False: 3.80k]
  ------------------
 1896|      0|		return (sc->to_charset);
 1897|  3.80k|	else
 1898|  3.80k|		return (sc->from_charset);
 1899|  3.80k|}
archive_strncpy_l:
 2014|   788k|{
 2015|   788k|	as->length = 0;
 2016|   788k|	return (archive_strncat_l(as, _p, n, sc));
 2017|   788k|}
archive_strncat_l:
 2022|   788k|{
 2023|   788k|	const void *s;
 2024|   788k|	size_t length = 0;
 2025|   788k|	int i, r = 0, r2;
 2026|       |
 2027|   788k|	if (_p != NULL && n > 0) {
  ------------------
  |  Branch (2027:6): [True: 788k, False: 0]
  |  Branch (2027:20): [True: 710k, False: 78.7k]
  ------------------
 2028|   710k|		if (sc != NULL && (sc->flag & SCONV_FROM_UTF16))
  ------------------
  |  |  112|   391k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|   391k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|   391k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2028:7): [True: 391k, False: 318k]
  |  Branch (2028:21): [True: 4.16k, False: 387k]
  ------------------
 2029|  4.16k|			length = utf16nbytes(_p, n);
 2030|   705k|		else
 2031|   705k|			length = mbsnbytes(_p, n);
 2032|   710k|	}
 2033|       |
 2034|       |	/* We must allocate memory even if there is no data for conversion
 2035|       |	 * or copy. This simulates archive_string_append behavior. */
 2036|   788k|	if (length == 0) {
  ------------------
  |  Branch (2036:6): [True: 98.8k, False: 689k]
  ------------------
 2037|  98.8k|		size_t tn = 1;
 2038|  98.8k|		if (sc != NULL && (sc->flag & SCONV_TO_UTF16))
  ------------------
  |  |  111|  61.0k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|  61.0k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|  61.0k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2038:7): [True: 61.0k, False: 37.8k]
  |  Branch (2038:21): [True: 0, False: 61.0k]
  ------------------
 2039|      0|			tn = 2;
 2040|  98.8k|		if (archive_string_ensure(as, as->length + tn) == NULL)
  ------------------
  |  Branch (2040:7): [True: 0, False: 98.8k]
  ------------------
 2041|      0|			return (-1);
 2042|  98.8k|		as->s[as->length] = 0;
 2043|  98.8k|		if (tn == 2)
  ------------------
  |  Branch (2043:7): [True: 0, False: 98.8k]
  ------------------
 2044|      0|			as->s[as->length+1] = 0;
 2045|  98.8k|		return (0);
 2046|  98.8k|	}
 2047|       |
 2048|       |	/*
 2049|       |	 * If sc is NULL, we just make a copy.
 2050|       |	 */
 2051|   689k|	if (sc == NULL) {
  ------------------
  |  Branch (2051:6): [True: 300k, False: 389k]
  ------------------
 2052|   300k|		if (archive_string_append(as, _p, length) == NULL)
  ------------------
  |  Branch (2052:7): [True: 0, False: 300k]
  ------------------
 2053|      0|			return (-1);/* No memory */
 2054|   300k|		return (0);
 2055|   300k|	}
 2056|       |
 2057|   389k|	s = _p;
 2058|   389k|	i = 0;
 2059|   389k|	if (sc->nconverter > 1) {
  ------------------
  |  Branch (2059:6): [True: 49.2k, False: 340k]
  ------------------
 2060|  49.2k|		sc->utftmp.length = 0;
 2061|  49.2k|		r2 = sc->converter[0](&(sc->utftmp), s, length, sc);
 2062|  49.2k|		if (r2 != 0 && errno == ENOMEM)
  ------------------
  |  Branch (2062:7): [True: 38.8k, False: 10.4k]
  |  Branch (2062:18): [True: 0, False: 38.8k]
  ------------------
 2063|      0|			return (r2);
 2064|  49.2k|		if (r > r2)
  ------------------
  |  Branch (2064:7): [True: 38.8k, False: 10.4k]
  ------------------
 2065|  38.8k|			r = r2;
 2066|  49.2k|		s = sc->utftmp.s;
 2067|  49.2k|		length = sc->utftmp.length;
 2068|  49.2k|		++i;
 2069|  49.2k|	}
 2070|   389k|	r2 = sc->converter[i](as, s, length, sc);
 2071|   389k|	if (r > r2)
  ------------------
  |  Branch (2071:6): [True: 25.8k, False: 363k]
  ------------------
 2072|  25.8k|		r = r2;
 2073|   389k|	return (r);
 2074|   389k|}
archive_string_dirname:
 2078|  2.39k|{
 2079|       |	/* strip trailing separators */
 2080|  2.49k|	while (as->length > 1 && as->s[as->length - 1] == '/')
  ------------------
  |  Branch (2080:9): [True: 2.35k, False: 144]
  |  Branch (2080:27): [True: 102, False: 2.24k]
  ------------------
 2081|    102|		as->length--;
 2082|       |	/* strip final component */
 2083|  9.58k|	while (as->length > 0 && as->s[as->length - 1] != '/')
  ------------------
  |  Branch (2083:9): [True: 8.41k, False: 1.16k]
  |  Branch (2083:27): [True: 7.19k, False: 1.22k]
  ------------------
 2084|  7.19k|		as->length--;
 2085|       |	/* empty path -> cwd */
 2086|  2.39k|	if (as->length == 0)
  ------------------
  |  Branch (2086:6): [True: 1.16k, False: 1.22k]
  ------------------
 2087|  1.16k|		return (archive_strcat(as, "."));
 2088|       |	/* strip separator(s) */
 2089|  2.45k|	while (as->length > 1 && as->s[as->length - 1] == '/')
  ------------------
  |  Branch (2089:9): [True: 1.95k, False: 495]
  |  Branch (2089:27): [True: 1.22k, False: 730]
  ------------------
 2090|  1.22k|		as->length--;
 2091|       |	/* terminate */
 2092|  1.22k|	as->s[as->length] = '\0';
 2093|  1.22k|	return (as);
 2094|  2.39k|}
archive_mstring_clean:
 3928|  3.28M|{
 3929|  3.28M|	archive_wstring_free(&(aes->aes_wcs));
 3930|  3.28M|	archive_string_free(&(aes->aes_mbs));
 3931|  3.28M|	archive_string_free(&(aes->aes_utf8));
 3932|  3.28M|	archive_string_free(&(aes->aes_mbs_in_locale));
 3933|  3.28M|	aes->aes_set = 0;
 3934|  3.28M|}
archive_mstring_get_utf8:
 3948|   428k|{
 3949|   428k|	struct archive_string_conv *sc;
 3950|   428k|	int r;
 3951|       |
 3952|       |	/* If we already have a UTF8 form, return that immediately. */
 3953|   428k|	if (aes->aes_set & AES_SET_UTF8) {
  ------------------
  |  |  221|   428k|#define	AES_SET_UTF8 2
  ------------------
  |  Branch (3953:6): [True: 32.0k, False: 396k]
  ------------------
 3954|  32.0k|		*p = aes->aes_utf8.s;
 3955|  32.0k|		return (0);
 3956|  32.0k|	}
 3957|       |
 3958|   396k|	*p = NULL;
 3959|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 3960|       |	/*
 3961|       |	 * On Windows, first try converting from WCS because (1) there's no
 3962|       |	 * guarantee that the conversion to MBS will succeed, e.g. when using
 3963|       |	 * CP_ACP, and (2) that's more efficient than converting to MBS, just to
 3964|       |	 * convert back to WCS again before finally converting to UTF-8
 3965|       |	 */
 3966|       |	if ((aes->aes_set & AES_SET_WCS) != 0) {
 3967|       |		sc = archive_string_conversion_to_charset(a, "UTF-8", 1);
 3968|       |		if (sc == NULL)
 3969|       |			return (-1);/* Couldn't allocate memory for sc. */
 3970|       |		archive_string_empty(&(aes->aes_utf8));
 3971|       |		r = archive_string_append_from_wcs_in_codepage(&(aes->aes_utf8),
 3972|       |			aes->aes_wcs.s, aes->aes_wcs.length, sc);
 3973|       |		if (a == NULL)
 3974|       |			free_sconv_object(sc);
 3975|       |		if (r == 0) {
 3976|       |			aes->aes_set |= AES_SET_UTF8;
 3977|       |			*p = aes->aes_utf8.s;
 3978|       |			return (0);/* success. */
 3979|       |		} else
 3980|       |			return (-1);/* failure. */
 3981|       |	}
 3982|       |#endif
 3983|       |	/* Try converting WCS to MBS first if MBS does not exist yet. */
 3984|   396k|	if ((aes->aes_set & AES_SET_MBS) == 0) {
  ------------------
  |  |  220|   396k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (3984:6): [True: 7.46k, False: 388k]
  ------------------
 3985|  7.46k|		const char *pm; /* unused */
 3986|  7.46k|		archive_mstring_get_mbs(a, aes, &pm); /* ignore errors, we'll handle it later */
 3987|  7.46k|	}
 3988|   396k|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|   396k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (3988:6): [True: 388k, False: 7.46k]
  ------------------
 3989|   388k|		sc = archive_string_conversion_to_charset(a, "UTF-8", 1);
 3990|   388k|		if (sc == NULL)
  ------------------
  |  Branch (3990:7): [True: 0, False: 388k]
  ------------------
 3991|      0|			return (-1);/* Couldn't allocate memory for sc. */
 3992|   388k|		r = archive_strncpy_l(&(aes->aes_utf8), aes->aes_mbs.s,
 3993|   388k|		    aes->aes_mbs.length, sc);
 3994|   388k|		if (a == NULL)
  ------------------
  |  Branch (3994:7): [True: 388k, False: 0]
  ------------------
 3995|   388k|			free_sconv_object(sc);
 3996|   388k|		if (r == 0) {
  ------------------
  |  Branch (3996:7): [True: 365k, False: 23.2k]
  ------------------
 3997|   365k|			aes->aes_set |= AES_SET_UTF8;
  ------------------
  |  |  221|   365k|#define	AES_SET_UTF8 2
  ------------------
 3998|   365k|			*p = aes->aes_utf8.s;
 3999|   365k|			return (0);/* success. */
 4000|   365k|		} else
 4001|  23.2k|			return (-1);/* failure. */
 4002|   388k|	}
 4003|  7.46k|	return (0);/* success. */
 4004|   396k|}
archive_mstring_get_mbs:
 4009|  1.57M|{
 4010|  1.57M|	struct archive_string_conv *sc;
 4011|  1.57M|	int r, ret = 0;
 4012|       |
 4013|       |	/* If we already have an MBS form, return that immediately. */
 4014|  1.57M|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|  1.57M|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4014:6): [True: 956k, False: 616k]
  ------------------
 4015|   956k|		*p = aes->aes_mbs.s;
 4016|   956k|		return (ret);
 4017|   956k|	}
 4018|       |
 4019|   616k|	*p = NULL;
 4020|       |	/* If there's a WCS form, try converting with the native locale. */
 4021|   616k|	if (aes->aes_set & AES_SET_WCS) {
  ------------------
  |  |  222|   616k|#define	AES_SET_WCS 4
  ------------------
  |  Branch (4021:6): [True: 6.93k, False: 609k]
  ------------------
 4022|  6.93k|		archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  6.93k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4023|  6.93k|		r = archive_string_append_from_wcs(&(aes->aes_mbs),
 4024|  6.93k|		    aes->aes_wcs.s, aes->aes_wcs.length);
 4025|  6.93k|		*p = aes->aes_mbs.s;
 4026|  6.93k|		if (r == 0) {
  ------------------
  |  Branch (4026:7): [True: 6.93k, False: 0]
  ------------------
 4027|  6.93k|			aes->aes_set |= AES_SET_MBS;
  ------------------
  |  |  220|  6.93k|#define	AES_SET_MBS 1
  ------------------
 4028|  6.93k|			return (ret);
 4029|  6.93k|		} else
 4030|      0|			ret = -1;
 4031|  6.93k|	}
 4032|       |
 4033|       |	/* If there's a UTF-8 form, try converting with the native locale. */
 4034|   609k|	if (aes->aes_set & AES_SET_UTF8) {
  ------------------
  |  |  221|   609k|#define	AES_SET_UTF8 2
  ------------------
  |  Branch (4034:6): [True: 1.95k, False: 607k]
  ------------------
 4035|  1.95k|		archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  1.95k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4036|  1.95k|		sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 4037|  1.95k|		if (sc == NULL)
  ------------------
  |  Branch (4037:7): [True: 0, False: 1.95k]
  ------------------
 4038|      0|			return (-1);/* Couldn't allocate memory for sc. */
 4039|  1.95k|		r = archive_strncpy_l(&(aes->aes_mbs),
 4040|  1.95k|			aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4041|  1.95k|		if (a == NULL)
  ------------------
  |  Branch (4041:7): [True: 1.95k, False: 0]
  ------------------
 4042|  1.95k|			free_sconv_object(sc);
 4043|  1.95k|		*p = aes->aes_mbs.s;
 4044|  1.95k|		if (r == 0) {
  ------------------
  |  Branch (4044:7): [True: 0, False: 1.95k]
  ------------------
 4045|      0|			aes->aes_set |= AES_SET_MBS;
  ------------------
  |  |  220|      0|#define	AES_SET_MBS 1
  ------------------
 4046|      0|			ret = 0;/* success; overwrite previous error. */
 4047|      0|		} else
 4048|  1.95k|			ret = -1;/* failure. */
 4049|  1.95k|	}
 4050|   609k|	return (ret);
 4051|   609k|}
archive_mstring_get_wcs:
 4056|   755k|{
 4057|   755k|	int r, ret = 0;
 4058|       |
 4059|   755k|	(void)a;/* UNUSED */
 4060|       |	/* Return WCS form if we already have it. */
 4061|   755k|	if (aes->aes_set & AES_SET_WCS) {
  ------------------
  |  |  222|   755k|#define	AES_SET_WCS 4
  ------------------
  |  Branch (4061:6): [True: 50.1k, False: 705k]
  ------------------
 4062|  50.1k|		*wp = aes->aes_wcs.s;
 4063|  50.1k|		return (ret);
 4064|  50.1k|	}
 4065|       |
 4066|   705k|	*wp = NULL;
 4067|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 4068|       |	/*
 4069|       |	 * On Windows, prefer converting from UTF-8 directly to WCS because:
 4070|       |	 * (1) there's no guarantee that the string can be represented in MBS (e.g.
 4071|       |	 * with CP_ACP), and (2) in order to convert from UTF-8 to MBS, we're going
 4072|       |	 * to need to convert from UTF-8 to WCS anyway and its wasteful to throw
 4073|       |	 * away that intermediate result
 4074|       |	 */
 4075|       |	if (aes->aes_set & AES_SET_UTF8) {
 4076|       |		struct archive_string_conv *sc;
 4077|       |
 4078|       |		sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 4079|       |		if (sc != NULL) {
 4080|       |			archive_wstring_empty((&aes->aes_wcs));
 4081|       |			r = archive_wstring_append_from_mbs_in_codepage(&(aes->aes_wcs),
 4082|       |			    aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4083|       |			if (a == NULL)
 4084|       |				free_sconv_object(sc);
 4085|       |			if (r == 0) {
 4086|       |				aes->aes_set |= AES_SET_WCS;
 4087|       |				*wp = aes->aes_wcs.s;
 4088|       |				return (0);
 4089|       |			}
 4090|       |		}
 4091|       |	}
 4092|       |#endif
 4093|       |	/* Try converting UTF8 to MBS first if MBS does not exist yet. */
 4094|   705k|	if ((aes->aes_set & AES_SET_MBS) == 0) {
  ------------------
  |  |  220|   705k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4094:6): [True: 301k, False: 404k]
  ------------------
 4095|   301k|		const char *p; /* unused */
 4096|   301k|		archive_mstring_get_mbs(a, aes, &p); /* ignore errors, we'll handle it later */
 4097|   301k|	}
 4098|       |	/* Try converting MBS to WCS using native locale. */
 4099|   705k|	if (aes->aes_set & AES_SET_MBS) {
  ------------------
  |  |  220|   705k|#define	AES_SET_MBS 1
  ------------------
  |  Branch (4099:6): [True: 404k, False: 301k]
  ------------------
 4100|   404k|		archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|   404k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4101|   404k|		r = archive_wstring_append_from_mbs(&(aes->aes_wcs),
 4102|   404k|		    aes->aes_mbs.s, aes->aes_mbs.length);
 4103|   404k|		if (r == 0) {
  ------------------
  |  Branch (4103:7): [True: 365k, False: 38.3k]
  ------------------
 4104|   365k|			aes->aes_set |= AES_SET_WCS;
  ------------------
  |  |  222|   365k|#define	AES_SET_WCS 4
  ------------------
 4105|   365k|			*wp = aes->aes_wcs.s;
 4106|   365k|		} else
 4107|  38.3k|			ret = -1;/* failure. */
 4108|   404k|	}
 4109|   705k|	return (ret);
 4110|   755k|}
archive_mstring_copy_mbs:
 4180|  64.4k|{
 4181|  64.4k|	if (mbs == NULL) {
  ------------------
  |  Branch (4181:6): [True: 5.84k, False: 58.6k]
  ------------------
 4182|  5.84k|		aes->aes_set = 0;
 4183|  5.84k|		return (0);
 4184|  5.84k|	}
 4185|  58.6k|	return (archive_mstring_copy_mbs_len(aes, mbs, strlen(mbs)));
 4186|  64.4k|}
archive_mstring_copy_mbs_len:
 4191|  66.2k|{
 4192|  66.2k|	if (mbs == NULL) {
  ------------------
  |  Branch (4192:6): [True: 0, False: 66.2k]
  ------------------
 4193|      0|		aes->aes_set = 0;
 4194|      0|		return (0);
 4195|      0|	}
 4196|  66.2k|	aes->aes_set = AES_SET_MBS; /* Only MBS form is set now. */
  ------------------
  |  |  220|  66.2k|#define	AES_SET_MBS 1
  ------------------
 4197|  66.2k|	archive_strncpy(&(aes->aes_mbs), mbs, len);
  ------------------
  |  |  173|  66.2k|	((as)->length=0, archive_strncat((as), (p), (l)))
  ------------------
 4198|  66.2k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|  66.2k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4199|  66.2k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  66.2k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4200|  66.2k|	return (0);
 4201|  66.2k|}
archive_mstring_copy_wcs:
 4205|  7.26k|{
 4206|  7.26k|	return archive_mstring_copy_wcs_len(aes, wcs,
 4207|  7.26k|				wcs == NULL ? 0 : wcslen(wcs));
  ------------------
  |  Branch (4207:5): [True: 0, False: 7.26k]
  ------------------
 4208|  7.26k|}
archive_mstring_copy_wcs_len:
 4227|  7.26k|{
 4228|  7.26k|	if (wcs == NULL) {
  ------------------
  |  Branch (4228:6): [True: 0, False: 7.26k]
  ------------------
 4229|      0|		aes->aes_set = 0;
 4230|      0|		return (0);
 4231|      0|	}
 4232|  7.26k|	aes->aes_set = AES_SET_WCS; /* Only WCS form set. */
  ------------------
  |  |  222|  7.26k|#define	AES_SET_WCS 4
  ------------------
 4233|  7.26k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  7.26k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4234|  7.26k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|  7.26k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4235|  7.26k|	archive_wstrncpy(&(aes->aes_wcs), wcs, len);
  ------------------
  |  |  175|  7.26k|	((as)->length = 0, archive_wstrncat((as), (p), (l)))
  ------------------
 4236|  7.26k|	return (0);
 4237|  7.26k|}
archive_mstring_copy_mbs_len_l:
 4242|   365k|{
 4243|   365k|	int r;
 4244|       |
 4245|   365k|	if (mbs == NULL) {
  ------------------
  |  Branch (4245:6): [True: 8.84k, False: 357k]
  ------------------
 4246|  8.84k|		aes->aes_set = 0;
 4247|  8.84k|		return (0);
 4248|  8.84k|	}
 4249|   357k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|   357k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4250|   357k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|   357k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4251|   357k|	archive_string_empty(&(aes->aes_utf8));
  ------------------
  |  |  181|   357k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4252|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 4253|       |	/*
 4254|       |	 * Internationalization programming on Windows must use Wide
 4255|       |	 * characters because Windows platform cannot make locale UTF-8.
 4256|       |	 */
 4257|       |	if (sc == NULL) {
 4258|       |		if (archive_string_append(&(aes->aes_mbs),
 4259|       |			mbs, mbsnbytes(mbs, len)) == NULL) {
 4260|       |			aes->aes_set = 0;
 4261|       |			r = -1;
 4262|       |		} else {
 4263|       |			aes->aes_set = AES_SET_MBS;
 4264|       |			r = 0;
 4265|       |		}
 4266|       |#if defined(HAVE_ICONV)
 4267|       |	} else if (sc != NULL && sc->cd_w != (iconv_t)-1) {
 4268|       |		/*
 4269|       |		 * This case happens only when MultiByteToWideChar() cannot
 4270|       |		 * handle sc->from_cp, and we have to iconv in order to
 4271|       |		 * translate character-set to wchar_t,UTF-16.
 4272|       |		 */
 4273|       |		iconv_t cd = sc->cd;
 4274|       |		unsigned from_cp;
 4275|       |		int flag;
 4276|       |
 4277|       |		/*
 4278|       |		 * Translate multi-bytes from some character-set to UTF-8.
 4279|       |		 */ 
 4280|       |		sc->cd = sc->cd_w;
 4281|       |		r = archive_strncpy_l(&(aes->aes_utf8), mbs, len, sc);
 4282|       |		sc->cd = cd;
 4283|       |		if (r != 0) {
 4284|       |			aes->aes_set = 0;
 4285|       |			return (r);
 4286|       |		}
 4287|       |		aes->aes_set = AES_SET_UTF8;
 4288|       |
 4289|       |		/*
 4290|       |		 * Append the UTF-8 string into wstring.
 4291|       |		 */ 
 4292|       |		flag = sc->flag;
 4293|       |		sc->flag &= ~(SCONV_NORMALIZATION_C
 4294|       |				| SCONV_TO_UTF16| SCONV_FROM_UTF16);
 4295|       |		from_cp = sc->from_cp;
 4296|       |		sc->from_cp = CP_UTF8;
 4297|       |		r = archive_wstring_append_from_mbs_in_codepage(&(aes->aes_wcs),
 4298|       |			aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4299|       |		sc->flag = flag;
 4300|       |		sc->from_cp = from_cp;
 4301|       |		if (r == 0)
 4302|       |			aes->aes_set |= AES_SET_WCS;
 4303|       |#endif
 4304|       |	} else {
 4305|       |		r = archive_wstring_append_from_mbs_in_codepage(
 4306|       |		    &(aes->aes_wcs), mbs, len, sc);
 4307|       |		if (r == 0)
 4308|       |			aes->aes_set = AES_SET_WCS;
 4309|       |		else
 4310|       |			aes->aes_set = 0;
 4311|       |	}
 4312|       |#else
 4313|   357k|	r = archive_strncpy_l(&(aes->aes_mbs), mbs, len, sc);
 4314|   357k|	if (r == 0)
  ------------------
  |  Branch (4314:6): [True: 351k, False: 5.35k]
  ------------------
 4315|   351k|		aes->aes_set = AES_SET_MBS; /* Only MBS form is set now. */
  ------------------
  |  |  220|   351k|#define	AES_SET_MBS 1
  ------------------
 4316|  5.35k|	else
 4317|  5.35k|		aes->aes_set = 0;
 4318|   357k|#endif
 4319|   357k|	return (r);
 4320|   365k|}
archive_mstring_update_utf8:
 4335|  40.7k|{
 4336|  40.7k|	struct archive_string_conv *sc;
 4337|  40.7k|	int r;
 4338|       |
 4339|  40.7k|	if (utf8 == NULL) {
  ------------------
  |  Branch (4339:6): [True: 0, False: 40.7k]
  ------------------
 4340|      0|		aes->aes_set = 0;
 4341|      0|		return (0); /* Succeeded in clearing everything. */
 4342|      0|	}
 4343|       |
 4344|       |	/* Save the UTF8 string. */
 4345|  40.7k|	archive_strcpy(&(aes->aes_utf8), utf8);
  ------------------
  |  |  165|  40.7k|	archive_strncpy((as), (p), ((p) == NULL ? 0 : strlen(p)))
  |  |  ------------------
  |  |  |  |  173|  81.5k|	((as)->length=0, archive_strncat((as), (p), (l)))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (173:47): [True: 0, False: 40.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4346|       |
 4347|       |	/* Empty the mbs and wcs strings. */
 4348|  40.7k|	archive_string_empty(&(aes->aes_mbs));
  ------------------
  |  |  181|  40.7k|#define	archive_string_empty(a) ((a)->length = 0)
  ------------------
 4349|  40.7k|	archive_wstring_empty(&(aes->aes_wcs));
  ------------------
  |  |  182|  40.7k|#define	archive_wstring_empty(a) ((a)->length = 0)
  ------------------
 4350|       |
 4351|  40.7k|	aes->aes_set = AES_SET_UTF8;	/* Only UTF8 is set now. */
  ------------------
  |  |  221|  40.7k|#define	AES_SET_UTF8 2
  ------------------
 4352|       |
 4353|  40.7k|	sc = archive_string_conversion_from_charset(a, "UTF-8", 1);
 4354|  40.7k|	if (sc == NULL)
  ------------------
  |  Branch (4354:6): [True: 0, False: 40.7k]
  ------------------
 4355|      0|		return (-1);/* Couldn't allocate memory for sc. */
 4356|       |
 4357|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 4358|       |	/* On Windows, there's no good way to convert from UTF8 -> MBS directly, so
 4359|       |	 * prefer to first convert to WCS as (1) it's wasteful to throw away the
 4360|       |	 * intermediate result, and (2) WCS will still be set even if we fail to
 4361|       |	 * convert to MBS (e.g. with ACP that can't represent the characters) */
 4362|       |	r = archive_wstring_append_from_mbs_in_codepage(&(aes->aes_wcs),
 4363|       |		aes->aes_utf8.s, aes->aes_utf8.length, sc);
 4364|       |
 4365|       |	if (a == NULL)
 4366|       |		free_sconv_object(sc);
 4367|       |	if (r != 0)
 4368|       |		return (-1); /* This will guarantee we can't convert to MBS */
 4369|       |	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS; /* Both UTF8 and WCS set. */
 4370|       |
 4371|       |	/* Try converting WCS to MBS, return false on failure. */
 4372|       |	if (archive_string_append_from_wcs(&(aes->aes_mbs), aes->aes_wcs.s,
 4373|       |	    aes->aes_wcs.length))
 4374|       |		return (-1);
 4375|       |#else
 4376|       |	/* Try converting UTF-8 to MBS, return false on failure. */
 4377|  40.7k|	r = archive_strcpy_l(&(aes->aes_mbs), utf8, sc);
  ------------------
  |  |  169|  40.7k|	archive_strncpy_l((as), (p), ((p) == NULL ? 0 : strlen(p)), (lo))
  |  |  ------------------
  |  |  |  Branch (169:32): [True: 0, False: 40.7k]
  |  |  ------------------
  ------------------
 4378|       |
 4379|  40.7k|	if (a == NULL)
  ------------------
  |  Branch (4379:6): [True: 40.7k, False: 0]
  ------------------
 4380|  40.7k|		free_sconv_object(sc);
 4381|  40.7k|	if (r != 0)
  ------------------
  |  Branch (4381:6): [True: 34.1k, False: 6.65k]
  ------------------
 4382|  34.1k|		return (-1);
 4383|  6.65k|	aes->aes_set = AES_SET_UTF8 | AES_SET_MBS; /* Both UTF8 and MBS set. */
  ------------------
  |  |  221|  6.65k|#define	AES_SET_UTF8 2
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_MBS; /* Both UTF8 and MBS set. */
  ------------------
  |  |  220|  6.65k|#define	AES_SET_MBS 1
  ------------------
 4384|       |
 4385|       |	/* Try converting MBS to WCS, return false on failure. */
 4386|  6.65k|	if (archive_wstring_append_from_mbs(&(aes->aes_wcs), aes->aes_mbs.s,
  ------------------
  |  Branch (4386:6): [True: 0, False: 6.65k]
  ------------------
 4387|  6.65k|	    aes->aes_mbs.length))
 4388|      0|		return (-1);
 4389|  6.65k|#endif
 4390|       |
 4391|       |	/* All conversions succeeded. */
 4392|  6.65k|	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  221|  6.65k|#define	AES_SET_UTF8 2
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  222|  6.65k|#define	AES_SET_WCS 4
  ------------------
              	aes->aes_set = AES_SET_UTF8 | AES_SET_WCS | AES_SET_MBS;
  ------------------
  |  |  220|  6.65k|#define	AES_SET_MBS 1
  ------------------
 4393|       |
 4394|  6.65k|	return (0);
 4395|  6.65k|}
archive_string.c:archive_string_append:
  226|  13.9M|{
  227|  13.9M|	if (archive_string_ensure(as, as->length + s + 1) == NULL)
  ------------------
  |  Branch (227:6): [True: 0, False: 13.9M]
  ------------------
  228|      0|		return (NULL);
  229|  13.9M|	if (s)
  ------------------
  |  Branch (229:6): [True: 13.9M, False: 14.5k]
  ------------------
  230|  13.9M|		memmove(as->s + as->length, p, s);
  231|  13.9M|	as->length += s;
  232|  13.9M|	as->s[as->length] = 0;
  233|  13.9M|	return (as);
  234|  13.9M|}
archive_string.c:archive_wstring_append:
  238|  20.4k|{
  239|  20.4k|	if (archive_wstring_ensure(as, as->length + s + 1) == NULL)
  ------------------
  |  Branch (239:6): [True: 0, False: 20.4k]
  ------------------
  240|      0|		return (NULL);
  241|  20.4k|	if (s)
  ------------------
  |  Branch (241:6): [True: 13.5k, False: 6.92k]
  ------------------
  242|  13.5k|		wmemmove(as->s + as->length, p, s);
  243|  20.4k|	as->length += s;
  244|  20.4k|	as->s[as->length] = 0;
  245|  20.4k|	return (as);
  246|  20.4k|}
archive_string.c:get_sconv_object:
 1700|   437k|{
 1701|   437k|	struct archive_string_conv *sc;
 1702|   437k|	unsigned current_codepage;
 1703|       |
 1704|       |	/* Check if we have made the sconv object. */
 1705|   437k|	sc = find_sconv_object(a, fc, tc);
 1706|   437k|	if (sc != NULL)
  ------------------
  |  Branch (1706:6): [True: 1.59k, False: 435k]
  ------------------
 1707|  1.59k|		return (sc);
 1708|       |
 1709|   435k|	if (a == NULL)
  ------------------
  |  Branch (1709:6): [True: 431k, False: 3.80k]
  ------------------
 1710|   431k|		current_codepage = get_current_codepage();
 1711|  3.80k|	else
 1712|  3.80k|		current_codepage = a->current_codepage;
 1713|       |
 1714|   435k|	sc = create_sconv_object(canonical_charset_name(fc),
 1715|   435k|	    canonical_charset_name(tc), current_codepage, flag);
 1716|   435k|	if (sc == NULL) {
  ------------------
  |  Branch (1716:6): [True: 0, False: 435k]
  ------------------
 1717|      0|		if (a != NULL)
  ------------------
  |  Branch (1717:7): [True: 0, False: 0]
  ------------------
 1718|      0|			archive_set_error(a, ENOMEM,
 1719|      0|			    "Could not allocate memory for "
 1720|      0|			    "a string conversion object");
 1721|      0|		return (NULL);
 1722|      0|	}
 1723|       |
 1724|       |	/*
 1725|       |	 * If there is no converter for current string conversion object,
 1726|       |	 * we cannot handle this conversion.
 1727|       |	 */
 1728|   435k|	if (sc->nconverter == 0) {
  ------------------
  |  Branch (1728:6): [True: 0, False: 435k]
  ------------------
 1729|      0|		if (a != NULL) {
  ------------------
  |  Branch (1729:7): [True: 0, False: 0]
  ------------------
 1730|      0|#if HAVE_ICONV
 1731|      0|			archive_set_error(a, ARCHIVE_ERRNO_MISC,
  ------------------
  |  |  204|      0|#define	ARCHIVE_ERRNO_MISC (-1)
  ------------------
 1732|      0|			    "iconv_open failed: Cannot handle ``%s''",
 1733|      0|			    (flag & SCONV_TO_CHARSET)?tc:fc);
  ------------------
  |  |   89|      0|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
  |  Branch (1733:8): [True: 0, False: 0]
  ------------------
 1734|       |#else
 1735|       |			archive_set_error(a, ARCHIVE_ERRNO_MISC,
 1736|       |			    "A character-set conversion not fully supported "
 1737|       |			    "on this platform");
 1738|       |#endif
 1739|      0|		}
 1740|       |		/* Failed; free a sconv object. */
 1741|      0|		free_sconv_object(sc);
 1742|      0|		return (NULL);
 1743|      0|	}
 1744|       |
 1745|       |	/*
 1746|       |	 * Success!
 1747|       |	 */
 1748|   435k|	if (a != NULL)
  ------------------
  |  Branch (1748:6): [True: 3.80k, False: 431k]
  ------------------
 1749|  3.80k|		add_sconv_object(a, sc);
 1750|   435k|	return (sc);
 1751|   435k|}
archive_string.c:find_sconv_object:
  912|   437k|{
  913|   437k|	struct archive_string_conv *sc; 
  914|       |
  915|   437k|	if (a == NULL)
  ------------------
  |  Branch (915:6): [True: 431k, False: 5.39k]
  ------------------
  916|   431k|		return (NULL);
  917|       |
  918|  10.7k|	for (sc = a->sconv; sc != NULL; sc = sc->next) {
  ------------------
  |  Branch (918:22): [True: 6.99k, False: 3.80k]
  ------------------
  919|  6.99k|		if (strcmp(sc->from_charset, fc) == 0 &&
  ------------------
  |  Branch (919:7): [True: 1.59k, False: 5.40k]
  ------------------
  920|  1.59k|		    strcmp(sc->to_charset, tc) == 0)
  ------------------
  |  Branch (920:7): [True: 1.59k, False: 0]
  ------------------
  921|  1.59k|			break;
  922|  6.99k|	}
  923|  5.39k|	return (sc);
  924|   437k|}
archive_string.c:get_current_codepage:
 1678|   435k|{
 1679|   435k|	return (-1);/* Unknown */
 1680|   435k|}
archive_string.c:create_sconv_object:
 1173|   435k|{
 1174|   435k|	struct archive_string_conv *sc; 
 1175|       |
 1176|   435k|	sc = calloc(1, sizeof(*sc));
 1177|   435k|	if (sc == NULL)
  ------------------
  |  Branch (1177:6): [True: 0, False: 435k]
  ------------------
 1178|      0|		return (NULL);
 1179|   435k|	sc->next = NULL;
 1180|   435k|	sc->from_charset = strdup(fc);
 1181|   435k|	if (sc->from_charset == NULL) {
  ------------------
  |  Branch (1181:6): [True: 0, False: 435k]
  ------------------
 1182|      0|		free(sc);
 1183|      0|		return (NULL);
 1184|      0|	}
 1185|   435k|	sc->to_charset = strdup(tc);
 1186|   435k|	if (sc->to_charset == NULL) {
  ------------------
  |  Branch (1186:6): [True: 0, False: 435k]
  ------------------
 1187|      0|		free(sc->from_charset);
 1188|      0|		free(sc);
 1189|      0|		return (NULL);
 1190|      0|	}
 1191|   435k|	archive_string_init(&sc->utftmp);
  ------------------
  |  |   71|   435k|	do { (a)->s = NULL; (a)->length = 0; (a)->buffer_length = 0; } while(0)
  |  |  ------------------
  |  |  |  Branch (71:71): [Folded, False: 435k]
  |  |  ------------------
  ------------------
 1192|       |
 1193|   435k|	if (flag & SCONV_TO_CHARSET) {
  ------------------
  |  |   89|   435k|#define SCONV_TO_CHARSET	1	/* MBS is being converted to specified
  ------------------
  |  Branch (1193:6): [True: 388k, False: 46.5k]
  ------------------
 1194|       |		/*
 1195|       |		 * Convert characters from the current locale charset to
 1196|       |		 * a specified charset.
 1197|       |		 */
 1198|   388k|		sc->from_cp = current_codepage;
 1199|   388k|		sc->to_cp = make_codepage_from_charset(tc);
 1200|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1201|       |		if (IsValidCodePage(sc->to_cp))
 1202|       |			flag |= SCONV_WIN_CP;
 1203|       |#endif
 1204|   388k|	} else if (flag & SCONV_FROM_CHARSET) {
  ------------------
  |  |   91|  46.5k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1204:13): [True: 46.5k, False: 0]
  ------------------
 1205|       |		/*
 1206|       |		 * Convert characters from a specified charset to
 1207|       |		 * the current locale charset.
 1208|       |		 */
 1209|  46.5k|		sc->to_cp = current_codepage;
 1210|  46.5k|		sc->from_cp = make_codepage_from_charset(fc);
 1211|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1212|       |		if (IsValidCodePage(sc->from_cp))
 1213|       |			flag |= SCONV_WIN_CP;
 1214|       |#endif
 1215|  46.5k|	}
 1216|       |
 1217|       |	/*
 1218|       |	 * Check if "from charset" and "to charset" are the same.
 1219|       |	 */
 1220|   435k|	if (strcmp(fc, tc) == 0 ||
  ------------------
  |  Branch (1220:6): [True: 0, False: 435k]
  ------------------
 1221|   435k|	    (sc->from_cp != (unsigned)-1 && sc->from_cp == sc->to_cp))
  ------------------
  |  Branch (1221:7): [True: 0, False: 435k]
  |  Branch (1221:38): [True: 0, False: 0]
  ------------------
 1222|      0|		sc->same = 1;
 1223|   435k|	else
 1224|   435k|		sc->same = 0;
 1225|       |
 1226|       |	/*
 1227|       |	 * Mark if "from charset" or "to charset" are UTF-8 or UTF-16BE/LE.
 1228|       |	 */
 1229|   435k|	if (strcmp(tc, "UTF-8") == 0)
  ------------------
  |  Branch (1229:6): [True: 388k, False: 46.5k]
  ------------------
 1230|   388k|		flag |= SCONV_TO_UTF8;
  ------------------
  |  |  105|   388k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
 1231|  46.5k|	else if (strcmp(tc, "UTF-16BE") == 0)
  ------------------
  |  Branch (1231:11): [True: 0, False: 46.5k]
  ------------------
 1232|      0|		flag |= SCONV_TO_UTF16BE;
  ------------------
  |  |  107|      0|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
 1233|  46.5k|	else if (strcmp(tc, "UTF-16LE") == 0)
  ------------------
  |  Branch (1233:11): [True: 0, False: 46.5k]
  ------------------
 1234|      0|		flag |= SCONV_TO_UTF16LE;
  ------------------
  |  |  109|      0|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  ------------------
 1235|   435k|	if (strcmp(fc, "UTF-8") == 0)
  ------------------
  |  Branch (1235:6): [True: 45.4k, False: 390k]
  ------------------
 1236|  45.4k|		flag |= SCONV_FROM_UTF8;
  ------------------
  |  |  106|  45.4k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
 1237|   390k|	else if (strcmp(fc, "UTF-16BE") == 0)
  ------------------
  |  Branch (1237:11): [True: 637, False: 389k]
  ------------------
 1238|    637|		flag |= SCONV_FROM_UTF16BE;
  ------------------
  |  |  108|    637|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
 1239|   389k|	else if (strcmp(fc, "UTF-16LE") == 0)
  ------------------
  |  Branch (1239:11): [True: 225, False: 389k]
  ------------------
 1240|    225|		flag |= SCONV_FROM_UTF16LE;
  ------------------
  |  |  110|    225|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
 1241|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1242|       |	if (sc->to_cp == CP_UTF8)
 1243|       |		flag |= SCONV_TO_UTF8;
 1244|       |	else if (sc->to_cp == CP_UTF16BE)
 1245|       |		flag |= SCONV_TO_UTF16BE | SCONV_WIN_CP;
 1246|       |	else if (sc->to_cp == CP_UTF16LE)
 1247|       |		flag |= SCONV_TO_UTF16LE | SCONV_WIN_CP;
 1248|       |	if (sc->from_cp == CP_UTF8)
 1249|       |		flag |= SCONV_FROM_UTF8;
 1250|       |	else if (sc->from_cp == CP_UTF16BE)
 1251|       |		flag |= SCONV_FROM_UTF16BE | SCONV_WIN_CP;
 1252|       |	else if (sc->from_cp == CP_UTF16LE)
 1253|       |		flag |= SCONV_FROM_UTF16LE | SCONV_WIN_CP;
 1254|       |#endif
 1255|       |
 1256|       |	/*
 1257|       |	 * Set a flag for Unicode NFD. Usually iconv cannot correctly
 1258|       |	 * handle it. So we have to translate NFD characters to NFC ones
 1259|       |	 * ourselves before iconv handles. Another reason is to prevent
 1260|       |	 * that the same sight of two filenames, one is NFC and other
 1261|       |	 * is NFD, would be in its directory.
 1262|       |	 * On Mac OS X, although its filesystem layer automatically
 1263|       |	 * convert filenames to NFD, it would be useful for filename
 1264|       |	 * comparing to find out the same filenames that we normalize
 1265|       |	 * that to be NFD ourselves.
 1266|       |	 */
 1267|   435k|	if ((flag & SCONV_FROM_CHARSET) &&
  ------------------
  |  |   91|   435k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1267:6): [True: 46.5k, False: 388k]
  ------------------
 1268|  46.5k|	    (flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8))) {
  ------------------
  |  |  112|  46.5k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|  46.5k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|  46.5k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
              	    (flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8))) {
  ------------------
  |  |  106|  46.5k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (1268:6): [True: 46.3k, False: 213]
  ------------------
 1269|       |#if defined(__APPLE__)
 1270|       |		if (flag & SCONV_TO_UTF8)
 1271|       |			flag |= SCONV_NORMALIZATION_D;
 1272|       |		else
 1273|       |#endif
 1274|  46.3k|			flag |= SCONV_NORMALIZATION_C;
  ------------------
  |  |   98|  46.3k|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
 1275|  46.3k|	}
 1276|       |#if defined(__APPLE__)
 1277|       |	/*
 1278|       |	 * In case writing an archive file, make sure that a filename
 1279|       |	 * going to be passed to iconv is a Unicode NFC string since
 1280|       |	 * a filename in HFS Plus filesystem is a Unicode NFD one and
 1281|       |	 * iconv cannot handle it with "UTF-8" charset. It is simpler
 1282|       |	 * than a use of "UTF-8-MAC" charset.
 1283|       |	 */
 1284|       |	if ((flag & SCONV_TO_CHARSET) &&
 1285|       |	    (flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8)) &&
 1286|       |	    !(flag & (SCONV_TO_UTF16 | SCONV_TO_UTF8)))
 1287|       |		flag |= SCONV_NORMALIZATION_C;
 1288|       |	/*
 1289|       |	 * In case reading an archive file. make sure that a filename
 1290|       |	 * will be passed to users is a Unicode NFD string in order to
 1291|       |	 * correctly compare the filename with other one which comes
 1292|       |	 * from HFS Plus filesystem.
 1293|       |	 */
 1294|       |	if ((flag & SCONV_FROM_CHARSET) &&
 1295|       |	   !(flag & (SCONV_FROM_UTF16 | SCONV_FROM_UTF8)) &&
 1296|       |	    (flag & SCONV_TO_UTF8))
 1297|       |		flag |= SCONV_NORMALIZATION_D;
 1298|       |#endif
 1299|       |
 1300|   435k|#if defined(HAVE_ICONV)
 1301|   435k|	sc->cd_w = (iconv_t)-1;
 1302|       |	/*
 1303|       |	 * Create an iconv object.
 1304|       |	 */
 1305|   435k|	if (((flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) &&
  ------------------
  |  |  105|   435k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
              	if (((flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) &&
  ------------------
  |  |  111|   435k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|   435k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|   435k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1305:7): [True: 388k, False: 46.5k]
  ------------------
 1306|   388k|	    (flag & (SCONV_FROM_UTF8 | SCONV_FROM_UTF16))) ||
  ------------------
  |  |  106|   388k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
              	    (flag & (SCONV_FROM_UTF8 | SCONV_FROM_UTF16))) ||
  ------------------
  |  |  112|   388k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|   388k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|   388k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1306:6): [True: 0, False: 388k]
  ------------------
 1307|   435k|	    (flag & SCONV_WIN_CP)) {
  ------------------
  |  |   94|   435k|#define SCONV_WIN_CP	 	(1<<3)	/* Use Windows API for converting
  ------------------
  |  Branch (1307:6): [True: 0, False: 435k]
  ------------------
 1308|       |		/* This case we won't use iconv. */
 1309|      0|		sc->cd = (iconv_t)-1;
 1310|   435k|	} else {
 1311|   435k|		sc->cd = iconv_open(tc, fc);
 1312|   435k|		if (sc->cd == (iconv_t)-1 && (sc->flag & SCONV_BEST_EFFORT)) {
  ------------------
  |  |   93|    213|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
  |  Branch (1312:7): [True: 213, False: 435k]
  |  Branch (1312:32): [True: 0, False: 213]
  ------------------
 1313|       |			/*
 1314|       |			 * Unfortunately, all of iconv implements do support
 1315|       |			 * "CP932" character-set, so we should use "SJIS"
 1316|       |			 * instead if iconv_open failed.
 1317|       |			 */
 1318|      0|			if (strcmp(tc, "CP932") == 0)
  ------------------
  |  Branch (1318:8): [True: 0, False: 0]
  ------------------
 1319|      0|				sc->cd = iconv_open("SJIS", fc);
 1320|      0|			else if (strcmp(fc, "CP932") == 0)
  ------------------
  |  Branch (1320:13): [True: 0, False: 0]
  ------------------
 1321|      0|				sc->cd = iconv_open(tc, "SJIS");
 1322|      0|		}
 1323|       |#if defined(__FreeBSD__) && !defined(HAVE_LIBICONV)
 1324|       |		/*
 1325|       |		 * FreeBSD's native iconv() by default returns the number of
 1326|       |		 * invalid characters in the input string, as specified by
 1327|       |		 * POSIX, but iconv_strncat_in_locale() assumes GNU iconv
 1328|       |		 * semantics.
 1329|       |		 */
 1330|       |		int v = 1;
 1331|       |
 1332|       |		(void)iconvctl(sc->cd, ICONV_SET_ILSEQ_INVALID, &v);
 1333|       |#elif defined(_WIN32) && !defined(__CYGWIN__)
 1334|       |		/*
 1335|       |		 * archive_mstring on Windows directly convert multi-bytes
 1336|       |		 * into archive_wstring in order not to depend on locale
 1337|       |		 * so that you can do a I18N programming. This will be
 1338|       |		 * used only in archive_mstring_copy_mbs_len_l so far.
 1339|       |		 */
 1340|       |		if (flag & SCONV_FROM_CHARSET) {
 1341|       |			sc->cd_w = iconv_open("UTF-8", fc);
 1342|       |			if (sc->cd_w == (iconv_t)-1 &&
 1343|       |			    (sc->flag & SCONV_BEST_EFFORT)) {
 1344|       |				if (strcmp(fc, "CP932") == 0)
 1345|       |					sc->cd_w = iconv_open("UTF-8", "SJIS");
 1346|       |			}
 1347|       |		}
 1348|       |#endif /* _WIN32 && !__CYGWIN__ */
 1349|   435k|	}
 1350|   435k|#endif	/* HAVE_ICONV */
 1351|       |
 1352|   435k|	sc->flag = flag;
 1353|       |
 1354|       |	/*
 1355|       |	 * Set up converters.
 1356|       |	 */
 1357|   435k|	setup_converter(sc);
 1358|       |
 1359|   435k|	return (sc);
 1360|   435k|}
archive_string.c:make_codepage_from_charset:
 1683|   435k|{
 1684|   435k|	(void)charset; /* UNUSED */
 1685|   435k|	return (-1);/* Unknown */
 1686|   435k|}
archive_string.c:canonical_charset_name:
 1133|   871k|{
 1134|   871k|	char cs[16];
 1135|   871k|	char *p;
 1136|   871k|	const char *s;
 1137|       |
 1138|   871k|	if (charset == NULL || charset[0] == '\0'
  ------------------
  |  Branch (1138:6): [True: 0, False: 871k]
  |  Branch (1138:25): [True: 0, False: 871k]
  ------------------
 1139|   871k|	    || strlen(charset) > 15)
  ------------------
  |  Branch (1139:9): [True: 0, False: 871k]
  ------------------
 1140|      0|		return (charset);
 1141|       |
 1142|       |	/* Copy name to uppercase. */
 1143|   871k|	p = cs;
 1144|   871k|	s = charset;
 1145|  9.14M|	while (*s) {
  ------------------
  |  Branch (1145:9): [True: 8.27M, False: 871k]
  ------------------
 1146|  8.27M|		char c = *s++;
 1147|  8.27M|		if (c >= 'a' && c <= 'z')
  ------------------
  |  Branch (1147:7): [True: 0, False: 8.27M]
  |  Branch (1147:19): [True: 0, False: 0]
  ------------------
 1148|      0|			c -= 'a' - 'A';
 1149|  8.27M|		*p++ = c;
 1150|  8.27M|	}
 1151|   871k|	*p++ = '\0';
 1152|       |
 1153|   871k|	if (strcmp(cs, "UTF-8") == 0 ||
  ------------------
  |  Branch (1153:6): [True: 434k, False: 436k]
  ------------------
 1154|   436k|	    strcmp(cs, "UTF8") == 0)
  ------------------
  |  Branch (1154:6): [True: 0, False: 436k]
  ------------------
 1155|   434k|		return ("UTF-8");
 1156|   436k|	if (strcmp(cs, "UTF-16BE") == 0 ||
  ------------------
  |  Branch (1156:6): [True: 637, False: 435k]
  ------------------
 1157|   435k|	    strcmp(cs, "UTF16BE") == 0)
  ------------------
  |  Branch (1157:6): [True: 0, False: 435k]
  ------------------
 1158|    637|		return ("UTF-16BE");
 1159|   435k|	if (strcmp(cs, "UTF-16LE") == 0 ||
  ------------------
  |  Branch (1159:6): [True: 225, False: 435k]
  ------------------
 1160|   435k|	    strcmp(cs, "UTF16LE") == 0)
  ------------------
  |  Branch (1160:6): [True: 0, False: 435k]
  ------------------
 1161|    225|		return ("UTF-16LE");
 1162|   435k|	if (strcmp(cs, "CP932") == 0)
  ------------------
  |  Branch (1162:6): [True: 0, False: 435k]
  ------------------
 1163|      0|		return ("CP932");
 1164|   435k|	return (charset);
 1165|   435k|}
archive_string.c:add_sconv_object:
  931|  3.80k|{
  932|  3.80k|	struct archive_string_conv **psc; 
  933|       |
  934|       |	/* Add a new sconv to sconv list. */
  935|  3.80k|	psc = &(a->sconv);
  936|  5.28k|	while (*psc != NULL)
  ------------------
  |  Branch (936:9): [True: 1.48k, False: 3.80k]
  ------------------
  937|  1.48k|		psc = &((*psc)->next);
  938|  3.80k|	*psc = sc;
  939|  3.80k|}
archive_string.c:get_current_charset:
 1755|   437k|{
 1756|   437k|	const char *cur_charset;
 1757|       |
 1758|   437k|	if (a == NULL)
  ------------------
  |  Branch (1758:6): [True: 431k, False: 5.39k]
  ------------------
 1759|   431k|		cur_charset = default_iconv_charset("");
 1760|  5.39k|	else {
 1761|  5.39k|		cur_charset = default_iconv_charset(a->current_code);
 1762|  5.39k|		if (a->current_code == NULL) {
  ------------------
  |  Branch (1762:7): [True: 3.57k, False: 1.82k]
  ------------------
 1763|  3.57k|			a->current_code = strdup(cur_charset);
 1764|  3.57k|			a->current_codepage = get_current_codepage();
 1765|  3.57k|			a->current_oemcp = get_current_oemcp();
 1766|  3.57k|		}
 1767|  5.39k|	}
 1768|   437k|	return (cur_charset);
 1769|   437k|}
archive_string.c:default_iconv_charset:
  445|   437k|default_iconv_charset(const char *charset) {
  446|   437k|	if (charset != NULL && charset[0] != '\0')
  ------------------
  |  Branch (446:6): [True: 433k, False: 3.57k]
  |  Branch (446:25): [True: 1.82k, False: 431k]
  ------------------
  447|  1.82k|		return charset;
  448|       |#if HAVE_LOCALE_CHARSET && HAVE_LOCALCHARSET_H && !defined(__APPLE__)
  449|       |	/* locale_charset() is broken on Mac OS */
  450|       |	return locale_charset();
  451|       |#elif HAVE_NL_LANGINFO
  452|   435k|	return nl_langinfo(CODESET);
  453|       |#elif defined(__BIONIC__)
  454|       |	return "UTF-8";
  455|       |#else
  456|       |	return "";
  457|       |#endif
  458|   437k|}
archive_string.c:get_current_oemcp:
 1689|  3.57k|{
 1690|  3.57k|	return (-1);/* Unknown */
 1691|  3.57k|}
archive_string.c:free_sconv_object:
 1367|   435k|{
 1368|   435k|	free(sc->from_charset);
 1369|   435k|	free(sc->to_charset);
 1370|   435k|	archive_string_free(&sc->utftmp);
 1371|   435k|#if HAVE_ICONV
 1372|   435k|	if (sc->cd != (iconv_t)-1)
  ------------------
  |  Branch (1372:6): [True: 435k, False: 213]
  ------------------
 1373|   435k|		iconv_close(sc->cd);
 1374|   435k|	if (sc->cd_w != (iconv_t)-1)
  ------------------
  |  Branch (1374:6): [True: 0, False: 435k]
  ------------------
 1375|      0|		iconv_close(sc->cd_w);
 1376|   435k|#endif
 1377|   435k|	free(sc);
 1378|   435k|}
archive_string.c:setup_converter:
  953|   435k|{
  954|       |
  955|       |	/* Reset. */
  956|   435k|	sc->nconverter = 0;
  957|       |
  958|       |	/*
  959|       |	 * Perform special sequence for the incorrect UTF-8 filenames
  960|       |	 * made by libarchive2.x.
  961|       |	 */
  962|   435k|	if (sc->flag & SCONV_UTF8_LIBARCHIVE_2) {
  ------------------
  |  |   96|   435k|#define SCONV_UTF8_LIBARCHIVE_2 (1<<4)	/* Incorrect UTF-8 made by libarchive
  ------------------
  |  Branch (962:6): [True: 0, False: 435k]
  ------------------
  963|      0|		add_converter(sc, strncat_from_utf8_libarchive2);
  964|      0|		return;
  965|      0|	}
  966|       |
  967|       |	/*
  968|       |	 * Convert a string to UTF-16BE/LE.
  969|       |	 */
  970|   435k|	if (sc->flag & SCONV_TO_UTF16) {
  ------------------
  |  |  111|   435k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|   435k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|   435k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (970:6): [True: 0, False: 435k]
  ------------------
  971|       |		/*
  972|       |		 * If the current locale is UTF-8, we can translate
  973|       |		 * a UTF-8 string into a UTF-16BE string.
  974|       |		 */
  975|      0|		if (sc->flag & SCONV_FROM_UTF8) {
  ------------------
  |  |  106|      0|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (975:7): [True: 0, False: 0]
  ------------------
  976|      0|			add_converter(sc, archive_string_append_unicode);
  977|      0|			return;
  978|      0|		}
  979|       |
  980|       |#if defined(_WIN32) && !defined(__CYGWIN__)
  981|       |		if (sc->flag & SCONV_WIN_CP) {
  982|       |			if (sc->flag & SCONV_TO_UTF16BE)
  983|       |				add_converter(sc, win_strncat_to_utf16be);
  984|       |			else
  985|       |				add_converter(sc, win_strncat_to_utf16le);
  986|       |			return;
  987|       |		}
  988|       |#endif
  989|       |
  990|      0|#if defined(HAVE_ICONV)
  991|      0|		if (sc->cd != (iconv_t)-1) {
  ------------------
  |  Branch (991:7): [True: 0, False: 0]
  ------------------
  992|      0|			add_converter(sc, iconv_strncat_in_locale);
  993|      0|			return;
  994|      0|		}
  995|      0|#endif
  996|       |
  997|      0|		if (sc->flag & SCONV_BEST_EFFORT) {
  ------------------
  |  |   93|      0|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
  |  Branch (997:7): [True: 0, False: 0]
  ------------------
  998|      0|			if (sc->flag & SCONV_TO_UTF16BE)
  ------------------
  |  |  107|      0|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
  |  Branch (998:8): [True: 0, False: 0]
  ------------------
  999|      0|				add_converter(sc,
 1000|      0|					best_effort_strncat_to_utf16be);
 1001|      0|			else
 1002|      0|				add_converter(sc,
 1003|      0|					best_effort_strncat_to_utf16le);
 1004|      0|		} else
 1005|       |			/* Make sure we have no converter. */
 1006|      0|			sc->nconverter = 0;
 1007|      0|		return;
 1008|      0|	}
 1009|       |
 1010|       |	/*
 1011|       |	 * Convert a string from UTF-16BE/LE.
 1012|       |	 */
 1013|   435k|	if (sc->flag & SCONV_FROM_UTF16) {
  ------------------
  |  |  112|   435k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|   435k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|   435k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (1013:6): [True: 862, False: 434k]
  ------------------
 1014|       |		/*
 1015|       |		 * At least we should normalize a UTF-16BE string.
 1016|       |		 */
 1017|    862|		if (sc->flag & SCONV_NORMALIZATION_D)
  ------------------
  |  |  101|    862|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
  |  Branch (1017:7): [True: 0, False: 862]
  ------------------
 1018|      0|			add_converter(sc,archive_string_normalize_D);
 1019|    862|		else if (sc->flag & SCONV_NORMALIZATION_C)
  ------------------
  |  |   98|    862|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
  |  Branch (1019:12): [True: 862, False: 0]
  ------------------
 1020|    862|			add_converter(sc, archive_string_normalize_C);
 1021|       |
 1022|    862|		if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|    862|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (1022:7): [True: 0, False: 862]
  ------------------
 1023|       |			/*
 1024|       |			 * If the current locale is UTF-8, we can translate
 1025|       |			 * a UTF-16BE/LE string into a UTF-8 string directly.
 1026|       |			 */
 1027|      0|			if (!(sc->flag &
  ------------------
  |  Branch (1027:8): [True: 0, False: 0]
  ------------------
 1028|      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.
  ------------------
 1029|      0|				add_converter(sc,
 1030|      0|				    archive_string_append_unicode);
 1031|      0|			return;
 1032|      0|		}
 1033|       |
 1034|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1035|       |		if (sc->flag & SCONV_WIN_CP) {
 1036|       |			if (sc->flag & SCONV_FROM_UTF16BE)
 1037|       |				add_converter(sc, win_strncat_from_utf16be);
 1038|       |			else
 1039|       |				add_converter(sc, win_strncat_from_utf16le);
 1040|       |			return;
 1041|       |		}
 1042|       |#endif
 1043|       |
 1044|    862|#if defined(HAVE_ICONV)
 1045|    862|		if (sc->cd != (iconv_t)-1) {
  ------------------
  |  Branch (1045:7): [True: 862, False: 0]
  ------------------
 1046|    862|			add_converter(sc, iconv_strncat_in_locale);
 1047|    862|			return;
 1048|    862|		}
 1049|      0|#endif
 1050|       |
 1051|      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 (1051:7): [True: 0, False: 0]
  ------------------
 1052|      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. */
  ------------------
 1053|      0|			add_converter(sc, best_effort_strncat_from_utf16be);
 1054|      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 (1054:12): [True: 0, False: 0]
  ------------------
 1055|      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. */
  ------------------
 1056|      0|			add_converter(sc, best_effort_strncat_from_utf16le);
 1057|      0|		else
 1058|       |			/* Make sure we have no converter. */
 1059|      0|			sc->nconverter = 0;
 1060|      0|		return;
 1061|    862|	}
 1062|       |
 1063|   434k|	if (sc->flag & SCONV_FROM_UTF8) {
  ------------------
  |  |  106|   434k|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (1063:6): [True: 45.4k, False: 389k]
  ------------------
 1064|       |		/*
 1065|       |		 * At least we should normalize a UTF-8 string.
 1066|       |		 */
 1067|  45.4k|		if (sc->flag & SCONV_NORMALIZATION_D)
  ------------------
  |  |  101|  45.4k|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
  |  Branch (1067:7): [True: 0, False: 45.4k]
  ------------------
 1068|      0|			add_converter(sc,archive_string_normalize_D);
 1069|  45.4k|		else if (sc->flag & SCONV_NORMALIZATION_C)
  ------------------
  |  |   98|  45.4k|#define SCONV_NORMALIZATION_C	(1<<6)	/* Need normalization to be Form C.
  ------------------
  |  Branch (1069:12): [True: 45.4k, False: 0]
  ------------------
 1070|  45.4k|			add_converter(sc, archive_string_normalize_C);
 1071|       |
 1072|       |		/*
 1073|       |		 * Copy UTF-8 string with a check of CESU-8.
 1074|       |		 * Apparently, iconv does not check surrogate pairs in UTF-8
 1075|       |		 * when both from-charset and to-charset are UTF-8, and then
 1076|       |		 * we use our UTF-8 copy code.
 1077|       |		 */
 1078|  45.4k|		if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|  45.4k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (1078:7): [True: 0, False: 45.4k]
  ------------------
 1079|       |			/*
 1080|       |			 * If the current locale is UTF-8, we can translate
 1081|       |			 * a UTF-16BE string into a UTF-8 string directly.
 1082|       |			 */
 1083|      0|			if (!(sc->flag &
  ------------------
  |  Branch (1083:8): [True: 0, False: 0]
  ------------------
 1084|      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.
  ------------------
 1085|      0|				add_converter(sc, strncat_from_utf8_to_utf8);
 1086|      0|			return;
 1087|      0|		}
 1088|  45.4k|	}
 1089|       |
 1090|       |#if defined(_WIN32) && !defined(__CYGWIN__)
 1091|       |	/*
 1092|       |	 * On Windows we can use Windows API for a string conversion.
 1093|       |	 */
 1094|       |	if (sc->flag & SCONV_WIN_CP) {
 1095|       |		add_converter(sc, strncat_in_codepage);
 1096|       |		return;
 1097|       |	}
 1098|       |#endif
 1099|       |
 1100|   434k|#if HAVE_ICONV
 1101|   434k|	if (sc->cd != (iconv_t)-1) {
  ------------------
  |  Branch (1101:6): [True: 434k, False: 213]
  ------------------
 1102|   434k|		add_converter(sc, iconv_strncat_in_locale);
 1103|       |		/*
 1104|       |		 * iconv generally does not support UTF-8-MAC and so
 1105|       |		 * we have to the output of iconv from NFC to NFD if
 1106|       |		 * need.
 1107|       |		 */
 1108|   434k|		if ((sc->flag & SCONV_FROM_CHARSET) &&
  ------------------
  |  |   91|   434k|#define SCONV_FROM_CHARSET	(1<<1)	/* MBS is being converted from
  ------------------
  |  Branch (1108:7): [True: 45.4k, False: 388k]
  ------------------
 1109|  45.4k|		    (sc->flag & SCONV_TO_UTF8)) {
  ------------------
  |  |  105|  45.4k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (1109:7): [True: 0, False: 45.4k]
  ------------------
 1110|      0|			if (sc->flag & SCONV_NORMALIZATION_D)
  ------------------
  |  |  101|      0|#define SCONV_NORMALIZATION_D	(1<<7)	/* Need normalization to be Form D.
  ------------------
  |  Branch (1110:8): [True: 0, False: 0]
  ------------------
 1111|      0|				add_converter(sc, archive_string_normalize_D);
 1112|      0|		}
 1113|   434k|		return;
 1114|   434k|	}
 1115|    213|#endif
 1116|       |
 1117|       |	/*
 1118|       |	 * Try conversion in the best effort or no conversion.
 1119|       |	 */
 1120|    213|	if ((sc->flag & SCONV_BEST_EFFORT) || sc->same)
  ------------------
  |  |   93|    213|#define SCONV_BEST_EFFORT 	(1<<2)	/* Copy at least ASCII code. */
  ------------------
  |  Branch (1120:6): [True: 213, False: 0]
  |  Branch (1120:40): [True: 0, False: 0]
  ------------------
 1121|    213|		add_converter(sc, best_effort_strncat_in_locale);
 1122|      0|	else
 1123|       |		/* Make sure we have no converter. */
 1124|      0|		sc->nconverter = 0;
 1125|    213|}
archive_string.c:add_converter:
  945|   481k|{
  946|   481k|	if (sc == NULL || sc->nconverter >= 2)
  ------------------
  |  Branch (946:6): [True: 0, False: 481k]
  |  Branch (946:20): [True: 0, False: 481k]
  ------------------
  947|      0|		__archive_errx(1, "Programming error");
  948|   481k|	sc->converter[sc->nconverter++] = converter;
  949|   481k|}
archive_string.c:_utf8_to_unicode:
 2374|  75.6M|{
 2375|  75.6M|	static const char utf8_count[256] = {
 2376|  75.6M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 00 - 0F */
 2377|  75.6M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 10 - 1F */
 2378|  75.6M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 20 - 2F */
 2379|  75.6M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 30 - 3F */
 2380|  75.6M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 40 - 4F */
 2381|  75.6M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 50 - 5F */
 2382|  75.6M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 60 - 6F */
 2383|  75.6M|		 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 70 - 7F */
 2384|  75.6M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 80 - 8F */
 2385|  75.6M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 90 - 9F */
 2386|  75.6M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* A0 - AF */
 2387|  75.6M|		 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* B0 - BF */
 2388|  75.6M|		 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* C0 - CF */
 2389|  75.6M|		 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* D0 - DF */
 2390|  75.6M|		 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,/* E0 - EF */
 2391|  75.6M|		 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* F0 - FF */
 2392|  75.6M|	};
 2393|  75.6M|	int ch, i;
 2394|  75.6M|	int cnt;
 2395|  75.6M|	uint32_t wc;
 2396|       |
 2397|       |	/* Sanity check. */
 2398|  75.6M|	if (n == 0)
  ------------------
  |  Branch (2398:6): [True: 47.2k, False: 75.5M]
  ------------------
 2399|  47.2k|		return (0);
 2400|       |	/*
 2401|       |	 * Decode 1-4 bytes depending on the value of the first byte.
 2402|       |	 */
 2403|  75.5M|	ch = (unsigned char)*s;
 2404|  75.5M|	if (ch == 0)
  ------------------
  |  Branch (2404:6): [True: 0, False: 75.5M]
  ------------------
 2405|      0|		return (0); /* Standard:  return 0 for end-of-string. */
 2406|  75.5M|	cnt = utf8_count[ch];
 2407|       |
 2408|       |	/* Invalid sequence or there are not plenty bytes. */
 2409|  75.5M|	if (n < (size_t)cnt) {
  ------------------
  |  Branch (2409:6): [True: 2.58k, False: 75.5M]
  ------------------
 2410|  2.58k|		cnt = (int)n;
 2411|  2.95k|		for (i = 1; i < cnt; i++) {
  ------------------
  |  Branch (2411:15): [True: 1.07k, False: 1.87k]
  ------------------
 2412|  1.07k|			if ((s[i] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2412:8): [True: 710, False: 363]
  ------------------
 2413|    710|				cnt = i;
 2414|    710|				break;
 2415|    710|			}
 2416|  1.07k|		}
 2417|  2.58k|		goto invalid_sequence;
 2418|  2.58k|	}
 2419|       |
 2420|       |	/* Make a Unicode code point from a single UTF-8 sequence. */
 2421|  75.5M|	switch (cnt) {
 2422|  75.0M|	case 1:	/* 1 byte sequence. */
  ------------------
  |  Branch (2422:2): [True: 75.0M, False: 522k]
  ------------------
 2423|  75.0M|		*pwc = ch & 0x7f;
 2424|  75.0M|		return (cnt);
 2425|   124k|	case 2:	/* 2 bytes sequence. */
  ------------------
  |  Branch (2425:2): [True: 124k, False: 75.4M]
  ------------------
 2426|   124k|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2426:7): [True: 49.2k, False: 74.9k]
  ------------------
 2427|  49.2k|			cnt = 1;
 2428|  49.2k|			goto invalid_sequence;
 2429|  49.2k|		}
 2430|  74.9k|		*pwc = ((ch & 0x1f) << 6) | (s[1] & 0x3f);
 2431|  74.9k|		return (cnt);
 2432|   150k|	case 3:	/* 3 bytes sequence. */
  ------------------
  |  Branch (2432:2): [True: 150k, False: 75.4M]
  ------------------
 2433|   150k|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2433:7): [True: 52.9k, False: 97.9k]
  ------------------
 2434|  52.9k|			cnt = 1;
 2435|  52.9k|			goto invalid_sequence;
 2436|  52.9k|		}
 2437|  97.9k|		if ((s[2] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2437:7): [True: 42.3k, False: 55.5k]
  ------------------
 2438|  42.3k|			cnt = 2;
 2439|  42.3k|			goto invalid_sequence;
 2440|  42.3k|		}
 2441|  55.5k|		wc = ((ch & 0x0f) << 12)
 2442|  55.5k|		    | ((s[1] & 0x3f) << 6)
 2443|  55.5k|		    | (s[2] & 0x3f);
 2444|  55.5k|		if (wc < 0x800)
  ------------------
  |  Branch (2444:7): [True: 633, False: 54.9k]
  ------------------
 2445|    633|			goto invalid_sequence;/* Overlong sequence. */
 2446|  54.9k|		break;
 2447|  54.9k|	case 4:	/* 4 bytes sequence. */
  ------------------
  |  Branch (2447:2): [True: 7.18k, False: 75.5M]
  ------------------
 2448|  7.18k|		if ((s[1] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2448:7): [True: 985, False: 6.19k]
  ------------------
 2449|    985|			cnt = 1;
 2450|    985|			goto invalid_sequence;
 2451|    985|		}
 2452|  6.19k|		if ((s[2] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2452:7): [True: 875, False: 5.32k]
  ------------------
 2453|    875|			cnt = 2;
 2454|    875|			goto invalid_sequence;
 2455|    875|		}
 2456|  5.32k|		if ((s[3] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2456:7): [True: 885, False: 4.43k]
  ------------------
 2457|    885|			cnt = 3;
 2458|    885|			goto invalid_sequence;
 2459|    885|		}
 2460|  4.43k|		wc = ((ch & 0x07) << 18)
 2461|  4.43k|		    | ((s[1] & 0x3f) << 12)
 2462|  4.43k|		    | ((s[2] & 0x3f) << 6)
 2463|  4.43k|		    | (s[3] & 0x3f);
 2464|  4.43k|		if (wc < 0x10000)
  ------------------
  |  Branch (2464:7): [True: 381, False: 4.05k]
  ------------------
 2465|    381|			goto invalid_sequence;/* Overlong sequence. */
 2466|  4.05k|		break;
 2467|   240k|	default: /* Others are all invalid sequence. */
  ------------------
  |  Branch (2467:2): [True: 240k, False: 75.3M]
  ------------------
 2468|   240k|		if (ch == 0xc0 || ch == 0xc1)
  ------------------
  |  Branch (2468:7): [True: 4.36k, False: 236k]
  |  Branch (2468:21): [True: 376, False: 235k]
  ------------------
 2469|  4.74k|			cnt = 2;
 2470|   235k|		else if (ch >= 0xf5 && ch <= 0xf7)
  ------------------
  |  Branch (2470:12): [True: 34.8k, False: 200k]
  |  Branch (2470:26): [True: 3.24k, False: 31.6k]
  ------------------
 2471|  3.24k|			cnt = 4;
 2472|   232k|		else if (ch >= 0xf8 && ch <= 0xfb)
  ------------------
  |  Branch (2472:12): [True: 31.6k, False: 200k]
  |  Branch (2472:26): [True: 4.62k, False: 26.9k]
  ------------------
 2473|  4.62k|			cnt = 5;
 2474|   227k|		else if (ch == 0xfc || ch == 0xfd)
  ------------------
  |  Branch (2474:12): [True: 381, False: 227k]
  |  Branch (2474:26): [True: 3.82k, False: 223k]
  ------------------
 2475|  4.20k|			cnt = 6;
 2476|   223k|		else
 2477|   223k|			cnt = 1;
 2478|   240k|		if (n < (size_t)cnt)
  ------------------
  |  Branch (2478:7): [True: 1.51k, False: 238k]
  ------------------
 2479|  1.51k|			cnt = (int)n;
 2480|   252k|		for (i = 1; i < cnt; i++) {
  ------------------
  |  Branch (2480:15): [True: 26.9k, False: 225k]
  ------------------
 2481|  26.9k|			if ((s[i] & 0xc0) != 0x80) {
  ------------------
  |  Branch (2481:8): [True: 14.6k, False: 12.2k]
  ------------------
 2482|  14.6k|				cnt = i;
 2483|  14.6k|				break;
 2484|  14.6k|			}
 2485|  26.9k|		}
 2486|   240k|		goto invalid_sequence;
 2487|  75.5M|	}
 2488|       |
 2489|       |	/* The code point larger than 0x10FFFF is not legal
 2490|       |	 * Unicode values. */
 2491|  58.9k|	if (wc > UNICODE_MAX)
  ------------------
  |  |  133|  58.9k|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2491:6): [True: 495, False: 58.4k]
  ------------------
 2492|    495|		goto invalid_sequence;
 2493|       |	/* Correctly gets a Unicode, returns used bytes. */
 2494|  58.4k|	*pwc = wc;
 2495|  58.4k|	return (cnt);
 2496|   391k|invalid_sequence:
 2497|   391k|	*pwc = UNICODE_R_CHAR;/* set the Replacement Character instead. */
  ------------------
  |  |  134|   391k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2498|   391k|	return (cnt * -1);
 2499|  58.9k|}
archive_string.c:unicode_to_utf16be:
 2679|  11.5k|{
 2680|  11.5k|	char *utf16 = p;
 2681|       |
 2682|  11.5k|	if (uc > 0xffff) {
  ------------------
  |  Branch (2682:6): [True: 32, False: 11.5k]
  ------------------
 2683|       |		/* We have a code point that won't fit into a
 2684|       |		 * wchar_t; convert it to a surrogate pair. */
 2685|     32|		if (remaining < 4)
  ------------------
  |  Branch (2685:7): [True: 0, False: 32]
  ------------------
 2686|      0|			return (0);
 2687|     32|		uc -= 0x10000;
 2688|     32|		archive_be16enc(utf16, ((uc >> 10) & 0x3ff) + 0xD800);
 2689|     32|		archive_be16enc(utf16+2, (uc & 0x3ff) + 0xDC00);
 2690|     32|		return (4);
 2691|  11.5k|	} else {
 2692|  11.5k|		if (remaining < 2)
  ------------------
  |  Branch (2692:7): [True: 0, False: 11.5k]
  ------------------
 2693|      0|			return (0);
 2694|  11.5k|		archive_be16enc(utf16, (uint16_t)uc);
 2695|  11.5k|		return (2);
 2696|  11.5k|	}
 2697|  11.5k|}
archive_string.c:unicode_to_utf16le:
 2701|  4.24k|{
 2702|  4.24k|	char *utf16 = p;
 2703|       |
 2704|  4.24k|	if (uc > 0xffff) {
  ------------------
  |  Branch (2704:6): [True: 86, False: 4.15k]
  ------------------
 2705|       |		/* We have a code point that won't fit into a
 2706|       |		 * wchar_t; convert it to a surrogate pair. */
 2707|     86|		if (remaining < 4)
  ------------------
  |  Branch (2707:7): [True: 0, False: 86]
  ------------------
 2708|      0|			return (0);
 2709|     86|		uc -= 0x10000;
 2710|     86|		archive_le16enc(utf16, ((uc >> 10) & 0x3ff) + 0xD800);
 2711|     86|		archive_le16enc(utf16+2, (uc & 0x3ff) + 0xDC00);
 2712|     86|		return (4);
 2713|  4.15k|	} else {
 2714|  4.15k|		if (remaining < 2)
  ------------------
  |  Branch (2714:7): [True: 0, False: 4.15k]
  ------------------
 2715|      0|			return (0);
 2716|  4.15k|		archive_le16enc(utf16, (uint16_t)uc);
 2717|  4.15k|		return (2);
 2718|  4.15k|	}
 2719|  4.24k|}
archive_string.c:unicode_to_utf8:
 2573|   528k|{
 2574|   528k|	char *_p = p;
 2575|       |
 2576|       |	/* Invalid Unicode char maps to Replacement character */
 2577|   528k|	if (uc > UNICODE_MAX)
  ------------------
  |  |  133|   528k|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2577:6): [True: 0, False: 528k]
  ------------------
 2578|      0|		uc = UNICODE_R_CHAR;
  ------------------
  |  |  134|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2579|       |	/* Translate code point to UTF8 */
 2580|   528k|	if (uc <= 0x7f) {
  ------------------
  |  Branch (2580:6): [True: 70.9k, False: 457k]
  ------------------
 2581|  70.9k|		if (remaining == 0)
  ------------------
  |  Branch (2581:7): [True: 552, False: 70.4k]
  ------------------
 2582|    552|			return (0);
 2583|  70.4k|		*p++ = (char)uc;
 2584|   457k|	} else if (uc <= 0x7ff) {
  ------------------
  |  Branch (2584:13): [True: 59.9k, False: 397k]
  ------------------
 2585|  59.9k|		if (remaining < 2)
  ------------------
  |  Branch (2585:7): [True: 227, False: 59.6k]
  ------------------
 2586|    227|			return (0);
 2587|  59.6k|		*p++ = 0xc0 | ((uc >> 6) & 0x1f);
 2588|  59.6k|		*p++ = 0x80 | (uc & 0x3f);
 2589|   397k|	} else if (uc <= 0xffff) {
  ------------------
  |  Branch (2589:13): [True: 395k, False: 2.02k]
  ------------------
 2590|   395k|		if (remaining < 3)
  ------------------
  |  Branch (2590:7): [True: 3.45k, False: 392k]
  ------------------
 2591|  3.45k|			return (0);
 2592|   392k|		*p++ = 0xe0 | ((uc >> 12) & 0x0f);
 2593|   392k|		*p++ = 0x80 | ((uc >> 6) & 0x3f);
 2594|   392k|		*p++ = 0x80 | (uc & 0x3f);
 2595|   392k|	} else {
 2596|  2.02k|		if (remaining < 4)
  ------------------
  |  Branch (2596:7): [True: 159, False: 1.87k]
  ------------------
 2597|    159|			return (0);
 2598|  1.87k|		*p++ = 0xf0 | ((uc >> 18) & 0x07);
 2599|  1.87k|		*p++ = 0x80 | ((uc >> 12) & 0x3f);
 2600|  1.87k|		*p++ = 0x80 | ((uc >> 6) & 0x3f);
 2601|  1.87k|		*p++ = 0x80 | (uc & 0x3f);
 2602|  1.87k|	}
 2603|   524k|	return (p - _p);
 2604|   528k|}
archive_string.c:utf16be_to_unicode:
 2608|  38.7k|{
 2609|  38.7k|	return (utf16_to_unicode(pwc, s, n, 1));
 2610|  38.7k|}
archive_string.c:utf16_to_unicode:
 2620|  75.4k|{
 2621|  75.4k|	const char *utf16 = s;
 2622|  75.4k|	unsigned uc;
 2623|       |
 2624|  75.4k|	if (n == 0)
  ------------------
  |  Branch (2624:6): [True: 2.79k, False: 72.6k]
  ------------------
 2625|  2.79k|		return (0);
 2626|  72.6k|	if (n == 1) {
  ------------------
  |  Branch (2626:6): [True: 0, False: 72.6k]
  ------------------
 2627|       |		/* set the Replacement Character instead. */
 2628|      0|		*pwc = UNICODE_R_CHAR;
  ------------------
  |  |  134|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2629|      0|		return (-1);
 2630|      0|	}
 2631|       |
 2632|  72.6k|	if (be)
  ------------------
  |  Branch (2632:6): [True: 36.9k, False: 35.6k]
  ------------------
 2633|  36.9k|		uc = archive_be16dec(utf16);
 2634|  35.6k|	else
 2635|  35.6k|		uc = archive_le16dec(utf16);
 2636|  72.6k|	utf16 += 2;
 2637|       |		
 2638|       |	/* If this is a surrogate pair, assemble the full code point.*/
 2639|  72.6k|	if (IS_HIGH_SURROGATE_LA(uc)) {
  ------------------
  |  |  130|  72.6k|#define IS_HIGH_SURROGATE_LA(uc) ((uc) >= 0xD800 && (uc) <= 0xDBFF)
  |  |  ------------------
  |  |  |  Branch (130:35): [True: 19.2k, False: 53.4k]
  |  |  |  Branch (130:53): [True: 12.1k, False: 7.01k]
  |  |  ------------------
  ------------------
 2640|  12.1k|		unsigned uc2;
 2641|       |
 2642|  12.1k|		if (n >= 4) {
  ------------------
  |  Branch (2642:7): [True: 12.1k, False: 8]
  ------------------
 2643|  12.1k|			if (be)
  ------------------
  |  Branch (2643:8): [True: 8.95k, False: 3.22k]
  ------------------
 2644|  8.95k|				uc2 = archive_be16dec(utf16);
 2645|  3.22k|			else
 2646|  3.22k|				uc2 = archive_le16dec(utf16);
 2647|  12.1k|		} else
 2648|      8|			uc2 = 0;
 2649|  12.1k|		if (IS_LOW_SURROGATE_LA(uc2)) {
  ------------------
  |  |  131|  12.1k|#define IS_LOW_SURROGATE_LA(uc)	 ((uc) >= 0xDC00 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (131:35): [True: 214, False: 11.9k]
  |  |  |  Branch (131:53): [True: 118, False: 96]
  |  |  ------------------
  ------------------
 2650|    118|			uc = combine_surrogate_pair(uc, uc2);
 2651|    118|			utf16 += 2;
 2652|  12.0k|		} else {
 2653|       |	 		/* Undescribed code point should be U+FFFD
 2654|       |		 	* (replacement character). */
 2655|  12.0k|			*pwc = UNICODE_R_CHAR;
  ------------------
  |  |  134|  12.0k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2656|  12.0k|			return (-2);
 2657|  12.0k|		}
 2658|  12.1k|	}
 2659|       |
 2660|       |	/*
 2661|       |	 * Surrogate pair values(0xd800 through 0xdfff) are only
 2662|       |	 * used by UTF-16, so, after above calculation, the code
 2663|       |	 * must not be surrogate values, and Unicode has no codes
 2664|       |	 * larger than 0x10ffff. Thus, those are not legal Unicode
 2665|       |	 * values.
 2666|       |	 */
 2667|  60.5k|	if (IS_SURROGATE_PAIR_LA(uc) || uc > UNICODE_MAX) {
  ------------------
  |  |  132|   121k|#define IS_SURROGATE_PAIR_LA(uc) ((uc) >= 0xD800 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (132:35): [True: 7.13k, False: 53.4k]
  |  |  |  Branch (132:53): [True: 1.84k, False: 5.28k]
  |  |  ------------------
  ------------------
              	if (IS_SURROGATE_PAIR_LA(uc) || uc > UNICODE_MAX) {
  ------------------
  |  |  133|  58.7k|#define UNICODE_MAX		0x10FFFF
  ------------------
  |  Branch (2667:34): [True: 0, False: 58.7k]
  ------------------
 2668|       |	 	/* Undescribed code point should be U+FFFD
 2669|       |	 	* (replacement character). */
 2670|  1.84k|		*pwc = UNICODE_R_CHAR;
  ------------------
  |  |  134|  1.84k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2671|  1.84k|		return (((int)(utf16 - s)) * -1);
 2672|  1.84k|	}
 2673|  58.7k|	*pwc = uc;
 2674|  58.7k|	return ((int)(utf16 - s));
 2675|  60.5k|}
archive_string.c:combine_surrogate_pair:
 2515|  2.13k|{
 2516|  2.13k|	uc -= 0xD800;
 2517|  2.13k|	uc *= 0x400;
 2518|  2.13k|	uc += uc2 - 0xDC00;
 2519|  2.13k|	uc += 0x10000;
 2520|  2.13k|	return (uc);
 2521|  2.13k|}
archive_string.c:utf16le_to_unicode:
 2614|  36.6k|{
 2615|  36.6k|	return (utf16_to_unicode(pwc, s, n, 0));
 2616|  36.6k|}
archive_string.c:cesu8_to_unicode:
 2534|  75.5M|{
 2535|  75.5M|	uint32_t wc = 0;
 2536|  75.5M|	int cnt;
 2537|       |
 2538|  75.5M|	cnt = _utf8_to_unicode(&wc, s, n);
 2539|  75.5M|	if (cnt == 3 && IS_HIGH_SURROGATE_LA(wc)) {
  ------------------
  |  |  130|  52.2k|#define IS_HIGH_SURROGATE_LA(uc) ((uc) >= 0xD800 && (uc) <= 0xDBFF)
  |  |  ------------------
  |  |  |  Branch (130:35): [True: 27.8k, False: 24.3k]
  |  |  |  Branch (130:53): [True: 24.7k, False: 3.10k]
  |  |  ------------------
  ------------------
  |  Branch (2539:6): [True: 52.2k, False: 75.5M]
  ------------------
 2540|  24.7k|		uint32_t wc2 = 0;
 2541|  24.7k|		if (n - 3 < 3) {
  ------------------
  |  Branch (2541:7): [True: 49, False: 24.7k]
  ------------------
 2542|       |			/* Invalid byte sequence. */
 2543|     49|			goto invalid_sequence;
 2544|     49|		}
 2545|  24.7k|		cnt = _utf8_to_unicode(&wc2, s+3, n-3);
 2546|  24.7k|		if (cnt != 3 || !IS_LOW_SURROGATE_LA(wc2)) {
  ------------------
  |  |  131|  2.66k|#define IS_LOW_SURROGATE_LA(uc)	 ((uc) >= 0xDC00 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (131:35): [True: 2.31k, False: 355]
  |  |  |  Branch (131:53): [True: 2.01k, False: 300]
  |  |  ------------------
  ------------------
  |  Branch (2546:7): [True: 22.0k, False: 2.66k]
  ------------------
 2547|       |			/* Invalid byte sequence. */
 2548|  22.7k|			goto invalid_sequence;
 2549|  22.7k|		}
 2550|  2.01k|		wc = combine_surrogate_pair(wc, wc2);
 2551|  2.01k|		cnt = 6;
 2552|  75.5M|	} else if (cnt == 3 && IS_LOW_SURROGATE_LA(wc)) {
  ------------------
  |  |  131|  27.4k|#define IS_LOW_SURROGATE_LA(uc)	 ((uc) >= 0xDC00 && (uc) <= 0xDFFF)
  |  |  ------------------
  |  |  |  Branch (131:35): [True: 3.10k, False: 24.3k]
  |  |  |  Branch (131:53): [True: 1.88k, False: 1.22k]
  |  |  ------------------
  ------------------
  |  Branch (2552:13): [True: 27.4k, False: 75.5M]
  ------------------
 2553|       |		/* Invalid byte sequence. */
 2554|  1.88k|		goto invalid_sequence;
 2555|  1.88k|	}
 2556|  75.5M|	*pwc = wc;
 2557|  75.5M|	return (cnt);
 2558|  24.6k|invalid_sequence:
 2559|  24.6k|	*pwc = UNICODE_R_CHAR;/* set the Replacement Character instead. */
  ------------------
  |  |  134|  24.6k|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2560|  24.6k|	if (cnt > 0)
  ------------------
  |  Branch (2560:6): [True: 2.88k, False: 21.7k]
  ------------------
 2561|  2.88k|		cnt *= -1;
 2562|  24.6k|	return (cnt);
 2563|  75.5M|}
archive_string.c:iconv_strncat_in_locale:
 2104|   389k|{
 2105|   389k|	ICONV_CONST char *itp;
 2106|   389k|	size_t remaining;
 2107|   389k|	iconv_t cd;
 2108|   389k|	char *outp;
 2109|   389k|	size_t avail, bs;
 2110|   389k|	int return_value = 0; /* success */
 2111|   389k|	size_t to_size, from_size;
 2112|       |
 2113|   389k|	if (sc->flag & SCONV_TO_UTF16)
  ------------------
  |  |  111|   389k|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|   389k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|   389k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2113:6): [True: 0, False: 389k]
  ------------------
 2114|      0|		to_size = 2;
 2115|   389k|	else
 2116|   389k|		to_size = 1;
 2117|   389k|	if (sc->flag & SCONV_FROM_UTF16)
  ------------------
  |  |  112|   389k|#define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  108|   389k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_FROM_UTF16	(SCONV_FROM_UTF16BE | SCONV_FROM_UTF16LE)
  |  |  ------------------
  |  |  |  |  110|   389k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2117:6): [True: 2.77k, False: 386k]
  ------------------
 2118|  2.77k|		from_size = 2;
 2119|   386k|	else
 2120|   386k|		from_size = 1;
 2121|       |
 2122|   389k|	if (archive_string_ensure(as, as->length + length*2+to_size) == NULL)
  ------------------
  |  Branch (2122:6): [True: 0, False: 389k]
  ------------------
 2123|      0|		return (-1);
 2124|       |
 2125|   389k|	cd = sc->cd;
 2126|   389k|	itp = (char *)(uintptr_t)_p;
 2127|   389k|	remaining = length;
 2128|   389k|	outp = as->s + as->length;
 2129|   389k|	avail = as->buffer_length - as->length - to_size;
 2130|  2.06M|	while (remaining >= from_size) {
  ------------------
  |  Branch (2130:9): [True: 2.05M, False: 13.0k]
  ------------------
 2131|  2.05M|		size_t result = iconv(cd, &itp, &remaining, &outp, &avail);
 2132|       |
 2133|  2.05M|		if (result != (size_t)-1)
  ------------------
  |  Branch (2133:7): [True: 376k, False: 1.67M]
  ------------------
 2134|   376k|			break; /* Conversion completed. */
 2135|       |
 2136|  1.67M|		if (errno == EILSEQ || errno == EINVAL) {
  ------------------
  |  Branch (2136:7): [True: 1.67M, False: 363]
  |  Branch (2136:26): [True: 0, False: 363]
  ------------------
 2137|       |			/*
 2138|       |		 	 * If an output charset is UTF-8 or UTF-16BE/LE,
 2139|       |			 * unknown character should be U+FFFD
 2140|       |			 * (replacement character).
 2141|       |			 */
 2142|  1.67M|			if (sc->flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) {
  ------------------
  |  |  105|  1.67M|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
              			if (sc->flag & (SCONV_TO_UTF8 | SCONV_TO_UTF16)) {
  ------------------
  |  |  111|  1.67M|#define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  107|  1.67M|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  |  |  ------------------
  |  |               #define SCONV_TO_UTF16		(SCONV_TO_UTF16BE | SCONV_TO_UTF16LE)
  |  |  ------------------
  |  |  |  |  109|  1.67M|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  |  |  ------------------
  ------------------
  |  Branch (2142:8): [True: 208k, False: 1.46M]
  ------------------
 2143|   208k|				size_t rbytes;
 2144|   208k|				if (sc->flag & SCONV_TO_UTF8)
  ------------------
  |  |  105|   208k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (2144:9): [True: 208k, False: 0]
  ------------------
 2145|   208k|					rbytes = sizeof(utf8_replacement_char);
 2146|      0|				else
 2147|      0|					rbytes = 2;
 2148|       |
 2149|   208k|				if (avail < rbytes) {
  ------------------
  |  Branch (2149:9): [True: 516, False: 207k]
  ------------------
 2150|    516|					as->length = outp - as->s;
 2151|    516|					bs = as->buffer_length +
 2152|    516|					    (remaining * to_size) + rbytes;
 2153|    516|					if (NULL ==
  ------------------
  |  Branch (2153:10): [True: 0, False: 516]
  ------------------
 2154|    516|					    archive_string_ensure(as, bs))
 2155|      0|						return (-1);
 2156|    516|					outp = as->s + as->length;
 2157|    516|					avail = as->buffer_length
 2158|    516|					    - as->length - to_size;
 2159|    516|				}
 2160|   208k|				if (sc->flag & SCONV_TO_UTF8)
  ------------------
  |  |  105|   208k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (2160:9): [True: 208k, False: 0]
  ------------------
 2161|   208k|					memcpy(outp, utf8_replacement_char, sizeof(utf8_replacement_char));
 2162|      0|				else if (sc->flag & SCONV_TO_UTF16BE)
  ------------------
  |  |  107|      0|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
  |  Branch (2162:14): [True: 0, False: 0]
  ------------------
 2163|      0|					archive_be16enc(outp, UNICODE_R_CHAR);
  ------------------
  |  |  134|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2164|      0|				else
 2165|      0|					archive_le16enc(outp, UNICODE_R_CHAR);
  ------------------
  |  |  134|      0|#define UNICODE_R_CHAR		0xFFFD	/* Replacement character. */
  ------------------
 2166|   208k|				outp += rbytes;
 2167|   208k|				avail -= rbytes;
 2168|  1.46M|			} else {
 2169|       |				/* Skip the illegal input bytes. */
 2170|  1.46M|				*outp++ = '?';
 2171|  1.46M|				avail--;
 2172|  1.46M|			}
 2173|  1.67M|			itp += from_size;
 2174|  1.67M|			remaining -= from_size;
 2175|  1.67M|			return_value = -1; /* failure */
 2176|  1.67M|		} else {
 2177|       |			/* E2BIG no output buffer,
 2178|       |			 * Increase an output buffer.  */
 2179|    363|			as->length = outp - as->s;
 2180|    363|			bs = as->buffer_length + remaining * 2;
 2181|    363|			if (NULL == archive_string_ensure(as, bs))
  ------------------
  |  Branch (2181:8): [True: 0, False: 363]
  ------------------
 2182|      0|				return (-1);
 2183|    363|			outp = as->s + as->length;
 2184|    363|			avail = as->buffer_length - as->length - to_size;
 2185|    363|		}
 2186|  1.67M|	}
 2187|   389k|	as->length = outp - as->s;
 2188|   389k|	as->s[as->length] = 0;
 2189|   389k|	if (to_size == 2)
  ------------------
  |  Branch (2189:6): [True: 0, False: 389k]
  ------------------
 2190|      0|		as->s[as->length+1] = 0;
 2191|   389k|	return (return_value);
 2192|   389k|}
archive_string.c:archive_string_normalize_C:
 3006|  49.2k|{
 3007|  49.2k|	const char *s = (const char *)_p;
 3008|  49.2k|	char *p, *endp;
 3009|  49.2k|	uint32_t uc, uc2;
 3010|  49.2k|	size_t w;
 3011|  49.2k|	int always_replace, n, n2, ret = 0, spair, ts, tm;
 3012|  49.2k|	int (*parse)(uint32_t *, const char *, size_t);
 3013|  49.2k|	size_t (*unparse)(char *, size_t, uint32_t);
 3014|       |
 3015|  49.2k|	always_replace = 1;
 3016|  49.2k|	ts = 1;/* text size. */
 3017|  49.2k|	if (sc->flag & SCONV_TO_UTF16BE) {
  ------------------
  |  |  107|  49.2k|#define SCONV_TO_UTF16BE 	(1<<10)	/* "to charset" side is UTF-16BE. */
  ------------------
  |  Branch (3017:6): [True: 0, False: 49.2k]
  ------------------
 3018|      0|		unparse = unicode_to_utf16be;
 3019|      0|		ts = 2;
 3020|      0|		if (sc->flag & SCONV_FROM_UTF16BE)
  ------------------
  |  |  108|      0|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (3020:7): [True: 0, False: 0]
  ------------------
 3021|      0|			always_replace = 0;
 3022|  49.2k|	} else if (sc->flag & SCONV_TO_UTF16LE) {
  ------------------
  |  |  109|  49.2k|#define SCONV_TO_UTF16LE 	(1<<12)	/* "to charset" side is UTF-16LE. */
  ------------------
  |  Branch (3022:13): [True: 0, False: 49.2k]
  ------------------
 3023|      0|		unparse = unicode_to_utf16le;
 3024|      0|		ts = 2;
 3025|      0|		if (sc->flag & SCONV_FROM_UTF16LE)
  ------------------
  |  |  110|      0|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (3025:7): [True: 0, False: 0]
  ------------------
 3026|      0|			always_replace = 0;
 3027|  49.2k|	} else if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|  49.2k|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (3027:13): [True: 0, False: 49.2k]
  ------------------
 3028|      0|		unparse = unicode_to_utf8;
 3029|      0|		if (sc->flag & SCONV_FROM_UTF8)
  ------------------
  |  |  106|      0|#define SCONV_FROM_UTF8		(1<<9)	/* "from charset" side is UTF-8. */
  ------------------
  |  Branch (3029:7): [True: 0, False: 0]
  ------------------
 3030|      0|			always_replace = 0;
 3031|  49.2k|	} else {
 3032|       |		/*
 3033|       |		 * This case is going to be converted to another
 3034|       |		 * character-set through iconv.
 3035|       |		 */
 3036|  49.2k|		always_replace = 0;
 3037|  49.2k|		if (sc->flag & SCONV_FROM_UTF16BE) {
  ------------------
  |  |  108|  49.2k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (3037:7): [True: 1.76k, False: 47.4k]
  ------------------
 3038|  1.76k|			unparse = unicode_to_utf16be;
 3039|  1.76k|			ts = 2;
 3040|  47.4k|		} else if (sc->flag & SCONV_FROM_UTF16LE) {
  ------------------
  |  |  110|  47.4k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (3040:14): [True: 1.00k, False: 46.4k]
  ------------------
 3041|  1.00k|			unparse = unicode_to_utf16le;
 3042|  1.00k|			ts = 2;
 3043|  46.4k|		} else {
 3044|  46.4k|			unparse = unicode_to_utf8;
 3045|  46.4k|		}
 3046|  49.2k|	}
 3047|       |
 3048|  49.2k|	if (sc->flag & SCONV_FROM_UTF16BE) {
  ------------------
  |  |  108|  49.2k|#define SCONV_FROM_UTF16BE 	(1<<11)	/* "from charset" side is UTF-16BE. */
  ------------------
  |  Branch (3048:6): [True: 1.76k, False: 47.4k]
  ------------------
 3049|  1.76k|		parse = utf16be_to_unicode;
 3050|  1.76k|		tm = 1;
 3051|  1.76k|		spair = 4;/* surrogate pair size in UTF-16. */
 3052|  47.4k|	} else if (sc->flag & SCONV_FROM_UTF16LE) {
  ------------------
  |  |  110|  47.4k|#define SCONV_FROM_UTF16LE 	(1<<13)	/* "from charset" side is UTF-16LE. */
  ------------------
  |  Branch (3052:13): [True: 1.00k, False: 46.4k]
  ------------------
 3053|  1.00k|		parse = utf16le_to_unicode;
 3054|  1.00k|		tm = 1;
 3055|  1.00k|		spair = 4;/* surrogate pair size in UTF-16. */
 3056|  46.4k|	} else {
 3057|  46.4k|		parse = cesu8_to_unicode;
 3058|  46.4k|		tm = ts;
 3059|  46.4k|		spair = 6;/* surrogate pair size in UTF-8. */
 3060|  46.4k|	}
 3061|       |
 3062|  49.2k|	if (archive_string_ensure(as, as->length + len * tm + ts) == NULL)
  ------------------
  |  Branch (3062:6): [True: 0, False: 49.2k]
  ------------------
 3063|      0|		return (-1);
 3064|       |
 3065|  49.2k|	p = as->s + as->length;
 3066|  49.2k|	endp = as->s + as->buffer_length - ts;
 3067|   481k|	while ((n = parse(&uc, s, len)) != 0) {
  ------------------
  |  Branch (3067:9): [True: 474k, False: 7.04k]
  ------------------
 3068|   474k|		const char *ucptr, *uc2ptr;
 3069|       |
 3070|   474k|		if (n < 0) {
  ------------------
  |  Branch (3070:7): [True: 296k, False: 178k]
  ------------------
 3071|       |			/* Use a replaced unicode character. */
 3072|   296k|			UNPARSE(p, endp, uc);
  ------------------
  |  | 2936|   296k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2937|   298k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2937:9): [True: 2.50k, False: 296k]
  |  |  ------------------
  |  | 2938|  2.50k|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2927|  2.50k|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|  2.50k|	as->length = p - as->s;			\
  |  |  |  | 2929|  2.50k|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 2.50k]
  |  |  |  |  ------------------
  |  |  |  | 2930|  2.50k|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|  2.50k|		return (-1);			\
  |  |  |  | 2932|  2.50k|	p = as->s + as->length;			\
  |  |  |  | 2933|  2.50k|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|  2.50k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 2.50k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2939|  2.50k|	}					\
  |  | 2940|   296k|	p += w;					\
  |  | 2941|   296k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2941:10): [Folded, False: 296k]
  |  |  ------------------
  ------------------
 3073|   296k|			s += n*-1;
 3074|   296k|			len -= n*-1;
 3075|   296k|			ret = -1;
 3076|   296k|			continue;
 3077|   296k|		} else if (n == spair || always_replace)
  ------------------
  |  Branch (3077:14): [True: 644, False: 178k]
  |  Branch (3077:28): [True: 0, False: 178k]
  ------------------
 3078|       |			/* uc is converted from a surrogate pair.
 3079|       |			 * this should be treated as a changed code. */
 3080|    644|			ucptr = NULL;
 3081|   178k|		else
 3082|   178k|			ucptr = s;
 3083|   178k|		s += n;
 3084|   178k|		len -= n;
 3085|       |
 3086|       |		/* Read second code point. */
 3087|  75.0M|		while ((n2 = parse(&uc2, s, len)) > 0) {
  ------------------
  |  Branch (3087:10): [True: 74.8M, False: 150k]
  ------------------
 3088|  74.8M|			uint32_t ucx[FDC_MAX];
 3089|  74.8M|			int ccx[FDC_MAX];
 3090|  74.8M|			int cl, cx, i, nx, ucx_size;
 3091|  74.8M|			int LIndex,SIndex;
 3092|  74.8M|			uint32_t nfc;
 3093|       |
 3094|  74.8M|			if (n2 == spair || always_replace)
  ------------------
  |  Branch (3094:8): [True: 942, False: 74.8M]
  |  Branch (3094:23): [True: 0, False: 74.8M]
  ------------------
 3095|       |				/* uc2 is converted from a surrogate pair.
 3096|       |			 	 * this should be treated as a changed code. */
 3097|    942|				uc2ptr = NULL;
 3098|  74.8M|			else
 3099|  74.8M|				uc2ptr = s;
 3100|  74.8M|			s += n2;
 3101|  74.8M|			len -= n2;
 3102|       |
 3103|       |			/*
 3104|       |			 * If current second code point is out of decomposable
 3105|       |			 * code points, finding compositions is unneeded.
 3106|       |			 */
 3107|  74.8M|			if (!IS_DECOMPOSABLE_BLOCK(uc2)) {
  ------------------
  |  |  986|  74.8M|	(((uc)>>8) <= 0x1D2 && u_decomposable_blocks[(uc)>>8])
  |  |  ------------------
  |  |  |  Branch (986:3): [True: 74.8M, False: 1.95k]
  |  |  |  Branch (986:25): [True: 56.1k, False: 74.8M]
  |  |  ------------------
  ------------------
 3108|  74.8M|				WRITE_UC();
  ------------------
  |  | 2949|  74.8M|#define WRITE_UC()	do {			\
  |  | 2950|  74.8M|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2950:6): [True: 74.8M, False: 1.83k]
  |  |  ------------------
  |  | 2951|  74.8M|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2951:7): [True: 25.4k, False: 74.8M]
  |  |  ------------------
  |  | 2952|  74.8M|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2927|  25.4k|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|  25.4k|	as->length = p - as->s;			\
  |  |  |  | 2929|  25.4k|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 25.4k]
  |  |  |  |  ------------------
  |  |  |  | 2930|  25.4k|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|  25.4k|		return (-1);			\
  |  |  |  | 2932|  25.4k|	p = as->s + as->length;			\
  |  |  |  | 2933|  25.4k|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|  25.4k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 25.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2953|  74.8M|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2953:11): [True: 74.8M, False: 0]
  |  |  ------------------
  |  | 2954|  1.26k|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 1.26k, False: 74.8M]
  |  |  ------------------
  |  | 2955|  1.26k|			*p++ = *ucptr++;	\
  |  | 2956|  1.26k|			/* FALL THROUGH */	\
  |  | 2957|  21.6k|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 20.3k, False: 74.8M]
  |  |  ------------------
  |  | 2958|  21.6k|			*p++ = *ucptr++;	\
  |  | 2959|  21.6k|			/* FALL THROUGH */	\
  |  | 2960|  63.5k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2960:3): [True: 41.8k, False: 74.8M]
  |  |  ------------------
  |  | 2961|  63.5k|			*p++ = *ucptr++;	\
  |  | 2962|  63.5k|			/* FALL THROUGH */	\
  |  | 2963|  74.8M|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2963:3): [True: 74.7M, False: 63.5k]
  |  |  ------------------
  |  | 2964|  74.8M|			*p++ = *ucptr;		\
  |  | 2965|  74.8M|			break;			\
  |  | 2966|  74.8M|		}				\
  |  | 2967|  74.8M|		ucptr = NULL;			\
  |  | 2968|  74.8M|	} else {				\
  |  | 2969|  1.83k|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2936|  1.83k|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2937|  1.94k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:9): [True: 103, False: 1.83k]
  |  |  |  |  ------------------
  |  |  |  | 2938|    103|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2927|    103|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2928|    103|	as->length = p - as->s;			\
  |  |  |  |  |  | 2929|    103|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2929:6): [True: 0, False: 103]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2930|    103|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2931|    103|		return (-1);			\
  |  |  |  |  |  | 2932|    103|	p = as->s + as->length;			\
  |  |  |  |  |  | 2933|    103|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2934|    103|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2934:10): [Folded, False: 103]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2939|    103|	}					\
  |  |  |  | 2940|  1.83k|	p += w;					\
  |  |  |  | 2941|  1.83k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2941:10): [Folded, False: 1.83k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2970|  1.83k|	}					\
  |  | 2971|  74.8M|} while (0)
  |  |  ------------------
  |  |  |  Branch (2971:10): [Folded, False: 74.8M]
  |  |  ------------------
  ------------------
 3109|  74.8M|				REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2921|  74.8M|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2922|  74.8M|	uc = uc2;				\
  |  | 2923|  74.8M|	ucptr = uc2ptr;				\
  |  | 2924|  74.8M|	n = n2;					\
  |  | 2925|  74.8M|} while (0)
  |  |  ------------------
  |  |  |  Branch (2925:10): [Folded, False: 74.8M]
  |  |  ------------------
  ------------------
 3110|  74.8M|				continue;
 3111|  74.8M|			}
 3112|       |
 3113|       |			/*
 3114|       |			 * Try to combine current code points.
 3115|       |			 */
 3116|       |			/*
 3117|       |			 * We have to combine Hangul characters according to
 3118|       |			 * http://uniicode.org/reports/tr15/#Hangul
 3119|       |			 */
 3120|  56.1k|			if (0 <= (LIndex = uc - HC_LBASE) &&
  ------------------
  |  | 2875|  56.1k|#define HC_LBASE	0x1100
  ------------------
  |  Branch (3120:8): [True: 20.5k, False: 35.6k]
  ------------------
 3121|  20.5k|			    LIndex < HC_LCOUNT) {
  ------------------
  |  | 2878|  20.5k|#define HC_LCOUNT	19
  ------------------
  |  Branch (3121:8): [True: 1.50k, False: 19.0k]
  ------------------
 3122|       |				/*
 3123|       |				 * Hangul Composition.
 3124|       |				 * 1. Two current code points are L and V.
 3125|       |				 */
 3126|  1.50k|				int VIndex = uc2 - HC_VBASE;
  ------------------
  |  | 2876|  1.50k|#define HC_VBASE	0x1161
  ------------------
 3127|  1.50k|				if (0 <= VIndex && VIndex < HC_VCOUNT) {
  ------------------
  |  | 2879|  1.09k|#define HC_VCOUNT	21
  ------------------
  |  Branch (3127:9): [True: 1.09k, False: 410]
  |  Branch (3127:24): [True: 577, False: 516]
  ------------------
 3128|       |					/* Make syllable of form LV. */
 3129|    577|					UPDATE_UC(HC_SBASE +
  ------------------
  |  | 2913|    577|#define UPDATE_UC(new_uc)	do {		\
  |  | 2914|    577|	uc = new_uc;				\
  |  | 2915|    577|	ucptr = NULL;				\
  |  | 2916|    577|} while (0)
  |  |  ------------------
  |  |  |  Branch (2916:10): [Folded, False: 577]
  |  |  ------------------
  ------------------
 3130|    577|					    (LIndex * HC_VCOUNT + VIndex) *
 3131|    577|					     HC_TCOUNT);
 3132|    926|				} else {
 3133|    926|					WRITE_UC();
  ------------------
  |  | 2949|    926|#define WRITE_UC()	do {			\
  |  | 2950|    926|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2950:6): [True: 926, False: 0]
  |  |  ------------------
  |  | 2951|    926|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2951:7): [True: 25, False: 901]
  |  |  ------------------
  |  | 2952|    926|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2927|     25|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|     25|	as->length = p - as->s;			\
  |  |  |  | 2929|     25|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 25]
  |  |  |  |  ------------------
  |  |  |  | 2930|     25|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|     25|		return (-1);			\
  |  |  |  | 2932|     25|	p = as->s + as->length;			\
  |  |  |  | 2933|     25|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|     25|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 25]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2953|    926|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2953:11): [True: 926, False: 0]
  |  |  ------------------
  |  | 2954|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 0, False: 926]
  |  |  ------------------
  |  | 2955|      0|			*p++ = *ucptr++;	\
  |  | 2956|      0|			/* FALL THROUGH */	\
  |  | 2957|    420|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 420, False: 506]
  |  |  ------------------
  |  | 2958|    420|			*p++ = *ucptr++;	\
  |  | 2959|    420|			/* FALL THROUGH */	\
  |  | 2960|    926|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2960:3): [True: 506, False: 420]
  |  |  ------------------
  |  | 2961|    926|			*p++ = *ucptr++;	\
  |  | 2962|    926|			/* FALL THROUGH */	\
  |  | 2963|    926|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2963:3): [True: 0, False: 926]
  |  |  ------------------
  |  | 2964|    926|			*p++ = *ucptr;		\
  |  | 2965|    926|			break;			\
  |  | 2966|    926|		}				\
  |  | 2967|    926|		ucptr = NULL;			\
  |  | 2968|    926|	} else {				\
  |  | 2969|      0|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2936|      0|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2937|      0|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:9): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 2938|      0|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2927|      0|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2928|      0|	as->length = p - as->s;			\
  |  |  |  |  |  | 2929|      0|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2929:6): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2930|      0|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2931|      0|		return (-1);			\
  |  |  |  |  |  | 2932|      0|	p = as->s + as->length;			\
  |  |  |  |  |  | 2933|      0|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2934|      0|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2934:10): [Folded, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2939|      0|	}					\
  |  |  |  | 2940|      0|	p += w;					\
  |  |  |  | 2941|      0|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2941:10): [Folded, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2970|      0|	}					\
  |  | 2971|    926|} while (0)
  |  |  ------------------
  |  |  |  Branch (2971:10): [Folded, False: 926]
  |  |  ------------------
  ------------------
 3134|    926|					REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2921|    926|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2922|    926|	uc = uc2;				\
  |  | 2923|    926|	ucptr = uc2ptr;				\
  |  | 2924|    926|	n = n2;					\
  |  | 2925|    926|} while (0)
  |  |  ------------------
  |  |  |  Branch (2925:10): [Folded, False: 926]
  |  |  ------------------
  ------------------
 3135|    926|				}
 3136|  1.50k|				continue;
 3137|  54.6k|			} else if (0 <= (SIndex = uc - HC_SBASE) &&
  ------------------
  |  | 2874|  54.6k|#define HC_SBASE	0xAC00
  ------------------
  |  Branch (3137:15): [True: 6.88k, False: 47.8k]
  ------------------
 3138|  6.88k|			    SIndex < HC_SCOUNT && (SIndex % HC_TCOUNT) == 0) {
  ------------------
  |  | 2882|  61.5k|#define HC_SCOUNT	(HC_LCOUNT * HC_NCOUNT)
  |  |  ------------------
  |  |  |  | 2878|  6.88k|#define HC_LCOUNT	19
  |  |  ------------------
  |  |               #define HC_SCOUNT	(HC_LCOUNT * HC_NCOUNT)
  |  |  ------------------
  |  |  |  | 2881|  6.88k|#define HC_NCOUNT	(HC_VCOUNT * HC_TCOUNT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2879|  6.88k|#define HC_VCOUNT	21
  |  |  |  |  ------------------
  |  |  |  |               #define HC_NCOUNT	(HC_VCOUNT * HC_TCOUNT)
  |  |  |  |  ------------------
  |  |  |  |  |  | 2880|  6.88k|#define HC_TCOUNT	28
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              			    SIndex < HC_SCOUNT && (SIndex % HC_TCOUNT) == 0) {
  ------------------
  |  | 2880|  4.89k|#define HC_TCOUNT	28
  ------------------
  |  Branch (3138:8): [True: 4.89k, False: 1.98k]
  |  Branch (3138:30): [True: 831, False: 4.06k]
  ------------------
 3139|       |				/*
 3140|       |				 * Hangul Composition.
 3141|       |				 * 2. Two current code points are LV and T.
 3142|       |				 */
 3143|    831|				int TIndex = uc2 - HC_TBASE;
  ------------------
  |  | 2877|    831|#define HC_TBASE	0x11A7
  ------------------
 3144|    831|				if (0 < TIndex && TIndex < HC_TCOUNT) {
  ------------------
  |  | 2880|    605|#define HC_TCOUNT	28
  ------------------
  |  Branch (3144:9): [True: 605, False: 226]
  |  Branch (3144:23): [True: 26, False: 579]
  ------------------
 3145|       |					/* Make syllable of form LVT. */
 3146|     26|					UPDATE_UC(uc + TIndex);
  ------------------
  |  | 2913|     26|#define UPDATE_UC(new_uc)	do {		\
  |  | 2914|     26|	uc = new_uc;				\
  |  | 2915|     26|	ucptr = NULL;				\
  |  | 2916|     26|} while (0)
  |  |  ------------------
  |  |  |  Branch (2916:10): [Folded, False: 26]
  |  |  ------------------
  ------------------
 3147|    805|				} else {
 3148|    805|					WRITE_UC();
  ------------------
  |  | 2949|    805|#define WRITE_UC()	do {			\
  |  | 2950|    805|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2950:6): [True: 560, False: 245]
  |  |  ------------------
  |  | 2951|    560|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2951:7): [True: 15, False: 545]
  |  |  ------------------
  |  | 2952|    560|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2927|     15|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|     15|	as->length = p - as->s;			\
  |  |  |  | 2929|     15|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 15]
  |  |  |  |  ------------------
  |  |  |  | 2930|     15|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|     15|		return (-1);			\
  |  |  |  | 2932|     15|	p = as->s + as->length;			\
  |  |  |  | 2933|     15|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|     15|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 15]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2953|    560|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2953:11): [True: 560, False: 0]
  |  |  ------------------
  |  | 2954|      0|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 0, False: 560]
  |  |  ------------------
  |  | 2955|      0|			*p++ = *ucptr++;	\
  |  | 2956|      0|			/* FALL THROUGH */	\
  |  | 2957|    215|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 215, False: 345]
  |  |  ------------------
  |  | 2958|    215|			*p++ = *ucptr++;	\
  |  | 2959|    215|			/* FALL THROUGH */	\
  |  | 2960|    560|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2960:3): [True: 345, False: 215]
  |  |  ------------------
  |  | 2961|    560|			*p++ = *ucptr++;	\
  |  | 2962|    560|			/* FALL THROUGH */	\
  |  | 2963|    560|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2963:3): [True: 0, False: 560]
  |  |  ------------------
  |  | 2964|    560|			*p++ = *ucptr;		\
  |  | 2965|    560|			break;			\
  |  | 2966|    560|		}				\
  |  | 2967|    560|		ucptr = NULL;			\
  |  | 2968|    560|	} else {				\
  |  | 2969|    245|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2936|    245|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2937|    264|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:9): [True: 19, False: 245]
  |  |  |  |  ------------------
  |  |  |  | 2938|     19|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2927|     19|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2928|     19|	as->length = p - as->s;			\
  |  |  |  |  |  | 2929|     19|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2929:6): [True: 0, False: 19]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2930|     19|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2931|     19|		return (-1);			\
  |  |  |  |  |  | 2932|     19|	p = as->s + as->length;			\
  |  |  |  |  |  | 2933|     19|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2934|     19|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2934:10): [Folded, False: 19]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2939|     19|	}					\
  |  |  |  | 2940|    245|	p += w;					\
  |  |  |  | 2941|    245|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2941:10): [Folded, False: 245]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2970|    245|	}					\
  |  | 2971|    805|} while (0)
  |  |  ------------------
  |  |  |  Branch (2971:10): [Folded, False: 805]
  |  |  ------------------
  ------------------
 3149|    805|					REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2921|    805|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2922|    805|	uc = uc2;				\
  |  | 2923|    805|	ucptr = uc2ptr;				\
  |  | 2924|    805|	n = n2;					\
  |  | 2925|    805|} while (0)
  |  |  ------------------
  |  |  |  Branch (2925:10): [Folded, False: 805]
  |  |  ------------------
  ------------------
 3150|    805|				}
 3151|    831|				continue;
 3152|  53.8k|			} else if ((nfc = get_nfc(uc, uc2)) != 0) {
  ------------------
  |  Branch (3152:15): [True: 1.46k, False: 52.3k]
  ------------------
 3153|       |				/* A composition to current code points
 3154|       |				 * is found. */
 3155|  1.46k|				UPDATE_UC(nfc);
  ------------------
  |  | 2913|  1.46k|#define UPDATE_UC(new_uc)	do {		\
  |  | 2914|  1.46k|	uc = new_uc;				\
  |  | 2915|  1.46k|	ucptr = NULL;				\
  |  | 2916|  1.46k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2916:10): [Folded, False: 1.46k]
  |  |  ------------------
  ------------------
 3156|  1.46k|				continue;
 3157|  52.3k|			} else if ((cl = CCC(uc2)) == 0) {
  ------------------
  |  | 1007|  52.3k|	(((uc) > 0x1D244)?0:\
  |  |  ------------------
  |  |  |  Branch (1007:3): [True: 721, False: 51.6k]
  |  |  ------------------
  |  | 1008|  52.3k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  ------------------
  |  Branch (3157:15): [True: 23.9k, False: 28.4k]
  ------------------
 3158|       |				/* Clearly 'uc2' the second code point is not
 3159|       |				 * a decomposable code. */
 3160|  23.9k|				WRITE_UC();
  ------------------
  |  | 2949|  23.9k|#define WRITE_UC()	do {			\
  |  | 2950|  23.9k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2950:6): [True: 23.5k, False: 396]
  |  |  ------------------
  |  | 2951|  23.5k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2951:7): [True: 46, False: 23.5k]
  |  |  ------------------
  |  | 2952|  23.5k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2927|     46|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|     46|	as->length = p - as->s;			\
  |  |  |  | 2929|     46|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 46]
  |  |  |  |  ------------------
  |  |  |  | 2930|     46|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|     46|		return (-1);			\
  |  |  |  | 2932|     46|	p = as->s + as->length;			\
  |  |  |  | 2933|     46|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|     46|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 46]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2953|  23.5k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2953:11): [True: 23.5k, False: 0]
  |  |  ------------------
  |  | 2954|    227|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 227, False: 23.3k]
  |  |  ------------------
  |  | 2955|    227|			*p++ = *ucptr++;	\
  |  | 2956|    227|			/* FALL THROUGH */	\
  |  | 2957|    552|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 325, False: 23.2k]
  |  |  ------------------
  |  | 2958|    552|			*p++ = *ucptr++;	\
  |  | 2959|    552|			/* FALL THROUGH */	\
  |  | 2960|  18.0k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2960:3): [True: 17.5k, False: 6.04k]
  |  |  ------------------
  |  | 2961|  18.0k|			*p++ = *ucptr++;	\
  |  | 2962|  18.0k|			/* FALL THROUGH */	\
  |  | 2963|  23.5k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2963:3): [True: 5.49k, False: 18.0k]
  |  |  ------------------
  |  | 2964|  23.5k|			*p++ = *ucptr;		\
  |  | 2965|  23.5k|			break;			\
  |  | 2966|  23.5k|		}				\
  |  | 2967|  23.5k|		ucptr = NULL;			\
  |  | 2968|  23.5k|	} else {				\
  |  | 2969|    396|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2936|    396|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2937|    408|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:9): [True: 12, False: 396]
  |  |  |  |  ------------------
  |  |  |  | 2938|     12|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2927|     12|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2928|     12|	as->length = p - as->s;			\
  |  |  |  |  |  | 2929|     12|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2929:6): [True: 0, False: 12]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2930|     12|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2931|     12|		return (-1);			\
  |  |  |  |  |  | 2932|     12|	p = as->s + as->length;			\
  |  |  |  |  |  | 2933|     12|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2934|     12|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2934:10): [Folded, False: 12]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2939|     12|	}					\
  |  |  |  | 2940|    396|	p += w;					\
  |  |  |  | 2941|    396|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2941:10): [Folded, False: 396]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2970|    396|	}					\
  |  | 2971|  23.9k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2971:10): [Folded, False: 23.9k]
  |  |  ------------------
  ------------------
 3161|  23.9k|				REPLACE_UC_WITH_UC2();
  ------------------
  |  | 2921|  23.9k|#define REPLACE_UC_WITH_UC2() do {		\
  |  | 2922|  23.9k|	uc = uc2;				\
  |  | 2923|  23.9k|	ucptr = uc2ptr;				\
  |  | 2924|  23.9k|	n = n2;					\
  |  | 2925|  23.9k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2925:10): [Folded, False: 23.9k]
  |  |  ------------------
  ------------------
 3162|  23.9k|				continue;
 3163|  23.9k|			}
 3164|       |
 3165|       |			/*
 3166|       |			 * Collect following decomposable code points.
 3167|       |			 */
 3168|  28.4k|			cx = 0;
 3169|  28.4k|			ucx[0] = uc2;
 3170|  28.4k|			ccx[0] = cl;
 3171|  28.4k|			COLLECT_CPS(1);
  ------------------
  |  | 2976|  28.4k|#define COLLECT_CPS(start)	do {		\
  |  | 2977|  28.4k|	int _i;					\
  |  | 2978|  57.8k|	for (_i = start; _i < FDC_MAX ; _i++) {	\
  |  |  ------------------
  |  |  |  | 2907|  57.8k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2978:19): [True: 57.3k, False: 444]
  |  |  ------------------
  |  | 2979|  57.3k|		nx = parse(&ucx[_i], s, len);	\
  |  | 2980|  57.3k|		if (nx <= 0)			\
  |  |  ------------------
  |  |  |  Branch (2980:7): [True: 3.38k, False: 53.9k]
  |  |  ------------------
  |  | 2981|  57.3k|			break;			\
  |  | 2982|  57.3k|		cx = CCC(ucx[_i]);		\
  |  |  ------------------
  |  |  |  | 1007|  53.9k|	(((uc) > 0x1D244)?0:\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1007:3): [True: 787, False: 53.2k]
  |  |  |  |  ------------------
  |  |  |  | 1008|  53.9k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  |  |  ------------------
  |  | 2983|  53.9k|		if (cl >= cx && cl != 228 && cx != 228)\
  |  |  ------------------
  |  |  |  Branch (2983:7): [True: 29.5k, False: 24.4k]
  |  |  |  Branch (2983:19): [True: 25.0k, False: 4.55k]
  |  |  |  Branch (2983:32): [True: 24.6k, False: 409]
  |  |  ------------------
  |  | 2984|  53.9k|			break;			\
  |  | 2985|  53.9k|		s += nx;			\
  |  | 2986|  29.3k|		len -= nx;			\
  |  | 2987|  29.3k|		cl = cx;			\
  |  | 2988|  29.3k|		ccx[_i] = cx;			\
  |  | 2989|  29.3k|	}					\
  |  | 2990|  28.4k|	if (_i >= FDC_MAX) {			\
  |  |  ------------------
  |  |  |  | 2907|  28.4k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2990:6): [True: 444, False: 27.9k]
  |  |  ------------------
  |  | 2991|    444|		ret = -1;			\
  |  | 2992|    444|		ucx_size = FDC_MAX;		\
  |  |  ------------------
  |  |  |  | 2907|    444|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  | 2993|    444|	} else					\
  |  | 2994|  28.4k|		ucx_size = _i;			\
  |  | 2995|  28.4k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2995:10): [Folded, False: 28.4k]
  |  |  ------------------
  ------------------
 3172|       |
 3173|       |			/*
 3174|       |			 * Find a composed code in the collected code points.
 3175|       |			 */
 3176|  28.4k|			i = 1;
 3177|  84.5k|			while (i < ucx_size) {
  ------------------
  |  Branch (3177:11): [True: 56.0k, False: 28.4k]
  ------------------
 3178|  56.0k|				int j;
 3179|       |
 3180|  56.0k|				if ((nfc = get_nfc(uc, ucx[i])) == 0) {
  ------------------
  |  Branch (3180:9): [True: 33.4k, False: 22.6k]
  ------------------
 3181|  33.4k|					i++;
 3182|  33.4k|					continue;
 3183|  33.4k|				}
 3184|       |
 3185|       |				/*
 3186|       |				 * nfc is composed of uc and ucx[i].
 3187|       |				 */
 3188|  22.6k|				UPDATE_UC(nfc);
  ------------------
  |  | 2913|  22.6k|#define UPDATE_UC(new_uc)	do {		\
  |  | 2914|  22.6k|	uc = new_uc;				\
  |  | 2915|  22.6k|	ucptr = NULL;				\
  |  | 2916|  22.6k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2916:10): [Folded, False: 22.6k]
  |  |  ------------------
  ------------------
 3189|       |
 3190|       |				/*
 3191|       |				 * Remove ucx[i] by shifting
 3192|       |				 * following code points.
 3193|       |				 */
 3194|  25.1k|				for (j = i; j+1 < ucx_size; j++) {
  ------------------
  |  Branch (3194:17): [True: 2.48k, False: 22.6k]
  ------------------
 3195|  2.48k|					ucx[j] = ucx[j+1];
 3196|  2.48k|					ccx[j] = ccx[j+1];
 3197|  2.48k|				}
 3198|  22.6k|				ucx_size --;
 3199|       |
 3200|       |				/*
 3201|       |				 * Collect following code points blocked
 3202|       |				 * by ucx[i] the removed code point.
 3203|       |				 */
 3204|  22.6k|				if (ucx_size > 0 && i == ucx_size &&
  ------------------
  |  Branch (3204:9): [True: 22.6k, False: 0]
  |  Branch (3204:25): [True: 22.1k, False: 490]
  ------------------
 3205|  22.1k|				    nx > 0 && cx == cl) {
  ------------------
  |  Branch (3205:9): [True: 20.9k, False: 1.20k]
  |  Branch (3205:19): [True: 1.17k, False: 19.8k]
  ------------------
 3206|  1.17k|					cl =  ccx[ucx_size-1];
 3207|  1.17k|					COLLECT_CPS(ucx_size);
  ------------------
  |  | 2976|  1.17k|#define COLLECT_CPS(start)	do {		\
  |  | 2977|  1.17k|	int _i;					\
  |  | 2978|  3.86k|	for (_i = start; _i < FDC_MAX ; _i++) {	\
  |  |  ------------------
  |  |  |  | 2907|  3.86k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2978:19): [True: 3.62k, False: 244]
  |  |  ------------------
  |  | 2979|  3.62k|		nx = parse(&ucx[_i], s, len);	\
  |  | 2980|  3.62k|		if (nx <= 0)			\
  |  |  ------------------
  |  |  |  Branch (2980:7): [True: 511, False: 3.11k]
  |  |  ------------------
  |  | 2981|  3.62k|			break;			\
  |  | 2982|  3.62k|		cx = CCC(ucx[_i]);		\
  |  |  ------------------
  |  |  |  | 1007|  3.11k|	(((uc) > 0x1D244)?0:\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1007:3): [True: 274, False: 2.83k]
  |  |  |  |  ------------------
  |  |  |  | 1008|  3.11k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  |  |  ------------------
  |  | 2983|  3.11k|		if (cl >= cx && cl != 228 && cx != 228)\
  |  |  ------------------
  |  |  |  Branch (2983:7): [True: 1.93k, False: 1.17k]
  |  |  |  Branch (2983:19): [True: 416, False: 1.52k]
  |  |  |  Branch (2983:32): [True: 416, False: 0]
  |  |  ------------------
  |  | 2984|  3.11k|			break;			\
  |  | 2985|  3.11k|		s += nx;			\
  |  | 2986|  2.69k|		len -= nx;			\
  |  | 2987|  2.69k|		cl = cx;			\
  |  | 2988|  2.69k|		ccx[_i] = cx;			\
  |  | 2989|  2.69k|	}					\
  |  | 2990|  1.17k|	if (_i >= FDC_MAX) {			\
  |  |  ------------------
  |  |  |  | 2907|  1.17k|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  |  |  Branch (2990:6): [True: 244, False: 927]
  |  |  ------------------
  |  | 2991|    244|		ret = -1;			\
  |  | 2992|    244|		ucx_size = FDC_MAX;		\
  |  |  ------------------
  |  |  |  | 2907|    244|#define FDC_MAX 10	/* The maximum number of Following Decomposable
  |  |  ------------------
  |  | 2993|    244|	} else					\
  |  | 2994|  1.17k|		ucx_size = _i;			\
  |  | 2995|  1.17k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2995:10): [Folded, False: 1.17k]
  |  |  ------------------
  ------------------
 3208|  1.17k|				}
 3209|       |				/*
 3210|       |				 * Restart finding a composed code with
 3211|       |				 * the updated uc from the top of the
 3212|       |				 * collected code points.
 3213|       |				 */
 3214|  22.6k|				i = 0;
 3215|  22.6k|			}
 3216|       |
 3217|       |			/*
 3218|       |			 * Apparently the current code points are not
 3219|       |			 * decomposed characters or already composed.
 3220|       |			 */
 3221|  28.4k|			WRITE_UC();
  ------------------
  |  | 2949|  28.4k|#define WRITE_UC()	do {			\
  |  | 2950|  28.4k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2950:6): [True: 5.47k, False: 22.9k]
  |  |  ------------------
  |  | 2951|  5.47k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2951:7): [True: 71, False: 5.40k]
  |  |  ------------------
  |  | 2952|  5.47k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2927|     71|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|     71|	as->length = p - as->s;			\
  |  |  |  | 2929|     71|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 71]
  |  |  |  |  ------------------
  |  |  |  | 2930|     71|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|     71|		return (-1);			\
  |  |  |  | 2932|     71|	p = as->s + as->length;			\
  |  |  |  | 2933|     71|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|     71|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 71]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2953|  5.47k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2953:11): [True: 5.47k, False: 0]
  |  |  ------------------
  |  | 2954|    210|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 210, False: 5.26k]
  |  |  ------------------
  |  | 2955|    210|			*p++ = *ucptr++;	\
  |  | 2956|    210|			/* FALL THROUGH */	\
  |  | 2957|    867|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 657, False: 4.81k]
  |  |  ------------------
  |  | 2958|    867|			*p++ = *ucptr++;	\
  |  | 2959|    867|			/* FALL THROUGH */	\
  |  | 2960|  2.45k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2960:3): [True: 1.58k, False: 3.89k]
  |  |  ------------------
  |  | 2961|  2.45k|			*p++ = *ucptr++;	\
  |  | 2962|  2.45k|			/* FALL THROUGH */	\
  |  | 2963|  5.47k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2963:3): [True: 3.02k, False: 2.45k]
  |  |  ------------------
  |  | 2964|  5.47k|			*p++ = *ucptr;		\
  |  | 2965|  5.47k|			break;			\
  |  | 2966|  5.47k|		}				\
  |  | 2967|  5.47k|		ucptr = NULL;			\
  |  | 2968|  22.9k|	} else {				\
  |  | 2969|  22.9k|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2936|  22.9k|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2937|  22.9k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:9): [True: 37, False: 22.9k]
  |  |  |  |  ------------------
  |  |  |  | 2938|     37|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2927|     37|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2928|     37|	as->length = p - as->s;			\
  |  |  |  |  |  | 2929|     37|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2929:6): [True: 0, False: 37]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2930|     37|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2931|     37|		return (-1);			\
  |  |  |  |  |  | 2932|     37|	p = as->s + as->length;			\
  |  |  |  |  |  | 2933|     37|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2934|     37|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2934:10): [Folded, False: 37]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2939|     37|	}					\
  |  |  |  | 2940|  22.9k|	p += w;					\
  |  |  |  | 2941|  22.9k|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2941:10): [Folded, False: 22.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2970|  22.9k|	}					\
  |  | 2971|  28.4k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2971:10): [Folded, False: 28.4k]
  |  |  ------------------
  ------------------
 3222|  66.2k|			for (i = 0; i < ucx_size; i++)
  ------------------
  |  Branch (3222:16): [True: 37.8k, False: 28.4k]
  ------------------
 3223|  37.8k|				UNPARSE(p, endp, ucx[i]);
  ------------------
  |  | 2936|  66.2k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2937|  37.9k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2937:9): [True: 92, False: 37.8k]
  |  |  ------------------
  |  | 2938|     92|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2927|     92|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|     92|	as->length = p - as->s;			\
  |  |  |  | 2929|     92|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 92]
  |  |  |  |  ------------------
  |  |  |  | 2930|     92|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|     92|		return (-1);			\
  |  |  |  | 2932|     92|	p = as->s + as->length;			\
  |  |  |  | 2933|     92|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|     92|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 92]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2939|     92|	}					\
  |  | 2940|  37.8k|	p += w;					\
  |  | 2941|  37.8k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2941:10): [Folded, False: 37.8k]
  |  |  ------------------
  ------------------
 3224|       |
 3225|       |			/*
 3226|       |			 * Flush out remaining canonical combining characters.
 3227|       |			 */
 3228|  28.4k|			if (nx > 0 && cx == cl && len > 0) {
  ------------------
  |  Branch (3228:8): [True: 24.5k, False: 3.90k]
  |  Branch (3228:18): [True: 2.08k, False: 22.4k]
  |  Branch (3228:30): [True: 2.07k, False: 10]
  ------------------
 3229|  73.8k|				while ((nx = parse(&ucx[0], s, len))
  ------------------
  |  Branch (3229:12): [True: 72.4k, False: 1.34k]
  ------------------
 3230|  73.8k|				    > 0) {
 3231|  72.4k|					cx = CCC(ucx[0]);
  ------------------
  |  | 1007|  72.4k|	(((uc) > 0x1D244)?0:\
  |  |  ------------------
  |  |  |  Branch (1007:3): [True: 419, False: 72.0k]
  |  |  ------------------
  |  | 1008|  72.4k|	ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
  ------------------
 3232|  72.4k|					if (cl > cx)
  ------------------
  |  Branch (3232:10): [True: 725, False: 71.7k]
  ------------------
 3233|    725|						break;
 3234|  71.7k|					s += nx;
 3235|  71.7k|					len -= nx;
 3236|  71.7k|					cl = cx;
 3237|  71.7k|					UNPARSE(p, endp, ucx[0]);
  ------------------
  |  | 2936|  71.7k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2937|  72.3k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2937:9): [True: 606, False: 71.7k]
  |  |  ------------------
  |  | 2938|    606|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2927|    606|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|    606|	as->length = p - as->s;			\
  |  |  |  | 2929|    606|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 606]
  |  |  |  |  ------------------
  |  |  |  | 2930|    606|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|    606|		return (-1);			\
  |  |  |  | 2932|    606|	p = as->s + as->length;			\
  |  |  |  | 2933|    606|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|    606|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 606]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2939|    606|	}					\
  |  | 2940|  71.7k|	p += w;					\
  |  | 2941|  71.7k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2941:10): [Folded, False: 71.7k]
  |  |  ------------------
  ------------------
 3238|  71.7k|				}
 3239|  2.07k|			}
 3240|  28.4k|			break;
 3241|  28.4k|		}
 3242|   178k|		if (n2 < 0) {
  ------------------
  |  Branch (3242:7): [True: 108k, False: 70.6k]
  ------------------
 3243|   108k|			WRITE_UC();
  ------------------
  |  | 2949|   108k|#define WRITE_UC()	do {			\
  |  | 2950|   108k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2950:6): [True: 107k, False: 757]
  |  |  ------------------
  |  | 2951|   107k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2951:7): [True: 535, False: 106k]
  |  |  ------------------
  |  | 2952|   107k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2927|    535|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|    535|	as->length = p - as->s;			\
  |  |  |  | 2929|    535|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 535]
  |  |  |  |  ------------------
  |  |  |  | 2930|    535|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|    535|		return (-1);			\
  |  |  |  | 2932|    535|	p = as->s + as->length;			\
  |  |  |  | 2933|    535|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|    535|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 535]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2953|   107k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2953:11): [True: 107k, False: 0]
  |  |  ------------------
  |  | 2954|    595|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 595, False: 106k]
  |  |  ------------------
  |  | 2955|    595|			*p++ = *ucptr++;	\
  |  | 2956|    595|			/* FALL THROUGH */	\
  |  | 2957|  2.82k|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 2.23k, False: 105k]
  |  |  ------------------
  |  | 2958|  2.82k|			*p++ = *ucptr++;	\
  |  | 2959|  2.82k|			/* FALL THROUGH */	\
  |  | 2960|  6.01k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2960:3): [True: 3.18k, False: 104k]
  |  |  ------------------
  |  | 2961|  6.01k|			*p++ = *ucptr++;	\
  |  | 2962|  6.01k|			/* FALL THROUGH */	\
  |  | 2963|   107k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2963:3): [True: 101k, False: 6.01k]
  |  |  ------------------
  |  | 2964|   107k|			*p++ = *ucptr;		\
  |  | 2965|   107k|			break;			\
  |  | 2966|   107k|		}				\
  |  | 2967|   107k|		ucptr = NULL;			\
  |  | 2968|   107k|	} else {				\
  |  | 2969|    757|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2936|    757|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2937|    841|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:9): [True: 84, False: 757]
  |  |  |  |  ------------------
  |  |  |  | 2938|     84|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2927|     84|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2928|     84|	as->length = p - as->s;			\
  |  |  |  |  |  | 2929|     84|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2929:6): [True: 0, False: 84]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2930|     84|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2931|     84|		return (-1);			\
  |  |  |  |  |  | 2932|     84|	p = as->s + as->length;			\
  |  |  |  |  |  | 2933|     84|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2934|     84|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2934:10): [Folded, False: 84]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2939|     84|	}					\
  |  |  |  | 2940|    757|	p += w;					\
  |  |  |  | 2941|    757|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2941:10): [Folded, False: 757]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2970|    757|	}					\
  |  | 2971|   108k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2971:10): [Folded, False: 108k]
  |  |  ------------------
  ------------------
 3244|       |			/* Use a replaced unicode character. */
 3245|   108k|			UNPARSE(p, endp, uc2);
  ------------------
  |  | 2936|   108k|#define UNPARSE(p, endp, uc)	do {		\
  |  | 2937|   108k|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  ------------------
  |  |  |  Branch (2937:9): [True: 890, False: 108k]
  |  |  ------------------
  |  | 2938|    890|		EXPAND_BUFFER();		\
  |  |  ------------------
  |  |  |  | 2927|    890|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|    890|	as->length = p - as->s;			\
  |  |  |  | 2929|    890|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 890]
  |  |  |  |  ------------------
  |  |  |  | 2930|    890|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|    890|		return (-1);			\
  |  |  |  | 2932|    890|	p = as->s + as->length;			\
  |  |  |  | 2933|    890|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|    890|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 890]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2939|    890|	}					\
  |  | 2940|   108k|	p += w;					\
  |  | 2941|   108k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2941:10): [Folded, False: 108k]
  |  |  ------------------
  ------------------
 3246|   108k|			s += n2*-1;
 3247|   108k|			len -= n2*-1;
 3248|   108k|			ret = -1;
 3249|   108k|			continue;
 3250|   108k|		} else if (n2 == 0) {
  ------------------
  |  Branch (3250:14): [True: 42.2k, False: 28.4k]
  ------------------
 3251|  42.2k|			WRITE_UC();
  ------------------
  |  | 2949|  42.2k|#define WRITE_UC()	do {			\
  |  | 2950|  42.2k|	if (ucptr) {				\
  |  |  ------------------
  |  |  |  Branch (2950:6): [True: 42.1k, False: 103]
  |  |  ------------------
  |  | 2951|  42.1k|		if (p + n > endp)		\
  |  |  ------------------
  |  |  |  Branch (2951:7): [True: 306, False: 41.8k]
  |  |  ------------------
  |  | 2952|  42.1k|			EXPAND_BUFFER();	\
  |  |  ------------------
  |  |  |  | 2927|    306|#define EXPAND_BUFFER() do {			\
  |  |  |  | 2928|    306|	as->length = p - as->s;			\
  |  |  |  | 2929|    306|	if (archive_string_ensure(as,		\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2929:6): [True: 0, False: 306]
  |  |  |  |  ------------------
  |  |  |  | 2930|    306|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  | 2931|    306|		return (-1);			\
  |  |  |  | 2932|    306|	p = as->s + as->length;			\
  |  |  |  | 2933|    306|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  | 2934|    306|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2934:10): [Folded, False: 306]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2953|  42.1k|		switch (n) {			\
  |  |  ------------------
  |  |  |  Branch (2953:11): [True: 42.1k, False: 0]
  |  |  ------------------
  |  | 2954|    323|		case 4:				\
  |  |  ------------------
  |  |  |  Branch (2954:3): [True: 323, False: 41.7k]
  |  |  ------------------
  |  | 2955|    323|			*p++ = *ucptr++;	\
  |  | 2956|    323|			/* FALL THROUGH */	\
  |  | 2957|    506|		case 3:				\
  |  |  ------------------
  |  |  |  Branch (2957:3): [True: 183, False: 41.9k]
  |  |  ------------------
  |  | 2958|    506|			*p++ = *ucptr++;	\
  |  | 2959|    506|			/* FALL THROUGH */	\
  |  | 2960|  3.27k|		case 2:				\
  |  |  ------------------
  |  |  |  Branch (2960:3): [True: 2.76k, False: 39.3k]
  |  |  ------------------
  |  | 2961|  3.27k|			*p++ = *ucptr++;	\
  |  | 2962|  3.27k|			/* FALL THROUGH */	\
  |  | 2963|  42.1k|		case 1:				\
  |  |  ------------------
  |  |  |  Branch (2963:3): [True: 38.8k, False: 3.27k]
  |  |  ------------------
  |  | 2964|  42.1k|			*p++ = *ucptr;		\
  |  | 2965|  42.1k|			break;			\
  |  | 2966|  42.1k|		}				\
  |  | 2967|  42.1k|		ucptr = NULL;			\
  |  | 2968|  42.1k|	} else {				\
  |  | 2969|    103|		UNPARSE(p, endp, uc);		\
  |  |  ------------------
  |  |  |  | 2936|    103|#define UNPARSE(p, endp, uc)	do {		\
  |  |  |  | 2937|    143|	while ((w = unparse(p, (endp) - (p), uc)) == 0) {\
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2937:9): [True: 40, False: 103]
  |  |  |  |  ------------------
  |  |  |  | 2938|     40|		EXPAND_BUFFER();		\
  |  |  |  |  ------------------
  |  |  |  |  |  | 2927|     40|#define EXPAND_BUFFER() do {			\
  |  |  |  |  |  | 2928|     40|	as->length = p - as->s;			\
  |  |  |  |  |  | 2929|     40|	if (archive_string_ensure(as,		\
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2929:6): [True: 0, False: 40]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 2930|     40|	    as->buffer_length + len * tm + ts) == NULL)\
  |  |  |  |  |  | 2931|     40|		return (-1);			\
  |  |  |  |  |  | 2932|     40|	p = as->s + as->length;			\
  |  |  |  |  |  | 2933|     40|	endp = as->s + as->buffer_length - ts;	\
  |  |  |  |  |  | 2934|     40|} while (0)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (2934:10): [Folded, False: 40]
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  | 2939|     40|	}					\
  |  |  |  | 2940|    103|	p += w;					\
  |  |  |  | 2941|    103|} while (0)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (2941:10): [Folded, False: 103]
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2970|    103|	}					\
  |  | 2971|  42.2k|} while (0)
  |  |  ------------------
  |  |  |  Branch (2971:10): [Folded, False: 42.2k]
  |  |  ------------------
  ------------------
 3252|  42.2k|			break;
 3253|  42.2k|		}
 3254|   178k|	}
 3255|  49.2k|	as->length = p - as->s;
 3256|  49.2k|	as->s[as->length] = '\0';
 3257|  49.2k|	if (ts == 2)
  ------------------
  |  Branch (3257:6): [True: 2.77k, False: 46.4k]
  ------------------
 3258|  2.77k|		as->s[as->length+1] = '\0';
 3259|  49.2k|	return (ret);
 3260|  49.2k|}
archive_string.c:get_nfc:
 2886|   109k|{
 2887|   109k|	int t, b;
 2888|       |
 2889|   109k|	t = 0;
 2890|   109k|	b = sizeof(u_composition_table)/sizeof(u_composition_table[0]) -1;
 2891|  1.10M|	while (b >= t) {
  ------------------
  |  Branch (2891:9): [True: 1.02M, False: 85.8k]
  ------------------
 2892|  1.02M|		int m = (t + b) / 2;
 2893|  1.02M|		if (u_composition_table[m].cp1 < uc)
  ------------------
  |  Branch (2893:7): [True: 537k, False: 483k]
  ------------------
 2894|   537k|			t = m + 1;
 2895|   483k|		else if (u_composition_table[m].cp1 > uc)
  ------------------
  |  Branch (2895:12): [True: 396k, False: 87.2k]
  ------------------
 2896|   396k|			b = m - 1;
 2897|  87.2k|		else if (u_composition_table[m].cp2 < uc2)
  ------------------
  |  Branch (2897:12): [True: 38.3k, False: 48.9k]
  ------------------
 2898|  38.3k|			t = m + 1;
 2899|  48.9k|		else if (u_composition_table[m].cp2 > uc2)
  ------------------
  |  Branch (2899:12): [True: 24.8k, False: 24.1k]
  ------------------
 2900|  24.8k|			b = m - 1;
 2901|  24.1k|		else
 2902|  24.1k|			return (u_composition_table[m].nfc);
 2903|  1.02M|	}
 2904|  85.8k|	return (0);
 2905|   109k|}
archive_string.c:best_effort_strncat_in_locale:
 2310|     17|{
 2311|     17|	size_t remaining;
 2312|     17|	const uint8_t *itp;
 2313|     17|	int return_value = 0; /* success */
 2314|       |
 2315|       |	/*
 2316|       |	 * If both from-locale and to-locale is the same, this makes a copy.
 2317|       |	 * And then this checks all copied MBS can be WCS if so returns 0.
 2318|       |	 */
 2319|     17|	if (sc->same) {
  ------------------
  |  Branch (2319:6): [True: 0, False: 17]
  ------------------
 2320|      0|		if (archive_string_append(as, _p, length) == NULL)
  ------------------
  |  Branch (2320:7): [True: 0, False: 0]
  ------------------
 2321|      0|			return (-1);/* No memory */
 2322|      0|		return (invalid_mbs(_p, length, sc));
 2323|      0|	}
 2324|       |
 2325|       |	/*
 2326|       |	 * If a character is ASCII, this just copies it. If not, this
 2327|       |	 * assigns '?' character instead but in UTF-8 locale this assigns
 2328|       |	 * byte sequence 0xEF 0xBD 0xBD, which are code point U+FFFD,
 2329|       |	 * a Replacement Character in Unicode.
 2330|       |	 */
 2331|       |
 2332|     17|	remaining = length;
 2333|     17|	itp = (const uint8_t *)_p;
 2334|    662|	while (remaining > 0 && *itp) {
  ------------------
  |  Branch (2334:9): [True: 645, False: 17]
  |  Branch (2334:26): [True: 645, False: 0]
  ------------------
 2335|    645|		if (*itp > 127) {
  ------------------
  |  Branch (2335:7): [True: 324, False: 321]
  ------------------
 2336|       |			// Non-ASCII: Substitute with suitable replacement
 2337|    324|			if (sc->flag & SCONV_TO_UTF8) {
  ------------------
  |  |  105|    324|#define SCONV_TO_UTF8		(1<<8)	/* "to charset" side is UTF-8. */
  ------------------
  |  Branch (2337:8): [True: 0, False: 324]
  ------------------
 2338|      0|				if (archive_string_append(as, utf8_replacement_char, sizeof(utf8_replacement_char)) == NULL) {
  ------------------
  |  Branch (2338:9): [True: 0, False: 0]
  ------------------
 2339|      0|					__archive_errx(1, "Out of memory");
 2340|      0|				}
 2341|    324|			} else {
 2342|    324|				archive_strappend_char(as, '?');
 2343|    324|			}
 2344|    324|			return_value = -1;
 2345|    324|		} else {
 2346|    321|			archive_strappend_char(as, *itp);
 2347|    321|		}
 2348|    645|		++itp;
 2349|    645|		--remaining;
 2350|    645|	}
 2351|     17|	return (return_value);
 2352|     17|}
archive_string.c:utf16nbytes:
 1992|  4.16k|{
 1993|  4.16k|	size_t s;
 1994|  4.16k|	const char *p, *pp;
 1995|       |
 1996|  4.16k|	if (_p == NULL)
  ------------------
  |  Branch (1996:6): [True: 0, False: 4.16k]
  ------------------
 1997|      0|		return (0);
 1998|  4.16k|	p = (const char *)_p;
 1999|       |
 2000|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
 2001|  4.16k|	s = 0;
 2002|  4.16k|	pp = p;
 2003|  4.16k|	n >>= 1;
 2004|  76.3k|	while (s < n && (pp[0] || pp[1])) {
  ------------------
  |  Branch (2004:9): [True: 74.0k, False: 2.33k]
  |  Branch (2004:19): [True: 60.0k, False: 13.9k]
  |  Branch (2004:28): [True: 12.1k, False: 1.83k]
  ------------------
 2005|  72.2k|		pp += 2;
 2006|  72.2k|		s++;
 2007|  72.2k|	}
 2008|  4.16k|	return (s<<1);
 2009|  4.16k|}
archive_string.c:mbsnbytes:
 1972|   705k|{
 1973|   705k|	size_t s;
 1974|   705k|	const char *p, *pp;
 1975|       |
 1976|   705k|	if (_p == NULL)
  ------------------
  |  Branch (1976:6): [True: 0, False: 705k]
  ------------------
 1977|      0|		return (0);
 1978|   705k|	p = (const char *)_p;
 1979|       |
 1980|       |	/* Like strlen(p), except won't examine positions beyond p[n]. */
 1981|   705k|	s = 0;
 1982|   705k|	pp = p;
 1983|   139M|	while (s < n && *pp) {
  ------------------
  |  Branch (1983:9): [True: 138M, False: 671k]
  |  Branch (1983:18): [True: 138M, False: 34.7k]
  ------------------
 1984|   138M|		pp++;
 1985|   138M|		s++;
 1986|   138M|	}
 1987|   705k|	return (s);
 1988|   705k|}

archive_string_sprintf:
   77|  66.7k|{
   78|  66.7k|	va_list ap;
   79|       |
   80|  66.7k|	va_start(ap, fmt);
   81|  66.7k|	archive_string_vsprintf(as, fmt, ap);
   82|       |	va_end(ap);
   83|  66.7k|}
archive_string_vsprintf:
   92|   384k|{
   93|   384k|	char long_flag;
   94|   384k|	intmax_t s; /* Signed integer temp. */
   95|   384k|	uintmax_t u; /* Unsigned integer temp. */
   96|   384k|	const char *p, *p2;
   97|   384k|	const wchar_t *pw;
   98|       |
   99|   384k|	if (archive_string_ensure(as, 64) == NULL)
  ------------------
  |  Branch (99:6): [True: 0, False: 384k]
  ------------------
  100|      0|		__archive_errx(1, "Out of memory");
  101|       |
  102|   384k|	if (fmt == NULL) {
  ------------------
  |  Branch (102:6): [True: 0, False: 384k]
  ------------------
  103|      0|		as->s[0] = 0;
  104|      0|		return;
  105|      0|	}
  106|       |
  107|  13.5M|	for (p = fmt; *p != '\0'; p++) {
  ------------------
  |  Branch (107:16): [True: 13.1M, False: 384k]
  ------------------
  108|  13.1M|		const char *saved_p = p;
  109|       |
  110|  13.1M|		if (*p != '%') {
  ------------------
  |  Branch (110:7): [True: 12.8M, False: 318k]
  ------------------
  111|  12.8M|			archive_strappend_char(as, *p);
  112|  12.8M|			continue;
  113|  12.8M|		}
  114|       |
  115|   318k|		p++;
  116|       |
  117|   318k|		long_flag = '\0';
  118|   318k|		switch(*p) {
  ------------------
  |  Branch (118:10): [True: 71.9k, False: 246k]
  ------------------
  119|  1.05k|		case 'l':
  ------------------
  |  Branch (119:3): [True: 1.05k, False: 317k]
  ------------------
  120|  1.05k|			if (p[1] == 'l') {
  ------------------
  |  Branch (120:8): [True: 911, False: 146]
  ------------------
  121|    911|				long_flag = 'L';
  122|    911|				p += 2;
  123|    911|				break;
  124|    911|			}
  125|    146|			__LA_FALLTHROUGH;
  126|  43.3k|		case 'j':
  ------------------
  |  Branch (126:3): [True: 43.2k, False: 275k]
  ------------------
  127|  71.0k|		case 'z':
  ------------------
  |  Branch (127:3): [True: 27.6k, False: 290k]
  ------------------
  128|  71.0k|			long_flag = *p;
  129|  71.0k|			p++;
  130|  71.0k|			break;
  131|   318k|		}
  132|       |
  133|   318k|		switch (*p) {
  134|      0|		case '%':
  ------------------
  |  Branch (134:3): [True: 0, False: 318k]
  ------------------
  135|      0|			archive_strappend_char(as, '%');
  136|      0|			break;
  137|    978|		case 'c':
  ------------------
  |  Branch (137:3): [True: 978, False: 317k]
  ------------------
  138|    978|			s = va_arg(ap, int);
  139|    978|			archive_strappend_char(as, (char)s);
  140|    978|			break;
  141|   154k|		case 'd':
  ------------------
  |  Branch (141:3): [True: 154k, False: 163k]
  ------------------
  142|   154k|			switch(long_flag) {
  143|  37.9k|			case 'j': s = va_arg(ap, intmax_t); break;
  ------------------
  |  Branch (143:4): [True: 37.9k, False: 117k]
  ------------------
  144|      0|			case 'l': s = va_arg(ap, long); break;
  ------------------
  |  Branch (144:4): [True: 0, False: 154k]
  ------------------
  145|    621|			case 'L': s = va_arg(ap, long long); break;
  ------------------
  |  Branch (145:4): [True: 621, False: 154k]
  ------------------
  146|      0|			case 'z': s = va_arg(ap, ssize_t); break;
  ------------------
  |  Branch (146:4): [True: 0, False: 154k]
  ------------------
  147|   116k|			default:  s = va_arg(ap, int); break;
  ------------------
  |  Branch (147:4): [True: 116k, False: 38.5k]
  ------------------
  148|   154k|			}
  149|   154k|			append_int(as, s, 10);
  150|   154k|			break;
  151|   123k|		case 's':
  ------------------
  |  Branch (151:3): [True: 123k, False: 194k]
  ------------------
  152|   123k|			switch(long_flag) {
  153|      0|			case 'l':
  ------------------
  |  Branch (153:4): [True: 0, False: 123k]
  ------------------
  154|      0|			case 'L':
  ------------------
  |  Branch (154:4): [True: 0, False: 123k]
  ------------------
  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|   123k|			default:
  ------------------
  |  Branch (162:4): [True: 123k, False: 0]
  ------------------
  163|   123k|				p2 = va_arg(ap, char *);
  164|   123k|				if (p2 == NULL)
  ------------------
  |  Branch (164:9): [True: 2, False: 123k]
  ------------------
  165|      2|					p2 = "(null)";
  166|   123k|				archive_strcat(as, p2);
  167|   123k|				break;
  168|   123k|			}
  169|   123k|			break;
  170|   123k|		case 'S':
  ------------------
  |  Branch (170:3): [True: 0, False: 318k]
  ------------------
  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|  38.6k|		case 'o': case 'u': case 'x': case 'X':
  ------------------
  |  Branch (178:3): [True: 0, False: 318k]
  |  Branch (178:13): [True: 38.4k, False: 279k]
  |  Branch (178:23): [True: 249, False: 318k]
  |  Branch (178:33): [True: 40, False: 318k]
  ------------------
  179|       |			/* Common handling for unsigned integer formats. */
  180|  38.6k|			switch(long_flag) {
  181|  5.24k|			case 'j': u = va_arg(ap, uintmax_t); break;
  ------------------
  |  Branch (181:4): [True: 5.24k, False: 33.4k]
  ------------------
  182|    146|			case 'l': u = va_arg(ap, unsigned long); break;
  ------------------
  |  Branch (182:4): [True: 146, False: 38.5k]
  ------------------
  183|    290|			case 'L': u = va_arg(ap, unsigned long long); break;
  ------------------
  |  Branch (183:4): [True: 290, False: 38.4k]
  ------------------
  184|  27.6k|			case 'z': u = va_arg(ap, size_t); break;
  ------------------
  |  Branch (184:4): [True: 27.6k, False: 11.0k]
  ------------------
  185|  5.34k|			default:  u = va_arg(ap, unsigned int); break;
  ------------------
  |  Branch (185:4): [True: 5.34k, False: 33.3k]
  ------------------
  186|  38.6k|			}
  187|       |			/* Format it in the correct base. */
  188|  38.6k|			switch (*p) {
  189|      0|			case 'o': append_uint(as, u, 8); break;
  ------------------
  |  Branch (189:4): [True: 0, False: 38.6k]
  ------------------
  190|  38.4k|			case 'u': append_uint(as, u, 10); break;
  ------------------
  |  Branch (190:4): [True: 38.4k, False: 289]
  ------------------
  191|    289|			default: append_uint(as, u, 16); break;
  ------------------
  |  Branch (191:4): [True: 289, False: 38.4k]
  ------------------
  192|  38.6k|			}
  193|  38.6k|			break;
  194|  38.6k|		default:
  ------------------
  |  Branch (194:3): [True: 44, False: 318k]
  ------------------
  195|       |			/* Rewind and print the initial '%' literally. */
  196|     44|			p = saved_p;
  197|     44|			archive_strappend_char(as, *p);
  198|   318k|		}
  199|   318k|	}
  200|   384k|}
archive_string_sprintf.c:append_int:
   63|   154k|{
   64|   154k|	uintmax_t ud;
   65|       |
   66|   154k|	if (d < 0) {
  ------------------
  |  Branch (66:6): [True: 10.2k, False: 144k]
  ------------------
   67|  10.2k|		archive_strappend_char(as, '-');
   68|  10.2k|		ud = (d == INTMAX_MIN) ? (uintmax_t)(INTMAX_MAX) + 1 : (uintmax_t)(-d);
  ------------------
  |  Branch (68:8): [True: 30, False: 10.2k]
  ------------------
   69|  10.2k|	} else
   70|   144k|		ud = d;
   71|   154k|	append_uint(as, ud, base);
   72|   154k|}
archive_string_sprintf.c:append_uint:
   54|   393k|{
   55|   393k|	static const char digits[] = "0123456789abcdef";
   56|   393k|	if (d >= base)
  ------------------
  |  Branch (56:6): [True: 199k, False: 193k]
  ------------------
   57|   199k|		append_uint(as, d/base, base);
   58|   393k|	archive_strappend_char(as, digits[d % base]);
   59|   393k|}

__archive_dos_to_unix:
   64|  39.9k|{
   65|  39.9k|	uint16_t msTime, msDate;
   66|  39.9k|	struct tm ts;
   67|  39.9k|	time_t t;
   68|       |
   69|  39.9k|	msTime = (0xFFFF & dos_time);
   70|  39.9k|	msDate = (dos_time >> 16);
   71|       |
   72|  39.9k|	memset(&ts, 0, sizeof(ts));
   73|  39.9k|	ts.tm_year = ((msDate >> 9) & 0x7f) + 80; /* Years since 1900. */
   74|  39.9k|	ts.tm_mon = ((msDate >> 5) & 0x0f) - 1; /* Month number. */
   75|  39.9k|	ts.tm_mday = msDate & 0x1f; /* Day of month. */
   76|  39.9k|	ts.tm_hour = (msTime >> 11) & 0x1f;
   77|  39.9k|	ts.tm_min = (msTime >> 5) & 0x3f;
   78|  39.9k|	ts.tm_sec = (msTime << 1) & 0x3e;
   79|  39.9k|	ts.tm_isdst = -1;
   80|  39.9k|	t = mktime(&ts);
   81|  39.9k|	return (int64_t)(t == (time_t)-1 ? INT32_MAX : t);
  ------------------
  |  Branch (81:19): [True: 0, False: 39.9k]
  ------------------
   82|  39.9k|}
__archive_ntfs_to_unix:
  136|  3.48k|{
  137|  3.48k|	if (ntfs > INT64_MAX) {
  ------------------
  |  Branch (137:6): [True: 1.16k, False: 2.31k]
  ------------------
  138|  1.16k|		ntfs -= NTFS_EPOC_TICKS;
  ------------------
  |  |   44|  1.16k|#define NTFS_EPOC_TICKS (NTFS_EPOC_TIME * NTFS_TICKS)
  |  |  ------------------
  |  |  |  |   42|  1.16k|#define NTFS_EPOC_TIME ARCHIVE_LITERAL_ULL(11644473600)
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  1.16k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define NTFS_EPOC_TICKS (NTFS_EPOC_TIME * NTFS_TICKS)
  |  |  ------------------
  |  |  |  |   43|  1.16k|#define NTFS_TICKS ARCHIVE_LITERAL_ULL(10000000)
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  1.16k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  139|  1.16k|		*secs = ntfs / NTFS_TICKS;
  ------------------
  |  |   43|  1.16k|#define NTFS_TICKS ARCHIVE_LITERAL_ULL(10000000)
  |  |  ------------------
  |  |  |  |  208|  1.16k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  140|  1.16k|		*nsecs = 100 * (ntfs % NTFS_TICKS);
  ------------------
  |  |   43|  1.16k|#define NTFS_TICKS ARCHIVE_LITERAL_ULL(10000000)
  |  |  ------------------
  |  |  |  |  208|  1.16k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  141|  1.16k|	}
  142|  2.31k|	else {
  143|  2.31k|		lldiv_t tdiv;
  144|  2.31k|		int64_t value = (int64_t)ntfs - (int64_t)NTFS_EPOC_TICKS;
  ------------------
  |  |   44|  2.31k|#define NTFS_EPOC_TICKS (NTFS_EPOC_TIME * NTFS_TICKS)
  |  |  ------------------
  |  |  |  |   42|  2.31k|#define NTFS_EPOC_TIME ARCHIVE_LITERAL_ULL(11644473600)
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  2.31k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define NTFS_EPOC_TICKS (NTFS_EPOC_TIME * NTFS_TICKS)
  |  |  ------------------
  |  |  |  |   43|  2.31k|#define NTFS_TICKS ARCHIVE_LITERAL_ULL(10000000)
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  2.31k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  145|       |
  146|  2.31k|		tdiv = lldiv(value, NTFS_TICKS);
  ------------------
  |  |   43|  2.31k|#define NTFS_TICKS ARCHIVE_LITERAL_ULL(10000000)
  |  |  ------------------
  |  |  |  |  208|  2.31k|# define	ARCHIVE_LITERAL_ULL(x)	x##ull
  |  |  ------------------
  ------------------
  147|  2.31k|		*secs = tdiv.quot;
  148|  2.31k|		*nsecs = (uint32_t)(tdiv.rem * 100);
  149|  2.31k|	}
  150|  3.48k|}

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

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

__archive_create_child:
   76|      3|{
   77|      3|	pid_t child = -1;
   78|      3|	int stdin_pipe[2], stdout_pipe[2], tmp;
   79|       |
   80|      3|#if !defined(POSIX_SPAWN_CLOEXEC_DEFAULT) && \
   81|      3|    (HAVE_FORK || HAVE_VFORK) && \
   82|      3|    (HAVE_CLOSEFROM || HAVE_CLOSE_RANGE || defined(_SC_OPEN_MAX))
   83|      3|#undef HAVE_POSIX_SPAWNP
   84|      3|#endif
   85|       |
   86|       |#if HAVE_POSIX_SPAWNP
   87|       |	posix_spawnattr_t attr;
   88|       |	posix_spawn_file_actions_t actions;
   89|       |	int r;
   90|       |#endif
   91|      3|	struct archive_cmdline *cmdline;
   92|       |
   93|      3|	cmdline = __archive_cmdline_allocate();
   94|      3|	if (cmdline == NULL)
  ------------------
  |  Branch (94:6): [True: 0, False: 3]
  ------------------
   95|      0|		goto state_allocated;
   96|      3|	if (__archive_cmdline_parse(cmdline, cmd) != ARCHIVE_OK)
  ------------------
  |  |  233|      3|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  |  Branch (96:6): [True: 0, False: 3]
  ------------------
   97|      0|		goto state_allocated;
   98|       |
   99|      3|	if (pipe(stdin_pipe) == -1)
  ------------------
  |  Branch (99:6): [True: 0, False: 3]
  ------------------
  100|      0|		goto state_allocated;
  101|      3|	if (stdin_pipe[0] == 1 /* stdout */) {
  ------------------
  |  Branch (101:6): [True: 0, False: 3]
  ------------------
  102|      0|		if ((tmp = dup(stdin_pipe[0])) == -1)
  ------------------
  |  Branch (102:7): [True: 0, False: 0]
  ------------------
  103|      0|			goto stdin_opened;
  104|      0|		close(stdin_pipe[0]);
  105|      0|		stdin_pipe[0] = tmp;
  106|      0|	}
  107|      3|	if (pipe(stdout_pipe) == -1)
  ------------------
  |  Branch (107:6): [True: 0, False: 3]
  ------------------
  108|      0|		goto stdin_opened;
  109|      3|	if (stdout_pipe[1] == 0 /* stdin */) {
  ------------------
  |  Branch (109:6): [True: 0, False: 3]
  ------------------
  110|      0|		if ((tmp = dup(stdout_pipe[1])) == -1)
  ------------------
  |  Branch (110:7): [True: 0, False: 0]
  ------------------
  111|      0|			goto stdout_opened;
  112|      0|		close(stdout_pipe[1]);
  113|      0|		stdout_pipe[1] = tmp;
  114|      0|	}
  115|       |
  116|       |#if HAVE_POSIX_SPAWNP
  117|       |
  118|       |	r = posix_spawnattr_init(&attr);
  119|       |	if (r != 0) {
  120|       |		errno = r;
  121|       |		goto stdout_opened;
  122|       |	}
  123|       |	r = posix_spawn_file_actions_init(&actions);
  124|       |	if (r != 0) {
  125|       |		errno = r;
  126|       |		goto attr_inited;
  127|       |	}
  128|       |#ifdef POSIX_SPAWN_CLOEXEC_DEFAULT
  129|       |	r = posix_spawnattr_setflags(&attr, POSIX_SPAWN_CLOEXEC_DEFAULT);
  130|       |	if (r != 0)
  131|       |		goto actions_inited;
  132|       |#endif
  133|       |	r = posix_spawn_file_actions_addclose(&actions, stdin_pipe[1]);
  134|       |	if (r != 0)
  135|       |		goto actions_inited;
  136|       |	r = posix_spawn_file_actions_addclose(&actions, stdout_pipe[0]);
  137|       |	if (r != 0)
  138|       |		goto actions_inited;
  139|       |	/* Setup for stdin. */
  140|       |	r = posix_spawn_file_actions_adddup2(&actions, stdin_pipe[0], 0);
  141|       |	if (r != 0)
  142|       |		goto actions_inited;
  143|       |	if (stdin_pipe[0] != 0 /* stdin */) {
  144|       |		r = posix_spawn_file_actions_addclose(&actions, stdin_pipe[0]);
  145|       |		if (r != 0)
  146|       |			goto actions_inited;
  147|       |	}
  148|       |	/* Setup for stdout. */
  149|       |	r = posix_spawn_file_actions_adddup2(&actions, stdout_pipe[1], 1);
  150|       |	if (r != 0)
  151|       |		goto actions_inited;
  152|       |	if (stdout_pipe[1] != 1 /* stdout */) {
  153|       |		r = posix_spawn_file_actions_addclose(&actions, stdout_pipe[1]);
  154|       |		if (r != 0)
  155|       |			goto actions_inited;
  156|       |	}
  157|       |	r = posix_spawnp(&child, cmdline->path, &actions, &attr,
  158|       |		cmdline->argv, NULL);
  159|       |	if (r != 0)
  160|       |		goto actions_inited;
  161|       |	posix_spawn_file_actions_destroy(&actions);
  162|       |	posix_spawnattr_destroy(&attr);
  163|       |
  164|       |#else /* HAVE_POSIX_SPAWNP */
  165|       |
  166|      3|#if HAVE_VFORK
  167|      3|	child = vfork();
  168|       |#else
  169|       |	child = fork();
  170|       |#endif
  171|      3|	if (child == -1)
  ------------------
  |  Branch (171:6): [True: 0, False: 3]
  ------------------
  172|      0|		goto stdout_opened;
  173|      3|	if (child == 0) {
  ------------------
  |  Branch (173:6): [True: 3, False: 0]
  ------------------
  174|      3|		close(stdin_pipe[1]);
  175|      3|		close(stdout_pipe[0]);
  176|      3|		if (dup2(stdin_pipe[0], 0 /* stdin */) == -1)
  ------------------
  |  Branch (176:7): [True: 0, False: 3]
  ------------------
  177|      0|			_exit(254);
  178|      3|		if (stdin_pipe[0] != 0 /* stdin */)
  ------------------
  |  Branch (178:7): [True: 3, False: 0]
  ------------------
  179|      3|			close(stdin_pipe[0]);
  180|      3|		if (dup2(stdout_pipe[1], 1 /* stdout */) == -1)
  ------------------
  |  Branch (180:7): [True: 0, False: 3]
  ------------------
  181|      0|			_exit(254);
  182|      3|		if (stdout_pipe[1] != 1 /* stdout */)
  ------------------
  |  Branch (182:7): [True: 3, False: 0]
  ------------------
  183|      3|			close(stdout_pipe[1]);
  184|       |
  185|       |#if HAVE_CLOSEFROM
  186|       |		closefrom(3);
  187|       |#elif HAVE_CLOSE_RANGE
  188|       |		close_range(3, ~0U, 0);
  189|       |#elif defined(_SC_OPEN_MAX)
  190|  3.06k|		for (int i = sysconf(_SC_OPEN_MAX); i > 3;)
  ------------------
  |  Branch (190:39): [True: 3.06k, False: 3]
  ------------------
  191|  3.06k|			close(--i);
  192|      3|#endif
  193|       |
  194|      3|		execvp(cmdline->path, cmdline->argv);
  195|      3|		_exit(254);
  196|      3|	}
  197|      0|#endif /* HAVE_POSIX_SPAWNP */
  198|       |
  199|      0|	close(stdin_pipe[0]);
  200|      0|	close(stdout_pipe[1]);
  201|       |
  202|      0|	*child_stdin = stdin_pipe[1];
  203|      0|	fcntl(*child_stdin, F_SETFL, O_NONBLOCK);
  204|      0|	*child_stdout = stdout_pipe[0];
  205|      0|	fcntl(*child_stdout, F_SETFL, O_NONBLOCK);
  206|      0|	__archive_cmdline_free(cmdline);
  207|       |
  208|      0|	*out_child = child;
  209|      0|	return ARCHIVE_OK;
  ------------------
  |  |  233|      0|#define	ARCHIVE_OK	  0	/* Operation was successful. */
  ------------------
  210|       |
  211|       |#if HAVE_POSIX_SPAWNP
  212|       |actions_inited:
  213|       |	errno = r;
  214|       |	posix_spawn_file_actions_destroy(&actions);
  215|       |attr_inited:
  216|       |	posix_spawnattr_destroy(&attr);
  217|       |#endif
  218|      0|stdout_opened:
  219|      0|	close(stdout_pipe[0]);
  220|      0|	close(stdout_pipe[1]);
  221|      0|stdin_opened:
  222|      0|	close(stdin_pipe[0]);
  223|      0|	close(stdin_pipe[1]);
  224|      0|state_allocated:
  225|      0|	__archive_cmdline_free(cmdline);
  226|      0|	return ARCHIVE_FAILED;
  ------------------
  |  |  237|      0|#define	ARCHIVE_FAILED	(-25)	/* Current operation cannot complete. */
  ------------------
  227|      0|}

xxhash.c:XXH32:
  295|  1.99k|{
  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|  1.99k|    XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;
  ------------------
  |  |  202|  1.99k|#   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|  1.99k|    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: 1.99k, False: 0]
  ------------------
  315|  1.99k|        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|  1.99k|#endif
  319|  1.99k|}
xxhash.c:XXH32_endian_align:
  235|  1.99k|{
  236|  1.99k|    const BYTE* p = (const BYTE*)input;
  237|  1.99k|    const BYTE* bEnd = p + len;
  238|  1.99k|    U32 h32;
  239|  1.99k|#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|  1.99k|    if (len>=16)
  ------------------
  |  Branch (245:9): [True: 17, False: 1.97k]
  ------------------
  246|     17|    {
  247|     17|        const BYTE* const limit = bEnd - 16;
  248|     17|        U32 v1 = seed + PRIME32_1 + PRIME32_2;
  ------------------
  |  |  189|     17|#define PRIME32_1   2654435761U
  ------------------
                      U32 v1 = seed + PRIME32_1 + PRIME32_2;
  ------------------
  |  |  190|     17|#define PRIME32_2   2246822519U
  ------------------
  249|     17|        U32 v2 = seed + PRIME32_2;
  ------------------
  |  |  190|     17|#define PRIME32_2   2246822519U
  ------------------
  250|     17|        U32 v3 = seed + 0;
  251|     17|        U32 v4 = seed - PRIME32_1;
  ------------------
  |  |  189|     17|#define PRIME32_1   2654435761U
  ------------------
  252|       |
  253|     17|        do
  254|    517|        {
  255|    517|            v1 += XXH_get32bits(p) * PRIME32_2; v1 = XXH_rotl32(v1, 13); v1 *= PRIME32_1; p+=4;
  ------------------
  |  |  239|    517|#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|    517|#define PRIME32_2   2246822519U
  ------------------
                          v1 += XXH_get32bits(p) * PRIME32_2; v1 = XXH_rotl32(v1, 13); v1 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|    517|#  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|    517|#define PRIME32_1   2654435761U
  ------------------
  256|    517|            v2 += XXH_get32bits(p) * PRIME32_2; v2 = XXH_rotl32(v2, 13); v2 *= PRIME32_1; p+=4;
  ------------------
  |  |  239|    517|#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|    517|#define PRIME32_2   2246822519U
  ------------------
                          v2 += XXH_get32bits(p) * PRIME32_2; v2 = XXH_rotl32(v2, 13); v2 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|    517|#  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|    517|#define PRIME32_1   2654435761U
  ------------------
  257|    517|            v3 += XXH_get32bits(p) * PRIME32_2; v3 = XXH_rotl32(v3, 13); v3 *= PRIME32_1; p+=4;
  ------------------
  |  |  239|    517|#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|    517|#define PRIME32_2   2246822519U
  ------------------
                          v3 += XXH_get32bits(p) * PRIME32_2; v3 = XXH_rotl32(v3, 13); v3 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|    517|#  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|    517|#define PRIME32_1   2654435761U
  ------------------
  258|    517|            v4 += XXH_get32bits(p) * PRIME32_2; v4 = XXH_rotl32(v4, 13); v4 *= PRIME32_1; p+=4;
  ------------------
  |  |  239|    517|#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|    517|#define PRIME32_2   2246822519U
  ------------------
                          v4 += XXH_get32bits(p) * PRIME32_2; v4 = XXH_rotl32(v4, 13); v4 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|    517|#  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|    517|#define PRIME32_1   2654435761U
  ------------------
  259|    517|        } while (p<=limit);
  ------------------
  |  Branch (259:18): [True: 500, False: 17]
  ------------------
  260|       |
  261|     17|        h32 = XXH_rotl32(v1, 1) + XXH_rotl32(v2, 7) + XXH_rotl32(v3, 12) + XXH_rotl32(v4, 18);
  ------------------
  |  |  170|     17|#  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|     17|#  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|     17|#  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|     17|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
  262|     17|    }
  263|  1.97k|    else
  264|  1.97k|    {
  265|  1.97k|        h32  = seed + PRIME32_5;
  ------------------
  |  |  193|  1.97k|#define PRIME32_5    374761393U
  ------------------
  266|  1.97k|    }
  267|       |
  268|  1.99k|    h32 += (U32) len;
  269|       |
  270|  3.61k|    while (p<=bEnd-4)
  ------------------
  |  Branch (270:12): [True: 1.62k, False: 1.99k]
  ------------------
  271|  1.62k|    {
  272|  1.62k|        h32 += XXH_get32bits(p) * PRIME32_3;
  ------------------
  |  |  239|  1.62k|#define XXH_get32bits(p) XXH_readLE32_align((const U32*)p, endian, align)
  ------------------
                      h32 += XXH_get32bits(p) * PRIME32_3;
  ------------------
  |  |  191|  1.62k|#define PRIME32_3   3266489917U
  ------------------
  273|  1.62k|        h32  = XXH_rotl32(h32, 17) * PRIME32_4 ;
  ------------------
  |  |  170|  1.62k|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                      h32  = XXH_rotl32(h32, 17) * PRIME32_4 ;
  ------------------
  |  |  192|  1.62k|#define PRIME32_4    668265263U
  ------------------
  274|  1.62k|        p+=4;
  275|  1.62k|    }
  276|       |
  277|  5.25k|    while (p<bEnd)
  ------------------
  |  Branch (277:12): [True: 3.25k, False: 1.99k]
  ------------------
  278|  3.25k|    {
  279|  3.25k|        h32 += (*p) * PRIME32_5;
  ------------------
  |  |  193|  3.25k|#define PRIME32_5    374761393U
  ------------------
  280|  3.25k|        h32 = XXH_rotl32(h32, 11) * PRIME32_1 ;
  ------------------
  |  |  170|  3.25k|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                      h32 = XXH_rotl32(h32, 11) * PRIME32_1 ;
  ------------------
  |  |  189|  3.25k|#define PRIME32_1   2654435761U
  ------------------
  281|  3.25k|        p++;
  282|  3.25k|    }
  283|       |
  284|  1.99k|    h32 ^= h32 >> 15;
  285|  1.99k|    h32 *= PRIME32_2;
  ------------------
  |  |  190|  1.99k|#define PRIME32_2   2246822519U
  ------------------
  286|  1.99k|    h32 ^= h32 >> 13;
  287|  1.99k|    h32 *= PRIME32_3;
  ------------------
  |  |  191|  1.99k|#define PRIME32_3   3266489917U
  ------------------
  288|  1.99k|    h32 ^= h32 >> 16;
  289|       |
  290|  1.99k|    return h32;
  291|  1.99k|}
xxhash.c:XXH_readLE32_align:
  219|   278k|{
  220|   278k|    if (align==XXH_unaligned)
  ------------------
  |  Branch (220:9): [True: 278k, False: 0]
  ------------------
  221|   278k|        return endian==XXH_littleEndian ? A32(ptr) : XXH_swap32(A32(ptr));
  ------------------
  |  Branch (221:16): [True: 278k, False: 0]
  ------------------
  222|      0|    else
  223|      0|        return endian==XXH_littleEndian ? *ptr : XXH_swap32(*ptr);
  ------------------
  |  Branch (223:16): [True: 0, False: 0]
  ------------------
  224|   278k|}
xxhash.c:A32:
  162|   278k|{
  163|   278k|    return (((const U32_S *)(x))->v);
  164|   278k|}
xxhash.c:XXH32_init:
  362|    711|{
  363|    711|    void* state = XXH_malloc (sizeof(struct XXH_state32_t));
  ------------------
  |  |   91|    711|#define XXH_malloc malloc
  ------------------
  364|    711|    if (state == NULL)
  ------------------
  |  Branch (364:9): [True: 0, False: 711]
  ------------------
  365|      0|        return NULL;
  366|    711|    XXH32_resetState(state, seed);
  367|    711|    return state;
  368|    711|}
xxhash.c:XXH32_resetState:
  348|    711|{
  349|    711|    struct XXH_state32_t * state = (struct XXH_state32_t *) state_in;
  350|    711|    state->seed = seed;
  351|    711|    state->v1 = seed + PRIME32_1 + PRIME32_2;
  ------------------
  |  |  189|    711|#define PRIME32_1   2654435761U
  ------------------
                  state->v1 = seed + PRIME32_1 + PRIME32_2;
  ------------------
  |  |  190|    711|#define PRIME32_2   2246822519U
  ------------------
  352|    711|    state->v2 = seed + PRIME32_2;
  ------------------
  |  |  190|    711|#define PRIME32_2   2246822519U
  ------------------
  353|    711|    state->v3 = seed + 0;
  354|    711|    state->v4 = seed - PRIME32_1;
  ------------------
  |  |  189|    711|#define PRIME32_1   2654435761U
  ------------------
  355|    711|    state->total_len = 0;
  356|    711|    state->memsize = 0;
  357|    711|    return XXH_OK;
  358|    711|}
xxhash.c:XXH32_update:
  437|  5.37k|{
  438|  5.37k|    XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;
  ------------------
  |  |  202|  5.37k|#   define XXH_CPU_LITTLE_ENDIAN   (*(const char*)(&one))
  ------------------
  439|       |
  440|  5.37k|    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: 5.37k, False: 0]
  ------------------
  441|  5.37k|        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|  5.37k|}
xxhash.c:XXH32_update_endian:
  372|  5.37k|{
  373|  5.37k|    struct XXH_state32_t * state = (struct XXH_state32_t *) state_in;
  374|  5.37k|    const BYTE* p = (const BYTE*)input;
  375|  5.37k|    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|  5.37k|    state->total_len += len;
  382|       |
  383|  5.37k|    if (state->memsize + len < 16)   /* fill in tmp buffer */
  ------------------
  |  Branch (383:9): [True: 3.48k, False: 1.88k]
  ------------------
  384|  3.48k|    {
  385|  3.48k|        XXH_memcpy(state->memory + state->memsize, input, len);
  ------------------
  |  |   93|  3.48k|#define XXH_memcpy memcpy
  ------------------
  386|  3.48k|        state->memsize +=  len;
  387|  3.48k|        return XXH_OK;
  388|  3.48k|    }
  389|       |
  390|  1.88k|    if (state->memsize)   /* some data left from previous update */
  ------------------
  |  Branch (390:9): [True: 1.50k, False: 382]
  ------------------
  391|  1.50k|    {
  392|  1.50k|        XXH_memcpy(state->memory + state->memsize, input, 16-state->memsize);
  ------------------
  |  |   93|  1.50k|#define XXH_memcpy memcpy
  ------------------
  393|  1.50k|        {
  394|  1.50k|            const U32* p32 = (const U32*)state->memory;
  395|  1.50k|            state->v1 += XXH_readLE32(p32, endian) * PRIME32_2; state->v1 = XXH_rotl32(state->v1, 13); state->v1 *= PRIME32_1; p32++;
  ------------------
  |  |  190|  1.50k|#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|  1.50k|#  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|  1.50k|#define PRIME32_1   2654435761U
  ------------------
  396|  1.50k|            state->v2 += XXH_readLE32(p32, endian) * PRIME32_2; state->v2 = XXH_rotl32(state->v2, 13); state->v2 *= PRIME32_1; p32++;
  ------------------
  |  |  190|  1.50k|#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|  1.50k|#  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|  1.50k|#define PRIME32_1   2654435761U
  ------------------
  397|  1.50k|            state->v3 += XXH_readLE32(p32, endian) * PRIME32_2; state->v3 = XXH_rotl32(state->v3, 13); state->v3 *= PRIME32_1; p32++;
  ------------------
  |  |  190|  1.50k|#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|  1.50k|#  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|  1.50k|#define PRIME32_1   2654435761U
  ------------------
  398|  1.50k|            state->v4 += XXH_readLE32(p32, endian) * PRIME32_2; state->v4 = XXH_rotl32(state->v4, 13); state->v4 *= PRIME32_1; p32++;
  ------------------
  |  |  190|  1.50k|#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|  1.50k|#  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|  1.50k|#define PRIME32_1   2654435761U
  ------------------
  399|  1.50k|        }
  400|  1.50k|        p += 16-state->memsize;
  401|  1.50k|        state->memsize = 0;
  402|  1.50k|    }
  403|       |
  404|  1.88k|    if (p <= bEnd-16)
  ------------------
  |  Branch (404:9): [True: 771, False: 1.11k]
  ------------------
  405|    771|    {
  406|    771|        const BYTE* const limit = bEnd - 16;
  407|    771|        U32 v1 = state->v1;
  408|    771|        U32 v2 = state->v2;
  409|    771|        U32 v3 = state->v3;
  410|    771|        U32 v4 = state->v4;
  411|       |
  412|    771|        do
  413|  67.1k|        {
  414|  67.1k|            v1 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v1 = XXH_rotl32(v1, 13); v1 *= PRIME32_1; p+=4;
  ------------------
  |  |  190|  67.1k|#define PRIME32_2   2246822519U
  ------------------
                          v1 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v1 = XXH_rotl32(v1, 13); v1 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|  67.1k|#  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|  67.1k|#define PRIME32_1   2654435761U
  ------------------
  415|  67.1k|            v2 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v2 = XXH_rotl32(v2, 13); v2 *= PRIME32_1; p+=4;
  ------------------
  |  |  190|  67.1k|#define PRIME32_2   2246822519U
  ------------------
                          v2 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v2 = XXH_rotl32(v2, 13); v2 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|  67.1k|#  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|  67.1k|#define PRIME32_1   2654435761U
  ------------------
  416|  67.1k|            v3 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v3 = XXH_rotl32(v3, 13); v3 *= PRIME32_1; p+=4;
  ------------------
  |  |  190|  67.1k|#define PRIME32_2   2246822519U
  ------------------
                          v3 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v3 = XXH_rotl32(v3, 13); v3 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|  67.1k|#  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|  67.1k|#define PRIME32_1   2654435761U
  ------------------
  417|  67.1k|            v4 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v4 = XXH_rotl32(v4, 13); v4 *= PRIME32_1; p+=4;
  ------------------
  |  |  190|  67.1k|#define PRIME32_2   2246822519U
  ------------------
                          v4 += XXH_readLE32((const U32*)p, endian) * PRIME32_2; v4 = XXH_rotl32(v4, 13); v4 *= PRIME32_1; p+=4;
  ------------------
  |  |  170|  67.1k|#  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|  67.1k|#define PRIME32_1   2654435761U
  ------------------
  418|  67.1k|        } while (p<=limit);
  ------------------
  |  Branch (418:18): [True: 66.3k, False: 771]
  ------------------
  419|       |
  420|    771|        state->v1 = v1;
  421|    771|        state->v2 = v2;
  422|    771|        state->v3 = v3;
  423|    771|        state->v4 = v4;
  424|    771|    }
  425|       |
  426|  1.88k|    if (p < bEnd)
  ------------------
  |  Branch (426:9): [True: 1.53k, False: 348]
  ------------------
  427|  1.53k|    {
  428|  1.53k|        XXH_memcpy(state->memory, p, bEnd-p);
  ------------------
  |  |   93|  1.53k|#define XXH_memcpy memcpy
  ------------------
  429|  1.53k|        state->memsize = (int)(bEnd-p);
  430|  1.53k|    }
  431|       |
  432|  1.88k|    return XXH_OK;
  433|  5.37k|}
xxhash.c:XXH_readLE32:
  227|   274k|FORCE_INLINE U32 XXH_readLE32(const U32* ptr, XXH_endianess endian) { return XXH_readLE32_align(ptr, endian, XXH_unaligned); }
xxhash.c:XXH32_digest:
  503|    393|{
  504|    393|    U32 h32 = XXH32_intermediateDigest(state_in);
  505|       |
  506|    393|    XXH_free(state_in);
  ------------------
  |  |   92|    393|#define XXH_free free
  ------------------
  507|       |
  508|    393|    return h32;
  509|    393|}
xxhash.c:XXH32_intermediateDigest:
  492|    393|{
  493|    393|    XXH_endianess endian_detected = (XXH_endianess)XXH_CPU_LITTLE_ENDIAN;
  ------------------
  |  |  202|    393|#   define XXH_CPU_LITTLE_ENDIAN   (*(const char*)(&one))
  ------------------
  494|       |
  495|    393|    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: 393, False: 0]
  ------------------
  496|    393|        return XXH32_intermediateDigest_endian(state_in, XXH_littleEndian);
  497|      0|    else
  498|      0|        return XXH32_intermediateDigest_endian(state_in, XXH_bigEndian);
  499|    393|}
xxhash.c:XXH32_intermediateDigest_endian:
  450|    393|{
  451|    393|    struct XXH_state32_t * state = (struct XXH_state32_t *) state_in;
  452|    393|    const BYTE * p = (const BYTE*)state->memory;
  453|    393|    BYTE* bEnd = (BYTE*)state->memory + state->memsize;
  454|    393|    U32 h32;
  455|       |
  456|    393|    if (state->total_len >= 16)
  ------------------
  |  Branch (456:9): [True: 48, False: 345]
  ------------------
  457|     48|    {
  458|     48|        h32 = XXH_rotl32(state->v1, 1) + XXH_rotl32(state->v2, 7) + XXH_rotl32(state->v3, 12) + XXH_rotl32(state->v4, 18);
  ------------------
  |  |  170|     48|#  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|     48|#  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|     48|#  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|     48|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
  459|     48|    }
  460|    345|    else
  461|    345|    {
  462|    345|        h32  = state->seed + PRIME32_5;
  ------------------
  |  |  193|    345|#define PRIME32_5    374761393U
  ------------------
  463|    345|    }
  464|       |
  465|    393|    h32 += (U32) state->total_len;
  466|       |
  467|    530|    while (p<=bEnd-4)
  ------------------
  |  Branch (467:12): [True: 137, False: 393]
  ------------------
  468|    137|    {
  469|    137|        h32 += XXH_readLE32((const U32*)p, endian) * PRIME32_3;
  ------------------
  |  |  191|    137|#define PRIME32_3   3266489917U
  ------------------
  470|    137|        h32  = XXH_rotl32(h32, 17) * PRIME32_4;
  ------------------
  |  |  170|    137|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                      h32  = XXH_rotl32(h32, 17) * PRIME32_4;
  ------------------
  |  |  192|    137|#define PRIME32_4    668265263U
  ------------------
  471|    137|        p+=4;
  472|    137|    }
  473|       |
  474|  1.45k|    while (p<bEnd)
  ------------------
  |  Branch (474:12): [True: 1.06k, False: 393]
  ------------------
  475|  1.06k|    {
  476|  1.06k|        h32 += (*p) * PRIME32_5;
  ------------------
  |  |  193|  1.06k|#define PRIME32_5    374761393U
  ------------------
  477|  1.06k|        h32 = XXH_rotl32(h32, 11) * PRIME32_1;
  ------------------
  |  |  170|  1.06k|#  define XXH_rotl32(x,r) ((x << r) | (x >> (32 - r)))
  ------------------
                      h32 = XXH_rotl32(h32, 11) * PRIME32_1;
  ------------------
  |  |  189|  1.06k|#define PRIME32_1   2654435761U
  ------------------
  478|  1.06k|        p++;
  479|  1.06k|    }
  480|       |
  481|    393|    h32 ^= h32 >> 15;
  482|    393|    h32 *= PRIME32_2;
  ------------------
  |  |  190|    393|#define PRIME32_2   2246822519U
  ------------------
  483|    393|    h32 ^= h32 >> 13;
  484|    393|    h32 *= PRIME32_3;
  ------------------
  |  |  191|    393|#define PRIME32_3   3266489917U
  ------------------
  485|    393|    h32 ^= h32 >> 16;
  486|       |
  487|    393|    return h32;
  488|    393|}

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

